android-service

How to communicate with HostApduService from an Activity

倾然丶 夕夏残阳落幕 提交于 2019-12-06 06:18:53
问题 I have asked this question here but it was marked as duplicate - however I didn't find any solution helpful mentioned in comments. Here, I am asking again with more details ... I am doing a sample app (PoC) on HCE and using HostApduService as per Android user guide. I have created two apps 1) ReaderApp - acting as card reader 2) HCEApp - emulating a card In HCEApp, I have created a class 'MyService' extending HostApduService public class MyService extends HostApduService { private int

java.lang.IllegalAccessError class ref in preverified class resolved to unexpected implementation

廉价感情. 提交于 2019-12-06 05:35:33
问题 Im getting an "java.lang.IllegalAccessError class ref in preverified class resolved to unexpected implementation" error when I push a button that starts a method in MainActivity which is supposed to start a new Activity. What can I do to fix this? This is my first attempt to make an android application, so ill need step by step instructions :) Also I havent been able to test if it works yet, but if you notice anything wrong with my AugiActivity service implementation or the local broadcast

Handler to Handler VERSUS Messenger to Messenger communication in Android

 ̄綄美尐妖づ 提交于 2019-12-06 05:30:07
问题 The question: Is it "better" (= faster and less overhead) to use Handler to Handler communication compared to using Messenger to Messenger communication in Android? The situation: Android App that has a bunch of activities and one service running (started service). Within the service a few threads are running next to the main thread of the service. Application is started, first activity starts the service, service starts, first activity forwards to second activity, second activity binds to

Not able to get SAMSUNG S4 native browser history

自作多情 提交于 2019-12-06 05:13:56
问题 I am accessing the browser history from device native browser. I use following code - Cursor cur = getContentResolver().query(Browser.BOOKMARKS_URI, new String[] { Browser.BookmarkColumns.URL }, null, null, BookmarkColumns.DATE + " DESC"); It works fine in all devices, but in SAMSUNG S4 Cursor returns null. I find that in devices where i get proper response, Browser package is 'com.android.browser' but in S4 device it is 'com.sec.android.app.sbrowser'. Is that the issue? But this is native

Why would I use a Bound Service?

心不动则不痛 提交于 2019-12-06 05:10:52
问题 For communicating between the application and a Service, why would I use a Bound service rather than sending data in the Intent: mServiceIntent = new Intent(getActivity(), RSSPullService.class); mServiceIntent.setData(Uri.parse(dataUrl)); I read that "If the service is already running, it will be called with onStartCommand() again, to deliver the new Intent, but a second copy is not created." Which means that I Could send messages in that intent to affect the service's progress, this is what

Android geofencing when app is killed

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 04:39:09
问题 My main requirement would be to have a service having its own process and trigger its own geofencing event. I'd like the user to be notified from the notification center when he enters a geofence, even if the app is killed. I read about services and this seems pretty clear to me, the Android documentation is dense so I managed to understand how to start a service with its own process, and also how it is able to communicate with the app using Messenger. Then there is this code sample from

What is the preferred way to call an Android Activity back from a Service thread

杀马特。学长 韩版系。学妹 提交于 2019-12-06 03:58:15
问题 I'm currently developing an Android application that has the following needs: A worker thread started in a Service. This thread does some processing and needs to be invoked from the main Activity and provide some asynchronous answers to the same Activity. Invoking the Service from the Activity is easy (IBinder stuff) My question is now about the proper implementation of the service callback. I was first going to add an android.os.Handler in the Activity and handle the thread's anwers in

Android Service (“startService & stopService”) and Play/Stop Button in One

不问归期 提交于 2019-12-06 03:52:35
I am developing an Android app and I need to make one button which will be a Play/Stop button for Android Service playing and stopping. Play button is for startActivity(); Stop button is for stopActivity(); How do I make this? You just need to declare a flag variable and declare body of onclick() based on flag value like this. public class ServiceActivity extends Activity { Button play; int button_status=1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); play=(Button)findViewById(R.id.button1); play

want to run and stop service with activity android

拜拜、爱过 提交于 2019-12-06 03:22:31
I am wondering if i can do this, i want to implement a service that will be called when activity launches and should run at regular intervals, and when i stop the activity by closing or pressing back the service should stop and alarm manager should not invoke service before the activity relaunches. One more thing i want to send some data on which service can operate and give results back to activity. currently i am doing like this..... class MyService extends Service{ } class MyScheduler extends BroadCastReceiver{ //Here alarm manager and pending intent is initialized to repeat after regular

Android : Do Application Login in background on boot-up

自闭症网瘾萝莉.ら 提交于 2019-12-06 03:00:46
问题 I have a VOIP Application, I need to login the application in background on device bootup. Currently the init to my application is done on UI Active( onCreate() ). I have the following things in my mind, can anyone help and clear my doubts. The service design is must to achieve this task?? Which Service Remote(AIDL) or Local Service and why? How does the UI and Service interaction happens? After UI is active who gets the Call- Backs? UI or Service ? Should i make Service as my Controller i.e