Zoheb Rahman | 23 May 2013 08:49
Picon

Broadcast Receiver service in a widget

I have a simple widget that does some calculations once the screen comes on and displays them and clears all the fields once the screen goes off ... i have a broadcast receiver setup in my service which listens to ACTION_SCREEN_ON and ACTION_SCREEN_OFF.

This works perfectly as long as the phone doesn't go to sleep for a long period of time or there is heavy usage of the phone - once this happens my widget process is killed (the service is still running but the process is killed) after this when the screen goes off and comes back on my widget doesn't update as the ACTION_SCREEN_ON intent is not caught by my service :(

public class CDTservice extends Service { <at> Override public void onCreate() { IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON); filter.addAction(Intent.ACTION_SCREEN_OFF); m_receiver = new ScreenBroadcastReceiver(); registerReceiver(m_receiver, filter); Log.d("Widgettool", "works"); } <at> Override public int onStartCommand(Intent intent, int flags, int startId) { start(); Toast.makeText(getBaseContext(), "SERVICE ON", Toast.LENGTH_SHORT).show(); return START_REDELIVER_INTENT; } <at> Override public void onDestroy() { stop(); unregisterReceiver(m_receiver); } public void start() { RemoteViews View = new RemoteViews(this.getPackageName(), R.layout.main); updatewidgetclass x= new updatewidgetclass(this, View, widgetId); x.start(); // does calculations and displays on widget } public void stop() { RemoteViews Viewclear = new RemoteViews(this.getPackageName(), R.layout.main); updatewidgetclass y = new updatewidgetclass(this, Viewclear, widgetId); y.stop(); // clears resources and stops } private class ScreenBroadcastReceiver extends BroadcastReceiver { <at> Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) { Log.d("ON SCREEN ON", "might hang here"); start(); } else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) { stop(); } } }

sometimes when the widget process is not claimed by the android system the widget works perfectly for days and perfectly displays the values ACTION_SCREEN_ON

the problem arises when - i check in settings>apps>running - i can see my widget name and it says 0 processes and 1 service

i assume the broadcast receive is happening on the main process and hence its not receiving it when the process gets killed.

I have a work around in place for this but would really like to fix the issue. Any helps is highly appreciated


--
--
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/groups/opt_out.
 
 
Ishan Sharma | 22 May 2013 21:42
Picon

Android native libraries: How can they be used?

Hello!


I have been reading Android architecture for some time and have some questions pertaining to the native libraries.
a) Are the native libraries used by the Application Framework? 

b) There are some libraries like media framework which provides media codecs etc. Does this mean that when I use the  Android API (core libraries) to play media files, the API interacts with the media framework in the native library.

c) Is NDK the only way I can use the native libraries?

Thanks

--
--
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/groups/opt_out.
 
 
Robert | 22 May 2013 18:32
Picon

Long Press on custom View

Long story, short.

1. I have a relative layout
2. I need to program stuff to happen when the user long presses inside the view


What I would really like is to have a delete button appear on the side that the user presses and the view goes away.
Any idea how to 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/groups/opt_out.
 
 
Latimerius | 22 May 2013 17:50
Picon

TextView's line breaking algo leaves whitespace at line beginnings (?)

Hello,

I just noticed that some lines in my multi-line TextViews (line breaks added by TextView itself) can occasionally turn out slightly indented to the right.  I'm not sure what the cause is but it does look a lot like there was a space at the beginning of the line.

Is this how TextView works, or am I doing something wrong?  It's not a huge problem but it looks a bit ugly so I'd be keen to fix it if possible.

Thank in advance!

--
--
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/groups/opt_out.
 
 
Dan Cha | 22 May 2013 17:31
Picon

Create an app to store a list of values locally on the phone/device

Ive looked around and found only a few apps kinda close to what im trying to do and few good examples on how to successfully setup SQL lite or whatever database to tie to the app to store the values on the phone/device.
 
What im trying to make is a very simple app for now that is just a long list of entries so that my daughter can reference it as she needs.
 
So for this first version i want to setup a local db that will be stored with the app on the phone/device.
Setup a simple entry form with 1 or 2 fields, submit and now you have a list.
 
Maybe give the ability to search or sort the list as it will grow into over hundred entries.
 
Can anyone offer a good site or online example of setting up such a app, not looking for someont to do it, just a sample site that shows how to link a db to your app so that values can be stored.
 
thank you

--
--
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/groups/opt_out.
 
 
Yu-Hsuan Lin | 22 May 2013 17:15
Picon
Gravatar

How to deal with the case when the index of codec dequeueOutputBuffer equals MediaCodec.INFO_TRY_AGAIN_LATER?

Hi all,


When I start to decode a video file, codec.dequeueOutputBuffer will equals MediaCodec.INFO_TRY_AGAIN_LATER (-1) at about five or more times in the beginning, should I stop queuing the input buffer and keep dequeuing the output buffer until it return non-negative value? I found that if I keep filling and queuing the next input buffer, and total output decoded frames number will less than the total sample-frame number of the video should be, but if I stop filling and just keep dequeuing the output buffer, the output frames number will more than the correct one about four, is that normal?

Also, I wrote a post about how to process the MediaRecorder's frame using these low-level Media APIs, hope you could give me any comment.

Thanks,
Yu-Hsuan

--
--
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/groups/opt_out.
 
 
Vignesh pandian | 22 May 2013 16:34
Picon

App for college website

hi 

i am new to both java and android app development .. i use eclipse to develop app... i want to make an app for my college website ... i donno where to start ... i want to fetch the data from college site and display it in this app ...   

--
--
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/groups/opt_out.
 
 
Terry | 22 May 2013 12:15
Picon

Suddenly Lots of Apps in Play Store are no longer compatible my Galaxy Tablet

Suddenly a lot of Apps in the Google Play Store no longer seem "compatible" with (e.g.) my Galaxy Tablet 10.1 (Model GT-P7500).

They were shown (as available) a few days ago, but now they are gone. I guess that something regarding device compatibility on the Play Store is BROKEN.
Amongst them are several of my own apps, which I have sold for this tablet for a long time. Suddenly they are shown as incompatible.

What has happened?

Regards, Terry

--
--
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/groups/opt_out.
 
 
user123 | 22 May 2013 11:16
Picon
Gravatar

[android-developers] Soft keyboard in webview - no “next” button to tab between input fields

My soft keyboad doesn't show this button when I focus webview input fields. Don't find anything about special settings to enable this - am I missing something? It doesn't appear in any kind of input field. Shouldn't this button appear by default?

Android version 4.0.3

--
--
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/groups/opt_out.
 
 
Ibrahim Sada | 22 May 2013 08:24
Picon

Sending and receving Xml file

Hi Friends..
  how to sends and receive xml file from android to server and vise versa
Thanks in Advance..
 
  

--
--
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/groups/opt_out.
 
 
Deepwinter | 22 May 2013 05:05
Picon

Exclude files from classpath when building with Ant

In Eclipse I have some sources that I exclude from the classpath.  When I compile with Ant, however, using 'ant release' I get build errors because these files are not being excluded.


How can I exclude files from the classpath when building with ant ?  The following line is included in .classpath file, yet the ant release script still tried to build them.

 <classpathentry excluding="org/odk/collect/android/activities/GeoPointMapActivity.java|org/odk/collect/android/widgets/GeoPointWidget.java|org/odk/collect/android/activities/GeoPointActivity.java" kind="src" path="src"/>


--
--
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/groups/opt_out.
 
 

Gmane