Is it possible to switch APN programatically in android? - 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

Related

Android SoftKeyboard shortcut

I have a question. I wanted to develop an app that would add a shortcut to the keyboard (Samsung SoftKeyboard).
The shortcut should be accessible via the dots at the top right (see attachment).
I would like to add a circle ("floating") over my app, as shown in the picture on the right.
Something specific should then be carried out via this circle (but that's not the point yet).
I've done a little research, but don't really know what to look for.
I hope you can help me.
thanks in advance
Example
afaik there is no such possibility to add anything in there. it's another app with own custom settings and options, you can't edit such or change in any way. your last chance is possibility of published API/some communication way for that app, which would allow to add such actions, but I very doubt Samsung made such API for own keyboard app and allowed ANY 3rd-party app to mess in their software... (btw. that would be very insecure for user)

Lock Android Device to Run Only One App

I was wondering if anyone had a relatively simple solution for us.
We created an app to be used by our clients on android devices that we give them.
We would like the client to only be able to use our app and have limited access to everything else (i.e. settings, email etc.) What is the best way to achieve this without using 3rd party apps.
Thank you in advance!
This may not help but the L preview has a task locking feature included that may be of some insight, I'm not aware of how it functions as yet
Task locking
The L Developer Preview introduces a new task locking API that lets you temporarily restrict users from leaving your app or being interrupted by notifications. This could be used, for example, if you are developing an education app to support high stakes assessment requirements on Android. Once your app activates this mode, users will not be able to see notifications, access other apps, or return to the Home screen, until your app exits the mode.
http://developer.android.com/preview/api-overview.html
Hope this helped
Suppress the Title Bar & Make Your App a Launcher
Root Your Tablet
Modify System Files and Settings to hide the soft keys
On the next link you can find the complete solution for the Nexus 7 (2012)
http://thebitplague.wordpress.com/2013/04/05/kiosk-mode-on-the-nexus-7/
simple Answer is:
Lock Install button with modify system settings.
Create your own customized-ROM and apply your requirement to that ROM.
more info, visit XDADavelopers

Change layout of the built-in application

Is it possible to change the layout of the built-in application of the Android?
I have Samsung S Duos and I want to change layout of some application(dialer, SMS messenger and phone book(contacts) are not so user-friendly for dual SIM cards)
Is it possible to make buttons of this applications bigger or smaller or to add a new option (sub menu)?
If yes, is there easier way than rewriting and compiling whole Android source? Or maybe there is an option to change the phone book(contacts) and reinstall it as a new application?
Any help is appreciated
Is it possible to make buttons of this applications bigger or smaller or to add a new option (sub menu)?
Somebody with sufficient experience could do this, yes.
is there easier way than rewriting and compiling whole Android source?
No. And even that is insufficient, as the result will not run on your phone without the requisite drivers.
Instead, find a ROM mod that can run on your phone, then start with that ROM mod's source and make your changes.
Or maybe there is an option to change the phone book(contacts) and reinstall it as a new application?
It is conceivable, though unlikely, that the maintainers of your chosen ROM mod have arranged for some of these apps to be buildable as SDK apps. Most likely, this is not an option for you.
I guess you can't just edit the application without having the source and recompiling it. You can modify your build.prop to edit your screen density value. If you change this, you will have more (Or less) buttons etc. on your screen. But editing this file is very dangerous and I don't recommend it.
Ok first off your the one that needs help so you dont have to be rude, secondly the source code is not going to be in your phone because its going to be a binary file. And unless you know how to convert a binary conputer kanguage fike to source code then your sol. This website is not a place where we write code for you. If you have no code to display then theres not much we can help with. And the only people that have the actual source code are going to be the developers that made the application which are the developers that made your phone. In this case shoot an email to your phones company which is samsung and see if they will release you an open source code that you can go off of. That should answer your question on how to get the source code. If they dont give it to you then you cant get it.

Android search settings for different user profiles

Does anyone know that is it possible to have a multiple user profiles in an Android device. If it is possible then will it be possible also to separate the search history or search settings for different user profiles? We are working on a custom Android device and trying to have different user profiles there. Although my job is not to find how to create multiple users but I got the task to find out how to differ the search settings for different users on the same device. I have checked almost everything in Android developer guide for searches and cant find anything like that. Any answers or clues or suggestions will be highly appreciated.
You cannot have multiple profiles on standard Android devices. You will have to create a highly customized ROM for this. I wish you fellows luck.
I guess since you are saying that you are building a custom android device you are building the
source from Android Open Source Project(AOSP). Since you have access to the entire source code, you
could set the system property 'fw.max_users=4' or any number you want greater than 1 to enable
multiple user profiles on the device. You could set this value in your device's system.prop file.
This feature probably started out in Android 4.2
But I don't there is currently any way to separate search history and search settings.
I see that this question was asked a long time ago, but it may help any new users who have the same
question.

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