[android-developers] AutoCompleteTextView, passing the focus and Android 1.6
Hi Guys, Has anyone noticed that AutoCompleteTextView doesn't pass the focus to the next field when you tap on NEXT button on soft keyboard? And it's all happening on Android 1.6. v1.5 works flawlessly! Is there any known solution for this? Thank you, Armond -- 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 reject a call using Android SDK
It's not possible for 3rd party app. (No accessible API/no working key injection) On Nov 15, 1:46 am, Muhammad Bilal se.bi...@gmail.com wrote: Hi, My question is really simple and to Geeks and experts in Android development, is it possible to reject a incoming call using Android SDK 1.6 or higher ? regards MB -- 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: Speech Recognition makes a beep when the user Cancels. This is bad.
Wouldn't it be enough to have a small pause after cancellation, before starting to listen again? Or have you already tried this? -- 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: Uploading a File with HttpClient and HttpPost
I solved the problem. I post my code here for others to have a working sample: on the server side I made a simple servlet: -- private void receiveFile(HttpServletRequest req, HttpServletResponse resp) throws Exception { Enumeration emns = req.getHeaderNames(); InputStream is = req.getInputStream(); OutputStream os = new FileOutputStream(req.getHeader(FILENAME_STR)); byte[] buffer = new byte[4096]; int bytesRead; while ((bytesRead = is.read(buffer)) != -1) { os.write(buffer, 0, bytesRead); } is.close(); os.close(); } protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { try { receiveFile(request,response); } catch (Exception e) { System.err.println(ERROR-+e.getMessage()); e.printStackTrace(); } } At the android side (SDK v.2.0 ): private HttpPost post; public void doUpload(String filepath,String filename) { HttpClient httpClient = new DefaultHttpClient(); try { httpClient.getParams().setParameter(http.socket.timeout, new Integer(9)); // 90 second post = new HttpPost(new URI(YOUR_SERVER_ADDRESS)); File file = new File(filepath); FileEntity entity; if (filepath.substring(filepath.length()-3, filepath.length ()).equalsIgnoreCase(txt) || filepath.substring(filepath.length()-3, filepath.length ()).equalsIgnoreCase(log)) { entity = new FileEntity(file,text/plain; charset=\UTF-8\); entity.setChunked(true); }else { entity = new FileEntity(file,binary/octet-stream); entity.setChunked(true); } post.setEntity(entity); post.addHeader(FILENAME_STR, filename); HttpResponse response = httpClient.execute(post); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { Log.e(TAG,ErrorResponse Status line code:+response.getStatusLine()); }else { // Here every thing is fine. } HttpEntity resEntity = response.getEntity(); if (resEntity == null) { Log.e(TAG,-Error No Response !!!-); } } catch (Exception ex) { Log.e(TAG,-Error-+ex.getMessage()); ex.printStackTrace(); } finally { httpClient.getConnectionManager().shutdown(); } } -- 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 popup a window from service
On Nov 13, 9:22 am, elf.cheng king...@gmail.com wrote: I am developing an ip phone an android.it may work as a service in background.when a call(or a message) coming in,I need a window(dialog or activity) popup.how to do that? I believe the NotificationManager is the standard way of doing this, to avoid disturbing the user. -- 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: Inter-activity communication
On Nov 13, 4:11 pm, abhi rkabhi1...@gmail.com wrote: Currently, I am starting a Child activity from a Parent activity in the following manner: public class Parent extends Activity { private int message; public Parent() { message = 0; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //Start child activity Intent child = new Intent(Parent.this,Child.class); startActivityForResult(child, 1); } } Is there a way to communicate the message member variable from the Parent activity to the Child activity? I'm not creating any Child objects above, so I'm confused as to how one is supposed to send messages from the Parent to the Child activities. Any suggestions? Hi, Everything you pass to the child, must be passed inside the Intent. Use putExtra() and get*Extra(). -- 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: viewflipper deck?
Ok I have changed the way i want to make this: I want to make this like the homescreen. So when you fling, the view follows your finger. SO when you are dragging to left, you see already the next view dragging with your finger gesture. Now with the viewflipper it only makes a transition to the next view after you make a full swipe to left or right. How can this be done? I have looked in the android source code (app Launcher) but this is much to complicated for me! Thank you, Wouter On Nov 14, 4:18 pm, Wouter wouterg...@gmail.com wrote: Hey, How can i make something like this: http://mippin.com/buzzdeck I want to make a deck of itinerary items (for my application TripIt). So a new screen per itinerary.. I tried to make this with a viewflipper but it shows the full view on the screen and i cannot see the other decks on the left or right side? Has someone made this before or has tips to make this? Thank you so much, Wouter -- 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 there a list of standard Intent specifications?
That's the one I'm trying to use: intent-filter android:icon=@drawable/icon android:label=@string/ app_name action android:name=android.intent.action.SEND/action category android:name=android.intent.category.ALTERNATIVE/ category category android:name=android.intent.category.SELECTED_ALTERNATIVE/ category /intent-filter On Nov 14, 9:30 pm, Mark Murphy mmur...@commonsware.com wrote: MrChaz wrote: I'm looking into getting my application to show up when the user tries to 'share' a picture via the Gallery application I can't, however, find any information about how exactly to go about this. I'd try supporting ACTION_SEND and see if that gets you in there. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.0 In Print! -- 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] JSONObject text must begin with '{' at character 1
TJ wrote: I'm having a weird error, seems to be cause whenever I hit JSONObject json=new JSONObject(result);. The error msg is org.json.JSONException: A JSONObject text must begin with '{. I have no idea how to fix this is any one have any idea PLEASE LET ME KNOW. The JSON File is thanks The JSON File is {ResultSet:{ totalResultsAvailable:3, totalResultsReturned:2, firstResultPosition:1, Result:[ { Title:madonna 116, Summary:Picture 116 of 184, Url:http:\/\/www.celebritypicturesarchive.com\/pictures\/m\/ madonna\/madonna-116.jpg, } }, { Title:madonna 118, Summary:Picture 118 of 184, Url:http:\/\/www.celebritypicturesarchive.com\/pictures\/m\/ madonna\/madonna-118.jpg, } } ] } } I don't know about the text of the error, but that does not look like valid JSON. You have a couple of extra closing braces, AFAICT. -- 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
Re: [android-developers] Re: Is there a list of standard Intent specifications?
MrChaz wrote: That's the one I'm trying to use: intent-filter android:icon=@drawable/icon android:label=@string/ app_name action android:name=android.intent.action.SEND/action category android:name=android.intent.category.ALTERNATIVE/ category category android:name=android.intent.category.SELECTED_ALTERNATIVE/ category /intent-filter Well, I can tell you that the mail program uses: intent-filter android:label=@string/app_name action android:name=android.intent.action.SEND / data android:mimeType=text/plain / data android:mimeType=image/* / data android:mimeType=video/* / category android:name=android.intent.category.DEFAULT / /intent-filter And the MMS client uses: intent-filter action android:name=android.intent.action.SEND / category android:name=android.intent.category.DEFAULT / data android:mimeType=image/* / /intent-filter intent-filter action android:name=android.intent.action.SEND / category android:name=android.intent.category.DEFAULT / data android:mimeType=video/* / /intent-filter intent-filter action android:name=android.intent.action.SEND / category android:name=android.intent.category.DEFAULT / data android:mimeType=text/plain / /intent-filter The categories you are using are for option menus and AFAIK are not relevant for the scenario you are trying. So, I'd model after the ones from the Android source code. BTW, to find this, you can use Google Code Search: http://www.google.com/codesearch and search on: package:android android.intent.action.SEND (though that will also bring up a bunch of SENDTO entries as well) -- 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: Is there a list of standard Intent specifications?
Thanks mark, I really didn't want to have to crawl around code to find how it's sending the picture i.e. as a content uri and how it's storing it (EXTRA_STREAM) still, it works now. Thanks again. On Nov 15, 12:42 pm, Mark Murphy mmur...@commonsware.com wrote: MrChaz wrote: That's the one I'm trying to use: intent-filter android:icon=@drawable/icon android:label=@string/ app_name action android:name=android.intent.action.SEND/action category android:name=android.intent.category.ALTERNATIVE/ category category android:name=android.intent.category.SELECTED_ALTERNATIVE/ category /intent-filter Well, I can tell you that the mail program uses: intent-filter android:label=@string/app_name action android:name=android.intent.action.SEND / data android:mimeType=text/plain / data android:mimeType=image/* / data android:mimeType=video/* / category android:name=android.intent.category.DEFAULT / /intent-filter And the MMS client uses: intent-filter action android:name=android.intent.action.SEND / category android:name=android.intent.category.DEFAULT / data android:mimeType=image/* / /intent-filter intent-filter action android:name=android.intent.action.SEND / category android:name=android.intent.category.DEFAULT / data android:mimeType=video/* / /intent-filter intent-filter action android:name=android.intent.action.SEND / category android:name=android.intent.category.DEFAULT / data android:mimeType=text/plain / /intent-filter The categories you are using are for option menus and AFAIK are not relevant for the scenario you are trying. So, I'd model after the ones from the Android source code. BTW, to find this, you can use Google Code Search: http://www.google.com/codesearch and search on: package:android android.intent.action.SEND (though that will also bring up a bunch of SENDTO entries as well) -- 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] CheckedTextView and android:checkMark property
Why is that that a XML property android:checkMark in CheckedTextView is not covered in doc http://developer.android.com/reference/android/widget/CheckedTextView.html ? Additionally - it looks that it is *required* attribute to use CheckedTextView as a view in listview with checkboxes Should i treat that as a kind-of-bug, or am I missing 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
[android-developers] Re: OpenGL ES works fine on Emulator but on HTC Hero 1.5 it does not render vertices
Ah sorry for long response time. Anyway, I went back to the problem and started using GLSurfaceView instead and it works with the current setup. With the GLSurfaceView, where am I supposed to implement onTouchListener? Since if I make the starting activity to implement the onTouchListener, it never gets called on touch evens. Any tips what/where it should be implemented? Cheerio for all the tips. On 9 marras, 17:51, Robert Green rbgrn@gmail.com wrote: Ah, I didn't realize how you were initializing GL. I'm bad at the EGL config stuff which is why I just use GLSurfaceView. I'm wondering if your problem is there? Consider trying GLSurfaceView and let me know the results. Otherwise, you may want to debug your init to make sure that it's correctly initializing a GL context and surface on the device. On Nov 9, 6:35 am, Mika mts...@googlemail.com wrote: Hi Robert, Will do. Here goes. First part is the sizeChange() when Android screen size changes and it gets called when the application launches. I'd thought I'd paste in the EGL stuff too, not all of it but some of it since it kind of relates to the initialisation. But yeah, the problem still is there. Itworksfineon emulators but not on the actual device. All the code from below in PasteBin again for easier reading (http://pastebin.com/m484eafe6). //OPENGLINITIALISATION _screenWidth = w; _screenHeight = h; gl.glViewport(0, 0, _screenWidth, _screenHeight); gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST); gl.glClearColor(0, 0, 1, 1); gl.glClear(GL10.GL_COLOR_BUFFER_BIT); gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glMatrixMode(GL10.GL_PROJECTION); // setupOpenGLworld coordinates to match screen coordinates GLU.gluOrtho2D(gl, 0, (float)_screenWidth, (float)_screenHeight, 0); // trying to match world coordinates to screen coordinates (tried using (int) too.. no changes :/) // BEFORE RENDERING: gl.glClear(GL10.GL_COLOR_BUFFER_BIT); gl.glMatrixMode(GL10.GL_MODELVIEW); gl.glLoadIdentity(); // EGL HELPER CLASS THAT TAKES CARE OF GETTING THE CONTEXT FOROPENGL AND ALL THAT SHAZAM private EGL10 _EGL; private EGLDisplay _display; private EGLSurface _surface; private EGLConfig _configs; private EGLContext _context; // EGL INIT int[] configSpec = { EGL10.EGL_DEPTH_SIZE, 0, EGL10.EGL_NONE }; _EGL = (EGL10) EGLContext.getEGL(); _display = _EGL.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); int[] version = new int[2]; _EGL.eglInitialize(_display, version); EGLConfig[] configs = new EGLConfig[1]; int[] num_config = new int[1]; _EGL.eglChooseConfig(_display, configSpec, configs, 1, num_config); _configs = configs[0]; _context = _EGL.eglCreateContext(_display, _configs, EGL10.EGL_NO_CONTEXT, null); _surface = null; But yeah, if anyone knows what's going on or knows what I'm doing wrong I'd be mighty grateful. I feel pretty lost with this one. Cheers again guys. On 9 marras, 00:14, Robert Green rbgrn@gmail.com wrote: I had a problem with Ortho on my phone vs on theemulatorat one point as well. Could you post more of your GL initialization code? My problem was something dumb like I was calling orthox using actual screen dimensions when I needed to either use fixed point there or use orthof. On Nov 8, 3:34 pm, Mika mts...@googlemail.com wrote: Hello everyone. Running into REALLY interesting problems withOpenGL ES. Basically when I start my program in 1.5 or 1.6emulator, itworks justfinebut on HTC Hero 1.5 it does not. The problem is that the vertices are not being rendered but the gl.glClear() command is working justfine. I followed in with the debugger and it does go into the rendering function and such but still not rendering the vertices... Here is the code in PasteBin (easier to read:http://pastebin.com/m706686e6 ) And here is the same thing pasted here: // VERTICE INIT int one = 65536; int half = one / 2; int vertices[] = { -half, -half, half, half, -half, half, -half, half, half, half, half, half } ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4); vbb.order(ByteOrder.nativeOrder()); mVertexBuffer = vbb.asIntBuffer(); mVertexBuffer.put(vertices); mVertexBuffer.position(0); // AND IN RENDER gl.glVertexPointer(3, GL10.GL_FIXED, 0, mVertexBuffer); gl.glColor4f(1, 0, 0, 1); gl.glScalef(50, 50, 1); gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4); Also I got my projection set in 2D ortho projection to match screen coordinates so that's why scale to 50,50 to actually make a bit bigger. I've tried using
[android-developers] Re: JSONObject text must begin with '{' at character 1
First, as Mark said, you have an extra curly bracket. You also have switched the ending square bracket with the ending curly bracket. The error might be indicating you are trying to access Result as a JSONObject, as opposed to the JSONArray that it is. Or it is a side effect of the mal-formed JSON. On Nov 15, 5:37 am, Mark Murphy mmur...@commonsware.com wrote: TJ wrote: I'm having a weird error, seems to be cause whenever I hit JSONObject json=new JSONObject(result);. The error msg is org.json.JSONException: A JSONObject text must begin with '{. I have no idea how to fix this is any one have any idea PLEASE LET ME KNOW. The JSON File is thanks The JSON File is {ResultSet:{ totalResultsAvailable:3, totalResultsReturned:2, firstResultPosition:1, Result:[ { Title:madonna 116, Summary:Picture 116 of 184, Url:http:\/\/www.celebritypicturesarchive.com\/pictures\/m\/ madonna\/madonna-116.jpg, } }, { Title:madonna 118, Summary:Picture 118 of 184, Url:http:\/\/www.celebritypicturesarchive.com\/pictures\/m\/ madonna\/madonna-118.jpg, } } ] } } I don't know about the text of the error, but that does not look like valid JSON. You have a couple of extra closing braces, AFAICT. -- 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] how to modify the dataRoam Setting of device
i want to block all the data connection when phone is in roaming . how to chang the data Roam Setting ? who can help me? 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] how to know whether a resource is compressed or not?
we can let aapt not compress the resource via command -0. which api can be used to check the resource is compress or not? thanks a lot -- 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: BAck to Activity after WebView
Hi, Just to be sure... is the previous Activity still on the task stack? You did not finish() it? On Nov 15, 6:16 am, toby teisentrae...@googlemail.com wrote: Hello, I've been searching and looking for this answer for quite some time now. I want to display a little HTML in a webView. When the User read the HTML, he's supposed to use the back button to go back to the previous activity. However, it closes the App. How can I make it go back to the last Activity? It would also be ok to display a soft back button or something. Here my code [snip] WebView webview = new WebView(this); setContentView(webview); webview.canGoBack(); webview.loadData(worker.getHtmlResult(), text/html, utf-8); [snap] Thanks, Toby -- 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] What is you Qustion?
http://www.healths.110mb.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] Broadcast receiver
Hi I am having trouble with broadcast receivers, I want to use the media_button broadcast so I can call a method on my service, I have tried putting the receiver inside the service class so I can call the method but that just says that the receiver is enclosed, but not static. If I create a new receiver class then I would have to bind a service connection from the receiver and that don't seem right, so what am I doing wrong I tried searching for it but cant seem to find an answer. -- 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] Broadcast receiver
Paul Townsend wrote: Hi I am having trouble with broadcast receivers, I want to use the media_button broadcast so I can call a method on my service, I have tried putting the receiver inside the service class so I can call the method but that just says that the receiver is enclosed, but not static. If I create a new receiver class then I would have to bind a service connection from the receiver and that don't seem right, so what am I doing wrong I tried searching for it but cant seem to find an answer. If I am going to register a BroadcastReceiver in Java code (vs. via the manifest), I tend to just make it an anonymous inner class: BroadcastReceiver onBatteryChanged=new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { // something useful here } }; You can see an example of this for receiving ACTION_BATTERY_CHANGED broadcast Intents here: http://github.com/commonsguy/cw-advandroid/tree/master/SystemEvents/OnBattery/ The same techniques should work for you for your media button. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android 1.6 Programming Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Broadcast receiver
Edit: Just thought I could use an Intent to the service and it will go through the onstart() etc... so I can do what I need but what if I needed to do the same in the activity as that dosen't have the same thing. 2009/11/15 Paul Townsend deer...@googlemail.com Hi I am having trouble with broadcast receivers, I want to use the media_button broadcast so I can call a method on my service, I have tried putting the receiver inside the service class so I can call the method but that just says that the receiver is enclosed, but not static. If I create a new receiver class then I would have to bind a service connection from the receiver and that don't seem right, so what am I doing wrong I tried searching for it but cant seem to find an answer. -- 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.comandroid-developers%2bunsubscr...@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] Broadcast receiver
Ahh thats not the way the samples do it, that kinda looks more right too, I will try that. 2009/11/15 Mark Murphy mmur...@commonsware.com Paul Townsend wrote: Hi I am having trouble with broadcast receivers, I want to use the media_button broadcast so I can call a method on my service, I have tried putting the receiver inside the service class so I can call the method but that just says that the receiver is enclosed, but not static. If I create a new receiver class then I would have to bind a service connection from the receiver and that don't seem right, so what am I doing wrong I tried searching for it but cant seem to find an answer. If I am going to register a BroadcastReceiver in Java code (vs. via the manifest), I tend to just make it an anonymous inner class: BroadcastReceiver onBatteryChanged=new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { // something useful here } }; You can see an example of this for receiving ACTION_BATTERY_CHANGED broadcast Intents here: http://github.com/commonsguy/cw-advandroid/tree/master/SystemEvents/OnBattery/ The same techniques should work for you for your media button. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android 1.6 Programming Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@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] Broadcast receiver
Cheers thx m8 got it working :) 2009/11/15 Paul Townsend deer...@googlemail.com Ahh thats not the way the samples do it, that kinda looks more right too, I will try that. 2009/11/15 Mark Murphy mmur...@commonsware.com Paul Townsend wrote: Hi I am having trouble with broadcast receivers, I want to use the media_button broadcast so I can call a method on my service, I have tried putting the receiver inside the service class so I can call the method but that just says that the receiver is enclosed, but not static. If I create a new receiver class then I would have to bind a service connection from the receiver and that don't seem right, so what am I doing wrong I tried searching for it but cant seem to find an answer. If I am going to register a BroadcastReceiver in Java code (vs. via the manifest), I tend to just make it an anonymous inner class: BroadcastReceiver onBatteryChanged=new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { // something useful here } }; You can see an example of this for receiving ACTION_BATTERY_CHANGED broadcast Intents here: http://github.com/commonsguy/cw-advandroid/tree/master/SystemEvents/OnBattery/ The same techniques should work for you for your media button. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android 1.6 Programming Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: ListView problem is back.
A reference on the sample project is in my first post: http://listexample.googlecode.com/ Don't be afraid, there is a just few lines of code and nothing is unnecessary. On 14 ноя, 16:52, Dan Dumont ddum...@gmail.com wrote: Can you post a sample? On Nov 14, 2009 4:23 AM, Sergey Vasilinets sergey.vasilin...@googlemail.com wrote: Goog Morning Dan, Thank you for your reply. This project is very simple and there isn't such functions as delete and edit. That's why only action with the size of adapter is adding and it's in safe method of AsyncTask On 14 ноя, 06:52, Dan Dumont ddum...@gmail.com wrote: I'm pretty sure that if the size of the a... sergey.vasilin...@googlemail.com wrote: Hello, I have a error 11-14 01:23:23.204: ERROR/... android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@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... -- 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: Invalid Audio Buffer Size on Samsung Galaxy
Further analysis reveals it only supports an 8k sampling rate. This is obviously a bug. Where do I file a bug report against the Samsung phone? On Nov 14, 9:49 pm, joelt j...@harpsoft.com wrote: It is also spitting this out: WARN/AudioHardwareMSM72XX(1018): getInputBufferSize bad sampling rate: 44100 Is there an API that will tell me which rates it _does_ support? It doesn't look like it. On Nov 14, 8:57 pm, joelt j...@harpsoft.com wrote: The following works fine on a G1 but gives an error on the Samsung Galaxy. I was hoping cross-platform support would be better than this. See error below. private final static int RATE = 44100; private final static int CHANNEL_MODE = AudioFormat.CHANNEL_CONFIGURATION_MONO; private final static int ENCODING = AudioFormat.ENCODING_PCM_16BIT; private AudioRecord recorder_; public boolean open() { int bufferSize = 4 * AudioRecord.getMinBufferSize(RATE, CHANNEL_MODE, ENCODING); recorder_ = new AudioRecord(AudioSource.MIC, RATE, CHANNEL_MODE, ENCODING, bufferSize); last line gives the following on the Samsung Galaxy phone: 11-14 19:04:07.507: ERROR/AndroidRuntime(7617): java.lang.IllegalArgumentException: Invalid audio buffer size. -- 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] Code compiled with SDK 2.0 does not install (and therefore run) on 1.5 emulator
I did signed export of the package while setting the target as 2.0. Then I tried to install the package by downloading it *through browser* (OTA download) on all the emulators. On 1.5, when I click on the download in order to install the package, I get the Parse Error: There is a problem parsing the package It works on 1.6 and 2.0 though. Compiling with 1.6 set as the target seems to install on all the emulators ok. Is it zipalign issue? Or if not - can someone clarify that to me? For now I don't use any 2.0 APIs, so I can just use 1.6 but in future - who knows and if this is going to be still a problem, how should be go about backward compatibility? Regards, Max. -- 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: JSONObject text must begin with '{' at character 1
Mark, thanks for the help But, I an also getting the same error msg when I try pulling the JSON file from twitter.com. thanks for the help. String url = http://twitter.com/statuses/user_timeline.json? screen_name=huskyr; HttpClient httpclient = new DefaultHttpClient(); HttpGet httpget = new HttpGet(url); HttpResponse response; InputStream instream = entity.getContent(); String result= convertStreamToString(instream); JSONObject json=new JSONObject(result); -- 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: Bounding Geometry in Maps?
That is a correct assumption. The span values give you the total latitude or longitude distance across the screen. - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking On Sat, Nov 14, 2009 at 11:44 PM, Chad cha...@gmail.com wrote: You know, I took a look at that lat/lon span and totally dismissed it. Now it makes sense. Thanks for the pointer. So is it safe to assume that I need to divide the span value in 1/2 prior to adding/subtracting that value from the center point lat/lon? Thanks, Chad On Nov 13, 3:23 pm, TreKing treking...@gmail.com wrote: The MapView class has a center point and latitude and longitude spans that you can use to compute the visible area. - TreKing - Chicago transit tracking app for Android-powered deviceshttp:// sites.google.com/site/rezmobileapps/treking On Fri, Nov 13, 2009 at 9:30 AM, Chad cha...@gmail.com wrote: Is there a way to get the current bounding geometry or bounding box in a current map view? I am connecting to a large dataset and would like the ability to send a bounding box of the users current view to the server to retrieve only the points that are within the users view and maybe buffer a little outside similar to google earth. Thanks, Chad -- 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.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@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.comandroid-developers%2bunsubscr...@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] Re: JSONObject text must begin with '{' at character 1
TJ wrote: Mark, thanks for the help But, I an also getting the same error msg when I try pulling the JSON file from twitter.com. thanks for the help. String url = http://twitter.com/statuses/user_timeline.json? screen_name=huskyr; HttpClient httpclient = new DefaultHttpClient(); HttpGet httpget = new HttpGet(url); HttpResponse response; InputStream instream = entity.getContent(); String result= convertStreamToString(instream); JSONObject json=new JSONObject(result); Rather than entity.getContent() and whatever convertStreamToString() is, use a BasicResponseHandler to get String content back from a Web service. Visit http://commonsware.com/AndTutorials, scroll down, and click on the Source Code link. Tutorial #17 will demonstrate accessing Twitter via HttpClient and a BasicResponseHandler, parsing it into a JSONObject. However, that is for a status update -- starting in Tutorial #18, I dump manual Twitter HTTP stuff like a bad habit and switch to using JTwitter. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android 1.6 Programming Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: OpenGL ES works fine on Emulator but on HTC Hero 1.5 it does not render vertices
On Nov 15, 1:27 pm, Mika mts...@googlemail.com wrote: With the GLSurfaceView, where am I supposed to implement onTouchListener? In my OpenGL app, I use an onTouchEvent listener on the containing activity instead. Works for me. String -- 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] ArchOS emulator?
At some point I may have to test apps to get them working on Archos or Android-x86. I was thinking I could use Android-x86 in Qemu to test archos compatibility..so what problems would I run into with this approach? Thanks Fred Grott Android Developer http://mobilebytes.wordpress.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: Extremely long DNS lookup (and failure) on T-Mobile network
How are you all getting around this issue? I am running into it on some phones given out as demos (G1s running 1.5). About 50% of the time, my network requests will just hang for about two minutes, then throw: java.net.UnknownHostException: Host is unresolved: myapi.me.com:80 this looks embarrassing since the users can open pages through the browser ok - what is going on? Thanks On Oct 26, 10:05 am, purvi purvi.n...@gmail.com wrote: Hello, I am also facing the same problem. I am using a handler to fetch the data coming from the network request. I am thinking to throw an alert message to the user from my app indicating No Response from Network or Network down or somthing like that so that the user donot see any error and the user himself restart the app or take corresponding steps instead of showing user an error. But I system gets to know that there is no network after all my queries are manipulated and so I dont know where exactly can I handle this error. I am able to made it print in my LogCat error[URL not found] so it doesnot give any Force Close error but I want the user to be notified about this. Can you please comment on this and incase if you can help me out with this? Thanks a lot. Regards, Purvi On Oct 15, 2:26 am, tomei.ninge...@gmail.com tomei.ninge...@gmail.com wrote: More info: I found out that the web site returns multiple IP addresses on the DNS lookup (see the Resolving i2.sinaimg.cn line below). This appears to be for load balancing purposes. Could this be the reason that got Android confused? $ wgethttp://i2.sinaimg.cn/IT/2009/1014/20091014235428.jpg --23:20:59-- http://i2.sinaimg.cn/IT/2009/1014/20091014235428.jpg = `20091014235428.jpg.1' Resolving i2.sinaimg.cn... 61.172.207.61, 61.172.207.62, 61.172.207.64, ... Connecting to i2.sinaimg.cn|61.172.207.61|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 93,820 (92K) [image/jpeg] On Oct 14, 9:53 pm, tomei.ninge...@gmail.com tomei.ninge...@gmail.com wrote: My problem may not be the same. I got this only on actual G1 device, not on emulator. Also, if G1 is connect to my home WiFi network (comcast), the DNS for i0.sinaimg.cn is resolved without any problem. However, if I disconnect Wifi and use TMO USA 3G network, the DNS never resolves. On Oct 14, 9:29 pm, for android forandr...@gmail.com wrote: http://code.google.com/p/android/issues/detail?id=2764 On Thu, Oct 15, 2009 at 4:40 AM, tomei.ninge...@gmail.com tomei.ninge...@gmail.com wrote: Hello, This happens only when my G1 phone is on T-Mobile network: I found that when I try to go to the browser, and type the address http://i0.sinaimg.cn/ The browser tries to load the page, but no progress is shown for more than 2 minutes. (I have full 3G signal; all other addresses work just fine) Eventually when I tried to access this URL in my Java code, I found a similar long delay when I try to open the HttpUrlConnection, and eventually I get thisexception: I/InetAddress( 1940):Unknownhosti0.sinaimg.cn, throwing UnknownHostException W/System.err( 1940): java.net.UnknownHostException:Hostis unresolved: i0.sinaimg.cn:80 W/System.err( 1940): at java.net.Socket.connect(Socket.java:1002) Why would DNS take so long? Also, if my program tries to issue the same HTTP request again, the same 2+ minute blocking happened. Is this an Android bug or a T-Mobile infrastructure bug? It seems the Android API should try to time-out faster, especially on the second attempt.- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- 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] Orientation change of gsm re-initializes the application
Hoi My application gets re-initialized when the gsm orientation changes from portrait to landscape and vice versa. I want to keep the application in portrait since it does not make any sense to have it in landscape mode. Does anyone know how to prevent the re-intantiation of the app and how I can keep the application in portrait even when the gsm is in landscape orientation? Help is very much appreciated Jasper de Keijzer -- 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: Layout problems
Thanks! I use now the relativelayout which requires for every control its relative position. It seems to work, so I keep it that way. Thanks anyway for help. By the way the results can be seen on google market. Free reversi app by Jasper de Keijzer. Bye Jasper On Nov 13, 8:09 pm, Morten Isaksen mazterar...@gmail.com wrote: I'm new to Android. I haven't written a line of working code yet. I've bought three books, and I've read 10 pages. Try gravity. I think that attribute gives an element more weight. Perhaps that will force the button to be visible? -- 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] Orientation change of gsm re-initializes the application
jdekeij wrote: Hoi My application gets re-initialized when the gsm orientation changes from portrait to landscape and vice versa. I want to keep the application in portrait since it does not make any sense to have it in landscape mode. Does anyone know how to prevent the re-intantiation of the app and how I can keep the application in portrait even when the gsm is in landscape orientation? Add android:screenOrientation=portrait to the activity element of the AndroidManifest.xml file, and that activity will stay locked in portrait mode. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.0 In Print! -- 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: Orientation change of gsm re-initializes the application
Thanks!! On Nov 15, 8:00 pm, Mark Murphy mmur...@commonsware.com wrote: jdekeij wrote: Hoi My application gets re-initialized when the gsm orientation changes from portrait to landscape and vice versa. I want to keep the application in portrait since it does not make any sense to have it in landscape mode. Does anyone know how to prevent the re-intantiation of the app and how I can keep the application in portrait even when the gsm is in landscape orientation? Add android:screenOrientation=portrait to the activity element of the AndroidManifest.xml file, and that activity will stay locked in portrait mode. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.0 In Print! -- 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: JSONObject text must begin with '{' at character 1
Mark, Thanks for the link, a lot of good examples. I try to use BasicResponseHandler but I am still getting the same error. Could it be something with Eclipse? org.json.JSONException: A JSONObject text must begin with '{' at character 1 DefaultHttpClient client=null; HttpClient httpclient = new DefaultHttpClient(); client=new DefaultHttpClient(); HttpParams params=new BasicHttpParams(); HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1); HttpProtocolParams.setContentCharset(params, UTF_8); HttpProtocolParams.setUseExpectContinue(params, false); client.setParams(params); HttpPost post=new HttpPost(http://brh.numbera.com/software/jsonview/ example.json); try { ResponseHandlerString responseHandler=new BasicResponseHandler(); String responseBody=httpclient.execute(post, responseHandler); Log.v(TAG, responseBody + responseBody.toString()); JSONObject response=new JSONObject(responseBody); Log.v(TAG, Response + response.toString()); } catch(Exception e) { Log.v(TAG, E + e.toString()); } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: JSONObject text must begin with '{' at character 1
Mark, I may have found the problem, but not sure how I can fix it. The log msg for the responseBody is below. Should it be the UTF_8 param? thanks {hey: guy,anumber: 243,anobject: {whoa: nuts,anarray: [1,2,thrh1ee], more:stuff},awesome: true,bogus: false,meaning: null, japanese:明日㠌à £Â ‚る。, link: http://jsonview.com;, notLink: http:// jsonview.com is great} -- 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: Extremely long DNS lookup (and failure) on T-Mobile network
I have seen this too, but what's worse, I've found socket connections taking to long to connect, even when not using DNS. For example, our software can connect to a PC via LAN using an IP address. Sometimes it will take 5 seconds, sometimes it will time out. In either case, after such a failure, if I close and re-run the app, it connects immediately. This problem started around the time 1.6 was released. SoftwareForMe.com Makers of PhoneMyPC On Sun, Nov 15, 2009 at 10:33 AM, Mark Wyszomierski mar...@gmail.comwrote: How are you all getting around this issue? I am running into it on some phones given out as demos (G1s running 1.5). About 50% of the time, my network requests will just hang for about two minutes, then throw: java.net.UnknownHostException: Host is unresolved: myapi.me.com:80 this looks embarrassing since the users can open pages through the browser ok - what is going on? Thanks On Oct 26, 10:05 am, purvi purvi.n...@gmail.com wrote: Hello, I am also facing the same problem. I am using a handler to fetch the data coming from the network request. I am thinking to throw an alert message to the user from my app indicating No Response from Network or Network down or somthing like that so that the user donot see any error and the user himself restart the app or take corresponding steps instead of showing user an error. But I system gets to know that there is no network after all my queries are manipulated and so I dont know where exactly can I handle this error. I am able to made it print in my LogCat error[URL not found] so it doesnot give any Force Close error but I want the user to be notified about this. Can you please comment on this and incase if you can help me out with this? Thanks a lot. Regards, Purvi On Oct 15, 2:26 am, tomei.ninge...@gmail.com tomei.ninge...@gmail.com wrote: More info: I found out that the web site returns multiple IP addresses on the DNS lookup (see the Resolving i2.sinaimg.cn line below). This appears to be for load balancing purposes. Could this be the reason that got Android confused? $ wgethttp://i2.sinaimg.cn/IT/2009/1014/20091014235428.jpg --23:20:59-- http://i2.sinaimg.cn/IT/2009/1014/20091014235428.jpg = `20091014235428.jpg.1' Resolving i2.sinaimg.cn... 61.172.207.61, 61.172.207.62, 61.172.207.64, ... Connecting to i2.sinaimg.cn|61.172.207.61|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 93,820 (92K) [image/jpeg] On Oct 14, 9:53 pm, tomei.ninge...@gmail.com tomei.ninge...@gmail.com wrote: My problem may not be the same. I got this only on actual G1 device, not on emulator. Also, if G1 is connect to my home WiFi network (comcast), the DNS for i0.sinaimg.cn is resolved without any problem. However, if I disconnect Wifi and use TMO USA 3G network, the DNS never resolves. On Oct 14, 9:29 pm, for android forandr...@gmail.com wrote: http://code.google.com/p/android/issues/detail?id=2764 On Thu, Oct 15, 2009 at 4:40 AM, tomei.ninge...@gmail.com tomei.ninge...@gmail.com wrote: Hello, This happens only when my G1 phone is on T-Mobile network: I found that when I try to go to the browser, and type the address http://i0.sinaimg.cn/ The browser tries to load the page, but no progress is shown for more than 2 minutes. (I have full 3G signal; all other addresses work just fine) Eventually when I tried to access this URL in my Java code, I found a similar long delay when I try to open the HttpUrlConnection, and eventually I get thisexception: I/InetAddress( 1940):Unknownhosti0.sinaimg.cn, throwing UnknownHostException W/System.err( 1940): java.net.UnknownHostException:Hostis unresolved: i0.sinaimg.cn:80 W/System.err( 1940):at java.net.Socket.connect(Socket.java:1002) Why would DNS take so long? Also, if my program tries to issue the same HTTP request again, the same 2+ minute blocking happened. Is this an Android bug or a T-Mobile infrastructure bug? It seems the Android API should try to time-out faster, especially on the second attempt.- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Warm regards, The PhoneMyPC Team -- You received this message because you are subscribed to the Google Groups Android
[android-developers] AppWidgetProvider SCREEN_ON/OFF Intent not received
Hi, We've an AppWidgetProvider and we would like to receive SCREEN_ON. From the following thread, it seems not possible to register for such event in AndroidManifest.xml http://groups.google.com/group/android-developers/browse_thread/thread/40753eb1b312f4ab/3e171b45a2fe880c?#3e171b45a2fe880c The thread reports that registration must be done with API. It works fine for an Activity but it is not allowed from a AppWidgetProvider which is already a BroadcastReceiver. Is there any solution ? 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: Archos/Android development
On Nov 14, 8:51 pm, Thomas Riley tomrile...@googlemail.com wrote: Firstly, here is the APK:http://files.appslib.com/apps/marketplace/appslib.apk Ah thanks, that's different from the link on the front page. Is that the one giving the 404 error? Its working me me. As for testing, I guess it would be best to try and find someone with a archos device and try it proper. I do hope my applications get validated :) It's a bit egg chicken that's for sure. Did you do anything special for the extended top bar when porting or just trust the views to resize themselves to the available space under it ? Lee -- 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: Archos/Android development
Sorry, just to check: the extended status bar doesn't show up in your emulator, right ? I just get the normal status bar even with the a5_horiz skin. Lee -- 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: JSONObject text must begin with '{' at character 1
Mark, I may have found the problem, but not sure how I can fix it. The log msg for the responseBody is below. Should it be the UTF_8 param? thanks {hey: guy,anumber: 243,anobject: {whoa: nuts,anarray: [1,2,thrh1ee], more:stuff},awesome: true,bogus: false,meaning: null, japanese:明日㠌à £Â ‚る。, link: http://jsonview.com;, notLink: http:// jsonview.com is great} Well, the stuff before the opening { is definitely not legal JSON. I'm no UTF-8 expert, but I'll be somewhat surprised if there's an encoding that justifies a bunch of extra characters like that at the front of the text. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html -- 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] startForeground Backwards compatability
Hi, I've got a question as I don't have an Android 2.0 device to test on and this particular aspect seems untestable in the emulator. I've got a service that needs to be run as a foreground service. I have a notification that stops it etc, so I have no problem using startForeground instead of setForeground. However, I'd like to have 1 version of my app that works across all platforms... Is this possible? If my app is compiled with Android 1.5 and uses setForeground, then will that command actually work on an Android 2.0 device, or does it not matter which sdk was used to compile? I've tried compiling with 2.0, and surrounding the call to startForeground with a try/catch, but that throws a VerifyError when the service is started, when run on a 1.5/6 device since startForeground doesn't exist there. Can I catch and ignore the VerifyError somehow and make it work that way? Any help would be appreciated, I really don't want to have to make a 2nd branch of my app. Regards, Geoff -- 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: JSONObject text must begin with '{' at character 1
Mark Murphy wrote: Mark, I may have found the problem, but not sure how I can fix it. The log msg for the responseBody is below. Should it be the UTF_8 param? thanks {hey: guy,anumber: 243,anobject: {whoa: nuts,anarray: [1,2,thrh1ee], more:stuff},awesome: true,bogus: false,meaning: null, japanese:明日㠌à £Â ‚る。, link: http://jsonview.com;, notLink: http:// jsonview.com is great} Well, the stuff before the opening { is definitely not legal JSON. I'm no UTF-8 expert, but I'll be somewhat surprised if there's an encoding that justifies a bunch of extra characters like that at the front of the text. Well, A characters with a bit of diacritical on top and a seemingly random character after it is petty typical for incorrect use of UTF-8 in my experience. I'd suggest that you start by removing the UTF parameters and see what happens. I use UTF-8 characters in JSON calls for one of my apps and for me it works perfectly by just encoding the query with UTF-8. However, in my case I explained very carefully what I wanted from the server people - you may not have that advantage... Still, if you capture the stream content you should be able to massage it into shape with some effort. My JSON lookup handler takes a sanity peek at the first character that is returned from the call - if it is neither '[' nor '{' I consider it a failure. Good luck / Jonas PS. Yes, the app in question is Prisjakt that won the Swedish Android Developer Competition '09. Now ,if only the prizes had been of the same magnitude as in ADC1/2... ;-) -- 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] Making SearchManager behave like the old googlenav.Search
So I have been looking into this for a couple of days, and I am pretty sure the intent of the android API team is to make SearchManager a platform level tool for searching application level content, like a application database, which is very cool, and I will probably use, but not what I want at this moment. I want to be able search a map just like the Google search apis for javascript: // We'll wait to the end to actually initialize the map // So let's build the search control searchControl = new google.search.SearchControl(); // Initialize a LocalSearch instance searcher = new google.search.LocalSearch(); // create the object //google.search.LocalSearch.ADDRESS_LOOKUP_ENABLED searcher.setCenterPoint(map); // bind the searcher to the map // Create a SearcherOptions object to ensure we can see all results var options = new google.search.SearcherOptions(); // create the object options.setExpandMode (google.search.SearchControl.EXPAND_MODE_OPEN); // Add the searcher to the SearchControl searchControl.addSearcher(searcher , options); // And second, we need is a search complete callback! searchControl.setSearchCompleteCallback(searcher , function() { map.clearOverlays(); var results = searcher.results; // Grab the results array // We loop through to get the points for (var i = 0; i results.length; i++) { var result = results[i]; // Get the specific result var markerLatLng = new google.maps.LatLng(parseFloat (result.lat), parseFloat (result.lng)); var marker = new google.maps.Marker(markerLatLng); // Create the marker // Bind information for the infoWindow aka the map marker popup marker.bindInfoWindow(result.html.cloneNode(true)); result.marker = marker; // bind the marker to the result map.addOverlay(marker); // add the marker to the map } This *was* in previous versions of the API (1.0?) I have seen very old code like: // W00t! Search for Pizza. // Create a MapPoint from the map's coordinates MapPoint mapPoint = new MapPoint(mMapView.getMapCenter ().getLatitudeE6(), mMapView.getMapCenter().getLongitudeE6()); // Create a dummy Map for use in Search Map map = new Map(getDispatcher(), null, 0, 0, 0, mapPoint, Zoom.getZoom(mMapView.getZoomLevel()), 0); // Search for Pizza near the specified coordinates Search search = new Search(Pizza, map, 0); // add the request the dispatcher getDispatcher().addDataRequest(search); // Wait for the search to complete, Should do this // in another thread ideally, this is just for illustration here. while (!search.isComplete()) { Log.i(LOG_TAG, .); } // Print the details. Log.i(LOG_TAG, Done - + search.numPlacemarks()); MapPoint point = null; for (int i = 0; i search.numPlacemarks(); i++) { Placemark placemark = search.getPlacemark(i); point = placemark.getLocation(); Log.i(LOG_TAG, - i : + Integer.toString(i)); Log.i(LOG_TAG, - Bubble : + placemark.getBubbleDescriptor()); Log.i(LOG_TAG, - Detail : + placemark.getDetailsDescriptor()); Log.i(LOG_TAG, - Title : + placemark.getTitle()); Log.i(LOG_TAG, - Location : + placemark.getLocation ().toString()); Log.i(LOG_TAG, - routable : + placemark.routableString()); } // Animate to the last location. if (point != null) { MapController mc = mMapView.getController(); Point point1 = new Point(point.getLatitude(), point.getLongitude()); mc.animateTo(point1); mc.zoomTo(12); Log.i(animateTo, point1.toString()); } I have been thinking it could be possible by geocoding an address using the location manager: //first find the location using geocoding Geocoder geocoder = new Geocoder(getApplicationContext(), Locale.getDefault()); try { ListAddress addrs = geocoder.getFromLocation(mMyLocationLat, mMyLocationLon, 1); } catch (IOException e) { Log.e(TAG, geocoding failed); } and then pre populating the search with something like pizza @94611, but right now when I do search the results go to a browser, I really want to be able to parse the results myself using an api. Does anyone know of an example like this or can give me some advice, the API docs on SearchManager are a little difficult
[android-developers] Re: OpenGL ES works fine on Emulator but on HTC Hero 1.5 it does not render vertices
Oh wow, I was so blind, I was just forcefully trying to implement onTouch() instead of onTouchEvent(), as soon as I swapped it, it started to work. Phew... How blind can you became to your own code? =) Thank you guys. On 15 marras, 18:20, String sterling.ud...@googlemail.com wrote: On Nov 15, 1:27 pm, Mika mts...@googlemail.com wrote: With the GLSurfaceView, where am I supposed to implement onTouchListener? In myOpenGLapp, I use an onTouchEvent listener on the containing activity instead. Works for me. String -- 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] startForeground Backwards compatability
Yes, this is possible and definitely testable in the emulator. I actually just update my own app to account for this change in 2.0. I don't think you can get around the VerifyError but you can check if the method you want to use exists. Build against 2.0 and use reflection to check if the startForeground exists and use it if it does, otherwise default to setForeground. There was a blog post about using reflection for things like this though I don't have the link handy. Hope that helps. - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking On Sun, Nov 15, 2009 at 2:27 PM, G ghack...@gmail.com wrote: Hi, I've got a question as I don't have an Android 2.0 device to test on and this particular aspect seems untestable in the emulator. I've got a service that needs to be run as a foreground service. I have a notification that stops it etc, so I have no problem using startForeground instead of setForeground. However, I'd like to have 1 version of my app that works across all platforms... Is this possible? If my app is compiled with Android 1.5 and uses setForeground, then will that command actually work on an Android 2.0 device, or does it not matter which sdk was used to compile? I've tried compiling with 2.0, and surrounding the call to startForeground with a try/catch, but that throws a VerifyError when the service is started, when run on a 1.5/6 device since startForeground doesn't exist there. Can I catch and ignore the VerifyError somehow and make it work that way? Any help would be appreciated, I really don't want to have to make a 2nd branch of my app. Regards, Geoff -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Code compiled with SDK 2.0 does not install (and therefore run) on 1.5 emulator
I just bumped up the build target on one of my apps to Android 2.0, exported a signed APK, and it installed and ran OK from the Browser app on the Android 1.5 emulator. So I guess the problem doesn't always occur. I wonder what we are doing different. What are you using for the uses-sdk element in your manifest? My test used: uses-sdk android:minSdkVersion=3 android:targetSdkVersion=4 / Although I think the wrong values there would result in a cannot be installed on this phone error rather than a parse error. On Nov 15, 12:55 pm, Max Binshtok max.binsh...@gmail.com wrote: I did signed export of the package while setting the target as 2.0. Then I tried to install the package by downloading it *through browser* (OTA download) on all the emulators. On 1.5, when I click on the download in order to install the package, I get the Parse Error: There is a problem parsing the package It works on 1.6 and 2.0 though. Compiling with 1.6 set as the target seems to install on all the emulators ok. Is it zipalign issue? Or if not - can someone clarify that to me? For now I don't use any 2.0 APIs, so I can just use 1.6 but in future - who knows and if this is going to be still a problem, how should be go about backward compatibility? Regards, Max. -- 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: Multitouch support in Android 2.0
I think I've got this figured out. Almost. With multi-touch support, getAction() can return a compound value representing the pointerID in the second byte and the action value in the first byte. For example, if two fingers are down, and pointerID 1 is lifted (i.e., finger 2), getAction() returns a value of 262 (0x100 or 256 to represent pointerID 1, and 6 to represent up for a compound value of 0x106 or 262). I'm curious why it was done this way instead of using 0 for down and 1 for up, even when pointers are involved. Things get a little weird because of the differences. Here's an example (note I'm using a Motorola Droid phone here so this may behave differently on other devices): Press finger 1 to the screen (action value of 0) finger 1 gets pointerID 0, no problem, pointerID is 0, down is 0 Press finger 2 to the screen (action value of 261) finger 2 gets pointerID 1, a little weird, could have been 256 instead? Lift finger 1 from the screen (action value of 6) finger 2 is still pointerID 1, action could still have been 1? Lift finger 2 from the screen (action value of 1) finger 2 is still pointerID 1, but the action value is not 262 or 257 it's 1 It would seem I can't use the bitmasks reliably in all cases. If I always inspect the action value for the pointerID and the action value, I get messed up at the end because pointerID has vanished. And 0 seems to be equivalent to 5, and 1 to 6. Is this something you'd consider a bug or is this how it's supposed to work? Should we expect it to continue to work this way? Thanks for your help. - dave On Oct 27, 4:28 pm, Dianne Hackborn hack...@android.com wrote: On Tue, Oct 27, 2009 at 2:02 PM, MrChaz mrchazmob...@googlemail.com wrote: Thanks for the info, Wouldn't this Finger 1 up: MotionEvent ACTION_POINTER_1_UP with one pointer, whose ID is 1. need to be ID of 0? Or am I mis-understanding the purpose of the UP action? Good point. Actually my example was not very good because at the places where there is an up transition, the last position of the pointer going up is included in the event stream -- so in all of these, you would receive both 0 and 1. It is in the following move event that you will only get the information for the pointers that are currently down. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How many 1.1 devices are still out there?
Are there any developers who switched from 1.1 to 1.5 APIs recently? Have you heard any complaints from users that are still using a 1.1 device? 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: startForeground Backwards compatability
THANK YOU! The word I was missing in my searches was Relection or Reflect. I've added this method to my Service, but I'm still having a problem... private void turnOnForeground(Notification notif) { try { Method m = Service.class.getMethod(startForeground, new Class[] {int.class, Notification.class}); m.invoke(this, NOTIFY_ID, notif); } catch (Exception e) { setForeground(true); mNotificationManager.notify(NOTIFY_ID, notif); } //Debug message to show if turn on worked ActivityManager am = (ActivityManager) getBaseContext ().getSystemService(ACTIVITY_SERVICE); Toast.makeText(getBaseContext(), Foreground: + am.getRunningServices(1).get(0).foreground, Toast.LENGTH_SHORT).show (); } The problem is the Toast at the end is still reporting false (on 2.0, works fine on 1.6), i.e. that the service isn't running in the foreground state. The code runs through and I can see in the LogCat that no exception is thrown or caught. Also, I tried just using regular ol' startForeground, then showing that same Toast, and tested on the 2.0 emulator, and it still reported false. Does that method of retrieving the foreground status just not work in 2.0 anymore (it works on 1.6)? How can I be sure my service is running in the foreground on the 2.0 emulator? On Nov 15, 4:21 pm, TreKing treking...@gmail.com wrote: Yes, this is possible and definitely testable in the emulator. I actually just update my own app to account for this change in 2.0. I don't think you can get around the VerifyError but you can check if the method you want to use exists. Build against 2.0 and use reflection to check if the startForeground exists and use it if it does, otherwise default to setForeground. There was a blog post about using reflection for things like this though I don't have the link handy. Hope that helps. --- -- TreKing - Chicago transit tracking app for Android-powered deviceshttp://sites.google.com/site/rezmobileapps/treking On Sun, Nov 15, 2009 at 2:27 PM, G ghack...@gmail.com wrote: Hi, I've got a question as I don't have an Android 2.0 device to test on and this particular aspect seems untestable in the emulator. I've got a service that needs to be run as a foreground service. I have a notification that stops it etc, so I have no problem using startForeground instead of setForeground. However, I'd like to have 1 version of my app that works across all platforms... Is this possible? If my app is compiled with Android 1.5 and uses setForeground, then will that command actually work on an Android 2.0 device, or does it not matter which sdk was used to compile? I've tried compiling with 2.0, and surrounding the call to startForeground with a try/catch, but that throws a VerifyError when the service is started, when run on a 1.5/6 device since startForeground doesn't exist there. Can I catch and ignore the VerifyError somehow and make it work that way? Any help would be appreciated, I really don't want to have to make a 2nd branch of my app. Regards, Geoff -- 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.comandroid-developers%2Bunsubs cr...@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 many 1.1 devices are still out there?
tomei.ninge...@gmail.com wrote: Are there any developers who switched from 1.1 to 1.5 APIs recently? Have you heard any complaints from users that are still using a 1.1 device? Well, my apps should still work for 1.1. According to web server logs all but one (active) users had switched to 1.5 about a week after it was released. However, this may not apply to your situation as at the time, it was pretty hard to get Android phones at all over here (Sweden), so pretty much everyone was a hardcore developer. I just had a peek in the last months logs and as far as I can tell, there are less then 10 1.1 phones that have been active in that time out of over 5500 users. However, this is still an illusion: My apps are rather Sweden specific and by running all these IP addresses through a whois lookup I can tell that none of them originate from Sweden. Hence, I'm pretty convinced that these are simply traces from developers/testers that for some reason experiment with all apps they can find on 1.1 devices. Obviously, I've had NO complaint from 1.1 users at all and I'm pretty sure that for Sweden there is not such thing as a regular 1.1 user. In fact, the (very) few indications I've seen of my apps not working are likely from those trying out pre-2.0 builds. The using the Search key appears to work somewhat differently in the 2.0 emulator, but I've had no response from the Android masters as to whether this is intentional or a bug. I have a plan for working around it, but I've held off releasing something new until it is confirmed on a true 2.0 phone. Best / Jonas -- 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] Adjusting Dialog Size Question (ie: ColorPal)
I just took a look at my app with a Droid - it works/looks super ... except for my color dialog - which is tiny compared to my G1. I want to update the ColorPal code to accommodate different screen dimensions. One way to do this would be to access the DisplayMetrics from the dialog ie: DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); This does not seem to work from a dialog though - or I am missing something. Can someone point me in the right direction? j -- 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: startForeground Backwards compatability
I don't know about that last section, I haven't used the ActivityManager, but are you sure that the service your checking is actually YOUR service? I would double check to make sure the service you're getting back is yours. This might have worked pre-2.0 simply by luck. - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking On Sun, Nov 15, 2009 at 4:06 PM, G ghack...@gmail.com wrote: THANK YOU! The word I was missing in my searches was Relection or Reflect. I've added this method to my Service, but I'm still having a problem... private void turnOnForeground(Notification notif) { try { Method m = Service.class.getMethod(startForeground, new Class[] {int.class, Notification.class}); m.invoke(this, NOTIFY_ID, notif); } catch (Exception e) { setForeground(true); mNotificationManager.notify(NOTIFY_ID, notif); } //Debug message to show if turn on worked ActivityManager am = (ActivityManager) getBaseContext ().getSystemService(ACTIVITY_SERVICE); Toast.makeText(getBaseContext(), Foreground: + am.getRunningServices(1).get(0).foreground, Toast.LENGTH_SHORT).show (); } The problem is the Toast at the end is still reporting false (on 2.0, works fine on 1.6), i.e. that the service isn't running in the foreground state. The code runs through and I can see in the LogCat that no exception is thrown or caught. Also, I tried just using regular ol' startForeground, then showing that same Toast, and tested on the 2.0 emulator, and it still reported false. Does that method of retrieving the foreground status just not work in 2.0 anymore (it works on 1.6)? How can I be sure my service is running in the foreground on the 2.0 emulator? On Nov 15, 4:21 pm, TreKing treking...@gmail.com wrote: Yes, this is possible and definitely testable in the emulator. I actually just update my own app to account for this change in 2.0. I don't think you can get around the VerifyError but you can check if the method you want to use exists. Build against 2.0 and use reflection to check if the startForeground exists and use it if it does, otherwise default to setForeground. There was a blog post about using reflection for things like this though I don't have the link handy. Hope that helps. --- -- TreKing - Chicago transit tracking app for Android-powered deviceshttp:// sites.google.com/site/rezmobileapps/treking On Sun, Nov 15, 2009 at 2:27 PM, G ghack...@gmail.com wrote: Hi, I've got a question as I don't have an Android 2.0 device to test on and this particular aspect seems untestable in the emulator. I've got a service that needs to be run as a foreground service. I have a notification that stops it etc, so I have no problem using startForeground instead of setForeground. However, I'd like to have 1 version of my app that works across all platforms... Is this possible? If my app is compiled with Android 1.5 and uses setForeground, then will that command actually work on an Android 2.0 device, or does it not matter which sdk was used to compile? I've tried compiling with 2.0, and surrounding the call to startForeground with a try/catch, but that throws a VerifyError when the service is started, when run on a 1.5/6 device since startForeground doesn't exist there. Can I catch and ignore the VerifyError somehow and make it work that way? Any help would be appreciated, I really don't want to have to make a 2nd branch of my app. Regards, Geoff -- 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.comandroid-developers%2bunsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@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.comandroid-developers%2bunsubscr...@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
[android-developers] Re: Making SearchManager behave like the old googlenav.Search
so after a ton on investigation I am pretty sure that it was a business decision to restrict this. There are non google alternatives though. Clay On Nov 15, 12:52 pm, Clay claytan...@gmail.com wrote: So I have been looking into this for a couple of days, and I am pretty sure the intent of the android API team is to make SearchManager a platform level tool for searching application level content, like a application database, which is very cool, and I will probably use, but not what I want at this moment. I want to be able search a map just like the Google search apis for javascript: // We'll wait to the end to actually initialize the map // So let's build the search control searchControl = new google.search.SearchControl(); // Initialize a LocalSearch instance searcher = new google.search.LocalSearch(); // create the object //google.search.LocalSearch.ADDRESS_LOOKUP_ENABLED searcher.setCenterPoint(map); // bind the searcher to the map // Create a SearcherOptions object to ensure we can see all results var options = new google.search.SearcherOptions(); // create the object options.setExpandMode (google.search.SearchControl.EXPAND_MODE_OPEN); // Add the searcher to the SearchControl searchControl.addSearcher(searcher , options); // And second, we need is a search complete callback! searchControl.setSearchCompleteCallback(searcher , function() { map.clearOverlays(); var results = searcher.results; // Grab the results array // We loop through to get the points for (var i = 0; i results.length; i++) { var result = results[i]; // Get the specific result var markerLatLng = new google.maps.LatLng(parseFloat (result.lat), parseFloat (result.lng)); var marker = new google.maps.Marker(markerLatLng); // Create the marker // Bind information for the infoWindow aka the map marker popup marker.bindInfoWindow(result.html.cloneNode(true)); result.marker = marker; // bind the marker to the result map.addOverlay(marker); // add the marker to the map } This *was* in previous versions of the API (1.0?) I have seen very old code like: // W00t! Search for Pizza. // Create a MapPoint from the map's coordinates MapPoint mapPoint = new MapPoint(mMapView.getMapCenter ().getLatitudeE6(), mMapView.getMapCenter().getLongitudeE6()); // Create a dummy Map for use in Search Map map = new Map(getDispatcher(), null, 0, 0, 0, mapPoint, Zoom.getZoom(mMapView.getZoomLevel()), 0); // Search for Pizza near the specified coordinates Search search = new Search(Pizza, map, 0); // add the request the dispatcher getDispatcher().addDataRequest(search); // Wait for the search to complete, Should do this // in another thread ideally, this is just for illustration here. while (!search.isComplete()) { Log.i(LOG_TAG, .); } // Print the details. Log.i(LOG_TAG, Done - + search.numPlacemarks()); MapPoint point = null; for (int i = 0; i search.numPlacemarks(); i++) { Placemark placemark = search.getPlacemark(i); point = placemark.getLocation(); Log.i(LOG_TAG, - i : + Integer.toString(i)); Log.i(LOG_TAG, - Bubble : + placemark.getBubbleDescriptor()); Log.i(LOG_TAG, - Detail : + placemark.getDetailsDescriptor()); Log.i(LOG_TAG, - Title : + placemark.getTitle()); Log.i(LOG_TAG, - Location : + placemark.getLocation ().toString()); Log.i(LOG_TAG, - routable : + placemark.routableString()); } // Animate to the last location. if (point != null) { MapController mc = mMapView.getController(); Point point1 = new Point(point.getLatitude(), point.getLongitude()); mc.animateTo(point1); mc.zoomTo(12); Log.i(animateTo, point1.toString()); } I have been thinking it could be possible by geocoding an address using the location manager: //first find the location using geocoding Geocoder geocoder = new Geocoder(getApplicationContext(), Locale.getDefault()); try { ListAddress addrs = geocoder.getFromLocation(mMyLocationLat, mMyLocationLon, 1); } catch (IOException e) { Log.e(TAG, geocoding failed); } and then pre
[android-developers] Re: Code compiled with SDK 2.0 does not install (and therefore run) on 1.5 emulator
I do: uses-sdk android:minSdkVersion=1/uses-sdk :) so it should be more likely to work... The error is quite weird - I will try to do it again, maybe it was a fluke and the file just got currupted while being transferred, although I think I already did repeat the procedure... Since you claim it to work on your side - it is definitely worth making sure this is not a fluke of some sort. Regards, Max. On Nov 15, 4:38 pm, Lance Nanek lna...@gmail.com wrote: I just bumped up the build target on one of my apps to Android 2.0, exported a signed APK, and it installed and ran OK from the Browser app on the Android 1.5 emulator. So I guess the problem doesn't always occur. I wonder what we are doing different. What are you using for the uses-sdk element in your manifest? My test used: uses-sdk android:minSdkVersion=3 android:targetSdkVersion=4 / Although I think the wrong values there would result in a cannot be installed on this phone error rather than a parse error. On Nov 15, 12:55 pm, Max Binshtok max.binsh...@gmail.com wrote: I did signed export of the package while setting the target as 2.0. Then I tried to install the package by downloading it *through browser* (OTA download) on all the emulators. On 1.5, when I click on the download in order to install the package, I get the Parse Error: There is a problem parsing the package It works on 1.6 and 2.0 though. Compiling with 1.6 set as the target seems to install on all the emulators ok. Is it zipalign issue? Or if not - can someone clarify that to me? For now I don't use any 2.0 APIs, so I can just use 1.6 but in future - who knows and if this is going to be still a problem, how should be go about backward compatibility? Regards, Max. -- 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: startForeground Backwards compatability
Ha! Yeah I just took a closer look, no idea why I thought that would be looking at my service :/ On Nov 15, 6:39 pm, TreKing treking...@gmail.com wrote: I don't know about that last section, I haven't used the ActivityManager, but are you sure that the service your checking is actually YOUR service? I would double check to make sure the service you're getting back is yours. This might have worked pre-2.0 simply by luck. --- -- TreKing - Chicago transit tracking app for Android-powered deviceshttp://sites.google.com/site/rezmobileapps/treking On Sun, Nov 15, 2009 at 4:06 PM, G ghack...@gmail.com wrote: THANK YOU! The word I was missing in my searches was Relection or Reflect. I've added this method to my Service, but I'm still having a problem... private void turnOnForeground(Notification notif) { try { Method m = Service.class.getMethod(startForeground, new Class[] {int.class, Notification.class}); m.invoke(this, NOTIFY_ID, notif); } catch (Exception e) { setForeground(true); mNotificationManager.notify(NOTIFY_ID, notif); } //Debug message to show if turn on worked ActivityManager am = (ActivityManager) getBaseContext ().getSystemService(ACTIVITY_SERVICE); Toast.makeText(getBaseContext(), Foreground: + am.getRunningServices(1).get(0).foreground, Toast.LENGTH_SHORT).show (); } The problem is the Toast at the end is still reporting false (on 2.0, works fine on 1.6), i.e. that the service isn't running in the foreground state. The code runs through and I can see in the LogCat that no exception is thrown or caught. Also, I tried just using regular ol' startForeground, then showing that same Toast, and tested on the 2.0 emulator, and it still reported false. Does that method of retrieving the foreground status just not work in 2.0 anymore (it works on 1.6)? How can I be sure my service is running in the foreground on the 2.0 emulator? On Nov 15, 4:21 pm, TreKing treking...@gmail.com wrote: Yes, this is possible and definitely testable in the emulator. I actually just update my own app to account for this change in 2.0. I don't think you can get around the VerifyError but you can check if the method you want to use exists. Build against 2.0 and use reflection to check if the startForeground exists and use it if it does, otherwise default to setForeground. There was a blog post about using reflection for things like this though I don't have the link handy. Hope that helps. --- -- TreKing - Chicago transit tracking app for Android-powered deviceshttp:// sites.google.com/site/rezmobileapps/treking On Sun, Nov 15, 2009 at 2:27 PM, G ghack...@gmail.com wrote: Hi, I've got a question as I don't have an Android 2.0 device to test on and this particular aspect seems untestable in the emulator. I've got a service that needs to be run as a foreground service. I have a notification that stops it etc, so I have no problem using startForeground instead of setForeground. However, I'd like to have 1 version of my app that works across all platforms... Is this possible? If my app is compiled with Android 1.5 and uses setForeground, then will that command actually work on an Android 2.0 device, or does it not matter which sdk was used to compile? I've tried compiling with 2.0, and surrounding the call to startForeground with a try/catch, but that throws a VerifyError when the service is started, when run on a 1.5/6 device since startForeground doesn't exist there. Can I catch and ignore the VerifyError somehow and make it work that way? Any help would be appreciated, I really don't want to have to make a 2nd branch of my app. Regards, Geoff -- 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.comandroid-developers%2Bunsubs cr...@googlegroups.comandroid-developers%2Bunsubs cr...@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.comandroid-developers%2Bunsubs
[android-developers] ANDROID_ID returns null on my G1 ?
Hi, Following other threads - I'm trying to get a unique device ID from the device. I tried this: String ID = Settings.Secure.getString(context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); but this returns null when running on my G1. Is it supposed to be returning a valid number, or am I accessing it wrong? I don't want to use the telephony device ID because that requires more permissions. 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
Re: [android-developers] ANDROID_ID returns null on my G1 ?
Mark Wyszomierski wrote: Following other threads - I'm trying to get a unique device ID from the device. I tried this: String ID = Settings.Secure.getString(context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); but this returns null when running on my G1. Is it supposed to be returning a valid number, or am I accessing it wrong? I don't want to use the telephony device ID because that requires more permissions. No, that should not return null AFAIK, except on the emulator. Is your device rooted or anything? -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.2 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: ANDROID_ID returns null on my G1 ?
Hi Mark, What does rooted mean? Things that might be messing it up: 1) I don't have a SIM card in the device (just using wifi) 2) I am using getAppplicationContext() for the context parameter in that call Other than that - everything else is 'normal'.. I think? Thanks On Nov 15, 7:47 pm, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: Following other threads - I'm trying to get a unique device ID from the device. I tried this: String ID = Settings.Secure.getString(context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); but this returns null when running on my G1. Is it supposed to be returning a valid number, or am I accessing it wrong? I don't want to use the telephony device ID because that requires more permissions. No, that should not return null AFAIK, except on the emulator. Is your device rooted or anything? -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.2 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
Re: [android-developers] Re: ANDROID_ID returns null on my G1 ?
Mark Wyszomierski wrote: What does rooted mean? Having the ability to run as root, which is roughly the Linux equivalent to the Administrator account in Windows. http://android-dls.com/wiki/index.php?title=Why_Root Things that might be messing it up: 1) I don't have a SIM card in the device (just using wifi) 2) I am using getAppplicationContext() for the context parameter in that call Other than that - everything else is 'normal'.. I think? Try a different Context -- use an Activity, Service, or ContentProvider. getApplicationContext(), near as I can tell, is tantamount to useless as a Context. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.2 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] UTF encoding of SMS
Does Android encode SMS using UTF-7 or UTF-8? I'm developing an app that interfaces with an SMS processing backend that uses UTF-7. If Android uses UTF-8, is there a way to programmatically use UTF-7 instead? Thanks, Jamie -- 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: ANDROID_ID returns null on my G1 ?
Ok I just tried with my one and only activity, still returns null: class MyActivity extends Activity { private String mId; @Override public void onCreate(..) { mId = Settings.Secure.getString(this, ...); } } I just pop it up via a dialog box, tried looking at it in LogCat too (with phone hooked up), same. I'm stumped! On Nov 15, 7:52 pm, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: What does rooted mean? Having the ability to run as root, which is roughly the Linux equivalent to the Administrator account in Windows. http://android-dls.com/wiki/index.php?title=Why_Root Things that might be messing it up: 1) I don't have a SIM card in the device (just using wifi) 2) I am using getAppplicationContext() for the context parameter in that call Other than that - everything else is 'normal'.. I think? Try a different Context -- use an Activity, Service, or ContentProvider. getApplicationContext(), near as I can tell, is tantamount to useless as a Context. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.2 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: ANDROID_ID returns null on my G1 ?
Oh I'm running 1.5 too, but I think that should be fine. On Nov 15, 8:05 pm, Mark Wyszomierski mar...@gmail.com wrote: Ok I just tried with my one and only activity, still returns null: class MyActivity extends Activity { private String mId; �...@override public void onCreate(..) { mId = Settings.Secure.getString(this, ...); } } I just pop it up via a dialog box, tried looking at it in LogCat too (with phone hooked up), same. I'm stumped! On Nov 15, 7:52 pm, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: What does rooted mean? Having the ability to run as root, which is roughly the Linux equivalent to the Administrator account in Windows. http://android-dls.com/wiki/index.php?title=Why_Root Things that might be messing it up: 1) I don't have a SIM card in the device (just using wifi) 2) I am using getAppplicationContext() for the context parameter in that call Other than that - everything else is 'normal'.. I think? Try a different Context -- use an Activity, Service, or ContentProvider. getApplicationContext(), near as I can tell, is tantamount to useless as a Context. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.2 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
Re: [android-developers] Re: ANDROID_ID returns null on my G1 ?
Mark Wyszomierski wrote: Oh I'm running 1.5 too, but I think that should be fine. Grab this project: http://commonsware.com/misc/WeightDemo.zip or, here's an APK: http://commonsware.com/misc/WeightDemo-debug.apk Install and run it. Ignore the layout -- that's from some other scrap test I had run before. If you get a Toast with a gibberish alphanumeric value, that's from: Secure.getString(getContentResolver(), Secure.ANDROID_ID) in the activity. If you get null, or it blows up, then something may be messed up with your device. I have run this code on a G1 (1.6), Ion (1.5), and Hero (1.5), and they all 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: ANDROID_ID returns null on my G1 ?
Ok I installed the apk straight from the link - I see the two blue rects above (foo, bar), then the toast - but the toast is empty (guess cause it really is returning null on my device). This is really weird! Thanks for sending that sample project to verify! On Nov 15, 8:15 pm, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: Oh I'm running 1.5 too, but I think that should be fine. Grab this project: http://commonsware.com/misc/WeightDemo.zip or, here's an APK: http://commonsware.com/misc/WeightDemo-debug.apk Install and run it. Ignore the layout -- that's from some other scrap test I had run before. If you get a Toast with a gibberish alphanumeric value, that's from: Secure.getString(getContentResolver(), Secure.ANDROID_ID) in the activity. If you get null, or it blows up, then something may be messed up with your device. I have run this code on a G1 (1.6), Ion (1.5), and Hero (1.5), and they all 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
Re: [android-developers] Re: ANDROID_ID returns null on my G1 ?
Mark Wyszomierski wrote: Ok I installed the apk straight from the link - I see the two blue rects above (foo, bar), then the toast - but the toast is empty (guess cause it really is returning null on my device). This is really weird! Thanks for sending that sample project to verify! Yeah, methinks your G1 is messed up. ANDROID_ID is stored, AFAIK, in a system SQLite database. It is conceivable, though scary, that this database got whacked somewhere along the line. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android App Developer Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: installing Android 1.6+ on headless Linux server
It seems to be a bug in android command (sdkmanager) and sometimes it's ignoring command line arguments: + exec java -Xmx256M -Djava.ext.dirs=/opt/android-sdk/tools/lib/x86:/ opt/android-sdk/tools/lib -Dcom.android.sdkmanager.toolsdir=/opt/ android-sdk/tools -jar /opt/android-sdk/tools/lib/sdkmanager.jar update sdk No command line parameters provided, launching UI. See 'android --help' for operations from the command line. On Nov 15, 2:32 am, azad azadbol...@bolour.com wrote: Hi, I am not sure how to install Android 1.6+ on a headless Linux server. Our continuous integration build machine is a headless server in the cloud. Following the instructions, I downloaded android-sdk_r3-linux.tgz, untarred it, added its location to my path, and tried to update. This what I got: r...@savendipity:/usr/local/share/android-sdk-linux/tools# android update sdk No command line parameters provided, launching UI. See 'android --help' for operations from the command line. Exception in thread main java.lang.UnsatisfiedLinkError: no swt-pi- gtk-3550 or swt-pi-gtk in swt.library.path, java.library.path or the jar file + stack trace I don't know whether this message means that it is not possible to update the SDK without a GUI, that my command line is wrong, or that my environment is missing something that would allow me to install from the command line. Would appreciate instructions on how to install 1.6+ on a headless linux server. Thanks in advance for your help. Azad -- 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: Multitouch support in Android 2.0
This is the intended behavior. There are basically five actions you need to care about. For all of them, you can mask out ACTION_MASK to just look at the action part. These three are all you need to care about if you aren't interesting in multitouch: 1. ACTION_DOWN, the existing standard action for the first press. 2. ACTION_MOVE, any change in state that doesn't involve a finger going up or down. 3. ACTION_UP, the existing standard action for the last release. And if you want to keep track of addition fingers going down, you want these: 4. ACTION_POINTER_DOWN, when an addition pointer goes down. The pointer ID mask tells you the new identifier for this pointer. 5. ACTION_POINTER_UP, when a pointer goes up by there are still active pointers. The pointer ID mask tells you the identifier for this pointer. Note that it was deliberate to keep the actions for the first and last pointer different from the other pointers, both for backwards compatibility and the fact that the majority of code doesn't care about multitouch. Now that the 2.0 source is available, here are some example uses of the API: http://android.git.kernel.org/?p=platform/development.git;a=blob;f=apps/Development/src/com/android/development/PointerLocation.java;h=38b4af2dcd97625e6fef2c1bddcb9362a127352e;hb=eclair http://android.git.kernel.org/?p=platform/development.git;a=blob;f=apps/Development/src/com/android/development/PointerLocation.java;h=38b4af2dcd97625e6fef2c1bddcb9362a127352e;hb=eclair http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/inputmethodservice/KeyboardView.java;h=0f7ef22f93fbc0e928257738cb369189698ad2f8;hb=eclair http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/inputmethodservice/KeyboardView.java;h=0f7ef22f93fbc0e928257738cb369189698ad2f8;hb=eclair On Sun, Nov 15, 2009 at 1:41 PM, davemac davemac...@gmail.com wrote: I think I've got this figured out. Almost. With multi-touch support, getAction() can return a compound value representing the pointerID in the second byte and the action value in the first byte. For example, if two fingers are down, and pointerID 1 is lifted (i.e., finger 2), getAction() returns a value of 262 (0x100 or 256 to represent pointerID 1, and 6 to represent up for a compound value of 0x106 or 262). I'm curious why it was done this way instead of using 0 for down and 1 for up, even when pointers are involved. Things get a little weird because of the differences. Here's an example (note I'm using a Motorola Droid phone here so this may behave differently on other devices): Press finger 1 to the screen (action value of 0) finger 1 gets pointerID 0, no problem, pointerID is 0, down is 0 Press finger 2 to the screen (action value of 261) finger 2 gets pointerID 1, a little weird, could have been 256 instead? Lift finger 1 from the screen (action value of 6) finger 2 is still pointerID 1, action could still have been 1? Lift finger 2 from the screen (action value of 1) finger 2 is still pointerID 1, but the action value is not 262 or 257 it's 1 It would seem I can't use the bitmasks reliably in all cases. If I always inspect the action value for the pointerID and the action value, I get messed up at the end because pointerID has vanished. And 0 seems to be equivalent to 5, and 1 to 6. Is this something you'd consider a bug or is this how it's supposed to work? Should we expect it to continue to work this way? Thanks for your help. - dave On Oct 27, 4:28 pm, Dianne Hackborn hack...@android.com wrote: On Tue, Oct 27, 2009 at 2:02 PM, MrChaz mrchazmob...@googlemail.com wrote: Thanks for the info, Wouldn't this Finger 1 up: MotionEvent ACTION_POINTER_1_UP with one pointer, whose ID is 1. need to be ID of 0? Or am I mis-understanding the purpose of the UP action? Good point. Actually my example was not very good because at the places where there is an up transition, the last position of the pointer going up is included in the event stream -- so in all of these, you would receive both 0 and 1. It is in the following move event that you will only get the information for the pointers that are currently down. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at
[android-developers] Re: ANDROID_ID returns null on my G1 ?
Ah yeah something must have gotten messed up on my phone then. I saw some other posts where you were trying to find a unique ID per phone (without requiring system permissions). Did you find any? On iPhone there is a simple deviceUUID you can use. Is this ANDROID_ID its equivalent? It looks like there's an ID from the Telephony manager but then you add to add another (scary) permission for that? Thanks On Nov 15, 8:23 pm, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: Ok I installed the apk straight from the link - I see the two blue rects above (foo, bar), then the toast - but the toast is empty (guess cause it really is returning null on my device). This is really weird! Thanks for sending that sample project to verify! Yeah, methinks your G1 is messed up. ANDROID_ID is stored, AFAIK, in a system SQLite database. It is conceivable, though scary, that this database got whacked somewhere along the line. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android App Developer Books:http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: ANDROID_ID returns null on my G1 ?
Mark Wyszomierski wrote: On iPhone there is a simple deviceUUID you can use. Is this ANDROID_ID its equivalent? Pretty much. It looks like there's an ID from the Telephony manager but then you add to add another (scary) permission for that? You can get device IDs from Telephony, but the concern (beyond the permission) is what those IDs might be on non-phones. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in Germany, 18-22 January 2010: http://bignerdranch.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] get the package/class name by code
hi guys, how can I use sdk to get the package/class name of a specific apk file, eg: I have a test.apk, and I want to know the package name and class name by API when I write a android program 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: Multitouch support in Android 2.0
I wish though, that the multitouch would have also been natively suuportedk in the sense that multiple views should get touch events also simultaneously. Right now it looks like it will only work on a per-view basis. Would have been nice that if views were attatche to a touch handler, and someone touched both then they both get their touch events. Then would have automatically had some programs work then. Maybe there is a way to have it work that way? I'm not are, would be nice to know how. Right now it seems you have to be using t same event handler for all touchesany help on clarification? On Nov 15, 7:39 pm, Dianne Hackborn hack...@android.com wrote: This is the intended behavior. There are basically five actions you need to care about. For all of them, you can mask out ACTION_MASK to just look at the action part. These three are all you need to care about if you aren't interesting in multitouch: 1. ACTION_DOWN, the existing standard action for the first press. 2. ACTION_MOVE, any change in state that doesn't involve a finger going up or down. 3. ACTION_UP, the existing standard action for the last release. And if you want to keep track of addition fingers going down, you want these: 4. ACTION_POINTER_DOWN, when an addition pointer goes down. The pointer ID mask tells you the new identifier for this pointer. 5. ACTION_POINTER_UP, when a pointer goes up by there are still active pointers. The pointer ID mask tells you the identifier for this pointer. Note that it was deliberate to keep the actions for the first and last pointer different from the other pointers, both for backwards compatibility and the fact that the majority of code doesn't care about multitouch. Now that the 2.0 source is available, here are some example uses of the API: http://android.git.kernel.org/?p=platform/development.git;a=blob;f=ap... http://android.git.kernel.org/?p=platform/development.git;a=blob;f=ap...http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;... http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;... On Sun, Nov 15, 2009 at 1:41 PM, davemac davemac...@gmail.com wrote: I think I've got this figured out. Almost. With multi-touch support, getAction() can return a compound value representing the pointerID in the second byte and the action value in the first byte. For example, if two fingers are down, and pointerID 1 is lifted (i.e., finger 2), getAction() returns a value of 262 (0x100 or 256 to represent pointerID 1, and 6 to represent up for a compound value of 0x106 or 262). I'm curious why it was done this way instead of using 0 for down and 1 for up, even when pointers are involved. Things get a little weird because of the differences. Here's an example (note I'm using a Motorola Droid phone here so this may behave differently on other devices): Press finger 1 to the screen (action value of 0) finger 1 gets pointerID 0, no problem, pointerID is 0, down is 0 Press finger 2 to the screen (action value of 261) finger 2 gets pointerID 1, a little weird, could have been 256 instead? Lift finger 1 from the screen (action value of 6) finger 2 is still pointerID 1, action could still have been 1? Lift finger 2 from the screen (action value of 1) finger 2 is still pointerID 1, but the action value is not 262 or 257 it's 1 It would seem I can't use the bitmasks reliably in all cases. If I always inspect the action value for the pointerID and the action value, I get messed up at the end because pointerID has vanished. And 0 seems to be equivalent to 5, and 1 to 6. Is this something you'd consider a bug or is this how it's supposed to work? Should we expect it to continue to work this way? Thanks for your help. - dave On Oct 27, 4:28 pm, Dianne Hackborn hack...@android.com wrote: On Tue, Oct 27, 2009 at 2:02 PM, MrChaz mrchazmob...@googlemail.com wrote: Thanks for the info, Wouldn't this Finger 1 up: MotionEvent ACTION_POINTER_1_UP with one pointer, whose ID is 1. need to be ID of 0? Or am I mis-understanding the purpose of the UP action? Good point. Actually my example was not very good because at the places where there is an up transition, the last position of the pointer going up is included in the event stream -- so in all of these, you would receive both 0 and 1. It is in the following move event that you will only get the information for the pointers that are currently down. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group.
[android-developers] Re: get the package/class name by code
for detail:: there are several apk files in the /data/app (design by myself), and first I will read the /data/app and get the apk file list, then launch other apk file by user choose, so the problem is that I need to know the package name and class name by xxx.apk string. thanks On 11月16日, 上午10時26分, tstanly tsai.sta...@gmail.com wrote: hi guys, how can I use sdk to get the package/class name of a specific apk file, eg: I have a test.apk, and I want to know the package name and class name by API when I write a android program 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] Share thread pool among activities ?
Is it possible to create a thread pool during application's start up and share it among activities ? Not exactly sure if this is feasible and moreover is it even a good idea ? -- 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] Any examples of displaying an information box when clicked on a map marker ?
I am looking for code examples of how to draw a description box when clicking on a map marker. Something similar to google map's implementation - http://code.google.com/apis/maps/documentation/examples/icon-custom.html (Click on the marker to see an example) 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] Task or application equivalent of onPause
My application uses a remote service to play audio. I do this so that no activity owns the playback of the audio - the user can trigger some audio to be played from one Activity, and the audio will continue to play as they navigate around the app. I do, however, want to tell the service to pause or stop playing audio when the user unloads the app either by backing out or hitting Home. When the app was a single activity, I was doing this in onPause. So, I guess I'm essentially looking for onPause at the application/task level. Does such thing exist? If not, what is the best practice way of getting notified that the task has been put on hold by the user either backing all the way out or hitting Home? -- 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] AutoCompleteTextView doesn't work with android:style/Theme.Light
I can't seem to get AutoCompleteTextView to work with Theme.Light The problem is the autocomplete popup draws the suggestions text in white on a white background. You can only see what the suggestions are after they are selected, because then the white text is drawn over top of the selector background. It works fine with the default theme but not with Theme.Light. I am using android version 1.5 My code is pretty much identical to the the Hello AutoCompleteTextView sample, except with android:style/Theme.Light and a different String array for the suggestions. I tried setting the android:textColor attribute. That only set the color for the AutoCompeleteTextView input box, not for the suggestion's popup. Right now the only way to get my app to work properly is to use the default theme. Does anyone else have the same issue or know of a way to programically set the suggestion's popup text color or background? -- 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 create a project in android
hi all,, plz help me out... actually i'm using eclipse and creating an android project properly. bt in package explorer the folder is showing a red symbol. that means error is there,but as i haven't change anything. so as i feel it should not give any error. actually i'm a beginner,so plz help me out. With advance thanx. Dhir -- 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] Task life cycle and activity launch mode question(s)
I read up on tasks and the activity life cycle. Single top launch mode seems to give me (in theory) what I'd like to have for my app, but it's not currently working as expected. It sounds simple enough, so I can't imagine I'm doing this incorrectly. From my understanding, single top means that my activity can be navigated to in many ways, but per Task it will act as a singleton instance moving it to the top of the Task stack when launched. Therefore, if I do either of the following: declare the activity's launchMode to be singleTop in the manifest OR launch my activity by intent with the FLAG_ACTIVITY_SINGLE_TOP flag I will get this behavior. I have tried both methods by themselves and both together, and I don't get this behavior. I have a very simple app with two Activities. MainActivity is my landing page where a user can select an artist and launch the ArtistActivity with that artist's id. The user can navigate back to the landing page with a menu item as well as the back button. If the user goes back and forth by menu item clicks, a stack of activities seems to be built so that successively hitting the back button will take them step by step backwards through the actions they've taken. I was under the impression that by declaring both activities as android:launchMode=singleTop and/or launching them with the properly flagged intent (intent.addFlag (Intent.FLAG_ACTIVITY_SINGLE_TOP), that hitting the back key would only take them through an activity once before exiting (visually hiding) the app. Am I getting this wrong? And if so (or not), how do I get my app with only two activities to treat the activities as a stack where my landing page (MainActivity) is always on the bottom? Hitting Back from MainActivity always exits (unloads/pauses?) the app (task?), and hitting Back from ArtistActivity always returns to a singleton instance of 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] Can recognizer use a file for audio input?
Is there a way to use an audio file as input to speech recognition? If not, is this feature expected in the foreseeable future? A separate question (and this is going to sound ridiculous, but it might actually be okay for a joke app I'm thinking about): Would it be possible to play audio out of an Android handset, while at the same time having a recognizer listen to it via the microphone? (Guess I could just try 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: Layout problems
Try RelativeLayout instead of LinearLayout. There are a lot of attributes you can use within a RelativeLayout that help you position the elements according to their siblings. http://developer.android.com/reference/android/widget/RelativeLayout.html http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html On Nov 13, 12:32 pm, jdekeij jasper.dekeij...@gmail.com wrote: Hoi, I try to get a button below my gameboard, however the gameboard overrides the button. When placed above the gameboard every thing is alright. The gameboard is named ¨reversi.com.BoardView¨ ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/reversimessage android:layout_width=fill_parent android:layout_height=wrap_content android:layout_marginTop=10dip android:text=Success with the match / Button android:id=@+id/takeback android:layout_width=wrap_content android:layout_height=wrap_content android:text=Takeback/ reversi.com.BoardView android:id=@+id/reversi android:layout_width=wrap_content android:layout_height=wrap_content/ /LinearLayout Help is very much appreciated Jasper de Keijzer -- 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: Segfault in what looks like WebView
Another data point from my syslog: Nov 13 13:17:11 desktop kernel: [108038.551130] emulator[7952]: segfault at 8c ip 0819176a sp bfa43320 error 4 in emulator [8048000+1fe000] Nov 13 13:17:11 desktop console-kit-daemon[1010]: GLib-GObject- WARNING: instance of invalid non-instantiatable type `(null)' Nov 13 13:17:11 desktop console-kit-daemon[1010]: GLib-GObject- CRITICAL: g_signal_emit_valist: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed Nov 13 13:17:11 desktop console-kit-daemon[1010]: GLib-GObject- CRITICAL: g_object_unref: assertion `G_IS_OBJECT (object)' failed Nov 13 13:17:11 desktop pulseaudio[14918]: pid.c: Stale PID file, overwriting. Nov 13 13:17:11 desktop pulseaudio[14918]: main.c: Unable to contact D- Bus: org.freedesktop.DBus.Error.NoServer: Failed to connect to socket / tmp/dbus-HegrcYjYyi: Connection refused Nov 13 13:17:12 desktop bonobo-activation-server (dge-14913): could not associate with desktop session: Failed to connect to socket /tmp/ dbus-HegrcYjYyi: Connection refused and my GNOME died. I wasn't actively using the emulator at the time, but my app using webkit was likely up. This happen a few days ago also. May be related to recently upgrading to Ubuntu 9.10. This is the emulator in the 2.0 sdk. -- 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: Webservice on Android
I also have the same issue described by Mark. I can call my web service using KSOAP2 when using my WiFi network, but when I try to use it through my phone's internet plan, it times out. I've been trying to find a solution for days. I've tried simple HttpGet and still get timeouts... I'm suspecting it could be proxy or APN, but I still have no luck.. BTW, I can reach the WS ftest page and use it from the browser with no problem I'd appreciate anyone's help on this On Nov 7, 8:10 am, rubeN_vl rvanluch...@hotmail.com wrote: I'm aware of that On 7 nov, 15:07, Mark Murphy mmur...@commonsware.com wrote: rubeN_vl wrote: i want to run awebserviceon aAndroidphone. Why? It's not going to be reachable, except on a local WiFi network, and even then only if somebody knows the IP address of the phone. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.0 In Print! -- 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] Securing a paid app
jax wrote: I am wondering how I might go about securing a paid app on Android. I am thinking of selling the application from my own website via PayPal, however, how will I stop people from sharing it with their friends etc. Does Android have any type of native support for this? An alternative might be http://www.kagi.com/KRM/index.php?page=krmjava I'm not affiliated with them nor have I used their services (yet), been using esellerate.net for Mac/Win apps so far. Michael -- 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 do you change the default language
Hi I came across your thread while researching on the same issue. Did you find out how to do it? Thanks. On Oct 31, 4:00 am, Nick nickw...@gmail.com wrote: How tochangethe defaultlanguagefrom english to chinese for HTC Hero. Is there any other ways except reinstall a new ROM -- 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] onNewIntent() is never called when use Icons
Hi, What I'm trying to do was supposed to be very simple, but is not working. :) I would like to have 2 Icons that will call my activity, that is the only one in the package. But, when the activity is called, I would like to know which of these Icons was used. In the logs, I'm able to see that the Intent sent asap after press the icon is sending this message like: I( 569:0x23d) Starting activity: Intent { action=android.intent.action.MAIN categories= {android.intent.category.LAUNCHER} flags=0x1020 comp={teste.teste/ teste.teste.alias1} } But, my override of onNewIntent is never called and the onResume is receiving a modified version of the Intent: D( 896:0x380) Intent is Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} flags=0x1020 comp= {teste.teste/teste.teste.mainapp} } As you can see, the alias1 packagename was modified to mainapp. And because of this, I'm unable to check which button was applied. My code in the manifest file is simple: application android:icon=@drawable/icon android:label=@string/ app_name android:debuggable=true activity android:name=.mainapp android:label=@string/ app_name android:configChanges=orientation android:launchMode=singleTop intent-filter action android:name=android.intent.action.MAIN / /intent-filter /activity activity-alias android:name=alias1 android:label=alias1 android:icon=@drawable/icon android:targetActivity=.mainapp android:launchMode=singleTop intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity-alias activity-alias android:name=alias2 android:label=alias2 android:icon=@drawable/icon android:targetActivity=.mainapp android:launchMode=singleTop intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity-alias receiver android:name=.BootMainapp intent-filter action android:name=android.intent.action.BOOT_COMPLETED / category android:name=android.intent.category.HOME / /intent-filter /receiver /application As you can see, I'm using the singleTop definition, as a requirement for onNewIntent call. Any ideas what could be wrong here? Or, How can I have a way to check which Icon was used to call my Acitivity? Thank you, Joao Sauer -- 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] Rotate TextView 90 degrees text out of view.
When I try to rotate a TextView (width 300, height 240) by extending the class TextView and overriding the onDraw method by the following code: @Override protected void onDraw(Canvas canvas) { canvas.save(); canvas.rotate(90); super.onDraw(canvas); canvas.restore(); } Then the text in the text view is not visible. If I rotate it 45 degrees then the text is in the view again. It seem to me that it rotates on the top left corner so the text is rotated out of the view and is now just left of the view. So I used the rotate method with the px and py parameters like: canvas.rotate(90, 150, 150); Now the text is on the top right corner of my view, just like I want it. But, the width of the vertical text is 300 and the height 240, so again a part of the text is out of the view witch is 300x240. The view is part of a relative layout, see activity code below: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final RelativeLayout rl = new RelativeLayout(this); RelativeLayout.LayoutParams lprms = new RelativeLayout.LayoutParams( LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT); lprms.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); lprms.rightMargin =10; lprms.leftMargin = 10; lprms.topMargin = 10; final CustomTextView tx = new CustomTextView(this,90,150,150); tx.setLayoutParams(lprms); tx.setText(Test Text Test Text Test Text Test Text Test Text Test Text); tx.setWidth(300); tx.setHeight(240); tx.setBackgroundColor(Color.RED); tx.setSingleLine(false); tx.setTextSize(12); rl.addView(tx ,0); setContentView(rl); } I hope there is a solution or work arround for this, cause I realy need vertical text objects. 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
[android-developers] Re: Dallas Android Developers
I'm in. On Nov 13, 3:27 pm, chrispix chris...@gmail.com wrote: Good work! Look forward to meeting everyone. On Nov 13, 2:51 pm, PJ pjbar...@gmail.com wrote: Place: Cafe Brazil (since Richardson is central to us) Time: Tentative plan is 11:30am tomorrow morning, and likely won't change, but I will announce final decision at 10pm tonight. Please read on below. I've added a sheet to our spreadsheet called Availability and suggested some times on Saturday and Sunday. Everyone please go there and say Yes or No for each timeslot. http://spreadsheets.google.com/ccc?key=0Al_CwVe6tLzZdExtMFUtem9wdG1sa... Tonight I'll look at everyone's availability and announce the official time (e.g. the one with the most Yes's). -- PJ On Nov 12, 1:10 am, PJ pjbar...@gmail.com wrote: If anyone is interested in joining the DallasDroid Devs, just reply to this thread and let us know that you're interested. An existing member can then invite you to be a collaborator of our spreadsheet, so that you can see who we are, see what all is going on, and tell us about yourself. -- PJ On Nov 12, 12:39 am, PJ pjbar...@gmail.com wrote: I vote for the 14th! (I'm out of town on the 21st.) I was about to ask everyone where they lived and a bunch of other info, then I realized it would be easier if we just had a shared spreadsheet. So guys, I've created a Google Docs spreadsheet that we can all edit!http://spreadsheets.google.com/ccc?key=tLm0U-zoptmlhEk_B_DteaAhl=en It's not too fancy, but please note that it does have multiple sheets/ tabs at the bottom: Members: Go here and enter your profile info so that we can see where you live, what your skills/interests are, etc. Meetings: List of meetings. For now I went ahead and put the 14th down for our first meeting! Notes: Put random notes/discussions/crap about the group here. I'll give everyone (in this discussion) permissions to edit the spreadsheet. If you have trouble viewing or editing it, let me know and I'll try to fix it. -- PJ On Nov 11, 4:44 pm, Aniruddh Bajirao abaji...@gmail.com wrote: 14th or 21st both are good for me. How about the others? On Wed, Nov 11, 2009 at 1:24 PM, Chris Dempsey cdal...@gmail.com wrote: How about the 14th or 21st? I'm in the Plano area but I own a car so traveling isn't a problem. :) On Wed, Nov 11, 2009 at 10:49 AM, Aniruddh Bajirao abaji...@gmail.comwrote: As PJ suggested 'DallasDroid Devs'... Lets plan an informal meet and get started... Any suggestions on when n where we can have a meet... On Wed, Nov 11, 2009 at 7:03 AM, Chris Dempsey cdal...@gmail.com wrote: I am interested in aDallasDroid developer group. I think PJ has the right idea. Start informal and see where it goes. On Wed, Nov 11, 2009 at 1:22 AM, PJ pjbar...@gmail.com wrote: DallasDroid Devs. It's catchy. Quick, someone reserve the domain! I think the biggest barrier to forming a localAndroidDev group is the fact thatdeveloperscan hang out in the IRC channel (and this Google group) and find lots of discussion there, from the comfort (and whim/speed) of their own homes. So, some people might not feel the extra effort is worth it. So an important step to creating a successfulDallasAndroidDev group is to brainstorm and come up with a convincing list of incentives to create/join a local group. Developerswill ask, What can theDallas group offer me that the worldwide community can't? The answer is stuff like: * Job placement: WhenDallasdevs get together, they can share info about local opportunities * Discuss local interests (like... uh...DallasCowboys? Whataburger? hahaha...) * Get out of the house and meet in person * etc. I'm personally not gifted at organizing social events, but I'd strongly consider joining/supporting. On Nov 10, 9:54 pm, Aniruddh Bajirao abaji...@gmail.com wrote: Anyone interested in having aDallasAndroidGroup? On Fri, Nov 6, 2009 at 9:42 PM, Aniruddh Bajirao abaji...@gmail.com wrote: If we have enough people interested lets create aDallasAndroid Dev-group. We can have planned meets. Will definitely be interesting and useful to share knowledge and experience as well as to get answers to questions. Above all it would be very interesting to meet and network with other Android Enthusiasts. On Fri, Nov 6, 2009 at 8:51 PM, cpick cp...@vmenu.com wrote: You might check the Texas Startup Blog. Alex Muse has a happy hour down at the info mart first monday of the month. Usually some
[android-developers] android 1.6 emulator not shown in ddms
recently I try to run my program on android 1.6 emulator. when I launch the emulator I can see it in my ddms with offline state,however, after a while it disappears from ddms. Any ideas? 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: Eclair install choked with errors about locks and died horribly leaving corrupted install
Skink and Armond, Thank you for the direct links! Downloading using the SDK and AVD Manager, my download rate kept falling from 20 to 0 KiB/sec, and then stalling. You may also find that you want http://dl-ssl.google.com/android/repository/usb_driver_r02-windows.zip as well. -- 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: Enabling SVG in Android's Webkit
Hello Jeff, I was able to make this work but I had to port the SVG generated sources makefiles to the Android makefile system. Also, on Ubuntu I ran into an Argument list too long error when linking. I had to remove a significant number of SVG DOM JS files in order to get past this. All the best, Andrew On Oct 15, 1:31 pm, Jeff Schiller codedr...@gmail.com wrote: Can anyone point me to instructions on how to enableSVGsupport when building Webkit forAndroid? I saw an earlier thread from back in March aboutSVGbeing slow for the UI of apps, but I'd like to experiment with web content containingSVG, DOM manipulations, etc to see what the speed is like. Is it just a matter of turning on the compile flags forSVGsupport in Webkit or would there be a significant porting task? Thanks,JeffSchiller -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] List
What's the easiest way to stop and start emails from this list without needing to unsubscribe and subscribe again? Options on my mail client or on the server side? 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: Ubuntu Karmic Koala (9.10)
Thanks for this, I just installed 9.10 this week and this post saved me a lot of time troubleshooting. In fact, Chrome's pop-ups were coming up blank and now the same fix works for Chrome as well. On Nov 2, 3:37 pm, StevePotell stevepot...@gmail.com wrote: You may have run into a few problems with this upgrade. Here is how you get eclipse running again http://mou.me.uk/2009/10/31/fixing-eclipse-in-ubuntu-9-10-karmic-koala/ to run the new Android SDK and AVD Manager from the command line use this command first: export GDK_NATIVE_WINDOWS=true then android I am hoping for a better fix in the near future -- 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: Securing a paid app
Using the unique ID (hash) of the phone, register it with your web service on install. Then employ PKI to authenticate your app on each launch. On your web service sign a string containing the hash, timestamp, and a short expiration timestamp. Then have your app use your public key (in the app) to authenticate the string, verify the timestamps, and complete the launch if valid, otherwise abort the launch or offer the user to come clean and install. To prevent code modification--bypassing the check--don't include all of the code in the app. Keep some of it on the server and only send it to the app if the check takes place and passes the check. This way the app will not function correctly unless the check is performed and passes. Create a set of one-off methods (dummys that just pass through) that you can dynamically use with each app instance; since you are in control of the download (unlike Market publishers), you can dynamically build and package a unique app for each instance downloaded. This way no two apps use the same method and a hacker is up a creek as far a patching the code and replicating it to the community. When one instance is cracked, and it will be, then your server can cancel that hacked instance without effecting all of the other valid users. This will create a string disincentive, because no two app are the same, codewise ;-) Maybe we should start a service and offer Android publishers a secure distribution service, unlike the Market. There is no way to register (stamp an app with a phone id) downloads from the Market prior to installation. As it stands now publishers have no way to verify if their app was downloaded from the Market or copied and installed by other means. If there is I would like to know. I've asked but I never get replies regarding this advanced topic. Most publishers are still learning to just create apps, let alone seek out secure distribution and customer behavior--only Google enjoys this privilege, currently. Here's a method snippet for getting the unique ID and hashing it: String getPhoneID(){ MessageDigest digest; try { digest = MessageDigest.getInstance(SHA-1); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(this should never happen); } String srvcName = Context.TELEPHONY_SERVICE; TelephonyManager telephonyManager = (TelephonyManager)getSystemService(srvcName); /* requires READ_PHONE_STATE permission */ String deviceId = telephonyManager.getDeviceId(); if (TextUtils.isEmpty(deviceId)) { return ; } byte[] hashedDeviceId = digest.digest(deviceId.getBytes()); String id = new String(Base64.encodeBase64(hashedDeviceId), 0, 12); id = id.replaceAll(/, _); return id; } On Nov 14, 7:12 am, jax jackma...@gmail.com wrote: I am wondering how I might go about securing a paid app on Android. I am thinking of selling the application from my own website via PayPal, however, how will I stop people from sharing it with their friends etc. Does Android have any type of native support for this? -- 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: Securing a paid app
What you can do is make your user enter serial #, the serial number could be a hashing function that you come up with that takes the device id (could be the imei number) the application could then check if the serial/hash code matches for that device. This would require your customer to send you his/her imei # or another unique # associated with the device so that you can generate the serial code for that device. You can also implement a two step method so that the customer can't accidently enter in their imei incorrectly by misstake. To do it this way you would generate a Request For Serial Number Code store this code in your database. The costomer enters this code in their phone, your phone connects to your web server sends the Request for Serial number code and the IMEI number of the phone with it. Your server generates the hash/ serial and sends it back to the phone. You can then mark the Request for serial number code as used so that they can not use it for another device. This is the method I use for my applications. On Nov 14, 8:39 am, jax jackma...@gmail.com wrote: Yes, that is why I have posted the question because I don't know how to do it. Has anyone done this before or know of a method for achieving this? On Nov 14, 10:23 pm, Andrei gml...@gmail.com wrote: What u want to do is to tie your app to one device How u do it up to u On Nov 14, 7:12 am, jax jackma...@gmail.com wrote: I am wondering how I might go about securing a paid app on Android. I am thinking of selling the application from my own website via PayPal, however, how will I stop people from sharing it with their friends etc. Does Android have any type of native support for this?- 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] Need help with XML parsing (SAX)
Hi, I have a big problem with the XML parsing (SAX) in Android. I can't use it at the following XML file: ?xml version='1.0' encoding='UTF-8'? osm version='0.6' generator='JOSM' node id='-1' visible='true' lat='-1.377' lon='-1.3635' / node id='-2' visible='true' lat='-2.493' lon='-0.8684' / node id='-3' visible='true' lat='-2.889' lon='-0.2925' / node id='-4' visible='true' lat='-2.1731531008265907' lon='-1.0103675762462703' / node id='-5' visible='true' lat='-1.17173167547311' lon='-0.39861659247471204' / node id='-6' visible='true' lat='-0.6922364241169185' lon='-0.10570125802657904' / node id='-7' visible='true' lat='3.033' lon='-3.4425' / node id='-8' visible='true' lat='1.809' lon='-3.77549996' / node id='-9' visible='true' lat='1.341' lon='-4.0275' / node id='-10' visible='true' lat='1.143' lon='-4.06349994' / node id='-11' visible='true' lat='1.008' lon='-4.0095' / node id='-12' visible='true' lat='0.9179' lon='-3.9465' / node id='-13' visible='true' lat='2.3983853072967456' lon='-3.6151525266913263' / node id='-14' visible='true' lat='1.1499578470195202' lon='-2.6031083483750397' / node id='-15' visible='true' lat='-1.5140421529804802' lon='1.338891651624961' / node id='-16' action='modify' visible='true' lat='-2.7920421529804806' lon='3.660891651624961' / node id='-17' action='modify' visible='true' lat='-0.8300421529804803' lon='4.6688916516249614' / node id='-18' visible='true' lat='1.3479578470195202' lon='0.2993916516249608' / node id='-19' visible='true' lat='1.0257578470195203' lon='0.9437916516249611' / way id='-20' action='modify' visible='true' nd ref='-7' / nd ref='-13' / nd ref='-8' / nd ref='-9' / nd ref='-10' / nd ref='-11' / nd ref='-12' / nd ref='-1' / nd ref='-4' / nd ref='-2' / nd ref='-3' / tag k='ref' v='43' / tag k='highway' v='primary' / tag k='name' v='Szőregi út' / /way way id='-21' action='modify' visible='true' nd ref='-13' / nd ref='-18' / nd ref='-19' / nd ref='-17' / tag k='ref' v='Fő fasor' / tag k='highway' v='unclassified' / tag k='name' v='Fő fasor' / /way way id='-22' action='modify' visible='true' nd ref='-4' / nd ref='-5' / nd ref='-6' / nd ref='-19' / tag k='highway' v='unclassified' / tag k='name' v='Thököly utca' / /way way id='-23' action='modify' visible='true' nd ref='-5' / nd ref='-14' / nd ref='-8' / tag k='highway' v='unclassified' / tag k='name' v='Derkovits fasor' / /way way id='-24' action='modify' visible='true' nd ref='-6' / nd ref='-15' / tag k='highway' v='unclassified' / tag k='name' v='Hársfa utca' / /way way id='-25' action='modify' visible='true' nd ref='-15' / nd ref='-16' / tag k='highway' v='unclassified' / tag k='name' v='Katalin utca' / /way way id='-26' action='modify' visible='true' nd ref='-16' / nd ref='-17' / tag k='highway' v='unclassified' / tag k='name' v='�gnes utca' / /way /osm I would be grateful if you could help me. I need this numbers to my map application. Could you write me source-code in Android? THX, Gab -- 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] Task or application equivalent of onPause
My application uses a remote service to play audio. I do this so that no activity owns the playback of the audio - the user can trigger some audio to be played from one Activity, and the audio will continue to play as they navigate around the app. I do, however, want to tell the service to pause or stop playing audio when the user unloads the app either by backing out or hitting Home. When the app was a single activity, I was doing this in onPause. So, I guess I'm essentially looking for onPause at the application/task level. Does such thing exist? If not, what is the best practice way of getting notified that the task has been put on hold by the user either backing all the way out or hitting Home? -- 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: Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml
Thanks Peter! this GDK_NATIVE_WINDOWS=true solved the issue for me (Ubuntu 9.10 32 bits) On 7 nov, 21:14, Peter Ersts peter.er...@gmail.com wrote: Try: export GDK_NATIVE_WINDOWS=true before you launching the manager. I came across a similar problems with Eclipse since upgrading to Ubuntu 9.10 on my 64-bit machine, this seems to fix most of the problems. On Nov 6, 1:37 pm, Romain Guy romain...@google.com wrote: It's a known issue with SWT and GTK. On Tue, Nov 3, 2009 at 3:19 AM, rcasha rca...@gmail.com wrote: Ok this is weird... it seems that the Android SDK and AVD Manager application recognises the Space bar, BUT NOT THE MOUSE, for certain checkboxes, buttons etc. So... you can enable the http option, and so on, by tabbing to the control and pressing space. On Oct 27, 11:58 pm, garycode garyma...@hotmail.com wrote: Hi, I'm trying to install a platform but when I type android the manager loads then I click Available Software then select thehttps://dl-ssl.google.com/android/repository/repository.xmlrepository I get this error., Failed to fetch URLhttps://dl-ssl.google.com/android/repository/repository.xml, reason: HTTPS SSL error. You might want to force download through HTTP in the settings. So I click the settings tab and select the force through http then click apply and save then nothing happens it doesn't save it because if i then close it and reload it the checkbox is unticked so it's not even using the force through http method. I get the same error if i go straight back to available software. I'm using Fedora and wget can download the xml file using ssl so I don't know why it's getting this https ssl error. Any ideas anyone? 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 -- 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