, call StartService () to communicate,At the same time, let intent carry a set of key-value pairs of data to match the service side.Activity: private void Startmusicservice (String option,string path) {Intent Intentservice = new Intent (Mainactivity.this, Musicservice.class); Intentservice.putextra ("option", option); Intentservice.putextra ("Messenger", new Messenger (handler));
ServiceConnection will be leaked. this.unbindService(mSc); }}
Note that you need to unbind the service in onstop; otherwise, memory leakage may occur.
2. Let's look at the problem of communication with the service in another process (cross-process communication !).
How can I run servcie in another process? Configure attributes in manifest.
Android: Process = ": Remote" indicates that the service runs in different processes of the same application.
The client can use
MSN Messenger Service Set instant messaging, Internet telephony, automatic check mail and other functions in one, very popular with the "Network Worm" favorite, but you know, the MSN Messenger Service can not only log on to MSN Messenger Server, You can also log on to the Exchange server in your local area network! You can enjoy the power of the MSN
(mBound) {unbindService (mConnection); mBound = false;}/** the user clicks the button, read the random number */public void onButtonClick (View v) {if (mBound) {// use the Service object to read the random number int num = mService. getRandomNumber (); Toast. makeText (this, "number:" + num, Toast. LENGTH_SHORT ). show () ;}/ ** fixed ServiceConnection, used to bind */private ServiceConnection mConnection = new ServiceConnection () {@ Override public void onServiceConnected (ComponentName class
) {unbindService (mConnection); mBound = false;}/** the user clicks the button, read the random number */public void onButtonClick (View v) {if (mBound) {// use the Service object to read the random number int num = mService. getRandomNumber (); Toast. makeText (this, "number:" + num, Toast. LENGTH_SHORT ). show () ;}/ ** fixed ServiceConnection, used to bind */private ServiceConnection mConnection = new ServiceConnection () {@ Override public void onServiceConnected (ComponentName className, IB
I saw some dating websites such as facebook, campus, and linkedin over the past two days. When they invite netizens, they can directly import the homtmail friends list.
Today, I also studied how to implement the basic functions. The front-end can call AJAX to obtain the data.
I can directly output these friends' email addresses and names.
/// Create a friend name and email address
Public class FriendInfo{Private string username;Private string email;Public FriendInfo (string username, string emai
These days, constantly have not too familiar with the computer friend asked me: "is not MSN Chat content is very easy to peek AH?" "They are worried about the problem mainly from the MSN sniffer such as" peeping "tool. Not only that, if you do not know enough about the local area network, think that only open "Network Neighborhood" access to other people's shared folders, then there will be more risk!
LAN, you still dare to chat?!
Lan the most famous eavesdropping tool, is the MSN sniffer, a s
The following content is related to the operating system version and does not guarantee that all windows instances can run.
Winver checks the Windows versionWmimgmt. msc open windows management architecture (Wmi)Wupdmgr Windows UpdateProgram Wscript Windows Script Host settingsWrite BoardWinmsd system informationWiaacmgr scanner and camera wizardWinchat XP built-in LAN chatMem.exe displays memory usageMsconfig.exe System Configuration UtilityMplayer2 simple Widnows Media PlayerMspaint graphic
Here, I will leave your MSN... for me, the biggest improvement of msn8.0 is to add offline messages. Other questions are not tested... Main functions of msn8.0: What is it Windows Live Messenger will be the next generation of MSN Messenger. It still includes all the features of your favorite messenger-your contact list, illustration, and instant contact with y
Video Address: http://study.163.com/course/courseLearn.htm?courseId=712011#/learn/video?lessonId=877122courseId= 712011First, the question:1, how to do an app different process communication?2. Multiple app communication (different apps)3. Inject event run script and invoke hidden APISecond app different process communication:Knowledge Points:1, Intent, binder2. Service, Activity3, Handler, view4. Messenger, Message, Serviceconnection, IPC (Internal p
Nowadays, DOS has become a thing of the antique class and has been completely abandoned by the Windows operating system. The existence of real-mode DoS cannot be found in the latest Win2000/XP, instead of the command line mode. Is dos useless at all? Do I have to understand the doscommand? In fact, many command line commands are provided in the 98/2000/XP system. These commands are very similar to those in DOS. If we use these commands well, we can get twice the result with half the effort in ou
Appwiz. Cpl add or delete programs
Winver checks the Windows version
Wmimgmt. msc open windows management architecture (Wmi)
Wupdmgr Windows Update Program
Wscript Windows Script Host settings
Write Board
Winmsd system information
Wiaacmgr scanner and camera wizard
Winchat XP built-in LAN chat
Mem.exe displays memory usage
Msconfig.exe System Configuration Utility
Mplayer2 simple Widnows Media Player
Mspaint graphic Board
Mstsc Remote Desktop Connection
Mplayer2 Media Player
Magnify magnifier U
when you need to interact with the service;You must override the Onbind () method to return IBinder to communicate with other components. Get the IBinder object in another componentThere is a sense of client-server that can have multiple clients communicating with the serverClient components, you must create a serviceconnection to listen to the connection to the service;There can be multiple clients connecting to the service, but the service's onbind is executed only once, so the same IBinder o
Boring landing Google Reader read the article, suddenly see Cathayan said "im name or to be easy to recognize." Lenovo to the recent colleagues in MSN Messenger search for the name of the suffering operation, I think or write a blog to say that I feel good.
MSN Messenger is still very useful, if willing to spend some time to set up the words, um. Instant Messaging should be a productivity boost, not a wast
list, but we have to have them with each other. NET account and has already installed Messenger as a prerequisite, users just click the MSN main window click "I Want" under the "Send instant message" option, in the pop-up dialog box, select the "Other" tab. Next, you enter the full account in the email address bar and click OK to send it. If you can't find the "I want" button in your MSN main window, you can click "Tools" and select "Show Actions Pan
Use messenger
The preceding method can only be used in the same process. If you want to communicate with the service of another process, you can use messenger.
In fact, there is also aidl in the way of implementing IPC (inter-process communication), but it is recommended to use messenger, which has two advantages:
1. using
Call MSN 6.2 API functions in VB
The reason for understanding this content is that a friend asked me to read a section about the MSN development program in the morning and now it cannot be run. I opened the project and found that it was written for 4.7, his computer installed 6, 2, because I also used 6.2, so I checked it in VB and found that the messenger Type Library is missing. However, with the addition of the
ReviewIn the previous article we introduced the background of Bluetooth Le and explained what we will be developing in this series of articles, but there is no actual code. We will correct this in this article, and we will ensure that the Bluetooth operation is decoupled from the UI by defining the Service/activity architecture.Service and Activity CommunicationBefore we go on, I should point out that we are not going to explore the details of ble in this article. At first, we were going to crea
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.