[android-developers] The number of used satellites for the calculation of GPS fix
how can i get the number of satellites, i used in my GPS localisation? -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: how to add new resource in Preference
hi, when i want to use shared preference. i used this: http://androidorange.blogspot.com/2011/06/android-sharedpreferences.html?spref=bl Maybe it help you. On Sep 9, 10:22 am, Ellen ellen...@hotmail.com wrote: I want to add some new resources in Preference which like title and summary, it seems that need to add the related id in attrs.xml and public.xml to announce it. When I tried to give an ID for the new resource, it report the id is out of range, so, seems the number couldn't extended. is it possible to enlarge this id range? -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: The number of used satellites for the calculation of GPS fix
thanks this give me caracteristic of a satellite. but i want first to know the number of satellites my android used to get a GPS fix? On Sep 9, 1:16 pm, Mark Murphy mmur...@commonsware.com wrote: On Fri, Sep 9, 2011 at 5:13 AM, souissi haythem haythe...@gmail.com wrote: how can i get the number of satellites, i used in my GPS localisation? http://developer.android.com/reference/android/location/GpsSatellite -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android Training...At Your Office:http://commonsware.com/training -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: The number of used satellites for the calculation of GPS fix
i have tried: gps_loc.getExtras().getInt(satellites); //gps_loc is the location, i got But it doesn't work and my programme was blocked!!! On Sep 9, 1:54 pm, Mark Murphy mmur...@commonsware.com wrote: On Fri, Sep 9, 2011 at 7:38 AM, souissi haythem haythe...@gmail.com wrote: thanks this give me caracteristic of a satellite. but i want first to know the number of satellites my android used to get a GPS fix? Ah, sorry. getExtras() on the Location object should have a satellites value (int, I guess) that is the number of satellites used to derive the fix. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android Training...At Your Office:http://commonsware.com/training -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] hexadecimal encoded TP-UD SMS
Hi, from my platform, i send an hexadecimal SMS to my Android. Why i can't detect this SMS? When i send a binary SMS, i can detect it with the broadcast SMS receiver. But the same broadcat doesn't work with hexadecimal SMS. There is my broadcast: public class SMSReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { //---get the SMS message passed in--- Bundle bundle = intent.getExtras(); SmsMessage[] msgs = null; String str = ; if (bundle != null) { //---retrieve the SMS message received--- Object[] pdus = (Object[]) bundle.get(pdus); msgs = new SmsMessage[pdus.length]; for (int i=0; imsgs.length; i++){ msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]); str += SMS from + msgs[i].getOriginatingAddress(); str += :; str += msgs[i].getMessageBody().toString(); str += \n; } //---display the new SMS message--- Toast.makeText(context, str, Toast.LENGTH_SHORT).show(); } } } I use createFromPdu((byte[])pdus[i]) method, it only take byte as parameter. Is there another method to detect hexadecimal SMS??? Thanks for your time. -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: hexadecimal encoded TP-UD SMS
the only think that i know, that it is two different forms. I got a problem when i want to communicate (by SMS) with a small programme (which was developped years ago and that i don't have source code). this programme send an hexadecimal SMS to my phone. but my phone did not notify anythink. -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re : Error starting app. Must force a close
http://groups.google.com/group/android-developers/browse_thread/thread/bd2fb3b57f5a9bc9/5fd98e43a85c6517?lnk=raot i hope this will help 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Android Accelerometer Sensor
Hi, I am trying to work with Accelerometer Sensor. So i tried this example: http://blog.androgames.net/85/android-accelerometer-tutorial/ It work perfectly. But when i change AccelerometerManager activity to a service, it doesn't work and i got an error. //this is the activity that i want change public class Accelerometer extends Activity implements AccelerometerListener { private static Context CONTEXT; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CONTEXT = this; } protected void onResume() { super.onResume(); if (AccelerometerManager.isSupported()) { AccelerometerManager.startListening(this); } } protected void onDestroy() { super.onDestroy(); if (AccelerometerManager.isListening()) { AccelerometerManager.stopListening(); } } public static Context getContext() { return CONTEXT; } /** * onShake callback */ public void onShake(float force) { Toast.makeText(this, Phone shaked : + force, 1000).show(); } /** * onAccelerationChanged callback */ public void onAccelerationChanged(float x, float y, float z) { ((TextView) findViewById(R.id.x)).setText(String.valueOf(x)); ((TextView) findViewById(R.id.y)).setText(String.valueOf(y)); ((TextView) findViewById(R.id.z)).setText(String.valueOf(z)); } } //this is my service when i change it, my error is hir public class Accelerometer extends Service implements AccelerometerListener{ private static Context CONTEXT; @Override public IBinder onBind(Intent intent) { // TODO Put your code here return null; } @Override public void onCreate() { System.out.println(”start listening”); // if (AccelerometerManager.isSupported()) { AccelerometerManager.startListening(this); // } } @Override public void onDestroy() { System.out.println(”start listening”); // if (AccelerometerManager.isListening()) { AccelerometerManager.stopListening(); // } } public static Context getContext() { return CONTEXT; } /** * onShake callback */ public void onShake(float force) { Toast.makeText(this, “Phone shaked niktilha omha ya 3ammi el7ag: ” + force, 1000).show(); } /** * onAccelerationChanged callback */ public void onAccelerationChanged(float x, float y, float z) { System.out.println(”x = “+x+” y = “+y+” z = “+z); } } Thanks for help. -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] register and unregister listner???
Hi, I want my application to manipulate accelerometer sensor. so i register the sensor from activiy1: sensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_GAME); now, i am in activity2 and i want to unregister the same sensor that i registred: solution1: sensorManager.unregisterListener(this); it doesn't work ! solution2: i open again my activity1 and unregister sensor. it doesn't work.android make a new activity1 for me and i don't get my activity1 in foreground Thank -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] em...@android.com
can i have an émail : myn...@android.com ??? -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: em...@android.com
Why, it's only for person who work in android sociaty??? On Jul 1, 2:50 pm, Jorge Luis jorgelferr...@gmail.com wrote: no. 2011/7/1 souissi haythem haythe...@gmail.com can i have an émail : myn...@android.com ??? -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Jorge Luis Ferrari Cé Desenvolvedor / Web Designer Siga @JLFerrari -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: em...@android.com
are you sure??? On Jul 1, 3:04 pm, Jorge Luis jorgelferr...@gmail.com wrote: yes. 2011/7/1 souissi haythem haythe...@gmail.com Why, it's only for person who work in android sociaty??? On Jul 1, 2:50 pm, Jorge Luis jorgelferr...@gmail.com wrote: no. 2011/7/1 souissi haythem haythe...@gmail.com can i have an émail : myn...@android.com ??? -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Jorge Luis Ferrari Cé Desenvolvedor / Web Designer Siga @JLFerrari -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Jorge Luis Ferrari Cé Desenvolvedor / Web Designer Siga @JLFerrari -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: update spinner
I try this but it still didn't work. did you have an example of using two spinners. thanks On Jun 24, 1:19 am, TreKing treking...@gmail.com wrote: On Thu, Jun 23, 2011 at 6:03 PM, Indicator Veritatis mej1...@yahoo.comwrote: Well now, TreKing, I have read the documentation on both, and I still don't consider the answer obvious. OP asked How can i update my spinner with the last value i have choise, using shared preference?? Taking the question at face value, this implies to me A) getting and setting the value from / to a Spinner, which you can do with obviously named methods and B) getting and setting this value from / to a SharedPreference, which you can also do with equally obviously named methods. The details of a full working scenario are, of course, a bit more involved but given the question, the answer is readily obtained by a good perusal of the docs, IMHO. Not even after also noticing from the Spinner Tutorial that he should use an Adapter too, most likely SpinnerAdapter. Even what seems 'obvious' after reading all that just looks and feels wrong, object disoriented. OK - seems beyond the scope of the question posed though. Especially since the Android word 'Adapter' is not very closely related to the Adapter Pattern its name so strongly suggests. An Android Adapter provides the interface by which a user-defined object can be used and represented in Android's system. It adapts your object to Android's way of displaying data. Seems aptly named to me. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] update spinner
Hi, How can i update my spinner with the last value i have choise, using shared preference?? 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: value of timer
i found the answer hir: http://stackoverflow.com/questions/5369682/android-get-current-time-and-date Calendar c = Calendar.getInstance(); int seconds = c.get(Calendar.SECOND) it's all what i need Thanks Mark, it's true that i can use timer . Indicator , you don't need to know what i want to do because it will take so much time. Thanks for all -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] value of timer
Hi, I have create a new timer: Timer t=new Timer(); than i lunch my timer: t.schedule(new TimerTask() { public void run() { } },1000); how can i have the value of my timer t, so i can do tests?? (if t== 20seconde faire un tel truc) 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: value of timer
i don't understand, how can i do this? On Jun 14, 1:55 pm, Mark Murphy mmur...@commonsware.com wrote: On Tue, Jun 14, 2011 at 7:32 AM, souissi haythem haythe...@gmail.com wrote: Hi, I have create a new timer: Timer t=new Timer(); than i lunch my timer: t.schedule(new TimerTask() { public void run() { } },1000); how can i have the value of my timer t You can't. There are no methods for that on Timer or TimerTask. General Java programming questions are probably better directed at StackOverflow (with the 'java' and 'android' tags). -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android Training in NYC:http://marakana.com/training/android/ -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: value of timer
ok, can i get the time of the system directly. I have tried getTime(), so i got the error: The method getTime() is undefined for the type SMSReceiver. please did some one know what's rong hir??? On Jun 14, 2:43 pm, souissi haythem haythe...@gmail.com wrote: i don't understand, how can i do this? On Jun 14, 1:55 pm, Mark Murphy mmur...@commonsware.com wrote: On Tue, Jun 14, 2011 at 7:32 AM, souissi haythem haythe...@gmail.com wrote: Hi, I have create a new timer: Timer t=new Timer(); than i lunch my timer: t.schedule(new TimerTask() { public void run() { } },1000); how can i have the value of my timer t You can't. There are no methods for that on Timer or TimerTask. General Java programming questions are probably better directed at StackOverflow (with the 'java' and 'android' tags). -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android Training in NYC:http://marakana.com/training/android/ -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: value of timer
Unfortunately, I can see only one thing wrong here: you do not know Java well enough to develop Android apps. Maybe it's true How do I know? The question you are asking makes no sense: why WOULD there be a getTime() method for SMSReceiver? Did you define it yourself? There is certainly none in BroadcastReceiver. Nor is that class defined in any of Android's sample code (included with the SDK). I wan't to get the time of reception of any msg, so after i can organise things in my programm. there is the method in android: http://developer.android.com/reference/java/util/Date.html#getTime%28%29 You can't expect an yreal hlep for the group if you ask about a class you defined, but do not give us the definition. So that brings me to one more problem I see: you really need to studyhttp://www.catb.org/~esr/faqs/smart-questions.htmlbefore posting question here or to any other Internet forum. ok, thanks for your advice, i will read 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] can i start an activity from a broadcast?
Hi, Please i wanna start my activity, when i my broadcast is received. I found this in android.com: Note that, although the Intent class is used for sending and receiving these broadcasts, the Intent broadcast mechanism here is completely separate from Intents that are used to start Activities with Context.startActivity(). There is no way for a BroadcastReceiver to see or capture Intents used with startActivity(); likewise, when you broadcast an Intent, you will never find or start an Activity. These two operations are semantically very different: starting an Activity with an Intent is a foreground operation that modifies what the user is currently interacting with; broadcasting an Intent is a background operation that the user is not normally aware of. I don't understand this? did they mean that i can't lunch an activity from broadcast??? 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] BROADCAST ACTION_SCREEN_OFF or ACTION_SCREEN_ON
Hi i need to use the two broadcast in the title. The problem is that to use it, we require API version8 (android 2.2). And my program need to work in Android 2.1 I wanna know if there is other tools in android 2.1 that it can do the work of detecting screen on or off. I have found isScreenOn() which test if the screen is on or off, but it is not why i need. I need to detect automatic when the screen is on so i lunch my service . 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: BROADCAST ACTION_SCREEN_OFF or ACTION_SCREEN_ON
so why i got this message?? [2011-06-09 14:06:19 - Screen] ERROR: Application requires API version 8. Device API version is 7 (Android 2.1-update1). [2011-06-09 14:06:19 - Screen] Launch canceled! And when i try this in an AVD 2.2, it work?? On Jun 9, 1:34 pm, Kostya Vasilyev kmans...@gmail.com wrote: According to the documentation, both are since API level 1. -- Kostya 2011/6/9 souissi haythem haythe...@gmail.com Hi i need to use the two broadcast in the title. The problem is that to use it, we require API version8 (android 2.2). And my program need to work in Android 2.1 I wanna know if there is other tools in android 2.1 that it can do the work of detecting screen on or off. I have found isScreenOn() which test if the screen is on or off, but it is not why i need. I need to detect automatic when the screen is on so i lunch my service . 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@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 post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: BROADCAST ACTION_SCREEN_OFF or ACTION_SCREEN_ON
sorry it's working i have to change my manifest.xml i know it's stupid :) thanks On Jun 9, 2:07 pm, souissi haythem haythe...@gmail.com wrote: so why i got this message?? [2011-06-09 14:06:19 - Screen] ERROR: Application requires API version 8. Device API version is 7 (Android 2.1-update1). [2011-06-09 14:06:19 - Screen] Launch canceled! And when i try this in an AVD 2.2, it work?? On Jun 9, 1:34 pm, Kostya Vasilyev kmans...@gmail.com wrote: According to the documentation, both are since API level 1. -- Kostya 2011/6/9 souissi haythem haythe...@gmail.com Hi i need to use the two broadcast in the title. The problem is that to use it, we require API version8 (android 2.2). And my program need to work in Android 2.1 I wanna know if there is other tools in android 2.1 that it can do the work of detecting screen on or off. I have found isScreenOn() which test if the screen is on or off, but it is not why i need. I need to detect automatic when the screen is on so i lunch my service . 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@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 post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] keypad unlocked automatically
Hi, can i do this in android? if something happen (my download finish), the keypad is unlocked automatically. i can detect when my download has finished. but i can't found how to unlock my phone automatically. 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: keypad unlocked automatically
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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Handling Screen OFF and Screen ON Intents
I'm trying to get a BroadcastReceiver invoked when the screen is turned on or off. In my AndroidManifest.xml I have specified : receiver android:name=.ScreenReceiver intent-filter action android:name=android.intent.action.SCREEN_ON/action category android:name=android.intent.category.HOME/ /intent-filter /receiver receiver android:name=.ScreenReceiver1 intent-filter action android:name=android.intent.action.SCREEN_OFF/ action category android:name=android.intent.category.HOME/ /intent-filter /receiver In my ScreenReceiver.java I have specified : public void onReceive(Context context, Intent intent) { try { Toast.makeText(context, Device Haythem SCREEN TURNED ON, Toast.LENGTH_LONG).show(); } catch (Exception e) { } } In my ScreenReceiver1.java I have specified : public void onReceive(Context context, Intent intent) { try { Toast.makeText(context, Device Haythem SCREEN TURNED OFF, Toast.LENGTH_LONG).show(); } catch (Exception e) { } } it don't work. My device didn't detect anythink. Please what's the problem??? 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Handling Screen OFF and Screen ON Intents
I CHANGED IT INTO LOG Log.e(ON,Device Haythem SCREEN TURNED ON); Log.e(Off,Device Haythem SCREEN TURNED Off); it still not working??? On Jun 6, 1:00 pm, Mark Murphy mmur...@commonsware.com wrote: One problem is that you are using Toasts instead of logging to LogCat with the android.util.Log class. On Mon, Jun 6, 2011 at 5:15 AM, souissi haythem haythe...@gmail.com wrote: I'm trying to get a BroadcastReceiver invoked when the screen is turned on or off. In my AndroidManifest.xml I have specified : receiver android:name=.ScreenReceiver intent-filter action android:name=android.intent.action.SCREEN_ON/action category android:name=android.intent.category.HOME/ /intent-filter /receiver receiver android:name=.ScreenReceiver1 intent-filter action android:name=android.intent.action.SCREEN_OFF/ action category android:name=android.intent.category.HOME/ /intent-filter /receiver In my ScreenReceiver.java I have specified : public void onReceive(Context context, Intent intent) { try { Toast.makeText(context, Device Haythem SCREEN TURNED ON, Toast.LENGTH_LONG).show(); } catch (Exception e) { } } In my ScreenReceiver1.java I have specified : public void onReceive(Context context, Intent intent) { try { Toast.makeText(context, Device Haythem SCREEN TURNED OFF, Toast.LENGTH_LONG).show(); } catch (Exception e) { } } it don't work. My device didn't detect anythink. Please what's the problem??? 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9.3 Available! -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Handling Screen OFF and Screen ON Intents
it's good I got the answer hear http://groups.google.com/group/android-developers/browse_frm/thread/81d84efa68578924?scoring=dq=screen_on; = Screen_on/off not working via the manifest thank u mark :) On Jun 6, 1:45 pm, souissi haythem haythe...@gmail.com wrote: I CHANGED IT INTO LOG Log.e(ON,Device Haythem SCREEN TURNED ON); Log.e(Off,Device Haythem SCREEN TURNED Off); it still not working??? On Jun 6, 1:00 pm, Mark Murphy mmur...@commonsware.com wrote: One problem is that you are using Toasts instead of logging to LogCat with the android.util.Log class. On Mon, Jun 6, 2011 at 5:15 AM, souissi haythem haythe...@gmail.com wrote: I'm trying to get a BroadcastReceiver invoked when the screen is turned on or off. In my AndroidManifest.xml I have specified : receiver android:name=.ScreenReceiver intent-filter action android:name=android.intent.action.SCREEN_ON/action category android:name=android.intent.category.HOME/ /intent-filter /receiver receiver android:name=.ScreenReceiver1 intent-filter action android:name=android.intent.action.SCREEN_OFF/ action category android:name=android.intent.category.HOME/ /intent-filter /receiver In my ScreenReceiver.java I have specified : public void onReceive(Context context, Intent intent) { try { Toast.makeText(context, Device Haythem SCREEN TURNED ON, Toast.LENGTH_LONG).show(); } catch (Exception e) { } } In my ScreenReceiver1.java I have specified : public void onReceive(Context context, Intent intent) { try { Toast.makeText(context, Device Haythem SCREEN TURNED OFF, Toast.LENGTH_LONG).show(); } catch (Exception e) { } } it don't work. My device didn't detect anythink. Please what's the problem??? 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9.3 Available! -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Handling Screen OFF and Screen ON Intents
for more detail: http://androidorange.blogspot.com/2011/06/manipulation-screen-off-and-screen-on.html On Jun 6, 2:20 pm, souissi haythem haythe...@gmail.com wrote: it's good I got the answer hearhttp://groups.google.com/group/android-developers/browse_frm/thread/8... = Screen_on/off not working via the manifest thank u mark :) On Jun 6, 1:45 pm, souissi haythem haythe...@gmail.com wrote: I CHANGED IT INTO LOG Log.e(ON,Device Haythem SCREEN TURNED ON); Log.e(Off,Device Haythem SCREEN TURNED Off); it still not working??? On Jun 6, 1:00 pm, Mark Murphy mmur...@commonsware.com wrote: One problem is that you are using Toasts instead of logging to LogCat with the android.util.Log class. On Mon, Jun 6, 2011 at 5:15 AM, souissi haythem haythe...@gmail.com wrote: I'm trying to get a BroadcastReceiver invoked when the screen is turned on or off. In my AndroidManifest.xml I have specified : receiver android:name=.ScreenReceiver intent-filter action android:name=android.intent.action.SCREEN_ON/action category android:name=android.intent.category.HOME/ /intent-filter /receiver receiver android:name=.ScreenReceiver1 intent-filter action android:name=android.intent.action.SCREEN_OFF/ action category android:name=android.intent.category.HOME/ /intent-filter /receiver In my ScreenReceiver.java I have specified : public void onReceive(Context context, Intent intent) { try { Toast.makeText(context, Device Haythem SCREEN TURNED ON, Toast.LENGTH_LONG).show(); } catch (Exception e) { } } In my ScreenReceiver1.java I have specified : public void onReceive(Context context, Intent intent) { try { Toast.makeText(context, Device Haythem SCREEN TURNED OFF, Toast.LENGTH_LONG).show(); } catch (Exception e) { } } it don't work. My device didn't detect anythink. Please what's the problem??? 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9.3 Available! -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to target a running app with a KeyEvent?
Hi, my goal is to target with a keyevent a specific application running either in foreground or background from a background service. I tried many solutions, but have not yet managed to do it. The few solutions tried (all from a background running service): With a broadcast, I tried to target the first application (for example the phone app) that would manage the key event KeyEvent lKey1Up = new KeyEvent(KeyEvent.ACTION_UP,KeyEvent.KEYCODE_ENDCALL); KeyEvent lKey1Dwn = new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_ENDCALL); Intent lKey1UpIntent = new Intent(Intent.ACTION_MEDIA_BUTTON); Intent lKey1DwnIntent = new Intent(Intent.ACTION_MEDIA_BUTTON); lKey1UpIntent.putExtra(Intent.EXTRA_KEY_EVENT, lKey1Up); lKey1DwnIntent.putExtra(Intent.EXTRA_KEY_EVENT, lKey1Dwn ); sendOrderedBroadcast(lKey1UpIntent, null); sendOrderedBroadcast(lKey1DwnIntent, null); = Nothing happens with my foreground phone app when the broadcast is performed while I am in a phone call state (OFFHOOK). Indeed, I was nearly sure this would not work since I have no way to specificely target the phone app. With Instrumentation, I tried to target the application that has the focus : Instrumentation lInst = new Instrumentation(); KeyEvent lKey1Up = new KeyEvent(KeyEvent.ACTION_UP,KeyEvent.KEYCODE_1); KeyEvent lKey1Dwn = new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_1); lInst.sendKeySync(lKey1Up); lInst.sendKeySync(lKey1Dwn); also tried with a single call to : lInst.sendKeyDownUpSync(KeyEvent.KEYCODE_1) = Application crashes (also during phone call) looks like I cannot use Instrumentation out of a testing purpose Eventually, I thought about using superDispatchKeyEvent(KeyEvent) but since I don't know how to target a specific window from the targeted running application (and I have none in my service, indeed), I don't know how to use it at all. And before anyone asks, I added the android.permission.INJECT_EVENTS android.permission.MODIY_PHONE_STATE in my manifest in order to be sure all I do is allowed. Then... thanks first for reading until here, and now : * some of you know how I can manage to do target a specific application with a keystroke event from a service? * some of you know how to do the same with the phone application specificely? Thanks in advance for your help. -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] list of receiver that i can a declare in manifest
hi, how can i have the list of receiver that can be declared in the manifest? i try ACTION_SCREEN_ON, it can't be declared in the manifest. it must be registred in my activity or my service. there is ACTION_BOOTCOMPLETE that is declared in the manifest, and runned independ of our activity. i wanna know if there is other BroadcastReceiver that run independ of our application?? 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to target a running app with a KeyEvent?
I do not believe that SDK applications can successfully receive this permission. So maybe i can do it with NDK application?? -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] install c++ application in my android
Hi can i install an application which have been developped in c++ in an android device? i have the code in c++ and i don't want to lose time to make an equivalent application in java. 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Call an Activity or a service when phone is locked by clicking two times on the CALL button
hi group, can i call an Activity or a service when phone is locked by clicking two times on the CALL button?? 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Calling an Activity when phone is locked by clicking two times on the END_CALL button
listner don't do this. they must be working when the phone is locked? i try to use broadcast i make this code in: return super.onKeyUp(keyCode, event); so igot an error: The method onKeyUp(int, KeyEvent) is undefined for the type BroadcastReceiver c'est quoi le problem?? On 13 mai, 02:17, Bob Kerns r...@acm.org wrote: I'm not! It would be a major security hole. But I could see a broadcast for various UI events while locked. They couldn't expose any UI (and perhaps should not be allowed to trigger any change of current activity), but they could do things like mute the audio, or log some event. On Thursday, May 12, 2011 9:13:58 AM UTC-7, Dianne Hackborn wrote: Sorry you can't do this. On Thu, May 12, 2011 at 5:44 AM, souissi haythem hayt...@gmail.comwrote: Hi, I need to call my Activity when user press two times on the END_CALL button (it need to work when the phone is locked). Is is that possible?? 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-d...@googlegroups.com To unsubscribe from this group, send email to android-develop...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hac...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Calling an Activity when phone is locked by clicking two times on the END_CALL button
Hi, I need to call my Activity when user press two times on the END_CALL button (it need to work when the phone is locked). Is is that possible?? 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Calling an Activity when phone is locked by clicking two times on the END_CALL button
Hi, I need to call my Activity when user press two times on the END_CALL button (it need to work when the phone is locked). Is is that possible?? 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Demande d'info
Bonjour Est ce que c'est possible de controler les touches non tactile de son terminal mobile. c'est à dire la touche appeler par exemple ou les touches de volume. Je veux que lorsque je fait un clic sur la touche menu, mon programme affiche son menu et non pas celui de SE Android. Est ce que je peu controler ce bouton? Cordialement Haythem -- 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@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en