You can use wifimanager and wifiinfo to obtain the current Wi-Fi connection information.
Wifimanager = (wifimanager) getsystemservice (wifi_service); wifiinfo = wifimanager. getconnectioninfo (); log. D ("wifiinfo", wifiinfo. tostring (); log. D ("SSID", wifiinfo. getssid ());
Remember to add a license to the manifest File
Uses-Permission android:Name="Android.
, talk about, I know this you will ^_^Fourth step: Install git and curl in the terminal form, tap the following command,sudo apt-get install Git-core curlsuch as the first line, the following carriage return, the installation is complete.Fifth step: Install the repo scriptCurl Http://android.git.kernel.org/repo >~/repoSixth step: Give repo permission to run With the picture or the one above, look carefull
First of all, if you are viewing the Android database file on a real machine, you have to get root permission, so there is no more talking about how to get it. May be the cause of the phone, I get access to the following mobile phone:Although the permissions in the data dire
contact to get the number column// We don't need a selection or sort order (there's only one result for the given URI)// Caution: the query () method shocould be called from a separate thread to avoid blocking// Your app's UI thread. (For simplicity of the sample, this code doesn't do that .)// Consider usingCursorLoaderTo perform the query.Cursor cursor = getcontentresolver (). Query (contacturi, projection, null );Cursor. movetofirst ();// Retrieve
.txt"); FileOutputStream Fos=Newfileoutputstream (file); Fos.write (Content.getbytes ()); Fos.flush (); Fos.close (); } Catch(Exception e) {e.printstacktrace (); } }In android2.1 and previous versions, its sdcard directory became/mnt/sdcard in the root directory, 2.2, and 2.3 after its sdcard directory, as well as some manufacturers ' custom Android systems, It may also change the name of the SDcard. If you still use ab
="android.permission.INTERNET" /> uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />3, in the activity of the application3.1 Instantiation of Imageloader protected ImageLoader imageLoader = ImageLoader.getInstance();3.2 Configuring option options = new DisplayImageOptions.Builder() .showImageOnLoading(R.drawable.dog)//加载图片时显示的默认图片 .showImageForEmptyUri(R.drawable.girl)//访问地址无内容时显示的图片 .sho
This article describes the Android programming acquisition system hidden service implementation of the lock screen method. Share to everyone for your reference, specific as follows:
realization Principle: When press the lock screen key, will emit a broadcast, when the interface receives a broadcast can realize the lock frequency. We can invoke the Locknow method in the Idevicepolicymanager service to send a broadcast to implement the lock screen.
Id
Note: This article is translated from Google's official Android developers training document, translator technology generally, because of the love of Android and produced the idea of translation, purely personal interests and interests.Original link: http://developer.android.com/training/contacts-provider/retrieve-details.htmlThis lesson will show you how to get
be done in the oncreate () phase of the activity.After successfully registering a periodic coordinate update, we can get the current coordinates at any time by the following method.Java code
Location location = locationmanager.getlastknownlocation (Locationmanager.gps_provider);
Double latitude = location.getlatitude (); //Longitude
Double longitude = location.getlongitude (); //Latitude
Double altitude = location.getaltitude ();
method, and no sizeof () is used to calculate the memory consumption. I mainly rewrite LinkedHashMap, after talking about the LinkHashMap source code, I also read the source code parsing written by others)
Summary:
The company attaches importance to the basics and Has algorithms for every interview. Although it is not difficult, it is estimated that it is just a look at the code writing specifications.
Android posts ask more questions about
1, first we have to write a radio receiver, when our mobile phone received a text message, the system will automatically send a broadcast, we just need to receive this broadcast can be2, in the broadcast, we rewrite the OnReceive () method, through the intent written inside the bundle can get the text message content,3, the manifest file inside we must add the permission, otherwise cannot receive.4, in orde
beforehandFinal file File = new file (path);if (!file.exists ()) {throw new IllegalArgumentException ("Uri file does not exist");If an exception is thrown here, the preview checks to an invalid image at this point, the developer put the following continue release and then throw the exception code comments can beContinue}This code is also made to judge but has not yet tried to be effective on this bug if you know this bug has a better solution to the Danale Welcome to the message is appreciatedT
way. The third way is recommended.It is worth mentioning that the small project needs to add a permission value in the configuration file:uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>Error without this permission!This small project is very practical, most of the apps have access to the user's avatar, the user's avatar settings, so we
This article illustrates how Android gets the strength of the currently connected WiFi signal, and is a very common and important skill in Android development. Share for everyone to use for reference. The specific methods are as follows:
1. Get WiFi information that is currently connected
Wifimanager Wifi_service = (wifimanager) getsystemservice (wifi_se
An example of this article describes the Android phone to get root permissions and to achieve shutdown restart function is a very common in the Android design of the important function. We are now sharing it with you for your reference in the development of Android programs.
The specific function code is as follows:
more and more Android apps are now using their mobile phone numbers to sign up and get their phone verification code to complete their registration. There are many applications to provide phone address Book backup function, get your permission to save your phone number in the address book to the server, you want to be
Get started with Android, record the problems encountered in learning and some personal summaries.Contact database path is:/data/data/com.android.providers.contacts/database/contacts2.dbPermissions issues: Android 6.0 or more just write permissions in XML is not enough, the code also needs to write.if (Build.VERSION.SDK_INT >= build.version_codes. M checkselfper
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.