I need to directly display the list of available networks in android phone instead of following the options Wireless&networks->Mobilenetworks->Network operators->Select manually etc, is it possible to directly display the list of available networks without following the above steps i tried the following codes..
startActivityForResult(new Intent(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS), 0);
The second thing i tried is
Intent intent = new Intent(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS);
startActivity(intent);
The third one which i tried is
Intent intent = new Intent(android.provider.Settings.ACTION_NETWORK_OPERATOR_SETTINGS);
startActivity(intent);
When i tried the third one i got the select manually and choose automatically screen but it is blinking and goes off.
What are all the other options which i can use to select the network without any options?
Related
I want to show that with something like Android.Provider.Settings, to start a new activity
Unfortunately that will not be available to you
Here is a list of settings you could possibly launch within a new intent
https://developer.xamarin.com/api/type/Android.Provider.Settings/
power settings is not one of them.
Im developing an application where in I have 2 text views and a button.
when I click the button, it should open default system contacts application and upon selecting a contact, it should display the name and number in the text fields respectively.
Now I have implemented ContactsContract and getContentResolver. But, I have seen other apps having this feature, which is quite easy because you need not create a list view and stuffs.
Now how do I start? how do I invoke default contact app and retrieve data from it.
I don't know the details about your problem, but I am pretty sure that you need to use an Implicit Intent (because the Contacts app may be different on different devices). Hopefully this page will help.
You may need to start by using this code:
Intent i = new Intent(); // Declare intent
// Start the intent
startActivity(i);
You may want to use ACTION_GET_CONTENT.
Thanks for the replies. I found out that this is what i need.
Intent localIntent = new Intent("android.intent.action.PICK",ContactsContract.Contacts.CONTENT_URI);
I have an android application that requires VPN. My users will be using Galaxy Note 3's and will be using the built in "VPN Client" (com.ipsec.vpnclient). I need to find a way to launch this application from my application, in the instance of the VPN dropping. I've already figured out a way to determine if the VPN dropped, but I still need a way to launch the application.
ANSWER:
Thanks to help from #Muthu I was able to get it working with the following method.
final Intent intent = new Intent("android.intent.action.VIEW");
intent.setComponent(new ComponentName("com.ipsec.vpnclient", "com.ipsec.vpnclient.MainActivity"));
EDIT:
To add to the confusion, I am easily able to add a shortcut to the activity (com.ipsec.vpnclient.MainActivity) via another Launcher like ADW or Nova. I also tried using com.ipsec.vpnclient.MainActivity instead of com.ipsec.vpnclient in the method below, to no avail.
Intent intent = getPackageManager().getLaunchIntentForPackage("com.ipsec.vpnclient");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
The above method works with other packages, but I can't seem to get this one to launch.
Here is the application when viewed in Android System Info.
Any ideas on how to launch this application programmatically?
You can Start any installed application by using intent. in your case like this
Intent LaunchVPN = getPackageManager().getLaunchIntentForPackage("com.ipsec.vpnclient");
startActivity( LaunchVPN );
Edit
You can open pre installed apps that can be found inside settings page by
final Intent i = new Intent("android.intent.action.VIEW");
i.setComponent(new ComponentName("com.android.settings","com.android.settings.InstalledAppDetails"));
startActivity(i);
I want to show only wi-fi settings fragment from settings. I have achieved this by using following code:
Intent i = new Intent(Settings.ACTION_SETTINGS);
i.putExtra(":android:show_fragment", "com.android.settings.wifi.WifiSettings");
i.putExtra(":android:no_headers", true);
startActivity(i);
Now I want to show only date & time fragment from settings so I changed my code to:
Intent i = new Intent(Settings.ACTION_SETTINGS);
i.putExtra(":android:show_fragment","com.android.settings.ACTION_DATE_SETTINGS");
i.putExtra(":android:no_headers", true);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
unfortunately it's not working.How can I display only specific Settings fragment from android inbuilt Settings app like this
I want to show only wi-fi settings fragment from settings. I have achieved this by using following code:
I would recommend that you use ACTION_WIFI_SETTINGS and get rid of the undocumented extras.
Now I want to show only date & time fragment from settings so I changed my code... unfortunately it's not working.
The right solution is to use ACTION_DATE_SETTINGS and get rid of the undocumented extras. Beyond that, com.android.settings.ACTION_DATE_SETTINGS is not the name of a fragment.
Evidently no_headers was silently removed from Android L and above... so we are out of luck. Re-write just select pieces of com.android.settings and block the standard settings through MDM - then pray for SYSTEM signature on your app.
This code works perfectly:
startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
But Android 3 show also another preferences. How do I can show to user only wireless settings?
UPD This code:
Intent intent=new Intent(Intent.ACTION_MAIN);
intent.setClassName("com.android.phone", "com.android.phone.Settings");
startActivity(intent);
starts a mobile settings. Is there something like that for wi-fi (turn in\off, setting ip-address etc)?
You can show only the wireless settings fragment by adding the following extras to your intent
Intent i = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
i.putExtra(":android:show_fragment", "com.android.settings.wifi.WifiSettings");
i.putExtra(":android:no_headers", true);
startActivity(i);
But Android 3 show also another preferences.
The activity you are starting is part of the Settings application, which you did not write. The Settings application can display whatever it wants. In the case of tablets, the Settings application will generally show all preferences, with the one tied to your Intent action be the currently-selected one.
How do I can show to user only wireless settings?
Write your own firmware with your own implementation of the Settings app that does what you want, and install that firmware on the user's device.
You can access only Wifi settings by using this
Intent i = new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK);
startActivity(i);
Extra options(for back and next buttons)
Intent i = new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK);
i.putExtra("extra_prefs_show_button_bar", true);
startActivity(i);