Brother, beginner android software is ready to be the case, the background service is responsible for receiving socket information has been running the front desk to obtain information from multiple activity have changed socket, my question now is not going to build this background service, I checked a lot of information on how is the foreground or the background process and the principle of how to write ah, what the background communication, which I know, the problem is I do not know how to build service this file ah. Like the new activity is the file-> NEw-> acitivity on it, but there is no service in the New File option this way

<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Direct to build a class extends Service.
Reply:
1 write a class extends Service, as
public class ExampleService extends Service {
}
2. AndroidManifest.xml declared Service
Read more android document suggested, refs: http://developer.android.com/
Reply:
2nd Floor positive solution.
1, direct new one Class inheritance Service
2, Statement Service
in the manifest file3, rewritten Service method.
No comments:
Post a Comment