[android-developers] Menu Widget
Can some one help me with the name or example of the menu widget that the Facebook app is using. It is the widget what appears when you click the three bars on the upper right hand corner. Thanks Zach -- 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 set spinner selection by id not position
I have created a simple Spinner binding it to a SimpleCursorAdapter. I'm populating the SimpleCursorAdapter with a list of towns from a content provider. When I go to save the users selection I'm planning on saving the row id that is being populated into my SimpleCursorAdapter. I'm using the following code to get the ID. townSpinner.getSelectedItemId(); What I can not figure out is how best to set the selection when I pull back up the saved item. The following code works but it only sets selection by position number. townSpinner.setSelection(2); Should I just create a loop to determine the correct position value based on Id? long cityId = Long.parseLong(cursor.getString(CityQuery.CITY_ID)); for (int i = 0; i citySpinner.getCount(); i++) { long itemIdAtPosition2 = citySpinner.getItemIdAtPosition(i); if (itemIdAtPosition2 == cityId) { citySpinner.setSelection(i); break; } } Thanks Zach -- 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: queryBroadcastReceivers setup
What should the prefix class be for MATCH_DEFAULT_ONLY? On Oct 12, 5:36 am, Mark Murphy mmur...@commonsware.com wrote: For the Intent, use whatever Intent you want to see if somebody will receive. queryBroadcastReceivers() is not to find *all* receivers -- it is to find if anything will receive a broadcast of a specific Intent. For the flags, 0 or MATCH_DEFAULT_ONLY are the two most likely options. On Mon, Oct 11, 2010 at 11:24 PM, zachariahyoung zpyo...@gmail.com wrote: I would like to know all of my broad cast receivers. The above methods should to the trick but I'm not finding any good examples on how to use it. PackageManager packageManager = getPackageManager(); packageManager.queryBroadcastReceivers(intent, flags); What should enter for intent and flags? Thanks Zach -- 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 Android 2.2 Programming Books:http://commonsware.com/books -- 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: BroadcastReceiver not working for Car Dock
What should my intent filter look like? Also is there a way to make the file dock via a adb command? Thanks On Oct 11, 6:54 am, Mark Murphy mmur...@commonsware.com wrote: On Sun, Oct 10, 2010 at 10:57 PM, zachariahyoung zpyo...@gmail.com wrote: I'm testing the code by click on the phone Car Home app. Would this not be the same thing as docking the phone? No, they are not the same. You will need a device and a car dock, AFAIK. -- 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: BroadcastReceiver not working for Car Dock
I believe this is they correct intent filter setup. receiver android:name=.DemoCar intent-filter action android:name=android.intent.action.DOCK_EVENT / category android:name=android.intent.category.CAR_DOCK / category android:name=android.intent.category.DEFAULT / /intent-filter /receiver Thanks Zach On Oct 11, 7:13 am, Mark Murphy mmur...@commonsware.com wrote: On Mon, Oct 11, 2010 at 8:03 AM, zachariahyoung zpyo...@gmail.com wrote: What should my intent filter look like? AFAIK, this should work: intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.CAR_DOCK / category android:name=android.intent.category.DEFAULT / /intent-filter Note, though, that I do not own acardock, let alone have written any code to try using it. Also is there a way to make the filedockvia a adb command? It does not appear that this is possible. I see neither an emulator switch nor a telnet command for it. -- 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] queryBroadcastReceivers setup
I would like to know all of my broad cast receivers. The above methods should to the trick but I'm not finding any good examples on how to use it. PackageManager packageManager = getPackageManager(); packageManager.queryBroadcastReceivers(intent, flags); What should enter for intent and flags? Thanks Zach -- 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] BroadcastReceiver not working for Car Dock
I'm trying to write a program to send an email when the phone is placed in the car dock. I have create a Android Project with no Activities. Below is the one class I have created. It just has a Toast so I can see that it is working. Below is the code which I think is correct. package com.demo.carmode; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; import android.widget.Toast; public class CarMode extends BroadcastReceiver { @Override public void onReceive(Context arg0, Intent intent) { Toast.makeText(arg0, Hello Car Mode, Toast.LENGTH_SHORT).show(); Log.d(ExmampleBroadcastReceiver, intent= + intent); Log.i(CarMod, hello world); } } My mainfest is real simple also. ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.demo.carmode android:versionCode=1 android:versionName=1.0 application android:icon=@drawable/icon android:label=@string/ app_name receiver android:name=.CarMode android:enabled=true intent-filter action android:name=android.intent.action.MAIN/action category android:name=android.intent.category.CAR_DOCK/ category /intent-filter /receiver /application /manifest I'm testing the code by click on the phone Car Home app. Would this not be the same thing as docking the phone? Have I not setup my manifest correctly? Could I be missing something else. Seems like this should work. I also see the active and category appear on my logcat. Thanks for the help Zach -- 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] Twitter App Source Code
Where can I find the source code for the Android Twitter App? Thanks Zach -- 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: Twitter App Source Code
Does anybody know when it will be released? On Jul 7, 9:16 am, Mark Murphy mmur...@commonsware.com wrote: On Wed, Jul 7, 2010 at 10:14 AM, zachariahyoung zpyo...@gmail.com wrote: Where can I find the source code for the Android Twitter App? AFAIK, it has not yet been released. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.8 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] Format double to a currency format
This maybe be a simple question but how to you format a double into a dollar format? For example I have a value of 4.2. In a textview I would like to see $4.20. Also what are my options for applying the correct currency symbol? -- 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] InstrumentationTestCase vs ActivityInstrumentationTestCase2
Can anybody tell me the difference between these two Test Case? -- 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: Question about unit testing a seek bar's events
Anybody have any ideas on this? On Dec 6, 9:45 pm, zachariahyoung zpyo...@gmail.com wrote: I have a very simple activity created with one seek bar. I'm trying to figure out how best to unit test the events. Below is how I have the seek bar wired up in my activity. EditText billAmount = (EditText)findViewById(R.id.billAmountEditText); tip = (SeekBar) findViewById(R.id.tipPercentSeekBar); tip.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch) { //tipPercent.setText(progress + %); billAmount.setText(1); } public void onStartTrackingTouch(SeekBar seekBar) { billAmount.setText(2); } public void onStopTrackingTouch(SeekBar seekBar) { billAmount.setText(3); } }); So with this I have a test class that extends ActivityInstrumentationTestCase and I have test method. Should I not be able to so something like this? Right now I'm getting Test run failed: String resource ID #0x2 with this code. @SmallTest public void testSeekTipEvents(){ TouchUtils.tapView(this, tip); assertEquals(1, billAmount.getText().toString()); } -- 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] Question about unit testing a seek bar's events
I have a very simple activity created with one seek bar. I'm trying to figure out how best to unit test the events. Below is how I have the seek bar wired up in my activity. EditText billAmount = (EditText)findViewById(R.id.billAmountEditText); tip = (SeekBar) findViewById(R.id.tipPercentSeekBar); tip.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch) { //tipPercent.setText(progress + %); billAmount.setText(1); } public void onStartTrackingTouch(SeekBar seekBar) { billAmount.setText(2); } public void onStopTrackingTouch(SeekBar seekBar) { billAmount.setText(3); } }); So with this I have a test class that extends ActivityInstrumentationTestCase and I have test method. Should I not be able to so something like this? Right now I'm getting Test run failed: String resource ID #0x2 with this code. @SmallTest public void testSeekTipEvents(){ TouchUtils.tapView(this, tip); assertEquals(1, billAmount.getText().toString()); } -- 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