[Solved] When should I use layout_centerHorizontal=true and gravity=”center_horizonatal” and foregroundGravity=”centerHorizontal”?

When you use RelativeLayout – You should use layout_centerHorizontal,layout_centerVertical,layout_centerInParent but when you use LinearLayout , you should use gravity to align children i.e., layout_gravity and gravity. foregroundGravity is used with foreground tag. What is in foreground it will align according to foregroundGravity solved When should I use layout_centerHorizontal=true and gravity=”center_horizonatal” and foregroundGravity=”centerHorizontal”?

[Solved] How to get values from JSON Array which doesn’t follow “key” : “value” standard / JSON with no Key?

It’s pretty much the compressed format of JSONArray, I’ve seen it few times, some systems use it to lower the amount of data that gets transferred. You can try something like this (edit how you need it, as this is only a basic concept): // Let us assume your JSON is loaded in jsonString variable … Read more

[Solved] Android code without casting

Because if you want to assign a supertype to a specific subtype variable, you need to downcast it to the actual type. Much of the Android framework is from an era before Java generics was available. Is there some better way to approach this? If you only need the View from a findViewById() return, make … Read more

[Solved] Split string using substring [closed]

You can simply use split method from String class. Split file=android.txt&data=it contains android data on & to get array of “file=android.txt” and “data=it contains android data”. Then you can split each of this elements on = so file=android.txt -> file, android.txt data=it contains android data -> data, it contains android data So your code can … Read more

[Solved] EditText not work

You haven’t set the resource xml file which contains your textView.. setContentView(R.layout.yourXmlFile); solved EditText not work

[Solved] How set a notification every Saturday?

What you can do is Import this in your java file import java.util.Calendar; and copy this in whichever function you’ll use. Calendar c = Calendar.getInstance(); if(c.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY){ text1.setText(“True”);//this is optional just to show that this is working perfectly. //You can do whatever in this, it will only works when the day is saturday. } … Read more

[Solved] Blur effect on background

From https://stackoverflow.com/a/36193733: I recently came across Renderscript API. //Set the radius of the Blur. Supported range 0 < radius <= 25 private static final float BLUR_RADIUS = 25f; public Bitmap blur(Bitmap image) { if (null == image) return null; Bitmap outputBitmap = Bitmap.createBitmap(image); final RenderScript renderScript = RenderScript.create(this); Allocation tmpIn = Allocation.createFromBitmap(renderScript, image); Allocation tmpOut … Read more

[Solved] Can I develop the app which should never delete.(Android)

The proper way to do this is to require employees to install an app that provides whatever certificates/credentials necessary to access company resources. This app would use the Device Administration APIs to restrict certain policies on the device. As long as the app is enabled as a Device Administrator in the settings of the device, … Read more

[Solved] Latest available Android OS version for different devices [closed]

I Think There is no such specific site for getting such information but i usually get such information through blogs and different people who gives latest and greatest information. For example https://www.androidpit.com/android-5-0-lollipop-phone-update-news or like Motorola has this site for update check https://motorola-global-portal.custhelp.com/app/standalone/country-selector/software-upgrade i think this type of site may be with different vendors so you … Read more

[Solved] Problems using Bundle. Unable to find method?

You want to retreive data from saved instace bundle then make use of following method in your activity. @Override public void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); this.animationNumber = savedInstanceState.AnimationGetNewNumber();//your code of retriving data from bundle Log.i(“debug”, “saved data: ” + myString); } Note: there is no open() and close() method for bundle instace. solved Problems using … Read more