Tony Pitman | 23 Nov 07:44 2014

GPS Background Service Stops Receiving Updates

I am writing an app that needs to get gps location information in the background. I created a class derived from Service to do this. I copied the example on the Android developer site about making a background service. It uses the ServiceHandler thread to do the work.

I use location manager and set up the receiving of updates.

I have my main activity create the service using the normal way like this:

Intent intent = new Intent(_context, MyService.class);
_context.startService(intent);

Inside my service I create the location manager and start getting location updates.

This works great so far. I am doing this as a service because I want my service to receive updates even if my application is shut down. I test this by holding down the home button and killing my app.

The problem is that as soon as I kill my app the service stops getting updates. The service does not go away, as far as I can tell, it just quits receiving GPS updates.

As long as I leave the app running, even in the background, the service keeps getting the GPS updates.

Can someone tell me how to continue to get GPS updates in my service even if the app that started it gets killed?

I have some settings in my AndroidManifest.xml that might be affecting it. I have the service set up so it is not exported and has permissions. I do this because I don't want other applications to use my service. Could these be affecting it?

Here is my service entry in the xml:

    <service android:name="com.mycompany.mypackage.MyService" android:permission="com.mycompany.MY_SERVICE" android:exported="false" />

Just after that outside of the application tag I have this:

  <permission android:name="com.mycompany. MY_SERVICE"/>
  <uses-permission android:name="com.mycompany. MY_SERVICE" />


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
dashman | 23 Nov 02:40 2014
Picon

Adding an image to the right of a Preference

I've got a Preference (not a sub-class) in a settings page...

Like to add an imagebutton on the right side.

How can I do that?



--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
dashman | 22 Nov 20:27 2014
Picon

Changing the background color of an notification icon

How can I change the background color of icon notifications.

That is - the circular icon that's displayed when the
notification panel is opened.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
dashman | 22 Nov 02:10 2014
Picon

text align textview/edittext in pre api17

How can I center text in pre api 17.

Both for TextView and EditText.

In my XML for the above elements, I have

        android:textAlignment="center"

and ok it doesn't work for pre api 17 - but any reason
why it should not work automatically in api 17+ devices.

Unless the compiler removes it.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
LiTTle | 21 Nov 14:40 2014
Picon

Android Intent setSelector

Why when I use setSelector method it returns neither Camera activities nor Gallery Activities.I have the following code:

protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Intent camera= new Intent("android.media.action.IMAGE_CAPTURE"); Intent gallery = new Intent(); gallery.setAction(android.content.Intent.ACTION_VIEW); gallery.setType("image/*"); gallery.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); camera.setSelector(gallery); startActivity(camera); }

According to Android's reference API "If the selector is set, it will be used when trying to find entities that can handle the Intent, instead of the main contents of the Intent."

I thought that I will get a dialog that opens the gallery instead of camera. But, instead of these I got a dialog that returns arbitrary applications/activities, such as Call Settings, Network Settings, SIM Toolkit, etc.

When I remove the camera.setSelector(gallery); method everything works like a charm, but when I use camera.setSelector(gallery); method it returns neither Camera activities nor Gallery Activities.
Could somebody explain me why I got a dialog with these arbitrary activities instead of appropriate?

I don't want to remove the camera.setSelector(gallery); because I am trying to understand how it works!

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Markus | 21 Nov 10:30 2014
Picon

NPE in ZoomManager

My only WebView is an AdView so this has to be ad-related.

This happened on a Nexus 7 (2012) still at Android 4.2.2.

java.lang.NullPointerException
    at android.webkit.ZoomManager.setupZoomOverviewWidth(ZoomManager.java:1087)
    at android.webkit.ZoomManager.onNewPicture(ZoomManager.java:1028)
    at android.webkit.WebViewClassic.setNewPicture(WebViewClassic.java:7986)
    at android.webkit.WebViewClassic$PrivateHandler.handleMessage(WebViewClassic.java:7327)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5041)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
    at dalvik.system.NativeStart.main(Native Method)

(I am reporting this here because I could not find a category for AdMob in the issue tracker.)

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
dashman | 21 Nov 02:03 2014
Picon

how to resize layout when the keyboard is open

Which layout should I use if I want the view to be resized when the
keyboard panel is open.


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
mnkumar6 | 20 Nov 00:06 2014
Picon

Re: android-developer

Pay attention to this article

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
dashman | 19 Nov 22:52 2014
Picon

releasing beta software

I'm developing a new app and is close to beta testing.

i was wondering how folks did this.

I'd like to release it - get feedback - but not allow users to rate it until production
version is released.

that's my initial thoughts.

Any ideas or suggestions welcome.


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
crem | 19 Nov 07:52 2014
Picon

Synchronize Video Data and Sensor Data

Hi,

In my application I need to capture/record video and simultaneously log sensor data which I receive via Bluetooth (about every 10ms), to a file.
This works fine.
Now I need to "synchronize" the video data and the received sensor data, i.e. I want to link the sensor data with a ms timestamp to the captured video, so that I know (more or less exactly) what sensor data belongs to what time in the video.
In the best case I have a connection VideoFrame <--> Sensor data, but I know that this is hard to achieve since the frame rate of the video is not constant etc...

Can you give some hints how I can implement this.
Right now I am using a simple approach where I set a timestamp (t1) right after I start the recording of the video and before I start to receive sensor data, and a timestamp (t2) when the first sensor data arrived. Then  i calcluate t = t2 - t1 to know the time in the recorded video.

Are there any more advanced approaches you can think of ?

Kind regards.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nate B | 18 Nov 21:15 2014
Picon

Does WiFiDirect Service Discovery work using SERVICE_TYPE_ALL protocol type?

Does WiFiDirect Service Discovery work using SERVICE_TYPE_ALL protocol type?

I have modified the WifiDirect service discovery sample application to discover all wifiDirect services. When I run the sample I don't discover any of the WifiDirect services that I know are running in my area. The code never makes it to the onServiceAvailable() override method. Is SERVICE_TYPE_ALL feature supported? Snippet of my code:

manager.setServiceResponseListener(channel, new WifiP2pManager.ServiceResponseListener() {...});

serviceRequestForAll = WifiP2pServiceRequest.newInstance(WifiP2pServiceInfo.SERVICE_TYPE_ALL, null);

manager.addServiceRequest(channel, serviceRequestForAll, new ActionListener() { ...});

manager.discoverServices(channel, new ActionListener() { ... });

Is there some other way that I can do a WiFiDirect Service Discovery and retrieve all of the WiFiDirect Services that are being advertised?

-Nate

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gmane