How do I write a combined CheckboxPreference / PreferenceScreen? - android

I would like to have a checkbox preference that takes the user to a new (sub)preference screen if the user presses on the actual text (and not on the checkbox to the right).
Just as the control under Settings -> Wireless -> Mobile Network Settings -> Access Point Names.

Two possibilities:
1) You can get android source code and see how they do it.
2) Check options in this question.
I was trying to move to an specific DialogPreference.
I your particular case I think it's better to create and show a new Dialog.

On my Nexus One, there is no checkbox on the Access Point Names preference. It is also not on the Android 2.1 emulator, the Motorola CLIQ, the Google Ion, or the T-Mobile G1.
The pattern that you describe would seem to violate the way the preference UI is set up.
That being said, if you do find a preference built into Android that behaves the way you want, you can go find it in the open source code. Many of the preferences used by Settings are not part of the public API, but you can clone their implementation into your own project.

Related

How to add own setting into android system settings?

Hi I'm creating a simple app for change background but I want to put into system settings and hide from menu apps like Kidlogger Pro. I found this answer but it is only available with TTS options?
I want to put into system settings
Settings is its own app; you cannot modify that app.
I found this answer but it is only available with TTS options?
The Settings app offers a couple of places where it will link to some activity of yours, to offer user configuration of certain features. In general, those are tied to very specific things (e.g., configuring an input method editor) and are not general-purpose solutions.
Android 7.0+ allows you to designate an activity that is linked to from your app's screen in Settings (Apps > (your app name)). This is the closest thing that Android has to what you are seeking.
You cannot invent new categories (e.g., "Apps", "Display", "Security"), and you cannot invent new settings in existing categories. For those things, the user should launch your main activity, and either configure that stuff there, or open up some dedicated settings screen from there.
By default, you can't. You can root your phone in order to change settings application.

Is it possible to switch APN programatically in android?

I am trying to develop an app in which I need to connect to a specific APN programatically for network testing purposes.
As a user, I can do this by going to "Settings" -> "Wireless & networks" -> "Mobile Networks" (long press) -> "Access Point Names". It will even let me add a new one manually.
I want to know, is there a way an app can do that automatically? I have root permissions and everything you might need.
If anyone knows the android source, can you point me on where to look to study the behavior of this screen? I've tried to take a dive there but I'm kinda lost.
I'm answering my own question in addition to what was pointed by 7383. Hope this helps someone.
Similar to ApnEditor, I was actually looking for ApnSettings (link to cyanogen). I supposed this screen was provided by android and didn't suspect that "Settings" was actually an app.
The apps can't be used with an IDE as we usually do, it should be either compiled with makefiles like android or edit it's source so it's "ide-compatible" as suggested here
Now, to add or edit APNs you can't just put that code in any app. You need android.permission.WRITE_APN_SETTINGS which is a permission only available to system apps. The app won't be portable, but it appears this can be done using a rooted phone or a custom rom. More info here and here
I hope you are looking for this. The following links are from Android settings app source code.
add new apn
Set as default

how to permanently override android soft keys behaviour and display through

I am relatively new to android and want to create an application that permanently overrides androids basic softkey behaviour and view (for devices with soft keys).
Some functionalities I want to implement are changing the size of the softkeys window at the bottom, change its images, and possibly change its functionality.
For example, the user can set the size to of the softkey to be "large", "medium" or "small". And I can change the functionality of the back button to open say a particular application instead of going "back".
I'm basically looking for a high level answer as to how to do this, a basic direction of what I should read/study in order to be able to accomplish this. I realise this may require root access.
Please note that I want this behaviour to change not only in my application but I want the effect to exist on all applications. If this requires the application to be running atleast at the backend, that is fine.
After doing some decent amount of search, it seems I will have to make changes in the systemUI.apk, or possibly get its source code and modify it. Is this correct?
Thanks in advance.
I don't think even root is going to be enough for the type of changes you are describing. You're going to need to edit the Android source code and build your own system image.
Well you can't override system resources because they are part of the system image.
What you are looking for is called Home Application which can be developed like any other android app no need for root , you can find an example for it in your sdk samples.
Home Sample Application.
your app would be responsible to have UI components to send the user to all of the phone functionalities which includes:
Place for wegits
Place for apps listing (menue)
Access telephony functionality (call, phone history ...)
Access settings.

How do I provide "hidden" menu options in my Android app?

I'd like to add a "hidden" or "developer only" menu option to my Android app for debugging purposes — basically I just want a menu option which, when selected, copies the apps database out to a file somewhere on the users disk.
Is there an easy way to achieve this? I'd prefer something that's hidden normally but can be enabled "out in the field", but something that requires a quick and easy compilation flag would be OK too.
In my knowledge there is no developer only option to do exclusive things in Android. You can derive your own i.e. - 10 time click on specific View, specific gesture on any activity. Its up to you!

Adding App Specific Entry into the Android Settings Menu

As I know, we can add our app specific menu entries in iPhone's Settings menu. I want to know how same can be done in Android? I am developing for Android 1.6 using Eclipse Galileo. Please guide me.
Probably the closest thing to what you seek is the Account Authenticator feature. For more information see this question and look for the android:accountPreferences attribute. This allows your preference Activity to show up in the Accounts area of Settings.
Apart from that, while it's difficult to prove a negative, I've analyzed the Settings source code for Jelly Bean and I'm pretty certain this is impossible. To see for yourself, examine the onBuildHeaders() method in the Settings.java file. The headers array is maintained internally to the Settings Activity and the only flexibility seems to be the Account mechanism mentioned above.
Read the details information from here .
Nice one example here.
Use android:settingsActivity in your Manifest. It works for Livewallpaper or Input Method. You can't use it for everything or for your particular App.
You will find this good for you.Check this
this will let you know many options to customize your App
Have a Look # this linkPreferenceActivity .

Categories

Resources