Where to put the Settings in Android? - java

On the iPhone/iPod touch, settings could be kept in the Settings.app. Can you do this in Android? Or must your settings be in the actual application?

Can you do this in Android?
Only if you are making your own firmware. Ordinary SDK applications do not have the ability to add to the roster of device-wide settings.
Or must you settings have to be in the
actual appilcation?
Yes. You can have the same look and feel as the main Settings application, by use of PreferenceActivity and preference XML files.

Android UI guidelines state that it is preferable and recommended to use a PreferenceActivity to handle all of your apps settings.
The beauty of using a PreferenceActivity is that it will automatically save the values to your apps SharedPreferences.
Another point to consider is if all the other apps are using PAs then they come to yours and have to handle the settings differently then it makes their experience more difficult and could cause them to look elsewhere for another app.
Hope that helps, good luck with it

Related

Block some selected Menu-Points in Android for Parental Control

Is it possible to build a Android-App,
where a User can control or block some selected menu-points in the default Android Settings menu? For example Connections or Display.
Sorry, I am completley new in Android Development. I want to develop an app for Parental Control.
Thank you :-)
Iam learning Kotlin
No there's no way to do this. And remember- there isn't one settings app. Multiple OEMs write their own, or customize the base one. So even if you could do it in the AOSP version, there's no way to be sure that the others would work with it. If you need this for personal use, consider a custom ROM or replacing the settings app yourself. If this is for a store app, its just not going to work, look into device ownership and device profiles as the only real way to prevent (some) settings changes.

How do i make my android app accessible from the lockscreen?

I'm creating an app to be used during emergencies and it's important that the app can be started from the lockscreen. Is this possible(it seems to be posssible, since i see apps like this on the Google Playstore) and how would i achieve this?
You might be better off replacing the lock screen. You'll have more control and be able to provide a better user experience. Downside is you have a lot of code to write.
See this:
Creating an Android Lock Screen App.
Making a lock screen widget was possible in between android 4.4.2 until android lollipop. All other version do not have this ability. As such the best alternative would be for your app to replace the built in launcher and create its own lockscreen which you would be able to customize yourself.

Control An Application With Using Another Application

I have a question about controlling applications in Android. I want to develop an application which selects appropriate network bands for each application. I guess i have to grant superuser access but i have another problem. Is there any available java code to do that?? Is there any library or something that you know? How can i do that?
I can list apps in a listview but i want controll them with an switch. There must be connection with the applications by switch
Thanks...
It' easier then what you think. Check out android intents (here) (and here). Intents are a kind of an event bus provided by android framework that can be used to launch applications as well as activities/services/receivers

How can I know the intents needed to open system activities

I have the need to open android's default screen settings, and previously I wanted to open android's default alarm configuration activity, in the future I'm thinking I would want to open GPS settings.
How can I get the information needed to start this activities?
Where can I found the documentation about this?
What's the process for getting this information without googling for the specific activity?
Check the Common Intents listing in the documentation.
It's a pretty comprehensive listing of the actions, URI formats and MIME types for building Intents for the standard Android applications.
There is a list of Actions in the documentation listed here.
You can launch any of the sub activities in the settings app using something like:
startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));

Android: Possible to start any activity of other apps from my own?

This is an Android noob question.
I am trying to start an activity of another apk through my own application. Now I know I can launch any other application and invoke its main activity. In many cases I'm also able to start subactivities, for example display it's settings dialogue.
However with some applications, for example Facebook or Endomondo I would get a FC everytime I try to launch some specific activity of their application.
Now I suspect that this is a permission issue and that the Facebook or Endomondo devs just don't want other applications to get access to their activities. But do I have to find out which activities I can use and which ones I can't use by trial and error every single time?
Plus: Is there any way around this dilemma? Maybe on a rooted device?
Cheers for any pointers.
As you already said you can only use activities of other apps which are designed to be used by others applications. Normally the developer of the other app define a set of intents and actions their app will be able to understand and process.
Using any other app's activity is by default not possible, this is by design of Android as every app runs in it own sandboxed process (there are some exceptions where apps can share a process).
So to use another app's activities you must know the intents it listen on. Normally this can be found in the applications website or documentation or on OpenIntents a dictionary for intents.

Categories