Re: [android-developers] Contact Manager Sample Code
Hi, Since the code worked on a real device and not on emulators, I just have to ask: Did you try to add any contact to the emulator before running the sample code? /Poncho On 02/19/2012 10:59 PM, Michael Ennovium wrote: The Contact Manager Sample code has given me hours of frustration. The sample code displays all the contacts in a List View and also provides for adding new contacts. I have no difficulty with the Add Contact portion. The listing of the contact gives different results for the list on diffent platforms. 1. Using my Samsumg Infuse 2.2 phone, the sample works correctly. 2. Using an emulator configured for Level 8, no contacts are displayed*. 3. Using an Acer Iconia tablet, no contacts are displayed*. 4. Using an emulator confgured for 3.2, no contacts are displayed*. * In all cases where no contacts are displayed, the cursor.getCount() returns a zero. The same source code is used without modification on each platform. I know it has to be "cockpit" error on my side but I am stumped. Any direction is graciously appreciated. My goal is to develop for the tablet and this has become a gating issue for me. -- 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
Re: [android-developers] simulate hte speed for amdroid phones
On 12/21/2011 05:36 AM, Shabnaz wrote: hi Iam trying to develop an app for accident detection and notification system. For tat I need to get the speed and acceleration of the mobile phione equpped with android how do I simulate ht espeed of the phone using the emulator because the mibile phone does not physically change its location Hi, Not sure about the speed, you can set the location by: telnet localhost 5554 geo fix 32.00 37.00 geo fix 32.00 37.10 geo fix 32.00 37.20 ... If you have more than one emulator the second emulator should be listen on port 5556. Hope this helps /Poncho -- 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
Re: [android-developers] compiler compliance problem
You are doing fine. I guess you are using Eclipse so within Eclipse: Right Click you project (in the Package Explorer view) and select Android Tools > Fix Project Properties :) Hope this helps /Yaron On 12/30/2011 07:59 AM, brucenow wrote: I thought I was doing pretty good getting everything installed correctly to follow the examples in the book, Android for Programmers. But when it came to importing the first example I got this meesage: "[2011-12-29 21:42:57 - Doodlz] Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools> Fix Project Properties." I really have no idea what tool to use or where exactly I might find it. Any ideas? Bruce -- 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
Re: [android-developers] How can i display exactly on the top....?
Hi, I'm not sure that I understand, what's wrong with: popup.layout( left, top, left + width, top + height); /Poncho On 01/04/2012 08:21 AM, Abhilash baddam wrote: Hi, My problem is when i tap on the marker i want to show the popup exactly on the top of the marker like displayed in requires.png(attatchment) but the popup i am getting is always on the top of the screen like displayed in capture.png(attatchment) How can i achieve that...? On 1/4/12, TreKing wrote: On Tue, Jan 3, 2012 at 1:31 PM, Abhilash baddam< abhilash.androiddevelo...@gmail.com> wrote: any help regading this issue... Maybe if you clarified what you're asking, like I asked the first time around. - TreKing<http://sites.google.com/site/rezmobileapps/treking> - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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
Re: [android-developers] How can i display exactly on the top....?
Hi, What happen if you try to move the popup before displaying it using the following line? "popup.layout( left, top, left + popup.getWidth(), top + popup.getHeight());" /Poncho On 01/04/2012 11:35 AM, Abhilash baddam wrote: Hi poncho, Thanks for the reply. I did get your suggestion, can you please explain it clearly. On 1/4/12, poncho wrote: Hi, I'm not sure that I understand, what's wrong with: popup.layout( left, top, left + width, top + height); /Poncho On 01/04/2012 08:21 AM, Abhilash baddam wrote: Hi, My problem is when i tap on the marker i want to show the popup exactly on the top of the marker like displayed in requires.png(attatchment) but the popup i am getting is always on the top of the screen like displayed in capture.png(attatchment) How can i achieve that...? On 1/4/12, TreKing wrote: On Tue, Jan 3, 2012 at 1:31 PM, Abhilash baddam< abhilash.androiddevelo...@gmail.com> wrote: any help regading this issue... Maybe if you clarified what you're asking, like I asked the first time around. - TreKing<http://sites.google.com/site/rezmobileapps/treking> - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Contact Number
Hi, 1) You should call the contact picker using startActivityForResult 2) You should override onActivityResult and parse the data returned from the contact picker. Something like: ... Uri result = data.getData(); String id = result.getLastPathSegment(); Cursor cursor = getContentResolver().query(Phone.CONTENT_URI, null, Email.CONTACT_ID + "=?", new String [] { id }, null); int numberIdx = cursor.getColumnIndex(Phone.DATA); if (cursor.moveToFirst()) { String number = cursor.getString(numberIdx); yourEditText.setText(number); } Don't forget to verify that the activityResult are returned from the contact picker and the result code is ok. Hope this helps /Yaron On 01/24/2012 11:31 AM, Bharath kumar Thota wrote: Hi, I am a newbie to android and while developing i got stuck up at a point and there by i could not move further.Please some one help me to solve my problem. My problem is as follows.. I wanna get the phone number of a particular contact into the edit text i.e., When i select a contact from the contacts, the phone number of the selected contact should get displayed in the EditText box..I had gone to the extent of opening the contacts, and now i can't find the way to pick the number and then get it in to the edittext. Thank you, Bharath -- 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
Re: [android-developers] Shared Preferences
Hi, The code itself is fine except that you don't print the exception. If you would log the exception you can see (in the LogCat) that the run-time is throwing some kind of a ParseException. This is since users (usually) don't type 'L' at the end of their numeric input, even when it's long. Hope this helps /Poncho On 02/07/2012 02:54 PM, ajay talreja wrote: This code is not working for mei'm trying to use Shared preferences to store long values.the code is correct and is launching successfully when i switch from long to int valuesplease help package d.preferencesdemo1; import android.app.Activity; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class preferencesdemo1 extends Activity { /** Called when the activity is first created. */ EditText t; long mobileno; TextView text; SharedPreferences app_preferences; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Get the app's shared preferences app_preferences = PreferenceManager.getDefaultSharedPreferences(this); mobileno = app_preferences.getLong("mobileno",9028252169L); // Update the TextView text = (TextView) findViewById(R.id.text); text.setText("The default mobile number is " + mobileno + "."); // Increment the mobileno // SharedPreferences.Editor editor = app_preferences.edit(); // editor.putlong("mobileno", ++mobileno); //editor.commit(); // Very important t = (EditText) findViewById(R.id.EditText01); Button b2 = (Button) findViewById(R.id.Button01); t.setText(""); b2.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { try { // Increment the mobileno SharedPreferences.Editor editor = app_preferences.edit(); long tv = Long.parseLong(t.getText().toString()); mobileno=tv; editor.putLong("mobileno", mobileno); editor.commit(); // Very important text.setText("The default mobile number is " + mobileno + "."); } catch (Exception e) { } } }); } } -- 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
Re: [android-developers] Custom label and text box in ListView?
According to the following thread " ListView isn't really meant to handle that type of UI with editable entries". http://groups.google.com/group/android-developers/browse_thread/thread/50f0fc185da8fe4d?pli=1 The suggested solution is to use vertical LinearLayout wrapped in a ScrollView, containing horizontal LinearLayours of the TextView and EditText. BTW, I struggled the ListView for three weeks before finding this thread. Hope this helps /Poncho On 02/09/2012 05:13 PM, Mark Winchester wrote: I'm trying to find a bit of sample code that I'm having trouble with. Hoping someone here could help me. I've got a Listview in my app that I want each row of to have a label and a text box (TextView and EditText). I've got to create these and add them dynamically. That much hasn't been too bad. Currently, I'm creating an ArrayAdapter from my array of data and setting it as the adapter for the ListView. I've got a layout that I can point to and the labels are being set correctly. What I'm having trouble finding is an example where the EditText boxes are filled upon creation, and then read back on an event. I would appreciate any help. -Mark -- 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
Re: [android-developers] installing APK without eclipse/android SDK
Hi, Does this helps? http://developer.android.com/guide/publishing/app-signing.html#releasecompile /Poncho On 02/12/2012 08:30 PM, John Goche wrote: Hello, I would like to send my APK to someone by email so that they may install it using WIndows Vista. I have searched for info on how they can install the .apk but only found a pointer to downloading the Astro file manager and installing from there after copying the apk to the phone's file system eg. via usb. But when the application is clicked on the message is: "the application is not installed". The phone is a Samsung Galaxy S Plus. Any ideas? (I have already enabled USB debugging and installation of non market apps in the settings). Installing to the phone via eclipse works, but I want to be able to do this from the phone's PC which does not have eclipse. I would like to be able to just compile the Dalvik APK in eclipse and send it via email for the user to install it from windows vista. Any ideas? Thanks, JG -- 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
Re: [android-developers] Re: main,out.xml
On 02/13/2012 11:18 PM, skink wrote: JackN wrote: I see this when I have the XML open and active and choose to run or debug the app. I faced that couple of times too, do you know how to avoid it? pskink Hi, Eclipse: Windows->Preferences Find the 'Run/Debug' section and then 'Launching'. You probably want to use the first option. Does this help? /Poncho -- 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
Re: [android-developers] Problem with listVIew
Hi, I struggled with similar issue for two weeks before finding the following thread which suggest that ListView should not be used with editable entries: http://groups.google.com/group/android-developers/browse_thread/thread/50f0fc185da8fe4d?pli=1 The suggested solution, wrapping a LinearLayout with ScrollView, worked for me as well. Hope this helps /Poncho On 11/11/2011 02:39 PM, Elison Lusvardi wrote: Hi guys, how are you? I have a problem in my application's ListView. Each item in the ListView can be created by different widgets, some have pictures, the layout is different in each case, some have images, others have buttons, etc.. All of them have actions like onClick and onLongClick - being in the widget itself or in a button. The cost to create each element is high, and the performance is a little bit low. So, I decided to store these items in a HashMap MyWidget> and whenever you create a new item, make sure if it is already inserted in my "cache" verifying by a Key So far so good, it works in order to get these items and recycles them, except that when I perform some action, it usually does not work. The itens doesn't longer detects the onClick, the onLongClick until it goes to outside the viewing area of the ListView. For example. I tap on the picture to open it and nothing happens. But when I take a scroll up or down, when that picture out of my sight, the app displays the picture with the viewer. If I hit a 3 or 4 times, when I move the scroll, the viewer will be opened 3 or 4 times .. = / Does anyone have any idea why this happens? thanks! -- Elison José Gracite Lusvardi -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] changing sound profiles
Maybe here? http://developer.android.com/reference/android/media/AudioManager.html On 11/17/2011 11:41 AM, kaoutar ben ahmed wrote: hello everyone, i'am working on a project in which i need to be able to change the phone mode to silence or vibration or normal sound. i could not find any information about this ,can anyone help me, with a tutorial or something ?? -- 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
Re: [android-developers] Edittext in Listview crashes on Android 2.2.3 on back during editing
http://groups.google.com/group/android-developers/browse_thread/thread/50f0fc185da8fe4d?pli=1 On 12/14/2011 08:08 AM, havexz wrote: Hi So here is what I did. I have a ListView and each item in it is a EditText. Now, just so you know I am using CursorAdapter with ListView, and I am creating EditText in newView and filling it with some text in bindView. Now how to recreate the issue, I just open the activity, click on any of the EditText and just click enough to see the orange color handle appears with cursor. Now just press back twice. Just press fast enough that orange handle still visible on screen. Now wait a sec and you have: . has leaked window . that was originally added here. I tried the normal EditText without the ListView and that works fine. What I think is that IME cursor handle is retaining the EditText and leading to leak. I also tried EditText with only 'hint' (empty EditText) and got same issue in the ListView. Now my questions: Is someone else also face this issue? Any reason why normal EditText works but EditText in ListView dont? Also is it good to put EditText in ListView or there are better options? Well this might be a common issue and some common soln. but I searched it found no good soln. Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@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
Re: [android-developers] Re: Edittext in Listview crashes on Android 2.2.3 on back during editing
On 12/14/2011 09:13 AM, havexz wrote: thanks for referring. Questions below are still open: OPEN Questions: 1. Is someone else also face this issue? I did, this is how I found the link I sent. 2. Any reason why normal EditText works but EditText in ListView dont? Did you read the thread in the link I sent, the first reply suggest that: "ListView isn't really meant to handle that type of UI with editableentries" 3. Why IME cursor handle is giving issue in ListView but not elsewhere? Same as 2. Regarding "Also is it good to put EditText in ListView or there are better options?" I have soln for maintaining the content. I can have text watcher or something. From the same thread: " vertical LinearLayout wrapped ina ScrollView, containing horizontal LinearLayours of the EditTexts andButtons" Hope this helps /Yaron On Dec 14, 12:45 am, poncho wrote: http://groups.google.com/group/android-developers/browse_thread/threa... On 12/14/2011 08:08 AM, havexz wrote: Hi So here is what I did. I have a ListView and each item in it is a EditText. Now, just so you know I am using CursorAdapter with ListView, and I am creating EditText in newView and filling it with some text in bindView. Now how to recreate the issue, I just open the activity, click on any of the EditText and just click enough to see the orange color handle appears with cursor. Now just press back twice. Just press fast enough that orange handle still visible on screen. Now wait a sec and you have: . has leaked window . that was originally added here. I tried the normal EditText without the ListView and that works fine. What I think is that IME cursor handle is retaining the EditText and leading to leak. I also tried EditText with only 'hint' (empty EditText) and got same issue in the ListView. Now my questions: Is someone else also face this issue? Any reason why normal EditText works but EditText in ListView dont? Also is it good to put EditText in ListView or there are better options? Well this might be a common issue and some common soln. but I searched it found no good soln. Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@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