open the Web page and change the listener in mainactivity to:Bt1.setonclicklistener (New View.onclicklistener () { @Override public void OnClick (view view) { Intent Intent = new Intent (Intent.action_view); Intent.setdata (Uri.parse ("http://www.baidu.com")); StartActivity (intent); }});The results of the operation are as follows:(click on the button, the browser opened the Baidu website)The Wang Zhi string is parsed into a URI object by the Uri.parse () method, and
This example shows how Android realizes the number of missed calls and unread messages, which is very common in Android program development and is a very useful feature that is now shared for your reference. Specifically as follows:
First, unread SMSFirst register observer, when there are new SMS or MMS will call the
In general, the Android phone does not have missed calls to the listener, if you want to achieve the processing of missed calls, you need to write their own programs to achieve. The program example described in this paper is the Android implementation to judge the phone missed
. provider/telephony/databases/telphony. DB
Call record storage location:/data/COM. Android. provider/telephony/databases/mmssms. DB
How to obtain the number of unread SMS messages:
Because the short message contains short messages and MMS 2, you need to query the message twice. SMS is short message, and MMS is MMs.
Cursor curMms = null;int count = 0;try {String sql = Mms.READ + " = 0 and " + Mms.MESSAGE_
Fifteen Android Wear applications that cannot be missed (1)
BKJIA: Android Wear applications cannot be generalized in terms of quality. In today's article, we will focus on 15 outstanding applications that can add infinite power to smart watches.
Expand your Android Wear vision
Google's
Intentservice is a background service class provided in Android, we send request commands through intent to intentservice in an external component, and then Intentservice executes commands in the command queue one after the other, and when the first command is received, Intentservice starts and starts a background thread to execute the first command, and then the command in the queue is executed sequentially, and then the service is stopped and destro
Android system Xiaomi/Samsung/Sony app startup icon unread message count (BadgeNumber) Dynamic reminder, androidbadgenumber
On Android phones, for example, QQ, when there is unread message, we can see that there is a red circle in the upper right corner of the app startup icon, and the number of unread messages is dynamically displayed in the circle, as shown in
People who use touch-screen mobile phones all have this kind of mistake: When the dial is wrong, the wrong person is called out step by step. At this time, they are busy hanging up. So for the above scenario design, I made such a small exercise, that is to say, when you want to call, first pop up a dialog box, confirm to call XXX, click confirm to cancel the call
My Android advanced tour ------> four call transfer scenarios, android advanced
The operator provides the following call transfer scenarios:
1. Always call transfer: No matter what status the current mobile phone is in, incoming calls will be transferred to the specified ph
Knowledge points:
Android does not open an API for ending a call. to end a call, you must use AIDL to communicate with the telephone management service and call the API in the service to end the call. The method is as follows:1> copy the following files from the
(a) Foreword
Android defaults to provide contact backup to SD card functions (code in the Com.android.vcard package), we can export the contact to a. vcf file exists in SD card; If you change the phone, we can import the contact from the SD card file. So, can we do the same thing with the phone records? The answer is YES!
(ii) export of call recordsSince it is a backup
Mobile phone call record is saved in the database, location:/data/data/com.android.providers.contacts/databases/calllog.db, table name: CallsThere is a Type field in this table, and the property value is a constant value:
Call: CallLog.Calls.INCOMING_TYPE (constant value: 1)
Dialed: CallLog.Calls.OUTGOING_TYPE (constant value: 2)
Missed: CallLog.
) "Vnd.android.cursor.item/organization": CompanyDATA.DATA15: This field is the head of the query;Realization idea: According to the contacts._id found in the previous table to the data table query, the returned DATA.DATA1 is all the contact information,According to Data.mimetype data to go with mimetypes this table to match, to determine the specific return of the information is (name, phone ....) )Remember to read call logs to configure permissions:
Android call logs are implemented in static class Android.provider.CallLog.Calls.Permission to read and write the call log first?Readcursor cursor = context.getcontentresolver (). Query (Calllog.calls.content_uri,new string[] {CallLog.Calls.NUMBER, Calllog.calls.cached_name,calllog.calls.type,calllog.calls.date,calllog.calls.duration}, Null,null, CallLog.Calls.DE
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.