[android-developers] Re: Writing widgets *without* persistent services
Marc -- Excellent. I was indeed missing something obvious, and the solution was much simpler than anything I was contemplating. Many thanks for pointing it out. (I was somewhat familiar with the layout-land mechanism from my readings, but hadn't realized that it was so automagic and all- pervasive. Now I know better.) -Robert --~--~-~--~~~---~--~~ 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: Getting Current Location on my Device works on emulator but not on my device
I removed the code from onProviderDisabled. Had some other code there initially (was getting location from network - but thats very inaccurate) Also tried changing the 2000 to 2 but it doesn;t make a difference. I still can't get a fix. Any help please? On 02-Jun-09, at 4:03 PM, Mark Murphy wrote: iDeveloper wrote: Hi This is what I tried based on the suggestions in the below chain mail MyLocationListener myListener = new MyLocationListener(); LocationManager myManager = (LocationManager)getSystemService(LOCATION_SERVICE); myManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 0, myListener); This is the LocationListener class public class MyLocationListener implements LocationListener { private static double latitude; private static double longitude; @Override public void onLocationChanged(Location arg0) { latitude = arg0.getLatitude(); longitude = arg0.getLongitude(); } @Override public void onProviderDisabled(String provider) { LocationManager myManager = (LocationManager)delegate.getSystemService(Context.LOCATION_SERVICE); LocationProvider name = myManager.getProvider(gps); if(name != null){ Location lastGps = myManager.getLastKnownLocation(gps); if(lastGps == null){ latitude = 0.0; longitude = 0.0; } else{ latitude = lastGps.getLatitude(); longitude = lastGps.getLongitude(); } } } Why are you attempting to connect to the system service in onProviderDisabled()? @Override public void onProviderEnabled(String provider) { } @Override public void onStatusChanged(String provider, int status, Bundle extras) {} public static double getLatitude() { return latitude; } public static double getLongitude() { return longitude; } } I waited for as long as 30 seconds but none of the listener methods were called. I am testing on a G1 with 1.5 SDK. Can someone please tell me whats wrong with the code? Thanks -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ 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] problem in installing adnroid plugin in eclipse
I read the docs for installing android plugin for eclipse. I did it according to it and i have downloaded and installed the plugin but after that when i cliced on Windows-prefrences i could not find Android in left panel. What could be wrong in 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] Re: Detect Physical Keyboard Layout (ex: QWERTY vs QWERTZ)
The flags provided by getResources().getConfiguration().keyboard are a good way of checking which keyboard (if any) is available. http://d.android.com/reference/android/content/res/Configuration.html j On Tue, Jun 2, 2009 at 8:07 PM, csvy sou...@gmail.com wrote: Is there any way to determine the layout of a physical keyboard (if there is one)? I would like to map commands to keyboard keys if there is a hardware keyboard available, but the layout is very important. I have had users from Germany complaining that layout is not optimized for their phones (since the Y and Z keys are swapped). Is there any way to automatically detect this, or am I stuck making it a setting? -- Jeff Sharkey jshar...@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] Country Codes for Localization
Hi, Can any one tell me where I can find the Country codes. I need them for localization of the application. Thanks best Regards; Swapnil Dalal. --~--~-~--~~~---~--~~ 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 detect current screen is vertical or horizontal?
Hi, I need to set different content view after rotating device screen. Is there any method to detect the direction of current screen is vertical or horizontal?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: Bug with EditText and Linkifycation?
Yes, I get this too. I had to turn off all links on EditText, because entering a phone number or url caused the textview to crash :-( -Brian On May 20, 2:09 am, Marcus marcus.ter...@gmail.com wrote: Hi, I have an EditText with linkifycation on. But if the content contains a link and I tap on it or move the cursor in it, I get an IndexOutOfBoundsException. Stacktrace below. I think the problem is the getCapsMode method of TextUtils. They don't check if the offset is below 0. So it crashes if there is no selection. E/AndroidRuntime( 2853): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 2853): java.lang.IndexOutOfBoundsException: charAt: -2 0 E/AndroidRuntime( 2853): at android.text.SpannableStringBuilder.charAt(SpannableStringBuilder.java: 110) E/AndroidRuntime( 2853): at android.text.TextUtils.getCapsMode (TextUtils.java:1562) E/AndroidRuntime( 2853): at android.view.inputmethod.BaseInputConnection.getCursorCapsMode (BaseInputConnection.java:273) E/AndroidRuntime( 2853): at android.widget.TextView.onCreateInputConnection(TextView.java:4346) E/AndroidRuntime( 2853): at android.view.inputmethod.InputMethodManager.startInputInner (InputMethodManager.java:933) E/AndroidRuntime( 2853): at android.view.inputmethod.InputMethodManager.checkFocus (InputMethodManager.java:1105) E/AndroidRuntime( 2853): at android.view.inputmethod.InputMethodManager.isActive (InputMethodManager.java:530) E/AndroidRuntime( 2853): at android.widget.TextView.onDraw (TextView.java:3880) E/AndroidRuntime( 2853): at android.view.View.draw(View.java: 5838) E/AndroidRuntime( 2853): at android.view.ViewGroup.drawChild (ViewGroup.java:1486) E/AndroidRuntime( 2853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java:1228) E/AndroidRuntime( 2853): at android.view.ViewGroup.drawChild (ViewGroup.java:1484) E/AndroidRuntime( 2853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java:1228) E/AndroidRuntime( 2853): at android.view.View.draw(View.java: 5841) E/AndroidRuntime( 2853): at android.widget.FrameLayout.draw (FrameLayout.java:352) E/AndroidRuntime( 2853): at android.view.ViewGroup.drawChild (ViewGroup.java:1486) E/AndroidRuntime( 2853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java:1228) E/AndroidRuntime( 2853): at android.view.ViewGroup.drawChild (ViewGroup.java:1484) E/AndroidRuntime( 2853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java:1228) E/AndroidRuntime( 2853): at android.view.View.draw(View.java: 5841) E/AndroidRuntime( 2853): at android.widget.FrameLayout.draw (FrameLayout.java:352) E/AndroidRuntime( 2853): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw (PhoneWindow.java:1847) E/AndroidRuntime( 2853): at android.view.ViewRoot.draw (ViewRoot.java:1217) E/AndroidRuntime( 2853): at android.view.ViewRoot.performTraversals(ViewRoot.java:1030) E/AndroidRuntime( 2853): at android.view.ViewRoot.handleMessage (ViewRoot.java:1482) E/AndroidRuntime( 2853): at android.os.Handler.dispatchMessage (Handler.java:99) E/AndroidRuntime( 2853): at android.os.Looper.loop(Looper.java: 123) E/AndroidRuntime( 2853): at android.app.ActivityThread.main (ActivityThread.java:3948) E/AndroidRuntime( 2853): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 2853): at java.lang.reflect.Method.invoke (Method.java:521) E/AndroidRuntime( 2853): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:782) E/AndroidRuntime( 2853): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) E/AndroidRuntime( 2853): at dalvik.system.NativeStart.main (Native Method) --~--~-~--~~~---~--~~ 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 use Picture.writeToStream to save picture to filesystem as png or jpeg format?
Hi folks, I am trying to capture screen from WebView and save the picture into either JPEG or PNG formats on android local filesystem. However, documentation of Picture.writeToStream doesn't mention anything about what format it stores or supports. So I am wondering is it possible to do what I want to do in 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: How to detect current screen is vertical or horizontal?
use an orientation sensor... On Wed, Jun 3, 2009 at 2:13 PM, aby orz0...@gmail.com wrote: Hi, I need to set different content view after rotating device screen. Is there any method to detect the direction of current screen is vertical or horizontal?Thanks -- Regards, Sujay Mark Twain http://www.brainyquote.com/quotes/authors/m/mark_twain.html - There is no sadder sight than a young pessimist. --~--~-~--~~~---~--~~ 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 detect current screen is vertical or horizontal?
getRequestedOrientation() method will work until you forced to change the Orientation. On Wed, Jun 3, 2009 at 2:21 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: use an orientation sensor... On Wed, Jun 3, 2009 at 2:13 PM, aby orz0...@gmail.com wrote: Hi, I need to set different content view after rotating device screen. Is there any method to detect the direction of current screen is vertical or horizontal?Thanks -- Regards, Sujay Mark Twain http://www.brainyquote.com/quotes/authors/m/mark_twain.html - There is no sadder sight than a young pessimist. -- Guna --~--~-~--~~~---~--~~ 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] Outgoing call screen
Guys, I am making an app that is similar to a calling card app where it appends a number to the start of the phone number when you call out. I wanted to know if it is possible to change the number/text that is displayed when you make the call. I am using the new_outgoing_call broadcast to do the number change and i would love for the original number to show and maybe some text to say via calling card or something. Anyone have any ideas? Regards, Chris --~--~-~--~~~---~--~~ 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] is upgrade to 1.5 safe???
hi, i am saurav mukherjee n i am working on a g1 mobile on android. there is a dialog box appearing for upgrading the os to 1.5. i jus wanted to know if anybody has done the same and is it safe (ie if the 1.5 os version is stable)? --~--~-~--~~~---~--~~ 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: is upgrade to 1.5 safe???
Yes, 1.5 is stable only, as you are working with G1, which is based on the cupcake version. On Wed, Jun 3, 2009 at 2:30 PM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: hi, i am saurav mukherjee n i am working on a g1 mobile on android. there is a dialog box appearing for upgrading the os to 1.5. i jus wanted to know if anybody has done the same and is it safe (ie if the 1.5 os version is stable)? -- Guna --~--~-~--~~~---~--~~ 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: is upgrade to 1.5 safe???
Not exactly If you used the removed methods, it will show exception. Take care of those methods alone. On Wed, Jun 3, 2009 at 2:39 PM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: will the applications developed for 1.0 r2 work well on 1.5? is it backward compatible? On Wed, Jun 3, 2009 at 2:33 PM, guna gunaz...@gmail.com wrote: Yes, 1.5 is stable only, as you are working with G1, which is based on the cupcake version. On Wed, Jun 3, 2009 at 2:30 PM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: hi, i am saurav mukherjee n i am working on a g1 mobile on android. there is a dialog box appearing for upgrading the os to 1.5. i jus wanted to know if anybody has done the same and is it safe (ie if the 1.5 os version is stable)? -- Guna -- Guna --~--~-~--~~~---~--~~ 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: Passing pointer to AsyncTask that changes GUI to onRetainNonConfigurationInstance?
If you look at Romain Guys Shelves app (where this class originates) he actually stops then restarts asynctasks when the screen rotates. This doesn't seem like a great way to go, as you throw away the progress. But as AsyncTasks have a reference to the activity, I can see why it's done. The whole configuration change means destruction thing has a lot of nasty side effects. I sometimes wonder if the gain in simplicity from not having to dynamically reload resources is worth it. The way I do something similar in my app is like Streets of Boston, basically have a callback interface that's stuffed into a static field. Of course you MUST be careful with locking, you can't just do something like: mCallback.showProgress(progress); because mCallback might have been set to null during the brief moment in which the screen is rotating. But then this is also wrong: if (mCallback != null) mCallback.showProgress(progress); because it has a race. So you need something like synchronized (some object) { if (mCallback != null) mCallback.showProgress(progress); } and then in your oncreate/ondestroy make sure you synchronize on that object when setting the value of mCallback. --~--~-~--~~~---~--~~ 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] Licensing an Android application programatically.
Hello list.. I had a query: If i wish to attach an evaluation license to my android application, how can that be achieved ? As for example, i may want to provide an evaluation license based application that expires in one of the following ways: 1. Time based (30 days etc) 2. Usage based ( 100 invocations of the application). Once the application's license expires, i need to restrict access to it from the user. Thanks in advance.. Best Regards aayush --~--~-~--~~~---~--~~ 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] start call with intent from browser
Hi, is it possible to start a call from the android browser, let's say by clicking a link in an html file or with javascript after a button click? maybe with help of the gears api? i'd appreciate any hints, maybe an example of how to embed the intent in the html-file/in javascript. thanks a lot!! cheers --~--~-~--~~~---~--~~ 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: [ListView + Custom adapter] items can't be selected (or highlighted)
Ok I added to my class implements AdapterView.OnItemClickListener. Then I implemented onItemClickListener method and added in onCreate setOnClickListener(this). Now I can select and highlight items but only with the trackball. Nothing happens with the mouse event. May have implement OnItemSelectedListener too ? Thanks Tom On 2 juin, 16:47, guna gunaz...@gmail.com wrote: Tom, You didnt implements OnItemClickListener, and also in oncreate add setonitemclicklistener(this) On Tue, Jun 2, 2009 at 8:10 PM, Tom thomas.coz...@gmail.com wrote: These are my line of codings : public class UserList extends ListActivity{ private Client client; private ArrayListUser users = new ArrayListUser(); private UserAdapter userAdapter; public static final int MENU_ITEM_VIEW = Menu.FIRST; private static final int COLUMN_INDEX_TITLE = 1; �...@override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.user_list); Intent i = getIntent(); if (i!= null) { if (i.getAction().equalsIgnoreCase(Intent.ACTION_VIEW)) { this.client = (Client) i.getSerializableExtra (Constants.CLIENT_CLASS_NAME); this.userAdapter = new UserAdapter(this, R.layout.user_row, users); users = (ArrayListUser) this.client.getUsers(); for(int j=0;jusers.size();j++) { this.userAdapter.add(users.get(j)); } setListAdapter(this.userAdapter); } } } private class UserAdapter extends ArrayAdapterUser{ private LayoutInflater mInflater; private ArrayListUser items; public UserAdapter(Context context, int resourceId, ArrayListUser items) { super(context, resourceId, items); mInflater = LayoutInflater.from(context); this.items = items; } public boolean areAllItemsSelectable() { return true; } public boolean isEnabled(int position) { if (position = 0 position = items.size()) { return true; } return false; } public int getCount() { return items.size(); } public User getItem(int position) { if (0 == position) { return null; } return items.get(position); } �...@override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; View v = convertView; User user = items.get(position); if (v == null) { mInflater = (LayoutInflater)getSystemService (Context.LAYOUT_INFLATER_SERVICE); v = mInflater.inflate(R.layout.user_row, null); if (user != null) { // Creates a ViewHolder and store references to the two children views // we want to bind data to. holder = new ViewHolder(); holder.firstNameText = (TextView) v.findViewById (R.id.user_first_name); holder.lastNameText = (TextView) v.findViewById (R.id.user_last_name); holder.phoneNumberText = (TextView) v.findViewById (R.id.user_phone_number); holder.statusText = (TextView) v.findViewById (R.id.user_status); } v.setTag(holder); } else { holder = (ViewHolder) v.getTag(); } if (holder.firstNameText != null) { holder.firstNameText.setText(user.getFirstName()); } if (holder.lastNameText != null){ holder.lastNameText.setText(user.getLastName()); } if ( holder.phoneNumberText != null){ holder.phoneNumberText.setText(user.getPhoneNumber()); } if (holder.statusText != null){ holder.statusText.setText(String.valueOf(user.getStatus ())); } return v; } private class ViewHolder { TextView firstNameText; TextView lastNameText; TextView phoneNumberText; TextView statusText; } public long getItemId(int position) { return position; } } �...@override public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) { AdapterView.AdapterContextMenuInfo info; try { info = (AdapterView.AdapterContextMenuInfo) menuInfo; }
[android-developers] Re: Licensing an Android application programatically.
Hi, # 1 - I believe you can do this when signing your certificate. # 2 - you can store the number of times your app is invoked on the Preferences then just check if it already exceeds your limit but then it can easily be broken by just uninstalling the application and download it again. I haven't tried this yet. Just my idea. Marc 2. Usage based ( 100 invocations of the application). On Wed, Jun 3, 2009 at 5:24 PM, aayush abhatnagar192...@gmail.com wrote: Hello list.. I had a query: If i wish to attach an evaluation license to my android application, how can that be achieved ? As for example, i may want to provide an evaluation license based application that expires in one of the following ways: 1. Time based (30 days etc) 2. Usage based ( 100 invocations of the application). Once the application's license expires, i need to restrict access to it from the user. Thanks in advance.. Best Regards aayush --~--~-~--~~~---~--~~ 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: Licensing an Android application programatically.
okay..thanks for the answer Marc. For #1 i believe i need to create my own certificate by using the keytool utility and sign it as you suggest. Time based is my only requirement..as of now. Usage based is not a priority for me. aayush On Jun 3, 2:34 pm, Marc Lester Tan mail...@gmail.com wrote: Hi, # 1 - I believe you can do this when signing your certificate. # 2 - you can store the number of times your app is invoked on the Preferences then just check if it already exceeds your limit but then it can easily be broken by just uninstalling the application and download it again. I haven't tried this yet. Just my idea. Marc 2. Usage based ( 100 invocations of the application). On Wed, Jun 3, 2009 at 5:24 PM, aayush abhatnagar192...@gmail.com wrote: Hello list.. I had a query: If i wish to attach an evaluation license to my android application, how can that be achieved ? As for example, i may want to provide an evaluation license based application that expires in one of the following ways: 1. Time based (30 days etc) 2. Usage based ( 100 invocations of the application). Once the application's license expires, i need to restrict access to it from the user. Thanks in advance.. Best Regards aayush --~--~-~--~~~---~--~~ 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: Is Contact Content Provider threadsafe?
Really appreciate a reply. --~--~-~--~~~---~--~~ 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: Licensing an Android application programatically.
if i were u if my app already interacts with the web then i'll initially hit a url from the app with may the phone's unique id... i'll take care of everythin else at the web-side... this will make sure that there's not much change in my app's performance... but i dont exactly no if an android phone has any sort of unique id the possibilities to get such an id... if not the id u may go for the google acc registered with the phone... but this may have some limitations... On Wed, Jun 3, 2009 at 3:20 PM, aayush abhatnagar192...@gmail.com wrote: okay..thanks for the answer Marc. For #1 i believe i need to create my own certificate by using the keytool utility and sign it as you suggest. Time based is my only requirement..as of now. Usage based is not a priority for me. aayush On Jun 3, 2:34 pm, Marc Lester Tan mail...@gmail.com wrote: Hi, # 1 - I believe you can do this when signing your certificate. # 2 - you can store the number of times your app is invoked on the Preferences then just check if it already exceeds your limit but then it can easily be broken by just uninstalling the application and download it again. I haven't tried this yet. Just my idea. Marc 2. Usage based ( 100 invocations of the application). On Wed, Jun 3, 2009 at 5:24 PM, aayush abhatnagar192...@gmail.com wrote: Hello list.. I had a query: If i wish to attach an evaluation license to my android application, how can that be achieved ? As for example, i may want to provide an evaluation license based application that expires in one of the following ways: 1. Time based (30 days etc) 2. Usage based ( 100 invocations of the application). Once the application's license expires, i need to restrict access to it from the user. Thanks in advance.. Best Regards aayush -- Regards, Sujay George Bernard Shawhttp://www.brainyquote.com/quotes/authors/g/george_bernard_shaw.html - A government that robs Peter to pay Paul can always depend on the support of Paul. --~--~-~--~~~---~--~~ 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: Licensing an Android application programatically.
I would do the same. Get the android ID like this: String android_id = android.provider.Settings.System.getString (this.getContentResolver(), android.provider.Settings.System.ANDROID_ID); Then send it to your back-end and query the number of times you've made the same call or the date you firstly made a call against the unique ID. Hope it helps! On Jun 3, 11:02 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: if i were u if my app already interacts with the web then i'll initially hit a url from the app with may the phone's unique id... i'll take care of everythin else at the web-side... this will make sure that there's not much change in my app's performance... but i dont exactly no if an android phone has any sort of unique id the possibilities to get such an id... if not the id u may go for the google acc registered with the phone... but this may have some limitations... On Wed, Jun 3, 2009 at 3:20 PM, aayush abhatnagar192...@gmail.com wrote: okay..thanks for the answer Marc. For #1 i believe i need to create my own certificate by using the keytool utility and sign it as you suggest. Time based is my only requirement..as of now. Usage based is not a priority for me. aayush On Jun 3, 2:34 pm, Marc Lester Tan mail...@gmail.com wrote: Hi, # 1 - I believe you can do this when signing your certificate. # 2 - you can store the number of times your app is invoked on the Preferences then just check if it already exceeds your limit but then it can easily be broken by just uninstalling the application and download it again. I haven't tried this yet. Just my idea. Marc 2. Usage based ( 100 invocations of the application). On Wed, Jun 3, 2009 at 5:24 PM, aayush abhatnagar192...@gmail.com wrote: Hello list.. I had a query: If i wish to attach an evaluation license to my android application, how can that be achieved ? As for example, i may want to provide an evaluation license based application that expires in one of the following ways: 1. Time based (30 days etc) 2. Usage based ( 100 invocations of the application). Once the application's license expires, i need to restrict access to it from the user. Thanks in advance.. Best Regards aayush -- Regards, Sujay George Bernard Shawhttp://www.brainyquote.com/quotes/authors/g/george_bernard_shaw.html - A government that robs Peter to pay Paul can always depend on the support of Paul. --~--~-~--~~~---~--~~ 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] Not able to launch an activity of other app from Tab activity.
Hi, I am getting the following exception when I call an activity1 ( resides in 1.apk) using the following intent from TabActivity (activity 2 resides in 2.apk) Intent tab1intent = new Intent(); tab1intent.setAction( android.intent.action.VIEW); tab1intent.addCategory( android.intent.category.DEFAULT); tab1intent.setType(vnd.android.activity/vnd.moto.BookmarkManagerActivity); tab1intent.putExtra(BROWSER LAUNCH, true); Any suggestion how do I handle this error. Appreciate your great help Thanks 05-27 19:23:33.311: INFO/ActivityManager(570): Starting activity: Intent { comp={com. moto.myFamily/com. moto.myFamily.familyTab} (has extras) } 05-27 19:23:33.730: WARN/dalvikvm(761): threadid=3: thread exiting with uncaught exception (group=0x4000fe70) 05-27 19:23:33.739: ERROR/AndroidRuntime(761): Uncaught handler: thread main exiting due to uncaught exception 05-27 19:23:33.841: ERROR/AndroidRuntime(761): java.lang.RuntimeException: Unable to start activity ComponentInfo{com. moto.myFamily/com. moto.myFamily.familyTab}: java.lang.SecurityException: Requesting code from com. moto.bookmarkmanager (with uid 10018) to be run in process com. moto.myFamily (with uid 10019) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.app.ActivityThread.access$1800(ActivityThread.java:112) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.os.Handler.dispatchMessage(Handler.java:99) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.os.Looper.loop(Looper.java:123) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.app.ActivityThread.main(ActivityThread.java:3948) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at java.lang.reflect.Method.invokeNative(Native Method) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at java.lang.reflect.Method.invoke(Method.java:521) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at dalvik.system.NativeStart.main(Native Method) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): Caused by: java.lang.SecurityException: Requesting code from com. moto.bookmarkmanager (with uid 10018) to be run in process com. moto.myFamily (with uid 10019) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.app.ActivityThread.getPackageInfo(ActivityThread.java:1932) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2167) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.app.ActivityThread.startActivityNow(ActivityThread.java:2112) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:600) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.widget.TabHost.setCurrentTab(TabHost.java:310) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.widget.TabHost.addTab(TabHost.java:203) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at com. moto.myFamily.familyTab.onCreate(familyTab.java:60) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231) 05-27 19:23:33.841: ERROR/AndroidRuntime(761): ... 11 more 05-27 19:23:33.891: INFO/Process(570): Sending signal. PID: 761 SIG: 3 05-27 19:23:33.891: INFO/dalvikvm(761): threadid=7: reacting to signal 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@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] Advice on debug tool for I/O
Hi, On a number of cases I have experienced problems with server / client communication where the server responses with XML files, which never reach my client. Is there any tool for monitoring everything incoming through an HTTP connection, or if not what is your advice to detect what's come through and what's not. I've tried Charles proxy, which intercepts all requests / responses, however, Android seems to refuse to work with proxies. Any advice will be much appreciated. 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@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: items can't be selected (or highlighted)
I just want to notice that the Layout for the ArrayAdapter contains checkbox. On 3 juin, 11:33, Tom thomas.coz...@gmail.com wrote: Ok I added to my class implements AdapterView.OnItemClickListener. Then I implemented onItemClickListener method and added in onCreate setOnClickListener(this). Now I can select and highlight items but only with the trackball. Nothing happens with the mouse event. May have implement OnItemSelectedListener too ? Thanks Tom On 2 juin, 16:47, guna gunaz...@gmail.com wrote: Tom, You didnt implements OnItemClickListener, and also in oncreate add setonitemclicklistener(this) On Tue, Jun 2, 2009 at 8:10 PM, Tom thomas.coz...@gmail.com wrote: These are my line of codings : public class UserList extends ListActivity{ private Client client; private ArrayListUser users = new ArrayListUser(); private UserAdapter userAdapter; public static final int MENU_ITEM_VIEW = Menu.FIRST; private static final int COLUMN_INDEX_TITLE = 1; �...@override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.user_list); Intent i = getIntent(); if (i!= null) { if (i.getAction().equalsIgnoreCase(Intent.ACTION_VIEW)) { this.client = (Client) i.getSerializableExtra (Constants.CLIENT_CLASS_NAME); this.userAdapter = new UserAdapter(this, R.layout.user_row, users); users = (ArrayListUser) this.client.getUsers(); for(int j=0;jusers.size();j++) { this.userAdapter.add(users.get(j)); } setListAdapter(this.userAdapter); } } } private class UserAdapter extends ArrayAdapterUser{ private LayoutInflater mInflater; private ArrayListUser items; public UserAdapter(Context context, int resourceId, ArrayListUser items) { super(context, resourceId, items); mInflater = LayoutInflater.from(context); this.items = items; } public boolean areAllItemsSelectable() { return true; } public boolean isEnabled(int position) { if (position = 0 position = items.size()) { return true; } return false; } public int getCount() { return items.size(); } public User getItem(int position) { if (0 == position) { return null; } return items.get(position); } �...@override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; View v = convertView; User user = items.get(position); if (v == null) { mInflater = (LayoutInflater)getSystemService (Context.LAYOUT_INFLATER_SERVICE); v = mInflater.inflate(R.layout.user_row, null); if (user != null) { // Creates a ViewHolder and store references to the two children views // we want to bind data to. holder = new ViewHolder(); holder.firstNameText = (TextView) v.findViewById (R.id.user_first_name); holder.lastNameText = (TextView) v.findViewById (R.id.user_last_name); holder.phoneNumberText = (TextView) v.findViewById (R.id.user_phone_number); holder.statusText = (TextView) v.findViewById (R.id.user_status); } v.setTag(holder); } else { holder = (ViewHolder) v.getTag(); } if (holder.firstNameText != null) { holder.firstNameText.setText(user.getFirstName()); } if (holder.lastNameText != null){ holder.lastNameText.setText(user.getLastName()); } if ( holder.phoneNumberText != null){ holder.phoneNumberText.setText(user.getPhoneNumber()); } if (holder.statusText != null){ holder.statusText.setText(String.valueOf(user.getStatus ())); } return v; } private class ViewHolder { TextView firstNameText; TextView lastNameText; TextView phoneNumberText; TextView statusText; } public long getItemId(int position) { return position; } }
[android-developers] Re: items can't be selected (or highlighted)
I added to my class implements AdapterView.OnItemClickListener. Then I implemented onItemClickListener method and added in onCreate setOnClickListener(this). Now I can select and highlight items but only with the trackball. Nothing happens with the mouse event. On 3 juin, 13:23, guna gunaz...@gmail.com wrote: Ask clearly your questions On Wed, Jun 3, 2009 at 4:45 PM, Tom thomas.coz...@gmail.com wrote: I just want to notice that the Layout for the ArrayAdapter contains checkbox. On 3 juin, 11:33, Tom thomas.coz...@gmail.com wrote: Ok I added to my class implements AdapterView.OnItemClickListener. Then I implemented onItemClickListener method and added in onCreate setOnClickListener(this). Now I can select and highlight items but only with the trackball. Nothing happens with the mouse event. May have implement OnItemSelectedListener too ? Thanks Tom On 2 juin, 16:47, guna gunaz...@gmail.com wrote: Tom, You didnt implements OnItemClickListener, and also in oncreate add setonitemclicklistener(this) On Tue, Jun 2, 2009 at 8:10 PM, Tom thomas.coz...@gmail.com wrote: These are my line of codings : public class UserList extends ListActivity{ private Client client; private ArrayListUser users = new ArrayListUser(); private UserAdapter userAdapter; public static final int MENU_ITEM_VIEW = Menu.FIRST; private static final int COLUMN_INDEX_TITLE = 1; �...@override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.user_list); Intent i = getIntent(); if (i!= null) { if (i.getAction().equalsIgnoreCase(Intent.ACTION_VIEW)) { this.client = (Client) i.getSerializableExtra (Constants.CLIENT_CLASS_NAME); this.userAdapter = new UserAdapter(this, R.layout.user_row, users); users = (ArrayListUser) this.client.getUsers(); for(int j=0;jusers.size();j++) { this.userAdapter.add(users.get(j)); } setListAdapter(this.userAdapter); } } } private class UserAdapter extends ArrayAdapterUser{ private LayoutInflater mInflater; private ArrayListUser items; public UserAdapter(Context context, int resourceId, ArrayListUser items) { super(context, resourceId, items); mInflater = LayoutInflater.from(context); this.items = items; } public boolean areAllItemsSelectable() { return true; } public boolean isEnabled(int position) { if (position = 0 position = items.size()) { return true; } return false; } public int getCount() { return items.size(); } public User getItem(int position) { if (0 == position) { return null; } return items.get(position); } �...@override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; View v = convertView; User user = items.get(position); if (v == null) { mInflater = (LayoutInflater)getSystemService (Context.LAYOUT_INFLATER_SERVICE); v = mInflater.inflate(R.layout.user_row, null); if (user != null) { // Creates a ViewHolder and store references to the two children views // we want to bind data to. holder = new ViewHolder(); holder.firstNameText = (TextView) v.findViewById (R.id.user_first_name); holder.lastNameText = (TextView) v.findViewById (R.id.user_last_name); holder.phoneNumberText = (TextView) v.findViewById (R.id.user_phone_number); holder.statusText = (TextView) v.findViewById (R.id.user_status); } v.setTag(holder); } else { holder = (ViewHolder) v.getTag(); } if (holder.firstNameText != null) { holder.firstNameText.setText(user.getFirstName()); } if (holder.lastNameText != null){
[android-developers] Re: Advice on debug tool for I/O
Same problem by me when I try to use the Twitter4J api for a twitter client application.So I'm interested too. Regards, Zoltan 2009/6/3 mobilek...@googlemail.com mobilek...@googlemail.com Hi, On a number of cases I have experienced problems with server / client communication where the server responses with XML files, which never reach my client. Is there any tool for monitoring everything incoming through an HTTP connection, or if not what is your advice to detect what's come through and what's not. I've tried Charles proxy, which intercepts all requests / responses, however, Android seems to refuse to work with proxies. Any advice will be much appreciated. Thank you! -- K. Zoltán --~--~-~--~~~---~--~~ 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: items can't be selected (or highlighted)
Post your latest code... So that its easy to correct the errors Check whether enabled the listitems. On Wed, Jun 3, 2009 at 4:59 PM, Tom thomas.coz...@gmail.com wrote: I added to my class implements AdapterView.OnItemClickListener. Then I implemented onItemClickListener method and added in onCreate setOnClickListener(this). Now I can select and highlight items but only with the trackball. Nothing happens with the mouse event. On 3 juin, 13:23, guna gunaz...@gmail.com wrote: Ask clearly your questions On Wed, Jun 3, 2009 at 4:45 PM, Tom thomas.coz...@gmail.com wrote: I just want to notice that the Layout for the ArrayAdapter contains checkbox. On 3 juin, 11:33, Tom thomas.coz...@gmail.com wrote: Ok I added to my class implements AdapterView.OnItemClickListener. Then I implemented onItemClickListener method and added in onCreate setOnClickListener(this). Now I can select and highlight items but only with the trackball. Nothing happens with the mouse event. May have implement OnItemSelectedListener too ? Thanks Tom On 2 juin, 16:47, guna gunaz...@gmail.com wrote: Tom, You didnt implements OnItemClickListener, and also in oncreate add setonitemclicklistener(this) On Tue, Jun 2, 2009 at 8:10 PM, Tom thomas.coz...@gmail.com wrote: These are my line of codings : public class UserList extends ListActivity{ private Client client; private ArrayListUser users = new ArrayListUser(); private UserAdapter userAdapter; public static final int MENU_ITEM_VIEW = Menu.FIRST; private static final int COLUMN_INDEX_TITLE = 1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.user_list); Intent i = getIntent(); if (i!= null) { if (i.getAction().equalsIgnoreCase(Intent.ACTION_VIEW)) { this.client = (Client) i.getSerializableExtra (Constants.CLIENT_CLASS_NAME); this.userAdapter = new UserAdapter(this, R.layout.user_row, users); users = (ArrayListUser) this.client.getUsers(); for(int j=0;jusers.size();j++) { this.userAdapter.add(users.get(j)); } setListAdapter(this.userAdapter); } } } private class UserAdapter extends ArrayAdapterUser{ private LayoutInflater mInflater; private ArrayListUser items; public UserAdapter(Context context, int resourceId, ArrayListUser items) { super(context, resourceId, items); mInflater = LayoutInflater.from(context); this.items = items; } public boolean areAllItemsSelectable() { return true; } public boolean isEnabled(int position) { if (position = 0 position = items.size()) { return true; } return false; } public int getCount() { return items.size(); } public User getItem(int position) { if (0 == position) { return null; } return items.get(position); } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; View v = convertView; User user = items.get(position); if (v == null) { mInflater = (LayoutInflater)getSystemService (Context.LAYOUT_INFLATER_SERVICE); v = mInflater.inflate(R.layout.user_row, null); if (user != null) { // Creates a ViewHolder and store references to the two children views // we want to bind data to. holder = new ViewHolder(); holder.firstNameText = (TextView) v.findViewById (R.id.user_first_name); holder.lastNameText = (TextView) v.findViewById (R.id.user_last_name); holder.phoneNumberText = (TextView) v.findViewById (R.id.user_phone_number); holder.statusText = (TextView) v.findViewById (R.id.user_status); } v.setTag(holder); } else {
[android-developers] Re: Licensing an Android application programatically.
Thanks so much for the detailed suggestions. I really appreciate it. Basically, the web based alternative will require the users of the application to run it with an internet connection. My app is a telco application, usually tested in an isolated lab environment on a private LAN. Performance may be an issue, as you guys correctly pointed out..but for an evaluation copy..it may be acceptable. For the real production ready (paid app), i wont use such a license. But still, i want to understand the performance penalty on using a client side licence solution. Is it that heavy that it will impair the performance of my app? if i remember correctly, i think the android app certificate needs to be assigned a validity date..and it can be password protected. Maybe it can be utilized for my needs? aayush On Jun 3, 10:09 am, mobilekid mobilek...@googlemail.com wrote: I would do the same. Get the android ID like this: String android_id = android.provider.Settings.System.getString (this.getContentResolver(), android.provider.Settings.System.ANDROID_ID); Then send it to your back-end and query the number of times you've made the same call or the date you firstly made a call against the unique ID. Hope it helps! On Jun 3, 11:02 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: if i were u if my app already interacts with the web then i'll initially hit a url from the app with may the phone's unique id... i'll take care of everythin else at the web-side... this will make sure that there's not much change in my app's performance... but i dont exactly no if an android phone has any sort of unique id the possibilities to get such an id... if not the id u may go for the google acc registered with the phone... but this may have some limitations... On Wed, Jun 3, 2009 at 3:20 PM, aayush abhatnagar192...@gmail.com wrote: okay..thanks for the answer Marc. For #1 i believe i need to create my own certificate by using the keytool utility and sign it as you suggest. Time based is my only requirement..as of now. Usage based is not a priority for me. aayush On Jun 3, 2:34 pm, Marc Lester Tan mail...@gmail.com wrote: Hi, # 1 - I believe you can do this when signing your certificate. # 2 - you can store the number of times your app is invoked on the Preferences then just check if it already exceeds your limit but then it can easily be broken by just uninstalling the application and download it again. I haven't tried this yet. Just my idea. Marc 2. Usage based ( 100 invocations of the application). On Wed, Jun 3, 2009 at 5:24 PM, aayush abhatnagar192...@gmail.com wrote: Hello list.. I had a query: If i wish to attach an evaluation license to my android application, how can that be achieved ? As for example, i may want to provide an evaluation license based application that expires in one of the following ways: 1. Time based (30 days etc) 2. Usage based ( 100 invocations of the application). Once the application's license expires, i need to restrict access to it from the user. Thanks in advance.. Best Regards aayush -- Regards, Sujay George Bernard Shawhttp://www.brainyquote.com/quotes/authors/g/george_bernard_shaw.html - A government that robs Peter to pay Paul can always depend on the support of Paul. --~--~-~--~~~---~--~~ 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: Licensing an Android application programatically.
For one thing, it's Secure.ANDROID_ID not System.ANDROID_ID. But the documentation on that is a bit vague. It seems to be related to your Google login information, so that brings up two questions: 1. is it sensitive information? 2. does it change if you log in to another Google account? On Jun 3, 12:09 pm, mobilekid mobilek...@googlemail.com wrote: I would do the same. Get the android ID like this: String android_id = android.provider.Settings.System.getString (this.getContentResolver(), android.provider.Settings.System.ANDROID_ID); Then send it to your back-end and query the number of times you've made the same call or the date you firstly made a call against the unique ID. Hope it helps! On Jun 3, 11:02 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: if i were u if my app already interacts with the web then i'll initially hit a url from the app with may the phone's unique id... i'll take care of everythin else at the web-side... this will make sure that there's not much change in my app's performance... but i dont exactly no if an android phone has any sort of unique id the possibilities to get such an id... if not the id u may go for the google acc registered with the phone... but this may have some limitations... On Wed, Jun 3, 2009 at 3:20 PM, aayush abhatnagar192...@gmail.com wrote: okay..thanks for the answer Marc. For #1 i believe i need to create my own certificate by using the keytool utility and sign it as you suggest. Time based is my only requirement..as of now. Usage based is not a priority for me. aayush On Jun 3, 2:34 pm, Marc Lester Tan mail...@gmail.com wrote: Hi, # 1 - I believe you can do this when signing your certificate. # 2 - you can store the number of times your app is invoked on the Preferences then just check if it already exceeds your limit but then it can easily be broken by just uninstalling the application and download it again. I haven't tried this yet. Just my idea. Marc 2. Usage based ( 100 invocations of the application). On Wed, Jun 3, 2009 at 5:24 PM, aayush abhatnagar192...@gmail.com wrote: Hello list.. I had a query: If i wish to attach an evaluation license to my android application, how can that be achieved ? As for example, i may want to provide an evaluation license based application that expires in one of the following ways: 1. Time based (30 days etc) 2. Usage based ( 100 invocations of the application). Once the application's license expires, i need to restrict access to it from the user. Thanks in advance.. Best Regards aayush -- Regards, Sujay George Bernard Shawhttp://www.brainyquote.com/quotes/authors/g/george_bernard_shaw.html - A government that robs Peter to pay Paul can always depend on the support of Paul. --~--~-~--~~~---~--~~ 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: Licensing an Android application programatically.
aayush, if u r goin for client-side implementations then i'm very sure that there're many workarounds... one of it was mentioned by marc earlier... N plz be clear whether ur app is standalone or does it make use of web in ur LAN?? On Wed, Jun 3, 2009 at 5:15 PM, Neil neilb...@gmail.com wrote: For one thing, it's Secure.ANDROID_ID not System.ANDROID_ID. But the documentation on that is a bit vague. It seems to be related to your Google login information, so that brings up two questions: 1. is it sensitive information? 2. does it change if you log in to another Google account? On Jun 3, 12:09 pm, mobilekid mobilek...@googlemail.com wrote: I would do the same. Get the android ID like this: String android_id = android.provider.Settings.System.getString (this.getContentResolver(), android.provider.Settings.System.ANDROID_ID); Then send it to your back-end and query the number of times you've made the same call or the date you firstly made a call against the unique ID. Hope it helps! On Jun 3, 11:02 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: if i were u if my app already interacts with the web then i'll initially hit a url from the app with may the phone's unique id... i'll take care of everythin else at the web-side... this will make sure that there's not much change in my app's performance... but i dont exactly no if an android phone has any sort of unique id the possibilities to get such an id... if not the id u may go for the google acc registered with the phone... but this may have some limitations... On Wed, Jun 3, 2009 at 3:20 PM, aayush abhatnagar192...@gmail.com wrote: okay..thanks for the answer Marc. For #1 i believe i need to create my own certificate by using the keytool utility and sign it as you suggest. Time based is my only requirement..as of now. Usage based is not a priority for me. aayush On Jun 3, 2:34 pm, Marc Lester Tan mail...@gmail.com wrote: Hi, # 1 - I believe you can do this when signing your certificate. # 2 - you can store the number of times your app is invoked on the Preferences then just check if it already exceeds your limit but then it can easily be broken by just uninstalling the application and download it again. I haven't tried this yet. Just my idea. Marc 2. Usage based ( 100 invocations of the application). On Wed, Jun 3, 2009 at 5:24 PM, aayush abhatnagar192...@gmail.com wrote: Hello list.. I had a query: If i wish to attach an evaluation license to my android application, how can that be achieved ? As for example, i may want to provide an evaluation license based application that expires in one of the following ways: 1. Time based (30 days etc) 2. Usage based ( 100 invocations of the application). Once the application's license expires, i need to restrict access to it from the user. Thanks in advance.. Best Regards aayush -- Regards, Sujay George Bernard Shaw http://www.brainyquote.com/quotes/authors/g/george_bernard_shaw.html - A government that robs Peter to pay Paul can always depend on the support of Paul. -- Regards, Sujay H. L. Mencken http://www.brainyquote.com/quotes/authors/h/h_l_mencken.html - Nobody ever went broke underestimating the taste of the American public. --~--~-~--~~~---~--~~ 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: Licensing an Android application programatically.
N one of my friends suggested that u make use of the serial key system for differentiating bet licensed unlicensed users... it sounds good... the first time a user uses ur app... jus ask for their key... also have an option for evaluate.. if the user selects evaluate set a preference to null string or if the user enters a correct key set it to smthin else... the key validation is a onetime job... so i guess this will also not bother ur performance... On Wed, Jun 3, 2009 at 5:26 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: aayush, if u r goin for client-side implementations then i'm very sure that there're many workarounds... one of it was mentioned by marc earlier... N plz be clear whether ur app is standalone or does it make use of web in ur LAN?? On Wed, Jun 3, 2009 at 5:15 PM, Neil neilb...@gmail.com wrote: For one thing, it's Secure.ANDROID_ID not System.ANDROID_ID. But the documentation on that is a bit vague. It seems to be related to your Google login information, so that brings up two questions: 1. is it sensitive information? 2. does it change if you log in to another Google account? On Jun 3, 12:09 pm, mobilekid mobilek...@googlemail.com wrote: I would do the same. Get the android ID like this: String android_id = android.provider.Settings.System.getString (this.getContentResolver(), android.provider.Settings.System.ANDROID_ID); Then send it to your back-end and query the number of times you've made the same call or the date you firstly made a call against the unique ID. Hope it helps! On Jun 3, 11:02 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: if i were u if my app already interacts with the web then i'll initially hit a url from the app with may the phone's unique id... i'll take care of everythin else at the web-side... this will make sure that there's not much change in my app's performance... but i dont exactly no if an android phone has any sort of unique id the possibilities to get such an id... if not the id u may go for the google acc registered with the phone... but this may have some limitations... On Wed, Jun 3, 2009 at 3:20 PM, aayush abhatnagar192...@gmail.com wrote: okay..thanks for the answer Marc. For #1 i believe i need to create my own certificate by using the keytool utility and sign it as you suggest. Time based is my only requirement..as of now. Usage based is not a priority for me. aayush On Jun 3, 2:34 pm, Marc Lester Tan mail...@gmail.com wrote: Hi, # 1 - I believe you can do this when signing your certificate. # 2 - you can store the number of times your app is invoked on the Preferences then just check if it already exceeds your limit but then it can easily be broken by just uninstalling the application and download it again. I haven't tried this yet. Just my idea. Marc 2. Usage based ( 100 invocations of the application). On Wed, Jun 3, 2009 at 5:24 PM, aayush abhatnagar192...@gmail.com wrote: Hello list.. I had a query: If i wish to attach an evaluation license to my android application, how can that be achieved ? As for example, i may want to provide an evaluation license based application that expires in one of the following ways: 1. Time based (30 days etc) 2. Usage based ( 100 invocations of the application). Once the application's license expires, i need to restrict access to it from the user. Thanks in advance.. Best Regards aayush -- Regards, Sujay George Bernard Shaw http://www.brainyquote.com/quotes/authors/g/george_bernard_shaw.html - A government that robs Peter to pay Paul can always depend on the support of Paul. -- Regards, Sujay H. L. Menckenhttp://www.brainyquote.com/quotes/authors/h/h_l_mencken.html - Nobody ever went broke underestimating the taste of the American public. -- Regards, Sujay Mark Twain http://www.brainyquote.com/quotes/authors/m/mark_twain.html - There is no sadder sight than a young pessimist. --~--~-~--~~~---~--~~ 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] wait till layout is shown
Hi, i have a main activity that needs quit a lot to load so i thought about a trick: i call a intropage that shows a pic and from directly it calls by intent the long loading page. Finaly I thought I would see the pic and in the background the other intent is loading, when its done the intro page dissapear automaticly and voila. (yes i thought i am very clever ) But now i see, that the Intro Page does not come initialized at all. I see in the header that the intro page is active, but the pic is not shown. immediatly it loads the main intent. So i guess i have to options.. make a small wait (but how) that the pic from the intro is finaly shown.. or more professional I have the option to request from windowmanager or so, if the layout from the intro is full shown. Only when that is done, I would call the Intent to start the main activity. Any Ideas? Thanks Chris --~--~-~--~~~---~--~~ 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: Licensing an Android application programatically.
But a drawback is that if not properly checked,the same key could be used with any no of ur apps... On Wed, Jun 3, 2009 at 5:29 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: N one of my friends suggested that u make use of the serial key system for differentiating bet licensed unlicensed users... it sounds good... the first time a user uses ur app... jus ask for their key... also have an option for evaluate.. if the user selects evaluate set a preference to null string or if the user enters a correct key set it to smthin else... the key validation is a onetime job... so i guess this will also not bother ur performance... On Wed, Jun 3, 2009 at 5:26 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: aayush, if u r goin for client-side implementations then i'm very sure that there're many workarounds... one of it was mentioned by marc earlier... N plz be clear whether ur app is standalone or does it make use of web in ur LAN?? On Wed, Jun 3, 2009 at 5:15 PM, Neil neilb...@gmail.com wrote: For one thing, it's Secure.ANDROID_ID not System.ANDROID_ID. But the documentation on that is a bit vague. It seems to be related to your Google login information, so that brings up two questions: 1. is it sensitive information? 2. does it change if you log in to another Google account? On Jun 3, 12:09 pm, mobilekid mobilek...@googlemail.com wrote: I would do the same. Get the android ID like this: String android_id = android.provider.Settings.System.getString (this.getContentResolver(), android.provider.Settings.System.ANDROID_ID); Then send it to your back-end and query the number of times you've made the same call or the date you firstly made a call against the unique ID. Hope it helps! On Jun 3, 11:02 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: if i were u if my app already interacts with the web then i'll initially hit a url from the app with may the phone's unique id... i'll take care of everythin else at the web-side... this will make sure that there's not much change in my app's performance... but i dont exactly no if an android phone has any sort of unique id the possibilities to get such an id... if not the id u may go for the google acc registered with the phone... but this may have some limitations... On Wed, Jun 3, 2009 at 3:20 PM, aayush abhatnagar192...@gmail.com wrote: okay..thanks for the answer Marc. For #1 i believe i need to create my own certificate by using the keytool utility and sign it as you suggest. Time based is my only requirement..as of now. Usage based is not a priority for me. aayush On Jun 3, 2:34 pm, Marc Lester Tan mail...@gmail.com wrote: Hi, # 1 - I believe you can do this when signing your certificate. # 2 - you can store the number of times your app is invoked on the Preferences then just check if it already exceeds your limit but then it can easily be broken by just uninstalling the application and download it again. I haven't tried this yet. Just my idea. Marc 2. Usage based ( 100 invocations of the application). On Wed, Jun 3, 2009 at 5:24 PM, aayush abhatnagar192...@gmail.com wrote: Hello list.. I had a query: If i wish to attach an evaluation license to my android application, how can that be achieved ? As for example, i may want to provide an evaluation license based application that expires in one of the following ways: 1. Time based (30 days etc) 2. Usage based ( 100 invocations of the application). Once the application's license expires, i need to restrict access to it from the user. Thanks in advance.. Best Regards aayush -- Regards, Sujay George Bernard Shaw http://www.brainyquote.com/quotes/authors/g/george_bernard_shaw.html - A government that robs Peter to pay Paul can always depend on the support of Paul. -- Regards, Sujay H. L. Menckenhttp://www.brainyquote.com/quotes/authors/h/h_l_mencken.html - Nobody ever went broke underestimating the taste of the American public. -- Regards, Sujay Mark Twain http://www.brainyquote.com/quotes/authors/m/mark_twain.html - There is no sadder sight than a young pessimist. -- Regards, Sujay H. L. Mencken http://www.brainyquote.com/quotes/authors/h/h_l_mencken.html - Nobody ever went broke underestimating the taste of the American public. --~--~-~--~~~---~--~~ 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
[android-developers] java.lang.VerifyError - please help me some one
Hi friends, I have written an application which uses 3rd party library .jar files. This app worked fine for android 1.0 supported devices. But when I ran the same app on android 1.5 supported device (ADP 1.5), I got the java.lang.VerifyError. Can any one please help me to solve this? Thanks, Manoj. --~--~-~--~~~---~--~~ 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: help with google accounts
Has anyone tried this in 1.5??? i'm plannin to move on to 1.5... jus wanted to make sure it works there as well... On Tue, Jun 2, 2009 at 10:27 AM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Ya guys sorry for the mistake... was sleepy when i posted that... 2009/6/1 Luis Alberto Pérez García lui...@gmail.com You can put them... just in case ;) El lun, 01-06-2009 a las 13:22 +0530, Sujay Krishna Suresh escribió: I'm actually able to get the list of accounts registered in my app... its finally workin now... :) if anyone needs the samethin... feel free to ask... i'll give u the steps to get the registered google accounts... On Mon, Jun 1, 2009 at 1:06 PM, admin.androidsl...@googlemail.com admin.androidsl...@googlemail.com wrote: You will need to wait for an official response from a google dev but my two cents worth is that I remember somewhere this feature is disabled for security reasons. Try searching this group I think it was discussed once before. On Jun 1, 6:47 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Plz respond... i need it asap... I dont want my app users to be entering their G acc info in my app again... when i add uses-permission android:name=android.permission.GET_ACCOUNTS/uses-permission to my manifest file i get an extra app permission sayin Your Google Accounts discover known accounts does anyone no how i can use this permission to actually get the acc details??? On Mon, Jun 1, 2009 at 10:25 AM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: hi, i want to get the google account which has been registered in the phone... the one that all the google apps use... is their any means to get hold of the username of the google account??? -- Regards, Sujay W. C. Fields http://www.brainyquote.com/quotes/authors/w/w_c_fields.html - I am free of all prejudices. I hate every one equally. -- Regards, Sujay -- Regards, Sujay Groucho Marx - A hospital bed is a parked taxi with the meter running. -- Regards, Sujay George Bernard Shawhttp://www.brainyquote.com/quotes/authors/g/george_bernard_shaw.html - A government that robs Peter to pay Paul can always depend on the support of Paul. -- Regards, Sujay Mark Twain http://www.brainyquote.com/quotes/authors/m/mark_twain.html - There is no sadder sight than a young pessimist. --~--~-~--~~~---~--~~ 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: wait till layout is shown
i even tried to place my startactivity for the main activity in onSTART but still my intro pics on the intro page are not shown. immediatly it starts the mainactivity... --~--~-~--~~~---~--~~ 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] No intent to terminate(end) the call programmatically
Hi all, Is android supports the terminating the phone call programmatically using either intent or any APi ? If not now then can we see one of the above in the future sdks?? Regards, Asif --~--~-~--~~~---~--~~ 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: No intent to terminate(end) the call programmatically
Asif k wrote: Is android supports the terminating the phone call programmatically using either intent or any APi ? No. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ 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 we go back to older versions?
Hi everyone, i upgraded my adp1 to 1.5... once the reboot was complete many of my apps stopped workin... now i wanna go back to 1.1... how do i do this?? -- Regards, Sujay George Bernard Shawhttp://www.brainyquote.com/quotes/authors/g/george_bernard_shaw.html - A government that robs Peter to pay Paul can always depend on the support of Paul. --~--~-~--~~~---~--~~ 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: Licensing an Android application programatically.
Yes...sounds neat indeed.. On Jun 3, 12:09 pm, mobilekid mobilek...@googlemail.com wrote: I would do the same. Get the android ID like this: String android_id = android.provider.Settings.System.getString (this.getContentResolver(), android.provider.Settings.System.ANDROID_ID); Then send it to your back-end and query the number of times you've made the same call or the date you firstly made a call against the unique ID. Hope it helps! On Jun 3, 11:02 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: if i were u if my app already interacts with the web then i'll initially hit a url from the app with may the phone's unique id... i'll take care of everythin else at the web-side... this will make sure that there's not much change in my app's performance... but i dont exactly no if an android phone has any sort of unique id the possibilities to get such an id... if not the id u may go for the google acc registered with the phone... but this may have some limitations... On Wed, Jun 3, 2009 at 3:20 PM, aayush abhatnagar192...@gmail.com wrote: okay..thanks for the answer Marc. For #1 i believe i need to create my own certificate by using the keytool utility and sign it as you suggest. Time based is my only requirement..as of now. Usage based is not a priority for me. aayush On Jun 3, 2:34 pm, Marc Lester Tan mail...@gmail.com wrote: Hi, # 1 - I believe you can do this when signing your certificate. # 2 - you can store the number of times your app is invoked on the Preferences then just check if it already exceeds your limit but then it can easily be broken by just uninstalling the application and download it again. I haven't tried this yet. Just my idea. Marc 2. Usage based ( 100 invocations of the application). On Wed, Jun 3, 2009 at 5:24 PM, aayush abhatnagar192...@gmail.com wrote: Hello list.. I had a query: If i wish to attach an evaluation license to my android application, how can that be achieved ? As for example, i may want to provide an evaluation license based application that expires in one of the following ways: 1. Time based (30 days etc) 2. Usage based ( 100 invocations of the application). Once the application's license expires, i need to restrict access to it from the user. Thanks in advance.. Best Regards aayush -- Regards, Sujay George Bernard Shaw http://www.brainyquote.com/quotes/authors/g/george_bernard_shaw.html - A government that robs Peter to pay Paul can always depend on the support of Paul. -- Regards, Sujay H. L. Menckenhttp://www.brainyquote.com/quotes/authors/h/h_l_mencken.html - Nobody ever went broke underestimating the taste of the American public. -- Regards, Sujay Mark Twain http://www.brainyquote.com/quotes/authors/m/mark_twain.html - There is no sadder sight than a young pessimist. -- Regards, Sujay H. L. Mencken http://www.brainyquote.com/quotes/authors/h/h_l_mencken.html - Nobody ever went broke underestimating the taste of the American public. --~--~-~--~~~---~--~~ 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: Clarification on static variables
Peter Carpenter wrote: And this is where my question lies… What happens to the static variables? They are definitely gone when the process is terminated. Things get a bit murky if all components are stopped, since outside forces (e.g., broadcast intents) might trigger your code again, and it might use the same process if that process is still hanging around. This is one of the many reasons to avoid static variables wherever possible. Meaning that a restart of a service does not guarantee a new set of initialised static variables. Correct. Unfortunately the code I’m porting includes lots of static references that assumes an initial clean state and leaves the JVM to clear everything as it’s stopped and started. L Launch a string of expletives in the general direction of the original author. Unless that author is you, of course. ;-) Am I forced to pore over this code with a fine tooth comb and ensure that the static variables are initialised correctly (LOTS of work) Better yet, get rid of the static variables. or is there some kind of (dirty) shortcut that I can use that will allow me to effectively unload the application (on activity exit?) forcing the ‘jvm’ to reinitialise the static variables on next activity startup? You can force-terminate your process via System.exit(). Some people have had success with that technique. However, bear in mind this will kill off anything that is running in your process, so unless you have absolute control over when and how your components run, you might clobber something trying to do some work. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ 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: Attempt to include a core VM class in something other...
markdsievers wrote: Just a bump...Same situation, upgrading Android and have ended up with this problem. Someone in the next cubicle has the same project working, so will post the solution shortly... The error message is fairly self-explanatory in terms of what to do, though the better answer is to not try adding classes in the java.* or javax.* namespaces. In the OP's case, if I am reading their stack trace correctly, they were trying to add java.security.cert.CertPathParameters, perhaps from Apache Harmony, and Android's build tools will not appreciate that. In part, that is because Android 1.5 already has an implementation of this interface. You can use classes pulled from Harmony, but you need to modify them (and the code that uses them) to put them in another namespace. Bear in mind that if you do follow the error message's instructions and use --core-library to attempt to get past this message, your application may break in future versions of Android, if they happen to include the same class you're trying to load and the implementations are not compatible. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ 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: items can't be selected (or highlighted)
public class UserList extends ListActivity implements AdapterView.OnItemClickListener{ private Client client; private ArrayListUser users = new ArrayListUser(); private UserAdapter userAdapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.user_list); getListView().setItemsCanFocus(false); getListView().setOnItemClickListener(this); Intent i = getIntent(); if (i!= null) { if (i.getAction().equalsIgnoreCase(Intent.ACTION_VIEW)) { this.client = (Client) i.getSerializableExtra (Constants.CLIENT_CLASS_NAME); this.userAdapter = new UserAdapter(this, R.layout.user_row, users); users = (ArrayListUser) this.client.getUsers(); Log.i(getClass().getSimpleName(),Display users); for(int j=0;jusers.size();j++) { this.userAdapter.add(users.get(j)); } setListAdapter(this.userAdapter); } } } @Override public void onItemClick(AdapterView? adapterView, View view, int position, long id) { Log.d(getClass().getSimpleName(), -- Click -- ); } // Adapter private class UserAdapter extends ArrayAdapterUser { private LayoutInflater mInflater; private ArrayListUser items; public UserAdapter(Context context, int resourceId, ArrayListUser items) { super(context, resourceId, items); mInflater = LayoutInflater.from(context); this.items = items; } public boolean areAllItemsSelectable() { return true; } public boolean isEnabled(int position) { if (position = 0 position = items.size()) { return true; } return false; } public int getCount() { return items.size(); } public User getItem(int position) { if (0 == position) { return null; } return items.get(position); } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; View v = convertView; User user = items.get(position); if (v == null) { mInflater = (LayoutInflater)getSystemService (Context.LAYOUT_INFLATER_SERVICE); v = mInflater.inflate(R.layout.user_row, null); if (user != null) { // Creates a ViewHolder and store references to the two children views // we want to bind data to. holder = new ViewHolder(); holder.firstNameText = (TextView) v.findViewById (R.id.user_first_name); holder.lastNameText = (TextView) v.findViewById (R.id.user_last_name); holder.phoneNumberText = (TextView) v.findViewById (R.id.user_phone_number); holder.statusText = (TextView) v.findViewById (R.id.user_status); } v.setTag(holder); } else { holder = (ViewHolder) v.getTag(); } if (holder.firstNameText != null) { holder.firstNameText.setText(user.getFirstName()); } if (holder.lastNameText != null){ holder.lastNameText.setText(user.getLastName()); } if ( holder.phoneNumberText != null){ holder.phoneNumberText.setText(user.getPhoneNumber()); } if (holder.statusText != null){ holder.statusText.setText(String.valueOf(user.getStatus ())); } return v; } class ViewHolder { TextView firstNameText; TextView lastNameText; TextView phoneNumberText; TextView statusText; } public long getItemId(int position) { return position; } } On 3 juin, 13:35, guna gunaz...@gmail.com wrote: Post your latest code... So that its easy to correct the errors Check whether enabled the listitems. On Wed, Jun 3, 2009 at 4:59 PM, Tom thomas.coz...@gmail.com wrote: I added to my class implements AdapterView.OnItemClickListener. Then I implemented onItemClickListener method and added in onCreate setOnClickListener(this). Now I can select and highlight items but only with the trackball. Nothing happens with the mouse event. On 3 juin, 13:23, guna gunaz...@gmail.com wrote: Ask clearly your questions On Wed, Jun 3, 2009 at 4:45 PM, Tom thomas.coz...@gmail.com wrote: I just want to
[android-developers] Re: Passing pointer to AsyncTask that changes GUI to onRetainNonConfigurationInstance?
Thanks Streets Of Boston and Mike for your replies and ideas. I managed to solve this problem with your help. After some testing i made a Service which executes my tasks. When a task has a result i send the results to the activity which called the function on the service. When the screen rotates i null the activity pointer in the service and on the oncreate i set the activity pointer to the current activity. If a task finishes with a result while the screen is rotating (ie activity pointer is null) i simply wait a couple seconds and see if the activity pointer is still null. The last step is still a bit crude, i might test a bit with lock/wait/ notify (if that works with services) or queuing results in the service. One problem with this whole setup that a service can only execute 1 task from 1 activity at a time. Cheers, Twan On Jun 3, 11:16 am, Mike Hearn mh.in.engl...@gmail.com wrote: If you look at Romain Guys Shelves app (where this class originates) he actually stops then restarts asynctasks when the screen rotates. This doesn't seem like a great way to go, as you throw away the progress. But as AsyncTasks have a reference to the activity, I can see why it's done. The whole configuration change means destruction thing has a lot of nasty side effects. I sometimes wonder if the gain in simplicity from not having to dynamically reload resources is worth it. The way I do something similar in my app is like Streets of Boston, basically have a callback interface that's stuffed into a static field. Of course you MUST be careful with locking, you can't just do something like: mCallback.showProgress(progress); because mCallback might have been set to null during the brief moment in which the screen is rotating. But then this is also wrong: if (mCallback != null) mCallback.showProgress(progress); because it has a race. So you need something like synchronized (some object) { if (mCallback != null) mCallback.showProgress(progress); } and then in your oncreate/ondestroy make sure you synchronize on that object when setting the value of mCallback. --~--~-~--~~~---~--~~ 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] Activity to service on click of BACK (arrow key on dev) and bring the same activity on click of notification
Hello android developers.. i am not much familiar with service's and use of aidl...here is the scenario i look to put fwd Kindly help on it...Working on android sdk 1.1 1) Activity is launched and location updates are taken and they are print on the activity using textview.. 2)On click of BACK (arrow key on dev) .. activity goes to destroy mode (which i dont want)...and call the service with dispatches the notification with the icon ..Still the location updates are ON.. 3)When i click the notification icon..i must get back the same activity which was getting the updates and updated values printed on the text view... I wonder is this possible .. i have gone through some apps such as My Tracks, Buddy Runner...which works well on this scenario... I hope some android developers give a favorable reply and help in solving the problem... I referred the LocalService and LocalServiceController examples from API demo ..but the activity is destroyed on the click of BACK ... Kindly help on this... Regards, Sheik --~--~-~--~~~---~--~~ 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: items can't be selected (or highlighted)
I'm sorry but it does'nt work. On 3 juin, 15:07, guna gunaz...@gmail.com wrote: getListView().setItemsCanFocus(true); Change to true as like this... it will work then On Wed, Jun 3, 2009 at 6:23 PM, Tom thomas.coz...@gmail.com wrote: public class UserList extends ListActivity implements AdapterView.OnItemClickListener{ private Client client; private ArrayListUser users = new ArrayListUser(); private UserAdapter userAdapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.user_list); getListView().setItemsCanFocus(false); getListView().setOnItemClickListener(this); Intent i = getIntent(); if (i!= null) { if (i.getAction().equalsIgnoreCase(Intent.ACTION_VIEW)) { this.client = (Client) i.getSerializableExtra (Constants.CLIENT_CLASS_NAME); this.userAdapter = new UserAdapter(this, R.layout.user_row, users); users = (ArrayListUser) this.client.getUsers(); Log.i(getClass().getSimpleName(),Display users); for(int j=0;jusers.size();j++) { this.userAdapter.add(users.get(j)); } setListAdapter(this.userAdapter); } } } @Override public void onItemClick(AdapterView? adapterView, View view, int position, long id) { Log.d(getClass().getSimpleName(), -- Click -- ); } // Adapter private class UserAdapter extends ArrayAdapterUser { private LayoutInflater mInflater; private ArrayListUser items; public UserAdapter(Context context, int resourceId, ArrayListUser items) { super(context, resourceId, items); mInflater = LayoutInflater.from(context); this.items = items; } public boolean areAllItemsSelectable() { return true; } public boolean isEnabled(int position) { if (position = 0 position = items.size()) { return true; } return false; } public int getCount() { return items.size(); } public User getItem(int position) { if (0 == position) { return null; } return items.get(position); } �...@override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; View v = convertView; User user = items.get(position); if (v == null) { mInflater = (LayoutInflater)getSystemService (Context.LAYOUT_INFLATER_SERVICE); v = mInflater.inflate(R.layout.user_row, null); if (user != null) { // Creates a ViewHolder and store references to the two children views // we want to bind data to. holder = new ViewHolder(); holder.firstNameText = (TextView) v.findViewById (R.id.user_first_name); holder.lastNameText = (TextView) v.findViewById (R.id.user_last_name); holder.phoneNumberText = (TextView) v.findViewById (R.id.user_phone_number); holder.statusText = (TextView) v.findViewById (R.id.user_status); } v.setTag(holder); } else { holder = (ViewHolder) v.getTag(); } if (holder.firstNameText != null) { holder.firstNameText.setText(user.getFirstName()); } if (holder.lastNameText != null){ holder.lastNameText.setText(user.getLastName()); } if ( holder.phoneNumberText != null){ holder.phoneNumberText.setText(user.getPhoneNumber()); } if (holder.statusText != null){ holder.statusText.setText(String.valueOf(user.getStatus ())); } return v; } class ViewHolder { TextView firstNameText; TextView lastNameText; TextView phoneNumberText; TextView statusText; } public long getItemId(int position) { return position; } } On 3 juin, 13:35, guna gunaz...@gmail.com wrote: Post your latest code... So that its easy to correct the errors Check whether enabled the listitems. On Wed, Jun 3, 2009 at 4:59 PM, Tom thomas.coz...@gmail.com wrote: I added to my class implements
[android-developers] Android Workflow
Hello, I try to develop a Android Application but I don't know how to handle the workflow. All examples are using one Activity and add some small functions. But how is it if I need a lot of more functions and views. I don't think that all should be in one activity, so I checked out the k9mail source code and let me inspire ;) I found this code: Accounts.actionLaunch(this); finish(); public static void actionLaunch(Context context) { Intent intent = new Intent(context, Accounts.class); intent.putExtra(EXTRA_STARTUP, true); context.startActivity(intent); } The start from a activity another and destroy the other. So is that the correct workflow of developing apps in android? Or is all functions in one activity recommend? Thanks for help. PS: I am a struts developer so I mostly create for a new part of my app a new action. So iam realy confuse with the 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: Use a new USB vid, How to support adb tools in linux, like Ubuntu
Resolved! --~--~-~--~~~---~--~~ 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: Licensing an Android application programatically.
Excellent Al. Looks great. -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of aayush Sent: 03 June 2009 14:05 To: Android Developers Subject: [android-developers] Re: Licensing an Android application programatically. I am still in the requirements gathering stage, trying to make some use cases for the licensing requirements. Starting this thread really helped. For understanding and reference..i am using this resource: http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html On Jun 3, 12:41 pm, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: btw aayush... if u r plannin to implement this can u plz temme how u r checkin the validity of a key?? 'm very bad with cryptography... On Wed, Jun 3, 2009 at 6:04 PM, aayush abhatnagar192...@gmail.com wrote: Yes...sounds neat indeed.. On Jun 3, 12:09 pm, mobilekid mobilek...@googlemail.com wrote: I would do the same. Get the android ID like this: String android_id = android.provider.Settings.System.getString (this.getContentResolver(), android.provider.Settings.System.ANDROID_ID); Then send it to your back-end and query the number of times you've made the same call or the date you firstly made a call against the unique ID. Hope it helps! On Jun 3, 11:02 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: if i were u if my app already interacts with the web then i'll initially hit a url from the app with may the phone's unique id... i'll take care of everythin else at the web-side... this will make sure that there's not much change in my app's performance... but i dont exactly no if an android phone has any sort of unique id the possibilities to get such an id... if not the id u may go for the google acc registered with the phone... but this may have some limitations... On Wed, Jun 3, 2009 at 3:20 PM, aayush abhatnagar192...@gmail.com wrote: okay..thanks for the answer Marc. For #1 i believe i need to create my own certificate by using the keytool utility and sign it as you suggest. Time based is my only requirement..as of now. Usage based is not a priority for me. aayush On Jun 3, 2:34 pm, Marc Lester Tan mail...@gmail.com wrote: Hi, # 1 - I believe you can do this when signing your certificate. # 2 - you can store the number of times your app is invoked on the Preferences then just check if it already exceeds your limit but then it can easily be broken by just uninstalling the application and download it again. I haven't tried this yet. Just my idea. Marc 2. Usage based ( 100 invocations of the application). On Wed, Jun 3, 2009 at 5:24 PM, aayush abhatnagar192...@gmail.com wrote: Hello list.. I had a query: If i wish to attach an evaluation license to my android application, how can that be achieved ? As for example, i may want to provide an evaluation license based application that expires in one of the following ways: 1. Time based (30 days etc) 2. Usage based ( 100 invocations of the application). Once the application's license expires, i need to restrict access to it from the user. Thanks in advance.. Best Regards aayush -- Regards, Sujay George Bernard Shaw http://www.brainyquote.com/quotes/authors/g/george_bernard_shaw.html - A government that robs Peter to pay Paul can always depend on the support of Paul. -- Regards, Sujay H. L. Mencken http://www.brainyquote.com/quotes/authors/h/h_l_mencken.html - Nobody ever went broke underestimating the taste of the American public. -- Regards, Sujay Mark Twain http://www.brainyquote.com/quotes/authors/m/mark_twain.html - There is no sadder sight than a young pessimist. -- Regards, Sujay H. L. Mencken http://www.brainyquote.com/quotes/authors/h/h_l_mencken.html - Nobody ever went broke underestimating the taste of the American public. -- Regards, Sujay H. L. Mencken http://www.brainyquote.com/quotes/authors/h/h_l_mencken.html - Nobody ever went broke underestimating the taste of the American public. --~--~-~--~~~---~--~~ 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
[android-developers] Re: Clarification on static variables
I completely agree with Mark: Better yet, get rid of the static variables. Peter, if possible, it may be 'easier' to change all your non-constant static variable to member variables of your activity/service by refactoring. When you activity/service is destroyed, these variables will go too. If you still need static access to these variable from other classes, you can have just one static variable: The currently active instance of your activity/service. Be sure to set this one to null when onDestroy is called. In MyActivity: public static MyActivity ACTIVE_INSTANCE; onCreate(...) { ACTIVE_INSTANCE = this; ... } onDestroy() { ACTIVE_INSTANCE = null; ... } (Note this will work only if this activity is the only one in your process. Otherwise, use the onResume and onPause instead). Other code can now get to your 'static' variables by calling 'ACTIVE_INSTANCE.previouslyStaticVar' On Jun 3, 8:35 am, Mark Murphy mmur...@commonsware.com wrote: Peter Carpenter wrote: And this is where my question lies… What happens to the static variables? They are definitely gone when the process is terminated. Things get a bit murky if all components are stopped, since outside forces (e.g., broadcast intents) might trigger your code again, and it might use the same process if that process is still hanging around. This is one of the many reasons to avoid static variables wherever possible. Meaning that a restart of a service does not guarantee a new set of initialised static variables. Correct. Unfortunately the code I’m porting includes lots of static references that assumes an initial clean state and leaves the JVM to clear everything as it’s stopped and started. L Launch a string of expletives in the general direction of the original author. Unless that author is you, of course. ;-) Am I forced to pore over this code with a fine tooth comb and ensure that the static variables are initialised correctly (LOTS of work) Better yet, get rid of the static variables. or is there some kind of (dirty) shortcut that I can use that will allow me to effectively unload the application (on activity exit?) forcing the ‘jvm’ to reinitialise the static variables on next activity startup? You can force-terminate your process via System.exit(). Some people have had success with that technique. However, bear in mind this will kill off anything that is running in your process, so unless you have absolute control over when and how your components run, you might clobber something trying to do some work. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ 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: Clarification on static variables
Streets Of Boston wrote: If you still need static access to these variable from other classes, you can have just one static variable: The currently active instance of your activity/service. Be sure to set this one to null when onDestroy is called. I agree with Mr. Boston (pssst...can I call you Streets? ;-) I have a slight preference for keeping a static reference to the service, rather than the activity. Services are naturally singletons: you'll either have zero or one of them. You *could* have more that one instance of your activity going, which might complicate a single static reference. Hence, if it's six of one/half dozen of the other, I'd lean towards putting the static reference on the service. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ 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: Problem with getChildCount method???
You have to do this through your BaseAdapter. Make sure that your BaseAdapter's individual elements/items have a variable that can determine if one is checked or not. If you want to check-mark all your list-item item's, run through every element in your BaseAdapter. Set every element to 'isChecked' (or call whatever variable/method is available on your element's class to make it checked). Then call the BaseAdapter's 'notifyDataSetChanged()'. This will cause your BaseAdapter's method 'getView()' to be called for all (visible) list-items: Using the 'position' (paramater of 'getView'), get the BaseAdapter's element on that position. Then query that element: if it is checked, check the list-view- item's checkbox. If not, clear this checkbox. On Jun 2, 12:27 am, dark_messiah ricky.dreamwea...@gmail.com wrote: I have problem...i m using a base adapter for binding a data from array to listviewthe listview has a checkbox with it...i wanted to create a menu to select all or deselect all view inside that list...but the getchildCount method is behaving abnormally..i m not able to get the correct child count...can anybody help me plz..??? .. .. public boolean onOptionsItemSelected(final MenuItem item) { if (item == mSelectAllItem ) { LayoutInflater mInflater = LayoutInflater.from(this); View view = (View)mInflater.inflate(R.layout.list_item, null); ListView listView = getListView(); int listItemCount = listView.getChildCount(); int listItemCount1 = listView.getCount(); System.out.println(Child Count in select all+listItemCount); System.out.println( Count in select all+listItemCount1); for( int j=0;jlistItemCount;j++ ) { CheckBox cbox=(CheckBox)((View)listView.getChildAt (j)).findViewById(R.id.alarmButton); if( !cbox.isChecked() ) { cbox.setChecked(true); System.out.println(TRUE); } else { System.out.println(FALSE); } } return true; } --~--~-~--~~~---~--~~ 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: setText for EditText is not working in 1.5
Great! But this tells me that Mark's hunch was correct. On Jun 3, 12:20 am, cindy ypu01...@yahoo.com wrote: After I switch the sequence of 2 lines, it is working. mEditText = (EditText)findViewById(R.id.text_edit); mEditText.setText(123456); mEditText.addTextChangedListener(new TextContentWatcher()); On Jun 2, 12:11 pm, Mark Murphy mmur...@commonsware.com wrote: There is no problem with addTextChangedListener. As long as I commented out mEditText.setText(123456), it is working. What does your stack trace tell you? -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Available!- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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] Fwd: Activity to service on click of BACK (arrow key on dev) and bring the same activity on click of notification
Hello android developers.. i am not much familiar with service's and use of aidl...here is the scenario i look to put fwd Kindly help on it...Working on android sdk 1.1 1) Activity is launched and location updates are taken and they are print on the activity using textview.. 2)On click of BACK (arrow key on dev) .. activity goes to destroy mode (which i dont want)...and call the service with dispatches the notification with the icon ..Still the location updates are ON.. 3)When i click the notification icon..i must get back the same activity which was getting the updates and updated values printed on the text view... I wonder is this possible .. i have gone through some apps such as My Tracks, Buddy Runner...which works well on this scenario... I hope some android developers give a favorable reply and help in solving the problem... I referred the LocalService and LocalServiceController examples from API demo ..but the activity is destroyed on the click of BACK ... Kindly help on this... Regards, Sheik -- Forwarded message -- From: sheik sheik...@gmail.com Date: Jun 3, 6:17 pm Subject: Activity to service on click of BACK (arrow key on dev) and bring the same activity on click of notification To: Android Developers Hello android developers.. i am not much familiar with service's and use of aidl...here is the scenario i look to put fwd Kindly help on it...Working on android sdk 1.1 1) Activity is launched and location updates are taken and they are print on the activity using textview.. 2)On click of BACK (arrow key on dev) .. activity goes to destroy mode (which i dont want)...and call the service with dispatches the notification with the icon ..Still the location updates are ON.. 3)When i click the notification icon..i must get back the same activity which was getting the updates and updated values printed on the text view... I wonder is this possible .. i have gone through some apps such as My Tracks, Buddy Runner...which works well on this scenario... I hope some android developers give a favorable reply and help in solving the problem... I referred the LocalService and LocalServiceController examples from API demo ..but the activity is destroyed on the click of BACK ... Kindly help on this... Regards, Sheik --~--~-~--~~~---~--~~ 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] Slow animation using SurfaceView
Hi all! I want to do an animation using a drawable and a surface view. I've tried with a View, but actually it runs really slow, so i tested with surface view, but i can see no changes (as slow as using a view). What i do is: set a PolyToPoly matrix concat that matrix draw a bitmap and repeat that until the animation has stopped. This is the code: private void doDraw(Canvas canvas) { Paint paint = mPaint; canvas.drawColor(Color.BLACK); canvas.save(); canvas.translate(getWidth() / 2, 20); canvas.restore(); if (isTurningLeft) { doDrawLeft(canvas, new float array); flipLeft(); } else if (isTurningRight) { doDrawRight(canvas, new float array); flipRight(); } else { doDrawStable(canvas); } } private void doDrawStable(Canvas canvas) { canvas.save(); canvas.drawBitmap(_bd, null, new RectF(0, 0, 160, 240), mPaint); canvas.restore(); } private void doDrawLeft(Canvas canvas, float dst[]) { canvas.save(); mMatrix.setPolyToPoly(initPos, 0, dst, 0, dst.length 1); canvas.concat(mMatrix); canvas.drawBitmap(_bd, null, new RectF(0, 0, 160, 240), mPaint); canvas.restore(); } private void doDrawRight(Canvas canvas, float dst[]) { canvas.save(); mMatrix.setPolyToPoly(initPos, 0, flippedPos, 0, dst.length 1); canvas.concat(mMatrix); mMatrix.setPolyToPoly(flippedPos, 0, dst, 0, dst.length 1); canvas.concat(mMatrix); canvas.drawBitmap(_bd, null, new RectF(0, 0, 160, 240), mPaint); canvas.restore(); } public void flipLeft() { //set new values to x,y,i //stop the animation if we have finished } public void flipRight() { //set new values to x,y,i //stop the animation if we have finished } Finally, we have this inside the thread: @Override public void run() { while (mRun) { Canvas c = null; try { c = mSurfaceHolder.lockCanvas(null); synchronized (mSurfaceHolder) { doDraw(c); } } finally { // do this in a finally so that if an exception is thrown // during the above, we don't leave the Surface in an // inconsistent state if (c != null) { mSurfaceHolder.unlockCanvasAndPost(c); } } } } It runs really slow!! Am I missing something? Any help is much 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@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: audio codec
I am having a problem retrieving codec output and listing the bytes. Following the Breno/Sparks thread I was able to get past the errors with initializing Audio Record and my code seems to run but I get all 0's as output. I assume I am missing something in AudioRecord.read? I am trying to look at the contents of the byte array (saveBytes) after recording has stopped. my code looks like this * // tune class (main display) RecordTone.setOnClickListener(new OnClickListener() { public void onClick(View v) { try { // init code recorder ar_test = new AudioRecord (MediaRecorder.AudioSource.MIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, 15); int status = ar_test.getState(); } catch (IllegalArgumentException e) { e.printStackTrace(); } ar_test.startRecording(); while(bytesRead 4){ bytesRead = ar_test.read(saveBytes, 0, 4); } ar_test.stop(); } } * //display list of codec output arTest = new tune(); String[] arResults = new String[arTest.saveBytes.length]; System.out.println(lgth++arTest.saveBytes.length); arResults[0] = List; for(int ii=1; iiarTest.saveBytes.length-1; ii++){ arResults[ii] = Byte.toString(arTest.saveBytes [ii]); } setListAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_1, arResults)); final ListView listView = getListView(); --~--~-~--~~~---~--~~ 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: is upgrade to 1.5 safe???
You will need to recompile your applications (make sure to switch the project properties to target 1.5 release) before redeploying them to an updated device. As far as other applications (ie. ones you downloaded, or didn't custom code) they will work for the most part. There are some subtle changes to the cupcake release (see the release notes for specifics: http://source.android.com/roadmap/cupcake), but for the most part, 1.5 is backwards compatible. Otherwise, it is definitely stable, and is a major improvement (both functionality-wise, and performance-wise), so it is a recommended update. On Jun 3, 2:09 am, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: will the applications developed for 1.0 r2 work well on 1.5? is it backward compatible? On Wed, Jun 3, 2009 at 2:33 PM, guna gunaz...@gmail.com wrote: Yes, 1.5 is stable only, as you are working with G1, which is based on the cupcake version. On Wed, Jun 3, 2009 at 2:30 PM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: hi, i am saurav mukherjee n i am working on a g1 mobile on android. there is a dialog box appearing for upgrading the os to 1.5. i jus wanted to know if anybody has done the same and is it safe (ie if the 1.5 os version is stable)? -- Guna --~--~-~--~~~---~--~~ 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] Justify a TextView?
Hi all, I can see this question has been asked a couple of times before, but with no answer. How do I set the text in a TextView to be justified? That is, I would like it to look like the left-hand example here: http://en.wikipedia.org/wiki/Justification_(typesetting) Thanks, Anna --~--~-~--~~~---~--~~ 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: Justify a TextView?
If you are in the eclipse ide with the android plugin, select the text view (open the xml file) and go to the properties tab. There should be an option called gravity. Set gravity to vertical-center|horizontal-center and that should do the trick. On Wed, Jun 3, 2009 at 10:33 AM, Anna PS annapowellsm...@googlemail.comwrote: Hi all, I can see this question has been asked a couple of times before, but with no answer. How do I set the text in a TextView to be justified? That is, I would like it to look like the left-hand example here: http://en.wikipedia.org/wiki/Justification_(typesetting) Thanks, Anna -- Mike Garcia There is no coincidence! --~--~-~--~~~---~--~~ 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: is upgrade to 1.5 safe???
Just updated to it. So far so good. Jason Van Anden http://www.bubblebeats.com On Wed, Jun 3, 2009 at 11:29 AM, Mike Wolfson mwolf...@gmail.com wrote: You will need to recompile your applications (make sure to switch the project properties to target 1.5 release) before redeploying them to an updated device. As far as other applications (ie. ones you downloaded, or didn't custom code) they will work for the most part. There are some subtle changes to the cupcake release (see the release notes for specifics: http://source.android.com/roadmap/cupcake), but for the most part, 1.5 is backwards compatible. Otherwise, it is definitely stable, and is a major improvement (both functionality-wise, and performance-wise), so it is a recommended update. On Jun 3, 2:09 am, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: will the applications developed for 1.0 r2 work well on 1.5? is it backward compatible? On Wed, Jun 3, 2009 at 2:33 PM, guna gunaz...@gmail.com wrote: Yes, 1.5 is stable only, as you are working with G1, which is based on the cupcake version. On Wed, Jun 3, 2009 at 2:30 PM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: hi, i am saurav mukherjee n i am working on a g1 mobile on android. there is a dialog box appearing for upgrading the os to 1.5. i jus wanted to know if anybody has done the same and is it safe (ie if the 1.5 os version is stable)? -- Guna --~--~-~--~~~---~--~~ 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: wait till layout is shown
On Wed, Jun 3, 2009 at 5:00 AM, guruk ilovesi...@gmail.com wrote: Hi, i have a main activity that needs quit a lot to load so i thought about a trick: i call a intropage that shows a pic and from directly it calls by intent the long loading page. Finaly I thought I would see the pic and in the background the other intent is loading, when its done the intro page dissapear automaticly and voila. (yes i thought i am very clever ) But now i see, that the Intro Page does not come initialized at all. I see in the header that the intro page is active, but the pic is not shown. immediatly it loads the main intent. So i guess i have to options.. make a small wait (but how) that the pic from the intro is finaly shown.. or more professional I have the option to request from windowmanager or so, if the layout from the intro is full shown. Only when that is done, I would call the Intent to start the main activity. The problem is that you're blocking the main thread, which prevents the UI from being shown. You don't really need your 'intro' activity. In your main activity, you can just set a picture, then do whatever your activity needs to do at startup in another thread, and once that is done, update the UI. --~--~-~--~~~---~--~~ 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: is upgrade to 1.5 safe???
Yes. I have had the OTA update now for over a week and it is working as I would expect. If you are developing in the Eclipse IDE and have the 1.5SDK installed, I'd strongly recommend updating your phone ASAP! On Wed, Jun 3, 2009 at 4:00 AM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: hi, i am saurav mukherjee n i am working on a g1 mobile on android. there is a dialog box appearing for upgrading the os to 1.5. i jus wanted to know if anybody has done the same and is it safe (ie if the 1.5 os version is stable)? -- Mike Garcia There is no coincidence! --~--~-~--~~~---~--~~ 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] Eclipse Visual SourceSafe Problem
Is there any one who are using Eclipse and Visual Sourcesafe...Android Resource manager try to parse all file in */res/values* and */res/layout * *directories... VisualSourceSafe puts the vssver2.scc file to these directories. * *Android Resource Manager can not parse scc files and gives error. * *How can i solve this problem? * * * -- ADEM KARAKOLLU --~--~-~--~~~---~--~~ 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] Short question: Is HTC Dream multi-touch screen natively? Tks
--~--~-~--~~~---~--~~ 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] click on a gone view
Why is this possible ? code : private OnClickListener _Listener = new OnClickListener() { public void onClick(View v) { if(v== myView){ if(myView.getVisibility()==View.GONE) Log.d(onClick,Why is this possible ?); } } } ... View myView = new View(this); ... myView.setOnclickListener(_Listener); I use View.VISIBLE / GONE to exchange display of two views... and when I want to click on the visible one, the gone one is catching it... is that normal ? --~--~-~--~~~---~--~~ 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: Short question: Is HTC Dream multi-touch screen natively? Tks
Short answer: no, it is not. On Wed, Jun 3, 2009 at 8:59 AM, codeplay yalpe...@gmail.com wrote: -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. 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] Re: How can I listen for WebView page load completed event
On Wed, Jun 3, 2009 at 9:16 AM, Lucius Fox lucius.fo...@gmail.com wrote: On Fri, May 8, 2009 at 10:35 AM, Mark Murphy mmur...@commonsware.com wrote: Lucius Fox wrote: Hi, Is it possible to listen for WebView page load completed event (the whole page is loaded including images, js files, css files and the page is completely rendered. Create a WebViewClient object, overriding onPageCompleted(). Then, call setWebViewClient() on your WebView object to tie the WebViewClient to the WebView. Then, implement onPageCompleted() to do whatever you need done when the page is loaded. I assume you mean onPageFinished(); Thank you for your help. (cross-posted to http://wiki.andmob.org/faq-webkit-complete) -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 2.0 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: How can I listen for WebView page load completed event
On Fri, May 8, 2009 at 10:35 AM, Mark Murphy mmur...@commonsware.com wrote: Lucius Fox wrote: Hi, Is it possible to listen for WebView page load completed event (the whole page is loaded including images, js files, css files and the page is completely rendered. Create a WebViewClient object, overriding onPageCompleted(). Then, call setWebViewClient() on your WebView object to tie the WebViewClient to the WebView. Then, implement onPageCompleted() to do whatever you need done when the page is loaded. I assume you mean onPageFinished(); (cross-posted to http://wiki.andmob.org/faq-webkit-complete) -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 2.0 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: media player does not display video, only audio coming, the screen turns black
I've tried a bunch of files with the mediaplayer demo on the emulator. Most show about the first frame or two of video and just play the audio. I'm wondering if a really fast computer CPU is required for the mediaplayer to work? More documentation is also needed for both the mediaplayer and VideoView (I've had even less success with the latter). Plus also a couple sample videos that play in the emulator would be nice. We can then at least know the specs. I've seen some specs on the net and tried those but the video still doesn't play. A 3gp file supposedly shot with a G1 didn't do any better either. Brian Conrad JyotishTools.com Harishkumar V wrote: Hi, I am trying to play mp4 video file from mediaplayer demo given in the api demos along with android sdk. I changed the path to /sdcard/video.mp4.. If i run mediaplayer_video demo, the audio output is coming, but no video is being displayed, the screen is black. when i seen the logcat, it reports, surfaceCreated called and surfaceChanged called. how to fix this... meanwhile, any videoplayer is available for android. Thanks and Regards, HarishKumar.V --~--~-~--~~~---~--~~ 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: Signed APK installed using a2b works / Same APK downloaded from market fails (force close)
To update this thread. It appeared that there were some indeed valid force close issues, but even debugging on one phone did not cause it to fail until I did a factory reset on the phone. Then i was able to cause the force close. Any thoughts? Chris On Jun 3, 10:05 am, chrispix chris...@gmail.com wrote: We just released an update, and spent a considerable amount of time trying to test. Once we released to the market, people started complaining about it force closing. The only way we were able to make it force close was by installing our app by the market. (why would that change our app?) vs. installing by adb as a signed app? We also noticed that if you downloaded the app for the first time and the newest version was 1.5.0, that the market forced 1.0 on you first, then made you upgrade to 1.5.0, we resolved this by going to version 2.0, but what other alternative is there to avoid that upgrade path? Chris. --~--~-~--~~~---~--~~ 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: Audio record and ply the recorded audio..
This may help as well http://www.benmccann.com/dev-blog/android-audio-recording-tutorial/ I am having difficulties in using audio record - trying to save the codec byte output in an array/buffer. Any help? On Jun 3, 4:26 am, guna gunaz...@gmail.com wrote: http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder... Check this link.. On Wed, Jun 3, 2009 at 4:48 PM, vineeth Desai vineeth.desa...@gmail.comwrote: Hi I have tried with AudioRecord API's also. Warm regards, Vineeth On Tue, Jun 2, 2009 at 9:22 PM, Keith Wiley kbwi...@gmail.com wrote: Don't forget to look at AudioRecord too. It's another interface for accessing audio. On Jun 2, 4:25 am, vineeth Desai vineeth.desa...@gmail.com wrote: Hi All, Could you please let me know how to do the audio record in android emulator and play the same recorded audio. Could you please help me in proceeding in development. I tried with MediaPlayer API's also. Its not working. Warm Regards, Vineeth. -- Guna --~--~-~--~~~---~--~~ 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] Having problems getting style attribute to work
I finally decided to use styles and themes instead of tediously setting attributes for each individual view. I was able to get the style to work when I set it on android:textAppearance, but when I try to just set it right on the style attribute like below, it no longer applies. This is happening to me for Buttons as well as TextViews. What I want is to be able to have a few different styles for text views and buttons and then just set the style on each button or text view. The style will need to define textSize, textColor, background and maybe a few others. Since background and some other things are not textAppearance, I need to use the general style attribute. Here's my current attempt: In one of my menu layouts, I have a title, which looks like this: TextView android:layout_width=wrap_content android:layout_height=wrap_content android:text=@string/ title_1_text android:layout_gravity=center_horizontal android:id=@+id/title android:layout_marginBottom=20px android:layout_marginTop=10px style=@style/MenuTitle/TextView then in res/values/styles.xml ?xml version=1.0 encoding=utf-8? resources style name=MenuTitle item name=android:textSize16pt/item item name=android:textColor#FFF/item /style /resources Any ideas on what I'm doing wrong here? I would think that the style attribute being set to the MenuTitle style would then apply the android:textSize and android:textColor, but I appear to be missing something. I have no themes defined yet. I'm considering doing that once I get this working because all of the layout backgrounds and button styles in my app will be the same. Thanks for any 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] ListView OnItemClickListener no callback
Hi, One of my ListView's has a CheckBox on every item's RelativeLayout. I just found that clicking on any item of the ListView does not callback its OnItemClick(). If I remove the CheckBox from item layout, callback is ok then. My app needs to get both callbacks from the CheckBox as well as from the other area of a ListView item. I read http://android-developers.blogspot.com/2008/12/touch-mode.html But I'm a bit confuse. Can anybody advise me how I get the callback on the ListView with CheckBox? public class UserList extends ListActivity implements ListView.OnItemClickListener, ListView.OnClickListener{ private Client client; private ArrayListUser users = new ArrayListUser(); private UserAdapter userAdapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.user_list); getListView().setOnItemClickListener(this); Intent i = getIntent(); if (i!= null) { if (i.getAction().equalsIgnoreCase(Intent.ACTION_VIEW)) { this.client = (Client) i.getSerializableExtra (Constants.CLIENT_CLASS_NAME); this.userAdapter = new UserAdapter(this, R.layout.user_row, users); users = (ArrayListUser) this.client.getUsers(); Log.i(getClass().getSimpleName(),Display users); for(int j=0;jusers.size();j++) { this.userAdapter.add(users.get(j)); } setListAdapter(this.userAdapter); } } } @Override public void onItemClick(AdapterView? adapterView, View view, int position, long id) { Log.d(getClass().getSimpleName(), -- Click on User item -- ); } private class UserAdapter extends ArrayAdapterUser { private LayoutInflater mInflater; private ArrayListUser items; public UserAdapter(Context context, int resourceId, ArrayListUser items) { super(context, resourceId, items); mInflater = LayoutInflater.from(context); this.items = items; } public boolean areAllItemsSelectable() { return true; } public boolean isEnabled(int position) { if (position = 0 position = items.size()) { return true; } return false; } public int getCount() { return items.size(); } public User getItem(int position) { if (0 == position) { return null; } return items.get(position); } @Override public View getView(int position, View convertView, ViewGroup parent) { // A ViewHolder keeps references to children views to avoid unnecessary calls // to findViewById() on each row. ViewHolder holder = null; View v = convertView; User user = items.get(position); if (v == null) { mInflater = (LayoutInflater)getSystemService (Context.LAYOUT_INFLATER_SERVICE); v = mInflater.inflate(R.layout.user_row, null); if (user != null) { // Creates a ViewHolder and store references to the children views // we want to bind data to. holder = new ViewHolder(); holder.firstNameText = (TextView) v.findViewById (R.id.user_first_name); holder.lastNameText = (TextView) v.findViewById (R.id.user_last_name); holder.phoneNumberText = (TextView) v.findViewById (R.id.user_phone_number); holder.statusText = (TextView) v.findViewById (R.id.user_status); } v.setTag(holder); } else { // Get the ViewHolder back to get fast access to the TextView // and the ImageView. holder = (ViewHolder) v.getTag(); } if (holder.firstNameText != null) { holder.firstNameText.setText(user.getFirstName()); } if (holder.lastNameText != null){ holder.lastNameText.setText(user.getLastName()); } if ( holder.phoneNumberText != null){ holder.phoneNumberText.setText(user.getPhoneNumber()); } if (holder.statusText != null){ holder.statusText.setText(String.valueOf(user.getStatus ())); } return v; } class ViewHolder { TextView firstNameText; TextView lastNameText; TextView phoneNumberText; TextView statusText; } } Best regards Tom
[android-developers] Re: is upgrade to 1.5 safe???
Now that I have been using it this AM - I must say ... sweet! The interface adjustments are great. j On Wed, Jun 3, 2009 at 11:39 AM, Mike Garcia sddm...@gmail.com wrote: Yes. I have had the OTA update now for over a week and it is working as I would expect. If you are developing in the Eclipse IDE and have the 1.5SDK installed, I'd strongly recommend updating your phone ASAP! On Wed, Jun 3, 2009 at 4:00 AM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: hi, i am saurav mukherjee n i am working on a g1 mobile on android. there is a dialog box appearing for upgrading the os to 1.5. i jus wanted to know if anybody has done the same and is it safe (ie if the 1.5 os version is stable)? -- Mike Garcia There is no coincidence! --~--~-~--~~~---~--~~ 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: ListView OnItemClickListener no callback
You can't, it's one or the other. If you put a focusable widget in a list item, that's what happens. If you need checkboxes, use ListView's choice mode instead. On Wed, Jun 3, 2009 at 10:25 AM, Tom thomas.coz...@gmail.com wrote: Hi, One of my ListView's has a CheckBox on every item's RelativeLayout. I just found that clicking on any item of the ListView does not callback its OnItemClick(). If I remove the CheckBox from item layout, callback is ok then. My app needs to get both callbacks from the CheckBox as well as from the other area of a ListView item. I read http://android-developers.blogspot.com/2008/12/touch-mode.html But I'm a bit confuse. Can anybody advise me how I get the callback on the ListView with CheckBox? public class UserList extends ListActivity implements ListView.OnItemClickListener, ListView.OnClickListener{ private Client client; private ArrayListUser users = new ArrayListUser(); private UserAdapter userAdapter; �...@override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.user_list); getListView().setOnItemClickListener(this); Intent i = getIntent(); if (i!= null) { if (i.getAction().equalsIgnoreCase(Intent.ACTION_VIEW)) { this.client = (Client) i.getSerializableExtra (Constants.CLIENT_CLASS_NAME); this.userAdapter = new UserAdapter(this, R.layout.user_row, users); users = (ArrayListUser) this.client.getUsers(); Log.i(getClass().getSimpleName(),Display users); for(int j=0;jusers.size();j++) { this.userAdapter.add(users.get(j)); } setListAdapter(this.userAdapter); } } } �...@override public void onItemClick(AdapterView? adapterView, View view, int position, long id) { Log.d(getClass().getSimpleName(), -- Click on User item -- ); } private class UserAdapter extends ArrayAdapterUser { private LayoutInflater mInflater; private ArrayListUser items; public UserAdapter(Context context, int resourceId, ArrayListUser items) { super(context, resourceId, items); mInflater = LayoutInflater.from(context); this.items = items; } public boolean areAllItemsSelectable() { return true; } public boolean isEnabled(int position) { if (position = 0 position = items.size()) { return true; } return false; } public int getCount() { return items.size(); } public User getItem(int position) { if (0 == position) { return null; } return items.get(position); } �...@override public View getView(int position, View convertView, ViewGroup parent) { // A ViewHolder keeps references to children views to avoid unnecessary calls // to findViewById() on each row. ViewHolder holder = null; View v = convertView; User user = items.get(position); if (v == null) { mInflater = (LayoutInflater)getSystemService (Context.LAYOUT_INFLATER_SERVICE); v = mInflater.inflate(R.layout.user_row, null); if (user != null) { // Creates a ViewHolder and store references to the children views // we want to bind data to. holder = new ViewHolder(); holder.firstNameText = (TextView) v.findViewById (R.id.user_first_name); holder.lastNameText = (TextView) v.findViewById (R.id.user_last_name); holder.phoneNumberText = (TextView) v.findViewById (R.id.user_phone_number); holder.statusText = (TextView) v.findViewById (R.id.user_status); } v.setTag(holder); } else { // Get the ViewHolder back to get fast access to the TextView // and the ImageView. holder = (ViewHolder) v.getTag(); } if (holder.firstNameText != null) { holder.firstNameText.setText(user.getFirstName()); } if (holder.lastNameText != null){ holder.lastNameText.setText(user.getLastName()); } if ( holder.phoneNumberText != null){ holder.phoneNumberText.setText(user.getPhoneNumber()); } if (holder.statusText != null){ holder.statusText.setText(String.valueOf(user.getStatus
[android-developers] Re: Advice on debug tool for I/O
I run the emulator on my desktop, and use Wireshark filtered for http requests. http://en.wikipedia.org/wiki/Wireshark On Jun 3, 3:43 am, mobilek...@googlemail.com mobilek...@googlemail.com wrote: Hi, On a number of cases I have experienced problems with server / client communication where the server responses with XML files, which never reach my client. Is there any tool for monitoring everything incoming through an HTTP connection, or if not what is your advice to detect what's come through and what's not. I've tried Charles proxy, which intercepts all requests / responses, however, Android seems to refuse to work with proxies. Any advice will be much appreciated. 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@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] Detecting hardware capabilities
There are return values and such that allow handling if SensorManager sensors and location providers aren't available, but what about the camera and microphone for audio recording? Is there a way to detect those in software, or are we just to assume that every device running Android (even the rumored set-top box) is going to have a camera and microphone and try to use them? In the case of the camera, it would seem that Camera.open() returning null would indicate the lack of hardware. I don't know if that assumption is valid or not, though, considering it isn't documented as such. In the case of the microphone, though, I don't see anything that could possibly be checked. The same goes for the camera if you're wanting to do video with the MediaRecorder class. --~--~-~--~~~---~--~~ 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 run the android application on G1
After upgrade to 1.5, I can run the application from eclipse using emulator, but I could not run it on my g1 phone which is upgraded to 1.5 by tmobile. Help needed!!! On Jun 2, 9:56 pm, cindy ypu01...@yahoo.com wrote: After I upgrade to 1.5, how can I run my application on gphone from eclipse? Thanks! Cindy --~--~-~--~~~---~--~~ 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: Having problems getting style attribute to work
Ok I think I may understand the problem but leads me down a very frustrating path. I think that if I were to set a style on a view, that style would need to inherit the default style and then override the values that I want to have custom. That's fine and all, but I have no idea where this magic list of default styles is or what the values are in it. I have scoured the developer's documentation starting here - http://developer.android.com/guide/topics/ui/themes.html and can not find this information anywhere. Basically, I have no idea what style to extend and I can't find the resources I need to figure it out. I don't even know what the default theme is. Does anyone? On Jun 3, 12:19 pm, Robert Green rbgrn@gmail.com wrote: I finally decided to use styles and themes instead of tediously setting attributes for each individual view. I was able to get the style to work when I set it on android:textAppearance, but when I try to just set it right on the style attribute like below, it no longer applies. This is happening to me for Buttons as well as TextViews. What I want is to be able to have a few different styles for text views and buttons and then just set the style on each button or text view. The style will need to define textSize, textColor, background and maybe a few others. Since background and some other things are not textAppearance, I need to use the general style attribute. Here's my current attempt: In one of my menu layouts, I have a title, which looks like this: TextView android:layout_width=wrap_content android:layout_height=wrap_content android:text=@string/ title_1_text android:layout_gravity=center_horizontal android:id=@+id/title android:layout_marginBottom=20px android:layout_marginTop=10px style=@style/MenuTitle/TextView then in res/values/styles.xml ?xml version=1.0 encoding=utf-8? resources style name=MenuTitle item name=android:textSize16pt/item item name=android:textColor#FFF/item /style /resources Any ideas on what I'm doing wrong here? I would think that the style attribute being set to the MenuTitle style would then apply the android:textSize and android:textColor, but I appear to be missing something. I have no themes defined yet. I'm considering doing that once I get this working because all of the layout backgrounds and button styles in my app will be the same. Thanks for any 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] Re: Having problems getting style attribute to work
Also, When I say that, nothing happens when I do the above example, I'm saying that nothing happens in the ADT editor. I haven't tried running it like that, I've just tried to see it work in the preview. Should a style setting show up in the ADT layout editor? On Jun 3, 2:09 pm, Robert Green rbgrn@gmail.com wrote: Ok I think I may understand the problem but leads me down a very frustrating path. I think that if I were to set a style on a view, that style would need to inherit the default style and then override the values that I want to have custom. That's fine and all, but I have no idea where this magic list of default styles is or what the values are in it. I have scoured the developer's documentation starting here -http://developer.android.com/guide/topics/ui/themes.htmland can not find this information anywhere. Basically, I have no idea what style to extend and I can't find the resources I need to figure it out. I don't even know what the default theme is. Does anyone? On Jun 3, 12:19 pm, Robert Green rbgrn@gmail.com wrote: I finally decided to use styles and themes instead of tediously setting attributes for each individual view. I was able to get the style to work when I set it on android:textAppearance, but when I try to just set it right on the style attribute like below, it no longer applies. This is happening to me for Buttons as well as TextViews. What I want is to be able to have a few different styles for text views and buttons and then just set the style on each button or text view. The style will need to define textSize, textColor, background and maybe a few others. Since background and some other things are not textAppearance, I need to use the general style attribute. Here's my current attempt: In one of my menu layouts, I have a title, which looks like this: TextView android:layout_width=wrap_content android:layout_height=wrap_content android:text=@string/ title_1_text android:layout_gravity=center_horizontal android:id=@+id/title android:layout_marginBottom=20px android:layout_marginTop=10px style=@style/MenuTitle/TextView then in res/values/styles.xml ?xml version=1.0 encoding=utf-8? resources style name=MenuTitle item name=android:textSize16pt/item item name=android:textColor#FFF/item /style /resources Any ideas on what I'm doing wrong here? I would think that the style attribute being set to the MenuTitle style would then apply the android:textSize and android:textColor, but I appear to be missing something. I have no themes defined yet. I'm considering doing that once I get this working because all of the layout backgrounds and button styles in my app will be the same. Thanks for any 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] Re: How to run the android application on G1
maybe try updating your sdk and eclipse plugin? http://developer.android.com/sdk/1.5_r2/index.html On Jun 3, 12:45 pm, cindy ypu01...@yahoo.com wrote: After upgrade to 1.5, I can run the application from eclipse using emulator, but I could not run it on my g1 phone which is upgraded to 1.5 by tmobile. Help needed!!! On Jun 2, 9:56 pm, cindy ypu01...@yahoo.com wrote: After I upgrade to 1.5, how can I run my application on gphone from eclipse? Thanks! Cindy --~--~-~--~~~---~--~~ 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: Signed APK installed using a2b works / Same APK downloaded from market fails (force close)
Did you activate copy protection on your app in the market? There have been force close issues reported when doing so. I do not know whether these have been resolved in the meantime or not. Did you increment the android:versionCode integer attribute in the manifest with you new version? (you should) Otherwise it might eventually have been a timing problem. I'm not sure all Google download data centers distribute a new version exactly from the moment on when it was uploaded. -- http://deepdroid.com On Jun 3, 5:05 pm, chrispix chris...@gmail.com wrote: We just released an update, and spent a considerable amount of time trying to test. Once we released to the market, people started complaining about it force closing. The only way we were able to make it force close was by installing our app by the market. (why would that change our app?) vs. installing by adb as a signed app? We also noticed that if you downloaded the app for the first time and the newest version was 1.5.0, that the market forced 1.0 on you first, then made you upgrade to 1.5.0, we resolved this by going to version 2.0, but what other alternative is there to avoid that upgrade path? Chris. --~--~-~--~~~---~--~~ 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 detect current screen is vertical or horizontal?
not sure how much help this is, but i'm using it on a canvas i have Integer width = canvas.getWidth(); Integer height = canvas.getHeight(); // Check Orientation so we know which grid to use if(widthheight) { // Landscape mode } else { // Portrait mode } On Jun 3, 1:43 am, aby orz0...@gmail.com wrote: Hi, I need to set different content view after rotating device screen. Is there any method to detect the direction of current screen is vertical or horizontal?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: Eclipse plugin for android
This is because you are attempting to run android.jar which does not contain any code at all (all the methods throw an exception). Also, note that a lot of the implementation of the view and drawing system is done in native and this is not provided with the SDK (nor could it as it's very tied to the rest of the Android platform) By the way, the layout editor in ADT already does this. It uses a separate library that is a custom version of the Android view framework with an implementation of the underlying drawing system in Java. Eclipse load this library, as well as all the framework system resources, and is then able to instantiate and draw views from an XML layout file. It also supports custom views by dynamically instantiating your custom view code from the .class files generated by the Eclipse compiler and loading your project resources (there are some limitations depending on what your view class does in its constructor and drawing methods). Xav On Wed, Jun 3, 2009 at 9:41 AM, Paul Turchenko paul.turche...@gmail.com wrote: HI. I'm trying to develop plugin for eclipse that should draw my custom view inflated from XML. Everything works fine until eclipse tries to instantiate any class from android.jar library. It fails with Runtime exception without any other helpful information (stub!). Any ideas why is it so? -- Xavier Ducrohet Android Developer Tools Engineer Google Inc. --~--~-~--~~~---~--~~ 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: Attempt to include a core VM class in something other...
Root cause was two android jars on the classpath...Yes it is a silly error, cant help but be a little dissapointed that this problem manifested itself like this On Jun 3, 10:40 pm, Mark Murphy mmur...@commonsware.com wrote: markdsievers wrote: Just a bump...Same situation, upgrading Android and have ended up with this problem. Someone in the next cubicle has the same project working, so will post the solution shortly... The error message is fairly self-explanatory in terms of what to do, though the better answer is to not try adding classes in the java.* or javax.* namespaces. In the OP's case, if I am reading their stack trace correctly, they were trying to add java.security.cert.CertPathParameters, perhaps from Apache Harmony, and Android's build tools will not appreciate that. In part, that is because Android 1.5 already has an implementation of this interface. You can use classes pulled from Harmony, but you need to modify them (and the code that uses them) to put them in another namespace. Bear in mind that if you do follow the error message's instructions and use --core-library to attempt to get past this message, your application may break in future versions of Android, if they happen to include the same class you're trying to load and the implementations are not compatible. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ 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] Why does ProgressDialog launched from OnItemClick wait until a subsequent thread's run method returns to show itself
I have code in my activity's onCreate that sets an onItemClick listener. when it fires I try to show a ProgressDialog that will be up until a subsequent thread Thread does it's processing. Strangely to me, the progress dialog never shows until *after* the thread.run() processing is complete. Almost like it's blocking. Am I doing something wrong? this is true even if the run method of doCurrentLocation doesn't do anything. Thanks for any ideas!! pawpaw17 @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ... optionsList.setOnItemClickListener(new OnItemClickListener(){ public void onItemClick(AdapterView? arg0, View arg1, int arg2, long arg3) { pd = ProgressDialog.show(myContext, getString (R.string.app_name), getString(R.string.thousands), true, false); Thread thread = new Thread(null, doGetCurrentLocation, Background); thread.run(); }; }); ... }; --~--~-~--~~~---~--~~ 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: Why does ProgressDialog launched from OnItemClick wait until a subsequent thread's run method returns to show itself
Because you're not truly creating a thread unless you call Thread.start (). Thread.run() will just do the runnable part in your current thread, which is, with certainty, not what you intended to do :) On Jun 3, 6:50 pm, pawpaw17 georgefraz...@yahoo.com wrote: I have code in my activity's onCreate that sets an onItemClick listener. when it fires I try to show a ProgressDialog that will be up until a subsequent thread Thread does it's processing. Strangely to me, the progress dialog never shows until *after* the thread.run() processing is complete. Almost like it's blocking. Am I doing something wrong? this is true even if the run method of doCurrentLocation doesn't do anything. Thanks for any ideas!! pawpaw17 @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ... optionsList.setOnItemClickListener(new OnItemClickListener(){ public void onItemClick(AdapterView? arg0, View arg1, int arg2, long arg3) { pd = ProgressDialog.show(myContext, getString (R.string.app_name), getString(R.string.thousands), true, false); Thread thread = new Thread(null, doGetCurrentLocation, Background); thread.run(); }; }); ... }; --~--~-~--~~~---~--~~ 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: Connect laptop built-in gps receiver to emulator
emulator -help-gps ? On Wed, Jun 3, 2009 at 6:54 PM, Lex hakkinen1...@gmail.com wrote: Hello, my Dell Latitude E6400 has a built-in gps receiver. How can I hook it up with the emulator? I have enough problems spoofing gps data due to exisiting Android bugs, so I might as well use real ones? Thanks, Lex --~--~-~--~~~---~--~~ 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: Bug? Geo fix and sdk 1.5
this is a known issue that will be fixed in the next 1.5 SDK release.Sorry about that. On Wed, Apr 29, 2009 at 1:10 AM, rob_b...@gmx.net rob_b...@gmx.net wrote: have the same problem! also tried with the r1 version of the new sdk 1.5. worked on sdk 1.1. doesn't matter if I use ddms or telnet. still can just see one or at least 2 coordinates displayed in the application. need help! thx On 28 Apr., 15:51, Andreas Frey a-f...@gmx.de wrote: Hello, I have a really simple Android Application using a MyLocationOverlay and a LocationManager to determine and show the current position via a Toast. But the geo fix command i submit via telnet does only work the first time i submit it. ALl later tries to update the position do not work. Anybody knows this problem? Any solutiions This is the relevant source code: - .. private void initLocationManager() { locManager = (LocationManager) getSystemService (Context.LOCATION_SERVICE); locationListener = new LocationListener() { public void onLocationChanged(Location location) { updatePosition(location); } public void onProviderDisabled(String arg0) { } public void onProviderEnabled(String arg0) { } public void onStatusChanged(String arg0, int arg1, Bundle arg2) { } }; locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener); } private void updatePosition(Location location) { Toast t = Toast.makeText( this, getString(R.string.msgPosition, location.getLatitude(), location.getLongitude()), Toast.LENGTH_SHORT); t.show(); theMap.getController().animateTo( new GeoPoint( (int)(location.getLatitude()*1E6), (int)(location.getLongitude()*1E6))); theMap.postInvalidate(); } -- --~--~-~--~~~---~--~~ 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 detect current screen is vertical or horizontal?
Try This, WindowManager z; z = this.getWindowManager(); Display r = z.getDefaultDisplay(); int rr = r.getOrientation(); HTH, Radio On Jun 3, 5:40 pm, Hiro the.h...@gmail.com wrote: not sure how much help this is, but i'm using it on a canvas i have Integer width = canvas.getWidth(); Integer height = canvas.getHeight(); // Check Orientation so we know which grid to use if(widthheight) { // Landscape mode } else { // Portrait mode } On Jun 3, 1:43 am, aby orz0...@gmail.com wrote: Hi, I need to set different content view after rotating device screen. Is there any method to detect the direction of current screen is vertical or horizontal?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 detect current screen is vertical or horizontal?
The easiest way of showing a different layout based on orientation is to build it into your resources folders, and there is no extra code needed. Here's an example of how I use two different layouts depending on portrait or landscape: http://code.google.com/p/connectbot/source/browse/trunk/connectbot/res/layout-port/item_host.xml http://code.google.com/p/connectbot/source/browse/trunk/connectbot/res/layout-land/item_host.xml (Notice how it uses two different directories, layout-port and layout-land. Android automatically picks the right layout from the /res/ folder at runtime.) Here's more detail on all the configuration tags types available: http://d.android.com/guide/topics/resources/resources-i18n.html -- Jeff Sharkey jshar...@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: Themes - Is it possible to apply a style to a specific view ID (that multiple views share) from the Theme?
You can do this, but in the opposite direction. Each of the TextViews would request a specific android:style, which you could then define from the theme through attributes. Here's an example where I started doing something like this: http://code.google.com/p/android-sky/source/browse/trunk/Sky/res/layout/widget_med.xml http://code.google.com/p/android-sky/source/browse/trunk/Sky/res/values/styles.xml I didn't write the one last level of indirection needed, which is where you use attributes, like ?attr/textDay. Then in the theme definition you would directly point those attributes at the concrete @style/Text.Day definitions. To apply various themes in your code, just use ContextThemeWrapper to wrap a specific theme you've defined. (Use that wrapper class when inflating view to make sure they inherit through the attributes correctly.) This is pretty complex, but hopefully it will be useful. This type of indirect inheritance is used across the platform, and in particular it's how Theme.Light is implemented. j On Wed, Jun 3, 2009 at 1:28 PM, Robert Green rbgrn@gmail.com wrote: Here's my scenario, I have about 6 layouts that all have a TextView with the ID title. I'm theming my app right now and I'd like to have it so that every instance of title gets a specific style applied. Is this possible? I don't want to use a default text style because normal text will have a different size, etc.. -- Jeff Sharkey jshar...@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: Themes - Is it possible to apply a style to a specific view ID (that multiple views share) from the Theme?
Hmm... I guess I'm thinking of the way a class of HTML elements are styled in CSS. That would be really nice. Something where I could say in the theme, All titles will look like this, and then a UI element would somehow declare, I am a title. I suppose it would be a next-level thing with theming. Perhaps theme-by-tag? I don't know. On Jun 3, 7:50 pm, Jeff Sharkey jshar...@android.com wrote: You can do this, but in the opposite direction. Each of the TextViews would request a specific android:style, which you could then define from the theme through attributes. Here's an example where I started doing something like this: http://code.google.com/p/android-sky/source/browse/trunk/Sky/res/layo...http://code.google.com/p/android-sky/source/browse/trunk/Sky/res/valu... I didn't write the one last level of indirection needed, which is where you use attributes, like ?attr/textDay. Then in the theme definition you would directly point those attributes at the concrete @style/Text.Day definitions. To apply various themes in your code, just use ContextThemeWrapper to wrap a specific theme you've defined. (Use that wrapper class when inflating view to make sure they inherit through the attributes correctly.) This is pretty complex, but hopefully it will be useful. This type of indirect inheritance is used across the platform, and in particular it's how Theme.Light is implemented. j On Wed, Jun 3, 2009 at 1:28 PM, Robert Green rbgrn@gmail.com wrote: Here's my scenario, I have about 6 layouts that all have a TextView with the ID title. I'm theming my app right now and I'd like to have it so that every instance of title gets a specific style applied. Is this possible? I don't want to use a default text style because normal text will have a different size, etc.. -- Jeff Sharkey jshar...@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] Android Developer Phone Update Problems
I'm developing on the Android G1 Dev phone and I've recently had a lot of compatibility issues. My firmware version is 1.0, not 1.5. If that's the problem, is there a way to get an update for the G1 Dev phone without having a cellular service (ie. no sim card)? (or should there be no noticeable problems between the versions?) --~--~-~--~~~---~--~~ 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: problem in installing adnroid plugin in eclipse
It's depend on other eclipse plugin such like WST , And a broken eclipse update will end with adt acting strange.. On Jun 3, 2:28 pm, Honest honestsucc...@gmail.com wrote: I read the docs for installing android plugin for eclipse. I did it according to it and i have downloaded and installed the plugin but after that when i cliced on Windows-prefrences i could not find Android in left panel. What could be wrong in 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] Re: Short question: Is HTC Dream multi-touch screen natively? Tks
Thanks, how about HTC Magic? (Seems not stated in its tech spec) On Jun 4, 12:05 am, Romain Guy romain...@google.com wrote: Short answer: no, it is not. On Wed, Jun 3, 2009 at 8:59 AM, codeplay yalpe...@gmail.com wrote: -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. 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] Callback to activity after layout has completed?
I want to find the dimensions of the various views in my layout. My understanding is this can only be done after layout is completed since layout is somewhat dynamic. So, after the activity calls setContentView() and then returns control on the main thread to the OS so that layout can occur, how do I get a notification that layout has completed so I that I can query the views for their dimensions? On a related topic, can I find out the status bar's height...or least the screen's full size (from which the status bar's height can be calculate by subtracting my window's height)? 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: Callback to activity after layout has completed?
Ah right, I remembered DisplayMetrics for screen size. I knew I had seen that before. So, I guess I can deduce the status bar height then. Sorry. On Jun 3, 7:05 pm, Keith Wiley kbwi...@gmail.com wrote: I want to find the dimensions of the various views in my layout. My understanding is this can only be done after layout is completed since layout is somewhat dynamic. So, after the activity calls setContentView() and then returns control on the main thread to the OS so that layout can occur, how do I get a notification that layout has completed so I that I can query the views for their dimensions? On a related topic, can I find out the status bar's height...or least the screen's full size (from which the status bar's height can be calculate by subtracting my window's height)? 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 -~--~~~~--~~--~--~---