android – Google Play Services version 5.2.08 too recent for my device-ThrowExceptions

Exception or error: I use this method to check the availability of play services: private boolean checkPlayServices() { int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this); if (status != ConnectionResult.SUCCESS) { if (GooglePlayServicesUtil.isUserRecoverableError(status)) { showErrorDialog(status); } else { Toast.makeText(this, “This device is not supported.”, Toast.LENGTH_LONG).show(); finish(); } return false; } return true; } status is now set to 2 …

android – Can I use greenrobot EventBus for Communication between Activity and Service?-ThrowExceptions

Exception or error: Can I use the EventBus library as an Activity, regarding Service communication? I tried this in my app as follows: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EventBus.getDefault().register(this); setContentView(R.layout.activity_music_player); Intent serviceIntent=new Intent(MusicPlayerActivityTest.this,MusicPlayerServiceTest.class); startService(serviceIntent); EventBus.getDefault().post(new SetSongList(songArraList, 0)); } @Override protected void onDestroy() { EventBus.getDefault().unregister(this); super.onDestroy(); } and in my service onEvent called. How …

android – Utilize both Play Services and AdMob SDK-ThrowExceptions

Exception or error: As MH. pointed out in this question, one no longer needs to include GoogleAdMobAdsSdk-x.x.x.jar in their Android project if they include Google Play Services (see the migration guide). However, I want to, and I’m having trouble. The problem: the google-play-services_lib project includes a definition for com.google.ads.AdRequest that is deprecated, and has a …

serviceconnection – Do I need to call both unbindService and stopService for Android services?-ThrowExceptions

Exception or error: In my Android app, I call both startService and bindService: Intent intent = new Intent(this, MyService.class); ServiceConnection conn = new ServiceConnection() { … } startService(intent) bindService(intent, conn, BIND_AUTO_CREATE); Later, I attempt to both unbindService andstopService`: unbindService(conn); stopService(intent); However, I get an exception on the call to unbindService. If I remove this call, …

android – How to cancel a foreground service from using the notification (swipe dismiss) or clear all notifications?-ThrowExceptions

Exception or error: I’m currently creating a foreground service with a notification that appears in the notification bar when the service starts. If the service stops, the notification dismisses. My question is, is there a way to stop the service when “clear all notifications” or a dismiss of the notification (swipe) occurs? Updated to include …