"10256","1","10259","","2008-08-13 19:15:07","61","25868","<p>I am interested in trying some Android Development and I've not had much luck getting started. I'm not much of a Linux person but I have an Ubuntu box setup that I attempted to install the Android SDK and plugins for Eclipse. But I'm not having much luck getting it setup. </p><p>I'm looking for some guidance for what would be the best way for me to do this. </p><ul><li>Should I use a different Linux distro?  </li><li>Is Eclipse the wrong way to go?  </li><li>I was hoping this was a way for me to get some Linux exposure too,so I don't even know if there is a way to accomplish this in Windows,but I'm sure someone else would be interested to know that info.</li></ul><p>I have looked at the instructions at Google, but everything I read assumes a prior knowledge of Linux, Eclipse or both. There also doesn't seem to be much troubleshooting help.</p>","288","Haydar","814702","","2013-06-29 21:35:50","2014-03-19 12:58:50","How should I get started with Android Development?","<android><linux><eclipse>","12","3","45","2013-06-19 12:54:50",""
"26362","1","46766","","2008-08-25 16:39:42","11","14606","<p>Has anyone managed to use <code>ItemizedOverlays</code> in Android Beta 0.9? I can't get it to work, but I'm not sure if I've done something wrong or if this functionality isn't yet available. </p><p>I've been trying to use the <code>ItemizedOverlay</code> and <code>OverlayItem</code> classes. Their intended purpose is to simulate map markers (as seen in Google Maps Mashups) but I've had problems getting them to appear on the map.</p><p>I can add my own custom overlays using a similar technique, it's just the <code>ItemizedOverlays</code> that don't work.</p><p>Once I've implemented my own <code>ItemizedOverlay</code> (and overridden createItem), creating a new instance of my class seems to work (I can extract OverlayItems from it) but adding it to a map's Overlay list doesn't make it appear as it should.</p><p>This is the code I use to add the <code>ItemizedOverlay</code> class as an Overlay on to my <code>MapView</code>.</p><pre><code>// Add the ItemizedOverlay to the Mapprivate void addItemizedOverlay() {  Resources r = getResources();  MapView mapView = (MapView)findViewById(R.id.mymapview);  List&lt;Overlay&gt; overlays = mapView.getOverlays();  MyItemizedOverlay markers = new MyItemizedOverlay(r.getDrawable(R.drawable.icon));  overlays.add(markers);  OverlayItem oi = markers.getItem(0);  markers.setFocus(oi);  mapView.postInvalidate();}</code></pre><p>Where <code>MyItemizedOverlay</code> is defined as:</p><pre><code>public class MyItemizedOverlay extends ItemizedOverlay&lt;OverlayItem&gt; {  public MyItemizedOverlay(Drawable defaultMarker) {    super(defaultMarker);    populate();  }  @Override  protected OverlayItem createItem(int index) {    Double lat = (index+37.422006)*1E6;    Double lng = -122.084095*1E6;    GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue());    OverlayItem oi = new OverlayItem(point, ""Marker"", ""Marker Text"");    return oi;  }  @Override  public int size() {    return 5;  } }</code></pre>","822","Reto Meier","421372","","2013-11-20 07:37:01","2013-11-20 07:37:01","Using ItemizedOverlay and OverlayItem In Android Beta 0.9","<android><overlay><android-mapview>","1","0","1","",""
"28380","1","3869611","","2008-08-26 15:30:38","28","59179","<p>Has anybody managed to get the Android Emulator working behind a proxy which requires authentication?</p><p>I've tried setting the -http-proxy argument to </p><pre><code>http://DOMAIN/USERNAME:PASSWORD@IP:PORT</code></pre><p>but am having no success. </p><p>I've tried following the docs to no avail. I've also tried the <code>-verbose-proxy</code> setting but this no longer seems to exist.</p><p>Any pointers?</p>","1281","Rich Lawrence","750613","","2012-06-30 11:22:22","2014-03-19 13:00:49","Proxy which requires authentication with Android Emulator","<android><authentication><proxy>","14","2","7","",""
"30953","1","279067","","2008-08-27 19:19:52","37","47285","<p>I am interested in writing applications for the iPhone and the Android platform. I was hoping to find a middleware / framework that abstracted away some of the differences in the APIs and allow me to specify the target platform at build time. Is there such a framework existing or planned?</p>","3022","Thomas","-1","","2008-09-10 14:13:49","2013-08-21 16:26:51","Is there a multiplatform framework for developing iPhone / Android applications?","<iphone><android><frameworks><middleware>","18","0","32","2013-01-10 16:38:00",""
"36881","1","68078","","2008-08-31 14:36:11","18","35688","<p>I have an activity which has a TabHost containing a set of TabSpecs each with a listview containing the items to be displayed by the tab. When each TabSpec is created, I set an icon to be displayed in the tab header.</p><p>The TabSpecs are created in this way within a <code>setupTabs()</code> method which loops to create the appropriate number of tabs:</p><pre><code>TabSpec ts = mTabs.newTabSpec(""tab"");ts.setIndicator(""TabTitle"", iconResource);ts.setContent(new TabHost.TabContentFactory({    public View createTabContent(String tag)    {        ...     }            });mTabs.addTab(ts);</code></pre><p>There are a couple instances where I want to be able to change the icon which is displayed in each tab during the execution of my program. Currently I am deleting all the tabs, and calling the above code again to re-create them.</p><pre><code>mTabs.getTabWidget().removeAllViews();mTabs.clearAllTabs(true);setupTabs();</code></pre><p>Is there a way to replace the icon that is being displayed without deleting and re-creating all of the tabs?</p>","1197","lnediger","597657","","2013-02-28 00:13:49","2013-02-28 00:13:49","Updating Android Tab Icons","<java><android><android-tabhost>","6","0","11","",""
"51988","1","3448945","","2008-09-09 14:18:23","74","15909","<p>Have any well-documented or open source projects targeted <code>iPhone</code>, <code>Blackberry</code>, and <code>Android</code> ? Are there other platforms which are better-suited to such an endeavor ? Note that I am particularly asking about client-side software, not web apps, though any information about the difficulties of using web apps across multiple mobile platforms is also interesting.</p>","654","Nicholas","474193","","2012-08-03 12:03:24","2013-10-04 04:21:29","What work has been done on cross-platform mobile development?","<iphone><android><blackberry><mobile><webos>","18","0","33","2012-06-14 16:46:02","2011-04-12 18:45:10"
"64745","1","","","2008-09-15 17:04:46","22","20800","<p>Coming from <code>J2ME</code> programming are there any similarities that would make it easy to adapt to <code>Android API</code>. Or is <code>Android API</code> completely different from the <code>J2ME</code> way of programming mobile apps. </p>","","maximumcode","474193","","2012-08-03 12:20:12","2014-01-20 17:29:59","Moving to Android from J2ME","<android><java-me><mobile>","4","1","11","",""
"101754","1","8189603","","2008-09-19 13:21:12","811","219334","<p>I like the Android platform. Actually, with some friends, we even participate to the ADC with the Spoxt project.</p><p>But Java is not my favourite language at all. We are working on a S60 version and this platform has a nice Python API. Of course there is nothing official about Python on Android, but since Jython exists, does anybody know a way to let the snake and the robot work together ?</p>","9951","e-satis","11596","","2009-06-10 05:24:54","2014-02-13 10:30:11","Is there any way to run Python on Android?","<python><android><ase><android-scripting>","17","9","301","",""
"103366","1","","","2008-09-19 16:16:49","11","4223","<p>I've been playing around with <code>OpenGL ES</code> development on Android. <code>OpenGL ES</code> applications seem to run slowly in the Emulator on my development machine. Does this reflect likely performance of actual hardware? I'm concerned about spending too much time developing an application if the graphics performance is going to be sluggish.</p>","","ANdrew Gibson","1961262","sgm","2013-01-18 10:00:59","2013-01-18 10:00:59","How well does the Android Phone Emulator reflect the performance?","<android><opengl-es><android-emulator>","1","1","","",""
"121762","1","121853","","2008-09-23 15:32:20","14","8999","<p>I have two threads in an Android application, one is the view thread, and the other a worker thread. What i want to do is to sleep the worker thread until the view thread terminates the handling of the onDraw method.</p><p>How i can do this? is there a wait for a signal or something?</p>","7363","Lucas S.","7363","Lucas S.","2008-09-23 15:39:59","2011-06-27 09:15:24","Sleep a thread until an event is attended in another thread","<java><android><multithreading><ipc>","2","0","5","",""
"144254","1","144280","","2008-09-27 19:13:21","35","3790","<p>So, I'll be getting my T-Mobile G1 within a month or so, and I'm excited to start developing for it.</p><p>Has anyone started using it yet? Is there a dev wiki or anything set up for it yet?</p>","1965","Jonathan Holland","225647","","2012-10-29 20:39:34","2012-10-29 20:39:34","Getting started with Android","<android>","7","2","24","2011-11-22 16:40:18",""
"146020","1","146086","","2008-09-28 14:53:56","45","16518","<p>I'm doing some Android dev, and I much prefer Visual Studio, but I'll have to use Eclipse for this.</p><p>Has anyone made a tool that switches Eclipse to look and behave more like visual studio? I mainly can't stand its clippyesqe suggestions on how I should program (Yes, I know I have not yet used that private field! Thanks Eclipse!), or its incredibly lousy intellisense.</p><p>For example, in eclipse, if I don't type ""this"" first, its intellisense won't realize I want to look for locally scoped members. Also, the TAB to complete VS convention is drilled into my head, and Eclipse is ENTER to complete, I could switch everything by hand but that would take hours, and I was hoping someone had some sort of theme or something that has already done it :)</p>","1965","Jonathan Holland","951448","","2013-02-02 17:03:14","2013-02-02 17:03:14","Making Eclipse behave like Visual Studio","<java><android><eclipse><visual-studio><ide>","4","4","7","","2008-09-28 14:53:56"
"150781","1","150922","","2008-09-29 21:31:18","7","3446","<p>Does anyone know of any existing projects that aim to port Android's Java VM over to the iPhone? From what I understand, this wouldn't be too out of reach and would certainly make for some exciting developments.</p><p><strong>Edit</strong>: I should point out that I am aware this will not happen using the official iPhone SDK. However, a jailbroken platform would remove any Apple-imposed roadblocks. I imagine most that would be interested in integrating Android into the iPhone would also be the demographic that would typically have a jailbroken iphone.</p>","5291","Wilco","5171","Dan Dyer","2008-10-17 13:16:36","2011-05-31 09:03:49","Porting Android's Java VM to the iPhone?","<iphone><android><jvm>","5","2","2","",""
"151777","1","151940","","2008-09-30 04:41:15","856","308966","<p>I've been playing around with the Android SDK, and I am a little unclear on saving an application's state. So given this minor re-tooling of the 'Hello, Android' example:  </p><pre><code>package com.android.hello;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class HelloAndroid extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mTextView = new TextView(this);        if (savedInstanceState == null) {            mTextView.setText(""Welcome to HelloAndroid!"");        } else {            mTextView.setText(""Welcome back."");        }        setContentView(mTextView);    }    private TextView mTextView = null;}</code></pre><p>I thought that might be all one needed to do for the simplest case, but it always gives me the first message, no matter how I navigate away from the app. I'm sure it's probably something simple like overriding onPause or something like that, but I've been poking away in the docs for 30 minutes or so and haven't found anything obvious, so would appreciate any help.</p><p><em>Cue me looking a fool in three, two, one...</em></p>","61","Bernard","61","","2013-10-31 14:18:06","2014-04-16 17:11:47","Saving Activity state in Android","<android><application-state>","15","3","526","",""
"173298","1","","","2008-10-06 06:01:45","5","2091","<p>What is a good mobile programming platform to go with for a c++ developer? </p><p>Is learning android a good option?</p>","22076","raj","309086","Simucal","2012-10-23 10:23:52","2012-11-08 10:40:36","Getting started with mobile programming. What is a good platform?","<java><android><c++><iphone>","10","0","1","2013-01-15 16:57:38","2008-10-06 06:02:50"
"196946","1","198662","","2008-10-13 07:44:54","9","14234","<p>I was trying the following example, but with external URLs:</p><p><a href=""http://android-developers.blogspot.com/2008/09/using-webviews.html"" rel=""nofollow"">http://android-developers.blogspot.com/2008/09/using-webviews.html</a></p><p>The example shows how to load an HTML file from assets folder (file:// url) and display it in a WebView. </p><p>But when I try it with external URLs (like <a href=""http://google.com"" rel=""nofollow"">http://google.com</a>), I am always getting a ""Website Not Available"" error. Android's built-in browser is able to access all external URLs. </p><p>I suspect that it has something to do with permissions, but wasn't able to confirm it.</p>","18027","Tahir Akhtar","469983","","2012-10-01 12:27:02","2012-10-01 12:27:02","Does Android WebView need permissions for opening external URLs?","<android><http><webview>","2","0","2","",""
"204363","1","742087","","2008-10-15 11:17:09","25","34534","<p>To all 4 Android developers out there :)</p><p>Is it possible to create a simple 3D model (for example in 3DS MAX) and then import it to Android somehow? I work in Eclipse with Android plugin, if that's of any importance.</p><p>If so, do you know any tutorials/resources explaining how to do it?</p>","3037","grycz","","","","2013-07-11 22:11:13","Is there a way to import a 3D model into Android?","<android><3d><opengl-es>","7","0","21","",""
"214615","1","421636","","2008-10-18 05:14:45","253","119130","<p>Now that the G1 with Google's Android OS is now available (soon), will the android platform ever support .Net?</p>","16340","JarrettV","3225","Kenny","2008-11-17 11:24:25","2012-06-20 13:53:07","Will Google Android ever support .NET?","<.net><android><mono><speculative>","13","2","114","2012-06-25 15:40:01",""
"228851","1","","","2008-10-23 07:29:45","6","3487","<p>Has anybody tried creating Raw socket in Android and have succeeded ?</p>","","Harish","3330969","Xardas","2014-03-19 13:09:42","2014-03-19 13:09:42","How to create Raw socket in Android?","<android><sockets><raw-sockets>","2","0","1","",""
"230193","1","231284","","2008-10-23 15:30:13","43","12480","<p>I know that you can run almost all Java in Dalvik's VM that you can in Java's VM but the limitations are not very clear.  Has anyone run into any major stumbling blocks?  Any major libraries having trouble?  Any languages that compile to Java bytecode (Scala, Jython etc...) not work as expected?  </p>","27247","Ichorus","14444","moocha","2008-10-23 15:47:29","2014-03-15 04:04:28","What can you not do on the Dalvik VM (Android's VM) that you can in Sun VM?","<java><android><jvm><dalvik>","4","0","21","",""
"230643","1","","","2008-10-23 17:29:07","10","6211","<p>Is there any elegant way in the Android API for detecting new media when it is written to the device? I’m mainly interested in photos taken by the camera, video taken by the camera and audio recorded from the mic.</p><p>My current thinking is to periodically scan each media content provider and filter based on last scan time.</p><p>I’m just wondering if there is some service I can hook into to get realtime notifications.</p>","21297","Declan Shanaghy","","","","2010-12-09 13:11:21","Android API for detecting new media from inbuilt camera & mic","<java><android><api><multimedia>","2","1","3","",""
"238284","1","238297","","2008-10-26 17:13:32","67","26469","<p>I'm building an Android app and I want to copy the text value of an EditText widget. It's possible for the user to press <code>Menu+A</code> then <code>Menu+C</code> to copy the value, but how would I do this programmatically?</p>","9128","Zach","1027277","Andy Lester","2013-12-17 12:13:57","2013-12-17 12:13:57","How to copy text programmatically in my Android app?","<android><menu>","4","2","22","",""
"240161","1","","","2008-10-27 14:52:45","9","9427","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2084745/how-to-install-the-application-on-real-device-without-publishing-and-eclipse"">How to install the application on real device without publishing and Eclipse?</a>  </p></blockquote><p>Besides the Android Marketplace, what are my options as far as deploying an Android application to someone remotely? </p><p>The particular issues I am up against are that I have an application which I have written which addresses a somewhat limited problem, for my sister. She is mostly computer literate, but not a developer and lives hours away.</p><p>I could see this same issue being common if a company were to want to develop an application for their shiny new G1s and then deploying their application. Surely there is a non-developer-centric way to do this.</p>","22777","Anthony Potts","4337","Gulzar","2008-10-28 00:55:55","2011-09-23 12:47:33","Android application deployment","<android><deployment>","0","0","1","2011-09-23 16:19:02",""
"240469","1","256136","","2008-10-27 16:18:25","5","6484","<p>It would be a shame if it doesn't, because it will make for more attractive looking Android applications.</p>","11911","Iain","","","","2014-03-19 13:11:49","Will JavaFX work on Android?","<android><javafx>","4","0","2","",""
"249916","1","518952","","2008-10-30 11:49:50","6","13111","<p>The <code>java.net.InetAddress.GetByName(String host)</code> method can only return <code>A</code> records so to lookup other record types I need to be able to send DNS queries using the <code>dnsjava</code> library.</p><p>However that normally relies on being able to parse <code>/etc/resolv.conf</code> or similar to find the DNS server addresses and that doesn't work on Android.</p><p>The current DNS settings on Android can apparently only be obtained from within a shell by using the <code>getprop</code> command.</p><p>Can anyone tell me how to get those settings from Java other than by spawning a shell with <code>Runtime.exec()</code> and parsing the output from <code>getprop</code>?</p>","6782","Alnitak","","","","2012-04-18 12:16:44","How do I find the DNS servers in Android from a Java program?","<java><android><dns>","3","1","2","",""
"257514","1","2679284","","2008-11-02 22:40:49","45","63221","<p>I need to find out the pixel position of one element in a list that's been displayed using a <code>ListView</code>. It seems like I should get one of the <code>TextView</code>s and then use <code>getTop()</code>, but I can't figure out how to get a child view of a <code>ListView</code>.</p><p><strong>Update:</strong> The children of the <code>ViewGroup</code> do not correspond 1-to-1 with the items in the list, for a <code>ListView</code>. Instead, the <code>ViewGroup</code>'s children correspond to only those views that are visible right now. So <code>getChildAt()</code> operates on an index that's internal to the <code>ViewGroup</code> and doesn't necessarily have anything to do with the position in the list that the <code>ListView</code> uses. :-)</p>","2652","lacker","119895","lacker","2013-08-31 12:53:40","2013-11-29 05:58:27","Android: Access child views from a ListView","<android><android-listview>","5","0","26","",""
"263507","1","","","2008-11-04 21:30:22","11","38299","<p>I'm trying to get the zoom controls to show up in a mapview, the following code almost works, but the zoom controls appear in the top left of the mapview, not the bottom center like I'm specifiying via setGravity().  Can someone enlighten me as to what I'm missing?</p><pre><code>zoomView = (LinearLayout) mapView.getZoomControls();zoomView.setLayoutParams(new ViewGroup.LayoutParams  (ViewGroup.LayoutParams.WRAP_CONTENT,   ViewGroup.LayoutParams.WRAP_CONTENT)); zoomView.setGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL);mapView.addView(zoomView);</code></pre><p>These views/layouts are all constructed programatically, there is no layout file to tweak.</p>","24590","","21886","","2009-12-24 18:20:32","2012-06-20 13:46:16","Placing Zoom Controls in a MapView","<android><android-mapview>","7","0","17","",""
"276719","1","","","2008-11-10 00:07:33","4","913","<p>I have a <code>T-Mobile G1</code> and I'm going to download the developer SDK and see if I can create a few simple apps for my phone.  If you've done similar development, please answer below and tell me about your experience.  Please share any links you found especially useful.</p>","1572436","","225647","","2012-10-29 20:39:52","2012-10-29 20:39:52","Anyone have any impressions, hints, tutorials from developing for Google Android devices?","<android><sdk>","5","0","4","2013-02-20 13:49:00",""
"288044","1","339021","","2008-11-13 19:56:11","11","23536","<p>I am using a ListView to present the main screen of my application.  The main screen is essentially a menu to get into the different sections of my application.  Currently I have the ListView contents generatings programmatically in the onCreate method.  </p><p>Here is the code snippet that does this:</p><pre><code>String[] mainItems = {    ""Inbox"", ""Projects"", ""Contexts"", ""Next Actions""}@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    setListAdapter(new ArrayAdapter&lt;String&gt;(            this, android.R.layout.simple_list_item_1, mainItems));    registerForContextMenu(getListView());}</code></pre><p>So the menu is essentially just a bunch of nodes with the text contained in the mainItems array.  I know that I can create an XML layout (i.e. <code>R.layout.mainMenu_item</code>) that has an ImageView and TextView in it, but I am unsure how to set the ImageView's icon.  I have seen that there is a setImageResouce(int resId) method, but the way to use this when generating with an ArrayAdapter is eluding me.  Is there a better way to do this?</p>","37436","Michael Herold","750613","","2012-06-27 10:16:56","2012-06-27 10:16:56","How can I create icons for menu items in Android's ListView?","<android><menu><icons><android-listview>","2","0","6","",""
"294688","1","308087","","2008-11-17 01:26:00","9","3629","<p>I have a specific scenario in mind, but I will ask this generally:</p><p><strong>Is there a way to make my mobile phone trigger an action on my computer?</strong> I am thinking that with a smart phone it must be possible to link the phone and the pc with bluetooth, and have some sort of small program running on my computer that will listen for incoming phonecalls on the phone. When someone calls me, I want my mobile to simply submit the callers phonenumber to the pc, and then the pc will do its stuff from there. Then, I want to handle the call on the mobile phone as usual.</p><p>Edit:Updated this question! I am currently using the HTC Hero, and hopefully the Android SDK will make this more easy to accomplish.</p><p>My specific scenario was:When my phone (Nokia N82) calls, i want to submit the callers phonenumber to a search applet/application, that will query Microsoft Dynamics CRM and see if a contact person or a company has that phonenumber, and if so, show the corresponding person or companys info on my screen. My preferred development platform is .Net</p>","29397","Bj&#248;rn","1208510","","2012-10-15 07:45:19","2012-10-15 07:45:19","How to make an incoming call on my mobile trigger an action on my pc","<.net><android><mobile><bluetooth><phonecalls>","10","1","6","",""
"297586","1","303500","","2008-11-18 01:32:18","321","266074","<p>I am having a lot of trouble finding good information on how to call a standard SOAP/WSDL web service with Android. All I've been able to find are either very convoluted documents and references to ""kSoap2"" and then some bit about parsing it all manually with <a href=""http://en.wikipedia.org/wiki/Simple_API_for_XML"">SAX</a>. OK, that's fine, but it's 2008 so I figured there should be some good library for calling standard web services.</p><p>The web service is just basically one created in <a href=""http://en.wikipedia.org/wiki/NetBeans"">NetBeans</a>. I would like to have IDE support for generating the plumbing classes. I just need the easiest/most-elegant way to contact a <a href=""http://en.wikipedia.org/wiki/Web_Services_Description_Language"">WSDL</a> based web service from an Android based phone.</p>","38426","BobbyShaftoe","213269","monjardin","2012-10-23 21:39:46","2013-12-31 09:54:01","How to call SOAP web service in Android","<java><android><web-services><soap><wsdl>","23","4","176","",""
"306626","1","434975","","2008-11-20 19:55:37","19","19006","<p>I'm completely stumped on this one.  I have three different lists that need to be displayed on the screen. It's completely possible that the lists will extend past the bottom edge of the screen, so I would need scrolling.</p><p>I've tried using a <code>ScrollView</code> with a <code>LinearLayout</code> child, and putting my <code>ListViews</code> in the <code>LinearView</code>, but all of the <code>ListViews</code> lock to a fixed height with scroll bars.  Using other kinds of Layouts means no scrolling.</p><p>Does anyone have any suggestions, or will I need to programmatically add the list items to some layout and hope for the best?</p>","12096","Andrew Burgess","1248044","Reto Meier","2013-06-05 08:01:26","2013-06-05 08:05:06","Scrolling with Multiple ListViews for Android","<android><listview><scrollview><android-linearlayout>","5","0","6","",""
"310581","1","310618","","2008-11-21 23:53:54","4","2293","<p>I understand the Android OS is based on Linux. Does that mean the G1 phone has a terminal emulator and you can open a console and use commands like <code>cd</code>, <code>ls</code>, etc? Or failing that, would it be possible to write a terminal emulator for it?</p><p>On a related note, would it be possible to run a ssh server on the G1 and log into it over a wifi connection?</p>","","Ethan","225647","","2012-10-29 20:42:03","2012-10-29 20:42:03","Can you get to a command line on the G1 phone?","<android>","5","0","1","",""
"351864","1","352920","","2008-12-09 05:14:13","3","5811","<p>I want to port few C/C++ libraries to android, how feasible it would be</p><p>e.g. openssl can it be portedor suppose an application which depends on openssl, what is the best way to port it to android when android i think itself has libssl.so</p><p>what are the tools available e.g. scratchbox , any alternatives?Has anybody experience with it?</p>","6946","","6946","","2008-12-09 05:19:57","2011-12-29 21:14:08","Porting C++ lib/app on android","<c++><c><android><linux><embedded>","3","0","2","",""
"365795","1","367657","","2008-12-13 21:48:11","5","835","<p>I have been used my Palm Treo 650 for a few years. Now i am considering to buy a new one among iPhone, BlackBerry and Windows mobile. It seems windows mobile is best for me. Because I have experience with .NET development, and I think .net framework compact will not be too far away from my knowledge.</p><p>Apart from calls, messages, I use it to check email, news and internet a lot. And I am very interested in developing small useful programmes on it as well. But it seems fancy iphone and push mail with BlackBerry are also very cool. </p><p>To consider both mobile programming and personal use, which is the best choice of a mobile system for programmers?</p>","43997","chagel","4007","rpetrich","2009-01-05 09:12:54","2009-01-05 09:12:54","Which mobile system is for programmers?","<iphone><android><windows-mobile><blackberry><smartphone>","12","2","4","2011-09-19 05:08:10",""
"365880","1","397513","","2008-12-13 22:44:56","35","27216","<p>Has anybody had any success with developing for Android platform using Netbeans (5.5+ ) IDE? I know of atleast netbeans one plugin that is supposed to support it but wanted to hear if anyone is using netbeans for Android development and how easy it is to set it up.</p>","33121","omermuhammed","839601","","2011-11-02 20:49:44","2014-04-15 14:07:27","Android development with Netbeans IDE","<android><netbeans>","3","2","9","",""
"371538","1","371586","","2008-12-16 14:47:26","196","49448","<p>Anyone working on the Android ('gPhone') have or know of a place where I can find a good ORM tool for it? The code is written in Java, and the database is SQLite. What I would like to find is a tool that given the object definition, can auto-generate the tables and the CRUD functions (that would be awesome), or, barring that, a tool that can take the table definition, the object definition, and auto-generate the CRUD functionality. The rub is that all of this must happen within the Android framework, which has its own conventions as to how database access works.</p>","18071","GWLlosa","356895","GWLlosa","2013-02-05 19:05:39","2014-03-18 09:40:29","Any good ORM tools for Android development?","<java><android><sqlite><orm><crud>","17","2","81","2013-04-15 11:36:26",""
"381759","1","381959","","2008-12-19 18:18:49","64","8436","<p>According to a recent <a href=""http://www.odesk.com/blog/2008/12/android-getting-slaughtered-by-iphone/"">article</a> iPhone has gained a better appeal than Android among programmers. I'm quite a newbie to Java and a complete profane to ObjectiveC, in your opinion, in which one of the two could I have a try?  which platform is good for me<br>because i have knowledge about java but not about objective c.</p>","25418","Tommaso Urli","1139398","","2012-03-21 13:23:21","2013-06-19 13:38:50","iPhone or Android?","<iphone><android><sdk>","25","9","25","2011-08-01 11:23:19","2008-12-22 10:10:04"
"390482","1","390488","","2008-12-24 00:28:04","18","43602","<p>This might sound like a stupid question, but google didn't help me. </p><p>Is there a JRE available for Android? If so which version is it? Are there any major features missing?</p><p>If not does that mean all java apps need to be recompiled for Dalvik to work on the Android?</p><p><strong>Update;</strong> Will there ever be JRE available for the Android?</p>","42303","hhafez","42303","hhafez","2008-12-24 00:35:13","2013-01-06 14:21:48","JRE on Android","<java><android><jre><dalvik>","2","3","3","",""
"392785","1","","","2008-12-25 12:40:28","10","33113","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4769020/android-and-xmpp-currently-available-solutions"">Android and XMPP: Currently available solutions</a>  </p></blockquote><p>I am trying to build a small XMPP client in Android. Any ideas on what library I can use?I have tried using the Smack API, but there are some issues with it, which makes it not practical.</p>","","Earlence","552792","","2011-09-26 22:19:17","2011-09-26 22:19:17","XMPP and Android","<android><xmpp>","4","1","6","2011-08-21 17:23:40",""
"419184","1","","","2009-01-07 04:25:01","70","75104","<p>On Android phones SMS messages registered to applications also get sent to the device's inbox.  However to prevent clutter, it'd be nice to be able to remove application specific SMS messages from the inbox to reduce the potential overflow of those messages.</p><p>Questions on other Google groups on getting a definitive answer on a programmatic way to delete SMS messages from the Android inbox don't seem to be pressing.</p><p>So the scenario:</p><ul><li>Android App startup.</li><li>register SMS message types X,Y and Z</li><li>messages P,Q,X,Y,Z stream in over the course of time, all deposited in inbox</li><li>Android application detects receipt of X,Y,Z (presumably as part of the program interrupt event)</li><li>process X,Y,Z</li><li><em>Desirement!!!</em> X,Y,Z are deleted from the Android inbox</li></ul><p>Has it been done?  Can it be done?</p>","52302","dmyung","63550","","2011-01-24 11:46:51","2014-03-22 18:43:32","How to delete an SMS from the inbox in Android programmatically?","<android><sms>","19","3","54","",""
"424752","1","772757","","2009-01-08 15:48:51","508","170774","<p>With Android removing the <a href=""http://en.wikipedia.org/wiki/Swing_%28Java%29"">Swing</a> and <a href=""http://en.wikipedia.org/wiki/Abstract_Window_Toolkit"">AWT</a> libraries from Java, I was wondering what solutions have been developed to display simple bar histograms, line graphs and other simple data visualizations in Android?</p><p>There is a Google specific 2D library. Are there any packages built atop it that allows for the easy creation of graphical data?</p><p>Some solutions bandied about on the web have been ""just pull down a Google chart with a HTTP get"" which seems like a fine workaround.  However, our eventual expected application usage is in a poor connectivity situation where network usage is expensive (unlocked phones in resource poor settings).</p>","52302","dmyung","979752","","2012-04-11 09:35:18","2013-10-16 06:14:51","Any good graphing packages for Android?","<java><android><graph>","13","2","335","2013-12-06 16:27:32",""
"432037","1","432155","","2009-01-11 00:27:55","481","321732","<p>How do I center the text horizontally and vertically in a <code>TextView</code> in android, so that it appears exactly in the middle of the <code>TextView</code>?</p>","6068","J. Pablo Fern&#225;ndez","427763","","2012-08-10 15:07:02","2014-03-21 10:15:57","How do I center text horizontally and vertical in a TextView in Android?","<android><text><center><textview>","25","0","76","",""
"432763","1","433033","","2009-01-11 11:14:06","103","82496","<p>In Android, when layout out widgets, what's the difference between fill_parent and wrap_content?</p><p>Is there any documentation where you can point to? I'm interested in understanding it very well.</p>","6068","J. Pablo Fern&#225;ndez","11440","","2009-05-23 10:39:00","2014-03-25 11:49:39","What's the difference between fill_parent and wrap_content?","<android><layout><user-interface>","3","1","26","",""
"433392","1","436162","","2009-01-11 18:38:27","30","27697","<p>How do I use prepared statements in SQlite in Android?</p>","6068","J. Pablo Fern&#225;ndez","20471","d03boy","2009-01-12 17:14:56","2013-03-08 08:00:39","How do I use prepared statements in SQlite in Android?","<android><sqlite><prepared-statement>","4","0","16","",""
"433761","1","436821","","2009-01-11 21:32:39","33","26019","<p>How do you implement a context menu triggered by a long click or tap on a ListActivity that is using the built in layouts and a ListAdapter?</p>","6068","J. Pablo Fern&#225;ndez","6068","J. Pablo Fern&#225;ndez","2009-01-14 18:00:38","2011-12-30 21:20:51","How do you implement context menu in a ListActivity on Android?","<android><user-interface><long-click>","3","1","23","",""
"437517","1","1001647","","2009-01-12 23:52:25","5","1168","<p>I'm considering creating a screen reader for Android. My questions are as follows. One how much of the internals of Android are exposed through the Java API? I'm looking for things such as system wide notification when text is displayed, notification of a new application being launched, etc. I'd rather not have to modify the kernel source and only allow my app to run on a developer phone. Two, how much processor and memory are left over on the G1 assuming no applications running? Three assuming average use of applications on the phone how much processor and memory are left?<br>More info<br>I'm aware that applications should not be designed to work on a specific phone. I picked the G1 because it's the most popular phone currently running Android that I know of. I am looking for lower end system specs that my program would have to fit in, it may run great on a netbook with Android installed but use to much memory and processor to run on most Android handsets.<br>Update:<br>There are now two screen reader projects that use Android 1.6, they can be found at<a href=""http://google-opensource.blogspot.com/2009/10/talkback-open-source-screenreader-for.html"" rel=""nofollow"">http://google-opensource.blogspot.com/2009/10/talkback-open-source-screenreader-for.html</a><a href=""http://spiel.thewordnerd.info/"" rel=""nofollow"">http://spiel.thewordnerd.info/</a></p>","14744","Jared","14744","Jared","2009-10-30 13:53:04","2009-10-30 13:53:04","android internals and memory/processor constraints?","<java><android><accessibility>","2","0","1","",""
"442496","1","442590","","2009-01-14 10:11:49","11","16642","<p>Can anybody tell my why this doesn't work in the Android emulator? From the browser I have access and the server is internal. All I can think of is that I'm missing some configuration on my app so it can access the network layer.</p><pre><code>try {    InetAddress server = Inet4Address.getByName(""thehost"");    //Doesn't work either    //or InetAddress server2 = Inet4Address.getByAddress(new String(""192.168.1.30"").getBytes());    if(server.isReachable(5000)){        Log.d(TAG, ""Ping!"");    }    Socket clientsocket = new Socket(server, 8080);} catch (UnknownHostException e) {    Log.e(TAG, ""Server Not Found"");} catch (IOException e) {    Log.e(TAG, ""Couldn't open socket"");}</code></pre><p><strong>Throws an UnknownHostException</strong></p><p>Thanks</p>","48869","Ubersoldat","750613","","2012-06-28 06:19:22","2012-06-28 06:19:22","Android HTTP Connection","<java><android><sockets><network-programming>","2","0","","",""
"449484","1","449824","","2009-01-16 04:05:38","65","52055","<p>I have a question regarding launching new activities. It boils down to this.I have 3 tabs on a view</p><pre><code>A) contains gMap activity B) camera activity C) some random text fields.</code></pre><p>Requirement is that the application runs in Portrait mode. </p><p>All 3 tabs work as expected w/ the exception of the Camera Preview Surface (B). It is rotated 90 degrees. They only way to make it correct is to set the app to landscape which throws all my tabs around, and is pretty much unworkable.</p><p>My solution is this : replace </p><p>my camera activity with a regular activity that is empty w/ the exception of </p><pre><code>Intent i = new Intent(this,CameraActivity.class);    startActivity(i);</code></pre><p>This launches my CameraActivity. And that works fine. I had to do a linear layout and include 3 images that look like real tabs, so I can try and mimic the operation of the tabs while rotating the screen to landscape and keep the visuals as portrait.The user can click one of the images(buttons) to display the next tab. This is my issue. It should exit my 'camera activity' returning to the 'blank activity' in a tab, where it should be interpreted to click the desiered tab from my image. </p><p>The main thing is, when it returns, it returns to a blank (black) page under a tab (because it is 'empty'). How can I capture the return event back to the page that called the activity, and then see what action they performed? </p><p>I can set an onclicklistener where I can respond to the fake tabs (images) being clicked to exit out of the camera activity. On exit, the tab should update so that is where you return. any Suggestions?</p><p>Thanks,</p>","393258","","844882","","2012-07-02 03:59:22","2012-07-02 03:59:22","Android: Capturing the return of an activity","<android><android-intent><android-activity><exit>","1","0","28","",""
"449763","1","449790","","2009-01-16 07:31:18","395","171315","<p>Particularly, where can I browse the source code for the contact application? Is the only way to go to download all there is?</p>","6068","J. Pablo Fern&#225;ndez","648313","","2011-07-13 20:59:30","2013-08-09 04:53:45","Where can I browse Android source code on-line?","<android><android-source>","8","8","163","2012-07-18 10:20:00",""
"451464","1","620641","","2009-01-16 18:31:48","3","2845","<p>How can I get my own image to be able to pan and zoom (like a MapView)?</p>","55944","","","","","2011-06-17 16:47:21","I want pan and zoom functionality (like a MapView) on my own map image","<android><zoom>","2","0","1","",""
"453353","1","462267","","2009-01-17 14:14:35","7","669","<p>Good afternoon,</p><p>with all the buzz around the iPhone / AppStore etc, I felt it to be a no-brainer to create a nice iPhone application for the web-application I've been putting together, but how's your experience with the Android Platform so far - is it interesting already from a sales &amp; user-volume?</p><p>I've had a quick look at the T-Mobile G1 and from an end-user perspective I didn't think it is all to appealing and to me it seems it'll take a while until all this takes off.</p><p>Does anyone of you already have an or multiple apps finished for the platform? How's your take on this.. are sales lower/higher than you expected them to be? Is it worth investing the time &amp; money (right now) to build an android version of my app? Being 'worth' obviously is a very flexible term and depends on someone's point of view, but basically right now every hour I don't work on the webapplication itself basically 'has' to pay off fairly quickly.. and that's why I'm reaching out for some real-life experience.</p><p>Cheers and thanks,-J</p>","2591","J&#246;rg Battermann","","","","2009-01-20 17:29:22","Google Android platform financially interesting already?","<android>","5","3","3","2013-11-08 05:20:44",""
"454274","1","454806","","2009-01-17 23:14:44","5","5966","<p>I am creating a matching game for Android, and when the user gets a match, a dialog box should pop up saying ""Match!"" I cannot figure out how to do this though. If I use Thread.currentthread().sleep, the dialog never appears. </p><pre><code>android.app.AlertDialog a = new android.app.AlertDialog.Builder(match.this).setTitle(""Match!"").show();Thread.currentthread().sleep(1000);a.dismiss();</code></pre><p>Nothing happens - the program just hangs for a second. I would like it to pop up for just 1 second, or if there is another sort of popup type thing, that would be good too.</p>","764272","Isaac Waller","764272","","2009-09-19 21:22:31","2009-12-22 05:32:52","Timed popup in Android","<java><android><popup><timer>","2","0","6","",""
"454315","1","456941","","2009-01-17 23:41:37","83","153386","<p>How do you format correctly according to the device configuration a date and time when having year, month, day, hour and minute?</p>","6068","J. Pablo Fern&#225;ndez","","","","2014-04-11 17:54:27","How do you format date and time in Android?","<android><date><time><formatting><format>","12","0","25","",""
"455830","1","472919","","2009-01-18 20:30:58","3","9723","<p>I have run into a small issue with something that I am probably just overlooking.</p><p>I want to take a picture from the surface preview of the camera, and save it to the sd_card. This works ALMOST perfectly. I assign it a file name, and for one reason or another, it does not use the filename. </p><p>This is what I have been trying to do :</p><pre><code>    Button imagecapture = (Button)findViewById(R.id.imagecapture);	imagecapture.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {        	String filename = null;        	ImageCaptureCallback iccb = null;        		try {        		filename = timeStampFormat.format(new Date());        		ContentValues values = new ContentValues();        		values.put(Media.TITLE, filename);        		values.put(Media.DESCRIPTION, ""Image capture by camera"");        		Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);        		iccb = new ImageCaptureCallback( getContentResolver().openOutputStream(uri));        		} catch(Exception ex ){        		ex.printStackTrace();        		Log.e(getClass().getSimpleName(), ex.getMessage(), ex);        		}        	camera.takePicture(mShutterCallback, mPictureCallbackRaw, iccb);        	com.froogloid.android.gspot.Park.imageFileName = filename;        }    });</code></pre><p>It won't use the filename (i.e. time/date stamp I ask it to.)</p>","393258","Chrispix","","","","2011-03-22 13:35:47","Android : Getting file name from camera?","<android><file><camera>","3","0","7","",""
"456211","1","456918","","2009-01-19 00:28:29","545","204530","<p>In my Android application, when I rotate the device (slide out the keyboard) then my activity is restarted (onCreate is called). Now, this is probably how it's supposed to be, but I do a lot of initial setting up in the onCreate method, so I need either:<br />1. Put all the initial setting up in another function so it's not all lost on device rotation or<br />2. Make it so onCreate is not called again and the layout just adjusts or<br />3. Limit the app to just portrait so that onCreate is not called.</p>","764272","Isaac Waller","844882","Isaac Waller","2012-07-02 03:57:22","2014-02-14 13:55:32","Activity restart on rotation Android","<android><rotation><android-activity>","17","2","346","",""
"459729","1","","","2009-01-20 00:24:56","41","121156","<p>How do I display the list of images using the ListView? I am dowloading the image at run time. The total number of images is not fixed.</p>","","Komal","63550","","2011-01-24 11:51:27","2013-08-13 10:15:14","How to display list of images in ListView in Android?","<android>","7","2","36","",""
"460387","1","","","2009-01-20 07:45:28","2","1313","<p>What is ScanResult.capabilities? Since I don't have a device, I don't know the format of it. </p><p>How do you connnect to a specific AP? I look through the API documentation but found no method to implement the function. Am I missing something?</p>","","zcj0429","584405","","2011-11-28 12:15:51","2011-11-28 12:15:51","Wi-Fi programming in android","<android>","1","0","","",""
"460418","1","460556","","2009-01-20 08:01:46","8","11841","<p>I have an application that has a primary layout of portrait (it is fixed as portrait), and there is one place to type in text. I would like to launch like a popup window in landscape orientation with the background image fogged out. I know there is a Popup Widget, but any ideas for rotating the text edit box would be great. Rotating it into a portrait view (text box only) when the keyboard is slid out would also work, as would showing a new screen with the text box on keyboard slide.</p>","393258","Chrispix","3330969","Chrispix","2014-03-19 13:24:31","2014-03-19 13:24:31","How to show an text editing box ""over"" the screen?","<android><text><popup><android-edittext>","1","0","7","",""
"468211","1","471148","","2009-01-22 06:27:36","13","4545","<p>What should I do to get my content provider to return the _count column with the count of records? The documentation says it is automatic, but maybe it's only taking about some built-in content provider. Running  a query to the database seems not to return it.</p>","6068","J. Pablo Fern&#225;ndez","6068","J. Pablo Fern&#225;ndez","2009-01-23 20:20:01","2013-11-06 15:36:17","How do I get the _count in my content provider?","<android><count><content><provider><android-contentprovider>","4","0","4","",""
"468220","1","559828","","2009-01-22 06:31:32","8","8078","<p>Currently I'm running instrumentations tests from the command line this way:</p><pre><code>adb shell am instrument -w com.blah.blah/android.test.InstrumentationTestRunner</code></pre><p>Is there a way to run them from Eclipse (with automatic installation of the application)?</p>","6068","J. Pablo Fern&#225;ndez","","","","2010-01-10 15:14:38","How do you run Android instrumentation tests from Eclipse?","<android><eclipse><testing><run>","2","0","5","",""
"468993","1","487622","","2009-01-22 12:52:33","33","19243","<p>I'm developing a JavaScript application that needs to run on the Google Android Phone OS.  Is there a way to enable the JavaScript Error/Debug console within Safari on either the Android Emulator or an actual device?  If so any instructions on how to do so would be appreciated.</p>","2723","Kevin","46914","Soviut","2009-01-27 05:56:26","2014-04-19 00:52:43","Is there a way to enable the JavaScript Error/Debug Console for Safari within Android?","<javascript><android><safari>","6","0","12","",""
"470566","1","","","2009-01-22 19:54:45","46","13980","<p>Anyone know of a user interface guidelines document for Android applications? Looking for something similar to <a href=""http://developer.apple.com/documentation/userexperience/Conceptual/AppleHIGuidelines/XHIGIntro/chapter_1_section_1.html"">Apple's</a> or <a href=""http://library.gnome.org/devel/hig-book/stable/"">Gnome's</a>.</p>","57663","mefesto","","","","2013-05-21 08:56:43","Android user interface guidelines","<android><user-interface><guidelines>","8","0","43","",""
"472313","1","477000","","2009-01-23 09:08:54","29","66205","<p>I am trying to get an address based on the long/lat. it appears that something like this should work? </p><pre><code>Geocoder myLocation = Geocoder(Locale.getDefault());    List myList = myLocation.getFromLocation(latPoint,lngPoint,1);</code></pre><p>The issue is that I keep getting : The method Geocoder(Locale) is undefined for the type savemaplocation</p><p>Any assistance would be helpful. Thank you.</p><hr><p>Thanks, I tried the context, locale one first, and that failed and was looking at some of the other constructors (I had seen one that had mentioned just locale). Regardless,</p><p>It did not work, as I am still getting : The method Geocoder(Context, Locale) is undefined for the type savemaplocation</p><p>I do have : import android.location.Geocoder;</p>","393258","Chrispix","1048862","Reto Meier","2013-03-31 16:42:40","2013-10-07 07:51:56","Android: Reverse geocoding - getFromLocation","<android><reverse-geocoding><street-address>","7","0","27","",""
"475674","1","476718","","2009-01-24 07:13:16","28","27491","<p>I'm building a mobile web app targeting Android users. I need to know what DOM events are available to me. I have been able to make the following work, but not terribly reliably:</p><ul><li>click</li><li>mouseover</li><li>mousedown</li><li>mouseup</li><li>change</li></ul><p>I have not been able to get the following to work:</p><ul><li>keypress</li><li>keydown</li><li>keyup</li></ul><p>Does anyone know the full list of what is supported and in what contexts (e.g., is onchange only available to form inputs?)? I can't find a reference for this on The Googles.</p><p>Thanks!</p><p><strong>Update:</strong> I asked <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/b9e24e2b05f39c5a/81292b608623f643"">the same question on the Android developers list</a>. I will be doing some more testing and will post my results both here and there.</p>","11577","Andrew Hedges","606371","Andrew Hedges","2012-04-03 02:26:25","2012-08-24 18:41:59","What DOM events are available to WebKit on Android?","<android><dom><webkit><dom-events>","3","0","13","",""
"476111","1","","","2009-01-24 15:03:18","179","46430","<p>I have followed the tutorial at <a href=""http://www.scala-lang.org/node/160"">Scala and Android</a> with Scala 2.7.3 final. The resulting Android App works but even the most basic application takes several minutes (!) to compile and needs 900 kb compressed, which is a show stopper for mobile applications. Additionally, the IDE runs out of memory every now and then. I assume dex is not made for big libraries like the scala-library.</p><p>So my question is: Has anyone actually done this and is there any cure for this?</p>","58598","Lemmy","58598","Lemmy","2009-01-25 22:00:20","2013-12-07 19:58:55","Scala Programming for Android","<android><scala><resources>","7","0","87","",""
"476848","1","6003815","","2009-01-24 23:03:30","53","21845","<p>Under what circumstances should I use <code>afterTextChanged</code> instead of <code>onTextChanged</code> and vice versa?  Examples would be most instructive with attention to why <code>onTextChanged</code> must be Overridden but <code>afterTextChanged</code> and <code>beforeTextChanged</code> do not have to be Overridden.</p>","53498","Will","1455421","","2012-09-19 10:47:20","2013-02-21 05:47:33","Android TextWatcher.afterTextChanged vs TextWatcher.onTextChanged","<android><textwatcher>","2","0","11","",""
"477572","1","10127787","","2009-01-25 11:23:37","433","286489","<p>I have a list view with a couple of image buttons on each row. When you click the list row, it launches a new activity. I have had to build my own tabs because of an issue with the camera layout. The activity that gets launched for result is a map. If I click on my button to launch the image preview (load an image off the SD card) the application returns from the activity back to the listview activity to the result handler to relaunch my new activity which is nothing more than an image widget. </p><p>The image preview on the list view is being done with the cursor and <code>ListAdapter</code>. This makes it pretty simple, but I am not sure how I can put a resized image (I.e. Smaller bit size not pixel as the src for the image button on the fly. So I just resized the image that came off the phone camera.</p><p>The issue is that I get an out of memory error when it tries to go back and re-launch the 2nd activity.</p><p>** Is there a way I can build the list adapter easily row by row, where I can resize on the fly (bit wise)? This would be preferable as I also need to make some changes to the properties of the widgets/elements in each row as I am unable to select a row with touch screen because of focus issue. (I can use roller ball.)</p><p>** I know I can do an out of band resize and save of my image, but that is not really what I want to do, but some sample code for that would be nice.</p><p>As soon as I disabled the image on the list view it worked fine again.</p><p>FYI: This is how I was doing it:</p><pre><code>String[] from = new String[] { DBHelper.KEY_BUSINESSNAME,                               DBHelper.KEY_ADDRESS,                               DBHelper.KEY_CITY,                               DBHelper.KEY_GPSLONG,                               DBHelper.KEY_GPSLAT,                               DBHelper.KEY_IMAGEFILENAME  + """"};int[] to = new int[] { R.id.businessname,                       R.id.address,                       R.id.city,                       R.id.gpslong,                       R.id.gpslat,                       R.id.imagefilename };notes = new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to);setListAdapter(notes);</code></pre><p>Where <code>R.id.imagefilename</code> is a <code>ButtonImage</code>.</p><p>Here is my LogCat:</p><hr><pre><code>01-25 05:05:49.877: ERROR/dalvikvm-heap(3896): 6291456-byte external allocation too large for this process.01-25 05:05:49.877: ERROR/(3896): VM wont let us allocate 6291456 bytes01-25 05:05:49.877: ERROR/AndroidRuntime(3896): Uncaught handler: thread main exiting due to uncaught exception01-25 05:05:49.917: ERROR/AndroidRuntime(3896): java.lang.OutOfMemoryError: bitmap size exceeds VM budget01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:304)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:149)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:174)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.graphics.drawable.Drawable.createFromPath(Drawable.java:729)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.ImageView.resolveUri(ImageView.java:484)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.ImageView.setImageURI(ImageView.java:281)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.SimpleCursorAdapter.setViewImage(SimpleCursorAdapter.java:183)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.SimpleCursorAdapter.bindView(SimpleCursorAdapter.java:129)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.CursorAdapter.getView(CursorAdapter.java:150)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.AbsListView.obtainView(AbsListView.java:1057)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.ListView.makeAndAddView(ListView.java:1616)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.ListView.fillSpecific(ListView.java:1177)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.ListView.layoutChildren(ListView.java:1454)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.AbsListView.onLayout(AbsListView.java:937)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.view.View.layout(View.java:5611)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1108)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.LinearLayout.onLayout(LinearLayout.java:922)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.view.View.layout(View.java:5611)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.FrameLayout.onLayout(FrameLayout.java:294)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.view.View.layout(View.java:5611)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:999)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.LinearLayout.onLayout(LinearLayout.java:920)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.view.View.layout(View.java:5611)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.widget.FrameLayout.onLayout(FrameLayout.java:294)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.view.View.layout(View.java:5611)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.view.ViewRoot.performTraversals(ViewRoot.java:771)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1103)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.os.Handler.dispatchMessage(Handler.java:88)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.os.Looper.loop(Looper.java:123)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at android.app.ActivityThread.main(ActivityThread.java:3742)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at java.lang.reflect.Method.invokeNative(Native Method)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at java.lang.reflect.Method.invoke(Method.java:515)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)01-25 05:05:49.917: ERROR/AndroidRuntime(3896):     at dalvik.system.NativeStart.main(Native Method)01-25 05:10:01.127: ERROR/AndroidRuntime(3943): ERROR: thread attach failed</code></pre><hr><p>I also have a new error when displaying an image:</p><pre><code>01-25 22:13:18.594: DEBUG/skia(4204): xxxxxxxxxxx jpeg error 20 Improper call to JPEG library in state %d01-25 22:13:18.604: INFO/System.out(4204): resolveUri failed on bad bitmap uri: 01-25 22:13:18.694: ERROR/dalvikvm-heap(4204): 6291456-byte external allocation too large for this process.01-25 22:13:18.694: ERROR/(4204): VM won't let us allocate 6291456 bytes01-25 22:13:18.694: DEBUG/skia(4204): xxxxxxxxxxxxxxxxxxxx allocPixelRef failed</code></pre>","393258","Chrispix","2124004","Chrispix","2013-10-24 09:20:02","2014-03-20 06:18:29","Strange out of memory issue while loading an image to a Bitmap object","<android><image><memory><bitmap>","36","2","495","","2013-03-29 06:56:44"
"484896","1","484921","","2009-01-27 19:38:57","5","1009","<p>That's my question, I want design all the interface of my application within an XML layout but I want to handle all the onTouch events, move ImageViews, etc, from a Java Class, this is possible?</p>","","c4r1o5","1777090","","2013-01-17 04:55:46","2013-01-17 04:55:46","How can access to the objects of a Layout XML from a Java class in Android","<android>","2","0","","",""
"490824","1","490838","","2009-01-29 07:59:41","4","1435","<p>trying to do some Android development, which means Eclipse, however, most of my experience is Microsoft tools (e.g. Visual Studio).  My java experience is mostly either Blackberry dev in the JDE and some miscellaneous stuff back in the Java 1.0 days.  </p><p>My question is this.  In VS200x, there is a .sln (solution), .csproj (project), etc...What are the equivalent file extensions for Eclipse?  Do they even exist?  I am having trouble with the basics, like how does one load a project into a workspace.</p><p>Is there a tutorial for Microsoft refugees somewhere?</p>","9382","AngryHacker","","","","2009-01-29 09:33:15","Eclipse eye for a Visual Studio guy","<java><android><visual-studio><eclipse>","4","0","2","",""
"491792","1","492277","","2009-01-29 14:27:56","3","1775","<p>I'm thinking about using semantic (web) technogies like RDF and OWL in an application on mobile devices. Currently I'm targeting android, but I'd also be interested in the possibilities on the iPhone and on J2ME.</p><p>I would like to use a lib instead of implementing everything from scratch. I know that there are some libraries and frameworks like Jena, Redland, Protégé but they don't state on which platforms they are known to work. </p><p>Having a dynamic object model and parsing from and to XML are must-haves for me. I'd also like to use reasoning, but I've been told it was rather computing-intensive, so that's only a nice-to-have.</p><p>For all platforms mentioned, the question can be interpreted as</p><ul><li>Is it possible in theory (especially for J2ME I'm not sure)</li><li>Are there libs that are known to work on those platforms?</li><li>Is the performance on a mobile platform good enough for real world usage?</li></ul>","39946","Brian Schimmel","","","","2010-10-22 22:22:22","Semantic stuff (RDF, OWL) on mobile phones - is it possible?","<iphone><android><java-me><rdf><owl>","5","1","2","",""
"493028","1","","","2009-01-29 19:23:41","2","2251","<p>Problem in running Junit tests in eclipse 3.4.1 on Mac OS</p><p>I am getting this error:'Lanuching AllTests' has encountered a problem. Cannot connect to VM.</p><pre>!ENTRY org.eclipse.core.net 1 0 2009-01-29 10:07:44.047!MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences!ENTRY org.eclipse.jdt.launching 4 120 2009-01-29 10:42:59.295!MESSAGE Cannot connect to VM!STACK 0java.net.SocketException: Socket closed        at java.net.PlainSocketImpl.socketAccept(Native Method)        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)        at java.net.ServerSocket.implAccept(ServerSocket.java:450)        at java.net.ServerSocket.accept(ServerSocket.java:421)        at org.eclipse.jdi.internal.connect.SocketTransportService.accept(SocketTransportService.java:95)        at org.eclipse.jdi.internal.connect.SocketTransportImpl.accept(SocketTransportImpl.java:56)        at org.eclipse.jdi.internal.connect.SocketListeningConnectorImpl.accept(SocketListeningConnectorImpl.java:135)        at org.eclipse.jdt.internal.launching.StandardVMDebugger$ConnectRunnable.run(StandardVMDebugger.java:107)        at java.lang.Thread.run(Thread.java:613)</pre>","60311","yinglcs","32043","guerda","2009-01-30 06:51:26","2012-03-26 18:20:25","Problem in running Junit tests in eclipse 3.4.1 on Mac OS","<android><eclipse><osx><junit>","3","3","1","2012-07-24 20:07:12",""
"495734","1","530709","","2009-01-30 14:46:15","7","6958","<p>Does anyone know if there's a way to either keep the user from uninstalling an app from an Android phone or reinstall it on removal? Before you flame me, please know that I have an app that's intended to be installed on the phone by a parent/employer/etc. and has a password-protected settings screen; the user would need to enter the password to remove the app.</p>","15882","Jarett","225647","Jarett","2012-10-29 20:40:06","2012-10-29 20:40:06","Is there any way to prevent an Android app from being removed?","<android>","5","0","3","",""
"499528","1","","","2009-01-31 20:45:59","3","11546","<p>Does anyone know what happened to <code>android.provider.Telephony</code>? It is not there anymore.</p>","33917","Tatyana Solovyeva","496830","","2011-10-20 18:43:22","2011-10-20 18:44:36","What happened to android.provider.Telephony?","<java><android><message>","5","0","4","",""
"500264","1","500494","","2009-02-01 05:17:24","6","21361","<p>I would like to implement a ListView, which I can do no problem w/ my cursor. Right now depending on which row you click on it takes you to a new activity based on the information pressed on that row (just like it should, and as expected). I would like to have a button however to delete the row, so a user can press any part of the row to launch the new activity, but if they press the button on that row, it deletes the row (or launches a delete activity/function).</p><p>If you can look @ DroidRecord, they have a similar layout as I am looking to achive.</p><p>Thanks!</p><p>Chris.</p>","393258","Chrispix","","","","2013-04-23 00:13:20","Android : Multiple Actions on a List View - Focus Issue","<android><listview><button><focus>","6","0","4","",""
"501085","1","1321162","","2009-02-01 16:27:27","6","631","<p>Is there some kind of guide about shortcuts on Android? I have the typical CRUD and I want to assign familiar shortcus.</p>","6068","J. Pablo Fern&#225;ndez","","","","2009-08-24 08:39:38","Are there standard shortcuts on Android?","<android><menu>","2","0","2","",""
"502788","1","519790","","2009-02-02 10:35:09","3","2355","<p>I have a problem with custom ItemizedOverlay on the MapView in Android.</p><p><strong>What I've done:</strong> Very simple offspring of ItemizedOverlay class that only wraps my own type of items and uses ItemizedOverlay for all the hard work.</p><p><strong>What works:</strong> Nearly everything - items are drawn properly, I can tap them etc.</p><p><strong>The problem:</strong> If I drag the map in the view by the map itself, I can scroll it without a problems. But if I try to start moving the map over one of items from my overlay (eg. ""dragging map by item""), it doesn't move.</p><p>This is really problem, because if I have ""a bit more"" items, there is no way to drag the map (without un-zooming and grabbing map outside items).</p><p>This problem occurs even if I don't handle any events generated by ItemizedOverlay (eg. with onTap() commented out in my overlay).</p><p>Any advice would be appreciated.</p>","56276","","","","","2012-06-11 00:34:14","MapView with ItemizedOverlay and map scrolling","<android><map><android-mapview>","1","1","","",""
"503451","1","","","2009-02-02 14:54:20","9","413","<p>Since the release of Android (over a year ago?), it's momentum seems to have slowed. I'm wondering of your perceptions of adoption and viability in the ""long run"". I believe Apple will ""lighten up"" a bit with real competition and with other platforms appearing to open their platform more to developers, do you feel that Android will be buried before it can mature? </p>","54192","geo","","","","2009-02-06 07:48:32","How would you describe the current state of the Android platform?","<android>","5","2","1","",""
"506777","1","","","2009-02-03 11:35:25","20","54153","<p>I need to know how to run an Android emulator automatically from Eclipse.</p><p>Any ideas?</p>","","tantan","321731","","2014-02-04 20:26:45","2014-02-04 20:26:45","How do I run an Android emulator automatically from Eclipse?","<android><eclipse><emulator>","1","0","4","",""
"513084","1","620086","","2009-02-04 20:11:52","376","92748","<p>If your application requires a database, and comes with built in data, what is the best way to ship that application?</p><p>1) Precreate the sqlite database and include it in the apk?</p><p>2) Include the SQL commands with the application and have it create the database and insert the data on first use?</p><p>The drawbacks I see </p><p>1) Possible sqlite version mismatches might cause problems, and I currently don't know where the database should go and how to access it.</p><p>2) It may take a really long time to create and populate the database on the device.</p><p>Your thoughts? Pointers to documentation regarding any issues would be great.</p>","62596","Heikki Toivonen","491978","Alex Fort","2012-08-28 07:25:53","2014-04-03 15:16:20","How to ship an Android application with a database?","<android>","10","2","248","",""
"513177","1","514778","","2009-02-04 20:34:40","5","4127","<p>When you are developing an Android application with the Eclipse plugin and debugger, and get a stack trace, you will not see any of the SDK source code. What steps do you need to make to fix this? Assume beginner Java programmer.</p><p>To clarify, I want Eclipse to automatically show me the correct source files and lines when I jump into a stack frame. I assume I would need to find the correct SDK sources, put them on my local system and then tell Eclipse how to find and use them. The question is, how exactly do I do these steps.</p>","62596","Heikki Toivonen","62596","Heikki Toivonen","2009-02-05 01:44:05","2011-09-02 05:57:07","When you get a stack trace in Eclipse with SDK classes in the stack, how can you see the SDK sources?","<android><eclipse>","3","0","3","",""
"522312","1","","","2009-02-06 21:43:19","640","135517","<p>I'd like to unit test my Android application but I found that test driven development in Android is far from trivial at the moment.</p><p>Any tips, tricks, war stories for building light weight and preferably fast running tests?</p>","35112","nyenyec","477415","","2012-04-04 15:52:58","2013-11-08 07:29:54","Best practices for unit testing Android apps","<android><unit-testing><tdd><android-testing>","16","7","397","2012-01-27 14:37:08","2009-02-06 21:43:19"
"522800","1","1804776","","2009-02-07 00:35:11","11","31915","<p>For my Android application there is a timer that measures how much time has passed. Ever 100 milliseconds I update my TextView with some text like ""Score: 10 Time: 100.10 seconds"". But, I find the TextView only updates the first few times. The application is still very responsive, but the label will not update. I tried to call .invalidate(), but it still does not work. I don't know if there is some way to fix this, or a better widget to use.</p><p>Here is a example of my code:</p><pre><code>float seconds;java.util.Timer gametimer;void updatecount() { TextView t = (TextView)findViewById(R.id.topscore);t.setText(""Score: 10 - Time: ""+seconds+"" seconds"");t.postInvalidate();}public void onCreate(Bundle sis) {... Load the UI, etc...  gametimer.schedule(new TimerTask() { public void run() {     seconds+=0.1; updatecount();} }, 100, 100);}</code></pre>","764272","Isaac Waller","764272","Isaac Waller","2010-01-14 02:29:41","2011-07-05 10:09:55","Android TextView Timer","<java><android><timer><textview>","3","0","2","",""
"523510","1","524191","","2009-02-07 09:31:31","19","9383","<p>I'm looking for something like the individual parts of the date picker dialog. A view that allows you to input integers (and only integers) that you can limit (between 1 and 10 for example), where you can use the keyboard or the arrows in the view itself. Does it exists?</p><p>It is for a dialog. A ready-made dialog to request an integer would also help.</p>","6068","J. Pablo Fern&#225;ndez","","","","2014-04-08 14:39:16","Is there a view for inputing integers in Android?","<android><gui><user-interface><integer>","4","0","11","",""
"524257","1","","","2009-02-07 18:10:07","40","24618","<p>What's the least painful and most size efficient way to use the Google Data APIs in an Android application?</p><p>After a few quick searches t seems that there is an <a href=""http://code.google.com/p/android-gdata/"">android-gdata</a> project on Google Code that seems to be the work of a single author. I didn't find any documentation for it and don't even know if it's production ready yet.</p><p>An older option, the com.google.wireless.gdata package seems to have been <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/faea8516f95ceaa6/9fc2090ffaf6620f?lnk=raot"">removed</a> from the SDK. It's still <a href=""http://android.git.kernel.org/?p=platform/external/gdata.git;a=summary"">available</a> in the GIT repository.</p><p>Before I invest too much time with either approach I'd like to know which is the best supported and least painful.</p>","35112","nyenyec","","","","2012-03-31 15:34:56","Best option for using the GData APIs on Android?","<android><gdata-api>","5","2","23","",""
"525063","1","525086","","2009-02-08 02:55:56","73","42797","<p>I want my intent to be launched when the user goes to a certain url: for example, the android market does this with <a href=""http://market.android.com/"">http://market.android.com/</a> urls. so does youtube. I want mine to do that too.</p>","764272","Isaac Waller","114066","","2012-08-20 15:38:03","2013-01-23 08:06:26","Android Respond To URL in Intent","<android><url><android-intent><launch>","1","2","39","",""
"525204","1","525252","","2009-02-08 05:29:49","7","9564","<p>I was wondering what is the intent for downloading URLs? In the browser, it will download stuff with a little notification icon. I was wondering if I can use that intent (and what it is). Thanks, Isaac Waller</p>","764272","Isaac Waller","","","","2013-09-03 06:32:06","Android Download Intent","<android><url><browser><download><android-intent>","5","4","1","",""
"526074","1","527228","","2009-02-08 17:29:48","16","19045","<p>I have created a activity that is only meant to be launched from a link (using a intent filter.) I do not want this activity to have a GUI - I just want it to start a service and put a notification in the bar. I have tried to put the intent filter for the link in my service, but that does not work. Is there a better thing to do this that will answer to intent filters - or can I just make my activity not have a GUI?<br />Sorry if I'm being confusing, Isaac</p>","764272","Isaac Waller","822","Reto Meier","2009-02-09 11:17:34","2014-01-31 23:10:01","Android Activity with no GUI","<android><gui><service><broadcastreceiver><intentfilter>","4","1","9","",""
"526524","1","526604","","2009-02-08 22:23:17","21","37382","<p>I have a Chronometer widget in my Android app. I was wondering how to get the time from it. I tried getText, getFormat, getBase, etc, but none of them work. This is probably a easy question, but I could not find it on Google.<br />Thanks, Isaac Waller</p><p>Example code snippet:</p><pre><code>Chronometer t = (Chronometer)findViewById(R.id.toptime);long time = SystemClock.elapsedRealtime()-t.getBase();Log.d(null,""Was: ""+time); //time is not the proper time for some reason - it is a random number between 0 and 50t.setBase(SystemClock.elapsedRealtime());t.start();</code></pre>","764272","Isaac Waller","764272","Isaac Waller","2009-09-10 14:46:06","2014-03-03 22:10:10","Android - Get time of chronometer widget","<android><time><widget><chronometer>","7","0","12","",""
"527216","1","","","2009-02-09 06:01:33","7","21173","<p>I try the following code to remove contact with a specified number:</p><pre><code>private void removeContact(Context context, String phone) {    //context.getContentResolver().delete(Contacts.Phones.CONTENT_URI, phone, null);    context.getContentResolver().delete(Contacts.Phones.CONTENT_URI,          Contacts.PhonesColumns.NUMBER+""=?"", new String[] {phone});}</code></pre><p>But I get this exception:</p><pre><code>java.lang.UnsupportedOperationException: Cannot delete that URL: content://contacts/phones    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:130)    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:110)    at android.content.ContentProviderProxy.delete(ContentProviderNative.java:362)    at android.content.ContentResolver.delete(ContentResolver.java:386)</code></pre><p>Can you please tell me how to fix my problem?</p><p>Thank you.</p>","60311","yinglcs","1450","EndangeredMassa","2009-05-25 18:02:24","2012-08-07 11:26:25","How to remove a contact programmatically in android","<android>","5","0","2","",""
"528589","1","","","2009-02-09 15:24:15","1","491","<p>Is there a TouchEvents DOM API for Android?I need to implement drag &amp; drop behavior.</p>","127878","vitaliy kotik","","","","2011-02-09 23:07:01","Android TouchEvents DOM API","<android><api><dom>","1","0","0","",""
"531324","1","531465","","2009-02-10 07:09:49","9","11319","<p>I am having an issue calculating distance using the Location.distanceTo method.</p><pre><code>private class MyLocationOverlay1 extends MyLocationOverlay {    @Override    public void drawMyLocation(Canvas canvas, MapView mapView, Location lastFix, GeoPoint myLocation, long when)             super.drawMyLocation(canvas,mapView,lastFix,myLocation,when);            Location bLocation = new Location(""reverseGeocoded"");            bLocation.setLatitude(FindList.gpslat);           // Value = 3.294391E7            bLocation.setLongitude(FindList.gpslong);         // Value = -9.6564615E7            Location aLocation = new Location(""reverseGeocoded"");            aLocation.setLatitude(myLocation.getLatitudeE6());   // Value = 3.2946164E7            aLocation.setLongitude(myLocation.getLongitudeE6()); // Value = -9.6505141E7            aLocation.set(aLocation);    // Don't think I need this               bLocation.set(bLocation);    // Don't think I need this either            int distance = (int)aLocation.distanceTo(bLocation);  // Value = 12637795 ???            String str = "" ("" + String.valueOf(distance) + "" meters)"";}}</code></pre><p>Can someone tell my why my distance calculation is showing 12,637,795 Meters?</p>","393258","Chrispix","","","","2014-01-20 15:57:46","Android : Location.distanceTo not working correctly?","<android><location><distance>","1","0","3","",""
"531427","1","","","2009-02-10 08:02:50","234","90764","<p>This must come up very often.</p><p>When the user is editing preferences in an Android app, I'd like them to be able to see the currently set value of the preference in the <code>Preference</code> summary.</p><p>Example: if I have a Preference setting for ""Discard old messages"" that specifies the number of days after which messages need to be cleaned up. In the <code>PreferenceActivity</code> I'd like the user to see:</p><p><em>""Discard old messages""</em> &lt;- title</p><p><em>""Clean up messages after <strong>x</strong> days""</em> &lt;- <a href=""http://code.google.com/android/reference/android/preference/Preference.html#setSummary(java.lang.CharSequence)"">summary</a> where <strong>x</strong> is the current Preference value </p><p>Extra credit: make this reusable, so I can easily apply it to all my preferences regardless of their type (so that it work with EditTextPreference, ListPreference etc. with minimal amount of coding).</p>","35112","nyenyec","114066","","2010-04-23 09:28:17","2014-03-13 22:13:10","How do I display the current value of an Android Preference in the Preference summary?","<android><gui><preferences>","19","0","176","",""
"531819","1","563507","","2009-02-10 10:47:19","4","29519","<p>I have created a custom icon bar in Android using the XML layout creator, using a RadioGroup within a LinearLayout (XML included below).  Each RadioButton within the RadioGroup has a custom drawable (with checked and unchecked states) as its <code>android:button</code> attribute.  </p><p>The Linear layout is itself within a <code>RelativeLayout</code> so that it can appear at an arbitrary position on the screen (as a side bar, in this instance).</p><p>The drawables are 55 pixels wide, and the <code>android:layout\_width</code> attribute of all these views is <code>wrap\_content</code>.</p><p>When I make this component visible, aligned to the bottom-left of the screen, only about three-quarters of the RadioButton image widths are visible.  Setting the <code>layout\_width</code> of the <code>RelativeLayout</code> to <code>fill\_parent</code>  rectifies this and causes the full button to appear.</p><p>However this means that the button group consumes click events across the entire width of the screen.</p><p>How can I make the entire button appear, and have only the area of the button respond to clicks?  Hard-coding the width of the drawable is not a particularly desirable solution.</p><pre><code>&lt;RelativeLayout android:id=""@+id/RelativeLayout01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:orientation=""vertical"" android:layout_alignParentBottom=""true"" android:layout_alignParentLeft=""true"" android:layout_below=""@+id/LinearLayout01"" android:visibility=""invisible""&gt;        &lt;RadioGroup android:id=""@+id/RadioGroup01"" android:layout_height=""wrap_content"" android:checkedButton=""@+id/RB01"" android:layout_width=""fill_parent""&gt;            &lt;RadioButton android:id=""@+id/RB01"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:button=""@drawable/DR01""/&gt;            &lt;RadioButton android:id=""@+id/RB02"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:button=""@drawable/DR02""/&gt;            &lt;RadioButton android:id=""@+id/RB03"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:button=""@drawable/DR03""/&gt;            &lt;RadioButton android:id=""@+id/RB04"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:button=""@drawable/DR04""/&gt;        &lt;/RadioGroup&gt;    &lt;/LinearLayout&gt;    &lt;/RelativeLayout&gt;</code></pre>","64505","","1544250","","2012-04-03 14:23:22","2012-04-28 03:54:55","How to size Android components according to image size using XML","<xml><android><layout>","2","0","4","",""
"540461","1","","","2009-02-12 08:17:26","1","34925","<p>Ok, I have been searching thick and thin, and I am having some issues implementing a BaseAdapter.</p><p>I have been able to implement a Simple Cursor Adapter <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List7.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List7.html</a> as per the example above.</p><p>There is a pretty good BaseAdapter example here : <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html"" rel=""nofollow"">List14 google example</a></p><p>I am wanting to create my own List Adapter using BaseAdapter to show a listView, with multiple items from a Database. I know this can be done using the Simple Cursor Adapter, but I am looking to handle rows differently, so I want to be able to draw each row by overriding getView. The data would be pulled from a cursor.</p><p>I know this code is ugly for getting to the cursor data, but assuming I have populated a cursor. What suggestions do you have on this if column 8 contains the image resource id. : </p><pre><code>@Override    public View getView(int position, View convertView, ViewGroup parent) {        // TODO Auto-generated method stub        cursor.moveToPosition(position);        ImageView i = new ImageView(mContext);        i.setImageResource(cursor.getShort(8));        i.setAdjustViewBounds(true);        i.setLayoutParams(new AbsListView.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));        return i;    }</code></pre><p>Do you have any good examples of a BaseAdapter being drawn using a cursor? </p>","393258","Chrispix","194309","","2011-12-01 08:31:22","2011-12-01 08:31:22","Android : BaseAdapter how to?","<android><listview><cursor><adapter>","1","2","5","",""
"541966","1","559781","","2009-02-12 15:59:00","820","320577","<p>I am using a <code>ListView</code> to display some images and captions associated with those images. I am getting the images from the Internet. Is there a way to lazy load the images so while the text displays, the UI is not locked up and images are displayed as they are downloaded? </p><p>The number of images is not fixed.</p>","46297","lostInTransit","63550","","2014-03-16 13:39:26","2014-04-04 12:35:07","How do I do a lazy load of images in ListView?","<java><android><image><url><android-listview>","26","6","840","",""
"548892","1","","","2009-02-14 10:25:59","38","52588","<p>I'm looking for tips, tricks and resources on optimizing a website design for Android's browser.</p><p>I'm building an Android app and some of the functionality will be accessible through a web interface.</p>","35112","nyenyec","2399024","","2014-03-01 13:01:47","2014-03-01 13:01:47","Tips for optimizing a website for Android's browser?","<android><html><css><design><mobile-website>","6","1","44","",""
"549451","1","560958","","2009-02-14 17:56:13","47","22354","<p>I'm trying to create an activity that presents some data to the user. The data is such that it can be divided into 'words', each being a widget, and sequence of 'words' would form the data ('sentence'?), the ViewGroup widget containing the words. As space required for all 'words' in a 'sentence' would exceed the available horizontal space on the display, I would like to wrap these 'sentences' as you would a normal piece of text.</p><p>The following code:</p><pre><code>public class WrapTest extends Activity {	/** Called when the activity is first created. */	@Override	public void onCreate(Bundle savedInstanceState) {		super.onCreate(savedInstanceState);		LinearLayout l = new LinearLayout(this);		LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(				LinearLayout.LayoutParams.FILL_PARENT,				LinearLayout.LayoutParams.WRAP_CONTENT);		LinearLayout.LayoutParams mlp = new LinearLayout.LayoutParams(				new ViewGroup.MarginLayoutParams(						LinearLayout.LayoutParams.WRAP_CONTENT,						LinearLayout.LayoutParams.WRAP_CONTENT));		mlp.setMargins(0, 0, 2, 0);		for (int i = 0; i &lt; 10; i++) {			TextView t = new TextView(this);			t.setText(""Hello"");			t.setBackgroundColor(Color.RED);			t.setSingleLine(true);			l.addView(t, mlp);		}		setContentView(l, lp);	}}</code></pre><p>yields something like the left picture, but I would want a layout presenting the same widgets like in the right one.</p><p><img src=""http://fnord.se/android/01-have.png"" alt=""non-wrapping"" /> <img src=""http://fnord.se/android/01-want.png"" alt=""wrapping"" /></p><p>Is there such a layout or combination of layouts and parameters, or do I have to implement my own ViewGroup for this?</p>","2010","Henrik Gustafsson","2010","Henrik Gustafsson","2009-02-14 20:57:32","2014-02-19 22:12:36","Line-breaking widget layout for Android","<java><android><gui><layout>","10","0","39","",""
"550905","1","551151","","2009-02-15 13:57:06","36","29379","<p>Just like the iPhone has a UIImagePickerController to let the user access pictures stored on the device, do we have a similar control in the Android SDK?</p><p>Thanks.</p>","46297","lostInTransit","","","","2013-10-10 12:49:10","Access pictures from Pictures app in my android app","<android>","3","1","30","",""
"551925","1","","","2009-02-16 00:33:50","4","418","<p>I am trying to setup a selector drawable in my asset file like this:* 2 different images for 'on'/'off' mode in rest mode (i.e. it doesnot has focus)* another 2 different images for 'on'/'off' mode in focus mode (i.e.it has the focus).</p><p>In my case, the 'rest' mode works, but the 'focus' mode does not.</p><p>Can you please tell me what am I missing in the focus mode? Thank you.</p><pre><code>&lt;!-- these 2 images works ---&gt;&lt;item android:state_checked=""false"" android:drawable=""@drawable/off"" /&gt;&lt;item android:state_checked=""true"" android:drawable=""@drawable/on"" /&gt;&lt;!-- these 2 images does not work --&gt; &lt;item android:state_focused=""true"" android:state_checked=""false""android:drawable=""@drawable/off_focus"" /&gt; &lt;item android:state_focused=""true"" android:state_checked=""true""android:drawable=""@drawable/on_focus"" /&gt;</code></pre>","60311","yinglcs","750613","yinglcs","2012-06-26 11:38:29","2012-06-26 11:38:29","How to specify different images when my custom widget has focus","<android><android-imageview>","1","1","1","",""
"552070","1","552380","","2009-02-16 02:26:21","33","31369","<p>I have an Android application in which I have my preferences in a xml file, which works fine.  I've now want to set one of the preferences using code instead of displaying the entire preference screen, how would I go about doing this?</p>","","stonedonkey","","","","2012-08-14 05:08:57","Android - How Do I Set A Preference In Code","<android>","2","0","14","",""
"552247","1","3654929","","2009-02-16 04:13:55","2","4018","<p>I am so confused when my list view using a BaseAdapter goes off the screen, each row no longer maintains a consecutive position. I don't know how else to explain it other than this.</p><p>If my BA/LV shows 4 items on the screen, and I add a view that displays a TextView of each row, it shows 0,1,2,3 for the row numbers (which is correct). But as soon as I scroll the list down to the bottom 4 items (items 5-8) it then shows those as 4,5,0,1?? Why?? I am so confused :/ I have tried doing all kinds of things (even some unconventional things, but this is the last thing I have that is not working). </p><p>** EDIT **I did discover that if I change <code>rv = (RowView) convertView</code>; to</p><pre><code>rv =  new RowView(mContext,(cursor.getString(2)),                        (cursor.getString(5)),                        cursor.getString(cursor.getColumnIndex(DBHelper.KEY_IMAGEFILENAME)),                        cursor.getString(cursor.getColumnIndex(DBHelper.KEY_CITY)),position);</code></pre><p>that it works, but then it is not re-using the code. So I guess I am on the right track. I did try some convenience methods, but that did not help me too much because I needed to set those values before the Constructor fired off. Do I need to create a new method and fire that at the end? Such as 'addRow' method? This also causes it to scroll VERY Slow.</p><pre><code>          @Override               public void onCreate(Bundle bundle)               {                 super.onCreate(bundle);                 //setContentView(R.layout.findlist);                 //getListView().setEmptyView(findViewById(R.id.empty));                 mDbHelper = new DBHelper(this);                 mDbHelper.open();                 cursor = mDbHelper.fetchAllLocations();                 startManagingCursor(cursor);                 mAdapter = new myListAdapter(this);                 setListAdapter(mAdapter);               }    public class myListAdapter extends BaseAdapter {            public String testing;            public myListAdapter(Context c) {                mContext = c;                // TODO Auto-generated constructor stub            }            @Override            public int getCount() {                // TODO Auto-generated method stub                return cursor.getCount();            }            @Override            public Object getItem(int position) {                // TODO Auto-generated method stub                return position;            }            @Override            public long getItemId(int position) {                // TODO Auto-generated method stub                return position;            }            @Override            public View getView(int position, View convertView, ViewGroup parent) {                 cursor.moveToPosition(position);                 RowView rv;                 if (convertView == null) {                        rv = new RowView(mContext,(cursor.getString(2)),                                (cursor.getString(5)),                                cursor.getString(cursor.getColumnIndex(DBHelper.KEY_IMAGEFILENAME)),                                cursor.getString(cursor.getColumnIndex(DBHelper.KEY_CITY)),position);                    } else {                        rv = (RowView) convertView;                        try {              // I KNOW THIS SECTION IS NOT RIGHT, BUT I HAVE BEEN MESSING IN HERE                                  rv.setAddress(cursor.getString(2));                        rv.setCity(cursor.getString(5));                        rv.setFocusable(true);                        rv.setClickable(true); }                        catch (Exception e) {                            rv = (RowView) convertView;                            rv.setAddress(cursor.getString(2));                            rv.setCity(cursor.getString(5));                            rv.setFocusable(true);                            rv.setClickable(true);                             Toast mToast;                            mToast = Toast.makeText(FindList.this, ""Error :"" + e.toString() ,                                    Toast.LENGTH_LONG);                            mToast.show();                        }                    }                 return rv;            }            public void addItems() {                 //String[] from = new String[] { DBHelper.KEY_BUSINESSNAME, DBHelper.KEY_ADDRESS, DBHelper.KEY_CITY, DBHelper.KEY_GPSLONG, DBHelper.KEY_GPSLAT,  DBHelper.KEY_IMAGEFILENAME  + """"};                 // create array of values of widgits                 //to = new int[] { R.id.businessname, R.id.address, R.id.city, R.id.gpslong, R.id.gpslat, R.id.preview};                 // Now create an array adapter and set it to display using our row from notes_row.xml            }        }private class RowView extends LinearLayout {        private TextView mAddress;        private TextView mCity;        public ImageView mArrow;        public ImageView mPicture;        public String mPathName;        public String mDateTime;        public RowView(Context context, String title, String words, String pathName, String city, int position) {            super(context);            this.setOrientation(HORIZONTAL);            this.setVerticalGravity(16); //CENTER_VERTICAL             // Here we build the child views in code. They could also have            // been specified in an XML file.            //DISPLAY DELETE BUTTON            Button mButton = new Button(context);            mButton.setFocusable(false);            mButton.setId(position);            mButton.setBackgroundResource(R.drawable.delete3);            addView(mButton, new LinearLayout.LayoutParams(                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));            TextView mTitle;            mTitle = new TextView(context);            mTitle.setText(Integer.toString(position));            addView(mTitle, new LinearLayout.LayoutParams(                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));            this.setOrientation(HORIZONTAL);                  try {             Bitmap bm = Bitmap.createScaledBitmap(BitmapFactory.decodeFile(cursor.getString(cursor.getColumnIndex(DBHelper.KEY_IMAGEFILENAME))),100, 100, true);                mPicture = new ImageView(context);                mPicture.setImageBitmap(bm);               } catch (Exception e) {                  mPicture = new ImageView(context);                 mPicture.setImageResource(R.drawable.noimage);           }                 addView(mPicture, new LinearLayout.LayoutParams(                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));            mArrow = new ImageView(context);            mArrow.setBackgroundResource(R.drawable.arrowleft3);            addView(mArrow, new LinearLayout.LayoutParams(                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));            currentPosition = position;            Button button = (Button)findViewById(position);            button.setOnClickListener(mCorkyListener);        }</code></pre>","393258","Chrispix","750613","Chrispix","2012-06-26 11:35:51","2012-06-26 11:35:51","Android BaseAdapter : position not really the position?","<android><listview><adapter><base>","1","0","","",""
"559405","1","571451","","2009-02-18 00:52:28","2","5273","<p>When you long press on something in Android, a context menu comes up. I want to add something to this context menu for all <code>TextViews</code> in the system. </p><p>For example, the system does this with Copy and Paste. I would want to add my own, and have it appear in every application. </p>","764272","Isaac Waller","34813","","2009-10-02 14:45:24","2009-10-02 14:45:24","Android add item to global context menu","<java><android><menu><contextmenu>","3","1","2","",""
"559902","1","560006","","2009-02-18 05:05:18","24","26802","<p>Thanks for any help.</p><p>I am trying to get a FileInputStream object on an image that the user selects from the picture gallery. This is the android URI returned by android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI</p><p>content://media/external/images/media/3</p><p>When I try to construct a java URI object from this object, I get an IllegalArgumentException with the exception description <strong>Expected file scheme in URI: content://media/external/images/media/3</strong> whereas the android URI shows the scheme as <strong>content</strong></p><p>Never found a solution for the original question. But if you want the byte stream of an image in the pictures gallery, this piece of code will do that.</p><pre><code>Bitmap bitmap = Media.getBitmap(getContentResolver(), imageUri);ByteArrayOutputStream bytes = new ByteArrayOutputStream();bitmap.compress(Bitmap.CompressFormat.JPEG, 40, bytes);ByteArrayInputStream fileInputStream = new ByteArrayInputStream(bytes.toByteArray());</code></pre>","46297","lostInTransit","46297","lostInTransit","2009-03-02 18:26:23","2013-09-19 18:43:31","Android- how can I convert android.net.Uri object to java.net.URI object?","<android>","5","0","6","",""
"560411","1","","","2009-02-18 09:46:21","3","12936","<p>I want to run the code for contacts as a separate application from eclipse (and modify)....Is there any way to download the source code?I've read that you can download it locally by using</p><p><code>git clone git://android.git.kernel.org/platform/packages/apps/Contacts.git</code></p><p>but I use windows XP...I've tried creating the folders in the exact way as they are given in this link below (same tree structure):</p><p><a href=""http://www.netmite.com/android/mydroid/packages/apps/Contacts/"" rel=""nofollow"">http://www.netmite.com/android/mydroid/packages/apps/Contacts/</a></p><p>but I got wayyy too many errors after importing it.</p>","","Apn","667810","","2012-06-09 21:37:32","2014-04-15 20:53:06","Application source code for contacts (android)","<android><windows-xp><source-code><contacts>","1","0","1","",""
"562267","1","2309541","","2009-02-18 18:24:25","1","2815","<p>The documentation at <a href=""http://code.google.com/android/reference/android/widget/AbsoluteLayout.html"" rel=""nofollow"">http://code.google.com/android/reference/android/widget/AbsoluteLayout.html</a> says:</p><pre><code>onLayout(boolean changed, int l, int t, int r, int b)//Called from layout when this view should assign a size and position to each of its children.</code></pre><p>So I overrode it like this:</p><pre><code>@Overrideprotected void onLayout(boolean changed, int l, int t, int r, int b) {	Log.d(""test"", ""In MainLayout.onLayout"");	int childCount = getChildCount();	for (int childIndex = 0; childIndex &lt; childCount; childIndex++) {		getChildAt(childIndex).setLayoutParams(new LayoutParams(100, 100, 100, 100));	}	super.onLayout(changed, l, t, r, b);}</code></pre><p>I am declaring the child elements (buttons) in the XML for the layout.</p><p>This correctly sets the position of the buttons but not the size.  The size is being taken from what is defined in the XML (it's a required attribute).</p>","55944","","55944","","2009-02-18 19:03:58","2010-09-23 13:06:24","How do I programmatically control the size of a child view in an Android AbsoluteLayout","<android><layout>","1","0","","",""
"568533","1","572010","","2009-02-20 06:36:37","6","9468","<p>In my Android application, I want a setting to be toggleable in it's menu like the Dialer app does for speaker and mute. You can see a picture below:  </p><p><img src=""http://www.isaacwaller.com/images/acall.png"" /></p><p>You see how the Speaker, Mute and Hold options are toggle buttons - you can tap them again and they will toggle the green color. They may do this in a custom way, but I suspect it is a option (I tried setting the Checkable attribute).</p>","764272","Isaac Waller","1777090","","2013-01-21 06:39:06","2013-08-23 11:06:04","Android MenuItem Toggle Button","<android><button><toggle><menuitem><togglebutton>","2","0","2","",""
"569830","1","570214","","2009-02-20 14:56:32","2","7240","<p>Got an activity that extends ListActivity.The list is backed up by a custom adapter that extends BaseAdapter.</p><pre><code>getListView().setFocusable(true);getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);</code></pre><p>I do a simple <code>(getSelectedItemPosition() == ListView.INVALID_POSITION)</code> check in <code>onPrepareOptionsMenu()</code> to disable the items that require an item to be selected.</p><p>Now, what I do after launching the activity (the action takes placeunder emulator, ver.1.1) an what it looks like:1) Hit menu - the menu items are disabled - OK2) Select an item with mouse wheel and hit menu - the items getenabled - OK3) Click anywhere outside the list, repeat 2). The items don't getenabled - WTF?4) Start from scratch, select an item hitting Del and moving mouse.The result is the same as for 3).</p><p>Why do these (3, 4) things keep happening to me? :)TIA. </p>","15187","gsmd","","","","2009-02-20 16:22:38","Strange ListView selection behavior on Android","<android><listview>","1","0","","",""
"571783","1","","","2009-02-21 00:33:07","3","15278","<p>First of all, Hi to everyone, I'm here just to ask something maybe very simple, I'm working with Files, <strong>FileOutputStream</strong> and <strong>FileInputStream</strong>, But I just want to get/set a few props from the file, I mean, the owner the file, the permissions read/write, etc.</p><p>Looking around I found the classes <strong>FileDescriptor</strong> and <strong>FilePermission</strong> but I don't have an idea of which I can use them, so I asking for some help about this; Actually I'm using the method <strong>setReadOnly()</strong> from the class <strong>File</strong> but that's now what I'm looking for.</p><p>Thank you all of you for your help. </p>","","c4r1o5","8954","DrJokepu","2009-02-21 01:12:14","2011-03-26 02:14:54","File permissions in Android","<java><android><permissions>","3","0","2","",""
"572053","1","572253","","2009-02-21 03:16:46","2","16506","<p>The context:I want to have a ListView that wouldn't receive focus (e.g. won'thighlight row when user touches it). Yet each row widget has it's ownOnClickListener.Here's what I specify in layout xml:</p><pre><code>android:choiceMode=""none"" android:focusableInTouchMode=""false""android:focusable=""false""</code></pre><p>The ListView still behaves exactly the same.Could someone please explain</p><ol><li>The interrelation between the three</li><li>What's the right way to create a ListView that doesn't receive focus?</li></ol><p>TIA. </p>","15187","gsmd","1675469","CQ","2014-04-05 09:36:03","2014-04-05 09:36:03","Focus control in a ListView","<android><listview><focus>","3","1","1","",""
"573581","1","2878825","","2009-02-21 19:11:18","16","36079","<p>I have two Android projects, a 'library project' containing a custom layout, and an 'application project' containing an application which uses the layout.</p><p>Everything seems to build and execute fine, except that the visual layout editor throws a ClassNotFoundException (which I assume is a bug in the plug-in), but when I try to start to make use of the attributes I defined for the custom layout in the xml, I can no longer build. That is; this works:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;se.fnord.android.layout.PredicateLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;   &lt;TextView    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""asdfasdf""    /&gt;&lt;/se.fnord.android.layout.PredicateLayout&gt;</code></pre><p>Whereas this does not:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;se.fnord.android.layout.PredicateLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    xmlns:fnord=""http://schemas.android.com/apk/res/se.fnord.android""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;   &lt;TextView    fnord:layout_horizontalSpacing=""1px""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""asdfasdf""    /&gt;&lt;/se.fnord.android.layout.PredicateLayout&gt;</code></pre><p>The build fails with a message from aapt:</p><blockquote>  <p>ERROR No resource identifier found for attribute 'layout_horizontalSpacing' in package 'se.fnord.android'</p></blockquote><p>The resource identifier does exist in the R-file and attrs.xml contained the library project, and if I put the layout code and resources directly in the application project everything works fine. The layout_horizontalSpacing attribute (and layout_verticalSpacing) is a custom attribute used in the PredicateLayout.LayoutParam class to specify the distance to the next widget.</p><p>So far I've tried the standard eclipse ways by specifying project references and build path project dependencies. I was also told to try the  tag in the application manifest, which did not help.</p><p>So, what do I need to do for the references in the xml-file to work?</p><p>I don't know if it's relevant, but the 'library' manifest looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""se.fnord.android""      android:versionCode=""1"" android:versionName=""1.0.0""&gt;&lt;/manifest&gt;</code></pre><p>The 'application' manifest like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""se.fnord.appname""      android:versionCode=""1"" android:versionName=""1.0.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".AppName""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt;</code></pre><p>(The 'PredicateLayout', btw, is a cleaned-up version of <a href=""http://stackoverflow.com/questions/549451"">this</a>).</p>","2010","Henrik Gustafsson","2010","Henrik Gustafsson","2009-02-22 00:15:18","2013-11-27 08:11:00","Specifying Android project dependencies (in Eclipse)","<android><eclipse><dependencies>","5","1","6","",""
"574195","1","","","2009-02-22 02:37:17","46","90792","<p>I have created a app where you can download YouTube videos for android. Now, I want it so that if you play a video in the YouTube native app you can download it too. To do this, I need to know the Intent that the YouTube native app puts out in order to play the YouTube app.<br>I could do this easially if I had the YouTube program on my emulator, so my 1st question is:<br>1. Can I download the YouTube app for my emulator, or...<br>2. What is the intent used when the user selects a video for playback.</p>","764272","Isaac Waller","114066","","2010-09-29 13:26:13","2014-02-10 12:05:30","Android YouTube app Play Video Intent","<android><youtube><android-intent><emulator>","13","0","38","",""
"576513","1","576562","","2009-02-23 04:18:33","51","48490","<p><br>I am having problems downloading a binary file (video) in my app from the internet. In Quicktime, If I download it directly it works fine but through my app somehow it get's messed up (even though they look exactly the same in a text editor). Here is a example:</p><pre><code>    URL u = new URL(""http://www.path.to/a.mp4?video"");    HttpURLConnection c = (HttpURLConnection) u.openConnection();    c.setRequestMethod(""GET"");    c.setDoOutput(true);    c.connect();    FileOutputStream f = new FileOutputStream(new File(root,""Video.mp4""));    InputStream in = c.getInputStream();    byte[] buffer = new byte[1024];    int len1 = 0;    while ( (len1 = in.read(buffer)) &gt; 0 ) {         f.write(buffer);    }    f.close();</code></pre>","764272","Isaac Waller","764272","","2009-12-31 01:19:31","2013-07-09 07:45:24","Android download binary file problems","<java><android><download><httpurlconnection><fileoutputstream>","6","0","41","",""
"576600","1","6501436","","2009-02-23 05:23:52","3","7017","<p>My android application requires a password to be entered in the first activity. I want to be able to automatically send the application back to the password entry screen after the application has been idle for a fixed amount of time.</p><p>The application has multiple activities, but I would like the timeout to be global for all activities. So, it wouldn't be sufficient to create a timer thread in the <code>onPause()</code> method of an <code>Activity</code>.</p><p>I'm not sure what the best definition for the application being idle is, but no activities being active would be sufficient.</p>","38129","Brian Pellin","592025","","2012-10-17 10:07:17","2012-10-17 10:07:17","Lock android app after a certain amount of idle time","<android>","3","0","4","",""
"582185","1","582585","","2009-02-24 15:29:25","334","190802","<p>How can I disable landscape mode for some of the views in my Android app?</p>","46297","lostInTransit","143979","","2010-11-25 16:36:02","2014-01-26 09:30:04","Android - disable landscape mode?","<android><orientation><android-manifest>","14","1","61","",""
"584779","1","584799","","2009-02-25 05:10:28","12","41550","<p>I am using Intents to switch between activities in my Android app. I am putting data in the Intent for use in the next activity. When I switch the phone between landscape and portrait modes, the values passed from the intent are lost and I get a NullPointerException.</p><p>Can someone please tell me what could be wrong.</p><p>There's a lot of code to post it entirely. But if someone needs to look at specific parts of code, I can post it here.</p><p><strong>Edit</strong><br/>I solved the issue of state not being saved. But another problem I faced is that none of the buttons on the screen work after the orientation has been changed. On button press, I get this warning in LogCat</p><pre><code>02-25 23:07:49.190: WARN/WindowManager(58): No window to dispatch pointer action 0</code></pre><p>Please help.</p>","46297","lostInTransit","2559445","lostInTransit","2013-07-08 05:49:55","2013-07-08 05:49:55","Android - switching between landscape and portrait mode makes Intent lose values","<android><android-orientation><landscape-portrait>","5","0","8","",""
"587185","1","605453","","2009-02-25 18:16:54","4","2726","<p>The web-site I'm working on is specially designed for Android. The user will not get benefit from Android build-in zoom buttons. On the contrary they make a mess.How can I switch them off?</p>","127878","vitaliy kotik","1403801","","2012-09-29 12:58:24","2012-09-29 12:58:24","zoom buttons in android's web browser","<android><website>","1","2","1","",""
"587454","1","","","2009-02-25 19:28:22","1","719","<p>I need to display an image by specifying the file name instead of by using resource. E.g <code>showImage(""background.png"")</code> instead of <code>showImage(R.drawable.background)</code>.</p><p>Any one knows how?</p><p>Thanks a lot.</p>","","Irwansyah","472270","","2011-10-07 06:11:53","2011-10-07 06:11:53","Displaying Image by File Name","<android><imageview>","1","0","","",""
"587917","1","1279574","","2009-02-25 21:23:04","51","49304","<p>I am trying to launch an Intent to send an email. All of that works, but when I try to actually send the email a couple 'weird' things happen.</p><p>here is code </p><pre><code>            Intent sendIntent = new Intent(Intent.ACTION_SEND);          	sendIntent.setType(""image/jpeg"");        	sendIntent.putExtra(Intent.EXTRA_SUBJECT, ""Photo"");        	sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(""file://sdcard/dcim/Camera/filename.jpg""));        	sendIntent.putExtra(Intent.EXTRA_TEXT, ""Enjoy the photo"");        	startActivity(Intent.createChooser(sendIntent, ""Email:""));</code></pre><p>So if I launch using the Gmail menu context It shows the attachment, lets me type who the email is to, and edit the body &amp; subject. No big deal. I hit send, and it sends. The only thing is the attachment does NOT get sent.</p><p>So. I figured, why not try it w/ the Email menu context (for my backup email account on my phone). It shows the attachment, but no text at all in the body or subject. When I send it, the attachment sends correctly. That would lead me to believe something is quite wrong. Do I need a new permission in the Manifest launch an intent to send email w/ attachment? What am I doing wrong?</p>","393258","Chrispix","","","","2013-06-18 14:16:53","Trying to attach a file from SD Card to email","<android><email><attachment><android-intent>","9","1","34","",""
"588454","1","599808","","2009-02-25 23:45:32","4","2680","<p>I'm trying to convert window coordinates to object coordinates. There's a gluUnProject in GLU class, which requires current modelview, projection matrices and viewport. </p><p>My question is how to get those matrices?  I tried gl.glGetIntegerv (GL11.GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES, model, 0); and ((GL11) gl).glGetFloatv(GL11.GL_MODELVIEW_MATRIX, modelf, 0); but the first one returns an array of zeros, and the other one just shows an ""method not implemented"" error. </p><p>Is gluUnProject the correct method for this purpose (i.e. window coordinates --> object coordinates) ?</p>","71133","focuser","","","","2010-09-18 02:47:50","Open GL ES on Android: how to use gluUnProject?","<android><opengl-es>","2","0","","",""
"588876","1","588889","","2009-02-26 02:37:49","3","2162","<p>In my Android program, I have some code that downloads a file. This works fine, but since on a cell phone, you can be disconnected at any time, I need to change it do it reconnects and resumes the download when you are halfway through and somebody calls/you lose cell reception/etc. I cannot figure out how to detect the InputStream has stopped working. See the code below:</p><pre><code>InputStream in = c.getInputStream();    byte[] buffer = new byte[8024];    int len1 = 0;    while ( (len1 = in.read(buffer)) &gt; 0 ) {        Log(""-""+len1+""- Downloaded."");        f.write(buffer,0, len1);        Thread.sleep(50);    }</code></pre><p>When I lose internet connection, My log shows:</p><pre><code>Log: -8024- Downloaded.Log: -8024- Downloaded.Log: -8024- Downloaded.Log: -8024- Downloaded.Log: -6024- Downloaded. (some lower number)</code></pre><p>And then my program just hangs on the while( (len1 = etc. I need to make it so when the internet gets disconnected I wait for the internet to be connected again and then resume the download.</p>","764272","Isaac Waller","1777090","","2013-01-21 06:38:34","2013-01-21 06:38:34","Android InputStream Internet Disconnect","<java><android><http><inputstream><disconnect>","1","0","3","",""
"595301","1","595344","","2009-02-27 15:49:30","3","7027","<p>In an app with a small number of POJOs and lots of helper methods that operate on them, what's better performance-wise: to make the helper classes singletons or to make the methods static?</p>","15187","gsmd","13633","Kendrick Wilson","2009-02-27 15:53:05","2009-02-27 16:14:01","Static methods or Singletons performance-wise (Android)?","<java><android><performance><singleton><static-methods>","4","0","1","",""
"598771","1","630312","","2009-02-28 22:08:00","2","2359","<p>In my program, it gets MP4 video in, and I want it to output a MP3 (without any server-side stuff.) Since Android (and my app) needs to run on many different hardware configurations, this means I probably cannot use FFMPEG. I know this may be very battery and processing power intensive, especially for a mobile phone, but I need this option for my users.  I cannot find any native libraries for Java that don't use FFMPEG. </p>","764272","Isaac Waller","3330969","","2014-03-20 02:52:26","2014-03-20 02:52:26","Android Strip Audio From Video","<android><audio><video><video-processing><strip>","3","0","1","",""
"599324","1","","","2009-03-01 05:46:30","3","4236","<p>My EditText hint is not wrapping. A hint isn't very useful if the last part is cut off.  I am very cautious about restricting/forcing the dimensions my EditText box to ensure it looks decent regardless of screen dimensions. </p><p>Here's what the relevant xml looks like:</p><pre><code>&lt;EditText android:id=""@+id/ET1""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:gravity=""left""    android:hint=""@string/Hint1""     android:lines=""3""&gt;&lt;/EditText&gt;</code></pre><p>I've already set <code>android:lines=""3""</code> to mitigate the issue, but it isn't enough.  In order to maximize compatibility with various screen dimensions I would prefer OS wrapping over me putting in line breaks and hard returns in the string.  There are other things happening in the view which also compel me to not manually set the width of the box to promote good breaks.</p>","53498","Will","3330969","","2014-03-19 13:31:20","2014-03-19 13:31:20","How to make a hint wrap in an Android EditText?","<android><android-edittext>","1","0","","",""
"599443","1","","","2009-03-01 07:37:55","32","29720","<p>I am developing an application where one of the things we need is to control the outgoing call, at least to be able to stop it from our application. </p><p>I've tried using <code>Intent.ACTION_CALL</code> from an existing activity:</p><pre><code>Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse(""tel:"" + phoneNumber)); startActivity(callIntent); </code></pre><p>But stopping the call seems to be disallowed through the API.</p><p>Can you suggest some workaround?</p><p>For example: enabling airplane mode during the call? Just an example; this hack didn't work for me.</p>","72415","Tilek","3330969","","2014-03-19 13:33:20","2014-03-19 13:33:20","How to hang up outgoing call in Android?","<android><telephony><telephonymanager>","7","2","27","",""
"600207","1","608600","","2009-03-01 18:09:09","268","123234","<p>How do I check if a background service (on Android) is running? I want an android activity that toggles the state of the service -- lets me turn it on if it is off and off if it is on.</p>","58164","Bee","3330969","","2014-03-19 13:28:59","2014-03-27 08:35:23","How to check if a service is running in android?","<android><android-service>","14","1","128","",""
"601294","1","661072","","2009-03-02 04:43:02","8","8021","<p><br />In my program it adds a shortcut to the screen. I get the icon on the screen fine, but when I tap it, I get:</p><pre><code>03-01 20:00:29.410: ERROR/AndroidRuntime(796): java.lang.SecurityException: Permission Denial: starting Intent { data=http://www.example.com/ flags=0x14000000 comp={com.isaacwaller.example/com.isaacwaller.example.ExampleCut} } from ProcessRecord{435c7398 796:android.process.acore/10005} (pid=796, uid=10005) requires null</code></pre><p>Do you know the problem? Thanks,<br />Isaac</p>","764272","Isaac Waller","","","","2011-12-12 11:11:00","Android homescreen shortcut permission error","<java><android><shortcut><permissions><homescreen>","5","0","1","",""
"601503","1","","","2009-03-02 07:17:27","355","113245","<p>How can I get crash data (stack traces at least) from my Android application? At least when working on my own device being retrieved by cable, but ideally from any instance of my application running on the wild so that I can improve it and make it more solid.</p>","6068","J. Pablo Fern&#225;ndez","6068","","2010-10-01 09:13:32","2014-01-11 00:31:07","How do I obtain crash-data from my Android application?","<android><crash><stack-trace>","22","4","281","","2010-10-01 09:13:32"
"604535","1","631944","","2009-03-02 23:43:29","4","4928","<p>I'm wondering if, with the G1, it's possible to force the network traffic to pass through the Wifi or through the Cell GSM network.  I need to force an application to connect through the tower network to get some login information.  Is this possible?  Anyone have any ideas as to how this would be possible?  I'm trying to accomplish this inside an app with the Android SDK (Sorry I wasn't more clear about that originally)</p>","62516","","62516","","2009-03-03 20:38:08","2009-03-10 19:39:34","Is it possible to force network traffic through Wifi or the TMobile network?","<android><networking><gsm><wifi>","3","0","1","",""
"605325","1","617716","","2009-03-03 06:21:07","24","12260","<p>Where are the schemas (DTD or XML schema) for the XML files used on Android like AndroidManifest.xml or the layouts?</p>","6068","J. Pablo Fern&#225;ndez","","","","2012-11-21 12:45:17","Where are the schemas for XML files on an Android project?","<xml><android><schema><dtd>","3","0","3","",""
"606694","1","606745","","2009-03-03 14:55:58","4","7902","<p>Is it possible to specify a different image when the user's focus comes to an ImageButton? I want to display an image button on a LinearLayout and change the image when the user's focus comes on the button or when the user presses the button.</p><p>Thanks.</p>","46297","lostInTransit","","","","2012-07-20 12:53:22","Android - different image for rollover on ImageButton","<android><imagebutton>","2","0","1","",""
"607610","1","613510","","2009-03-03 18:45:19","14","10870","<p>With <code>Android SDK 1.1 r1</code>, is there any way to change the <code>RatingBar</code> widget class's star image with my own? Is this possible at all? If so, then how? </p><p>Thanks.</p>","69117","Chang Chung","750613","","2012-06-30 11:34:49","2014-02-23 04:49:49","How to change the star images of the RatingBar?","<android><ratingbar>","2","0","8","",""
"607721","1","","","2009-03-03 19:12:18","6","15280","<p>I have two questions regarding native C/C++ on Android platforms:</p><ol><li><p>Is it possible for device manufactures to develop native C++ applications on an Android platform?</p></li><li><p>How can I develop my own native C++ application / library that has an upper layer Java front-end / API on an Android platform?</p></li></ol>","2425000","","510036","","2013-02-11 13:32:46","2013-02-11 13:32:46","Native C/C++ code on an Android platform","<c++><android><native>","7","0","1","",""
"620779","1","731878","","2009-03-06 22:55:55","3","1418","<p>Can anyone tell me the difference in how an application is delivered and installed to an android G1 phone when it is downloaded from Market vs downloaded from my webserver?</p><p>This little test app: </p><p><a href=""http://yootles.com/outbox/TallyBee.apk"" rel=""nofollow"">http://yootles.com/outbox/TallyBee.apk</a> (keeps a simple count) </p><p>Installs on my (unhacked) G1, but fails to install on two friends' (hacked) G1s when they download from me -- it thinks that the package conflicts with/wants to overwrite Android System -- but installs fine when they download it (the same .apk) from Market.</p><ul><li>There are no problems with pushing the .apk to the phones with adb.</li><li>Yes, they both have set their phones to allow ""unknown sources"" in Application Settings.</li><li>I want to get the install working from my server in order to expedite testing.</li></ul>","58164","Bee","126014","dreeves","2009-06-29 21:42:16","2009-06-29 21:42:16","android: install fails on hacked phones","<android><mobile>","2","2","2","",""
"621216","1","670218","","2009-03-07 03:01:59","2","2064","<p><br />My app needs to have a intent-filter that responds to a intent that has it's component set (a explicit intent.) Here is a example.  </p><pre><code>Intent i = new Intent();i.setClassName(""com.compareeverywhere"",""com.compareeverywhere.ScanActivity"");startActivity(i);</code></pre><p>Just a simple intent-filter will not do - because the intent is made for a specific component (activity,) it just launches that without looking for intents at all. Is there a way to do this?<br />Thanks, Isaac Waller<br />P.S: Please don't reply ""No.""</p>","764272","Isaac Waller","764272","Isaac Waller","2009-03-08 16:42:19","2009-03-21 23:32:48","Android Override Explicit Intent","<android><override><activity><android-intent><explicit>","1","1","","",""
"622710","1","622719","","2009-03-07 23:20:33","3","1563","<p>Is it possible to have Android running on <code>x86</code> computers?</p>","49628","mixedpickles","750613","David Pokluda","2012-06-30 11:32:59","2012-06-30 11:32:59","Android: Is there a PC port?","<android><operating-system><x86>","3","0","","",""
"623225","1","623399","","2009-03-08 07:30:37","18","29696","<p>I want to open the Settings-> Sound &amp; Display-> Phone Ringtones screen from my application. How can I do that?</p><p>Thanks.</p>","46297","lostInTransit","","","","2013-03-05 13:48:07","android - go to settings screen","<android>","2","0","9","",""
"623533","1","","","2009-03-08 12:55:37","12","32934","<p>I would like to develop an application for Android which would transfer data through TCP connection.</p><p>Does anyone know for any good example or book where client-server connection example could be found?</p><p>I'm quite new with Java and Android so I would be very thankful for any suggestion.</p>","22996","niko","","","","2013-05-11 12:49:57","Android (Java) network programming resources","<java><android><network-programming>","2","0","4","",""
"628659","1","674207","","2009-03-10 01:54:07","28","23350","<p>I have an app that plays intermittent sounds while its activity is open, and the user is always expecting it to make these noises, but unfortunately it is constrained by the music stream volume. The options I have discovered are thus:</p><ol><li>Adjust the music stream's volume, possibly deafening the user if they happen to be playing music at the time.</li><li>Call MediaPlayer.setVolume() which is ineffective if the music stream's volume is 0.</li><li>Handle volume button presses myself which presents two issues: volume button presses adjust the ringer volume unless my audio is playing, and I have been as of yet unable to catch the onKey event for a volume button press using my OnKeyListener. If there were some way to force the adjustment to apply to the music stream while my activity has focus, or to just catch the button presses myself this would work.</li><li>Play a silent looping piece of audio in the background to keep the music stream in context for volume adjustments.</li></ol><p>I think the 3rd option is probably best since it cedes control of the volume to the user, but if there were some way to just override the system volume in a single mediaplayer instance that would work too.</p>","327","Luke","327","Luke","2009-03-10 02:10:39","2011-12-07 12:45:17","How can I manage audio volumes sanely in my Android app?","<android>","3","1","25","",""
"631238","1","","","2009-03-10 16:54:17","10","22653","<p>I'm trying to get a vertical seekbar going with the emulator, but I'msort of stuck.  I can get the seekbar to display the way I want it to,and I can get the progress to do what I want, and I can modify theonTouchEvent to get the thumb to go vertically instead ofhorizontally.  What I can't do is get the thumb to move outside of thedefault 29 horizontal pixels without using setThumbOffset().  This initself isn't a problem.  The problem is coming from the fact that Idon't understand the thumbOffset at all -- I guess.  I think I could (properly) resize thewidget, which I am pretty sure I'm not doing right.  Or maybe I couldjust use the thumbOffset if I could figure it out.  Since I cancalculate the progress correctly I thought I would just use a linearfunction of progress * (getTop() - getBottom()) of the widget but thatdoesn't seem to do it.  But I can't figure out what the offset iscentered around.</p><p>As a somewhat aside, I am really unsure if what I am doing inonSizeChanged() is sane or if it's going to bite me in the ass lateron.</p><p>Here's the main.xml layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;com.mobilsemantic.mobipoll.SlideBar        android:id=""@+id/slide""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:max=""100""        android:progress=""0""        android:secondaryProgress=""25"" /&gt;        &lt;Button android:id=""@+id/button""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:text=""Hello, I am a Button"" /&gt;    &lt;TextView android:id=""@+id/tracking""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>And the class (ignore the debugging junk):</p><pre><code>import android.content.Context;import android.graphics.Canvas;import android.util.AttributeSet;import android.util.Log;import android.view.MotionEvent;import android.view.View;import android.widget.SeekBar;public class SlideBar extends SeekBar {        private int oHeight = 320, oWidth = 29;        private int oProgress = -1, oOffset = -1;;        private float xPos = -1, yPos = -1;        private int top = -1, bottom = -1, left = -1, right = -1;        public SlideBar(Context context) {                super(context);        }        public SlideBar(Context context, AttributeSet attrs)        {                super(context, attrs);                oOffset = this.getThumbOffset();                oProgress = this.getProgress();        }        public SlideBar(Context context, AttributeSet attrs, int defStyle)        {                super(context, attrs, defStyle);        }        protected synchronized void onMeasure(int widthMeasureSpec, intheightMeasureSpec)        {                int height = View.MeasureSpec.getSize(heightMeasureSpec);                oHeight = height;                this.setMeasuredDimension(oWidth, oHeight);        }        protected void onSizeChanged(int w, int h, int oldw, int oldh)        {                super.onSizeChanged(h, w, oldw, oldh);        }        protected void onLayout(boolean changed, int l, int t, int r, int b)        {                super.onLayout(changed, l, t, r, b);                left = l;                right = r;                top = t;                bottom = b;        }        protected void onDraw(Canvas c)        {                c.rotate(90);                c.translate(0,-29);                super.onDraw(c);        }        public boolean onTouchEvent(MotionEvent event)        {                xPos = event.getX();                yPos = event.getY();                float progress = (yPos-this.getTop())/(this.getBottom()-this.getTop());                oOffset = this.getThumbOffset();                oProgress = this.getProgress();                Log.d(""offset"" + System.nanoTime(), new Integer(oOffset).toString());                Log.d(""progress"" + System.nanoTime(), new Integer(oProgress).toString());                float offset;                offset = progress * (this.getBottom()-this.getTop());                this.setThumbOffset((int)offset);                Log.d(""offset_postsetprogress"" + System.nanoTime(), new Integer(oOffset).toString());                Log.d(""progress_postsetprogress"" + System.nanoTime(), new Integer(oProgress).toString());                this.setProgress((int)(100*event.getY()/this.getBottom()));                return true;        }}</code></pre>","52115","nderraugh","","","","2012-10-05 18:39:40","Modifying the Android seekbar widget to operate vertically","<android><layout><widget><seekbar>","4","0","9","",""
"642076","1","","","2009-03-13 10:20:17","21","25824","<p>I have written the below code for sending SMS messages.</p><pre><code>SmsManager smsManager = SmsManager.getDefault();smsManager.sendTextMessage(destAddr, null, mMessageText, il, null);</code></pre><p>But this is not updating in my Inbox, I need to save the same message in Inbox,Or is there any way to invoke a native SMS application to send SMS ? </p>","","Senthil","703019","&#211;lafur Waage","2012-03-04 01:28:01","2014-04-05 05:23:55","How to save SMS to inbox in android?","<android><sms>","5","2","17","",""
"642974","1","643106","","2009-03-13 14:31:15","3","6019","<p>I want to work on some <a href=""http://source.android.com/"" rel=""nofollow"">Android</a> code together with others and need to set up repository to be used locally within the team. However, it seems like <code>repo</code> doesn't let me do that. And neither does cloning a git repository in the android repo like this:</p><pre><code>$ git clone /var/android/.repo/projects/bionic.git/</code></pre><p>I get the following error message:</p><pre><code>Initialized empty Git repository in /home/user/mydroid/bionic/.git/0 blocksWarning: Remote HEAD refers to nonexistent ref, unable to checkout.</code></pre><p>Has anyone tried successfully to work on a git repository in Android together with others without having to send to the Android project itself?</p><p><hr /></p><p>I've also tried to do the following, I've initiated a client at a shared computer and locally in my computer like this:</p><pre><code>$ repo init -u git://android.git.kernel.org/platform/manifest.git</code></pre><p>I also tried to add a remote for a seperate project (e.g. bionic) to the shared computer like this, but get an error:</p><pre><code>$ git clone /initech/android/bionicfatal: cannot clone empty repository</code></pre><p>I also try to do it like this:</p><pre><code>$ git clone /initech/android/.repo/projects/bionic.git/Initialized empty Git repository in /home/user/mydroid/bionic/.git/0 blocksWarning: Remote HEAD refers to nonexistent ref, unable to checkout.</code></pre><p>It finds a git repository, clones it, but can't find any references to checkout even if there is a topic branch in the remote. What gives?</p>","3713","Spoike","3713","Spoike","2009-03-13 18:43:13","2009-03-13 18:43:13","How do I share code via git with others having the Android repo?","<git><android><repository>","2","0","1","",""
"644469","1","694426","","2009-03-13 20:17:11","7","6676","<p>I've tried to debug the android applications on emulator and than on the device as well but all the time I get the message ""Wait for debugger - waiting for the debugger to attach to the process"".</p><p>I really don't know how to set the environment and the application in order to run the debug.</p><p>I Would really appreciate if anyone of you could provide any useful tips.</p>","22996","niko","73488","zweiterlinde","2010-11-03 09:23:49","2010-11-03 09:23:49","Can't Debug Android Applications","<android><debugging>","2","6","3","",""
"647112","1","","","2009-03-15 02:05:13","7","439","<p>I'm working on my first video game for the Android platform as a bit of a nights and weekends project.</p><p>It is coming along nicely, but I am very unhappy with the control sensativity.</p><p>In this game, you move an object left and right on the screen. On the bottom of the screen is a ""touchpad"" of sorts, which is where your finger should rest.</p><pre><code>/-------------------------\|                         ||                         ||                         ||       Game Area         ||                         ||                         ||                         ||                         ||                         |/-------------------------\|                         ||       Touch Area        ||                         |\-------------------------/</code></pre><p>I am currently using a state variable to hold ""MOVING_LEFT, MOVING_RIGHT, NOT_MOVING"" and am updating the location of the player object each frame based on that variable.</p><p>However, my code that reads the touchscreen input and sets this state variable is either too sensative, or too laggy, depending on how I tweak it:</p><pre><code>public void doTouch (MotionEvent e) {	int action = e.getAction();	if (action == MotionEvent.ACTION_DOWN) {		this.mTouchX = (int)e.getX();		this.mTouchY = (int)e.getY();				} 	else if (action == MotionEvent.ACTION_MOVE) {		if ((int)e.getX() &gt;= this.mTouchX) {			this.mTouchX = (int)e.getX();			this.mTouchY = (int)e.getY();				if (this.TouchRect.contains(this.mTouchX, this.mTouchY)) {								this.mTouchDirection = MOVING_RIGHT;			}		} 		else if ((int)e.getX() &lt;= this.mTouchX) {			this.mTouchX = (int)e.getX();			this.mTouchY = (int)e.getY();			if (this.TouchRect.contains(this.mTouchX, this.mTouchY)) {								this.mTouchDirection = MOVING_LEFT;			}		}		else {			this.mTouchDirection = NOT_MOVING;		}					} 	else if (action == MotionEvent.ACTION_UP) {		this.mTouchDirection = NOT_MOVING;	}		}</code></pre><p>The idea is that when there is any movement, I check the previous location of the users finger and then figure out what direction to move the player. </p><p>This doesn't work very well, I figure there are some IPhone/Android developers on here who have figured out how to do good controls via a touchscreen and can give some advice.</p>","1965","FlySwat","","","","2009-03-15 02:55:30","Using TouchScreens for game control","<iphone><android><user-interface><touchscreen>","2","2","3","",""
"649057","1","649164","","2009-03-16 02:22:39","8","24607","<p>For my application, I'd been using my own Camera class for taking images and my own database but soon enough I couldn't really keep up with changes and I decided to use the built in camera application in Android to do the job, but I can't seem to get it to save file. What am I missing here? The application seems to save the file but it's just 0 bytes. I looked up the source code of the Camera application and it's looking for the ""output"" in Extras to save the file. Any help would be greatly appreciated.</p><pre><code>Public class CameraTest extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button cameraButton = (Button) findViewById(R.id.cameraButton);        cameraButton.setOnClickListener( new OnClickListener(){            public void onClick(View v ){            	ContentValues values = new ContentValues();            	values.put(Images.Media.TITLE, ""title"");            	values.put(Images.Media.BUCKET_ID, ""test"");            	values.put(Images.Media.DESCRIPTION, ""test Image taken"");            	Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);            	Intent intent = new Intent(""android.media.action.IMAGE_CAPTURE"");            	intent.putExtra(""output"", uri.getPath());            	startActivityForResult(intent,0);            }        });    }    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {    	if (requestCode== 0 &amp;&amp; resultCode == Activity.RESULT_OK){    		((ImageView)findViewById(R.id.pictureView)).setImageURI(data.getData());    	}    }}</code></pre>","18501","pvsnp","","","","2011-09-01 21:20:45","How do I save data from Camera to disk using MediaStore on Android?","<android><camera><android-intent><mediastore>","5","0","10","",""
"649154","1","673014","","2009-03-16 03:26:06","156","168023","<p>I am working on a function to download an image from a web server, display it on the screen, and if the user wishes to keep the image, save it on the SD card in a certain folder. Is there an easy way to take a bitmap and just save it to the SD card in a folder of my choice?</p><p>My issue is that I can download the image, display it on screen as a Bitmap. The only way I have been able to find to save an image to a particular folder is to use FileOutputStream, but that requires a byte array. I am not sure how to convert (if this is even the right way) from Bitmap to byte array, so I can use a FileOutputStream to write the data.</p><p>The other option I have is to use MediaStore :</p><pre><code>MediaStore.Images.Media.insertImage(getContentResolver(), bm,    barcodeNumber + "".jpg Card Image"", barcodeNumber + "".jpg Card Image"");</code></pre><p>Which works fine to save to SD card, but does not allow you to customize the folder.</p>","393258","Chrispix","436938","","2013-03-13 16:32:08","2014-02-26 07:23:27","Save bitmap to location","<android><bitmap><save>","9","1","62","",""
"651175","1","652201","","2009-03-16 16:33:09","3","353","<p>I am trying to add ringtones to the media/ringtones folder from my application. If the phone is connected via USB to a computer or mounted on my Mac, the ringtones do not show up in the SD Card, nor in the Ringtone settings.</p><p>But if I run the application with the USB unplugged, the ringtones appear ok. This is not a problem with Ringdroid which does the same thing.</p><p>Can someone please tell me what could be wrong.</p>","46297","lostInTransit","","","","2009-11-01 10:00:31","Android - inconsistent ringtone behavior","<android>","2","0","1","",""
"651733","1","","","2009-03-16 19:03:11","13","25785","<ol><li>I like that my GUI appears immediately when the user starts the app.</li><li>Then some data (<code>text, pictures</code>) gets loaded in the background (<code>like YouTube app</code>).</li><li>The ListView and Gallery gets updated automatically with this new data.</li></ol><p>I initiate my ListView, start a Thread and load the data... and then the ListView does not get updated!Several people told me I should use <code>notifyDataSetChanged()</code>.But I cannot place this command in my Thread (just unknown).</p><p>Any ideas? It can't be so hard, but I am going crazy.. I will give you my source code if needed.</p>","","","750613","","2012-06-30 11:31:03","2012-06-30 11:31:03","Android: Update Listview after Thread loads data from the net","<android><listview>","3","0","9","",""
"652888","1","659131","","2009-03-17 02:58:14","2","1891","<p>I have created a multithreaded application but it still hangs if the server is unavailable.</p><p>In the main Activity I've created the following methods:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    //bind GUI elements    ...    //start TCPConnection Service in a new thread    establishTCPConnection();    ...}private void establishTCPConnection(){    TCPClientServiceThread = new Thread(null, backgroundConnection, ""connection"");    TCPClientServiceThread.start();}..private Runnable backgroundConnection = new Runnable(){    public void run(){        //establish TCP connection        doEstablishTCPConnection();    }};private void doEstablishTCPConnection(){    //start TCPConnection service    startService(new Intent(this, TCPClientService.class));}</code></pre><p>And this is the TCPClientService Class:</p><pre><code>public class TCPClientService extends Service{...private String serverAddress = ""192.168.1.5"";private int portNumber = 1000;@Overridepublic void onCreate(){    //TODO: Actions to perform when service is created    connectionAvailable = false;    IntentFilter dataReceiverFilter;    dataReceiverFilter = new IntentFilter(MotranetClient.MOTION_DATA_UPDATED);    dataReceiver = new DataReceiver();    registerReceiver(dataReceiver, dataReceiverFilter);    EstablishConnection();}@Overridepublic IBinder onBind(Intent intent){    //TODO: Replace with service binding implementation    return null;}private void EstablishConnection(){    try {           InetAddress serverAddr = InetAddress.getByName(serverAddress);           Log.d(""TCP"", ""C: Connecting..."");           Socket socket = new Socket(serverAddr, portNumber);           String message = ""testing connection"";               try {                Log.d(""TCP"", ""C: Sending: '"" + message + ""'"");                PrintWriter out = new PrintWriter( new BufferedWriter( new OutputStreamWriter(socket.getOutputStream())),true);                out.println(message);                Log.d(""TCP"", ""C: Sent."");                  Log.d(""TCP"", ""C: Done."");                  connectionAvailable = true;             } catch(Exception e) {                 Log.e(""TCP"", ""S: Error"", e);                 connectionAvailable = false;               } finally {                  socket.close();                  announceNetworkAvailability(connectionAvailable);                }         } catch (Exception e) {              Log.e(""TCP"", ""C: Error"", e);              announceNetworkAvailability(connectionAvailable);         }    }}</code></pre><p>When the server is unavailable the line </p><pre><code>Socket socket = new Socket(serverAddr, portNumber);</code></pre><p>causes some delay and I believe this is the cause for hanging. But if the TCPClientService Service is executing in its own thread I don't know why this affects the timeout of the main activity.</p><p>I would be very thankful if anyone could show how to prevent the application from hanging when the server is unavailable.</p>","22996","niko","1777090","","2013-01-17 04:59:31","2013-01-17 04:59:31","How to prevent the application timeout?","<android><multithreading><service>","1","0","1","",""
"653088","1","653175","","2009-03-17 05:21:25","4","12506","<p>I need to show a large number of EditText controls on a screen, each of which will only allow entering 0-2 digits. The default EditText size is too wide for me to show enough EditText controls on a screen, but I have been unable to figure out how to make them narrower. I have tried the following attributes in </p><p><strong>XML:</strong> </p><pre><code>android:maxLength=""2""android:layout_width=""20dip""android:maxWidth=""20px""android:ems=""2""android:maxEms=""2""</code></pre><p>So the question is: how can EditText be made smaller than default?</p>","62596","Heikki Toivonen","1043882","","2013-03-01 03:57:06","2013-03-01 03:57:06","How to make EditText smaller than default?","<android><android-layout><android-xml>","4","0","3","",""
"655994","1","661111","","2009-03-17 20:56:32","18","44334","<p>I'm trying to put an image at the top left of a <code>LinearLayout</code>, but with the image border and padding taking up the whole of the width of the window.</p><p>If I try the XML below, I get my image with its border and a white background across the whole width of the page, <em>except</em> that the image ends up centered, and doesn't move to the left.</p><pre><code>&lt;ImageView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_gravity=""left""    android:src=""@drawable/banner""    android:background=""@android:color/white""    android:padding=""@dimen/d_8px""/&gt;</code></pre><p>Is there some attribute that I've not yet discovered that forces the image to be left aligned within the <code>ImageView</code> when the <code>layout_width</code> is set to <code>fill_parent</code> ?</p><p>In the mean-time I've worked around this by dropping the <code>ImageView</code> inside another <code>LinearLayout</code>, and dropping an empty <code>TextView</code> to its right that takes up the rest of the horizontal space.</p>","6782","Alnitak","","","","2011-09-08 18:46:28","Android layout - alignment issue with ImageView","<android><layout>","2","0","6","",""
"657154","1","658862","","2009-03-18 06:24:24","5","2752","<p><br />I have a contact ID, how do I get the group the contact is assigned to? I am sure it is something to do with the Contacts.Groups class but I cannot figure it out.<br />Thanks,  Isaac</p>","764272","Isaac Waller","","","","2012-10-15 17:36:26","Android Get Group of Contact by ID","<android><group><contacts><android-contentprovider>","1","0","2","",""
"660151","1","911407","","2009-03-18 21:19:52","20","21818","<p>In the layout you can set the <code>EditText</code> widget to be non-editable via the <code>android:editable attribute</code>.</p><p>How can I do this in code?  I need to make the <code>EditText</code> widget to be editable depending on conditions.</p>","9382","AngryHacker","750613","","2012-06-30 11:28:35","2013-11-29 06:21:41","How to replicate android:editable=""false"" in code?","<android><edittext>","12","0","8","",""
"660629","1","661098","","2009-03-19 00:32:09","15","36756","<p>I want to create an Android ImageButton in the xml file with a background image, and a smaller icon on top of that, right in the center. For some reason, it's not obvious how to do it, and documentation is no help.</p><pre><code>&lt;ImageButtonandroid:id=""@+id/sound_button""android:layout_x=""430px""android:layout_y=""219px""android:layout_width=""48px""android:layout_height=""48px""android:scaleType=""center""android:src=""@android:drawable/volumeicon""android:background=""@drawable/clearbuttonup""/&gt;</code></pre><p>However, no matter what I try (putting ""<strong>wrap _ content</strong>"" instead of <strong>absolute</strong> numbers on layout _ height and layout _ width, the icon remains in the top left corner of the button. If, however, I have no background image (i.e. a system default white button), the icon does go into the center. The button also goes into the top left corner when I use a color instead of an image for the background.</p><p>Why does this happen, and how would I actually get the behavior I want-- that is, a background image with the icon in the center?</p>","30952","","750613","","2012-06-30 11:27:44","2013-05-31 20:10:44","Android ImageButton -- can't get image in the center","<xml><android><layout><imagebutton>","3","0","","",""
"660648","1","663193","","2009-03-19 00:35:27","2","1123","<p>In my Android app, a Service runs in the background and logs GPS readings to a database. The user sees an Activity that presents them with radio buttons. I'd like to also log their currently selected radio button to the database. How can I access the radio button object from the Service?</p>","40956","drewda","","","","2009-03-19 17:33:27","Android: accessing radio button values from a service","<android>","1","0","","",""
"661277","1","669969","","2009-03-19 07:02:37","0","2774","<p><br />In the Browser that comes with Android, when you rotate the phone, the WebView is not reloaded. I was wondering how to do this. I can save the current URL of the webview and pass it to the next version of myself, but how do I with the whole WebView. Thanks, Isaac</p>","764272","Isaac Waller","","","","2012-10-02 07:09:56","Android WebView save state?","<android><view><webview><savestate>","2","0","2","",""
"662344","1","663386","","2009-03-19 14:07:50","4","6223","<p>I've developed an application that receives a Broadcast and thenlaunches an Activity, where that Activity queries a ContentProviderwhich pulls information out of the DNS in real-time.</p><p>I'd like to be able to shuffle this so that instead of going:</p><pre><code>BroadcastReceiver.onReceive() {  Intent intent = new Intent(...);  intent.setData(...); // set a single String data  context.startActivity(intent);}Activity.onCreate() {  String value = intent.getData();  // get the String data  Cursor = ContentProvider.query(search);  ...  setContentView(...);}</code></pre><p>it goes:</p><pre><code>BroadcastReceiver.onReceive() {  Cursor = ContentProvider.query(...);  if (cursor != null) {     Intent intent = new Intent(...);     // how do I pass the cursor?     getContext().startActivity(intent);  }}Activity.onCreate() {  // how do I retrieve the cursor?  setContentView(...);}</code></pre><p>i.e. if the query() returns no data I want to miss out launching theactivity, and allow the Broadcast message to fall through as normal.</p><p>If the query() does return data, I want that Cursor to be supplied tothe Activity, so that I don't have to go and query for the data again.</p><p>In turn, the Activity has its own UI which the user needs to respond to.</p><p>Is this possible? </p>","6782","Alnitak","","","","2009-03-19 18:14:49","Dataflow between Android BroadcastReceiver, ContentProvider, and Activity?","<android><activity><broadcastreceiver><dataflow><android-contentprovider>","2","0","2","",""
"662420","1","663170","","2009-03-19 14:28:41","16","16998","<p>I'm having a problem reading the SMS messages from the device.When acquiring a content provider for the URI '<code>content://sms/inbox</code>',everything is fine, I can read the ""person"" column to find the foreign keyinto the people table and ultimately reach the contact and theirname.</p><p>However, I also want to traverse the sent messages too. When readingfrom 'content://sms/sent', the person field always appears to be 0. Isthis the correct field to be reading to locate the recipient data forthe sent message? If so - any idea why mine is always 0?</p><p>All my testing has been done in the emulator and I've created 3contacts. I've sent messages to those contacts from the emulator inthe normal manner you'd send a message.</p><p>Just to reiterate, I can see the 4 sent messages and read theassociated body text. My problem is that I can't seem to read the""person"" ID and hence I can't work out who the recipient is.</p><p>Any help would be greatly appreciated.</p><p>Many thanks,</p><p>Martin.</p>","67801","Martin","750613","","2012-06-30 11:26:44","2012-06-30 11:26:44","Android SMS Content (content://sms/sent)","<android><contact>","2","0","16","",""
"664851","1","664875","","2009-03-20 03:10:30","5","11715","<p>Following the Android notepad tutorials using Eclipse 3.4.2 on OSX 10.5.6.</p><p>I'm instructed to set a breakpoint in one of the following ways:</p><ol><li><p>Double click on the gray bar to the left of the editor pane.</p><ul><li>this just brings up the ""Add Bookmark"" window</li></ul></li><li><p>Select ""Toggle breakpoint"" in the context menu</p><ul><li>the only options in the context menu are ""Go to Annotation..."" (which is disabled), ""Add Bookmark"", ""Add Task"", ""Quick Diff"", ""Show line numbers"", ""Folding"" and ""Preferences"" </li></ul></li></ol><p>My guess would be that the editor's in some mode that doesn't allow breakpoints to be set, but I'm only an Eclipse newb. Anyone able to lend any advice here?</p>","49697","","","","","2012-05-03 16:48:25","Can't set breakpoints in Eclipse","<android><eclipse><osx><breakpoints>","3","0","","",""
"668268","1","668498","","2009-03-20 22:44:53","3","1423","<p><br />Under the terms of the Apache Public License, can I use some (graphic) resources in my commercial app?<br />More specifically, in my (proprietary) Android app, I want to use some graphics from Android. Since Android is licensed under the Apache Public License, I downloaded the source and took the resources I wanted. But I was wondering, if I want to sell this app, or not release the source code, am I allowed? Do I have to put any notices in my app description?<br />Thanks, Isaac Waller</p>","764272","Isaac Waller","3235496","","2014-03-16 09:42:28","2014-03-16 09:42:28","Can I use resources licenced under the Apache Public License in my commercial app?","<android><licensing><commercial><apache-license>","4","0","2","",""
"668788","1","668908","","2009-03-21 05:24:20","57","44399","<p>In my Android app, I always get VerifyErrors! And I cannot figure out why. Whenever I include a external JAR, I always get VerifyErrors when I try to launch my app (except for once, when I included Apache Log4j.) </p><p>I usually get around this by taking the source of the library and adding it to my project, but I am trying to put the GData client library (<code>http://code.google.com/p/gdata-java-client/</code>). </p><p>I can get this in source, but it's dependencies (mail.jar, activation.jar, servlet-api.jar) I cannot, so I get verify errors. I would like to get to the root of this problem once and for all. I looked on the internet, but they all seem to talk about incomplete class files? which I do not know of.</p>","764272","Isaac Waller","750613","","2012-06-30 11:25:27","2014-01-16 11:14:27","Android java.lang.VerifyError?","<java><android><gdata><verifyerror>","18","2","7","",""
"669764","1","675920","","2009-03-21 18:48:26","58","57875","<p>I am creating a server in .NET and a client application for Android. I would like to implement an authentication method which sends username and password to server and a server sends back a session string.</p><p>I'm not familiar with WCF so I would really appreciate your help.</p><p>In java I've written the following method:</p><pre><code>private void Login(){  HttpClient httpClient = new DefaultHttpClient();  try  {      String url = ""http://192.168.1.5:8000/Login?username=test&amp;password=test"";    HttpGet method = new HttpGet( new URI(url) );    HttpResponse response = httpClient.execute(method);    if ( response != null )    {      Log.i( ""login"", ""received "" + getResponse(response.getEntity()) );    }    else    {      Log.i( ""login"", ""got a null response"" );    }  } catch (IOException e) {    Log.e( ""error"", e.getMessage() );  } catch (URISyntaxException e) {    Log.e( ""error"", e.getMessage() );  }}private String getResponse( HttpEntity entity ){  String response = """";  try  {    int length = ( int ) entity.getContentLength();    StringBuffer sb = new StringBuffer( length );    InputStreamReader isr = new InputStreamReader( entity.getContent(), ""UTF-8"" );    char buff[] = new char[length];    int cnt;    while ( ( cnt = isr.read( buff, 0, length - 1 ) ) &gt; 0 )    {      sb.append( buff, 0, cnt );    }      response = sb.toString();      isr.close();  } catch ( IOException ioe ) {    ioe.printStackTrace();  }  return response;}</code></pre><p>But on the server side so far I haven't figured out anything.</p><p>I would be really thankful if anyone could explain how to create an appropriate method string Login(string username, string password) with appropriate App.config settings and Interface with appropriate [OperationContract] signature in order to read these two parameters from client and reply with session string.</p><p>Thanks!</p>","22996","niko","","","","2013-01-22 06:13:46","How to Consume WCF Service with Android","<.net><android><wcf><rest>","5","1","49","",""
"670987","1","671210","","2009-03-22 13:09:54","9","30991","<p>Since both the java implementation (<code>OpenJDK</code>) and Android's virtual machine DalvikVM are opensource it must be possible to implement Sun's JavaVM on top Google's DalvikVM. This would make it possible to run JVM based apps and languages (<code>Clojure, Jython</code>) out-of-the-box on the android.</p><p>Is there an ongoing effort to produce such an implementation of the Sun JVM?</p>","48486","","750613","","2012-06-30 11:24:25","2014-01-31 19:12:20","Running Java bytecode on the Android - Sun JVM on top of DalvikVM","<java><android><jvm>","6","0","3","",""
"672325","1","672422","","2009-03-23 05:37:23","5","3962","<p>I'm currently getting to grips with Android, playing around with the Lunar Lander sample.</p><p>I've found that if you navigate away from the app (eg, hit the call button) it will destroy the underlying surface (calling <code>surfaceDestroyed</code>).</p><p>Navigating back (which will trigger <code>onWindowVisibilityChanged</code>) the app will crash, as it will try to draw to the surface without recreating it.</p><p>Is there some code I can put in <code>onWindowVisibilityChanged</code> (or anywhere else) that will regenerate the SurfaceView's underlying surface and resume execution nicely?</p><p>It feels like this should be a simple function call but I can't find anything in the API docs.</p><p>Thanks!</p>","49697","","","","","2010-11-04 20:28:54","Android: Regaining focus using SurfaceView","<java><android><surfaceview>","2","0","1","",""
"678630","1","687453","","2009-03-24 18:31:56","80","66347","<p>I'd like to make an http request to a remote server while properly handling cookies (eg. storing cookies sent by the server, and sending those cookies when I make subsequent requests).  It'd be nice to preserve any and all cookies, but really the only one I care about is the session cookie.</p><p>With java.net, it appears that the preferred way to do this is using java.net.CookieHandler (abstract base class) and java.net.CookieManager (concrete implementation).  Android has java.net.CookieHandler, but it does not seem to have java.net.CookieManager.</p><p>I could code it all by hand by inspecting http headers, but it seems like there must be an easier way.</p><p>What is the proper way to make http requests on Android while preserving cookies?</p>","82156","Mike","","","","2014-04-11 16:45:22","How do I make an http request using cookies on Android?","<java><android><http><url><cookies>","3","2","70","",""
"680180","1","686570","","2009-03-25 04:04:24","32","65419","<p>I have created a threaded service the following way:</p><pre><code>public class TCPClientService extends Service{  ...@Overridepublic void onCreate() {    ...    Measurements = new LinkedList&lt;String&gt;();    enableDataSending();    }@Overridepublic IBinder onBind(Intent intent) {    //TODO: Replace with service binding implementation    return null;}@Overridepublic void onLowMemory() {    Measurements.clear();    super.onLowMemory();}@Overridepublic void onDestroy() {    Measurements.clear();    super.onDestroy();    try {        SendDataThread.stop();    } catch(Exception e){        ...         }}private Runnable backgrounSendData = new Runnable() {    public void run() {        doSendData();    }};private void enableDataSending() {    SendDataThread = new Thread(null, backgrounSendData, ""send_data"");    SendDataThread.start();} private void addMeasurementToQueue() {     if(Measurements.size() &lt;= 100) {         String measurement = packData();         Measurements.add(measurement);     } } private void doSendData() {     while(true) {         try {                   if(Measurements.isEmpty()) {                 Thread.sleep(1000);                 continue;             }             //Log.d(""TCP"", ""C: Connecting..."");             Socket socket = new Socket();             socket.setTcpNoDelay(true);             socket.connect(new InetSocketAddress(serverAddress, portNumber), 3000);             //socket.connect(new InetSocketAddress(serverAddress, portNumber));             if(!socket.isConnected()) {                 throw new Exception(""Server Unavailable!"");             }             try {                 //Log.d(""TCP"", ""C: Sending: '"" + message + ""'"");                 PrintWriter out = new PrintWriter( new BufferedWriter( new OutputStreamWriter(socket.getOutputStream())),true);                 String message = Measurements.remove();                 out.println(message);                 Thread.sleep(200);                 Log.d(""TCP"", ""C: Sent."");                 Log.d(""TCP"", ""C: Done."");                 connectionAvailable = true;                           } catch(Exception e) {                 Log.e(""TCP"", ""S: Error"", e);                 connectionAvailable = false;             } finally {                 socket.close();                 announceNetworkAvailability(connectionAvailable);             }         } catch (Exception e) {             Log.e(""TCP"", ""C: Error"", e);             connectionAvailable = false;             announceNetworkAvailability(connectionAvailable);         }    }}...}</code></pre><p>After I close the application the phone works really slow and I guess it is due to thread termination failure.</p><p>Does anyone know what is the best way to terminate all threads before terminating the application?</p>","22996","niko","597657","","2013-02-28 00:16:02","2013-02-28 00:16:02","Where to stop/destroy threads in Android Service class?","<java><android><multithreading><service>","2","0","36","",""
"683136","1","686718","","2009-03-25 19:45:17","0","2757","<p>Just come to polishing my application and making it resume after the user has left. When the application restores I get an IllegalThreadStateException, which is quite annoying. This problem is present in the example google gives of <a href=""http://developer.android.com/guide/samples/LunarLander/index.html"" rel=""nofollow"">Lunar Lander</a>. Has anyone found a way to restore working when using surfaceView?</p>","64392","","1465910","","2012-09-29 08:39:22","2013-09-11 01:43:27","Android IllegalThreadStateException in LunarLander","<java><android><surfaceview><illegalstateexception>","3","0","","",""
"693997","1","1565243","","2009-03-29 02:15:24","202","100253","<p>I have created the following function for checking the connection status:</p><pre><code>private void checkConnectionStatus() {    HttpClient httpClient = new DefaultHttpClient();    try {      String url = ""http://xxx.xxx.xxx.xxx:8000/GaitLink/""                   + strSessionString + ""/ConnectionStatus"";      Log.d(""phobos"", ""performing get "" + url);      HttpGet method = new HttpGet(new URI(url));      HttpResponse response = httpClient.execute(method);      if (response != null) {        String result = getResponse(response.getEntity());        ...</code></pre><p>When I shut down the server for testing the execution waits a long time at line</p><pre><code>HttpResponse response = httpClient.execute(method);</code></pre><p>Does anyone know how to set the timeout in order to avoid waiting too long?</p><p>Thanks!</p>","22996","niko","244296","niko","2010-06-19 14:13:30","2013-09-14 23:40:21","How to set HttpResponse timeout for Android in Java","<java><android><timeout><httpresponse>","3","0","124","",""
"694150","1","","","2009-03-29 05:28:25","1","908","<p>I am a student in Northwestern Polytechnic University in computer science program.</p><p>I am working on project a in which i have to sync my program with google calendar using Android application.</p><p>for that i am using eclipse and i got some code online but i dont know wht .jar file i need to add for support below importss..</p><pre><code>import com.google.Android.gdata.client.AndroidXmlParserFactory;import com.google.Android.gdata.client.JakartaGDataClient;import com.google.wireless.gdata.calendar.client.CalendarClient;import com.google.wireless.gdata.calendar.data.EventEntry;import com.google.wireless.gdata.calendar.data.When;import com.google.wireless.gdata.calendar.parser.xml.XmlCalendarGDataParserFactory;import com.google.wireless.gdata.client.QueryParams;import com.google.wireless.gdata.data.Feed;import com.google.wireless.gdata.parser.GDataParser;</code></pre><p>please can anybody help me regarding this ..</p><p>or any other clue for my project because i got a deadline on next week ..</p><p>thank you very much in advance..</p><p>i'll really appreciate.</p>","","APatel","525478","","2012-09-21 16:14:42","2012-09-21 16:14:42","Calendar Syncronization in Android Application","<android>","1","0","","",""
"695137","1","","","2009-03-29 18:53:09","3","3491","<p>Is there a way to read/access emails or inbox in Android programmatically?</p>","","Idan","869912","Remou","2012-08-13 18:31:21","2012-08-13 18:31:21","Is there a way to read/access emails or inbox in Android programmatically?","<android><email>","1","2","","",""
"695971","1","708049","","2009-03-30 04:00:03","3","2316","<p>Using the Apache HttpClient on android, how do I send data to a RESTfull Ruby on Rails app using HttpPost.</p><p><strong>This is my Controller:</strong></p><pre><code># POST /products  def create    @product = Product.new(params[:product])    respond_to do |format|      if @product.save        flash[:notice] = 'Product was successfully created.'        format.html { redirect_to(@product) }        format.xml  { render :xml =&gt; @product, :status =&gt; :created, :location =&gt; @product }      else        format.html { render :action =&gt; ""new"" }        format.xml  { render :xml =&gt; @product.errors, :status =&gt; :unprocessable_entity }      end    end  end</code></pre><p>And this is my Java Code. Should I be passing the data in the URL name, or do I have to set it somewhere else? (httpost.setEntity perhaps?)  Eventually I will be using JSON but for now I just want to get it so I can actually call the ""create"" method in Rails. Rails is getting the POST but never executes any code in the ""create"" method</p><pre><code>  HttpClient httpclient = new DefaultHttpClient();  HttpPost httppost = new HttpPost(""http://192.168.0.100:3000/products/new"");  HttpResponse response = httpclient.execute(httppost);</code></pre><p>I am quite stuck and would appreciate if someone could point me in the right direction.</p>","62088","brodie","750613","","2012-06-30 11:23:02","2012-06-30 11:23:02","Java: HTTP Post to create new ""Product"" in a Ruby on Rails application","<java><ruby-on-rails><android><http>","3","0","2","",""
"700550","1","702148","","2009-03-31 08:25:03","3","1592","<p>I would like to produce an android user interface which allows the user to move added components/widgets around the screen by selecting them and then dragging them around.</p><p>Is this possible using the standard android apis?</p>","85034","","","","","2009-03-31 17:45:17","Is it possible to move components around the screen using the standard android apis?","<android><user-interface>","3","0","1","",""
"704295","1","704918","","2009-04-01 06:23:58","13","53210","<p>I want to show my progressbar in the center of the screen when a processing happens on a button click. But I just want the progressbar without the dialog box..</p><p>Is there any way I can do this?</p>","46297","lostInTransit","114066","lostInTransit","2010-08-17 08:08:12","2012-07-29 17:19:13","Android - show an indeterminate progressbar without the dialog","<android>","5","0","6","",""
"704311","1","707316","","2009-04-01 06:28:25","47","52685","<p>Is there a way of finding out where my app threw an ANR (Application Not Responding). I took a look at the traces.txt file in /data and I see a trace for my application. This is what I see in the trace.</p><pre><code>DALVIK THREADS:""main"" prio=5 tid=3 TIMED_WAIT  | group=""main"" sCount=1 dsCount=0 s=0 obj=0x400143a8  | sysTid=691 nice=0 sched=0/0 handle=-1091117924  at java.lang.Object.wait(Native Method)  - waiting on &lt;0x1cd570&gt; (a android.os.MessageQueue)  at java.lang.Object.wait(Object.java:195)  at android.os.MessageQueue.next(MessageQueue.java:144)  at android.os.Looper.loop(Looper.java:110)  at android.app.ActivityThread.main(ActivityThread.java:3742)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)  at dalvik.system.NativeStart.main(Native Method)""Binder Thread #3"" prio=5 tid=15 NATIVE  | group=""main"" sCount=1 dsCount=0 s=0 obj=0x434e7758  | sysTid=734 nice=0 sched=0/0 handle=1733632  at dalvik.system.NativeStart.run(Native Method)""Binder Thread #2"" prio=5 tid=13 NATIVE  | group=""main"" sCount=1 dsCount=0 s=0 obj=0x433af808  | sysTid=696 nice=0 sched=0/0 handle=1369840  at dalvik.system.NativeStart.run(Native Method)""Binder Thread #1"" prio=5 tid=11 NATIVE  | group=""main"" sCount=1 dsCount=0 s=0 obj=0x433aca10  | sysTid=695 nice=0 sched=0/0 handle=1367448  at dalvik.system.NativeStart.run(Native Method)""JDWP"" daemon prio=5 tid=9 VMWAIT  | group=""system"" sCount=1 dsCount=0 s=0 obj=0x433ac2a0  | sysTid=694 nice=0 sched=0/0 handle=1367136  at dalvik.system.NativeStart.run(Native Method)""Signal Catcher"" daemon prio=5 tid=7 RUNNABLE  | group=""system"" sCount=0 dsCount=0 s=0 obj=0x433ac1e8  | sysTid=693 nice=0 sched=0/0 handle=1366712  at dalvik.system.NativeStart.run(Native Method)""HeapWorker"" daemon prio=5 tid=5 VMWAIT  | group=""system"" sCount=1 dsCount=0 s=0 obj=0x4253ef88  | sysTid=692 nice=0 sched=0/0 handle=1366472  at dalvik.system.NativeStart.run(Native Method)----- end 691 -----</code></pre><p>How can I find out where the problem is? The methods in the trace are all SDK methods.</p><p>Thanks.</p>","46297","lostInTransit","21234","","2011-06-30 18:09:23","2012-03-30 03:26:04","Android - how do I investigate an ANR?","<android><performance><android-anr-dialog>","4","1","33","",""
"707993","1","708312","","2009-04-02 01:42:38","3","9683","<p>I am creating an application which requires login and enables user to configure some settings.</p><p>However I would like to enable user to store preferred settings, username and password.</p><p>Does anyone know how to store and retrieve values from registry?Another possibility is using SQL Lite database but if possible I would prefer to store values to registry.</p><p>Thanks!</p>","22996","niko","750613","","2012-06-22 10:08:31","2012-06-22 10:08:31","Android: how to store variable values to registry?","<android><variables><registry>","1","1","","",""
"708012","1","708317","","2009-04-02 01:54:30","330","180716","<p>I am creating an application which requires login. I created the main and the login activity.</p><p>In the main activity onCreate method I added the following condition:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ...    loadSettings();    if(strSessionString == null)    {        login();    }    ...}</code></pre><p>The onActivityResult method which is executed when the login form terminates looks like this:</p><pre><code>@Overridepublic void onActivityResult(int requestCode,    						 int resultCode,    						 Intent data){    super.onActivityResult(requestCode, resultCode, data);    switch(requestCode)    {    	case(SHOW_SUBACTICITY_LOGIN):    	{    		if(resultCode == Activity.RESULT_OK)    		{    			strSessionString = data.getStringExtra(Login.SESSIONSTRING);    			connectionAvailable = true;    			strUsername = data.getStringExtra(Login.USERNAME);    		}    	}    }</code></pre><p>The problem is the login form sometimes appears twice (the login() method is called twice) and also when the phone keyboard slides the login form appears again and I guess the problem is the variable strSessionString.</p><p>Does anyone know how to set the variable global in order to avoid login form appearing after the user already successfully authenticates?</p><p>Thanks!</p>","22996","niko","79595","","2013-08-04 06:54:53","2013-11-20 22:48:26","Android: How to declare global variables?","<android><singleton><global-variables><state>","11","0","319","",""
"716857","1","726454","","2009-04-04 10:18:59","3","2379","<p><em>If you have an answer that is not Java / SQLite related, I'd be pleased to read it.</em></p><h2>The environment</h2><p>I store items in a database with the following scheme :</p><pre><code>####################       Item      #    ####################      _id        #    This is the primary key#    parent_id    #    If set, it the ID of the item containing this item#      date       #    An ordinary date#  geocontext_id  #    Foreign key to a pair of named coordinates#######################################   Geocontext    #    ####################       _id       #    This is the primary key#       name      #    Way for the user to label a pair of coordinates (e.g : ""home"", ""work"")#         x       #    One of the coordinate#         y       #    The other one###################</code></pre><h2>The problem</h2><p>I must filter the items according to the geocontext  and the date. It would be a easy job if items were all at the same level, but the trick is it's recursive. E.G :</p><pre><code>root      |_item 1      |_item 2       |      |_item 4      |      |_item 5      |             |_item 6      |_item 3      |      |_item 8      |             |_item 10      |_item 11      |       |_item 12      |_item 7</code></pre><p>There is no explicit limit to the recursive depth.</p><p>Now, if we are in any node and filter with the date ""1st of April"", we must see not only the items directly contained in the node that match the date, but <strong>we must see the items that contain items matching the date as well</strong>. </p><p>E.G : We are in ""Items 2"", if ""item 6"" matches the date, then we consider ""item 5"" matches the date too and we must keep it. If we are at the root, then item 2 must be displayed.</p><p>Same goes for the geocontext, but it's even harder because  :</p><ul><li>It's stored in an other table.</li><li>Matching the context is a costly mathematical computation.</li></ul><p>Of course, brute forcing the matching would result in the software to be slow and a very poor user experience.</p><p>NOTE : <strong>I don't need to display a tree</strong>. I display a list of filtered data from a tree. We must see only a flat list of the top elements. The challenge is to decide whether to display each element or not, according to all the children hierachy.</p><h2>How I tried to solve it</h2><p>I thought I could ease a bit the problem by using more tables to cache flat data :</p><pre><code>#################### Geocontex_cache #    ####################     item_id     #     I can Join the items table on this field#     child_id    #     I can delete / update a child, and so delete / update the cache#  geocontext_id  #     I can delete / update a geocontext, and so delete / update the cache#        x        #      Here, I can brute force :-)#        y        # #######################################    Date_cache   #    ####################     item_id     #     #     child_id    #    #       date      #    ###################</code></pre><p>This seems reasonable, but I haven't tried it yet. Nevertheless, it should the following drawbacks :</p><ul><li><p>I moved the costly process to the get/ set / create / delete methods thatwill have to manage the cached date.That will be a troublesome code towrite and maintain. A five depthlevel item will triger a process thatwill hit recursively five parents.</p></li><li><p>The size ot the data base couldbecome HUGE.  A five de depth levelitem store cached data for fiveparents. Don't know if it's relevant,since this a a mono-user app with amanual input. I don't think anybodywould insert more thatn 1000 itemswith more than 10 level of depth.</p></li></ul><p>Now the good news is we go from the   bottom of the pyramid to the top, not   the other way, so it's not has   horrible as it seems. When I will   have to deal with parent item   deletion, it will be another nice   headache, but I save it for another   question ;-).</p><h2>Now my question</h2><p>How would you store the data and process the filtering int the most optimal way ?</p><p><em>Optional :</em></p><p>Should I define an explicit recursive depth limit ?Should I perform the filtering using SQL or Java ? SQL surely will be faster, but matching the geocontext is far easier to do in Java.</p><p>As I am working on the Android platform, I have the following constraints :</p><ul><li><p>Java is the only language available,and not with the entire standard lib.</p></li><li><p>SQLite is the only DBMS available.</p></li><li><p>Performance and memory are importantissues. In case you have to choose,battery life and thereforeperformance is the priority.</p></li><li><p>Exotics external libs may not be ableto be used.</p></li></ul><p>P.S : I dug into SO and found some interesting pieces of information (espacially <a href=""http://stackoverflow.com/questions/192220/what-is-the-most-efficientelegant-way-to-parse-a-flat-table-into-a-tree"">http://stackoverflow.com/questions/192220/what-is-the-most-efficientelegant-way-to-parse-a-flat-table-into-a-tree</a>). It's a hint, but not a problem solver.</p>","9951","e-satis","3043","e-satis","2009-09-17 22:59:20","2009-09-17 22:59:20","Recursive data processing performance using Java and SQLite","<java><android><sqlite><recursion>","4","4","2","",""
"724419","1","726143","","2009-04-07 07:04:37","5","5880","<p>I have two activities running: <em>mainActivity</em> and <em>childActivity</em>. Whenever the user clicks in the button in <em>mainActivity</em>, the <em>childActivity</em> is launched. What I want to do is this:</p><p>When the active activity is the <em>childActivity</em> and the user <strong>clicks the home button then relaunch the application</strong>, I want to see the <em>childActivity</em> <strong>instead of</strong> <em>mainActivity</em> that is launched. </p><p>I had some suggestions actually work arounds. I tried to manipulate onStart, onRestart, onResume, onStop, onDestroy events. But, they didn't fully solve the problem. There should be a smart way out there. Thank you.</p><p>Edit: </p><p>Thank you for the answer, Soonil. The case you said is happening when the activity is called from recent activities window. (the window opened when you long press the home button) However; This is not happening when you open it from home screen. (like opening from start) I don't think my code has a specific problem to generate this error. Because, I created a test project and tried standalone before sending the question and faced the same problem. Anyhow, here is the test code:</p><pre><code>public class MainActivity extends Activity implements OnClickListener {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {    	super.onCreate(savedInstanceState);    	setContentView(R.layout.main);    	this.setTitle(""MainActivity"");    	((Button) findViewById(R.id.btnChildActivity)).setOnClickListener(this);    }    @Override    public void onClick(View arg0) {    	// TODO Auto-generated method stub    	startActivity(new Intent(this, ChildActivity.class));    }}public class ChildActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {    	super.onCreate(savedInstanceState);    	setContentView(R.layout.main2);    	this.setTitle(""ChildActivity"");    }}</code></pre>","40929","","40929","","2009-04-07 16:41:30","2010-10-08 12:33:14","Android: Restoring the active Activity while resuming the application","<android><activity>","3","5","6","",""
"725496","1","726172","","2009-04-07 12:40:20","10","14026","<p>I'm writing an application for android and would like to have an <code>itunes</code> like coverflow preview.Is there anything in the api that I can use or do I have to build it from scratch?</p>","2450","","2706848","","2014-02-15 13:08:51","2014-02-15 13:08:51","Android coverflow","<java><android><mobile><coverflow>","4","1","8","",""
"726388","1","726400","","2009-04-07 15:40:36","2","1470","<p>I'm thinking about creating an application for the iPhone and Android that will need to access a common backend to retrieve account information.  Can both access a web service over https?  What other way would allow me to have one interface to the backend that is accessible by both?</p>","4555","","","","","2012-06-22 09:59:48","What common backend can be accessed securely from an iPhone and Android application?","<iphone><android><security><backend>","4","0","1","",""
"727021","1","731612","","2009-04-07 18:29:11","1","3390","<p>First, a non-programming question:  My phone is auto-responding to missed calls with a text message: ""Sorry. I'm not near my phone right now.""  Where did my phone get the idea to do that and how do I make it stop?</p><p>And a programming question:  How can I make my Android do arbitrary things in response to a missed call, such as email me the phone number, or just customize the SMS auto-response, perhaps replying with my location.</p>","4234","","4234","","2009-04-09 14:37:58","2010-10-14 15:26:58","SMS auto-responses on Android","<android><sms><voice><auto-responder>","2","0","1","2012-09-06 12:19:39",""
"728077","1","728588","","2009-04-08 00:19:01","29","22085","<p>Is there a way to reload an Android application in the emulator without closing the emulator, saving any code changes, and running the emulator again?  If I make even a simple change to the layout, it takes about 30 seconds by time I run it in Eclipse and Android ""boots"", and I can unlock the emulator to run the application.  Is there any way to shorten this time when making changes, or is it something I just have to deal with?</p>","4555","","","","","2014-04-10 17:01:12","Reload Android application in emulator without restarting emulator in Eclipse?","<android><eclipse>","3","1","10","",""
"731603","1","734516","","2009-04-08 20:08:13","4","1293","<p>I have an android application that plays music from a site, however to authenticate to the stream, you need to send a cookie first I.E:</p><p><a href=""http://example.com/site/content?id=SOMEID"" rel=""nofollow"">http://example.com/site/content?id=SOMEID</a> = mp3 formatted stream</p><p>If you access the url without a cookie, you'll get a Server 500 error.If you have a cookie, then you'll get the stream.</p><p>For the life of me, I can't figure out how to make the mediaplayer play a URL while sending a cookie.</p><p>I can play any url that doesn't require a cookie, however.</p>","88770","","750613","","2012-06-22 10:01:10","2012-10-28 13:16:22","Android MediaPlayer URL's with Cookie","<java><android><cookies><media-player>","2","1","1","",""
"733721","1","4077170","","2009-04-09 10:58:27","8","12501","<p>I have to activate android's system key lock (the one you get when you press the <em>power off</em>/*hang up* button). See here:</p><p><img src=""http://farm4.static.flickr.com/3202/2849046033_fd42359cef.jpg"" alt=""img""></p><p>I already browsed the docs but everything I found was <a href=""http://developer.android.com/reference/android/os/PowerManager.html"" rel=""nofollow"">PowerManager</a> and <a href=""http://developer.android.com/reference/android/app/KeyguardManager.html"" rel=""nofollow"">KeyguardManager</a>. Both seem not to be the solution :-(.</p><p>So, does everyone know how to achieve that from a android application? (If special permissions are required, that is no problem but changing the device's settings is not a solution...)</p><p><strong>EDIT</strong>: Or does someone know that this is definitely not possible at all? Btw. craigs solution with sending keys does not work anymore (see comments).</p>","55925","","55925","","2012-04-03 10:52:09","2012-04-03 10:52:09","Android - Activation of the system key lock (aka lock screen)","<java><android><keyboard><locking><device-admin>","5","1","4","",""
"736571","1","737971","","2009-04-10 02:48:27","134","231539","<p>In my Android application, I have two activity classes.  I have a button on the first one and I want to show the second when it is clicked, but I get an error.  Here are the classes:</p><pre><code>public class FirstActivity extends Activity {  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button orderButton = (Button)findViewById(R.id.order);    orderButton.setOnClickListener(new View.OnClickListener() {      @Override      public void onClick(View view) {        Intent intent = new Intent(FirstActivity.this, OrderScreen.class);        startActivity(intent);      }    });  }}</code></pre><p>The second class that should show when the button is clicked, but never does:</p><pre><code>public class OrderScreen extends Activity {  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.order);    Button orderButton = (Button) findViewById(R.id.end);    orderButton.setOnClickListener(new View.OnClickListener() {      @Override      public void onClick(View view) {        finish();      }    });  }}</code></pre><p>How do I create a button that will show the second activity?</p>","4555","","844882","","2012-07-02 03:58:58","2013-09-11 01:39:58","Using Intent in an Android application to show another activity","<android><android-intent><android-activity>","9","3","33","",""
"738018","1","742749","","2009-04-10 15:37:51","1","5714","<p>I have an image that takes up a lot more space than the android screen. I want the image to be presented full size and the user can move in any direction. Like a map.</p><p>Any suggestions?</p>","83452","","","","","2013-12-20 08:08:48","How can I make my image scrollable? [Android Platform]","<android><image><scrolling>","3","0","1","",""
"738708","1","745052","","2009-04-10 19:59:12","4","6241","<p>I've got an XML file storing an array of shorts in my resources. I need to assign this array, but Android API only provides a way to get array of ints (<code>getResources.getIntArray()</code>). I've ended up getting an array of ints and converting it to array of shorts later, but that's hardly ideal.</p><p>Is there a way to get an array of shorts from Android resources? If not, is there a more efficient/cleaner way of converting int array into short array? My code currently looks like this:</p><pre><code>int indicesInt[] = context.getResources().getIntArray(R.array.indices);short indices[] = new short[indicesInt.length];for (int i = 0; i &lt; indicesInt.length; i++) {    indices[i] = (short)indicesInt[i];}</code></pre>","3037","","3037","","2009-04-10 20:11:45","2009-04-13 19:23:19","How to efficiently get short array from resources on Android?","<java><android><arrays><resources>","1","0","3","",""
"738817","1","759517","","2009-04-10 20:50:19","8","50816","<p>I have images displayed in a GridView as in <a href=""http://developer.android.com/guide/tutorials/views/hello-gridview.html"" rel=""nofollow"">this tutorial</a>.  I want to be able to click on a single image and do other events and I need to know what image was clicked.</p><p>Do I have to add imageView.onKeyDown(keyCode, event) in the ImageAdapter class?  Here is the code as it currently exists:</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {  ImageView imageView;  if (convertView == null) {      // if it's not recycled, initialize some attributes    imageView = new ImageView(mContext);    imageView.setLayoutParams(new GridView.LayoutParams(85, 85));    imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);    imageView.setPadding(8, 8, 8, 8);    //does this need imageView.onKeyDown(keyCode, event)?  }   else {    imageView = (ImageView) convertView;  }  imageView.setImageResource(mThumbIds[position]);  return imageView;}</code></pre><p>How will it indicate what image was clicked? How do I create the proper handler?</p>","4555","","1765573","","2013-07-19 09:39:48","2013-07-19 09:39:48","Create a clickable image in a GridView in Android","<java><android><android-gridview><clickable-image>","3","0","5","",""
"739818","1","739917","","2009-04-11 10:14:26","4","2977","<p>I am developing a game for Android in Windows Vista environment. I want to automate the exporting unsigned application operation in a batch file. So, I wouldn't have to Right click on the project, go to Android Tools and then select Export Unsigned Application Package... anytime I want to run my project. Thank you.</p>","40929","","","","","2010-10-20 06:24:23","Eclipse: How to automate export unsigned application in a batch file","<android><eclipse><batch-file>","2","0","","",""
"742171","1","742241","","2009-04-12 18:31:59","7","6125","<p>I use onLongClick and onClick events of a button to get user inputs. Whenever; the user long click and triggers onLongClick event, the onClick event is also triggered. I couldn't find my problem. The code of two methods are shown in below:</p><pre><code>@Override    public void onClick(View v) {    	switch(((Button) v).getId())    	{    	case R.id.enter:    		EntertheNumber();    		break;    	case R.id.clear:    		CleartheNumber();    		break;    	case R.id.number_zero:    	case R.id.number_one:    	case R.id.number_two:    	case R.id.number_three:    	case R.id.number_four:    	case R.id.number_five:    	case R.id.number_six:    	case R.id.number_seven:    	case R.id.number_eight:    	case R.id.number_nine:    		AddtotheNumber(mEditor, (Button) v);    		break;    	}@Override    public boolean onLongClick(View view) {    	if(SMBGuesstheNumber.bDisplayFlagList)    	{    		theActiveButton = (Button) view;    		showDialog(R.id.display_flaglist);    	}    	return false;    }</code></pre><p>Actually, my project is Open Source. So, you can find all the code at <a href=""http://code.google.com/p/guessthenumber/"">http://code.google.com/p/guessthenumber/</a></p><p>Thank you.</p>","40929","","126562","","2010-10-20 06:19:42","2010-10-20 06:19:42","LongClick event also triggers Click event","<java><android><events><event-handling>","2","0","1","",""
"746597","1","747599","","2009-04-14 06:56:37","4","4373","<p>first time poster here.</p><p>I'm working on a client-server Android application and trying to figure out how to identify different phones/users to the server unambiguously. My first attempt would be to use the phone number on the SIM card. Although now that I think about it, how common is it these days that your phone number changes when you e.g. change carrier? I guess it depends from country to country etc. </p><p>Anyway, I've been trying to figure out, since I don't have actual Android phones, how to change the phone number of the emulator phone to simulate different users. Is it possible or should I just think about alternative ways of identification? </p>","90563","","","","","2013-04-23 17:51:23","Running several Android emulators with different phone numbers","<android><emulator><identification>","4","0","2","",""
"747614","1","","","2009-04-14 13:40:56","2","2492","<p>I have a root'd G1 phone, and I would like to set its hostname. As root I can run the <code>hostname</code> command and set it, but the name does not survive reboot.</p><p>First, I tried creating a <code>/etc/hostname</code> file that only contained my hostname, but that did not work.</p><p>Next, I edited <code>/etc/hosts</code> like this:</p><pre><code>127.0.0.1     g1-phone localhost</code></pre><p>However that failed as well. Are there any other methods I can try to set the hostname permanently?</p>","41908","","225647","","2012-10-29 20:46:00","2012-10-29 20:46:00","How to set the hostname on a G1 Phone","<android><hostname>","1","0","1","",""
"749887","1","749935","","2009-04-15 00:37:06","4","4957","<p>How do you use the Android API to zoom in and out maps with the 2 finger gestures like iPhone?</p>","90883","","114066","","2010-03-02 08:23:22","2010-03-02 08:23:22","How to use Android Map to zoom with hand gesture (iphone like)","<android><api><map><zoom><gesture>","2","0","3","",""
"753793","1","753847","","2009-04-15 21:24:38","1","6356","<p>I've poured over the docs and haven't been able to figure this out. Is it even possible?</p><p><a href=""http://developer.android.com/reference/com/google/android/maps/MyLocationOverlay.html"" rel=""nofollow"">Please see this</a></p>","76835","","1887603","","2012-12-21 04:36:43","2012-12-21 04:36:43","How can I use a custom bitmap for the ""you are here"" point in a MyLocationOverlay?","<java><android><bitmap><android-mapview><mylocationoverlay>","2","0","6","",""
"754064","1","761333","","2009-04-15 22:50:46","1","290","<p>I am looking for resources concerning Android's use of XML - not how to's, but technical articles or whitepapers concerning the XML architecture in Android. Why were things designed the way they were, what considerations were made - all specific to the XML part.</p><p>If this is not available, I'm also interested in general use of XML in mobile computing. Does the iPhone use XML in the same way?</p><p>Can anyone point me to some good articles/websites/books/whitepapers/videos ?</p>","35501","","","","","2009-04-17 17:17:13","Android XML whitepaper","<xml><android><mobile>","1","3","","",""
"754684","1","","","2009-04-16 03:43:48","68","115087","<p>Say, we have a table created as: </p><pre>  create table notes (_id integer primary key autoincrement, created_date date)</pre><p>To insert a record, I'd use </p><pre>ContentValues initialValues = new ContentValues(); initialValues.put(""date_created"", """");long rowId = mDb.insert(DATABASE_TABLE, null, initialValues);</pre><p>But how to set the date_created column to ""now""?  To make it clear, the </p><pre>initialValues.put(""date_created"", ""datetime('now')"");</pre><p>Is not the right solution.  It just sets the column to ""datetime('now')"" text.</p>","91440","","","","","2014-02-27 01:18:13","How to insert a SQLite record with a datetime set to 'now' in Android application?","<android><sqlite>","9","1","36","",""
"756962","1","757154","","2009-04-16 16:34:29","0","409","<p>In the various smartphone APIs/SDKs, I was wondering if it is possible to prompt a user if they'd like to log a phone call after they hang up. The most basic functionality would be after calling out or receiving a call, the phone would ask</p><p>Do you want to log the call to|from 555-555-5555?<br />Yes | No | Never this number</p><p>(then it might take the user to a small form and then post the info to a webservice)</p><p>The business use is for lawyers who have company phones and need to track billing.</p><p>this is a bit different question than <a href=""http://stackoverflow.com/questions/341622/accessing-the-iphones-call-log-with-the-iphone-sdk"">Accessing the iPhone&#39;s Call log with the iPhone SDK</a>.</p>","45767","","996493","","2012-04-07 15:54:16","2012-04-07 15:54:16","Logging calls after hanging up on smart phones","<iphone><android><api><blackberry><palm-os>","3","0","1","",""
"763972","1","","","2009-04-18 19:06:03","7","8700","<p>I'm developing a simple application for the Google Android to turn on and off the wifi or 3g or 2g.</p><p>I see <a href=""http://developer.android.com/reference/android/net/wifi/WifiManager.html#isWifiEnabled"" rel=""nofollow"">http://developer.android.com/reference/android/net/wifi/WifiManager.html#isWifiEnabled</a>()that you can see if the wifi is enabled or disabled and also us<a href=""http://developer.android.com/reference/android/net/wifi/WifiManager.html#setWifiEnabled"" rel=""nofollow"">http://developer.android.com/reference/android/net/wifi/WifiManager.html#setWifiEnabled</a>(boolean)to turn on and off the wifi.</p><p>I'm wondering if it's possible to do the same for 3G and for 2G/GPRS?I know it's possible because you can turn off 3G and left 2G on.</p>","161922","","2144559","","2013-04-17 13:58:59","2013-04-17 13:58:59","Google Android - how to figure out if 3g and 2g is turned on","<android><wireless><gprs>","2","2","8","",""
"767771","1","845085","","2009-04-20 10:52:03","2","29595","<p>I want to develop an application that disable the Background Data (new feature in Android 1.5) and Auto Sync and then enable GPRS/EDGE connection and vice versa. </p><p>I figured out how to enable/disable GPRS/EDGE by changing the APN settings. (weird solution. However; Android developers couldn't think a user may want to disable GPRS/EDGE) But, I couldn't find a way to enable/disable Auto Sync and Background data.</p><p>I investigated the Android code and as I understood, the Sync operation is an intent. So, I wanted to reach with putExtra to the intend and trigger the enabling/disabling. But; I couldn't find the correct keyword. Or may be I am totally wrong. SO, I need some advice.</p><p>If you could tell me how can I do or where should I look, I would be very happy. Thank you.</p>","40929","","40929","","2011-10-28 06:15:29","2012-01-12 17:01:54","Android: Enable/Disable Auto Sync and Background Data","<android><synchronization><gprs>","3","0","2","",""
"768969","1","819427","","2009-04-20 16:13:49","36","45636","<p>What's the correct way to pass a bundle to the activity that is being launched from the current one? Shared properties?</p>","15187","","142162","","2011-09-25 01:35:18","2011-09-25 01:35:18","Passing a Bundle on startActivity()?","<android><activity><bundle>","2","0","20","",""
"769326","1","784463","","2009-04-20 17:40:43","2","5435","<p>I'm trying to animate some text 'zooming out' on top of another view.  My code looks something like:</p><pre><code>class BoardView extends View {private TextView animText;...private void animText(String text, int color, int xBlocks, int yBlocks) {    animText.setText(text);    animText.setTextColor(color);    animText.setVisibility(View.VISIBLE);    final int x = BOARD_X_OFFSET + xBlocks * xBlockSize;    final int y = BOARD_Y_OFFSET + yBlocks * yBlockSize;    final float SCALE_FROM = (float) 0.25;    final float SCALE_TO = (float) 5.0;    ScaleAnimation anim = new ScaleAnimation(SCALE_FROM, SCALE_TO, SCALE_FROM, SCALE_TO, x, y);    anim.setDuration(500);    animText.setAnimation(anim);    this.setAnimation(null);    startAnimation(anim);}}</code></pre><p>with animText being invoked in the onDraw() routine of the BoardView.  What I'm seeing, however, is the <em>board</em> zooming out, not the text, despite the above calls to setAnimation().</p><p>I've looked in the main android docs and at one other <a href=""http://stuffthathappens.com/blog/2008/11/13/android-animation-101/"" rel=""nofollow"">example</a>.  Even pointers in the right direction would be helpful.</p>","8002","","1777090","","2013-01-17 04:58:09","2013-01-17 04:58:09","How to animate text over another View in Android?","<android><animation>","1","0","2","",""
"769533","1","769595","","2009-04-20 18:33:23","2","921","<p>On <em>normal</em> JVMs you can use <code>META-INF/MANIFEST.MF</code> to declare application properties, in <code>J2ME</code> you can use the <code>.jad</code>-Files but what can you do on Android?</p><p>I need a way to declare properties which I can access using <code>System.getProperties()</code> on Android. It would be best if I could use the same file format as <code>MANIFEST.MF</code>-like property files use.</p>","55925","","839601","","2012-06-22 10:01:36","2012-06-22 10:01:36","Android MANIFEST.MF equivalent","<java><android><properties>","2","0","0","",""
"770558","1","821468","","2009-04-21 00:08:24","0","1430","<p>I have removed all Input Managers that were added, but it's still happening. Here is the crash report. Any ideas?</p><pre><code>Process:         emulator [460]Path:            /usr/local/dev/android/android-sdk-mac_x86-1.5_pre/tools/emulatorIdentifier:      emulatorVersion:         ??? (???)Code Type:       X86 (Native)Parent Process:  bash [275]Date/Time:       2009-04-20 20:03:44.786 -0400OS Version:      Mac OS X 10.5.6 (9G55)Report Version:  6Exception Type:  EXC_BAD_ACCESS (SIGBUS)Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000010Crashed Thread:  0Thread 0 Crashed:0   emulator                        0x000667a1 sock_address_init_resolve + 87 (sockets.c:631)Thread 0 crashed with X86 Thread State (32-bit):  eax: 0x00000008  ebx: 0xbfffcb98  ecx: 0x00000000  edx: 0x00000000  edi: 0xbfffcb5c  esi: 0x00000000  ebp: 0x0085fa90  esp: 0xbfffcb20   ss: 0x0000001f  efl: 0x00010202  eip: 0x000667a1   cs: 0x00000017   ds: 0x0000001f   es: 0x0000001f   fs: 0x00000000   gs: 0x00000037  cr2: 0x00000010Binary Images:    0x1000 -   0x19a46b +emulator ??? (???) /usr/local/dev/android/android-sdk-mac_x86-1.5_pre/tools/emulator0x8fe00000 - 0x8fe2db43  dyld 97.1 (???) &lt;100d362e03410f181a34e04e94189ae5&gt; /usr/lib/dyld0x90003000 - 0x90003ffd  com.apple.vecLib 3.4.2 (vecLib 3.4.2) /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib0x900a4000 - 0x904b4fef  libBLAS.dylib ??? (???) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib0x904b5000 - 0x904ddff7  com.apple.shortcut 1 (1.0) &lt;057783867138902b52bc0941fedb74d1&gt; /System/Library/PrivateFrameworks/Shortcut.framework/Versions/A/Shortcut0x904de000 - 0x9052fff7  com.apple.HIServices 1.7.0 (???) &lt;01b690d1f376e400ac873105533e39eb&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices0x90530000 - 0x9080aff3  com.apple.CoreServices.CarbonCore 786.11 (786.11) &lt;f06fe5d92d56ac5aa52d1ba182745924&gt; /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore0x9080b000 - 0x90820ffb  com.apple.ImageCapture 5.0.1 (5.0.1) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture0x9085b000 - 0x90871fff  com.apple.DictionaryServices 1.0.0 (1.0.0) &lt;ad0aa0252e3323d182e17f50defe56fc&gt; /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices0x90872000 - 0x908effef  libvMisc.dylib ??? (???) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib0x908f0000 - 0x908f6fff  com.apple.print.framework.Print 218.0.2 (220.1) &lt;8bf7ef71216376d12fcd5ec17e43742c&gt; /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print0x908f7000 - 0x908f8ffc  libffi.dylib ??? (???) &lt;a3b573eb950ca583290f7b2b4c486d09&gt; /usr/lib/libffi.dylib0x908f9000 - 0x90984fff  com.apple.framework.IOKit 1.5.1 (???) &lt;f9f5f0d070e197a832d86751e1d44545&gt; /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit0x91210000 - 0x912d7ff2  com.apple.vImage 3.0 (3.0) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage0x9155c000 - 0x91589feb  libvDSP.dylib ??? (???) &lt;b232c018ddd040ec4e2c2af632dd497f&gt; /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib0x91597000 - 0x9161eff7  libsqlite3.0.dylib ??? (???) &lt;6978bbcca4277d6ae9f042beff643f7d&gt; /usr/lib/libsqlite3.0.dylib0x9161f000 - 0x916bcfe4  com.apple.CFNetwork 422.15.2 (422.15.2) &lt;80851410a5592b7c3b149b2ff849bcc1&gt; /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork0x916bd000 - 0x916c4ff7  libCGATS.A.dylib ??? (???) &lt;386dce4b28448fb86e33e06ac466f4d8&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCGATS.A.dylib0x916c6000 - 0x91720ff7  com.apple.CoreText 2.0.4 (???) &lt;f9a90116ae34a2b0d84e87734766fb3a&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText0x91721000 - 0x91725fff  libmathCommon.A.dylib ??? (???) /usr/lib/system/libmathCommon.A.dylib0x91726000 - 0x91741ffb  libPng.dylib ??? (???) &lt;4780e979d35aa5ec2cea22678836cea5&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib0x917fa000 - 0x91805fe7  libCSync.A.dylib ??? (???) &lt;e6aceed359bd228f42bc1246af5919c9&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCSync.A.dylib0x9184b000 - 0x918d5fe3  com.apple.DesktopServices 1.4.7 (1.4.7) &lt;d16642ba22c32f67be793ebfbe67ca3a&gt; /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv0x918d6000 - 0x91969fff  com.apple.ink.framework 101.3 (86) &lt;bf3fa8927b4b8baae92381a976fd2079&gt; /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink0x9197a000 - 0x9197affd  com.apple.Accelerate.vecLib 3.4.2 (vecLib 3.4.2) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib0x9197b000 - 0x91a5cff7  libxml2.2.dylib ??? (???) &lt;306036e0070330e35045650e6d9f0d05&gt; /usr/lib/libxml2.2.dylib0x91a5d000 - 0x91a9efe7  libRIP.A.dylib ??? (???) &lt;5d0b5af7992e14de017f9a9c7cb05960&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libRIP.A.dylib0x91ada000 - 0x91e98fea  libLAPACK.dylib ??? (???) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib0x91e99000 - 0x91fdfff7  com.apple.ImageIO.framework 2.0.4 (2.0.4) &lt;6a6623d3d1a7292b5c3763dcd108b55f&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO0x920b5000 - 0x92134ff5  com.apple.SearchKit 1.2.1 (1.2.1) &lt;3140a605db2abf56b237fa156a08b28b&gt; /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit0x92135000 - 0x92135fff  com.apple.Carbon 136 (136) &lt;9961570a497d79f13b8ea159826af42d&gt; /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon0x9213b000 - 0x92184fef  com.apple.Metadata 10.5.2 (398.25) &lt;e0572f20350523116f23000676122a8d&gt; /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata0x92185000 - 0x921e1ff7  com.apple.htmlrendering 68 (1.1.3) &lt;fe87a9dede38db00e6c8949942c6bd4f&gt; /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HTMLRendering.framework/Versions/A/HTMLRendering0x921e2000 - 0x921e4fff  com.apple.securityhi 3.0 (30817) &lt;dbe328cd62d603a952a4226342711e8b&gt; /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI0x9220d000 - 0x92532fe2  com.apple.QuickTime 7.6.0 (1290) &lt;bc0920abbbaad03f5513ac7ffbd30633&gt; /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime0x9266c000 - 0x92676feb  com.apple.audio.SoundManager 3.9.2 (3.9.2) &lt;0f2ba6e891d3761212cf5a5e6134d683&gt; /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/CarbonSound0x92677000 - 0x92677ff8  com.apple.ApplicationServices 34 (34) &lt;8f910fa65f01d401ad8d04cc933cf887&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices0x92678000 - 0x92b49f3e  libGLProgrammability.dylib ??? (???) &lt;5d283543ac844e7c6fa3440ac56cd265&gt; /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib0x92b87000 - 0x92be4ffb  libstdc++.6.dylib ??? (???) &lt;04b812dcec670daa8b7d2852ab14be60&gt; /usr/lib/libstdc++.6.dylib0x92d47000 - 0x92d5fff7  com.apple.CoreVideo 1.6.0 (20.0) &lt;c0d869876af51283a160cd2224a23abf&gt; /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo0x92d61000 - 0x92ec8ff3  libSystem.B.dylib ??? (???) &lt;d68880dfb1f8becdbdac6928db1510fb&gt; /usr/lib/libSystem.B.dylib0x92ec9000 - 0x92f08fef  libTIFF.dylib ??? (???) &lt;3589442575ac77746ae99ecf724f5f87&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib0x92f09000 - 0x92f15ff9  com.apple.helpdata 1.0.1 (14.2) /System/Library/PrivateFrameworks/HelpData.framework/Versions/A/HelpData0x92f16000 - 0x935b6fff  com.apple.CoreGraphics 1.407.2 (???) &lt;3a91d1037afde01d1d8acdf9cd1caa14&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics0x935b7000 - 0x936efff7  libicucore.A.dylib ??? (???) &lt;18098dcf431603fe47ee027a60006c85&gt; /usr/lib/libicucore.A.dylib0x93829000 - 0x93858fe3  com.apple.AE 402.3 (402.3) &lt;4cb9ef65cf116d6dd424f0ce98c2d015&gt; /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE0x93859000 - 0x93871fff  com.apple.openscripting 1.2.8 (???) &lt;572c7452d7e740e8948a5ad07a99602b&gt; /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting0x93872000 - 0x938cbff7  libGLU.dylib ??? (???) /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib0x938cc000 - 0x938d0fff  libGIF.dylib ??? (???) &lt;572a32e46e33be1ec041c5ef5b0341ae&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib0x938d1000 - 0x938effff  libresolv.9.dylib ??? (???) &lt;a8018c42930596593ddf27f7c20fe7af&gt; /usr/lib/libresolv.9.dylib0x93908000 - 0x93ca5fef  com.apple.QuartzCore 1.5.7 (1.5.7) &lt;2fed2dd7565c84a0f0c608d41d4d172c&gt; /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore0x93cd0000 - 0x93cd9fff  com.apple.speech.recognition.framework 3.7.24 (3.7.24) &lt;d3180f9edbd9a5e6f283d6156aa3c602&gt; /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition0x93dde000 - 0x93deeffc  com.apple.LangAnalysis 1.6.4 (1.6.4) &lt;8b7831b5f74a950a56cf2d22a2d436f6&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis0x93e01000 - 0x93e01ffc  com.apple.audio.units.AudioUnit 1.5 (1.5) /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit0x93fa9000 - 0x94050feb  com.apple.QD 3.11.54 (???) &lt;b743398c24c38e581a86e91744a2ba6e&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD0x9405d000 - 0x94064fe9  libgcc_s.1.dylib ??? (???) &lt;a9ab135a5f81f6e345527df87f51bfc9&gt; /usr/lib/libgcc_s.1.dylib0x94065000 - 0x94089fff  libxslt.1.dylib ??? (???) &lt;0a9778d6368ae668826f446878deb99b&gt; /usr/lib/libxslt.1.dylib0x9408a000 - 0x94107feb  com.apple.audio.CoreAudio 3.1.1 (3.1.1) &lt;f35477a5e23db0fa43233c37da01ae1c&gt; /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio0x94158000 - 0x94158ffa  com.apple.CoreServices 32 (32) &lt;2fcc8f3bd5bbfc000b476cad8e6a3dd2&gt; /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices0x9418c000 - 0x94198ffe  libGL.dylib ??? (???) /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib0x95175000 - 0x951affe7  com.apple.coreui 1.2 (62) /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI0x951b0000 - 0x951bdfe7  com.apple.opengl 1.5.9 (1.5.9) &lt;7e5048a2677b41098c84045305f42f7f&gt; /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL0x955e2000 - 0x9560afff  libcups.2.dylib ??? (???) &lt;16bec7c6a004f744804e2281a1b1c094&gt; /usr/lib/libcups.2.dylib0x9560b000 - 0x9560dff5  libRadiance.dylib ??? (???) &lt;8a844202fcd65662bb9ab25f08c45a62&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib0x95856000 - 0x95866fff  com.apple.speech.synthesis.framework 3.7.1 (3.7.1) &lt;06d8fc0307314f8ffc16f206ad3dbf44&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis0x95867000 - 0x9586afff  com.apple.help 1.1 (36) &lt;b507b08e484cb89033e9cf23062d77de&gt; /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help0x9586b000 - 0x9586bff8  com.apple.Cocoa 6.5 (???) &lt;e064f94d969ce25cb7de3cfb980c3249&gt; /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa0x9586c000 - 0x9586cffb  com.apple.installserver.framework 1.0 (8) /System/Library/PrivateFrameworks/InstallServer.framework/Versions/A/InstallServer0x9587d000 - 0x95af8fe7  com.apple.Foundation 6.5.7 (677.22) &lt;8fe77b5d15ecdae1240b4cb604fc6d0b&gt; /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation0x95b73000 - 0x96371fef  com.apple.AppKit 6.5.6 (949.43) &lt;a3a300499bbe4f1dfebf71d752d01916&gt; /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit0x96372000 - 0x96405ff3  com.apple.ApplicationServices.ATS 3.4 (???) &lt;8c51de0ec3deaef416578cd59df38754&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS0x96406000 - 0x96425ffa  libJPEG.dylib ??? (???) &lt;e7eb56555109e23144924cd64aa8daec&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib0x96426000 - 0x96468fef  com.apple.NavigationServices 3.5.2 (163) &lt;91844980804067b07a0b6124310d3f31&gt; /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/NavigationServices.framework/Versions/A/NavigationServices0x96469000 - 0x9654eff3  com.apple.CoreData 100.1 (186) &lt;8e28162ef2288692615b52acc01f8b54&gt; /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData0x965a1000 - 0x965a1ffd  com.apple.Accelerate 1.4.2 (Accelerate 1.4.2) /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate0x965a2000 - 0x965a9ffe  libbsm.dylib ??? (???) &lt;d25c63378a5029648ffd4b4669be31bf&gt; /usr/lib/libbsm.dylib0x965aa000 - 0x96675fff  com.apple.ColorSync 4.5.1 (4.5.1) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync0x9667c000 - 0x9672cfff  edu.mit.Kerberos 6.0.12 (6.0.12) &lt;685cc018c133668d0d3ac6a1cb63cff9&gt; /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos0x96733000 - 0x96771ff7  libGLImage.dylib ??? (???) &lt;1123b8a48bcbe9cc7aa8dd8e1a214a66&gt; /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib0x96772000 - 0x967feff7  com.apple.LaunchServices 290.3 (290.3) &lt;6f9629f4ed1ba3bb313548e6838b2888&gt; /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices0x96809000 - 0x96840fff  com.apple.SystemConfiguration 1.9.2 (1.9.2) &lt;8b26ebf26a009a098484f1ed01ec499c&gt; /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration0x96841000 - 0x96b49fff  com.apple.HIToolbox 1.5.4 (???) &lt;3747086ba21ee419708a5cab946c8ba6&gt; /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox0x96b7d000 - 0x96d4bff3  com.apple.security 5.0.4 (34102) &lt;55dda7486df4e8e1d61505be16f83a1c&gt; /System/Library/Frameworks/Security.framework/Versions/A/Security0x96d60000 - 0x96e40fff  libobjc.A.dylib ??? (???) &lt;7b92613fdf804fd9a0a3733a0674c30b&gt; /usr/lib/libobjc.A.dylib0x96e41000 - 0x96f93ff3  com.apple.audio.toolbox.AudioToolbox 1.5.2 (1.5.2) /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox0x96f94000 - 0x97046ffb  libcrypto.0.9.7.dylib ??? (???) &lt;69bc2457aa23f12fa7d052601d48fa29&gt; /usr/lib/libcrypto.0.9.7.dylib0x97047000 - 0x97101fe3  com.apple.CoreServices.OSServices 226.5 (226.5) &lt;2a135d4fb16f4954290f7b72b4111aa3&gt; /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices0x97142000 - 0x9716dfe7  libauto.dylib ??? (???) &lt;42d8422dc23a18071869fdf7b5d8fab5&gt; /usr/lib/libauto.dylib0x972ee000 - 0x972f6fff  com.apple.DiskArbitration 2.2.1 (2.2.1) &lt;75b0c8d8940a8a27816961dddcac8e0f&gt; /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration0x97389000 - 0x97397ffd  libz.1.dylib ??? (???) &lt;5ddd8539ae2ebfd8e7cc1c57525385c7&gt; /usr/lib/libz.1.dylib0x97398000 - 0x974cbfff  com.apple.CoreFoundation 6.5.5 (476.17) &lt;4a70c8dbb582118e31412c53dc1f407f&gt; /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation0x974cc000 - 0x974d1fff  com.apple.CommonPanels 1.2.4 (85) &lt;ea0665f57cd267609466ed8b2b20e893&gt; /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels0x97502000 - 0x9757cff8  com.apple.print.framework.PrintCore 5.5.3 (245.3) &lt;222dade7b33b99708b8c09d1303f93fc&gt; /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore0xfffe8000 - 0xfffebfff  libobjc.A.dylib ??? (???) /usr/lib/libobjc.A.dylib0xffff0000 - 0xffff1780  libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylib</code></pre>","93498","","3065448","","2014-02-24 07:55:03","2014-02-24 07:55:03","Bus error when running Android 1.5 emulator on Mac OS X 10.5.6","<android><osx><terminal>","1","1","","",""
"773690","1","779588","","2009-04-21 17:30:48","14","46726","<p>I know how to put the icon on each tab, that is no problem. I also ran across this :[Stack Overflow thread on pretty much same thing][1]</p><p>I followed one of the links from that question, and found [this][2]</p><p>Pretty much, it said use a selector defined in the xml, sure, did that. But there is no id associated w/ it so I am not sure how to get the selector function as a drawable so I can use it as the icon for the tabs. Maybe I am going about this the wrong way.. But this is what I have, and obviously missing something.</p><pre><code>&lt;selector    android:id=""@+id/myselector""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;!-- Non focused states --&gt;    &lt;item        android:state_focused=""false""        android:state_selected=""false""        android:state_pressed=""false""        android:drawable=""@drawable/darklogo"" /&gt;    &lt;item        android:state_focused=""false""        android:state_selected=""true""        android:state_pressed=""false""        android:drawable=""@drawable/lightlogo"" /&gt;    &lt;!-- Focused states --&gt;    &lt;item        android:state_focused=""true""        android:state_selected=""false""        android:state_pressed=""false""        android:drawable=""@drawable/lightlogo"" /&gt;    &lt;item        android:state_focused=""true""        android:state_selected=""true""        android:state_pressed=""false""        android:drawable=""@drawable/lightlogo"" /&gt;    &lt;!-- Pressed --&gt;    &lt;item        android:state_pressed=""true""        android:drawable=""@drawable/lightlogo"" /&gt;&lt;/selector&gt;</code></pre><p>In my code, an example tab is generated using :</p><pre><code>  host.addTab(host.newTabSpec(""three"")                  .setIndicator(""map"",drawables)                  .setContent(new Intent(this, Map.class))); </code></pre><p>Right now drawables is just a reference to an drawable image resource. How do I make the selector a drawable? </p><p>This is my question  [1]: <a href=""http://stackoverflow.com/questions/36881/updating-android-tab-icons"">Updating Android Tab Icons</a> [2]: <a href=""http://groups.google.com/group/android-evelopers/browse_thread/thread/ef3bdebcb715b385"" rel=""nofollow"">http://groups.google.com/group/android-evelopers/browse_thread/thread/ef3bdebcb715b385</a></p>","393258","","750613","","2012-06-22 09:55:16","2012-06-22 09:55:56","Android : Customizing tabs on state : How do I make a selector a drawable","<android><tabs><selector><drawable>","2","0","12","",""
"774545","1","","","2009-04-21 20:53:21","0","2718","<p>I am calling the ZXing scanner from Screen-A using <code>Intent</code>s.  Once the scan is done, control returns, of course, to the code behind Screen-A and I do some other work before calling Screen-B.</p><p>Problem is: the screen is black during this work period and I cannot determine the proper context to use to display a ""working..."" Toast/msgbox.  Any help or suggestions?</p><p>Regards,Jim</p>","","Jim","489607","","2012-04-10 03:15:32","2012-06-22 09:51:28","Android: determining the current context to display an alert","<android><multithreading><android-intent><context><offloading>","2","2","","",""
"775188","1","","","2009-04-21 23:56:50","9","60655","<p>I have an application that will have 5-15 buttons depending on what is available from a backend.  How do I define the proper GridView layout files to include an array of buttons that will each have different text and other attributes?  Each button will essentially add an item to a cart, so the onClick code will be the same except for the item it adds to the cart.</p><p>How can I define an array so I can add a variable number of buttons, but still reference each of them by a unique ID?  I've seen examples of the <a href=""http://developer.android.com/guide/samples/ApiDemos/res/values/arrays.html"">arrays.xml</a>, but they have created an array of strings that are pre-set.  I need a way to create an object and not have the text defined in the layout or arrays xml file.</p><p><strong>Update - Added info about adding to a GridView</strong></p><p>I want to add this to a GridView, so calling the <a href=""http://developer.android.com/reference/android/widget/AdapterView.html#addView%28android.view.View,%20int"">addView method</a> results in an UnsupportedOperationException.  I can do the following:</p><pre><code>ImageButton b2 = new ImageButton(getApplicationContext());b2.setBackgroundResource(R.drawable.img_3);android.widget.LinearLayout container = (android.widget.LinearLayout) findViewById(R.id.lay);container.addView(b2);</code></pre><p>but that doesn't layout the buttons in a grid like I would like.  Can this be done in a GridView?</p>","4555","","750613","","2012-06-22 09:50:26","2012-06-22 09:50:54","Add an array of buttons to a GridView in an Android application","<android><arrays><button><dynamic><android-gridview>","3","0","4","",""
"785973","1","786588","","2009-04-24 14:03:08","165","80717","<p>I am creating an application which connects to the server using username/password and I would like to enable the option ""Save password"" so the user wouldn't have to type the password each time the application starts.</p><p>I was trying to do it with Shared Preferences but am not sure if this is the best solution.</p><p>I would appreciate any suggestion on how to store user values/settings in Android application.</p>","22996","","1279334","","2012-09-21 14:30:40","2013-12-03 10:40:56","What is the most appropriate way to store user settings in Android application","<java><android><preferences><credentials><saving-data>","13","0","90","",""
"786334","1","823650","","2009-04-24 15:24:19","3","7915","<p>I have an application using the following layout :</p><p><img src=""http://img15.imageshack.us/img15/238/screenshot003xbo.png"" alt=""alt text"" /></p><p>When the app start, the focus is on the first TextView, but if you try to type any letter in it, the focus goes directly to the tabs. It seems that I am not the only one <a href=""http://groups.google.com/group/android-developers/browse%5Fthread/thread/f3fdd1eb17288886/0d28c51a6b9ffdfe?lnk=gst&amp;q=tab%2Bfocus#0d28c51a6b9ffdfe"" rel=""nofollow"">fighting with this issue</a>, and maybe this is related to the following :</p><p><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/435791bbd6c550a/8022183887f38f4f?lnk=gst&amp;q=tabs+focus#8022183887f38f4f"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/435791bbd6c550a/8022183887f38f4f?lnk=gst&amp;q=tabs+focus#8022183887f38f4f</a></p><p>Anyway, have you any idea of why that happens ? And of course, any workaround would be appreciated.</p><p><hr /></p><p>I post the code below to avoid overloading the question :</p><p>The XML :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout           android:padding=""5px""          android:orientation=""vertical""           android:id=""@+id/task_edit_panel""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""           android:layout_weight=""50"" &gt;        &lt;LinearLayout android:orientation=""vertical""    		android:layout_width=""fill_parent""    		android:layout_height=""wrap_content""&gt;    		&lt;TextView android:layout_width=""wrap_content""    			android:layout_height=""wrap_content""     			android:text=""@string/title""     		    android:textStyle=""bold"" /&gt;    		&lt;EditText android:id=""@+id/title""     		  android:layout_width=""fill_parent""    			android:layout_height=""fill_parent"" /&gt;    	&lt;/LinearLayout&gt;    	&lt;TabHost android:id=""@+id/edit_item_tab_host""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""&gt;             &lt;TabWidget android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""                         android:id=""@android:id/tabs"" /&gt;     		&lt;FrameLayout              android:id=""@android:id/tabcontent""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:paddingTop=""65px""&gt; &lt;!--  you need that if you don't want the tab content to overflow --&gt;               &lt;LinearLayout                   android:id=""@+id/edit_item_date_tab""                   android:orientation=""vertical""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    android:padding=""5px"" &gt;     				&lt;TextView android:layout_width=""wrap_content""    						android:layout_height=""wrap_content""     						android:text=""date""     						 android:textStyle=""bold"" /&gt;    			&lt;/LinearLayout&gt;    		    &lt;LinearLayout                   android:id=""@+id/edit_item_geocontext_tab""                   android:orientation=""vertical""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    android:padding=""5px"" &gt;     			&lt;TextView android:layout_width=""wrap_content""    						android:layout_height=""wrap_content""     						android:text=""lieu""     						 android:textStyle=""bold"" /&gt;    			&lt;/LinearLayout&gt;    	        &lt;LinearLayout                   android:id=""@+id/edit_item_text_tab""                   android:orientation=""vertical""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                     android:padding=""5px""&gt;     			&lt;EditText android:id=""@+id/details""     				    android:layout_width=""fill_parent""    					android:layout_height=""fill_parent""    					android:scrollbars=""vertical"" /&gt;    			&lt;/LinearLayout&gt;    		&lt;/FrameLayout&gt;    	&lt;/TabHost&gt;    &lt;/LinearLayout&gt;    &lt;!-- Bottom pannel with ""add item"" button --&gt;    &lt;LinearLayout           android:padding=""5px""          android:orientation=""horizontal""           android:layout_weight=""1""          android:id=""@+id/task_edit_panel""          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:background=""#E7E7E7"" &gt;          &lt;!--  Let the height set to fill_parent until we find a better way for the layout  --&gt;          &lt;Button android:id=""@+id/item_edit_ok_button""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:layout_gravity=""bottom""                android:text=""@string/ok""                style=""?android:attr/buttonStyleSmall""                android:layout_weight=""1"" /&gt;           &lt;Button android:id=""@+id/item_edit_cancel_button""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:layout_gravity=""bottom""                android:text=""@string/cancel""                style=""?android:attr/buttonStyleSmall""                android:layout_weight=""1"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>And the Java code :</p><pre><code>    TabHost tab_host = (TabHost) findViewById(R.id.edit_item_tab_host);     // don't forget this setup before adding tabs from a tabhost using a xml view or you'll get an nullpointer exception    tab_host.setup();     TabSpec ts1 = tab_host.newTabSpec(""TAB_DATE"");    ts1.setIndicator(getString(R.string.when), getResources().getDrawable(R.drawable.ic_dialog_time));    ts1.setContent(R.id.edit_item_date_tab);    tab_host.addTab(ts1);    TabSpec ts2 = tab_host.newTabSpec(""TAB_GEO"");    ts2.setIndicator(getString(R.string.where),  getResources().getDrawable(R.drawable.ic_dialog_map));    ts2.setContent(R.id.edit_item_geocontext_tab);    tab_host.addTab(ts2);    TabSpec ts3 = tab_host.newTabSpec(""TAB_TEXT"");    ts3.setIndicator(getString(R.string.what),  getResources().getDrawable(R.drawable.ic_menu_edit));    ts3.setContent(R.id.edit_item_text_tab);    tab_host.addTab(ts3);    tab_host.setCurrentTab(0);</code></pre>","9951","","","","","2013-02-27 16:00:56","Why is is a TabHost stealing focus from a TextView in Android?","<android><focus>","4","0","6","",""
"788455","1","788520","","2009-04-25 07:33:40","0","1767","<p>I want to have a listener for a socket at the client side. I am using Android which is Java. I am using TCP/IP but I don't want to loop at the client side. </p><p>Is there any method for that or do I have to have my own mechanism for listening?</p><p>Any help would be appreciated. Thanks,</p>","95877","","750613","","2012-06-22 09:49:46","2012-06-22 09:49:46","Listener to socket at client(Android)","<java><android><networking><sockets>","1","0","","",""
"792155","1","792168","","2009-04-27 03:22:53","17","17196","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/144254/getting-started-with-android"">Getting started with Android</a>  </p></blockquote><p>I'm interested about learning how to develop applications for Android. I downloaded the Android SDK but I don't see where to begin. Any suggestion? Any literature?Thanks in advance for your answers.</p>","91857","","12178","","2009-04-27 04:59:44","2011-12-13 11:18:33","How to start developing applications for Android?","<android>","3","7","24","2011-12-18 07:10:49",""
"792185","1","794526","","2009-04-27 03:42:20","11","10067","<p>I'm developing a game for Android. It's got a lot going on but is running reasonably smoothly. That is, of course, until the user touches the screen.</p><p>While they're touching it, <code>onTouchEvent</code> is called (with <code>action = ACTION_MOVE</code>, <code>x = 0</code> and <code>y = 0</code>) roughly once every ten milliseconds at what appears to be a fairly high priority, as it absolutely obliterates the framerate. As soon as the touch ends the framerate returns to its nice state.</p><p>I've tried</p><ul><li>having <code>onTouchEvent</code> handle input for the game as usual</li><li>having <code>onTouchEvent</code> return <code>true</code> straight away</li><li>not having <code>onTouchEvent</code> implemented at all</li></ul><p>The problem persists in all three situations.</p><p>Has anyone encountered this? Is there a way to reduce the rate at which <code>ACTION_MOVE</code> events are generated, or to ensure that they're only generated when there is actual movement, or use a polling method that just gets the current location of the touch? Or even just a way to disable it entirely?</p>","49697","","387076","","2011-09-29 23:34:52","2011-11-14 19:20:56","Why are touch events destroying my Android framerate?","<android><touch><polling><frame-rate>","5","0","6","",""
"792923","1","","","2009-04-27 10:06:11","3","6166","<p>I've got a question that is annoying me.</p><p>With Android, I've got an application that seems to be calling <code>onCreate</code> every time a new instance of an activity is created, because this activity is the son of an another and it finishes itself while it ends its role for one piece of data.</p><p>The calling of <code>onCreate</code> every time seems to be re-parsing the XML to create the views and re-attaching/re-creating the listeners to the code and so on. So Is there a way to cache an activity to be recalled every time, without seeing it if we click on the back button in the mobile device? It's like having it really hidden (not accessible with the back button) and destroyed only if it's necessary.</p><p>Thanks everyone in advance :)</p>","","EB- Iliass","20578","","2013-02-14 11:37:33","2013-02-14 11:37:33","How to cache views with Android and avoid calling onCreate everytime","<android><oncreate>","4","0","","",""
"793029","1","3943831","","2009-04-27 10:47:24","3","2630","<p>How to test my IBinder object that Service return on onBind ?</p>","96486","","750613","","2012-06-22 09:44:23","2012-06-22 09:44:23","Android Service Testing","<android><unit-testing><service><automated-tests>","1","1","1","",""
"796172","1","","","2009-04-28 04:04:18","1","2194","<p>I want to type in different languages in android other than english like hebrew... by providing ttf files. Are there any in build API's so I can use that?Any help would be appreciated,</p>","95877","","750613","","2012-06-22 09:32:50","2012-06-22 09:32:50","Language support on android","<java><android><internationalization>","4","0","1","",""
"796665","1","796690","","2009-04-28 07:38:31","0","626","<p>Well, put it this way. I have already tested an Android application in emulator. Now I want to try that in a real G1 phone. But I am not able to run 1.5 SDK on my G1. Could anyone help me with this, please.</p>","95877","","750613","","2012-06-22 09:31:36","2012-06-22 09:31:36","How can I get the Android SDK, version 1.5, to run on my G1 phone?","<java><android>","2","1","","",""
"799607","1","803960","","2009-04-28 20:06:05","2","2236","<pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;ImageView				    	android:layout_width=""wrap_content""    	android:layout_height=""wrap_content""    	android:layout_centerHorizontal=""true""    	android:src=""@drawable/wallpaper"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Size of ""@drawable/peetscoffee_wallpaper"" is 640x480 , but it is not centered horisontally.How to fix it?</p>","96486","","","","","2012-06-22 09:12:38","ImageView trouble","<android><layout><uiimageview>","1","0","","",""
"801144","1","","","2009-04-29 06:39:37","4","3852","<p>I have  created an <code>XML</code> and i am having an <code>XSD</code> file and i have to validate the xml with this schema ,can i get any example for doing that . And where i have to place the xsd file in my project so that i can validate with that schema.    </p>","95877","","750613","","2012-06-30 11:38:55","2013-09-17 22:29:28","Android schema validation","<java><android><xml-schema>","4","0","2","",""
"801270","1","804623","","2009-04-29 07:32:59","2","6726","<p>I have a layout in which I am displaying a webview. I want to add images on top of the webview at specific places through code.</p><p>Can some one please tell me how to do that?</p><p>The translucent background example in API Demos makes the view cover the whole screen. I want to place only a small image and at a specific location (origin not 0,0)</p><p>Thanks a lot.</p>","46297","","2559445","","2013-07-08 05:58:48","2013-07-08 05:58:48","Android - how do I place an image on top of my existing layout through code?","<android><android-webview><android-imageview>","2","0","","",""
"801632","1","","","2009-04-29 09:42:40","2","1160","<p>In java there is class SchemaFactory which is used for schema validation but it is not available in android is there any other option available  </p>","95877","","4023","","2009-04-29 11:03:02","2009-04-30 06:46:50","Android schema","<java><android><validation><xml-schema>","3","0","","",""
"808645","1","1819182","","2009-04-30 19:26:17","2","1919","<p>I have a <code>BroadcastReceiver</code> catching <code>ACTION_NEW_OUTGOING_CALL</code> events.</p><p>In the <code>onReceive()</code> method I'm sending the supplied number to a new <code>ListActivity</code>, where the user gets to choose various new destination numbers from a list.</p><p>When the user selects a new number from the list I'm then starting a new <code>ACTION_CALL</code> intent with the new number in the URI field. Alternatively, the result might be the original number.</p><p>Whatever the new number is, it has to be dialled immediately and not processed any further.</p><p>How can I let the <code>BroadcastReceiver</code> know that this resulting number shouldn't be processed yet again?</p>","6782","","","","","2013-08-13 07:30:19","Android - stopping NEW_OUTGOING_CALL events from looping?","<android><listener>","2","0","1","",""
"809763","1","","","2009-05-01 00:40:43","11","1459","<p>I'm porting a game to Android (there's a lot of code and very little of it is mine), and DalvikVM is telling me (through LogCat) all about the garbage collection. At some point in the code, I get a stream of ""GC freed x objects / x ms"" messages, basically informing me that ~150,000 objects have just been deleted and it's taking a full second.</p><p>I want to know where these came from! I am pretty sure I'm not creating that many objects intentionally.</p><p>So, is there a way to get... basically the opposite of that message? Something that prints a log message when any object is <em>created</em>?</p><p>That way I could step over the code, checking how many messages are generated, and seeing which parts of code are generating the objects. I suspect some form of object creation in part of a loop, but if possible this would be an easy way to tell for sure.</p><p>I'm using Eclipse 3.4.2, if that's relevant.</p><p>Any ideas?</p>","49697","","","","","2009-05-03 15:52:33","Android: Track number of objects created","<android><garbage-collection><debugging><profiling><allocation>","2","2","3","",""
"809878","1","823643","","2009-05-01 01:29:13","12","19832","<p>Suppose I have the URL for large animated gif and I wanted to make a youtube like activity that displays the animation in a streaming way.  How do I </p><ol><li>stream in the image?</li><li>get it do display with actual animation?</li></ol><p>I know <code>ImageView</code> is not the answer as it only shows the first frame.  </p><p>A bonus would be having access to its buffering status so I can synchronize streaming sound as well -- this is part of a <a href=""http://ytmnd.com/"">YTMND</a> viewer application.  While I could create a service that transcodes the public gif files into a nicer format, I'd like the app to function without additional dependencies.</p>","98154","","114066","","2010-07-02 06:49:51","2011-07-10 15:10:07","Android: How do a display a large animated gif given a url?","<android><animated-gif>","3","3","8","",""
"818677","1","818799","","2009-05-04 03:15:37","21","34001","<p>I've got an android app using a local sqlite database.</p><pre><code>private SQLiteDatabase mDb;</code></pre><p>when I run this query I get my Cursor over rows with pid equal to id, as desired:</p><pre><code>mDb.query(true, PT_TABLE, new String[] {KEY_PID, KEY_TID},     KEY_PID+"" = ""+id, null, null, null, null, null);        </code></pre><p>when I run the following query, aiming to get that same result set, ordered by pid I get ""<strong>android.database.sqlite.SQLiteException: datatype mismatch</strong>""</p><pre><code>mDb.query(true, PT_TABLE, new String[] {KEY_PID, KEY_TID},     KEY_PID+"" = ""+id, null, null, null, null, KEY_PID+"" DESC"");</code></pre><p>Any ideas?</p>","58164","","750613","","2012-06-30 11:36:56","2013-06-16 09:23:51","android: ORDER BY in query","<android><sqlite>","3","0","2","",""
"820398","1","866184","","2009-05-04 14:41:14","20","38914","<p>I am using a custom title view in my application for each activity. In one of the activities, based on button clicks I need to change the custom title view. Now this works fine every time when I make a call to setFeatureInt.</p><p>But if I try to update any items in the custom title (say change the text of a button or a text view on the title), the update does not take place.</p><p>Debugging through the code shows that the text view and button instances are not null and I can also see the custom title bar. But the text on the text view or the button is not updated. Has anyone else faced this problem?How do I resolve it?</p><p>Thanks.</p><p><strong>EDIT</strong></p><p>Here's what I tried. Does not get updated even on calling postInvalidate.</p><pre><code>    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.text_title);	TextView databar = (TextView) findViewById(R.id.title_text);	databar.setText(""Some Text"");	databar.postInvalidate();	Button leftButton = (Button) findViewById(R.id.left_btn);	leftButton.setOnClickListener(mLeftListener);	leftButton.setText(""Left Btn"");	leftButton.postInvalidate();	Button rightBtn = (Button) findViewById(R.id.right_btn);	rightBtn.setOnClickListener(mRightListener);	rightBtn.postInvalidate();</code></pre>","46297","","310001","","2010-11-09 10:31:24","2011-06-24 19:06:49","Android - change custom title view at run time","<android>","4","1","27","",""
"821085","1","821098","","2009-05-04 17:36:15","28","10518","<p>Is there a strategy or at least best practice to write an app that runs on iPhone, BlackBerry and Android?</p><p>I'm ignorant about the development environments for BB and Android, but I assume they both support Java apps.</p><p>I know that the iPhone would require an ObjectiveC portion (as well as a whole new UI).</p><p>Has anyone done this?</p>","245","","","","","2012-04-05 14:19:04","Technology to write iPhone, BlackBerry and Android phone at the same time?","<iphone><android><blackberry>","12","4","16","2012-12-24 18:28:07",""
"822841","1","","","2009-05-05 00:59:11","0","560","<p>Several recent applications (e.g. Shazam) have text and image ads which are handled by Google.  I can't seem to find how they did this.  Is there some new API that you can use to display ads given some key, similar to how the maps API works? Or is this something that developers individually negotiate?</p><p>Specifically I'm interested in Google's ads.</p>","98154","","98154","","2009-05-07 04:57:12","2009-10-24 22:06:11","Android: Recent apps seem to have Google-provided ads, is there some new API for this?","<android><advertising>","3","0","3","",""
"823670","1","828717","","2009-05-05 07:01:36","2","5990","<p>I'd like to create an app that allow you to filter incomming call to various answering message with :</p><ul><li>""this number is not available"" for black listed phone numbers</li><li>A formal message for strangers</li><li>A informative message about what your doing for friends</li></ul><p>I don't know I you can get automatically a call, play a recorded message then wait for the answer and record it. Or maybe there is just a way to interact with the actual anwsering system so I just have to plug in. </p><p>Any clue strongly appreciated. A human sacrifice for any code snippet :-)</p>","9951","","","","","2012-02-10 15:04:46","Is there a way to to create a custom answering machine in android?","<android>","4","0","4","",""
"825029","1","826351","","2009-05-05 14:07:25","3","780","<p>I would like to create an ermergency call application : if triggered, it calls a given number and play an audio file, giving the information the caller couldn't give himself.</p><p>For that I need to engage a call but ensure that I can replace any sound from the speaker with an played audio file. Can I do that in android ? What's the way ?</p>","9951","","","","","2009-05-05 18:47:30","Is there a way to phone somebody and play an audio file in android?","<android><audio>","1","4","0","",""
"826970","1","828570","","2009-05-05 21:24:18","0","1821","<p>What I've read seems to indicate that the only way to do it is to use unofficial APIs that are being locked down in Cupcake (1.5). Is this true?</p>","76835","","76835","","2009-05-06 08:58:37","2009-05-06 08:59:11","Is there a way to raise the backlight on an Android device through the official API?","<android><mobile>","1","0","","",""
"828280","1","855486","","2009-05-06 06:24:46","27","15443","<p>I've seen any number of examples and they all seem to solve this problem differently. Basically I just want the simplest way to make the request that won't lock the main thread and is cancelable.</p><p>It also doesn't help that we have (at least) 2 HTTP libraries to choose from, java.net.* (such as HttpURLConnection) and org.apache.http.*. </p><p>Is there any consensus on what the best practice is?</p>","76835","","","","","2013-05-27 12:33:18","Is there an accepted best-practice on making asynchronous HTTP requests in Android?","<java><android><http>","3","4","14","",""
"830309","1","911387","","2009-05-06 15:53:29","1","2706","<p>I am planning to port a flash player to Android OS. Presently Android is not supporting the Flash. I have looked into GNash, an open source flash player but the problem with this is that it is not supporting the latest version flash files and we can't open the youtube with GNash.</p><p>Are there any open source light-weight flash players which can be ported to Android.</p><p>EDIT: I have also tried SwfDec but even this one is not playing the videos from youtube.</p><p>Any other open source players which can play youtube videos?</p>","28641","","28641","","2009-05-07 16:18:11","2011-02-21 01:14:38","Flash support in Android","<android><flash>","5","1","","",""
"834139","1","834207","","2009-05-07 11:30:22","3","3995","<p>Today I faced a very weird problem. In my game I create AlertDialog to show the user next level challenges when one is succeeded. So, the corresponding code is like this. when the game is succeeded showDialog(R.id.display_success) is called and the following code is executed.</p><p>So, I am expecting to execute this code in every call. However; the game is executing only once and showing the same AlertDialog in every other execution. I mean, like the instance is not created after the first one is created and the first instance is used all the time. I hope I was able to describe my problem.</p><pre><code>case R.id.display_success:                  updateGameSettings();       message = formatLevel()       + formatMission();       return new AlertDialog.Builder(this)       .setIcon(R.drawable.smiley_happy)       .setTitle(R.string.dialog_success)       .setMessage(message)       .setPositiveButton(R.string.alert_dialog_newgame, new DialogInterface.OnClickListener() {               public void onClick(DialogInterface dialog,     int whichButton) {                       startANewGame();               }       })       .setNegativeButton(R.string.exit, new DialogInterface.OnClickListener() {               public void onClick(DialogInterface dialog, int whichButton) {                     finish();               }       })       .create();</code></pre>","40929","","746010","","2012-01-28 23:18:02","2012-01-28 23:18:02","Android: Can not change the text appears in AlertDialog","<android><text><dialog>","2","0","","",""
"838499","1","838790","","2009-05-08 06:40:42","2","806","<p>I have been tasked with porting a large Java codebase to the Android platform.  The project makes extensive use of AWT which isn't' supported on Android.</p><p>I'm looking for a tool that lets me visualize all of the classes in the project.  I'd like to be able to see all of the relationships between classes so that I can get a good idea of where to start the port.</p><p>If you have any suggestions that would help in this task I'd like to hear about them.</p>","103345","","","","","2009-05-08 19:23:55","Visualizing Java project","<java><android>","3","0","1","",""
"839435","1","","","2009-05-08 11:39:58","17","9944","<p>When i am including the jaxp jar file i am getting the error as follows </p><pre><code>trouble processing ""javax/xml/XMLConstants.class"":[2009-05-08 16:53:18 - TestProject] Attempt to include a core VM class in something other than a core library.It is likely that you have attempted to include the core library from a desktopvirtual machine into an application, which will most assuredly not work. Ifyou really intend to build a core library -- which is only appropriate aspart of creating a full virtual machine binary, as opposed to compiling anapplication -- then use the ""--core-library"" option to suppress this errormessage. If you go ahead and use ""--core-library"" but are in fact buildingan application, then please be aware that your build will still fail at somepoint; you will simply be denied the pleasure of reading this helpful errormessage.[2009-05-08 16:53:18 - TestProject] 1 error; aborting[2009-05-08 16:53:18 - TestProject] Conversion to Dalvik format failed with error 1</code></pre><p>is anybody has faced this problem any help will be really appreciated i have goend some solution but they are not specific </p>","","Samson1982","12423","","2009-05-08 12:20:06","2013-12-17 00:00:04","Android core library error","<android>","5","4","9","",""
"842997","1","","","2009-05-09 09:01:41","0","1400","<p>I am using ANT to build android project ,I am adding external jar in the lib folder and trying to build the project it builds perfectly but i am getting run time error ...i have seen some groups they have said that the build.xml has to be modified with these changes </p><pre><code>&lt;target name=""dex"" depends=""compile""&gt;     &lt;exec executable=""${dx}"" failonerror=""true""&gt;         &lt;arg value=""-JXmx384M"" /&gt;         &lt;arg value=""--dex"" /&gt;         &lt;arg value=""--output=${basedir}/${intermediate-dex}"" /&gt;         &lt;arg value=""--locals=full"" /&gt;         &lt;arg value=""--positions=lines"" /&gt;         &lt;arg path=""${basedir}/${outdir-classes}"" /&gt;     &lt;/exec&gt; &lt;/target&gt; </code></pre><p>Add a new arg after the last one:     </p><p>but when i add the same it is not building does any body have occured with the same problem ......and the error is no command specified</p>","","Samson1982","114066","Samson1982","2010-07-29 09:11:55","2010-07-29 09:11:55","Android project using Ant","<android><ant>","1","3","","",""
"843223","1","","","2009-05-09 12:33:16","0","2046","<p>I am new to wordpress and I want to create an interface for being able to access my database hosted on wordpress in my mobile applications - particularly iPhone and Android.</p><p>As these do not directly access SQL databases and would need routines on the server-side for being able to do so, what would be the best way for me to go about writing these routines/web-service calls?</p><p>Are there any wordpress plugins available for this? If not, what language should I use - php or something else?</p><p>I need some lead.</p>","46297","","1777090","","2013-01-21 06:39:37","2013-01-21 06:39:37","Wordpress database access in mobile applications","<iphone><database><android><wordpress>","3","1","","",""
"843675","1","","","2009-05-09 17:13:01","66","79101","<p>On an Android Cupake (1.5) enabled device, how do I check and activate the GPS? </p>","103766","","2401535","","2014-04-02 10:10:43","2014-04-02 10:10:43","How do I find out if the GPS of an Android device is enabled","<android><gps><android-sensors>","5","0","50","",""
"844972","1","870933","","2009-05-10 08:53:56","2","4571","<p>What I want to do is a database listviewWith a small image button and text on the right sideThe I want the small image to change with a URL given by A text file but I am stuck and the 2 hour rule is up</p><p>For(file lenght)So URL  is www.site.com/images/(i++).png</p>","52766","","","","","2011-08-12 14:28:57","is it possible to put an image from a URL in a imagebutton in android?","<android>","2","2","2","",""
"846748","1","","","2009-05-11 04:54:13","2","3660","<p>I have created an XML and i want to validate with schema i.e, xsd file but there are no direct classes provided by android for the same if i am not wrong ......... and there is an external jar named jaxp1.3 which doesnt allow me to compile the code is it because the bytecode of desktop and android are different? which has the classes schema factory and validator which does the validation stuff ......Is there an other option available . Any help would be appreciated ..... desperately searching for the ans.......... </p>","95873","","","","","2013-09-17 22:33:23","XML Schema Validation in Android","<java><android>","3","0","","",""
"846942","1","5136575","","2009-05-11 06:26:28","3","10595","<p>Is it possible to get the calendar's entries from the phone offline? It seem the only way is to use <a href=""http://code.google.com/p/gdata-java-client/"" rel=""nofollow"">gdata-java-client</a>.</p>","35084","","2559445","","2013-07-08 05:57:18","2013-07-08 05:57:18","Is there a way to access the calendar's entries without using gdata-java-client?","<android><android-calendar>","7","0","6","",""
"847664","1","5937092","","2009-05-11 11:18:17","27","23259","<p>My application uses quite a lot of pictures that are downloaded from the internet and cached locally on the Android phone. I am wondering, what is the correct way to save those pictures. There are several ways I see, that are not fully satisfying.</p><p>Save them on SD Card in a public folder</p><ul><li>Uses up space that wont be freed on uninstall</li><li>User can see pics in Gallery</li><li>Needs a folder on the sdcard root (you can actually see it while browsing your phone)</li></ul><p>Save them on SD Card in a non-public folder</p><ul><li>Uses up space that wont be freed on uninstall</li><li>Secretly uses space on the SD Card</li></ul><p>Save them inside the application</p><ul><li>Blows up application size far too much</li></ul><p>What is the correct way of locally saving the images of my application to not distract the user and leave no garbage anywhere?</p>","81364","","","","","2011-05-11 09:30:53","Where to save pictures on Android?","<java><android><media><image>","5","0","23","",""
"848728","1","","","2009-05-11 15:45:28","68","92065","<p>I want to retrieve the SMS messages from the inbox and display them?</p>","","Hamaney","510491","","2011-04-30 05:51:30","2013-11-13 22:57:57","How can I read SMS messages from the inbox programmatically in Android?","<android><sms><inbox>","5","4","61","",""
"851426","1","851446","","2009-05-12 06:33:54","2","215","<p>I am using android G1 phone and now i have upgraded my sdk to 1.5 and i want to run my application  on device but when i connect my phone to PC i am able to install my app only when i am selecting 1.1 sdk but not when selected 1.5 .So is there any updates required for the device so i can proceed with 1.5 sdk also .if possible can u provide with a proper link that would be great .</p>","","Samson1982","764272","","2009-08-01 23:14:24","2009-08-01 23:14:24","Android device update for G1","<java><android>","2","0","","",""
"851571","1","854267","","2009-05-12 07:29:22","2","879","<p>I'd also like a way to change the default, if possible.</p>","76835","","76835","","2009-05-12 16:29:33","2009-05-12 18:52:04","How does one change the size (width + height) of the XML layout preview panels in the ADT plugin for Eclipse?","<android><eclipse-plugin><adt>","1","0","1","",""
"851882","1","","","2009-05-12 09:09:02","58","97004","<p>Is there a tool or a website that could help me create a UI for an Android application using drag-and-drop? </p><p>I found <a href=""http://www.droiddraw.org/"">this site</a> but want to know if there is a more stable tool or website for this?</p>","104857","","28169","","2009-05-12 09:11:33","2014-02-11 14:42:00","Easy way to build Android UI?","<android><gui><user-interface>","12","0","26","2014-02-12 04:54:15",""
"852462","1","867714","","2009-05-12 12:17:54","3","6466","<p>I am trying to compile some OpenGL samples available on the net in SDK 1.5. But the import statement for android.graphics.OpenGLContext gives me an error saying the class cannot be found.</p><p>Can someone tell me where I can find this class. And if it is no longer supported by the android SDK then how do I port the samples to 1.5.</p>","46297","","44729","","2013-07-08 13:53:12","2013-07-08 13:53:12","Why can't Android find android.graphics.OpenGLContext?","<android><opengl-es>","1","0","","",""
"853393","1","992810","","2009-05-12 15:33:43","0","911","<p>I'm trying to find some information regarding the available GPU (for OpenGL) memory on the T-Mobile G1.</p><p>This phone has a MSM7200 Qualcomm chip inside with ATI Imageon GPU. </p><p>Unfortunately I am not able to dig any info regarding the specifics of GPU memory usage.</p><p>How much memory is available in total for the textures?Is the memory shared with the CPU memory?</p>","2454753","","225647","","2012-10-29 20:40:26","2012-10-29 20:40:26","T-Mobile G1 (MSM7200) GPU Memory","<android><memory><opengl-es>","1","0","0","",""
"858670","1","987721","","2009-05-13 15:34:05","2","3369","<p>I want to start playing around with Android. Downloaded the sources and followed the instructions from the <a href=""http://source.android.com/download"" rel=""nofollow"">download page</a> </p><p>Made a plain generic build:</p><pre><code>============================================TARGET_PRODUCT=genericTARGET_BUILD_VARIANT=engTARGET_SIMULATOR=TARGET_BUILD_TYPE=releaseTARGET_ARCH=armHOST_ARCH=x86HOST_OS=linuxHOST_BUILD_TYPE=releaseBUILD_ID=============================================</code></pre><p>But how can i create an e.g.qemu image from that. I looked around the /out dir,found the host tools and the emulator but dont know where to start to get this running. </p>","88022","","3052751","","2014-01-08 17:27:49","2014-01-08 17:27:49","Compiling Android Qemu image","<android><android-emulator><qemu>","1","0","4","",""
"859702","1","860097","","2009-05-13 18:46:49","2","1228","<p>I have an application the requests a media stream from a server, however the request needs to include a cookie or else the server returns a 500 error. MediaPlayer does not have the functionality to send a cookie along with a URI request.</p><p>My way around this is to have Android proxy the requests. I'll have the MediaPlayer make a request to the localhost (http://localhost/?ID=1) and then I'll have a small proxy app make the request along with the cookie and return the media stream.</p><p>My question is how would I go about making the proxy side? How do I have my app setup a listener on localhost for an http request?</p><p>I don't need a full blown code write up on how to do it, just some simple class names and example code showing how to have an android app listen for requests from the mediaplayer.</p>","88770","","1777090","","2013-01-17 05:15:39","2013-01-17 05:15:39","Respond to local http request in Android","<java><android><http-proxy>","1","0","","",""
"866769","1","867828","","2009-05-15 02:39:36","90","146072","<p>I'm making an Android app, and need to call the phone's contact list. I need to call the contacts list function, pick a contact, then return to my app with the contact's name. Here's the code I got on the internet, but it doesnt work.</p><pre><code>import android.app.ListActivity;import android.content.Intent;import android.database.Cursor;import android.os.Bundle;import android.provider.Contacts.People;import android.view.View;import android.widget.ListAdapter;import android.widget.ListView;import android.widget.SimpleCursorAdapter;import android.widget.TextView;public class Contacts extends ListActivity {    private ListAdapter mAdapter;    public TextView pbContact;    public static String PBCONTACT;    public static final int ACTIVITY_EDIT=1;    private static final int ACTIVITY_CREATE=0;    // Called when the activity is first created.     @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        Cursor C = getContentResolver().query(People.CONTENT_URI, null, null, null, null);        startManagingCursor(C);        String[] columns = new String[] {People.NAME};        int[] names = new int[] {R.id.row_entry};        mAdapter = new SimpleCursorAdapter(this, R.layout.mycontacts, C, columns, names);        setListAdapter(mAdapter);    } // end onCreate()    // Called when contact is pressed    @Override    protected void onListItemClick(ListView l, View v, int position, long id) {        super.onListItemClick(l, v, position, id);        Cursor C = (Cursor) mAdapter.getItem(position);        PBCONTACT = C.getString(C.getColumnIndex(People.NAME));        // RHS 05/06        //pbContact = (TextView) findViewById(R.id.myContact);        //pbContact.setText(new StringBuilder().append(""b""));        Intent i = new Intent(this, NoteEdit.class);        startActivityForResult(i, ACTIVITY_CREATE);    }}</code></pre>","90883","","1288","","2011-05-14 13:36:31","2013-05-20 06:53:04","How to call Android contacts list?","<android><contacts>","8","2","94","",""
"867518","1","3427058","","2009-05-15 08:09:23","162","175581","<p>In Android, I want to use a Spinner that initially (when the user has not made a selection yet) displays the text ""Select One"". When the user clicks the spinner, the list of items is displayed and the user selects one of the options. After the user has made a selection, the selected item is displayed in the Spinner instead of ""Select One"".</p><p>I have the following code to create a Spinner: </p><pre><code>String[] items = new String[] {""One"", ""Two"", ""Three""};Spinner spinner = (Spinner) findViewById(R.id.mySpinner);ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,            android.R.layout.simple_spinner_item, items);adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);spinner.setAdapter(adapter);</code></pre><p>With this code, initially the item ""One"" is displayed. I could just add a new item ""Select One"" to the items, but then ""Select One"" would also be displayed in the dropdown list as first item, which is not what I want.</p><p>How can I fix this problem?</p>","51034","","63550","","2013-07-28 09:45:23","2014-04-11 07:13:31","How to make an Android Spinner with initial text ""Select One""","<android><android-spinner>","21","1","88","",""
"867897","1","884332","","2009-05-15 10:25:23","0","7567","<p>I just noticed, using the HTC Dream that using a bluetooth headset was really easy for phone calls, but nothing seemed to be available for videos / music sound output. V1.0 limitations are not at fault since when you play a music and start a call, you can hear the music in the headset for a second. So it's technically possible, just not available in the settings.</p><p>Does anybody knows how to redirect programatically the sound output to the blutooth headset ?</p><p>I'd like to code a little app that let you listen to your music while looking like a total idiot with a big device hanging to your hear :-)</p><p>N.B : this question is a copy of <a href=""http://groups.google.com/group/android-developers/browse%5Fthread/thread/c29b455707e5eba4"" rel=""nofollow"">the one I asked in Google group.</a> </p>","9951","","","","","2010-07-02 07:54:02","Bluetooth sound output on Android","<android><audio><bluetooth>","1","0","","",""
"874227","1","903387","","2009-05-17 09:22:17","6","72433","<p>I'm doing a Get and Post method for an android project and I need to ""translate"" HttpClient 3.x to HttpClient 4.x (using by android).My problem is that I'm not sure of what I have done and I don't find the ""translation"" of some methods...</p><p>This is the HttpClient 3.x I have done and (-->) the HttpClient 4.x ""translation"" if I have found it (Only parties who ask me problems) : </p><pre><code>HttpState state = new HttpState (); --&gt; ?HttpMethod method = null; --&gt; HttpUriRequest httpUri = null;method.abort(); --&gt; httpUri.abort(); //httpUri is a HttpUriRequestmethod.releaseConnection(); --&gt; conn.disconnect(); //conn is a HttpURLConnectionstate.clearCookies(); --&gt; cookieStore.clear(); //cookieStore is a BasicCookieStoreHttpClient client = new HttpClient(); --&gt; DefaultHttpClient client = new DefaultHttpClient();client.getHttpConnectionManager().getParams().setConnectionTimeout(SOCKET_TIMEOUT) --&gt; HttpConnectionParams.setConnectionTimeout(param, SOCKET_TIMEOUT);client.setState(state); --&gt; ?client.getParams().setCookiePolicy(CookiePolicy.RFC_2109); --&gt; HttpClientParams.setCookiePolicy(param, CookiePolicy.RFC_2109);PostMethod post = (PostMethod) method; --&gt; ?post.setRequestHeader(...,...); --&gt; conn.setRequestProperty(...,...);post.setFollowRedirects(false); --&gt; conn.setFollowRedirects(false);RequestEntity tmp = null; --&gt; ?tmp = new StringRequestEntity(...,...,...); --&gt; ?int statusCode = client.executeMethod(post); --&gt; ?String ret = method.getResponsBodyAsString(); --&gt; ?Header locationHeader = method.getResponseHeader(...); --&gt; ?ret = getPage(...,...); --&gt; ?</code></pre><p>I don't know if that is correct.This has caused problems because the packages are not named similarly, and some methods too.I just need documentation (I haven't found) and little help.</p><p>Thank you in advance for your help.Michaël</p>","108341","","114066","","2010-04-13 16:37:11","2013-02-07 11:50:35","Android project using httpclient --> http.client (apache), post/get method","<java><android><apache><http>","4","0","24","",""
"876082","1","877565","","2009-05-18 03:02:40","2","975","<p>What are the pros and cons to use iPhone/Android phones to write scripts?</p><p>I'd like to buy a new mobile phone which I can utilize my time to do some scripting even when I'm not at my desktop computer.</p><p>I heard that you can't save files to your iPhone unless you jail break it. This maybe a big problem if I want to create some new scripting file. Say I want to create a abc.java and there's no way for me to save it.</p><p>Is it the same case for Android too? Can I create local scripting files on Android phones? Since Android is a linux os... is it possible to install java sdk or other sdk (like flex?) on it?</p>","63226","","","","","2009-05-18 16:00:05","What are the pros and cons to use iPhone/Android phones to write scripts?","<iphone><android><scripting><text-editor>","5","0","1","",""
"878098","1","","","2009-05-18 14:42:22","2","13816","<p>I am writing a solitaire app. I use a canvas to draw everything on the screen. Sometimes a pile of cards will get big and extend below the bottom of the screen. I would like to make the canvas scrollable so the user can access those cards. </p><p>main activity</p><pre><code>package com.maulinpathare.solitaire;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.view.Menu;import android.view.MenuItem;public class Solitaire extends Activity{    /** Called when the activity is first created. */     private Context mContext;     private GameView mG;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mContext = this;        setContentView(R.layout.main);    }    @Override    public boolean onCreateOptionsMenu(Menu menu) {        boolean result = super.onCreateOptionsMenu(menu);        menu.add(0, 1, 0, R.string.newGame);        menu.add(0, 2, 0, R.string.exitGame);        return result;    }    @Override    public boolean onOptionsItemSelected(MenuItem item) {        switch (item.getItemId()) {        case 1:          mG = new GameView(this);          setContentView(mG);            return true;        case 2:            finish();            return true;        }        return false;    }}//end class</code></pre><p>GameView ClassThis is where everything happensI have removed most of the game logic... </p><pre><code>package com.maulinpathare.solitaire;import java.util.Stack;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Rect;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;import android.widget.ScrollView;public class GameView extends ScrollView implements OnTouchListener{     private Deck mD;     private boolean mInit, mDone;     private Stack&lt;Card&gt; mPile1, mPile2, mPile3, mPile4, mPile5, mPile6, mPile7,                              mOpenPile, mEndPile1, mEndPile2, mEndPile3, mEndPile4, mTemp;     private Canvas mCanvas;     private int mPile;     private boolean mPickUp, mVictory;     private Card mCard;     private final int mSpacing = 22;     private Paint rectPaint, wonPaint1, wonPaint2;     public GameView(Context context) {        super(context);                    //initialize everything needed for the game    }    @Override    protected void onDraw(Canvas canvas) {     mCanvas = canvas;     if(mInit){          initialize();          mInit = false;     }        //draw stuff...    }//end onDraw    public boolean onTouch(View v, MotionEvent event){     int eventAction = event.getAction();     int x = Math.round(event.getX());     int y = Math.round(event.getY());     switch(eventAction){     case MotionEvent.ACTION_DOWN:                    //check if touch has happened on one of the card piles          break; //end case action_touch     case MotionEvent.ACTION_MOVE:                    //if card touched move it          break; //end case action_move     case MotionEvent.ACTION_UP:                    //check if legal move has been made          break; //end case action_up     }//end switch(event)     invalidate();     return true;    }//end onTouch}</code></pre><p>Where and how should I implement screen scrolling? I would like the user to be able to slide their finger across the screen in the direction they want to scroll.</p>","98778","","","","","2012-04-27 09:34:14","android canvas scroll","<android>","3","0","1","",""
"881195","1","896643","","2009-05-19 06:12:37","1","2411","<p>Long story short, how can I disable the screen transitions between activities? We implemented our own tab handler if you will, and now it is doing a transition between tabs, which looks pretty tacky. Thanks!</p><p>Chris.</p>","393258","","","","","2012-04-26 09:29:59","Android : Disable 1.5 cupcake animation transitions","<android><animation><screen><transition>","3","0","","",""
"885009","1","886494","","2009-05-19 21:02:20","497","521303","<p>I just downloaded and installed the new Android SDK. I wanted to create a simple application to test drive it.</p><p>The wizard created this code:</p><pre><code>package eu.mauriziopz.gps;import android.app.Activity;import android.os.Bundle;public class ggps extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }}</code></pre><p>but <a href=""http://en.wikipedia.org/wiki/Eclipse_%28software%29"">Eclipse</a> gives me the error</p><blockquote>  <p>R cannot be resolved</p></blockquote><p>on line</p><pre><code>setContentView(R.layout.main);</code></pre><p>Why?</p><p>PS: I do have an XML file named <code>main.xml</code> under <code>res/layout/</code>.</p>","61996","","63550","","2012-08-13 16:52:16","2014-04-10 20:43:23","R cannot be resolved - Android error","<android><eclipse><android-resources>","86","4","152","","2011-09-22 11:22:43"
"885641","1","","","2009-05-20 00:10:40","0","1622","<p><br />In my Android application, I have a ListActivity. This ListActivity uses a SimpleAdapter that I fill with items from my service. So, in my code, I do:</p><pre><code>MySuperCoolService.Binder serviceBinder = null;private ServiceConnection serviceConnection = new ServiceConnection()    {    	public void onServiceConnected(ComponentName className, IBinder service) {    		Log.d(TAG, ""Service connection: connected!"");    		serviceBinder = (MySuperCoolService.Binder)service;    	}    	public void onServiceDisconnected(ComponentName className) {    		Log.d(TAG, ""Service connection: disconnected"");    		serviceBinder = null;    	}    };bindService(new Intent(this, MySuperCoolService.class), serviceConnection, BIND_AUTO_CREATE);while(serviceBinder==null) {    Thread.Sleep(1000);}// now retrieve from service using binder and set list adapter</code></pre><p>This whole operation takes hardly any time (less than a second), so I want it to run in the UI thread. See my onCreate:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    fillDataUsingCodeAbove();}</code></pre><p>The reason I want this to run in the UI thread is that if you have a list item selected, or you have scrolled to a certain position in the ListView, and you rotate the device or take out the keyboard or something (to trigger a configuration change) when my activity is restarted, Android will try to restore the state right after onCreate. But, if I run it in a separate thread, it will not. Also there is a cool fadein animation too :)<br />The problem I am having with running it in the UI thread is that when I try to bind to the service, that service bind request gets put onto the message queue. But then when I go into my loop, I stop the message queue from looping. So my program hangs, because it's waiting for the service to get bound, and the service won't get bound until the loop ends. I have thought of putting <code>Looper.loop()</code> inside my loop, but that just hangs it at Looper.loop() (I don't know why.)<br />Sorry for such a long question,<br />Isaac Waller</p>","764272","","","","","2012-10-11 17:01:34","Android Loading listview items from service results in hang","<android><listview><service><message-queue><serviceconnection>","2","0","","",""
"886334","1","","","2009-05-20 05:44:53","-4","958","<pre><code>public class test extends Activity {    ImageView imView;    ImageView imViewLine;    String imageUrl=""http://www.web.com/app/"";    String FileType = "".png"";    int imageNum = 0;    Random r;    int count = 0;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        r= new Random();        ListView myListView = (ListView)findViewById(R.id.myListView);        final ArrayList&lt;String&gt; todoItems = new ArrayList&lt;String&gt;();        final ArrayAdapter&lt;String&gt; aa = new ArrayAdapter&lt;String&gt;(this,R.layout.line,todoItems);        //Bind the listview to the array adapter     	 myListView.setAdapter(aa);     	for(count = 0; count &lt; 2; count++){     	 todoItems.add(0, ""TEST"");     	 downloadFile(imageUrl + Integer.toString(count) + FileType);     	 aa.notifyDataSetChanged();     	 }    }    Bitmap bmImg;    void downloadFile(String fileUrl){          URL myFileUrl =null;                    try {               myFileUrl= new URL(fileUrl);          } catch (MalformedURLException e) {               // TODO Auto-generated catch block               e.printStackTrace();          }          try {               HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection();               conn.setDoInput(true);               conn.connect();               int length = conn.getContentLength();               InputStream is = conn.getInputStream();               bmImg = BitmapFactory.decodeStream(is);               imViewLine.setImageBitmap(bmImg);          } catch (IOException e) {               // TODO Auto-generated catch block               e.printStackTrace();          }     }}&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;  &lt;ImageButton    android:id=""@+id/icon""    android:layout_width=""90px""    android:paddingLeft=""2px""    android:paddingRight=""2px""    android:paddingTop=""2px""    android:layout_height=""wrap_content""    /&gt;  &lt;TextView    android:id=""@+id/label""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:paddingLeft=""10px""    android:paddingTop=""5px""    android:textSize=""10sp""    /&gt;  &lt;/LinearLayout&gt;    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;  &lt;ImageButton    android:id=""@+id/myImageButton""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""  /&gt;  &lt;EditText    android:id=""@+id/myEditText""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""New To Do Item""  /&gt;  &lt;ListView      android:id=""@+id/myListView""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""   /&gt;&lt;/LinearLayout&gt;</code></pre>","52766","","40342","","2009-09-30 15:04:19","2011-12-14 14:26:28","Android! SORRY! APP Stop Unexpectaly.. Trying to load image from website keep getting this error","<android><image>","1","3","","2012-10-23 12:40:14",""
"886830","1","","","2009-05-20 08:33:15","7","1139","<p>I've published an Android applications on the Android market and now have an update to do.</p><p>I want to know if any of you have already done that, and what experience can you share about it :</p><ul><li>How to manage version conflicts ?</li><li>What to do with databases ?</li><li>Can you make appear a message with ""what's new"" if it's an update, but nothing it's a new installation ?</li><li>Should you backup old data before updating, and how ?</li><li>Did you run into any trouble and how did you solve it ?</li><li>Can update be partial (like, just a patch) ?</li></ul><p>Any advice is welcome.</p>","9951","","9951","","2009-05-20 09:53:48","2009-05-21 02:23:06","What are Android application update issues and best practices?","<android>","1","0","1","",""
"887226","1","891128","","2009-05-20 10:35:31","2","1074","<p>I made a lot of changes to my app : databases scheme, graphics, code, etc. The biggest is the package name that I renamed to a total different one. The applicatgio got the same name and Id in the manifeste.xml file and the apk got the same name, with the same digital signature.</p><p>Nevertheless, when using <code>./adb install -r myapp.apk</code>, myapp appears twice in the menu. Of course since the DB is stored in a directory using the package name as name, the user feel like its data is lost.</p><p>How can I prevent this from happening, and if I can't, how can I automate he migration ?</p><p>I have several clues : prompting the user for uninstalling the old app, copying the database from the old file to the new one, etc.</p>","9951","","","","","2011-08-03 07:52:00","Why updating an android app can make it appear twice?","<android>","2","0","","",""
"890366","1","890945","","2009-05-20 21:31:01","23","21927","<p>The only way I've found of retrieving MCC and MNC is by overriding an activity's onConfigurationChanged method, as such:</p><pre><code>public void onConfigurationChanged(Configuration config){	super.onConfigurationChanged(config);	DeviceData.MCC = """" + config.mcc;	DeviceData.MNC = """"  +config.mnc;}</code></pre><p>However,  I need this data as soon as the app starts and can't wait for the user to switch the phone's orientation or equivalent to trigger this method.  Is there a better way to access the current Configuration object?</p>","","user108078","","","","2014-02-24 10:54:19","how do you get the phone's MCC and MNC in Android?","<java><android><mobile>","5","0","11","",""
"891141","1","","","2009-05-21 02:18:22","23","14314","<p>Can a package uninstall itself?  Can a package uninstall another package if they share the same userId and signature?</p>","53498","","","","","2012-03-08 18:30:58","Is it possible to programmatically uninstall a package in Android","<android>","1","1","6","",""
"891451","1","929256","","2009-05-21 05:04:04","17","26630","<p>I am using the <code>showDialog()</code> and <code>dismissDialog()</code> to show progress dialogs in my app. Moved from creating the dialog and calling <code>show()</code> on it to using this in order to save state when changing orientation.</p><p>But when I change the orientation from portrait->landscape->portrait, the <code>dismissDialog()</code> no longer dismisses the dialog. The dialog stay there all the time and I need to press the back button for it to disappear.</p><p>Any reason why it would behave that way?</p><p><strong>Edit</strong></p><p>To overcome this issue, I tried adding a <code>removeDialog()</code> in <code>onDestroy()</code> so that the dialog is not created/displayed twice and before orientation change, the dialog is removed. Tried adding log statements and see what happens</p><pre><code>05-21 12:35:14.064: DEBUG/MyClass(193): *************callingShowDialog05-21 12:35:14.064: DEBUG/MyClass(193): *************onCreareDialog05-21 12:35:15.385: DEBUG/MyClass(193): *************onSaveInstanceState05-21 12:35:15.415: DEBUG/MyClass(193): *************onDestroy05-21 12:35:15.585: DEBUG/MyClass(193): *************callingShowDialog05-21 12:35:15.585: DEBUG/MyClass(193): *************onCreareDialog05-21 12:35:15.715: DEBUG/MyClass(193): *************onCreareDialog05-21 12:35:17.214: DEBUG/MyClass(193): *************onSaveInstanceState05-21 12:35:17.214: DEBUG/MyClass(193): *************onDestroy05-21 12:35:17.275: ERROR/WindowManager(193): android.view.WindowLeaked: Activity com.android.MyClass has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43362088 that was originally added here05-21 12:35:17.395: DEBUG/MyClass(193): *************callingShowDialog05-21 12:35:17.395: DEBUG/MyClass(193): *************onCreareDialog05-21 12:35:17.475: DEBUG/MyClass(193): *************onCreareDialog</code></pre><p>If we see here, initially when the activity is displayed, the onCreateDialog is called once and on changing the orientation, onSaveInstanceState and onDestroy are called.</p><p>But after that, onCreateDialog is called twice (once by a call to showDialog which I make, but why the 2nd time?) and this happens every time I change the orientation hence forth.</p><p>Any idea why that happens?</p><p>Thanks again</p>","46297","","948041","","2012-06-14 09:04:43","2012-06-14 09:04:43","Android - dismissDialog does not dismiss the dialog","<android>","9","1","13","",""
"895341","1","895602","","2009-05-21 21:43:30","6","10937","<p>I've populated a <code>ListActivity</code> from a <code>Cursor</code> using <code>SimpleCursorAdapter</code> that starts another activity when one of the list items have been clicked.  I'm also using <code>ViewBinder</code> to do some custom transformation of the data.</p><p>I want to add a <code>CheckBox</code> to each row in the list so I've changed the view and added a <code>CheckBox</code> with gravity right.</p><p>Adding the <code>CheckBox</code> has removed the ability to click on the items.  The <code>onListItemClick</code> method I was overriding in <code>ListActivity</code> is no longer called when you press on a list item.  Removing the <code>CheckBox</code> fixes this.  Why is this?</p><p>Also, how can I set up the list so that it continues to perform my required functionality if the main part of the list item is clicked but have additional functionality when the <code>CheckBox</code> in the item is checked?  Will setting a <code>onCheckedChangedListener</code> work or is the same view instance reused for each item in the list?</p>","5303","","493939","","2012-06-03 07:01:53","2012-06-03 07:01:53","Custom list clicking with checkboxes","<android><checkbox><android-listview><android-viewbinder>","2","0","3","",""
"896354","1","902686","","2009-05-22 04:31:47","4","6033","<p>I am using a MediaPlayer instance in order to stream audio files from an Internet location. The audio player is in a separate activity. The user can select from a list of audio files and come to this activity to play the audio.</p><p>Now the user might go back to the previous activity (with the list) and select another audio file. In this case, I want to stop any other audio that is playing and start playing the new audio which was selected.</p><p>Is there any way I can know whether an audio file is playing without having to hold on to the MediaPlayer object?</p><p>Thanks.</p><p><strong>Edit</strong></p><p>I did find out how to know whether an audio is playing.We can do it by using an object of AudioManager and calling isAudioPlaying(). This will return a true if any audio is playing.</p><p>Now the other question, <strong>how do I stop an audio currently playing?</strong> I do not have an instance of the MediaPlayer object which was created to start the audio (coz the user has already left the activity once and has come back with a new object of the activity and thus a new instance of the MediaPlayer)</p>","46297","","46297","","2009-05-23 05:10:16","2014-02-19 09:19:06","Android - find whether audio is currently playing and stop it","<android>","5","0","2","",""
"896377","1","896425","","2009-05-22 04:41:53","233","22267","<p>I've been hearing some good things about Google's <strong>Android Market</strong> recently, and I might look into developing for android (currently develop for iPhone OS) at some point, so here are my points to resolve: </p><ul><li>Are any of you Android Developers, or simultaneously developing for iPhone AND Android?</li><li>What have your experiences been for developing and selling your apps on the Android Market?</li><li>Does Google have their act together in their app approval/deployment process?</li><li>How does being a developer/merchant on the Android Market compare with the that of the App Store?</li><li>Are you making money?</li><li>Do you see this market as promising? </li><li>Love it?</li><li>Hate it?</li></ul><p>Share your experiences on the Android Market.</p>","332525","","","user1852286","2012-11-28 08:40:50","2014-01-28 20:04:18","What are your experiences selling on the Android Market?","<iphone><android><google-play><app-store>","7","0","123","2011-08-01 12:50:40",""
"896721","1","896733","","2009-05-22 07:27:18","12","40898","<p>I want to use the URLEncoder/URLDecoder class (java.net.URLEncoder/URLDecoder) in an application and the methods : encode(String s, String enc)/decode(String s, String enc), but I don't know what can be the value of the String argument enc?I want to encode/decode in the ""x-www-form-urlencoded"" MIME content type.Thank you for your help.</p>","108341","","","","","2014-04-09 16:12:12","URLEncoder encode / URLDecoder decode in java (Android)","<java><android>","4","0","","",""
"896889","1","906458","","2009-05-22 08:34:34","2","17194","<p>HiI'm developing an application for the android OS, I'm just starting, but I can't get the GPS on the emulator to work.I've read on the internet that you need to send a geo fix to the emulator in order to enable the gps locationProvider. I'm both using the DDMS and telnet to try to send it, but logcat never tells me the it recived a new fix, and my apolication still sees the gps as disabled </p><p>here's my code</p><pre><code>package eu.mauriziopz.gps;import java.util.Iterator;import java.util.List;import android.app.Activity;import android.content.Context;import android.location.LocationManager;import android.os.Bundle;import android.util.Log;public class ggps extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        LocationManager l =(LocationManager) getSystemService(Context.LOCATION_SERVICE);        List&lt;String&gt; li = l.getAllProviders();        for (Iterator&lt;String&gt; iterator = li.iterator(); iterator.hasNext();) {	    	String string =  iterator.next();	    	Log.d(""gps"", string);    	}        if (l.getLastKnownLocation(""gps"")==null)            Log.d(""gps"", ""null"");       }}</code></pre><p>I've read that the DDMS may not work properly on a non english OS, but telnet should work!</p><p>update: the gps is enabled in the settings</p>","61996","","147141","","2009-10-07 22:09:41","2012-10-24 11:46:50","GPS on emulator doesn't get the geo fix - Android","<android><eclipse><gps>","4","2","1","",""
"897072","1","","","2009-05-22 09:32:16","2","3235","<p>I am using EditText for getting userInput but the problem i am facing is that i want to change the font color at runtime but in the same Edittext as i am able to change the font type but as i change the font color it changes for the whole editext but i need to change the color for specfic text only . </p><p>And one more issue issue is that when making an edittext with the height more than the ""fillparent"" property i am getting the cursor postion in middle but i want it to be at the top always i.e. at the start .. </p><p>Is there any other widget available which will provide me the solution for both the problems Thnx in advance Any help would be appreciated </p>","95877","","","","","2009-05-22 10:43:53","Changing font color runtime Android","<java><android>","1","0","1","",""
"900294","1","902692","","2009-05-22 22:36:02","6","18892","<p>I'm creating a backup utility for Android and I need to read content of inbox, outbox and dratfs. How can I accomplish that on SDK v1.5?</p>","70918","","","","","2011-11-07 05:35:48","Android 1.5: Reading SMS messages","<android><backup><sms>","2","0","8","",""
"901057","1","","","2009-05-23 07:12:15","1","5646","<p>Hi I am new to android and I have a problem in creating a database.</p><pre><code>public class database extends ListActivity {    /** Called when the activity is first created. */    private final String MY_DATABASE_NAME = ""myCoolUserDB.db"";    private final String MY_DATABASE_TABLE = ""t_Users"";     Context c;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        ArrayList&lt;String&gt; results = new ArrayList&lt;String&gt;();        setContentView(R.layout.main);        SQLiteDatabase mydb=null;        try        {            mydb.openOrCreateDatabase(MY_DATABASE_NAME,  null);        } catch(Exception e){}    }}</code></pre><p>When I run this code it throws a run time exception.  Please help me.</p>","111436","","8331","","2009-05-23 09:08:50","2012-02-26 19:50:36","Problem in creating a database in SQLite in Android","<android>","4","1","1","",""
"901239","1","1462993","","2009-05-23 09:55:05","17","88209","<p>I am using a custom title view and would like to show/hide a progressbar in the title view when a thread is working.</p><p>This is my title view's XML</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;Button        android:id=""@+id/image_left_btn""        android:layout_width=""75dip""         android:layout_height=""wrap_content""         android:text=""Back""    /&gt;    &lt;TextView    	android:id=""@+id/image_title_text""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_weight=""1""    	android:textSize=""20dip""        android:textStyle=""bold""        android:textColor=""#fff""        android:layout_gravity=""center""        android:gravity=""center""        android:paddingLeft=""8dip""        android:paddingRight=""8dip""    /&gt;    &lt;ProgressBar     	android:id=""@+android:id/progress_small_title""        style=""?android:attr/progressBarStyleSmall""        android:layout_width=""75dip""        android:layout_height=""wrap_content""         android:paddingRight=""8dip""/&gt;&lt;/LinearLayout&gt;</code></pre><p>In my Activity, after setting this as the custom title bar, I do this</p><pre><code>titleProgress = (ProgressBar)findViewById(R.id.progress_small_title);titleProgress.setVisibility(View.INVISIBLE);</code></pre><p>where titleProgress is ProgressBar object.</p><p>This is what I do in my thread</p><pre><code>runOnUiThread(new Runnable() {    public void run() {    	titleProgress.setVisibility(View.VISIBLE);    }});//long operation hererunOnUiThread(new Runnable() {    public void run() {    	titleProgress.setVisibility(View.INVISIBLE);    }});</code></pre><p>But there is no change to the progress bar. It is never displayed. Can someone please tell me what is wrong with the code?</p><p>Is it possible to display the title progressbar in a custom title?</p><p>Thanks.</p>","46297","","46297","","2009-05-25 08:08:06","2012-01-03 17:45:07","Android - using runOnUiThread to do UI changes from a thread","<android>","5","0","2","",""
"901781","1","","","2009-05-23 15:53:08","2","749","<p>I'm following the installation tutorial according (www.softwarepassion.com/?p=176) to the explanations and everything seems to be fine and not getting any errors. But, when I run the 'Hello, world' application, I get an empty screen on my phone showing me only 'Android' with a blinking cursor. Does anyone know what I might be missing or doing wrong? I'm using eclipse on Ubuntu 9.04.</p><p>Here's an screenshot of the emulator when I run the app: www.twitpic.com/5rrcg and here is the screen I should be getting: developer.android.com/guide/tutorials/images/hello_world_5.png</p>","89008","","1777090","","2013-01-17 05:17:14","2013-01-17 05:17:14","What might be wrong with my Android installation in Ubuntu 9.04","<android><eclipse><mobile><phone>","1","1","1","",""
"902056","1","902653","","2009-05-23 17:55:01","7","1588","<p>I was searching the internet but could not find a site comparing the two. I'm interested in developing for the android platform. G1 seems to be just the same as ADP1, but is there any small changes that will be noticeable in development?</p><p>How about 3rd party software? What T-Mobile software exists in G1 which is not part of the ADP1 bundle and vice versa?</p><p>Can I swap the original ADP1 firmware with T-Mobile branded one? As I understand people can already hack the G1 to run ADP1's non-branded firmware.</p>","95624","","918414","","2013-03-16 03:15:30","2013-03-16 03:15:30","What are the differences between T-Mobile G1 (branded HTC Dream) and Google's ADP1 (device for developers)?","<android><mobile>","4","0","2","",""
"902089","1","902666","","2009-05-23 18:09:15","9","16607","<p>I'm working on an Android application that needs to look at what images a user has stored.  The problem is that if the user has the sdcard mounted via the USB cable, I can't read the list of images on the disk.</p><p>Does anyone know of a way to tell if the usb is mounted so that I could just pop up a message informing the user that it won't work?</p>","73865","","2559445","","2013-07-08 05:57:29","2013-11-19 00:25:46","How to tell if the sdcard is mounted in Android?","<android><android-sdcard>","6","1","8","",""
"903343","1","903841","","2009-05-24 08:39:05","10","41370","<p>I have problems with Cursor in my Android application.I have a SQLiteDatabase that return me Cursor when I try to fetch the values with :</p><pre> public Cursor fetchOption(long rowId) throws SQLException {        Cursor mCursor =                mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID,                        KEY_TITLE, KEY_BODY}, KEY_ROWID + ""="" + rowId, null,                        null, null, null, null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }</pre><p>But I don't know how to obtain the value of the field in the Cursor.If I do that :</p><pre>String a = mOptionDb.fetchOption(0).getColumnName(0).toString();String b = mOptionDb.fetchOption(0).getColumnName(1).toString();String c = mOptionDb.fetchOption(0).getColumnName(2).toString();</pre><p>I obtain the name of the columns (_id, title, body) but not the value.How can I resolve that?</p><p>Thank you in advance for your answer.Michaël</p>","108341","","","","","2013-01-30 09:59:18","Cursor : get the field value (Android)","<java><android>","3","0","6","",""
"904376","1","908617","","2009-05-24 18:27:18","1","7763","<p>I have a parent ScrollView with a child view. When the user presses the back button, I want the child view to handle the event. I have tried a couple of things but none of them seem to work. pressing the back button kill sthe activity.</p><pre><code>public class GameScrollView extends ScrollView{     public GameScrollView(Context context) {          super(context);     }     @Override     public boolean onInterceptTouchEvent (MotionEvent ev){          return false;     }     @Override     public boolean onKeyDown (int keyCode, KeyEvent event){          return false;     }}</code></pre><p>in the child view I have the following code</p><pre><code>public class GameView extends View implements OnTouchListener, onKeyListener{     public boolean onKey(View v, int keyCode, KeyEvent event){          if(keyCode == KeyEvent.KEYCODE_BACK){                    //do stuff          }          invalidate();          return true;             }}</code></pre><p>In the ScrollView I have also tried overriding the dispatchKeyEvent method to return false, but that did not work either. What am I doing wrong here?</p><p>Thanks!</p>","98778","","2559445","","2013-07-08 05:57:36","2013-07-08 05:57:36","Opening childview back from scrollview","<android><android-scrollview>","2","0","","",""
"904972","1","905244","","2009-05-25 00:38:45","0","5989","<p>I have an application that open an other class using intent : </p><pre>private void createRepository(){        Intent j = new Intent(this, Repository.class);        startActivityForResult(j, ACTIVITY_CREATE);    }</pre><p>In Repository.class we have the <strong>onActivityResult</strong> method :</p><pre>public void onActivityResult(int reqCode, int resultCode, Intent data) {      super.onActivityResult(reqCode, resultCode, data);      switch (reqCode) {        case (PICK_CONTACT) :          if (resultCode == Activity.RESULT_OK) {            Uri contactData = data.getData();            c =  managedQuery(contactData, null, null, null, null);            if (c.moveToFirst()) {              //String name = c.getString(c.getColumnIndexOrThrow(People.NAME));              num = c.getString(c.getColumnIndexOrThrow(People.NUMBER));            }              }            break;      }      finish();    }</pre><p>I don't know how I can return the value of <strong>num</strong> to the first class (that create Repository.class).Thank you for your help.Michaël</p>","108341","","","","","2012-06-22 11:32:00","Intent problem, return value (Android)","<java><android>","2","0","","",""
"906684","1","947986","","2009-05-25 13:07:16","1","4894","<p>I have an URL pointing to content and I need to get highest value contained in one of the columns. Is there any aggregate function that will accomplish that or do I have to do this manually?</p>","70918","","95810","","2009-05-25 16:12:47","2009-06-04 00:20:11","Android: Get highest value in column","<sql><database><android><content><aggregate>","2","0","1","",""
"906850","1","","","2009-05-25 14:02:27","2","3808","<p>Hi I'm trying to get and update when the phone gets near a location.I've both tried using addProximityAlert and requestLocationUpdates</p><pre><code>    LocationManager lm =(LocationManager) getSystemService(Context.LOCATION_SERVICE);    Location l = lm.getLastKnownLocation(""gps"");    Intent intent = new Intent(""eu.mauriziopz.gps.ProximityAlert"");    PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent, 0);    lm.addProximityAlert(12, 12, 100, 1000000, pIntent);</code></pre><p>This one never fires the intent (which I know works since I can fire it up manually).I tried using a listener but it gets executed only once. No matter how many times I update the gps it never gets called again</p><pre><code>    ProximityListener pl = new ProximityListener();    lm. requestLocationUpdates(""gps"", 2000, 10, pl);</code></pre><p>this is the code of the activity (called in the first case)</p><pre><code>public class ProximityAlert extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {	// TODO Auto-generated method stub	super.onCreate(savedInstanceState);	Log.d(""intent"", ""Hi"");	finish();}</code></pre><p>This is the Listener</p><pre><code>public class ProximityListener implements LocationListener {String DEBUG_TAG = ""ProximityListener"";@Overridepublic void onLocationChanged(Location location) {	// TODO Auto-generated method stub	Log.d(DEBUG_TAG, location.toString());}@Overridepublic void onProviderDisabled(String provider) {	// TODO Auto-generated method stub}@Overridepublic void onProviderEnabled(String provider) {	// TODO Auto-generated method stub}@Overridepublic void onStatusChanged(String provider, int status, Bundle extras) {	// TODO Auto-generated method stub}}</code></pre><p>Thanks</p>","61996","","147141","","2009-10-07 22:26:57","2012-11-04 01:45:33","addProximityAlert doesn't work (neither does requestLocationUpdates) - Android","<android><gps>","4","0","3","",""
"910135","1","","","2009-05-26 11:03:22","14","9670","<p>I am using an <code>EditText</code>. Is it possible to have a part of text uneditable and the rest editable in the same <code>EditText</code>?</p><p>Thanks in advance     </p>","95877","","597607","","2012-06-22 11:56:43","2012-06-22 11:56:43","Can we have uneditable text in edittext","<java><android><edittext>","2","0","6","",""
"910973","1","912802","","2009-05-26 14:25:14","9","10280","<p>If I disable an <code>EditText</code> widget using</p><pre><code>editText.setEnabled(false);</code></pre><p>I can still type into it using the on-screen input method (in both the emulator and on the G1). Is this intended? How can I workaround this issue?</p>","98401","","","","","2012-04-27 02:24:26","Why can I type into a disabled EditText?","<android>","8","0","1","",""
"914931","1","","","2009-05-27 10:04:59","-3","1876","<p>I am using RSA modulus and encrypting a data with modulus and trying to decrypt it with private key of RSA ..i m using RSA/ECB/PKCS1Padding at the decrypt end </p><p>Thnx in advance </p>","95877","","","","","2012-06-22 16:11:53","RSA decrypt in ANdroid","<java><android>","1","1","","",""
"915960","1","1251132","","2009-05-27 14:16:39","0","2715","<p>I have a FrameLayout view which contains one (MapView-like) control and some additional buttons overlaying it. (the layout xml is below).</p><p>I want to allow the user to pan/scroll the main view using not only touch but also the Trackball. The problem is - using the trackball just switches the focus between all the controls on the layout, and I cannot seem to find a way to contain the <strong>onTrackballEvent</strong> to just the MainView.</p><p>Any suggestions are welcome, thanks in advance.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;merge xmlns:android=""http://schemas.android.com/apk/res/android""       android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;FrameLayout android:id=""@+id/pageView""     xmlns:panel=""http://schemas.android.com/apk/res/com.yappa""      xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;    &lt;MainView    	android:id=""@+id/mainView""     	android:layout_width=""fill_parent""    	android:layout_height=""wrap_content""&gt;    &lt;/MainView&gt;    &lt;ZoomControls android:id=""@+id/ZoomControls01""    	android:layout_gravity=""bottom|center""    	android:layout_height=""wrap_content"" android:layout_width=""wrap_content""&gt;    &lt;/ZoomControls&gt;    &lt;Panel          ....    &lt;/Panel&gt;&lt;/FrameLayout&gt;&lt;/merge&gt;</code></pre>","2454753","","2454753","","2009-06-14 14:13:00","2011-05-20 19:58:22","How to control trackball behaviour in Android Views?","<android><view><custom-controls><trackball>","2","2","0","",""
"919153","1","923963","","2009-05-28 04:15:50","23","15617","<p>I've noticed in some coding people use icicle with the onCreate method, and I was wondering what it is exactly:</p><pre><code>public class About extends Activity {    @Override    protected void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.whatup);    }</code></pre><p>Is this the same thing as <code>savedInstanceState</code>?</p>","92802","","63550","","2011-08-28 14:27:29","2012-07-07 06:54:43","What is Android's icicle parameter?","<android>","2","0","4","",""
"919798","1","921275","","2009-05-28 08:33:31","2","1521","<p>I want to view the Log on device i.e the <code>System.out.println()</code>; I am able to view on DDMS but how to view on device screeen while running an apk file      </p>","95877","","750613","","2012-06-22 11:22:56","2012-11-08 17:47:50","view the Log on device","<java><android><logging>","4","0","2","",""
"920306","1","","","2009-05-28 11:06:11","45","49208","<p>I have two activities.  Main activity and child activity.When I press a button, the child activity is launchedNow I have no problem. I want to send some databack to the main screen. I used The Bundle classbut it is not working. It throw some run time exceptionIs there any solution? Anyone knows the answer pleasetell me.</p>","111436","","2559445","","2013-07-08 06:02:34","2013-07-08 06:43:59","Sending data back to the Main Activity in android","<android><android-intent>","4","1","20","",""
"920597","1","920624","","2009-05-28 12:30:59","2","887","<p>I want to move an image around the screen according to the trackball movement. I am able to capture the movements using the onTrackballEvent method. But this is being called for very small float values (I believe for each rotation?) of the trackball.</p><p>Now as X and Y positions of views should be integers when specifying with LayoutParams, it makes no sense to move the view with every rotation. Instead I want to move the view only after the user stops rotating the trackball.</p><p>Is there any method by which we can get whether the user stopped using the trackball or not?</p>","46297","","1777090","","2013-01-17 05:16:36","2013-01-17 05:16:36","Android - has trackball event ended?","<android>","2","0","","",""
"920741","1","955653","","2009-05-28 13:08:33","15","10868","<p>Is there a way to always show the zoom controls on a MapView? I have added the zoom controls using</p><pre><code>map=(MapView)findViewById(R.id.map);map.setBuiltInZoomControls(true);</code></pre><p>but the zoom controls fade in and out. I want them to always be visible.</p>","84021","","","","","2012-06-22 11:20:26","Always show zoom controls on a MapView","<android><android-mapview>","2","0","9","",""
"921130","1","","","2009-05-28 14:27:16","28","55322","<p>I don't have any of the devices to test at the moment. I guess I'll start using the emulators later on.</p><p>We're looking to offer mobile support. I was wondering how jQuery or even javascript renders in their respective browsers. </p><p>What works? What doesn't? Any tips? Advice?</p>","5853","","","","","2012-03-20 14:05:01","jQuery on iPhone/Android/BlackBerry","<jquery><iphone><android><browser><blackberry>","8","0","17","",""
"922819","1","947440","","2009-05-28 19:43:28","4","2445","<p>I've been working with Android for well over a year now, but I still have trouble determining when different types of messaging/communication between processes/threads should be used.  I'm mainly talking about broadcasting Intents, using AIDL for services, using Handlers to send messages and socket communication.</p><p>Many of these tools can be used to accomplish similar tasks, but which is better suited to particular situations?</p>","113946","","","","","2010-10-16 01:34:33","When should I use each of Android's different messaging types?","<android><multithreading><processes><messaging>","3","0","6","",""
"923408","1","923451","","2009-05-28 21:56:06","5","5118","<p>I'm working with Android and I really need a fast way to get a bitmap of a predetermined size to be filled with a predetermined colour.</p><p>The following code is not working for me however;</p><p>Bitmap input is a mutable bitmap</p><pre><code>    int old = input.getPixel(0, 0);    Canvas c = new Canvas(input);    Rect rect = c.getClipBounds(); // The dimensions of the bitmap are returned    c.drawARGB(a, r, g, b);    int n = input.getPixel(0, 0);    if(old==n)        Log.e(TAG, ""Values didn't change!"");    return input;</code></pre><p>Rest assured, the 'old' value and the value of (a|r|g|b) are different but having 'drawn' the colour using a canvas with my mutable bitmap underneath, the bitmap retains it's old value.</p><p>I'd be happy with any method that takes a bitmap and a colour value and returns a bitmap filled with that colour.</p>","111734","","1777090","","2013-01-17 05:16:14","2013-01-17 05:16:14","Android - Fill bitmap with colour","<android><bitmap><fill>","1","0","","",""
"926770","1","932382","","2009-05-29 15:58:57","3","2564","<p>I would like to extend the Android platform's default Gmail/Email applications either by plugging into their ContentProvider or by using intent filters. Essentially, I want to be able to scan incoming emails for special rules that will trigger events in my Android application. If scanning emails automatically isn't possible, then I would at least like to add a menu item to the email viewer screen that would allow the user to flag the email content as needing to be scanned.</p><ol><li>Does the <code>Gmail/Email</code> applications allow you to extend them in this way?</li><li>For future reference, besides finding sample code or reading documentation provided by the author of an application, is there a standard way of finding out what intents are available for my application to use? Like a tool maybe?</li></ol><p>Thanks,Marc</p>","56855","","750613","","2012-06-22 11:17:49","2012-06-22 11:17:49","Extending Android's Default Gmail/Email Applications","<java><android><gmail>","1","0","2","",""
"929875","1","4720982","","2009-05-30 15:00:27","155","193766","<p>I am starting development on a mobile application for both iPhone and Android, and I already have most of the GUI mock-ups white-boarded (with some still in my head). As a next step, I need to put them all down on paper so that I can start socializing the designs among my team - and I'm wondering what the best online GUI mock-up tool is that's currently available?</p><p>I have a lot of experience using Visio - and I like the way it works. Ideally, though, I'd want a tool which is web-based for easier collaboration.</p><p>Any suggestions?</p>","99863","","1454806","","2012-12-26 21:38:37","2013-06-18 10:20:02","GUI Design Tools to mock up iPhone & Android applications","<iphone><android><gui><mockups>","22","1","149","2011-12-07 14:05:32",""
"930402","1","","","2009-05-30 19:31:52","3","1726","<p>I want to draw a graph that updates in real time (grows from the right). The most efficent way I can think of to do that would be to copy everything from x[0 .. width-2] left by 1 pixel, then draw the new value at x[width-1]. </p><p>I have little experience with Android, but from what I can tell, Canvas doesn't operate on it's contents at all. Do I need to repaint the entire screen each time? This involves scaling and smoothing so I'm worried it will be slow. </p><p>Should I draw into a byte[][] then use this to paint to the screen (shifting the contents of my buffer left each time) ?</p>","758","","1104926","","2011-12-19 12:58:37","2012-01-03 19:02:55","Android: Efficiently scrolling the contents of a Canvas?","<android><canvas>","4","1","","",""
"930424","1","935287","","2009-05-30 19:43:05","12","4803","<p>I know you can get a developer phone but the new G2 looks pretty nice as well as the Samsung around the corner.I would assume however that it would be a better idea to be using a consumer phone if they are the target market for apps you wish to produce, especially for testing purposes.</p><p>Has anyone else had experience from this choice and provide any further illumination to the issue?</p>","1143","","3314","","2009-05-30 20:47:31","2009-06-03 15:43:00","What's the best android phone to get as a developer","<android>","3","3","3","2011-05-06 13:57:55",""
"930458","1","","","2009-05-30 19:55:53","1","1032","<p>This is my first S/O question, please be gentle!</p><p>I'd like to know more about porting C applications to native ARM for use on Android devices.</p><p>I can make simple programs using the prebuild toolchain which comes with the source, but how can I use this toolchain with applications which are more than one file and require configure and make?</p>","","Rich","1777090","","2013-01-17 05:01:43","2013-01-17 05:01:43","Complete Way to Compile Complex Native Applications to Android ARM","<android><jni><native>","2","0","1","",""
"932522","1","1922425","","2009-05-31 17:41:21","18","3846","<p>Is Android going to gain momentum or will the iPhone continue to dominate mobile application sales?</p><p>I want to develop iPhone apps, but the learning curve is too steep to be productive quickly.  I get the feeling that I have to already be a Mac developer since I've never done memory cleanup beyond removing an event listener.</p><p>Is android development easier coming from a C# .NET and ActionScript background?</p>","55124","","149","","2009-05-31 17:57:02","2013-02-28 19:35:53","IPhone vs Android","<iphone><android><ide>","14","1","9","2013-03-01 03:10:18",""
"934237","1","935842","","2009-06-01 10:15:22","10","26108","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/6554269/android-sqlite-no-such-table-error"">Android Sqlite - &ldquo;No Such Table&rdquo; Error</a>  </p></blockquote><p>We are trying to develop an application on Android. We are using SQLite database and on phone we are getting </p><blockquote>  <p>SQLiteException:no such table. </p></blockquote><p>It is working fine on simulator.</p><p>Can anyone provide any input on this?</p>","104004","","23199","","2011-07-24 00:51:58","2012-06-22 11:13:44","SQLite Exception: no such table Error","<android><sqlite>","3","4","2","2012-06-04 17:14:14",""
"934301","1","","","2009-06-01 10:41:07","0","3251","<p>Hi I want to change the folder permissions on device but when I type su I get permission denied is there any other way to do the same?</p>","95877","","1384282","","2013-01-13 00:09:49","2013-05-17 17:58:10","SU command issue Android device","<android><shell><root>","1","9","","",""
"935103","1","945448","","2009-06-01 14:38:10","3","1204","<p>I would like to execute opcodes directly against the running Dalvik VM instance from within my application on Android.  I'm looking for something similar to the C asm function.  I have a list of opcodes for dalvik, but I am unfamiliar with how to either execute them directly, or write them out to .class files and execute them against some sort of VM CLI command like dalvikvm from within a running application.</p>","3484","","","","","2013-03-01 10:13:35","How Do I Execute Dalvik Op-Codes","<android><assembly><dalvik><opcodes>","2","0","1","",""
"937307","1","946425","","2009-06-01 23:31:03","1","2094","<p>I have created a custom <a href=""http://developer.android.com/reference/android/widget/ExpandableListAdapter.html"" rel=""nofollow"">ExpandableListAdapter</a> and everything works properly. What I'd like to be able to do is in each of the groups add a different type of child to the end. I have tried adding 1 to the <code>getChildrenCount()</code> number and then testing <code>isLastChild</code> in the <code>getChildView()</code> method, but that doesn't seem to work.</p><p>If a group has three children what I have working looks like this:</p><pre>Group    NormalChild    NormalChild    NormalChild</pre><p>But I'd really like something like this:</p><pre>Group    NormalChild    NormalChild    NormalChild    AlternateChild</pre><p>The idea being that the <code>AlternateChild</code> could be a link to more info about the group. Any Ideas?</p><p><strong>EDIT:</strong><a href=""http://developer.android.com/reference/android/widget/ListView.html"" rel=""nofollow"">ListView</a> has <a href=""http://developer.android.com/reference/android/widget/ListView.html#addFooterView%28android.view.View%29"" rel=""nofollow"">addFooterView()</a> which will allow you to add a footer to a whole <code>ListView</code>... wonder how to add them to the ExpandableListView's children, or if it's even possible</p>","76835","","76835","","2009-06-02 08:38:24","2010-05-30 16:57:41","In an ExpandableListView, how can I show one additional line at the end of the child results?","<java><android><expandablelistview><expandablelistadapter>","1","0","1","",""
"937313","1","938657","","2009-06-01 23:35:31","589","267593","<p>I've been battling to get <code>fling</code> gesture detection working on my Android application today.I've been looking at these sources;</p><ul><li><p><a href=""http://www.anddev.org/gesturedetector_and_gesturedetectorongesturelistener-t3204.html"">Detect Gestures - Tutorial</a></p></li><li><p><a href=""http://developer.android.com/reference/android/view/GestureDetector.SimpleOnGestureListener.html"">SDK docs</a></p></li><li><p><a href=""http://www.google.co.in/codesearch/p?hl=en#RzGvLIykRFs/src/com/android/calculator2/PanelSwitcher.java&amp;q=android%20package%3agit://android.git.kernel.org%20Calculator2"">Calculator Code</a></p></li></ul><p>Nothing has worked for me so far and I was hoping for some pointers.</p><p>What I have is a <code>GridLayout</code> that contains 9 <code>ImageView</code>s. The source can be found here: <a href=""http://code.google.com/p/miffed/source/browse/GUI/src/uk/ac/ic/doc/gea05/miffed/wigets/GridLayout.java"">Romain Guys's Grid Layout</a>.</p><p>That file is take from Romain Guy's <a href=""http://code.google.com/p/apps-for-android/"">Photostream application</a> and has only been slightly adapted.</p><p>For the simple click situation I need only set the <code>onClickListener</code> for each <code>ImageView</code> I add to be the main <code>activity</code> which implements <code>View.OnClickListener</code>. It seems infinitely more complicated to implement something that recognizes a <code>fling</code>. I presume this is because it may span <code>views</code>?</p><ul><li><p>If my activity implements<code>OnGestureListener</code> I don't know how toset that as the gesture listener forthe <code>Grid</code> or the <code>Image</code> views that Iadd.</p><pre><code>public class SelectFilterActivity extends Activity implements   View.OnClickListener, OnGestureListener { ...</code></pre></li><li><p>If my activity implements<code>OnTouchListener</code> then I have no<code>onFling</code> method to <code>override</code> (it hastwo events as parameters allowing meto determine if the fling wasnoteworthy).</p><pre><code>public class SelectFilterActivity extends Activity implements    View.OnClickListener, OnTouchListener { ...</code></pre></li><li><p>If I make a custom <code>View</code>, like <code>GestureImageView</code> that extends <code>ImageView</code> I don't know how to tell the activity that a <code>fling</code> has occurred from the view. In any case, I tried this and the methods weren't called when I touched the screen.</p></li></ul><p>I really just need a concrete example of this working across views. What, when and how should I attach this <code>listener</code>? I need to be able to detect single clicks also.</p><pre><code>// Gesture detectionmGestureDetector = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener() {    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {        int dx = (int) (e2.getX() - e1.getX());        // don't accept the fling if it's too short        // as it may conflict with a button push        if (Math.abs(dx) &gt; MAJOR_MOVE &amp;&amp; Math.abs(velocityX) &gt; Math.absvelocityY)) {            if (velocityX &gt; 0) {                moveRight();            } else {                moveLeft();            }            return true;        } else {            return false;        }    }});</code></pre><p>Is it possible to lay a transparent view over the top of my screen to capture flings?If I choose not to <code>inflate</code> my child image views from XML can I pass the <code>GestureDetector</code> as a constructor parameter to a new subclass of <code>ImageView</code> that I create?</p><p>This is the very simple activity that I'm trying to get the <code>fling</code> detection to work for: <a href=""http://code.google.com/p/miffed/source/browse/GUI/src/uk/ac/ic/doc/gea05/miffed/gui/SelectFilterActivity.java?r=210"">SelectFilterActivity (Adapted from photostream)</a>.</p><p>Any advice would be greatly appreciated. Apologies if the question is disjointed, please ask for clarification and I'll happily tell you the specifics of what I've tried.</p>","111734","","1570662","","2014-01-22 00:08:44","2014-01-22 00:08:44","Android - basic gesture detection","<android><listener><gesture-recognition>","13","2","510","",""
"937724","1","947072","","2009-06-02 02:48:55","3","1415","<p>I recently stumbled into PhoneGap and I love the concept, but I can't get my first try at an  Android application working.  The documentation skips a few details and the comments are filled with people running into problems.</p><p>Does anyone out there have PhoneGap running?  What did you tweak for Android?  </p>","55124","","13154","","2009-06-02 13:00:06","2010-03-05 15:51:13","Mobile Development for iPhone, Android, and Blackberry","<iphone><android><blackberry><phonegap>","2","3","5","",""
"938215","1","938794","","2009-06-02 06:48:15","3","704","<p>How can I differentiate an android Activity from a SubActivity programatically?Is there any api for that?</p>","115522","","","","","2009-06-02 10:13:03","How can I differentiate an android Activity from a SubActivity programatically?","<android>","1","0","","",""
"938719","1","958611","","2009-06-02 09:46:28","2","30796","<p>I am trying to get the GPS location of my G1 using the following code</p><p><strong>In Activity</strong></p><pre><code>MyLocationListener myListener = new MyLocationListener();LocationManager myManager = (LocationManager)getSystemService(LOCATION_SERVICE);myManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 0, myListener);</code></pre><p>This is the LocationListener class</p><pre><code>public class MyLocationListener implements LocationListener {  private static double latitude;  private static double longitude;  @Override  public void onLocationChanged(Location arg0) {    latitude = arg0.getLatitude();    longitude = arg0.getLongitude();  }  @Override  public void onProviderDisabled(String provider) {  }  @Override  public void onProviderEnabled(String provider) {  }  @Override  public void onStatusChanged(String provider, int status, Bundle extras) {}  public static double getLatitude() {    return latitude;  }  public static double getLongitude() {    return longitude;  }}</code></pre><p>I waited for as long as 30 seconds but none of the listener methods were called. The GPS icon shows up, stays there for some time but for some reason I don't get a fix, even outdoors in bright sunlight. I am testing on a G1 with 1.5 SDK.</p><p>Can someone please tell me what's wrong with the code? Thanks.</p><p>Adding log</p><pre><code>06-02 18:30:43.143: ERROR/System(52): java.lang.SecurityException06-02 18:30:43.143: ERROR/System(52):     at android.os.BinderProxy.transact(Native Method)06-02 18:30:43.143: ERROR/System(52):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)06-02 18:30:43.143: ERROR/System(52):     at android.os.ServiceManager.addService(ServiceManager.java:72)06-02 18:30:43.143: ERROR/System(52):     at com.android.server.ServerThread.run(SystemServer.java:155)06-02 18:30:43.152: ERROR/AndroidRuntime(52): Crash logging skipped, no checkin service06-02 18:30:43.382: ERROR/SystemServer(52): Failure starting StatusBarService06-02 18:30:43.382: ERROR/SystemServer(52): java.lang.NullPointerException06-02 18:30:43.382: ERROR/SystemServer(52):     at com.android.server.status.StatusBarPolicy.updateBluetooth(StatusBarPolicy.java:749)06-02 18:30:43.382: ERROR/SystemServer(52):     at com.android.server.status.StatusBarPolicy.&lt;init&gt;(StatusBarPolicy.java:282)06-02 18:30:43.382: ERROR/SystemServer(52):     at com.android.server.status.StatusBarPolicy.installIcons(StatusBarPolicy.java:337)06-02 18:30:43.382: ERROR/SystemServer(52):     at com.android.server.ServerThread.run(SystemServer.java:186)06-02 18:30:43.382: ERROR/AndroidRuntime(52): Crash logging skipped, no checkin service</code></pre>","46297","","147141","","2009-10-07 22:26:14","2011-03-29 23:35:12","Android - using LocationManager does not give a geo fix","<android><gps>","3","1","3","",""
"938872","1","","","2009-06-02 10:42:49","3","1471","<p>I am new to android. Now I am working on some database sample programs.Now I have a problem in displaying the data retrieved from database ina tabular format. If anyone know the answer, please help me with thesource code.</p>","111436","","1777090","","2013-01-17 05:03:51","2013-01-17 05:03:51","How to display data in tabular format in android?","<android>","1","0","1","",""
"939170","1","945879","","2009-06-02 12:09:32","6","30027","<p>I have a database file in <code>res/raw/</code> folder. I am calling <code>Resources.openRawResource()</code>  with the file name as <code>R.raw.FileName</code> and I get an input stream, but I have an another database file in device, so to copy the contents of that db to the device db I use:</p><pre><code> BufferedInputStream bi = new BufferedInputStream(is);</code></pre><p>and FileOutputStream, but I get an exception that database file is corrupted. How can I proceed?I try to read the file using <code>File</code> and <code>FileInputStream</code> and the path as <code>/res/raw/fileName</code>, but that also doesn't work.</p>","95877","","815724","","2012-02-04 08:25:10","2012-02-09 02:06:08","Resources.openRawResource() issue Android","<java><android>","2","1","3","",""
"939444","1","939541","","2009-06-02 13:15:53","16","8021","<p>I need to work on my Android development skills.  Which blog has the freshest and most walkthroughs, code samples, and tutorials?</p>","30957","","12870","","2009-06-02 13:22:27","2011-05-18 10:12:26","Which Android development blog has the most walkthroughs and tutorials?","<android><blogs>","5","2","16","2011-05-19 03:01:18",""
"943944","1","945683","","2009-06-03 10:04:38","3","7111","<p>the graphic designer of the Android app that I'm currently building has come up with a two-color line as a separator between items in a layout box:</p><p><img src=""http://img7.imageshack.us/img7/3351/twocolorline.png"" alt=""two-color separator line"" /></p><p>If you look closely at the image, you see a darkish gray line, with immediately below it a very light gray (almost white) line. The lines should resize to the width of the container.</p><p>What is the best way to implement this in the UI?</p>","51034","","51034","","2009-06-03 10:11:20","2011-12-17 15:53:10","Two-color horizontal line in Android","<android>","5","0","2","",""
"954249","1","","","2009-06-05 04:16:49","4","24699","<p>I need sample code to create TabHost in android.can anyone help me.</p>","111436","","519818","","2011-04-25 07:27:50","2014-04-10 13:13:45","can anyone give sample code for TabHost in Android?","<android><android-tabhost>","3","2","4","",""
"954726","1","971958","","2009-06-05 07:52:49","18","26916","<p>I want to show an AlertDialog with one option that might change on every request. So for example at one time I want to show the option ""add to contacts"" while another time it should be ""remove from contacts"".</p><p>My code does work on the first time, however Android seems to cache the AlertDialog so that onCreateDialog is not executed next time. Therefore the option doesnt change anymore. Can I prevent this caching, or is there just another way of changing the option?</p><p><strong>I am working with SDK 1.5 but using 1.1.</strong></p><pre><code>@Overrideprotected Dialog onCreateDialog(final int id) {    ...    String add_remove_contact = res.getString(R.string.profile_add_to_contacts);    if (user.getContacts().contains(profileID)) {        add_remove_contact = res.getString(R.string.profile_remove_from_contacts);        // TODO: this string is not changed when contact status changes     }    final CharSequence[] items = {res.getString(R.string.view_profile),                                  res.getString(R.string.profile_send_message),                                  add_remove_contact};    AlertDialog.Builder builder = new AlertDialog.Builder(this);    ...    return builder.create();}</code></pre>","81364","","750613","","2012-06-22 11:06:22","2012-06-22 11:08:16","Android AlertDialog with dynamically changing text on every request","<java><android><alertdialog>","7","0","6","",""
"957076","1","957273","","2009-06-05 17:20:44","2","3935","<p>What JavaScript Mobile development tool would you use based on momentum, existing documentation and functionality, and ability to get passed the App Stores strict policies? </p>","55124","","","","","2010-02-16 17:38:44","QuickConnect vs Phonegap","<javascript><iphone><android><phonegap><xui>","4","1","1","",""
"958525","1","1029824","","2009-06-05 23:08:52","2","1029","<p>I'm considering the use of <code>JiBX</code> for a project that will have to run on both Blackberry and RIM. While it seems like <code>J2ME</code> use of <code>JiBX</code> has been considered by the community (as per JiBX jira tickets), Android is relatively new.</p><p>The question is, therefore, this: has anybody had any success (or issues, for that matter) using JiBX on Android, or any other libraries that need to modify your class bytecode at build-time?</p><p>There have been discussions out there about how such libs should be runnable on Android (as compared to those using runtime bytecode instrumentation), but I haven't seen too many reports about people actually attempting to do this.</p>","118317","","750613","","2012-06-30 11:49:14","2012-06-30 11:49:14","JiBX on Android (or any other build-time bytecode manipulating library)","<java><xml><android><bytecode><jibx>","3","0","1","",""
"958652","1","","","2009-06-06 00:19:13","1","537","<p>I have just start to study Android. But I have no linux PC &amp; Android phone. I just using Emulator on Windows OS. </p><p>Now, I wanna try to use Sql lite &amp; Contents provider on Android. Can I test sample code on Emulator without Linux? Some people say that I should build Android on Linux ad make Image for Emulator. Then test on Emulator on windows. Is it right? or Can emulator works alone ?</p>","","rinehart","996493","","2012-04-26 10:08:00","2012-04-26 10:08:00","Can I try my Android test code with SQL lite & Content provider on Emulator?","<android><content><emulator>","2","1","","",""
"959522","1","963312","","2009-06-06 11:46:09","1","5002","<p>I'm trying to draw a square in OpenGL ES (Android), 2D and covering the whole screen.</p><p>At the moment I'm just using trial and error but am sure there has got to be a better way to get the size of the screen. Below is how I'm currently initializing square:</p><pre><code>    float[] square = new float[] { 	-0.1f, -0.1f, 0.0f,								0.1f, -0.1f, 0.0f,								-0.1f, 0.1f, 0.0f,								0.1f, 0.1f, 0.0f };</code></pre><p>Ideally the 0.1f in the x axis would be be the width and 0.1 in y the height of the window. Any help would be greatly appreciated.</p><p>Cheers </p>","","Dawson","44729","","2010-06-18 23:11:42","2010-06-18 23:11:42","Getting the size of the OpenGL window in Android","<android><opengl-es>","2","1","","",""
"959969","1","966813","","2009-06-06 15:45:48","0","1183","<p>I've installed the newest Android SDK using eclipse's software updates feature to hit the resource at <a href=""https://dl-ssl.google.com/android/eclipse/"" rel=""nofollow"">https://dl-ssl.google.com/android/eclipse/</a>.</p><p>After installing it, it seems like the SDK is integrated into Eclipse, but when I try to create a new project with a single blank activity in it, I get the following error:</p><pre>[2009-06-06 11:41:24 - TestProject] no classfiles specified[2009-06-06 11:41:24 - TestProject] Conversion to Dalvik format failed with error 1</pre><p>This is using <code>eclipse version 3.4.2</code> running on top of <code>Mac OS 10.5.7</code> on a 32 bit processor.</p><p>Is this a misconfiguration on my part? Have I missed a part of the installation?</p>","32771","","750613","","2012-06-30 11:48:42","2012-06-30 11:48:42","Trouble Installing the new Android SDK","<android><eclipse><configuration>","3","0","","",""
"961944","1","965641","","2009-06-07 14:10:20","43","74080","<p>Is it possible to have overlapping views in Android? I would like to have an ImageView with a transparent png in the front and another view in the background.</p><p>edit:</p><p>This is what I have at the moment, the problem is that the image in the imageView is not transparent, the parts that should be transparent are just black.</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:orientation=""vertical""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:id=""@+id/gallerylayout""&gt;&lt;Gallery android:id=""@+id/overview""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    /&gt; &lt;ImageView android:id=""@+id/navigmaske"" 	android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:src=""@drawable/navigmask""    /&gt; &lt;/RelativeLayout&gt;</code></pre><p>edit:</p><p>I got it to work, it was a theme file from another programmer on the team.Just changed this</p><pre><code>&lt;item name=""android:background""&gt;#FF000000&lt;/item&gt;</code></pre><p>to this</p><pre><code>&lt;item name=""android:background""&gt;#00000000&lt;/item&gt;</code></pre>","2450","","365265","","2013-08-03 20:38:58","2013-10-02 23:00:55","Overlapping Views in Android","<java><android><view>","5","2","23","",""
"962172","1","962283","","2009-06-07 16:03:47","4","2828","<p>How do I record some audio using Android?</p>","108495","","","","","2011-12-27 21:09:19","How do I record audio using Android 1.5?","<android><audio>","3","0","1","",""
"963340","1","3747154","","2009-06-08 03:27:23","34","192856","<p>Is it possible to add extra languages to Android? My current Android phone only supports English and Chinese language input. I would like to have Dutch also, as I can use it for word completion. The question on top of that is, how to switch easily between these languages in the text input (keyboard) GUI?</p>","70182","","","","","2012-11-29 12:58:36","How to add an extra language input to Android?","<android>","7","0","1","2011-11-17 14:16:33",""
"970392","1","971579","","2009-06-09 14:28:25","2","274","<p>How would a phone like the <code>Samsung I7500</code> upgrade its firmware when running on a non google partner carrier? I don't see any kind of manual upgrade options available.</p>","73831","","750613","","2012-06-30 11:46:31","2012-06-30 11:46:31","Non OTA Android upgrades","<android><mobile>","3","0","","",""
"971824","1","982361","","2009-06-09 18:49:34","18","3424","<p>I'm messing with Android services, and I have found that <code>ServiceConnection.onServiceConnected()</code> gets called fairly predictably when I bind to a service.</p><p>However, my <code>onServiceDisconnected()</code> method seems to never be called, even after the VM dies.</p><p>I have logged debug messages on the service and show that all threads have been shutdown, etc. I know services are implemented as processes; are there threads I don't know about that are preventing the process from exiting?</p><p>Thanks in advance.</p>","104181","","750613","","2012-06-30 11:46:17","2013-01-27 04:15:22","When does ServiceConnection.onServiceDisconnected() get called?","<android><android-service>","1","0","2","",""
"972933","1","980802","","2009-06-09 23:01:28","13","4006","<p>Is there a way of removing an activity from the home launcher by itself at runtime? I mean removing <code>Intent.CATEGORY_LAUNCHER</code> from it's properties or something similar.</p>","7363","","750613","","2012-06-30 11:42:17","2012-07-23 08:11:06","Remove application from launcher programatically in Android","<java><android><android-manifest>","1","0","6","",""
"973127","1","","","2009-06-10 00:12:36","7","5178","<p>I am working on an android app that needs to act on a few data files totaling around <code>30MB</code>.  I put together a test and the emulator failed with <code>OutOfDiskSpace</code>.  Debugging on a device failed with even a smaller data size.  After reading through the google groups, it appears that the application size limit isn't stated anywhere and nobody from google has been forthcoming with specifics about this.  Given that there are iPhone apps that are over <code>100MB</code> in size, putting such a small limit on Android apps seems weird, except just for the fact that you have a relatively small amount of total available app storage space (&lt; <code>100MB</code>).</p><p>Now for my question:</p><p>What techniques do you use to deal with this limit? If you have an app that needs more than 10MB, do you put it on a web server and deal with downloading it the first time?  If so, how do you handle access control so that only your app can get the data?</p>","16476","","750613","","2012-06-30 11:42:54","2012-06-30 11:42:54","Android Application Requiring Large Data Files","<java><android><web-services>","2","0","3","",""
"973386","1","1081807","","2009-06-10 02:01:50","25","6325","<p>I believe I read at some point that due to Android running on the Dalvik VM, that dynamic languages for the JVM (Clojure, Jython, JRuby etc.) would be hard pressed to obtain good performance on Dalvik (and hence on Android).  If I recall correctly, the reasoning was that under the hood, in order to achieve the dynamic typing, there was quite a bit of fiddling done with the java bytecode and that the bytecode->dalvik translation wouldn't pick this up easily.</p><p>So should I avoid a dynamic JVM language if I want to develop for Android?</p><p><hr /></p><p>EDIT: I guess I should have provided a bit more context.  I was considering using Clojure to develop apps for Android.  I was thinking about using Clojure for a few reasons: </p><ul><li><p>I want to learn FP</p></li><li><p>I don't really care to learn Java</p></li><li><p>Clojure seems to have some veryinteresting language concepts (STMfor example).</p></li></ul><p>However, when I tried to write apps for Android in Clojure, I found that there is a performance issue that is unacceptable.  But I found a blog posting that said that dynamically typed languages (Clojure for example) would have problems due to the bytecode manipulation needed to get the dynamic typing.  So I was sort of looking for independent confirmation that this is true or it isn't.  I should have known better than to make the assumption that in this particular issue all dynamically typed JVM languages could be treated as the same.  I guess I did ask a fairly broad question so I guess I shouldn't be surprised that people didn't quite understand what I was asking.</p>","2820","","2820","","2010-06-28 12:24:09","2014-03-04 19:25:04","Android Adverse To Dynamic Languages","<android><dynamic><jvm>","4","0","8","","2010-06-28 12:24:09"
"974680","1","1417817","","2009-06-10 10:02:40","8","36708","<p>I would like to create a photo/video capture application. </p><p>I have created a <code>CaptureView</code> class which extends <code>SurfaceView</code> and placed it in the main form.</p><p>The main form's activity has <code>onCreateOptionsMenu()</code> method which creates a menu. The menu worked fine but then I tried to implement a method <code>onKeyDown</code>:</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if(event.getAction() == KeyEvent.ACTION_DOWN) {        switch(keyCode) {        case KeyEvent.KEYCODE_CAMERA:            videoPreview.TakePicture();            return true;        }    }    return super.onKeyDown(keyCode, event);}</code></pre><p>The menu doesn't appear anymore and the method doesn't catch onKeyDown event.</p><p>Does anyone know what could be the reason for this issue?</p>","22996","","2065587","","2014-03-12 13:15:59","2014-03-12 13:15:59","onKeyDown() issue","<android><android-view><onkeydown>","8","3","1","",""
"975611","1","","","2009-06-10 13:30:11","5","5570","<p>Anyone help me to modify the layout params of a child in a ListView in Android.Please give some code snippets if you can.</p>","111436","","","","","2011-10-04 12:13:00","How to modify the Layout params of a child in a ListView in Android?","<android>","3","0","4","",""
"975918","1","978512","","2009-06-10 14:25:05","1","3511","<p>I am creating a custom Widget which extends SurfaceView and I am planning to use it for camera preview.</p><p>In the main activity I tried to implement some event listeners but can't catch any event.</p><p>This is the part of code where I tried to add an event listener:</p><pre><code>videoPreview = (CaptureView)findViewById(R.id.capturePreview);    videoPreview.setOnKeyListener(new OnKeyListener(){		public boolean onKey(View v, int keyCode, KeyEvent event){			switch(keyCode)			{			case KeyEvent.KEYCODE_CAMERA:				videoPreview.TakePicture();				return true;			}			return false;		}	});</code></pre><p>If I press a button the LogCat outputs ""Continuing to wait for key to be dispatched"" line.</p><p>Does anyone know how to implement event listeners in main activity using SurfaceView classes?</p><p>Thanks!</p>","22996","","","","","2009-11-24 15:02:06","Processing events in SurfaceView","<android><event-handling><surfaceview>","3","0","1","",""
"977295","1","","","2009-06-10 18:11:44","0","827","<p>Is there a working snapshot of Android that will run on my HTC Touch (""ELF0300"" with OMAP850 processor)?</p>","","froo","","","","2009-06-11 00:00:52","Is there a working snapshot of Android that will run on my HTC Touch (""Elf"")?","<android><htc>","2","0","","",""
"978172","1","1633437","","2009-06-10 21:10:49","3","10008","<p>I have an app that allows you to create Home ""shortcuts"" to a specific <code>Activity</code>. It turns out that some of my users will use the app, hit the home key to go do something else, then use one of the shortcuts to jump back to that Activity. Since the app is still in memory it just opens the new <code>Activity</code> on top of the others and the ""Back"" key will take them back through the whole history. What I'd like to have happen is if they use a shortcut then to effectively kill the history and have the back key just exit the app. Any suggestions?</p>","76835","","76835","","2009-06-10 22:32:46","2011-05-31 11:21:26","How do you make an Android ""Home"" shortcut bypass the app it's point to's history?","<android><activity><shortcut>","2","0","5","",""
"979778","1","979793","","2009-06-11 07:28:35","7","2091","<p>I'm just starting out on Android and Java programming, coming in from a C++ background. I was wondering - whats the best way to go about making a library/UI widget/component that I can license to third-party developers? </p><p>In C++ I'd ship the customers my headers and *.a files, but I don't know the equivalent in Java.</p><p>Are there any good resources or links about this, maybe even from general Java development standpoint.</p>","94239","","","","","2011-07-06 00:21:38","Making a redistributable component or library for Android","<java><android>","3","2","1","",""
"982386","1","983777","","2009-06-11 17:11:35","2","46484","<p>i'm following the example on the android tutorial about the GridView, but instead of showing image, i want to just simple show some text using a TextView. it turns out seems to be harder than i thought. it might seems like this is totally unnecessary and it doesn't have a valid use case, but i'm trying this out to just get myself familiar with the sdk. </p><p>so my code is pretty much the same as the GridView example in <a href=""http://developer.android.com/guide/tutorials/views/hello-gridview.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/views/hello-gridview.html</a>, but instead of using a ImageAdapter, i created a dummy adapter like following:  </p><pre><code>public class MyAdapter extends BaseAdapter {    private Context context;    private String[] texts = {""aaa"", ""bbb"", ""ccc"", ""ddd"", ""eee"", ""fff"", ""eee"", ""hhh"", ""iii""};    public MyAdapter(Context context) {        this.context = context;    }    public int getCount() {        return 9;    }    public Object getItem(int position) {        return null;    }    public long getItemId(int position) {        return 0;    }    public View getView(int position, View convertView, ViewGroup parent) {        TextView tv;        if (convertView == null) {            tv = new TextView(context);            tv.setLayoutParams(new GridView.LayoutParams(85, 85));        }        else {            tv = (TextView) convertView;        }            tv.setText(texts[position]);        return tv;    }}</code></pre><p>it all seems valid to me, but running this gives me nothing on the screen. and there's no error message. there are some selectable/clickable (invisible) blocks if i click them, but the text is obvious not shown. i wonder is my layout doesn't have the android:text causing this problem? or anything else?</p><p>any feedback will be appreciated and thanks for your help!</p>","121476","","111033","","2011-09-03 18:04:49","2014-03-28 05:51:36","Android: Simple GridView that displays text in the grids","<java><android><phone>","2","0","3","",""
"983761","1","1139025","","2009-06-11 21:19:08","12","49115","<p>I'm writing an Android App and I'm looking for the fastest (In terms of setup) way for me to send data to a server and receive information back on request.</p><p>We're talking basic stuff. I have a log file which tells me how a user is using my application (In beta, I wouldn't runin a user experience by constantly logging usually) and I want to communicate that to my server (That I haven't setup).</p><p>I don't need security, I don't need high throughput or concurrent connections (I have 3 phones to play with) but I do need to set it up fast!</p><p>I remember back in the day that setting up XAMPP was particularly brainless, then maybe I could use PHP to send the file from the phone to the Server?</p><p>The Server would ideally be able to respond to a GET which would allow me to send back some SQL statements which ultimately affect the UI. (It's meant to adapt the presented options depending on those most commonly used).</p><p>So there you have it, I used PHP about 4 years ago and will go down that route if it's the best but if there's some kind of new fangled port open closing binary streaming singing and dancing method that has superseeded that option I would love to know.</p><p><a href=""http://developerlife.com/tutorials/?p=288"">This tutorial</a> seems useful but I don't really need object serialization, just text files back and forth, compressed naturally.</p><p>Android comes with the <strong>Apache HTTP Client 4.0</strong> built in as well as java.net.URL and java.net.HttpUrlConnection, I'd rather not add too much bult to my App with third party libraries.</p><p>Please remember that I'm setting up the server side as well so I'm looking for an overall minimum lines of code!</p><p>Thanks,</p><p>Gav</p>","111734","","","","","2013-02-06 06:58:30","Android (Java) Simple Send and recieve with Server - Fast Setup Challenge","<java><android>","4","0","22","",""
"985153","1","","","2009-06-12 05:28:44","5","8774","<p>Anyone please help me with some code snippets to slove the problem.If anyone knows how to make an adjustable gridview please help me.</p>","111436","","","","","2009-07-07 10:24:48","How to make a GridView stretchable in Android to expand the Column width to any extend?","<android>","1","0","1","",""
"985793","1","985857","","2009-06-12 09:20:50","1","726","<p>I have just been integrating the Skyhook Wireless technology into my Android application. This is the localization framework that gives a better localization by looking for wifi hotspots. As a result the position is better, at least indoors when it can find a hotspot. On the downside the library is around 300kb of size on the device.</p><p>Now in Cupcake when I look at ""Security &amp; location"" settings, there is an option named ""Use wireless networks"". This seems to be exactly the same as Skyhooks technology. However, I cant find any useful information about what kind of localization this is and weather it makes sense to drop the 300 kb library. Is Skyhook already integrated into Cupcake?</p>","81364","","","","","2009-06-12 09:40:28","Does Android (Cupcake) already use Skyhook Wireless for localization?","<android><localization><wireless>","1","0","2","",""
"985851","1","992801","","2009-06-12 09:37:09","0","1535","<p>I created a custom SurfaceView called CaptureView and tried to add it into main.xml file:</p><pre><code>&lt;dev.recorder.client.CaptureView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/capturePreview""/&gt;</code></pre><p>The application seems to work fine but if I switch from main.xml tab to Layout in Eclipse the text NullPointerException appears instead of layout preview.</p><p>In the Activity I binded the controls the following way:</p><pre><code>setContentView(R.layout.main);    bindControls();private void bindControls(){	videoPreview = (CaptureView)findViewById(R.id.capturePreview);	txtstatus = (TextView)findViewById(R.id.txtMode);	txtTimer = (TextView)findViewById(R.id.txtTime);}</code></pre><p>Does anyone know how this issue could be solved?</p>","22996","","","","","2010-03-18 09:44:19","How to avoid NullPointerException when using custom Views or SurfaceViews","<android><custom-controls><nullpointerexception>","1","1","","",""
"986364","1","986669","","2009-06-12 12:23:49","0","4258","<p>I am creating an appication for video recording and I overlayed the video preview with labels txtStatus and txtTime.</p><p>The camera button starts/stops the timer which periodically calls the UpdateGUI method. Running the debug I can see the timer is working - it calls updateGUI method every second but the method doesn't update the controls.</p><p>I would really appreciate if I could get any hint on how to fix this issue.</p><p>Here is the code:</p><p>This is the method which activates the timer:</p><pre><code>private void startTimer(){	updateTimer = new Timer(""TimerUpdate"");	updateTimer.scheduleAtFixedRate(new TimerTask(){		public void run(){			settings.IncreaseRecordingTime();			updateGUI();		}	}, 0, 1000);}</code></pre><p>This is the updateGUI method:</p><pre><code>private void updateGUI(){	setStatusLabel();	String strTime = settings.GetTimerString(); //strTime changes every second (it works as expected)	txtTimer.setText(strTime);//the text doesn't change!}</code></pre><p>And this is the method which is called when the button is pressed:</p><pre><code>private boolean onCaptureButton(){	settings.CaptureAction();	videoPreview.setFrameCallback(settings);	updateGUI();//here the function updateGUI() works as expected - it changes the txtStatus text from ""Preview"" to ""Recording""	setTimer();	return false;}</code></pre><p>I added some comments as well (don't know why updateGUI() works when it is called at onCaptureButton() method and doesn't work when called inside the timer method).</p>","22996","","","","","2013-06-26 20:07:47","Using timer for updating GUI: why it doesn't work?","<android><gui><timer>","2","0","","",""
"986602","1","989725","","2009-06-12 13:18:59","4","5807","<p>I tried to bind some actions to a camera button:</p><pre><code>videoPreview.setOnKeyListener(new OnKeyListener(){		public boolean onKey(View v, int keyCode, KeyEvent event){			if(event.getAction() == KeyEvent.ACTION_DOWN)			{				switch(keyCode)				{				case KeyEvent.KEYCODE_CAMERA:					//videoPreview.onCapture(settings);					onCaptureButton();...				}			}			return false;		}	});</code></pre><p>Pressing the button however the application crashes because the original Camera application starts.</p><p>Does anyone know how to prevent Camera application start when the camera button is pressed?</p>","22996","","","","","2010-12-07 17:48:18","Android: Unregister camera button","<android><camera>","4","0","2","",""
"986627","1","991120","","2009-06-12 13:25:09","46","6125","<p>I have an Android library that uploads data to a test server and production server. I'd like developers using this library to use the test server when developing, and production server when the app is downloaded from Android Market.</p><p>Is this possible for an app to tell where it came from (Market or non-Market?) I would imagine one could detect the presence of the signed JAR file.</p>","104181","","","","","2011-12-22 00:13:59","Detect if app was downloaded from Android Market","<android>","5","4","32","",""
"987072","1","987503","","2009-06-12 14:54:10","195","151849","<p>In an Android app, is there anything wrong with the following approach:</p><pre><code>public class MyApp extends android.app.Application {    private static MyApp instance;    public MyApp() {    	instance = this;    }    public static Context getContext() {    	return instance;    }}</code></pre><p>and pass it everywhere (e.g. SQLiteOpenHelper) where context is required (and not leaking of course)?</p>","15187","","267542","","2010-03-04 17:39:38","2013-12-09 07:52:06","Using Application context everywhere?","<android><android-context>","8","8","118","",""
"987848","1","","","2009-06-12 17:09:05","2","2826","<p>Having developed many desktop GUI apps (from Xt to Qt, Java Awt/Swt/Swing, etc) I really find it difficult to get used to Android.</p><p>Suppose I have the MainView Activity class which explicitly calls DetailedView via intent mechanism as shown next:</p><ul><li><p>Since an Activity class is instantiated via onCreate() how do Icustomize it? (No constructor, onlypass data through intent!)   </p></li><li><p>Is there a way to get a reference for the DetailedView instance inMainActivity?</p></li><li><p>Is there a way to get a reference for the MainActivity instance in DetailedView?</p></li><li><p>How can I pass the reference to FrontEnd to the DetailedView class?Intent.putExtras() allows only forcertain data types to pass to theintent receiver class.</p><pre><code>MainActivity {    ...    FrontEnd fe;    ...<pre><code>public void onCreate(Bundle savedInstanceState) {    ...    Intent myIntent = new Intent(this, DetailedView.class);    ...}protected void onListItemClick(ListView l, View v, int position, long id) {    ...    startActivityForResult(myIntent,..);    ...}</code></pre>}</code></pre></li></ul>","","perak","12388","","2010-03-21 18:51:31","2010-03-21 18:51:31","Passing data through intents instead of constructors","<android>","2","0","3","",""
"990217","1","990944","","2009-06-13 07:25:46","29","37804","<p>I am creating a application whose only component is a service which keeps on running in background (basically a proxy server) but I am not able to find a way how to start that service. Application can not have any UI or user interaction so I am not using Activity.Broadcast receiver can listen to BOOT broadcast but how do I start service first time when it is installed and how can I keep it running? or is there a broadcast which I can listen after app is installed e.g. may be TIME_TICK but that has to be registered from activity i think</p>","6946","","","","","2013-05-30 10:13:01","android app with service only","<android><service>","3","2","27","",""
"990551","1","990837","","2009-06-13 11:37:58","0","463","<p>I face a problem while devloping a native c/c++ share library for android platform, as we all know that Android use Java language for the upper layer development. Now I have ported my Engine code using ASCII c/c++ to android using its bionic library, yet when need to design the User Interface, I have to use the JNI to call my engine code. As far as I know, that is the only choice. The problem is my engine own hundrends of export APIs. If I use the JNI tech., I need to wrap these APIs to a new share library for use, which will cost a lot of time for devlopement and testing. Can somebody give some suggestions for this situation?  I am not familiar with java or JNI tech by the way.</p><p>TIPS:When I searched the Google, I found some open source for JNI generator such as JNative etc. Untill NOW I do not know is it suitable for Android platform or not.</p>","91527","","1777090","","2013-01-17 05:10:09","2013-01-17 05:10:09","JNI tech. on Android or linux platform when devlepment .so?","<android>","1","0","","",""
"990558","1","1094666","","2009-06-13 11:44:05","18","16473","<p>I created a <code>BroadcastReceiver</code> and configured it with an <code>android.provider.Telephony.SMS_RECEIVED</code> action filter so it is called everytime the phone <em>receives</em> a text.</p><p>Is there some event/action or other way for my application to be notified whenever the phone <em>sends</em> a text (preferably independent of the application that sends it)?</p><p>So far the only option I see is to poll the content provider for <code>content://sms/sent</code> which doesn't even give me all sent texts because applications can choose not to put it there.</p>","98401","","","","","2012-11-22 16:49:22","Android Broadcast Receiver for Sent SMS messages?","<android><sms><broadcastreceiver>","1","2","8","",""
"990948","1","991554","","2009-06-13 16:13:57","6","12850","<p>I have an application which spawns a new thread when a user asks for an image to be filtered.</p><p>This is the only type of task that I have and all are of equal importance.</p><p>If I ask for too many concurrent threads (Max I ever want is 9) the thread manager throws a <strong>RejectedExecutionException</strong>. </p><p>At the minute what I do is;</p><pre><code>// Manage Concurrent Tasksprivate Queue&lt;AsyncTask&lt;Bitmap,Integer,Integer&gt;&gt; tasks = new LinkedList&lt;AsyncTask&lt;Bitmap,Integer,Integer&gt;&gt;();@Overridepublic int remainingSize() {	return tasks.size();}@Overridepublic void addTask(AsyncTask&lt;Bitmap, Integer, Integer&gt; task) {	try{		task.execute(currentThumbnail);		while(!tasks.isEmpty()){			task = tasks.remove();			task.execute(currentThumbnail);		}	} catch (RejectedExecutionException r){		Log.i(TAG,""Caught RejectedExecutionException Exception - Adding task to Queue"");		tasks.add(task);	}}</code></pre><p>Simply add the rejected task to a queue and the next time a thread is started the queue is checked to see if there's a backlog.</p><p>The obvious issue with this is that if the final task gets rejected on its first attempt it will never be restarted (Until after it's no longer needed).</p><p>Just wondering if there's a simple model I should use for managing this sort of thing. I need tasks to notify the queue when they're done so I know there's space but I'm not sure how.</p><p>Kind regards,</p><p>Gavin</p>","111734","","","","","2010-02-17 18:40:48","Simple Thread Management - Java - Android","<java><android><multithreading>","3","0","6","",""
"991375","1","991429","","2009-06-13 19:51:47","3","3379","<p>I have an Android (1.5) application which needs to be constantly running when a button is pressed. So, when a button is pressed I would like the phone to remain on and not want the screen or CPU to time-out.</p><p>When another button is pressed I would like the phone to be back to normal and time-out as per user settings.</p><p>Thanks</p>","122547","","","","","2010-12-18 17:19:57","Preventing application/screen timeout Android","<android><android-1.5-cupcake>","2","1","2","",""
"991667","1","992114","","2009-06-13 22:31:04","6","7717","<p>How can I instruct Eclipse to copy a file from my Android solution to an emulator, as part of Run/Debug? I have a small database, stored in Assets, that needs to accompany the application. Thus far I have simply copied the file myself using DDMS but would prefer to have it automatically included. The project properties allow me to specify some aspects of the build, e.g. the build order and which libraries should be included, but I don't see anything about simply copying a file. </p>","4593","","114066","","2010-06-17 12:49:40","2010-06-17 12:49:40","Include a database file with Android application via Eclipse","<android><database><eclipse>","1","0","1","",""
"991764","1","992060","","2009-06-13 23:28:52","22","50232","<p>Is there a way to hide the window title so that it won't get shown in fullscreen mode (</p><pre><code>getWindow().setFlags(LayoutParams.FLAG_FULLSCREEN,    			LayoutParams.FLAG_FULLSCREEN)</code></pre><p>) but then will appear upon</p><pre><code>getWindow().clearFlags(LayoutParams.FLAG_FULLSCREEN)</code></pre><p>?</p><pre><code>requestWindowFeature(Window.FEATURE_NO_TITLE)</code></pre><p>is not an option of course as this won't allow to get it back. </p>","15187","","15187","","2009-06-14 12:04:20","2013-04-29 12:28:00","Hiding Title in a Fullscreen mode?","<android><fullscreen><title>","6","2","20","",""
"992508","1","992557","","2009-06-14 09:23:22","4","7701","<p>Hello I am trying to use a service to control a wakelock so I can permanently leave the screen on when my application is running. I create the wakelock and activate it in onCreate() and release it in onDestroy() however I get the error ""wl cannot be resolved"". Can someone explain how I can get over this? Code below:</p><pre><code>public class WakeLockService extends Service {    @Override    public IBinder onBind(Intent arg0) {        // TODO Auto-generated method stub        return null;    }      @Override    public void onCreate() {        PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);        PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, ""My Tag"");        wl.acquire();    }    @Override    public void onDestroy() {        wl.release();    }}</code></pre>","122547","","1777090","","2013-01-17 05:32:34","2013-01-17 05:32:34","Using a wakelock in a service Android 1.5","<java><android><android-service><android-wake-lock><android-1.5-cupcake>","2","0","4","",""
"992880","1","1013733","","2009-06-14 14:06:10","8","16113","<p>I'm trying to call a RESTful web service from an Android application using the following method:</p><pre><code>        HttpHost target = new HttpHost(""http://"" + ServiceWrapper.SERVER_HOST,ServiceWrapper.SERVER_PORT);        HttpGet get = new HttpGet(""/list"");        String result=null;	    HttpEntity entity = null;	    HttpClient client = new DefaultHttpClient();	    try {		  HttpResponse response=client.execute(target, get);		  entity = response.getEntity();		  result = EntityUtils.toString(entity);		 } catch (Exception e) {		  e.printStackTrace();		 } finally {		  if (entity!=null)		   try {		    entity.consumeContent();		   } catch (IOException e) {}		 }		 return result;</code></pre><p>I can browse to address and see the xml results using the Android Emulator browser and from my machine. I have given my app the INTERNET permission. </p><p>I'm developing with eclipse.</p><p>I've seen it mentioned that I might need to configure a proxy but since the web service i'm calling is on port 80 this shouldn't matter should it? I can call the method with the browser.</p><p>Any ideas?</p>","4950","","4950","","2009-06-16 18:47:49","2012-11-15 10:53:51","Unresolved Host Exception Android","<java><android><rest>","4","2","10","",""
"993137","1","993641","","2009-06-14 16:20:56","5","7184","<p>Hello I am trying to implement a wake lock for an application.</p><pre><code>    PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, ""My Tag"");</code></pre><p>It seems to force close when defining the PowerManager shown in the code above. Whats going wrong?</p>","122547","","","","","2009-06-14 20:05:29","Android wake lock force close","<java><android><android-1.5-cupcake>","1","0","3","",""
"994746","1","994862","","2009-06-15 06:38:01","9","13771","<p>I have created a BroadcastReceiver to detect SDCard mount and unmountevent, however, I am not able to receive any events at all:here's the AndroidManifest.xml:</p><pre><code>&lt;receiver android:enabled=""true"" android:label=""SDCardMountReceiver"" android:exported=""true"" android:name=""xxx.broadcasts.SDCardBroadcastReceiver""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.content.Intent.ACTION_MEDIA_MOUNTED""&gt;&lt;/action&gt;        &lt;!-- or &lt;action android:name=""android.content.Intent.ACTION_MEDIA_UNMOUNTED"" /&gt;--&gt;&lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>And the SDCardMountReceiver class:</p><pre><code>public class SDCardBroadcastReceiver extends BroadcastReceiver {    public SDCardBroadcastReceiver() {        super();        System.err.println(""constructor"");    }    public void onReceive(Context context, Intent intent) {        Log.d(""SDCardBroadCastReceiver"", ""receive "" + intent.getAction());        System.err.println(""jonathan receive "" + intent.getAction());    }}</code></pre>","121196","","2218452","","2013-04-27 10:40:24","2013-11-18 22:07:09","Android BroadcastReceiver can't receive any broadcast events","<android><broadcastreceiver>","3","2","4","",""
"994840","1","","","2009-06-15 07:20:21","1","8916","<p>Hai,anyone can help me to create user defined listener interface with some code snippets</p>","111436","","1288","","2009-07-27 17:53:21","2014-03-07 20:17:55","How to create our own Listener interface in android?","<android>","4","1","3","",""
"995514","1","997495","","2009-06-15 11:02:20","66","109100","<p>I am doing a https post and I'm getting an exception of ssl exception Not trusted server certificate. If i do normal http it is working perfectly fine. Do I have to accept the server certificate somehow?</p>","95877","","114066","","2010-08-13 16:01:07","2014-01-20 23:00:16","Https Connection Android","<java><android><ssl>","11","2","78","",""
"995673","1","999217","","2009-06-15 11:48:25","1","3868","<p>I want the user to select a contact to which my application would send a SMS. How do I ensure that when I start an activity with ACTION_PICK intent only those contacts with mobile phone numbers are displayed?</p><p>Currently, I'm starting the activity like this:</p><pre><code>Intent intent = new Intent(Intent.ACTION_PICK, Phones.CONTENT_URI);</code></pre>","80303","","","","","2011-03-24 12:37:38","How to start an ACTION_PICK activity with only those contacts which have a mobile phone","<android>","3","0","","",""
"995719","1","996288","","2009-06-15 11:57:52","58","19935","<p>I have an application which I want to hit the market as a Paid app. I would like to have other version which would be a ""trial"" version with a time limit of say, 5 days?</p><p>How can I go about doing this?</p>","122547","","779408","","2012-10-28 06:39:09","2014-04-08 13:49:49","Creating an Android trial application that expires after a fixed time period","<android><trialware><android-1.5-cupcake>","8","0","42","",""
"999947","1","1001953","","2009-06-16 07:10:47","0","1976","<p>I want to customize my ExpandableList. My issue is that I need a button and expandable list on single activity. Can I achieve that? I have seen all the examples but all extends ExpandableListActivity not the Activity in which I can put all the widgets in one activity. Any help would be appreciated.</p>","95877","","1777090","","2013-01-17 05:30:27","2013-01-17 05:30:27","Android ExpandableListActivity issue","<java><android><expandablelistview>","1","1","","",""
"1001944","1","2326036","","2009-06-16 14:43:36","9","7165","<p>I am developing a library for Android that requires frequent updates from a central server. I was thinking how nice it would be if my library could update itself -- or if I could just release a bootstrap library that downloads the target library when the app is installed.</p><p>I see this class in 1.5 called ""DexClassLoader"" but there seems to be precious little on the web besides the API docs. Has anyone used this successfully for the scenario which I described?</p><p>Also, do the terms of the Android Market permit such a thing?</p>","104181","","","","","2013-07-16 18:24:13","Android remote code loading","<android><auto-update>","3","0","22","",""
"1002085","1","","","2009-06-16 15:05:17","75","41725","<p>Just started working with the webview.  The issue is performance following rotation.  The WebView has to reload the page, which can be a bit tedious.</p><p>What's the best of of handling an orientation change without reloading the page from source each time?</p>","108099","","114066","","2010-08-13 15:44:21","2013-10-16 12:45:27","Android WebView handling orientation changes","<android><webview><orientation>","8","4","32","",""
"1002164","1","1571635","","2009-06-16 15:14:50","166","167264","<p>I'm trying to develop/port a game to Android, but it's in C, and Android supports Java, but I'm sure there must be a way to get a C app on there, anyone knows of a good tutorial on the subject?</p><p>Thanks!</p>","15124","","","user166390","2012-03-19 02:17:55","2013-10-05 04:02:15","Write applications in C or C++ for Android?","<c++><c><android>","20","10","48","2012-02-14 04:05:11",""
"1002492","1","1002964","","2009-06-16 16:08:24","1","7887","<p>I am quite new to Android and Java. Before I was working with C++ where the events where dispatched with messages. Now I would like to create the same user experience for Android platform and I would appreciate any of your suggestions or comments on what is the best way to bind events to user controls.</p><p>Here is an example from C++:</p><pre><code>ON_MESSAGE(WM_RECORD_START, &amp;CMainFrame::OnRecordStart)//Method OnRecordStarts() executes on WM_RECORD_START_MESSAGE</code></pre><p>...</p><pre><code>LRESULT CMainFrame::OnRecordStart(WPARAM wParam, LPARAM lParam){        m_pNetworkCtrl-&gt;SetGeoLocationInfo();        ...}</code></pre><p>...</p><pre><code>void CMainFrame::RecordStart(){    PostMessage(WM_RECORD_START);}</code></pre><p>In the case above the method RecordStart() is bound to a button (it is executed when a button is pressed) and posts the message WM_RECORD_START. When the message WM_RECORD_START is received, the method OnRecordStart() is executed.</p><p>As mentioned before I would like to create a responsive user interface and am not sure if it would be good enough if the method OnRecordStart() is called directly from RecordStart():</p><pre><code>void RecordStart(){OnRecordStart();}</code></pre><p>I would really appreciate any of your suggestions.</p><p>Thanks!</p>","22996","","","","","2013-11-07 12:06:29","Android: Best practice for responsive user interfaces","<java><android><messages>","4","0","6","",""
"1002884","1","","","2009-06-16 17:28:52","0","848","<p>I have a Cursor points to a Contact. How can I get an url built from that Cursor?</p><p>I need to know that because from here<a href=""http://developer.android.com/guide/topics/providers/content-providers.html"" rel=""nofollow"">http://developer.android.com/guide/topics/providers/content-providers.html</a></p><p>I need to have an url so that I can build a phone uri, like this:</p><p>phoneUri = Uri.withAppendedPath(uri, People.Phones.CONTENT_DIRECTORY);</p><p>and I can query all the phone numbers for that contact.</p>","89599","","","","","2011-01-14 21:22:31","How can I get an URL from a cursor object","<android>","1","0","0","",""
"1004611","1","","","2009-06-17 00:59:32","0","1826","<p>I've been racking my brain about this for a while, I've managed to send a post request to a https based login form using the android sdk, specifically the org.apache.http library. All seems well in that the response i get back from the server is 200 OK. </p><p>However, I can't figure out how to then scrape the page behind the login. The apache library seems geared towards server requests/repsonses so the question is how can i get the actual html page back using the android sdk?</p><p>Example code would be much appreciated.</p>","","vasdee","","","","2009-10-25 13:00:01","android web scraping behind a secure login","<java><android>","1","1","1","",""
"1007507","1","1007863","","2009-06-17 14:45:22","3","14166","<p>I would like to create a button with circular or rectangular background, text and an image below or above the text.</p><p>Here is the CustomButton Layout where I added the objects (background and text - ImageView is missing):</p><pre><code>&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_height=""wrap_content"" android:orientation=""horizontal"" android:layout_width=""wrap_content"" android:layout_gravity=""center_vertical|center_horizontal""&gt;</code></pre><p></p><p>I would like to create a CustomButton object with methods setText() and setImage() which would change the button text and image and place multiple CustomButtons into main layout.</p><p>Does anyone know how to create a custom layout, place it into another layout(main) and modify its elements from the activity which is bound to main layout?</p><p>I would really appreciate your help.</p><p>Thanks!</p>","22996","","","","","2012-01-18 15:11:26","Android: How to Create a Custom button widget","<android><widget>","3","1","2","",""
"1007598","1","","","2009-06-17 15:00:05","1","824","<p>I am trying to use the following intent action, but i get an<code>ActivityNotFoundException</code> in the first case (<code>startActivity</code>) and nothing in the second case (<code>sendBroadcast</code>).</p><pre><code>""com.android.launcher.action.UNINSTALL_SHORTCUT""</code></pre><p>I try to use it with the following code:</p><pre><code>Intent i = new Intent(""com.android.launcher.action.UNINSTALL_SHORTCUT"");startActivity(i);</code></pre><p>Also with the following:</p><pre><code>Intent i = new Intent(""com.android.launcher.action.UNINSTALL_SHORTCUT"");sendBroadcast(i); </code></pre>","7363","","1331488","","2013-03-24 18:51:03","2013-03-24 18:51:03","Using ""UNINSTALL_SHORTCUT"" Intent in Android","<java><android>","0","3","","",""
"1007695","1","","","2009-06-17 15:16:23","21","30107","<p>I am writing an application to play youtube videos using streaming.</p><p>First method:</p><p>I am getting the RTSP URL to the video using GData APIs.Here is the code to play the RTSP url.</p><pre><code>   VideoView mVideoView = new VideoView(this);   setContentView(mVideoView);   mVideoView.setVideoURI(Uri.parse(""rtsp://rtsp2.youtube.com/CiILENy73wIaGQkDwpjrUxOWQBMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp""));   mVideoView.start();</code></pre><p>But it throws error on both G1 device and emulator (Emulator has somefirewall problem as per mailing list)Here is the error message</p><p>ERROR/PlayerDriver(35): Command PLAYER_INIT completed with an error orinfo PVMFFailure</p><p>Second method:</p><p>A hack way to get the path of 3gp file from<a href=""http://www.youtube.com/get_video?v="">http://www.youtube.com/get_video?v=</a>&amp;t=&lt;>&amp;&lt;>..After getting the file path and I can call setVideoURI and it playsfine. But it is a hack way to achieve the requirement.I have checked the Youtube App also, it also does the hack way to playthe youtube url.(Checked with logcat)</p><p>I have tried changing from VideoView to MediaPlayer but no change in the error.</p><p>Is there a ""Clean"" way to do this?</p><p>Please let me know your thoughts.</p>","28641","","56285","","2014-01-27 22:19:36","2014-04-17 05:42:45","Streaming Youtube Videos","<android><youtube><streaming><android-mediaplayer><videoview>","6","4","12","",""
"1008703","1","","","2009-06-17 18:11:28","2","3170","<p>I've got an <code>Activity</code> that displays 5<code>GridViews</code>. Each of these <code>GridViews</code> is divided by a <code>TextView</code> with a background that spans the width of the screen. The <code>GridViews</code> represent a volume of books, and each item in the grid is a <code>Button</code> representing a book in a volume.</p><p>All the <code>GridViews</code> and <code>TextViews</code> sit inside a <code>RelativeLayout</code>. Some Volumes have many books and others just a few, so I've been trying to get the individual grid views to <code>wrap_content</code> and take up all the space they need to show all of their books, but no luck. The <code>View</code> equally divides space to each of the <code>GridViews</code>, hiding most of the books. I have my xml layout below. Can anyone tell me how I can get this done? </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    xmlns:as=""http://schemas.android.com/apk/res/edu.byu.scriptures""      android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;RelativeLayout android:id=""@+id/gridNavBar""        android:layout_height=""44px""        android:layout_width=""fill_parent""        android:background=""@drawable/bgnd_1_44""        android:paddingBottom=""0px""&gt;        &lt;Button            android:id=""@+id/homeButton""            android:layout_height=""wrap_content""            android:layout_width=""wrap_content""            android:layout_alignParentLeft=""true""            android:layout_centerVertical=""true""            android:layout_marginLeft=""5px""            android:text=""Home""                android:textSize=""14sp""                android:textColor=""#fff""                android:shadowColor=""#444""                android:shadowRadius=""1""                android:shadowDx=""1""                android:shadowDy=""-1""                android:background=""@drawable/generic_button_xml""/&gt;    &lt;TextView android:id=""@+id/bookRef""        android:text=""Books""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_centerHorizontal=""true""        android:layout_centerVertical=""true""        android:textColor=""#fff""        android:textSize=""18sp""        android:textStyle=""bold""        android:shadowColor=""#444""        android:shadowRadius=""1""        android:shadowDx=""1""        android:shadowDy=""-1""        /&gt;&lt;/RelativeLayout&gt;&lt;ScrollView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_below=""@id/gridNavBar""&gt;    &lt;RelativeLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;               &lt;TextView                android:gravity=""top""                android:id=""@+id/vol1DividerBar""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:text=""Volume 1""                android:textColor=""#000""                android:background=""@drawable/volume_divider""                android:layout_centerHorizontal=""true""                android:layout_alignParentTop=""true""/&gt;            &lt;GridView                 android:layout_weight=""1""                android:id=""@+id/vol1Grid""                android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                android:numColumns=""auto_fit""                android:verticalSpacing=""0dp""                android:horizontalSpacing=""0dp""                android:layout_below=""@id/vol1DividerBar""/&gt;            &lt;TextView                android:layout_weight=""1""                android:id=""@+id/vol2DividerBar""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:text=""Volume 2""                android:textColor=""#000""                android:background=""@drawable/volume_divider""                android:layout_below=""@id/vol1Grid""/&gt;            &lt;GridView                android:layout_weight=""1""                android:id=""@+id/vol2Grid""                android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:numColumns=""auto_fit""                android:verticalSpacing=""0dp""                android:horizontalSpacing=""0dp""                android:layout_below=""@id/vol2DividerBar""/&gt;            &lt;TextView                android:layout_weight=""1""                android:id=""@+id/vol3DividerBar""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:text=""Volume 3""                android:textColor=""#000""                android:background=""@drawable/volume_divider""                android:layout_below=""@id/vol2Grid""/&gt;            &lt;GridView                android:layout_weight=""1""                 android:id=""@+id/vol3Grid""                android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:numColumns=""auto_fit""                android:verticalSpacing=""0dp""                android:horizontalSpacing=""0dp""                android:layout_below=""@id/vol3DividerBar""/&gt;            &lt;TextView                android:layout_weight=""1""                android:id=""@+id/vol4DividerBar""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:text=""The Doctrine and Covenants""                android:textColor=""#000""                android:background=""@drawable/volume_divider""                android:layout_below=""@id/vol3Grid""/&gt;            &lt;GridView                android:layout_weight=""1""                android:id=""@+id/vol4Grid""                android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:numColumns=""auto_fit""                android:verticalSpacing=""0dp""                android:horizontalSpacing=""0dp""                android:layout_below=""@id/vol4DividerBar""/&gt;            &lt;TextView                android:layout_weight=""1""                android:id=""@+id/vol5DividerBar""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:text=""The Pearl of Great Price""                android:textColor=""#000""                android:background=""@drawable/volume_divider""                android:layout_below=""@id/vol4Grid""/&gt;            &lt;GridView                android:layout_weight=""1""                android:id=""@+id/vol5Grid""                android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:numColumns=""auto_fit""                android:verticalSpacing=""0dp""                android:horizontalSpacing=""0dp""                android:layout_below=""@id/vol5DividerBar""/&gt;        &lt;/RelativeLayout&gt;&lt;/ScrollView&gt;&lt;/RelativeLayout&gt;</code></pre>","","Dustin Graham","493939","Dustin Graham","2012-05-06 06:44:00","2013-04-24 15:26:07","Multiple android GridViews won't wrap_content","<android><android-layout><android-gridview>","2","0","2","",""
"1009970","1","1699523","","2009-06-17 23:09:04","40","47696","<p>I'm getting this error when trying to run unit tests from Eclipse with an Android Project. The list of Instrumentation Test Runners is empty in the Android preferences.</p><blockquote>  <p>[2009-06-17 23:57:51 - MyApp] ERROR:  Application does not specify a  android.test.InstrumentationTestRunner  instrumentation or does not declare  uses-library android.test.runner</p></blockquote><p>Google-fu failing me.</p><p>It's also annoyingly decided that because I tried to run a unit test once, that's what I always want to do... Grr</p>","4950","","","","","2014-03-28 22:08:30","Android Eclipse Plugin: Instrumentation Test Runner not specified","<android><eclipse><unit-testing><junit>","7","0","8","",""
"1011111","1","1018178","","2009-06-18 06:39:42","4","1725","<p>I would like to perform a certain operation every time a user adds a new contact in the Android Contacts application. It would include using the new contact's information.</p><p>Is there an easy way to do this? Is there some event that can be listened for or do I have to extend the Contacts application itself? Or should I just think of some other approach if this is not feasible.</p>","90563","","967945","","2013-01-15 15:17:34","2013-01-15 15:17:34","Reacting to new contacts in Android Contacts application","<android><android-contacts>","1","0","3","",""
"1011237","1","","","2009-06-18 07:21:33","8","12955","<p>Hai any one please tell me is there any possibility to create a DataGrid in android ,if yes mean please help me with some code snippets,or give some related web urls.</p>","111436","","","","","2012-02-25 12:05:31","How to create a DataGrid display in android?","<android>","1","2","7","",""
"1013157","1","1013843","","2009-06-18 14:56:30","1","554","<p>I would like to create a user interface which would contain network indication icons (3G, WiFi...) and I would like to use existing graphic elements which are displayed in notification bar.</p><p>Does anyone know how to get these existing elements and use it in custom layout?</p><p>I guess these icons are all ImageView elements and I am wondering whether it is possible to retrieve them with <code>findViewById()</code> method.</p>","22996","","1777090","","2013-01-17 05:28:44","2013-01-17 05:28:44","Android: How to use existing graphic elements","<android><uiimageview><reusability>","2","0","","",""
"1013469","1","1013898","","2009-06-18 15:44:41","16","9167","<p>Which you think is the best way of doing a wizard like application (user can navigate between screens with a next and back button, and each screen has to save some state data) in Android platform.</p><p>I mainly can think in two approaches:</p><ol><li><p>Having one activity+view for each screen and then i make the screen switch by calling each activity. What make this nice is that i can use the system back button as my back handler and i don't have to take care of that myself, aslo each activity will save it's own state.</p></li><li><p>Having one activity and many views, and what i switch views in each screen change, this helps me re-use more code, but makes saving states a mess.</p></li></ol><p>What do you think? Which is the best way of doing this on Android?</p>","7363","","172525","","2013-03-05 11:00:53","2014-01-03 06:54:57","Make a wizard like application in Android","<android><user-interface><wizard><user-experience>","4","0","4","",""
"1013765","1","1014857","","2009-06-18 16:35:28","6","24296","<p>How do I create categories in an arbitrary ListView like those in Preferences (PreferenceCategory)?</p><p>I've found <code>android.R.layout.preference_category</code> that renders that grey TextView but don't see it mentioned anywhere from java code.</p>","15187","","","","","2012-09-24 11:33:27","Creating categories in a ListView?","<android><listview><category>","1","0","3","",""
"1015082","1","3141728","","2009-06-18 20:42:14","4","2768","<p>I'm animating a an ImageView from the left to the right of the screen using a translate animation.  The ImageView is place inside a RelativeLayout over the top of my main layout using FrameLayout.</p><p>When I run the animation on the emulator everything works pretty well but when I use run it on my G1 it leaves visual artifacts behind and effects the rendering of the text component behind it.</p><p>Is this a performance issue and I'm being too ambitious or is it a bug I can overcome?</p><p>If it is a performance issue is there anything I can do to improve things?</p>","5303","","225647","","2012-10-29 20:40:47","2013-03-18 00:13:31","Why is my animation leaving a trail?","<android><gui><animation>","8","3","7","",""
"1016497","1","1016802","","2009-06-19 05:44:27","0","3409","<p>On iPhone, an application can associate a new protocol name to itself so that if a user types in 'myapp://xxx' in a web browser it calls the application.</p><p>Is this possible with BlackBerry or Android?</p>","125341","","75204","","2012-04-08 06:56:50","2012-04-08 06:56:50","On blackberry and android : calling native application from a web browser?","<android><browser><blackberry><native>","3","1","","",""
"1016584","1","1030814","","2009-06-19 06:23:01","1","6560","<p>I'm new to Android dev.</p><p>There's a very pretty state diagram of the <a href=""http://developer.android.com/reference/android/media/MediaPlayer.html"" rel=""nofollow"">MediaPlayer</a>, but I can't for the life of me figure out how to actually use this class to play a video. </p><p>There's a view samples around the 'net, but they seem to be for previous versions of the SDK.I've also checked the <a href=""http://developer.android.com/guide/samples/index.html"" rel=""nofollow"">official samples</a>, but with no luck.</p>","94239","","1228","","2013-08-19 15:43:26","2013-08-19 15:43:26","Is there a working sample for the Android 1.5 VideoView/MediaPlayer class?","<java><android><android-widget><media>","1","0","","",""
"1016896","1","1016941","","2009-06-19 08:25:57","652","455805","<p>I created some custom elements, and I want to programmatically place them to the upper right corner (<code>n</code> pixels from the top edge and <code>m</code> pixels from the right edge). Therefore I need to get the screen width and screen height and then set position:</p><pre><code>int px = screenWidth - m;int py = screenHeight - n;</code></pre><p>How do I get screenWidth and screenHeight in the main Activity?</p>","22996","","3130569","","2014-04-14 19:45:20","2014-04-14 19:45:20","How to get screen dimensions","<android><android-layout><layout><screen><android-screen>","29","0","263","",""
"1017853","1","1018105","","2009-06-19 13:00:38","12","39622","<p>I have created a class RoundIcon which extends View and the class contains setIconImage() method:</p><pre><code>public void setIconImage(int imageFromResources) {    iconImage = BitmapFactory.decodeResource(getResources(), imageFromResources);    iconWidth = iconImage.getWidth();    iconHeight = iconImage.getHeight();    refreshDrawableState();}</code></pre><p>and there is a method onDraw():</p><pre><code>@Overrideprotected void onDraw(Canvas canvas) {    if(px == 0 || py == 0)    {        px = 50;        py = 50;    }    canvas.drawCircle(px, py, circleRadius, circlePaint);    canvas.save();    if(iconImage != null)    {        int cardinalX = px - iconWidth/2;        int cardinalY = py - iconHeight/2;        canvas.drawBitmap(iconImage, cardinalX, cardinalY, iconPaint);    }    canvas.restore();}</code></pre><p>The problem is that the function onDraw() doesn't execute each time the method setIconImage() is called from main activity and therefore the icon doesn't change in the user interface.</p><p>Does anyone know how to modify the code in order to redraw an image every time the method setIconImage is called?</p>","22996","","1777090","","2013-01-17 05:28:25","2013-02-04 17:59:55","Android: How to redraw a graphic element?","<android><user-interface><refresh>","2","0","3","",""
"1018392","1","1018606","","2009-06-19 14:50:07","5","821","<p>From the O'Reilly book ""Android Application Development "" by Rick Rogers, John Lombardo, Zigurd Mednieks &amp; Blake Meike, page 23:</p><pre><code> &lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""@string/hello""    /&gt;</code></pre><p>From page 44:</p><pre><code> &lt;application android:icon=""@drawable/icon2""&gt;</code></pre><p>What is the meaning of the <code>@</code> in each of the above fragments?</p>","101954","","2231440","","2013-12-31 09:07:12","2013-12-31 09:07:12","@ in AndroidManifest.xml file","<android><xml>","3","0","0","",""
"1020564","1","","","2009-06-20 00:12:09","3","1781","<p>From the O'Reilly book ""Android Application Development "" by Rick Rogers, John Lombardo, Zigurd Mednieks &amp; Blake Meike, page 44:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""com.microjobsinc.mjandroid"" android:versionCode=""1""    android:versionName=""1.0""&gt;</code></pre><p>The XML code above has the <code>package</code> attribute. However, in the rest of the XML, the remaining attributes all have a namespace.</p><p>Why do all of the attributes have a namespace except <code>package</code>?</p>","101954","","2231440","","2013-12-31 09:05:57","2013-12-31 09:10:32","AndroidManifest.xml <manifest> package attribute has no namespace","<android><xml>","1","1","","",""
"1020758","1","","","2009-06-20 02:13:26","2","1726","<p><a href=""http://developer.android.com/guide/publishing/versioning.html#appversion"" rel=""nofollow"">Versioning Your Applications</a> on the Adroid developers web site:</p><blockquote>  <p>you would release the first version of  your application with versionCode set  to 1, then monotonically increase the  value with each release, regardless  whether the release constitutes a  major or minor release.</p></blockquote><p>That is all nice and well but how is one to handle this sequence?:</p><pre>1 1.02 1.13 1.24 1.35 1.46 2.0? 1.5</pre>","101954","","","","","2009-06-20 20:58:25","AndroidManifest.xml file <manifest> versionCode attribute","<xml><android><versioning>","2","0","","",""
"1021167","1","1056668","","2009-06-20 07:40:11","7","30026","<p>I want to refresh a listview. When I am getting a value from different class I want it to update that to list view. I am creating a thread for refreshing the list but I am getting an exception:</p><p><code>Only the original thread that created a thread a view hierarchy can touch its views</code></p><p>How to proceed?</p>","95877","","1777090","","2013-01-17 05:23:56","2013-01-17 05:23:56","Refresh a view Android","<java><android>","2","0","1","",""
"1022125","1","1022152","","2009-06-20 17:57:59","1","1333","<p>On Android mobiles, does anyone has checked that if a user clicks on a link<code>&lt;a href='wtai://wp/mc;5551231367' title='Call'&gt;555.123.1367&lt;/a&gt;</code>this would propose the user to make a call to this phone number ?</p><p>If not, do you know how is it possible to do it ?</p>","125341","","","","","2009-06-20 18:10:00","On Android : making a phonecall using a browser application","<android><phonecalls>","1","0","0","",""
"1023209","1","1023795","","2009-06-21 04:35:01","1","608","<p>How can I copy a CharArrayBuffer to another CharArrayBuffer at a specified index in Java on android?</p><p>developer.android.com/reference/android/…  </p><pre><code>CharArrayBuffer stringBuffer1 = new CharArrayBuffer(128); System.arraycopy(""Phone"", 0, stringBuffer1.data, 0, ""Phone"".length());</code></pre><p>But i get an ArrayStoreException. I have allocated the CharArrayBuffer to be 128. I don't understand this exception</p>","125440","","2961","","2009-06-21 05:59:35","2009-06-21 12:30:39","Copy a CharArrayBuffer to another CharArrayBuffer","<java><android>","2","5","","",""
"1023502","1","1024383","","2009-06-21 09:17:17","12","7459","<p>I am currently writing a paper on the Android platform. After some <a href=""http://code.google.com/p/android-benchmarks/"" rel=""nofollow"">research</a>, it's clear that Dalvik has room for improvement. I was wondering, what do you think would be the best use of a developer's time with this goal?</p><p>JIT compilation seems like the big one, but then i've also heard this would be of limited use on such a low resource machine. Does anyone have a resource or data that backs this up?</p><p>Are there any other options that should be considered? Aside from developing a robust native development kit to bypass the VM. </p><p>For those who are interested, there is a lecture that has been recorded and put online regarding the <a href=""http://sites.google.com/site/io/dalvik-vm-internals"" rel=""nofollow"">Dalvik VM</a>.</p><p>Any thoughts welcome, as this question <em>appears subjective</em> i'll clarify that the answer I'll accept must have some justification for proposed changes. Any data to back it up, such as the improvement in the Sun JVM when it was introduced, would be a massive plus.</p>","111734","","1777090","","2013-01-17 05:26:54","2013-01-17 05:26:54","How would you improve Dalvik? Android's Virtual Machine","<android><jit><virtual-machine><dalvik>","3","3","4","",""
"1024803","1","1024962","","2009-06-21 21:28:55","2","12648","<p>I have an application which I would like to be fully disabled/closed when it is paused (IE. When the user presses the Home, End (call) and Back button I would like the application to be closed, instead of being saved in the history stack).</p><p>How do I do this....?</p><p>Thanks.</p>","122547","","","","","2011-01-31 21:01:03","Killing android application on pause","<android><android-1.5-cupcake>","3","0","3","",""
"1025114","1","7434252","","2009-06-22 00:21:26","2","353","<p>Is it possible for me to dynamically switch the adapter of a Gallery?</p><p>In the <code>onCreate()</code> of my activity, I did this:</p><pre><code>myGallery.setAdapter(adapter1);</code></pre><p>And then later on in my code, I did</p><pre><code>myGallery.setAdapter(anotherAdapter1);</code></pre><p>I tried, that but in the emulator, the myGallery never gets update when I do 'setAdapter' again.How can I force myGallery free up all the items when it was using adapter1 and then makes it repopulate items for anotherAdapter1?</p><p>Thank you.</p>","125440","","2559445","","2013-07-08 06:05:10","2013-07-08 06:05:10","How can I switch adapter for a Gallery","<android><android-adapter>","1","0","1","",""
"1026285","1","1034036","","2009-06-22 09:33:43","0","1350","<p>I am rewriting the existing C++ application and adapting it for Android environment.</p><p>In the code there is a PostMessage statement:</p><pre><code>PostMessage( bExitApp ? WM_CLOSE : WM_LOGIN, wParam, lParam );</code></pre><p>Does anyone know what is the most appropriate way to achieve tha same result in Android (Java)?</p><p>Is it well enough to create two methods like OnLogin() and OnClose() the following way:</p><pre><code>private void OnLogin(long arg0, long arg1){//some logic here}private void OnClose(long arg0, long arg1){//some logic here}</code></pre><p>and then write</p><pre><code>if(bExitApp)(OnLogin(arg0, arg1))else{OnClose(arg0, arg1)}</code></pre><p>?</p>","22996","","1777090","","2013-01-17 05:27:19","2013-01-17 05:27:19","PostMessage() alternative in Java(Android)","<java><android><postmessage>","1","1","","",""
"1026973","1","1027438","","2009-06-22 12:38:14","205","56581","<p>In various bits of Android code I've seen:</p><pre><code> public class MyActivity extends Activity {    public void method() {       mContext = this;    // since Activity extends Context       mContext = getApplicationContext();       mContext = getBaseContext();    } }</code></pre><p>However I can't find any decent explanation of which is preferable, and under what circumstances which should be used.</p><p>Pointers to documentation on this, and guidance about what might break if the wrong one is chosen, would be much appreciated.</p>","6782","","267542","","2010-03-04 17:31:18","2014-03-20 03:28:07","Android - what's the difference between the various methods to get a Context?","<android><android-context>","7","1","118","",""
"1027149","1","","","2009-06-22 13:14:01","8","20914","<p>I need a popup dialog to be shown when i get a message from different thread but the dialog should be not dependent on Activity i.e, it should display the dialog wherever the screen focus is. </p><p>Can it be done? Because the dialog is handled per Activity, I thought of using a service but again it would be one more thread added and I want to avoid that. </p><p>Any other options available?</p>","95877","","114066","","2011-01-24 10:21:35","2013-08-23 10:03:31","PopUp dialog Android from background thread","<java><android><service><dialog>","4","2","2","",""
"1027226","1","4239256","","2009-06-22 13:29:15","0","2362","<p>I created a custom View Round button which consists of an image and some text. I tried to bind a method to it but it doesn't work and don't know what could be the reason.</p><p>In the main.xml (layout file) i set the parameter clickable to true and in the onCreate method in the main activity i added the following lines:</p><pre><code>rbActionButton = (RoundButton)findViewById(R.id.actionButton);	rbActionButton.setOnClickListener(new OnClickListener(){		public void onClick(View view){			onActionButton();		}	});</code></pre><p>Does anyone know whether there's anything missing or the reason it doesn't work?</p><p>Thanks!</p>","22996","","","","","2010-11-21 17:44:29","setting the key listener to a custom View","<android><custom-view>","1","1","","",""
"1028139","1","1028161","","2009-06-22 16:24:33","1","1892","<p>I trying to parse a data in a MySql Format, I ran accross SimpleDateFormat. I can get the proper day and month, but I got a strange result for the year :</p><pre><code>date = 2009-06-22;SimpleDateFormat sdf = new SimpleDateFormat(""yyyy-MM-dd""); Date d = sdf.parse(date);System.println(date);System.println(d.getDate());System.println(d.getMonth());System.println(d.getYear());</code></pre><p>Outputs :</p><pre><code>2009-06-2222           OK5            Hum... Ok, months go from 0 to 11109          o_O WTF ?</code></pre><p>I tried changing the format to ""YYYY-MM-dd"" (got an error) and ""yy-MM-dd"" (did nothing). I am programming on Android, don't know if it's important.</p><p>For now, I bypass that using a split, but it's dirty and prevent me from using i18n features.</p>","9951","","9951","","2009-06-22 16:36:48","2009-06-22 16:36:48","Why don't I get the year right using SimpleDateFormat in java?","<java><android><date-parsing>","2","0","","",""
"1029117","1","1029766","","2009-06-22 19:58:21","0","299","<p>I was wondering if someone could provide me with a bit of theory. I read that;</p><blockquote>  <p>Page alignment causes changes in  linking. Of very high impact on the  success of compiling software for  Android is the fact that Google forces  compatible binaries to not be page  aligned for the text and data section.  This requires changes in the way of  linking object files. For self-written  software, one can take precautions and  react on this fact with compiling all  shared libraries accordingly. For  already existing source code, changing  the linker’s behavior can present a  very tiring and, often, an even  impossible task.</p></blockquote><p>But personally know very little of page alignment, what does this actually mean? Is this the reason we must change the asx file when compiling native libraries for use on Android? <a href=""http://honeypod.blogspot.com/2007/12/shared-library-hello-world-for-android.html"" rel=""nofollow"">Here's the context for that statement.</a></p><p>Apologies if you think I should just Google this, I did try but I'm just looking for a bit more of an explanation than there is at that link.</p><p>Kind regards,</p><p>Gavin</p>","111734","","","","","2010-11-05 18:54:50","Why does Android page alignment cause issues with linking? (Android running native code)","<android><linker><native>","1","0","","",""
"1032258","1","","","2009-06-23 12:31:05","3","7966","<p>I would like to save a preview frame as a jpeg image.</p><p>I have tried to write the following code:</p><pre><code>public void onPreviewFrame(byte[] _data, Camera _camera){    if(settings.isRecording())    {        Camera.Parameters params = _camera.getParameters();        params.setPictureFormat(PixelFormat.JPEG);        _camera.setParameters(params);        String path = ""ImageDir"" + frameCount;        fileRW.setPath(path);        fileRW.WriteToFile(_data);        frameCount++;    }}</code></pre><p>but it's not possible to open a saved file as a jpeg image. Does anyone know how to save preview frames as jpeg images?</p><p>Thanks</p>","22996","","1610216","","2012-09-11 10:53:30","2012-12-11 17:29:46","Android: How to save a preview frame as jpeg image?","<android><camera>","5","0","1","",""
"1032912","1","","","2009-06-23 14:28:55","19","36650","<p>I would like to create a video recorder and so far haven't figured out how to set parameters in order to successfully go through MediaRecorder.prepare() method.</p><p>Executing the following method</p><pre><code>public void start() throws IOException{	String state = android.os.Environment.getExternalStorageState();	if(!state.equals(Environment.MEDIA_MOUNTED))	{		throw new IOException(""SD card is not mounted. It is "" + state + ""."");	}	File directory = new File(path).getParentFile();	if(!directory.exists() &amp;&amp; !directory.mkdirs())	{		throw new IOException(""Path to file could not be created."");	}	recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);	recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);	recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);	recorder.setVideoFrameRate(15);	recorder.setVideoSize(176, 144);	recorder.setOutputFile(path);	recorder.prepare();	recorder.start();	this.state = VideoRecorderState.STATE_RECORDING;}</code></pre><p>it throws an exception on line <code>recorder.prepare().</code></p><p>Does anyone know how to set parameters in order to be able to capture video?</p><p>Thanks!</p>","22996","","","","","2012-04-28 12:07:59","Android: Does anyone know how to capture video?","<android><video-capture>","7","2","17","",""
"1034253","1","1035434","","2009-06-23 18:19:20","19","19863","<p>I've looked around for a physics engine that will play nicely with Android, but I've only been disappointed.</p><p>In terms of performance, I had heard that jbox2d was the best bet, but (from my understanding) ever since Android SDK V1.0, the Dalvik VM's verifier has become very strict and rejects some of the key classes and refuses to run. This problem persists after using the dx tool (although I might be using the tool improperly).</p><p>I know that the AndroidBox2D porting project exists to optimize jbox2d for the Android garbage collector, but the project page doesn't have any downloads and the gpl license isn't as attractive as the zlib license of the original.</p><p>Does anyone have any tips for making jbox2d work in Eclipse, or have any recommendations for where I should start looking?</p>","86348","","321731","","2013-09-28 19:23:10","2013-09-28 19:23:10","Are there any decent physics engines for Android?","<android><physics-engine>","6","2","15","",""
"1041644","1","","","2009-06-25 00:38:07","3","8134","<p>My plan is to prepopulate a database on a virtual device and then include database in the distribution of my app.</p><p>However, I can't find the database file.</p><p>Is it on my hard disk some where?How do I get it?</p><p>I tried connecting using adb, I did an ""ls"" and then got really scared by this obscure list of directories:</p><p>sqlite_stmt_journalscachesdcardetcsystemsyssbinprocinit.rcinit.goldfish.rcinitdefault.propdatarootdev</p><p><hr /></p><p>Even when I cd over to /data/data/your.package.here/databases I still do not have access to the actual database file. I can't use sqlite3 or do a pull on it. Is there a way to change permissions?</p><p>This works fine on my emulator, but fails on the actual deviceadb pull /data/data//databases/mydb.db .</p>","108495","","108495","","2009-06-25 11:21:58","2009-06-26 04:18:22","How do I find the database file on an Android virtual device?","<database><android>","3","0","","",""
"1042201","1","","","2009-06-25 04:33:31","1","2387","<p>Hai to All        Anybody know about the camera Api in android.when i used this Api it displayed a black and white grids and a squre moving above it.Anyone know how to get a real time camera preview please help me with some code.</p>","111436","","","","","2011-12-27 06:25:24","How to get a Camera Preview in android?","<android>","3","1","1","",""
"1043257","1","1043352","","2009-06-25 10:53:36","5","7667","<p>I'm trying to install a prebuilt binary in a custom Android image. For that I have copied it to a new directory in <code>prebuilt/android-arm/</code> with an <code>Android.mk</code> file similar to this one:</p><pre><code>LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_SRC_FILES := binary_nameLOCAL_MODULE := binary_nameLOCAL_MODULE_CLASS := EXECUTABLESinclude $(BUILD_PREBUILT)</code></pre><p>So if I run <code>make system_image binary_name</code>, the binary file is copied to <code>/bin/</code> in system image. And if I run the emulator I can see the binary file in <code>/system/bin</code>. The permissions are the same as the other executables (<code>-rwxr-xr-x</code>) and, according to <code>file</code>, this is an ARM binary (<code>ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped</code>).</p><p>But when I run it on the emulator, it says:</p><pre><code># binary_namebinary_name: not found</code></pre><p>I have straced it and this is what I can see:</p><pre><code># strace binary_nameexecve(""/system/bin/binary_name"", [""binary_name""], [/* 9 vars */]) = -1 ENOENT (No such file or directory)write(2, ""strace: exec"", 12strace: exec)            = 12write(2, "": "", 2: )                       = 2write(2, ""No such file or directory"", 25No such file or directory) = 25write(2, ""\n"", 1)                       = 1io_submit(1, -1344063348, {...} &lt;unfinished ... exit status 1&gt;</code></pre><p>But the file is there, and strace is able to find it.</p><p>Any idea of what can be happening?</p><p><strong>UPDATE</strong>: As Kristof says, this is probably a problem of dynamic linking, but I don't have ldd for Android ARM...</p>","28855","","28855","","2009-06-25 11:19:08","2009-06-25 11:19:08","Installing a prebuilt binary on Android: ""not found""","<android><linux><arm><emulator><libc>","1","0","2","",""
"1043322","1","1043722","","2009-06-25 11:04:43","64","95965","<p>I connected to my live device using the adb and the following commands:</p><pre><code>C:\&gt;adb -s HT829GZ52000 shell$ lslssqlite_stmt_journalscachesdcardetcsystemsyssbinproclogo.rleinit.trout.rcinit.rcinit.goldfish.rcinitdefault.propdatarootdev$ cd datacd data$ lslsopendir failed, Permission denied</code></pre><p>I was surprised to see that I have access denied. How come I can't browse around the directories using the commandline like this?</p><p>How do I get root access on my phone?</p>","108495","","283844","","2011-04-21 16:51:38","2014-03-22 03:06:23","Why do I get access denied to data folder when using adb?","<android><adb>","11","2","35","",""
"1045275","1","1046290","","2009-06-25 17:45:29","1","2004","<p>Can someone please explain how to understand a logcat from an android force close.</p><p>This crash occurs when I called finish() in the onPause().</p><p>Here is the DDMS screenshot <a href=""http://www.2ql.net/uploads/1245827534.png"" rel=""nofollow"">http://www.2ql.net/uploads/1245827534.png</a></p><p>Thanks.</p>","122547","","","","","2009-06-25 21:10:39","Understanding a DDMS Log","<android>","1","0","1","",""
"1045909","1","","","2009-06-25 19:57:42","2","866","<p>I have this code:</p><pre><code> Intent intent = new Intent(); intent.setAction(Intent.ACTION_SEND); startActivity(intent);</code></pre><p>which successfully launches an Messaging App on android.</p><p>But how can i attach a Bitmap object when launching the intent?</p><p>I have read <a href=""http://developer.android.com/reference/android/content/Intent.html"" rel=""nofollow"">http://developer.android.com/reference/android/content/Intent.html</a>,the closet thing to what i need is EXTRA_STREAM, like this:intent2.putExtra(Intent.EXTRA_STREAM, _uri);</p><p>but my case, I have a reference of Bitmap object, not an URI of anBitmap.</p><p>Please tell me what can I do to attach a Bitmap object?</p><p>Thank you.</p>","128983","","1252063","","2012-10-04 07:26:30","2012-10-04 07:40:03","How to start activity with a bitmap attached?","<android><bitmap>","3","1","0","",""
"1046256","1","1046749","","2009-06-25 21:03:33","9","15347","<p>I would like to create a custom control in my Android App. It will be a circular control with some smaller moveable circles that will indicate a specific value.</p><p>Is there a way to realize this? </p><p>Are there at least some nice tutorials where I can read how to create a custom control?</p>","88446","","72882","","2012-12-18 12:59:32","2012-12-18 12:59:32","How can I create custom controls in Android?","<android><controls>","1","0","1","",""
"1046815","1","1344950","","2009-06-26 00:19:54","0","1070","<p>From the JavaDoc, the EXTRA_STREAM parameter when launching an intent needs to be an URI. How can I pass a Bitmap object which I get from launching a ""android.provider.MediaStore.ACTION_IMAGE_CAPTURE"" intent?</p><pre><code>/**     * A content: URI holding a stream of data associated with the Intent,     * used with {@link #ACTION_SEND} to supply the data being sent.     */    public static final String EXTRA_STREAM = ""android.intent.extra.STREAM"";</code></pre>","128983","","1777090","","2013-01-17 06:29:59","2013-01-17 06:29:59","Passing in a Bitmap as the EXTRA_STREAM parameter when launching an Intent","<android><android-intent>","1","0","","",""
"1047342","1","","","2009-06-26 04:28:44","3","1500","<p>I want to run a query in SQLite with a regexp using Android.How do I do that?</p>","","Mitali","31615","","2009-06-26 13:13:45","2012-08-24 18:46:55","How to run a query with regexp in Android","<android><regex><sqlite>","2","0","","",""
"1047698","1","","","2009-06-26 06:50:51","1","3642","<p>I have to connect to a webserver from android and I have to access a webservice and a webpage from the webserver. Can anybody help me? Please give step by step process with some code snippets because I am new to android and I don't know anything in connecting to a webserver.</p>","111436","","1777090","","2013-01-21 06:47:33","2013-01-21 06:47:33","Regarding connecting to a webserver from android","<android>","2","0","5","",""
"1048310","1","","","2009-06-26 10:04:32","18","46533","<p>I need to call a web service with a URL something like: <code>""http://192.168.1.19/TestWeb/WebService.asmx""</code> from android.</p><p>Please anyone help me with a full example?</p>","111436","","1069068","","2013-03-19 14:41:30","2013-03-19 14:41:30","How to call a .NET web service from android?","<.net><android><web-services>","1","7","13","2012-07-25 08:53:49",""
"1048739","1","","","2009-06-26 11:58:27","3","19589","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails"">Android Camera will not work. startPreview fails</a>  </p></blockquote><p>I am trying to set a camera preview in a custom SurfaceView but I get an exception each time I execute the initialization method.</p><p>Below is the code for camera preview initialization:</p><pre><code>private void init(Context context){    setFocusable(true);    mRecording = false;    fileRW = new FileReaderWriter();    frameCount = 0;    if(mCamera == null)    {        mCamera = Camera.open();    }    Parameters parameters = mCamera.getParameters();    parameters.setPictureFormat(PixelFormat.JPEG);    mCamera.setParameters(parameters);    try {        mCamera.setPreviewDisplay(surfaceHolder);    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    mCamera.startPreview();}</code></pre><p>the line <code>mCamera.setPreviewDisplay(surfaceHolder);</code> throws an exception (<code>setPreviewDisplay failed</code>) each time I try to execute the method.</p><p>Does anyone know what could be wrong? I would really appreciate any of your help.</p><p>Thanks!`</p>","22996","","54680","","2011-11-04 13:58:21","2011-11-04 13:58:21","Camera.setPreviewDisplay() throws Exception","<android><camera>","2","1","6","2011-11-04 13:59:53",""
"1049228","1","1049244","","2009-06-26 13:43:37","173","43244","<p>Programming in Android, most of the text values are expected in CharSequence.</p><p>Why is that ? What is the benefit and what are the main impacts of using CharSequence over String ?</p><p>What are the main differences, and what issues are expected, while using them, and converting from one to another ?</p>","9951","","10475","","2009-10-23 23:40:03","2012-04-05 14:35:46","CharSequence VS String in Java?","<java><android><string><charsequence>","4","0","32","",""
"1049918","1","1075010","","2009-06-26 15:57:15","3","2929","<p>I want to play the flv files in Android. So what I thought is to convert the flv file to mp4 or 3gp(for which there is a decoder in Android). OpenCore can be used to convert. I have looked into opencore code, there is a class in opencore ""/android/external/opencore/fileformats/mp4/composer"" to create the mp4 file. It has apis like </p><pre><code>AddTrack AddSampleToTrack</code></pre><p>I should give the input as frames, but in Flv I will get the Sorenson Video and Mp3 audio frame(after doing some trivial string operations to remove the headers). Can I use these directly as input to above apis or is there any good way to convert flv to mp4? And also I have looked into ""/android/external/opencore/nodes/pvmp4ffcomposernode"" but it reads from ports not able to know how to send input to this class.</p><p>Let me know your thoughts.</p>","28641","","","","","2012-09-18 10:40:12","Flv to mp4 conversion","<android><flv><mp4>","1","3","1","",""
"1050297","1","1645203","","2009-06-26 17:34:55","1","6171","<p>I launch an activity to capture a picture from camera:</p><pre><code>Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE, null);i.putExtra(""return-data"", true);startActivityForResult(i, PICK_FROM_CAMERA);</code></pre><p>Can you please tell me how to get the URI of the capture picture ?</p>","125440","","3330969","","2014-03-22 03:03:36","2014-03-22 03:03:36","How to get the URL of the captured image?","<java><android>","2","0","","",""
"1051330","1","2055640","","2009-06-26 21:20:37","1","2341","<p>I start an <code>IMAGE_CAPTURE</code> Intent like this, and my activity's <code>onActivityResult()</code> get called:</p><pre><code>Intent i = new Intent (android.provider.MediaStore.ACTION_IMAGE_CAPTURE, null);i.putExtra(""return-data"", true);startActivityForResult(i, PICK_ICON_FROM_CAMERA_ID);</code></pre><p>But, if I start my Intent like this, the Capture Image Intent did get called, but my activity's <code>onActivityResult()</code> never get called:</p><pre><code>Intent i = new Intent (android.provider.MediaStore.ACTION_IMAGE_CAPTURE, null);i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.parse(""file:/"" + ""MyTestFile""));i.putExtra(""outputFormat"",    Bitmap.CompressFormat.PNG.name());startActivityForResult(i, PICK_ICON_FROM_CAMERA_ID);</code></pre><p>Can you please tell me how to get the 2<sup>nd</sup> case to work ?</p>","128983","","3330969","","2014-03-22 03:02:58","2014-03-22 03:02:58","IMAGE_CAPTURE Intent never returns to onActivityResult(int, int, Intent);","<java><android>","1","0","1","",""
"1051649","1","1051827","","2009-06-26 23:01:34","22","41470","<p>I'm currently writing an app in Android that works with the GPS. At the moment I'm able to work out whether the GPS is enabled. My problem is that I want to enable the GPS on app startup if it is disabled. How can I do this programmaticaly?</p>","129688","","741249","","2012-05-02 11:41:20","2012-05-02 11:41:20","How to programmatically enable GPS in Android Cupcake","<java><android><gps><android-1.5-cupcake>","5","1","15","",""
"1052300","1","","","2009-06-27 07:23:05","31","101207","<p>I have a problem while calling a webservice. I have a .NET web service on the server, and I am using KSOAP2 (ksoap2-j2se-full-2.1.2) in Android. While running the program I got an runtime exception like ""org.ksoap2.serialization.SoapPrimitive"". What should I do?</p><p>Here is my code.</p><pre><code>package projects.ksoap2sample;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.SoapObject;import org.ksoap2.serialization.SoapSerializationEnvelope;import org.ksoap2.transport.HttpTransportSE;import android.app.*;import android.os.*;import android.widget.TextView;public class ksoap2sample extends Activity {    /** Called when the activity is first created. */    private static final String SOAP_ACTION = ""http://tempuri.org/HelloWorld"";    private static final String METHOD_NAME = ""HelloWorld"";    private static final String NAMESPACE = ""http://tempuri.org/"";    private static final String URL = ""http://192.168.1.19/TestWeb/WebService.asmx"";    TextView tv;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        tv=(TextView)findViewById(R.id.text1);        try {            SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);            //request.addProperty(""prop1"", ""myprop"");            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);            envelope.dotNet=true;            envelope.setOutputSoapObject(request);            HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);            androidHttpTransport.call(SOAP_ACTION, envelope);            Object result = (Object)envelope.getResponse();            String[] results = (String[])  result;            tv.setText( """"+results[0]);        }        catch (Exception e) {            tv.setText(e.getMessage());        }    }}</code></pre>","111436","","63550","","2011-08-18 21:36:37","2014-02-10 07:43:04","How to call a .NET Webservice from Android using KSOAP2?","<android><ksoap2><ksoap>","9","2","37","",""
"1053721","1","1103560","","2009-06-27 21:55:42","3","4742","<p>I can't get DDMS to load any KML files.</p><p>I have a KML file for example with the following in it:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;kml xmlns=""http://www.opengis.net/kml/2.2""&gt; &lt;Placemark&gt;   &lt;name&gt;Simple placemark&lt;/name&gt;   &lt;description&gt;Attached to the ground. Intelligently places itself      at the height of the underlying terrain.&lt;/description&gt;   &lt;Point&gt;     &lt;coordinates&gt;-122.0822035425683,37.42228990140251,0&lt;/coordinates&gt;   &lt;/Point&gt; &lt;/Placemark&gt;&lt;/kml&gt;</code></pre><p>The docs at <a href=""http://developer.android.com/guide/developing/tools/ddms.html"" rel=""nofollow"">http://developer.android.com/guide/developing/tools/ddms.html</a>seem to indicate that I only need to launch my app and fire up DDMSand load the KML.  That doesn't work.</p><p>I even tried the Google Earth solution suggested at the same link.</p><p>I'm using SDK 1.5_r2.  I am doing something wrong or missing something?</p>","52115","","","","","2011-11-24 18:03:05","DDMS won't load (or doesn't parse?) KML file","<android><kml><ddms>","4","0","3","",""
"1055188","1","1055566","","2009-06-28 16:22:01","26","17002","<p>I already found out that there is no way to bundle files in an .apk and have them on /sdcard, the best option so far being to download the large files upon first run. I came accross a tutorial saying how to bundle an sqlite db with the apk and then copy it so that it can be accessed with SQLiteDatabase (thus doubling the space needed, and not using /sdcard at all).</p><p><a href=""http://developer.android.com/guide/topics/data/data-storage.html#db"">http://developer.android.com/guide/topics/data/data-storage.html#db</a> says all databases MUST be in /data/data/package_name/databases. </p><p>Is that really so? Is there a way to trick the framework into opening a database that is placed on the /sdcard partition? Is there a way to use another SQLite java wrapper/framework to access such databases?</p><p>If the answer to the above is 'No', what other options do I have? My data is very well represented in a relational model, but is just too big, plus, I want to be able to update it without the need to reinstall/upgrade the entire app.</p>","125681","","","","","2014-03-22 03:00:32","Can I download an SQLite db on /sdcard and access it from my Android app?","<database><android><sqlite><download>","5","2","29","",""
"1056570","1","","","2009-06-29 04:36:16","15","35674","<p>I'm not sure how to autostart an android application after the android emulator completes its booting. Does anyone have any code snippets that will help me?</p>","111436","","16587","","2009-07-22 21:02:28","2014-03-22 02:58:22","How to Autostart an Android Application?","<android>","3","1","15","",""
"1057880","1","1058108","","2009-06-29 11:44:03","1","1525","<p>Hello I have an android application which has a service running. After 20 mins from that service and other systems (<code>such as GPS</code>) starting I would like it to automaticly stop. I assume I need to use a Timer for that?</p><p>Can someone show an example of how I could do it?</p>","122547","","750613","","2012-06-26 05:53:57","2012-06-26 05:53:57","Android Application and Timers","<android><timer><android-1.5-cupcake>","2","0","","",""
"1059839","1","1061701","","2009-06-29 18:47:09","8","6523","<p>I am building a application for the Android platform and I would like to use the accelerometer. Now, I have found a very nice application for sensor simulation (<a href=""http://code.google.com/p/openintents/wiki/SensorSimulator"" rel=""nofollow"">OpenIntents' SensorSimulator</a>) but, for what I want to do, a would like to create my own sensor simulator application.</p><p>I have not found information on how to do this (I do not know if disassembly the jar of the Simulator is correct) and, as I said, I would like to build a smaller and simpler version of a sensor simulator, more suitable for my intents.</p><p>Do you know where could I start? where can I see what are the pieces of code that I need to build?</p><p>Basically, all my asking just for some direction.</p>","69041","","3330969","","2014-03-22 02:57:28","2014-03-22 02:57:28","How to Build a Sensor Simulator for Android?","<android><simulation><sensor>","2","0","6","",""
"1060203","1","1060502","","2009-06-29 20:02:35","2","2200","<p>I am trying to launch an email intent with an attached jpg.</p><p>I did:</p><pre><code>Intent intent4 = new Intent(Intent.ACTION_SENDTO,Uri.fromParts(""mailto"", ""testemail@gmail.com"", null));startActivity(intent4);</code></pre><p>this launches the email activity.</p><p>But when I try to add DataAndType (my jpeg attachment).  It fails with</p><pre><code>android.content.ActivityNotFoundException: No Activity found to handle Intent { action=android.intent.action.SENDTO data=file:///data/data/com.mycompany.mypackage/files/temp-picture type=JPEG Intent intent4 = new Intent(Intent.ACTION_SENDTO,  Uri.fromParts(""mailto"", ""testemail@gmail.com"", null));intent4.setDataAndType(Uri.parse(""file://""+ mTempFilePath),  Bitmap.CompressFormat.JPEG.name());    startActivity(intent4);</code></pre>","114970","","3330969","","2014-03-26 00:55:17","2014-03-26 00:55:17","How to launch email intent with an attached image?","<java><android>","1","0","2","",""
"1061730","1","","","2009-06-30 04:29:18","1","975","<p>I want to launch more than one application at the same time.Like one application should run in the background when a new application is started,and i have to switch between those two application.If anyone having the code to do this please help me.Give some website links to know about the multitasking in android and how to achieve it.</p>","111436","","","","","2009-06-30 04:32:26","Regarding Multitasking in Android application","<android>","1","0","1","",""
"1062052","1","","","2009-06-30 06:36:30","4","2794","<p>I can run an application in background but I want to know how many applications are running in the background. Like in some mobile while pressing the center button a list of currently running applications are displayed. Is this is possible in android? If possible then give some code snippets and steps to achieve this.</p>","111436","","1777090","","2013-01-16 06:33:11","2013-01-16 06:33:11","How to know how many applications are running in the background in android?","<android>","1","0","3","",""
"1062476","1","","","2009-06-30 08:42:11","5","19609","<p>Greetings,</p><p>I am trying to get the Click - event when clicking on the currently selected tab of my TabActivity. The onTabChangedHandler is only called whenever the tab is changed, not if the currently active Tab is clicked. The debugger tells me i have the onClickListener Registered for the TabWidget within my TabHost. </p><p>Am i registering for the wrong View?</p><p>Also, I am unable to create a Context Menu for the Tabs, only for its content, is this problem related?</p><pre><code>public class TestDroidViewTab extends TabActivity                               implements TabContentFactory                              , OnTabChangeListener, OnClickListener {  private static final String LOG_KEY = ""TEST"";  ListView listView;  @Override  protected void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      final TabHost tabHost = getTabHost();      TabHost.TabSpec ts = tabHost.newTabSpec(""ID_1"");      ts.setIndicator(""1"");       ts.setContent(this);      tabHost.addTab(ts);      ts = tabHost.newTabSpec(""ID_2"");      ts.setIndicator(""2"");       ts.setContent(this);      tabHost.addTab(ts);      ts = tabHost.newTabSpec(""ID_3"");      ts.setIndicator(""3"");       ts.setContent(this);      tabHost.addTab(ts);      tabHost.setOnClickListener(this);      tabHost.setOnTabChangedListener(this);  }  public void onClick(View v) {      Log.d(LOG_KEY, ""OnClick"");  }  public void onTabChanged(String tabId) {      Log.d(LOG_KEY, ""OnTabChanged"");  }</code></pre>","","Aracos","683261","","2012-01-30 09:00:14","2013-05-31 09:18:01","OnClickListener on Tabs not working","<android><onclick><android-tabhost>","4","0","7","",""
"1062578","1","1878518","","2009-06-30 09:02:29","27","36486","<p>I would like to build an Android application that, via an OCR library, should scan a picture extracting text from it .  </p><p>What Java library should I use?</p>","130929","","130929","","2011-01-26 10:42:30","2012-05-10 09:19:05","What kind of OCR Java library should I use in Android?","<java><android><ocr>","4","0","26","2012-06-05 23:10:46",""
"1063604","1","1064006","","2009-06-30 13:10:57","8","6081","<p>I have an application which launch automatically after the booting finished,but the application icon is displayed in the android emulator.Now i want to hide that icon from the user.So that the user cannot know from the application is lanuch and they cannot launch that application manually.</p>","131062","","","","","2011-05-09 08:19:52","How to hide an application icon in Android emulator?","<android>","1","0","3","",""
"1064704","1","1064865","","2009-06-30 16:32:53","4","745","<p>How to register listening for any Contact <strong>(add/remove contact, change in email/phone</strong>) changes on android?</p><p>Thank you.</p>","114970","","750613","","2012-06-26 05:40:19","2012-06-26 05:40:19","How to register listening for any Contact changes on android","<java><android><android-contacts>","1","0","2","",""
"1065056","1","1068827","","2009-06-30 17:52:47","3","1341","<p>I'm looking for a protocol to secure a connection between a mobile device and a web service.  I want to ensure that only the mobile device can perform actions on the web service and vice versa. Data doesn't need to be encrypted.</p><p>I know Oauth, but it seems that it's more used to secure connections when you got 3 different entities (Server, Consumer and Auth). Here, the Consumer and the User would be the same person.</p><p>Is there a simple protocol to do that (without requiring the user to login and then authorize the access token like it is the case for Oauth)?</p><p>I need to use it on different plateforms, so the protocol needs to be available at least on iPhone and PHP.</p>","129513","","1777090","","2013-01-17 05:21:41","2013-01-17 05:21:41","Protocol to secure a connection between a mobile device and a web service?","<iphone><android><authentication><blackberry><oauth>","3","0","3","",""
"1066008","1","1076189","","2009-06-30 20:54:52","2","3026","<p>I am currently trying out the Android 1.5 SDK and I have seen a couple of examples on TabHost.What I am trying to do is to use a different button on each Tab to do its tasks. </p><p>What I tried was using onClickListiner() and onClick(). I think this is what all the developers use, but I keep getting a null exception on the LogCat every time the button is pressed. Also I have each XML Layout so I call the Tab as : tab.add(...setContent(R.id.firstTabLayout))</p><pre><code>firstTabLayout = layout for Button and TextView.</code></pre><p>What would be the best way to make a button/TextView work properly under the TabHost?</p>","52766","","667810","","2012-08-09 01:56:27","2012-08-09 01:56:27","Android 1.5 Programming with TabHost and Buttons","<java><android><mobile><sdk><android-tabhost>","1","0","","",""
"1066948","1","1070759","","2009-07-01 01:49:17","0","1446","<p>A simple ListView with, say, 6 rows (Views). Now, I want it to fit exactly a single screen. Any straightforward way to do this? Or should I go with a custom view?</p>","15187","","","","","2009-07-02 11:14:32","Stretching ListView to a single screen?","<android><listview>","3","2","1","",""
"1068000","1","1068965","","2009-07-01 08:38:23","1","4831","<p>I created a full-screen application and set the default orientation to landscape. When I open the keyboard the application crashes therefore I would like to override the method which executes on keyboard slide. Does anyone know which method is that?</p>","22996","","1777090","","2013-01-17 05:21:23","2013-01-17 05:21:23","Android: Keyboard event handler","<android><keyboard-events>","1","0","","",""
"1068121","1","1070541","","2009-07-01 09:12:07","10","9045","<p>I created an application which uses camera and during the appplication execution the screen is always on.</p><p>In the onCreate() method I added the lock:</p><pre><code>final PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);this.mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, ""My Tag"");this.mWakeLock.acquire();</code></pre><p>And this is the overriden onStop() method:</p><pre><code>@Overrideprotected void onStop() {	if(mWakeLock.isHeld())	{		mWakeLock.release();	}	super.onStop();}</code></pre><p>But after the application termination the screen remains on all the time and if I run the camera application it encounters an error which obviously appears because the camera resources are not released.</p><p>Does anyone know how to release all resources on application termination?</p>","22996","","","","","2013-04-07 19:25:35","Android: How to release resources when the application terminates?","<android><resources>","5","0","1","",""
"1072911","1","1073190","","2009-07-02 07:10:51","3","3712","<p>I would like to run APIDemos under <code>platforms\android-1.5\samples</code> directory on Android emulator but I don't know how to do it.<br>Do I need to generate an apk or import sources as an eclipse project?</p>","130929","","130929","","2011-04-12 19:18:36","2011-12-10 20:28:17","How to run APIDemos on Android emulator?","<android>","3","0","1","",""
"1073114","1","1073156","","2009-07-02 08:12:23","8","9498","<p>The main activity includes some variables with set values. I created a sub-activity with the form which has to be filled with the data from main activity so I guess the data have to be passed to the sub-activity when it starts.</p><p>Does anyone know how to pass the variable values to the sub-activity from the main activity?</p><p>Thanks!</p>","22996","","","","","2012-02-28 21:56:18","Android: How to pass the data to sub-activities?","<android><activity>","2","0","6","",""
"1073293","1","1824376","","2009-07-02 09:07:28","1","3769","<p>I have created a CapturePreview class and CameraManager class the following way:</p><p>CapturePreview:</p><pre><code>public class CaptureView extends SurfaceView implements Callback{private final SurfaceHolder surfaceHolder;FileReaderWriter fileRW;int frameCount;private static final int MSG_FRAME_REFRESHED = 1;private static final int MSG_AUTOFOCUS = 2;private final CameraManager mCameraManager;private boolean mRecording;public CaptureView(Context context, AttributeSet attrs){	super(context, attrs);	surfaceHolder = getHolder();	surfaceHolder.addCallback(this);	surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);	CameraManager.init(context);	mCameraManager = CameraManager.get();	init(context);}public CaptureView(Context context, AttributeSet attrs, int defStyle){	super(context, attrs, defStyle);	surfaceHolder = getHolder();	surfaceHolder.addCallback(this);	surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);	surfaceHolder.setSizeFromLayout();	CameraManager.init(context);	mCameraManager = CameraManager.get();	init(context);}@Overridepublic void surfaceChanged(SurfaceHolder holder, int format, int width,		int height) {	mCameraManager.startPreview();	//mCameraManager.requestPreviewFrame(mCameraHandler, MSG_FRAME_REFRESHED);	mCameraManager.requestAutoFocus(mCameraHandler, MSG_AUTOFOCUS);}@Overridepublic void surfaceCreated(SurfaceHolder holder) {	try	{		mCameraManager.openDriver(surfaceHolder);	}	catch(Exception e)	{		//TODO: display error	}}@Overridepublic void surfaceDestroyed(SurfaceHolder holder) {	mCameraManager.stopPreview();}private void init(Context context){	setFocusable(true);	mRecording = false;	fileRW = new FileReaderWriter();	frameCount = 0;}public void setRecording(boolean isRecording) {	this.mRecording = isRecording;}public boolean isRecording() {	return mRecording;}private Handler mCameraHandler = new CameraHandler();private class CameraHandler extends Handler{	@Override	public void handleMessage(Message msg)	{		switch(msg.what)		{		case MSG_FRAME_REFRESHED://  			String path = ""JPGFrame"" + frameCount;//  			fileRW.setPath(path);//  			fileRW.WriteToFile((byte[]) msg.obj);//  			frameCount++;			break;		}	}}</code></pre><p>}</p><p>CameraManager:</p><pre><code>public final class CameraManager {@Overrideprotected void finalize() throws Throwable {	closeDriver();	super.finalize();}private static final String TAG = ""CameraManager"";private static CameraManager mCameraManager;private Camera mCamera;private final Context mContext;private Point mScreenResolution;private Rect mFramingRect;private Handler mPreviewHandler;private int mPreviewMessage;private Handler mAutoFocusHandler;private int mAutoFocusMessage;private boolean mPreviewing;public static synchronized void init(Context context) {    if (mCameraManager == null) {      mCameraManager = new CameraManager(context);      mCameraManager.getScreenResolution();    }  }  public static CameraManager get() {    return mCameraManager;  }  private CameraManager(Context context) {    mContext = context;    mCamera = null;    mPreviewing = false;  }  public void openDriver(SurfaceHolder holder) throws IOException {    // ""throws IOException added to accommodate Android 1.5    if (mCamera == null) {      mCamera = Camera.open();      setCameraParameters();      mCamera.setPreviewDisplay(holder);    }  }  public void closeDriver() {    if (mCamera != null) {      mCamera.release();      mCamera = null;    }  }  public void startPreview() {    if (mCamera != null &amp;&amp; !mPreviewing) {      mCamera.startPreview();      mPreviewing = true;    }  }  public void stopPreview() {    if (mCamera != null &amp;&amp; mPreviewing) {      mCamera.setPreviewCallback(null);      mCamera.stopPreview();      mPreviewHandler = null;      mAutoFocusHandler = null;      mPreviewing = false;    }  }  public void requestPreviewFrame(Handler handler, int message) {    if (mCamera != null &amp;&amp; mPreviewing) {      mPreviewHandler = handler;      mPreviewMessage = message;      mCamera.setPreviewCallback(previewCallback);    }  }  public void requestAutoFocus(Handler handler, int message) {    if (mCamera != null &amp;&amp; mPreviewing) {      mAutoFocusHandler = handler;      mAutoFocusMessage = message;      mCamera.autoFocus(autoFocusCallback);    }  }  public Rect getFramingRect() {    if (mFramingRect == null) {      int size = ((mScreenResolution.x &lt; mScreenResolution.y) ? mScreenResolution.x :          mScreenResolution.y) * 3 / 4;      int leftOffset = (mScreenResolution.x - size) / 2;      int topOffset = (mScreenResolution.y - size) / 2;      mFramingRect = new Rect(leftOffset, topOffset, leftOffset + size, topOffset + size);    }    return mFramingRect;  }  PreviewCallback previewCallback = new PreviewCallback()  {	@Override	public void onPreviewFrame(byte[] data, Camera camera) {		if(mPreviewHandler != null)		{			Message message = mPreviewHandler.obtainMessage(mPreviewMessage,	            mScreenResolution.x, mScreenResolution.y, data);		        message.sendToTarget();		}	}   };  AutoFocusCallback autoFocusCallback = new AutoFocusCallback()  {	@Override	public void onAutoFocus(boolean success, Camera camera) {		if(mAutoFocusHandler != null)		{			Message message = mAutoFocusHandler.obtainMessage(mAutoFocusMessage, success);	        message.sendToTarget();		}		}    };  private void setCameraParameters() {    Camera.Parameters parameters = mCamera.getParameters();    parameters.setPreviewSize(mScreenResolution.x, mScreenResolution.y);    parameters.setPictureFormat(PixelFormat.JPEG);    parameters.setPreviewFormat(PixelFormat.JPEG);    mCamera.setParameters(parameters);  }  private Point getScreenResolution() {    if (mScreenResolution == null) {      WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);      Display display = wm.getDefaultDisplay();      mScreenResolution = new Point(display.getWidth(), display.getHeight());    }    return mScreenResolution;  }</code></pre><p>}</p><p>The video preview works fine this way until the sub-activity starts in the main activity. When sub-activity starts the <code>CaptureView.surfaceDestroyed(SurfaceHolder holder)</code> is called and the video preview stops. Then when the sub-activity closes the <code>CaptureView.surfaceCreated(SurfaceHolder holder)</code> is executed, but the video preview doesn't start.</p><p>Does anyone know how to fix the problem in order to successfully restart video preview after surfaceDestroyed(SurfaceHolder holder) is executed?</p><p>Thanks!</p>","22996","","","","","2010-08-02 02:10:05","Android: How to restart video preview after the surfaceDestroyed()?","<android><video><camera>","1","0","","",""
"1074773","1","","","2009-07-02 14:37:43","3","2475","<p>I am trying to capture video and the routine throws an exception when the execution reaches recorder.prepare() statement:</p><pre><code>private void recordVideoStart(){	if(recorder != null)	{		recorder.stop();		recorder.release();	}	File file = new File(""/sdcard/videoTest.3gpp"");	try {		file.createNewFile();	} catch (IOException e) {		// TODO Auto-generated catch block		e.printStackTrace();	}	recorder = new MediaRecorder();	recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);	recorder.setAudioSource(MediaRecorder.AudioSource.MIC);	recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);	recorder.setOutputFile(file.getAbsolutePath());	recorder.setVideoSize(176, 144);	recorder.setVideoFrameRate(15);	//recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);	recorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT);	recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);	recorder.setPreviewDisplay(videoPreview.getSurface());	try {		recorder.prepare();	} catch (IllegalStateException e) {		// TODO Auto-generated catch block		e.printStackTrace();	} catch (IOException e) {		// TODO Auto-generated catch block		e.printStackTrace();	}	recorder.start();}</code></pre><p>Looking the LogCat I noticed the line ""Camera is not available"".</p><p>Does anyone know what could be wrong here and how to enable video capture?</p><p>Thanks!</p>","22996","","","","","2012-04-26 10:50:07","Android: Camera is not available problem","<android><camera><capture>","3","2","","",""
"1075276","1","","","2009-07-02 16:11:52","1","422","<p>Are there APIs for grabbing the voice (in both directions) during a call? I'm interested in whether it can be intercepted before it's sent out (outgoing) and before it's played by the speaker (incoming).</p>","87676","","","","","2012-05-07 22:15:01","Android: Grabbing Voice","<android>","2","0","","",""
"1077162","1","1077188","","2009-07-02 23:18:49","8","1908","<p>Are there any interpreters available for the Android platform for any language at all? If so, do they work with both physical and on-screen keyboards?</p>","4812","","995926","","2012-05-03 06:59:49","2012-05-03 06:59:49","Programming on (not *for*) an Android device","<android><mobile>","3","0","2","",""
"1077357","1","1078988","","2009-07-03 00:30:07","204","41931","<p>In the Android SDK documentation, all of the examples used with the @drawable/my_image xml syntax directly address images that are stored in the res/drawable directory in my project.</p><p>I am wondering if it is explicitly not okay to create a sub directory within the drawable directory.</p><p>For example, if I had the following directory layout:</p><pre><code>res/drawable-- sandwiches  -- tunaOnRye.png  -- hamAndSwiss.png-- drinks  -- coldOne.png  -- hotTea.png</code></pre><p>Could I reference the image of a tuna salad sandwich as @drawable/sandwiches/tunaOnRye</p><p>Or do I have to keep the hierarchy flat in the drawable directory.</p>","95724","","958370","","2012-02-09 13:26:13","2014-01-09 14:39:45","Can The Android drawable directory contain subdirectories?","<android><drawable><android-resources>","9","2","32","",""
"1077415","1","1077431","","2009-07-03 01:07:20","36","2271","<p>Is <a href=""http://en.wikipedia.org/wiki/Android%5F%28operating%5Fsystem%29"" rel=""nofollow"">Android</a> development restrictive in any way like the <a href=""http://en.wikipedia.org/wiki/IPhone"" rel=""nofollow"">iPhone</a>, or can you download whatever and from whoever you want?</p><p>I want to learn about development for either iPhone or Android, but from what I hear iPhone development is pretty restrictive!</p>","68183","","63550","","2009-12-29 09:26:59","2013-04-11 06:35:56","Is Android development restrictive in any way like for the iPhone?","<iphone><android>","10","0","11","",""
"1077688","1","4263669","","2009-07-03 03:53:58","1","2341","<p>I want to send and receive information between Emulators in Android.i am using two systems and i have installed android in both the systems and i have to consider one emulator as server and another as client.Now i want to send data from one to another.Anyone knows regrading this please help me with some sample code.</p>","131062","","131062","","2009-07-08 04:21:49","2014-01-29 08:27:54","How to do Client server communication in Android?","<android>","3","0","1","",""
"1079475","1","1079777","","2009-07-03 13:55:55","1","220","<p>I am trying to pop up dialog from run method it gives me exception that Looper.prepare not called, when I call the same method i dont get any exception but there is no pop up dialog shown on the console. As I have used handler in this way ,</p><pre><code>handler = new Handler() {    public void handleMessage(Message msg) {        showDialog(DIALOG1_KEY);        // process incoming messages here    }};</code></pre><p>I am not getting any exception again but still no luck can any body tell me where I am doing things wrong.</p>","95877","","1777090","","2013-01-17 05:20:34","2013-01-17 05:20:34","Showing dialog from run() method","<java><android>","1","0","","",""
"1080811","1","1082523","","2009-07-03 21:00:19","136","60753","<p>How can I create a list where when you reach the end of the list I am notified so I can load more items?  </p>","764272","","321731","","2014-02-08 14:27:07","2014-02-08 14:27:07","Android Endless List","<android><list><listview>","6","1","162","",""
"1081156","1","","","2009-07-03 23:52:38","1","4845","<p>I have an application that is based on Web 2.0 technologies -- basically I use phonegap / titanium approach to start up a web browser where most of the app is written in javascript and HTML (jQuery, to more precise).  The app works great on the emulator, but when I launch it on the G1, it crashes.  When I reduce the amount of javascript that has been written for the app, it starts to work again.  Alternatively, if I remove the javascriptInterface to access some of the ""java"" based methods, the app also works. </p><p>When I try to load all the javascript and java objects required for the app, it crashes (as in the log below).  Is there some hard limit on the amount of ""code"" memory that I can load in Webkit?  The crazy thing is that this app uses a lot of images, that load just fine.. seems like i'm hitting some limit on the number of lines of javascript that I am allowed to parse and load into Webkit ?  It does say something about ""Too many open files"", which might be the issue, but I'm not actually opening any files with my application, so I'm confused by this error.</p><p>Thanks for any help.  I've been struggling with this for the last few days.</p><p>Best.</p><p>Alex</p><pre><code>07-03 16:43:23.430: DEBUG/dalvikvm(104): GC freed 964 objects / 41632 bytes in 285ms07-03 16:43:24.030: DEBUG/dalvikvm(314): GC freed 710 objects / 23680 bytes in 131ms07-03 16:43:24.380: INFO/ActivityManager(62): Process android.process.im (pid 220) has died.07-03 16:43:24.650: DEBUG/dalvikvm(104): GC freed 964 objects / 41688 bytes in 154ms07-03 16:43:24.700: ERROR/IMemory(104): cannot dup fd=1023, size=1048576, err=0 (Too many open files)07-03 16:43:24.700: ERROR/IMemory(104): cannot map BpMemoryHeap (binder=0x4fe260), size=1048576, fd=-1 (Bad file number)07-03 16:43:24.820: ERROR/JavaBinder(104): *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)07-03 16:43:24.820: ERROR/JavaBinder(104): java.lang.RuntimeException: No memory in memObj07-03 16:43:24.820: ERROR/JavaBinder(104):     at android.database.CursorWindow.native_init(Native Method)07-03 16:43:24.820: ERROR/JavaBinder(104):     at android.database.CursorWindow.&lt;init&gt;(CursorWindow.java:467)07-03 16:43:24.820: ERROR/JavaBinder(104):     at android.database.CursorWindow.&lt;init&gt;(CursorWindow.java:27)07-03 16:43:24.820: ERROR/JavaBinder(104):     at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:442)07-03 16:43:24.820: ERROR/JavaBinder(104):     at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:445)07-03 16:43:24.820: ERROR/JavaBinder(104):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:95)07-03 16:43:24.820: ERROR/JavaBinder(104):     at android.os.Binder.execTransact(Binder.java:287)07-03 16:43:24.820: ERROR/JavaBinder(104):     at dalvik.system.NativeStart.run(Native Method)</code></pre>","","Alex Shah","319618","","2011-01-12 16:39:07","2011-09-27 23:00:56","android phonegap application fails when loading too much javascript","<android><memory-management><phonegap>","3","1","","",""
"1082437","1","1082836","","2009-07-04 15:41:19","61","54117","<p>Can someone please show me some sample code on how to use an <code>AlarmManager</code> in ?Android.</p><p>I have been playing around with some code for a few days and it just won't work.</p><p>I need to trigger a block of code after 20 minutes from the <code>AlarmManager</code> being set.</p>","122547","","320180","","2012-08-19 14:41:54","2013-11-29 13:58:45","Android AlarmManager","<java><android><alarmmanager><android-alarms><android-1.5-cupcake>","4","0","46","",""
"1083154","1","1789879","","2009-07-04 23:18:18","46","29442","<p>I'm moving <a href=""http://chris.boyle.name/projects/android-puzzles"">a project</a> to the new Android Native Development Kit (i.e. JNI) and I'd like to catch SIGSEGV, should it occur (possibly also SIGILL, SIGABRT, SIGFPE) in order to present a nice crash reporting dialog, instead of (or before) what currently happens: the immediate unceremonious death of the process and possibly some attempt by the OS to restart it. (<b>Edit:</b> The JVM/Dalvik VM catches the signal and logs a stack trace and other useful information; I just want to offer the user the option to email that info to me really.) </p><p>The situation is: a large body of C code which I didn't write does most of the work in this application (all the game logic) and although it's well-tested on numerous other platforms, it's entirely possible that I, in my Android port, will feed it garbage and cause a crash in native code, so I want the crash dumps (both native and Java) that currently show up in the Android log (I guess it would be stderr in a non-Android situation). I'm free to modify both C and Java code arbitrarily, although the callbacks (both going in and coming out of JNI) number about 40 and obviously, bonus points for small diffs.</p><p>I've heard of the signal chaining library in J2SE, libjsig.so, and if I could safely install a signal handler like that on Android, that would solve the catching part of my question, but I see no such library for Android/Dalvik.</p>","6540","","6540","","2010-04-09 15:52:55","2013-08-28 17:08:50","How can I catch SIGSEGV (segmentation fault) and get a stack trace under JNI on Android?","<android><jni><signals><android-ndk><sigsegv>","5","0","35","",""
"1083527","1","1222801","","2009-07-05 05:52:06","44","71055","<p>I want to block calls from few numbers, for that I want to write a app of my own.So what are the APIs which I should be using?</p><p>Basically I want to get notified when a call comes, i want to compare numbers if it is what i want to block, i want to cut the call or mute it or if possible mute it and record it.</p>","6946","","","","","2013-08-26 09:44:42","How to block calls in android","<android><callblocking>","5","1","37","",""
"1086283","1","1086522","","2009-07-06 09:54:47","4","4557","<p>To put it simple: I want to bookmark the current position (probablyseveral positions) in a html file displayed in a WebView to laterrestore it. Any little hint would help. :)</p>","15187","","","","","2010-11-01 09:14:34","Getting document position in a WebView?","<android><webview>","2","0","4","",""
"1088810","1","1090800","","2009-07-06 19:27:56","3","9764","<p>Im trying to setup some tabs for my android application, but i got stuck.</p><p>I cant find a way to communicate between the tabs..</p><p>I got 2 tabs.</p><hr><h2>|Search|Result|</h2><p>The search tab is simply showing a TextEdit and a ""Search"" button.Hitting the search button should make my app change to the result tab and display the result.</p><p>i have added the tabs as activities using new intents as </p><pre><code>TabHost host=getTabHost();  host.addTab(host.newTabSpec(""one"")     .setIndicator(""Search"")     .setContent(new Intent(this, SearchTabActivity.class)));  host.addTab(host.newTabSpec(""Result"")     .setIndicator(""Android"")     .setContent(new Intent(this, ResultTabActivity.class)));  </code></pre><p>Now i cant find a way for SearchTabActivity to display ResultTabActivity and alter its view... </p><p>Im looking forward for any tip.</p>","133858","","708685","","2011-06-08 04:02:12","2012-08-26 14:29:16","How to communicate between Android tabs","<android><gui><activity><tabs>","1","2","3","",""
"1090019","1","1090180","","2009-07-07 01:56:04","0","1076","<p>I am writing a program that convert TM-2 degree to lat/lon on Android, but I can't find formula for that. I do find some example on internet, but most of them are convert with open source library, that I can't use on Android platform. I also find a java class that do convert from UTM to lat lon, but it seems no suitable for TM 2 degreen coordinate system. So my question is: how do I convert TM 2 degree coordinate to lat/lon? Where can I find formula?</p>","25077","","147141","","2009-10-07 22:24:24","2010-05-16 09:00:04","How to convert TM-2 degree coordinate to lat lon on Android?","<android><gps><geocoding><coordinate-systems>","1","2","","",""
"1091048","1","1091576","","2009-07-07 08:36:47","4","4481","<p>I' trying to use <em>window.pageYOffset</em> &amp; <em>window.scrollMaxY</em> to calculate the current page progress. This approach works under FF3.5 but under webkit <em>window.scrollMaxY</em> is undefined.</p>","15187","","15187","","2009-07-07 10:33:34","2012-11-08 09:24:49","Alternatives to window.scrollMaxY?","<javascript><android><webkit>","3","0","3","",""
"1091114","1","1091250","","2009-07-07 08:53:04","8","4039","<p>I want to port an small open source AES encryption class to Android, and it would cut my work down a lot if the API of Android is as close as possible to the Java 6 API. </p><p>How much is implemented (or referenceable), as I have tried searching about this on google, and i have not yet come up with anything useful?</p>","134118","","","","","2013-03-22 16:28:44","How much of the Java 6 API is implemented by Android?","<java><android>","6","0","1","",""
"1092144","1","1092208","","2009-07-07 12:51:01","26","6491","<p>What mobile platform should I start learning?What matters is:</p><ul><li>ease</li><li>popularity of the platform</li><li>low cost of the SDK and actual handheld</li></ul>","63051","","63550","","2010-12-14 10:28:57","2012-08-17 07:17:25","What mobile platform should I start learning?","<iphone><android><windows-mobile><java-me><symbian>","22","0","23","2013-11-11 14:24:53","2009-08-26 05:47:45"
"1093962","1","","","2009-07-07 18:23:20","5","6792","<p>Android's API provides a clean mechanism via SQLite to make queries into the contact list.  However, I am not sure how to limit the results:</p><pre><code>Cursor cur = ((Activity)mCtx).managedQuery(                People.CONTENT_URI,                columns,                ""LIMIT ? OFFSET ?"",                new String[] { Integer.toString(limit), Integer.toString(offset) },                null        );</code></pre><p>Doesn't work.</p>","","Alex","","","","2012-04-12 13:58:36","how add limit clause to manageQuery on android","<android><sqlite>","5","0","4","",""
"1095322","1","1123806","","2009-07-07 23:13:04","21","52265","<p>I'm using Eclipse to learn to develop Android applications in Java. I haven't used Eclipse before.</p><p>The project I'm trying to use (supplied by OReilly as part of 'Android Application Development') is MJAndroid. When attempting to run the project, the Run fails, and the Problems tab mentions com.java.Object can't be found, and Eclipse asks me to check the build path. Clicking Properties -> Java Build Path -> Libraries, the message 'Unable to get system library for the project' is displayed.</p><p>On a working project, Properties -> Java Build Path -> Libraries has an entry for Android 1.1, which if I click Edit, has the classpath container path of  com.android.ide.eclipse.adt.ANDROID_FRAMEWORK.</p><p>It seems a simple matter of adding the correct container path to my non-working project. However Eclipse seems determined to make this as difficult as possible. No matter what I chose to add - jars, externals jars, variables, libraries, class folders, external class folders, nothing seems to take the form of 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK' that the 'Android 1.1' entry on the working app has. </p><p>How can I add this namespace to my project so it resembles the working one?</p><p>I'm quite sure it's a problem with Eclipse's somewhat odd user interface. Frankly there' nothing I'd prefer more than a file to modify and set such information - my background is in Python, and the whole eclipse environment seems an unnecessary burden.</p>","123671","","","","","2014-03-26 05:59:33","Android Eclipse Classpath - want to add classpath container path but eclipse won't let me","<java><android><eclipse><classpath>","7","0","9","",""
"1096102","1","1096439","","2009-07-08 04:16:45","0","2509","<p>I am having a task,considering one emulator as server and i have to access a web service from the client emulator.I think this is not possible in android,if anyone knows about it please send some code snippets to do this.</p>","131062","","750613","","2012-06-22 13:17:01","2012-06-22 13:17:01","How to do Socket communication in android?","<android><network-programming>","1","0","","",""
"1096618","1","2216788","","2009-07-08 07:33:43","9","11789","<p>I'm writing an android application that builds an offscreen bitmap that is (say) 640*480 pixels and displays that in a SurfaceView.  Note that the size of the image is larger than the actual display on the handset.</p><p>The way that the application works is that it initially displays the upper left corner (0,0) of the image and then I would like to be able to scroll around the image.</p><p>My Surfaceview class implements the onMeasure callback and returns a size of 1024*768 which displays the area of the image that corresponds to the phone screen. I'd like to implement support for scrolling which I'm finding near impossible due to the very limited documentation (just bunches of classes and calls with no coherency). I've tried just calling scrollBy and that doesn't work.</p><p>If anyone has any pointers about how to proceed this would be much appreciated.</p>","103345","","","","","2014-02-20 09:29:17","Android SurfaceView scrolling","<android><scrolling><surfaceview>","2","0","2","",""
"1096961","1","","","2009-07-08 09:01:07","1","1956","<p>I want to extend the built in media player, however when i grab the sources, there are a lot of external dependencies that are hard to track down.<br>Is there any way to get the source and the dependencies so that i can have it as a standalone and then extend it, is this even possible?</p>","","bernyu","","","","2009-07-08 11:14:17","Extending Android media player","<android>","1","0","2","",""
"1097440","1","1097446","","2009-07-08 11:19:55","2","1448","<p>How can we use Web services in Android Applications? </p>","134861","","","","","2009-07-08 11:21:35","Web Service use in Android","<android><web-services>","1","0","","",""
"1097594","1","1111738","","2009-07-08 11:52:04","4","7887","<p>I have attached a mapview to my layout and have a it showing a compass and my current location. The problem I have is, that there is no street map shown in the view, so basically I just see the compass and my current location over a blank grid.</p>","129688","","3330969","","2014-03-20 12:20:39","2014-03-20 12:20:39","How to show a map in an Android mapactivity?","<android><google-maps><android-mapview>","4","0","1","",""
"1097937","1","","","2009-07-08 13:02:36","0","1207","<p>I am planning to give mobile phone development a shot and was thinking about making some simple multiplayer games.  I know latency over local wifi is probably fine but what are the issues with latency over GPRS/3G?</p><p>I've searched and the best I've seen is someone saying it was 'high', without presenting any concrete numbers.  I suppose latency fluctuations are important as well - does anyone have any info on this?</p>","130417","","130417","","2009-07-08 18:09:57","2010-05-12 22:48:35","Latency on mobile networks (Android)","<android><mobile-phones><latency>","2","0","","",""
"1098628","1","","","2009-07-08 14:59:28","0","719","<p>I have installed repo and git on my PC. I am trying to get the latest Android source by using the following commands:</p><ol><li><p><code>repo init -u git://android.git.kernel.org/platform/manifest.git</code>The command succeeds but I am not able to see .repo directory created.</p></li><li><p>repo syncThis command also succeeds and the program shows the details of objects being received. However I am not able to see anything downloaded to my PC.</p></li></ol><p>Any help will be appreciated.</p>","","Mayank","750613","","2012-06-22 13:13:53","2012-06-22 13:13:53","Repo command with no results","<android><git><repository>","2","0","","",""
"1099640","1","1107509","","2009-07-08 17:59:42","8","9349","<p>I'm pretty new to java in general, but I have a bit of experience in C and C++.  Normally in a C or C++ program there's a main loop/function, usually int main ().  Is there a similar function that I can use in android java development?</p>","135135","","750613","","2012-06-22 13:13:21","2013-02-05 21:22:55","Main loop in Android","<java><android><activity-lifecycle>","4","0","6","",""
"1101160","1","1101395","","2009-07-08 23:49:53","2","8472","<p>I want to lay two TextView to the left, and one button to the right inside a linear layout, is this possible?The following is my code where I had to hardcode the leftMargin of the button, this is inflexible.   Is it possible to layout children that flows in different directions? </p><pre><code>&lt;LinearLayoutandroid:id=""@+id/widget43""android:layout_width=""fill_parent""android:layout_height=""100px""&gt;&lt;TextViewandroid:id=""@+id/tc_buttom_text1""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Time elapsed""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/tc_buttom_text2""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""00:00:00 00""&gt;&lt;/TextView&gt;&lt;Buttonandroid:id=""@+id/tc2_home""android:layout_width=""70px""android:layout_height=""wrap_content""android:layout_marginLeft=""200px""android:layout_marginRight=""10px""android:text=""Home""android:layout_weight=""0.5""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","121196","","750613","","2012-06-22 13:11:17","2012-06-22 13:11:56","android LinearLayout","<android><layout><android-linearlayout>","4","0","","",""
"1101380","1","","","2009-07-09 01:22:11","71","35377","<p>My app has a certain piece of functionality that will only work on a device where root is available. Rather than having this feature fail when it is used (and then show an appropriate error message to the user), I'd prefer an ability to silently check if root is available first, and if not,hide the respective options in the first place.</p><p>Is there a way to do this?</p>","15677","","73488","","2010-10-04 11:19:51","2014-04-07 10:16:41","Determine if running on a rooted device","<android><root>","9","1","56","",""
"1101992","1","1103668","","2009-07-09 05:36:57","9","3368","<p>I'd like to be able to send a POST request from an Android app to App Engine and have it linked to the user's Google account.  I read that you need to obtain an authentication token and send it with the POST request.  Does Android provide a way to request this token?  And how would GAE process it?  </p><p>I feel like this should be easy and I'm missing something obvious.  </p><p>Thanks!</p>","91377","","","","","2010-05-05 15:01:08","Easy way to authenticate POST requests from a Google Android client to Google App Engine?","<android><google-app-engine><authentication>","2","0","9","",""
"1102050","1","1103054","","2009-07-09 05:55:22","17","34377","<p>How to navigate from one Activity screen to another Activity screen? In the first screen I'm having one button if I click the button it has to move to another Activity screen.</p>","132724","","228755","","2012-10-03 08:00:15","2013-12-18 13:29:54","How to navigate from one screen to another screen","<java><android><activity>","9","0","6","",""
"1102418","1","1104135","","2009-07-09 07:51:37","1","950","<p>I want my app to catch downloads of a particular kind of file.Here's the corresponding part of AndroidManifest.xml:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    	&lt;activity android:name="".activity.ExeReceiver""&gt;    		&lt;intent-filter&gt;    			&lt;action android:name=""android.intent.action.VIEW"" /&gt;    			&lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    			&lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;    			&lt;data android:scheme=""http"" /&gt;    			&lt;data android:host=""*"" /&gt;    			&lt;data android:pathPattern="".*\\.exe"" /&gt;    		&lt;/intent-filter&gt;    	&lt;/activity&gt;</code></pre><p>Now, open a page with a link to an .exe file, click it. The download manager starts and then tells that <em>The content is not supported on the phone.</em> My activity doesn't even get called.</p><p>The questions are:</p><p>1) Why doesn't my activity get called?</p><p>2) What's the correct way of letting download manager do it's job and then get notified upon file download completion?</p><p>TIA.</p>","15187","","","","","2009-07-09 14:43:07","Catching file download?","<android>","2","0","","",""
"1103027","1","","","2009-07-09 10:14:26","30","43042","<p>Is it possible to change an application icon directly from the program?<br>I mean, change <code>icon.png</code> in the <code>res\drawable</code> folder.<br>I would like to let users to change application's icon from the program so next time they would see the previously selected icon in the launcher.</p>","130929","","130929","","2010-11-12 11:17:33","2014-01-29 10:28:51","How to change an application icon programmatically in Android?","<android>","6","0","33","",""
"1105141","1","1105157","","2009-07-09 16:50:30","1","6575","<p>I would like to create a table to store device settings. The table has three rows: id, parameter_name and parameter_value.</p><p>The table was created by executing the following query statement:</p><pre><code>DATABASE_CREATE = ""create table DATABASE_TABLE (KEY_ID INTEGER PRIMARY KEY AUTOINCREMENT, KEY_NAME INTEGER not null, VALUE TEXT not null);</code></pre><p>and then the rows are stored by executing the following method:</p><pre><code>private long insertRow(int rowParameter, String rowValue, SQLiteDatabase db){    long res = -1;    ContentValues settingsParameterValues = new ContentValues();    settingsParameterValues.put(KEY_NAME, rowParameter);    settingsParameterValues.put(VALUE, rowValue);    if(db != null){        res = db.insert(DATABASE_TABLE, null, settingsParameterValues);    }    return res;}</code></pre><p>When the database is created the default values are stored:</p><pre><code>@Override    public void onCreate(SQLiteDatabase db) {        db.execSQL(DATABASE_CREATE);        insertRow(PRIVACY_LEVEL_ROW_INDEX, ""0"", db);        insertRow(STREAM_TITLE_ROW_INDEX, ""untitled"", db);        insertRow(STREAM_TAGS_ROW_INDEX, """", db);    }</code></pre><p>The problem with method insertRow() however is that it can't prevent duplicating the entries.</p><p>Does anyone know how to prevent duplicate entries in this case?</p>","22996","","1777090","","2013-01-17 06:08:02","2013-01-17 06:08:02","SQLite: prevent duplicates","<sql><database><android><sqlite>","4","0","1","",""
"1105196","1","1105311","","2009-07-09 17:02:06","26","29529","<p>I'm referring to the camera application that is already installed on my G1, not the camera API source code.</p><p>How do I get the source code?</p>","121196","","418183","","2011-12-12 12:55:44","2013-03-05 12:34:51","Where can I get the Android camera application source code?","<android><camera>","3","0","6","",""
"1105219","1","1106563","","2009-07-09 17:05:35","26","42774","<p>I created a SQLite database on Android device. The program can read/write to database so the database file has obviously been created. The SQLiteDatabase.mPath is set to</p><pre><code>db.mPath = ""/data/data/dev.client.android/databases/clientDB.db""</code></pre><p>but when I browse the directories on the device I can't locate the file clientDB.db. I looked inside data directory  but it appears to be empty.</p><p>Does anyone know what could be wrong here?</p>","22996","","","","","2012-06-22 13:04:47","Android: Where are database files stored?","<database><android><sqlite>","3","0","6","",""
"1106924","1","1109354","","2009-07-09 23:17:10","1","1652","<p>I have Android pet-project DroidIn which utilizes HttpClient 4 (built into Android) to do some form based authentication. I started noticing that people who are using WiFi are reporting connection problems. It also doesn't help that site I'm accessing has self-assigned certificate. Well - the question is (I'm quite vague on WiFi details) If WiFi at the hotspot doesn't support HTTPS would that be a good enough reason for connection to fail and is there anything that I can do beside proxying into another appserver using HTTP which then would call HTTPS site?</p>","135946","","","","","2011-01-24 16:52:12","HTTPS authentication over WiFi using HttpClient 4","<java><android><ssl><https><httpclient>","3","0","0","",""
"1107165","1","","","2009-07-10 00:41:07","4","2508","<p>I am getting a</p><p><code>NullPointerException at android.app.ActivityThread$PackageInfo$ServiceDispatcher.doConnected(ActivityThread.java:1012)</code></p><p>My application is not even in the stack trace, so I have no idea what is going on.</p><p>I am trying to connect to a service when it happens.</p><p>How can I fix this problem?</p>","764272","","768110","","2013-07-15 02:21:17","2013-07-15 02:21:17","Android: NullPointerException at android.app.ActivityThread$PackageInfo$ServiceDispatcher.doConnected(ActivityThread.java:1012)","<android><service><activity><nullpointerexception>","1","1","","",""
"1108170","1","1108357","","2009-07-10 07:24:09","1","8723","<p>I created the following method for retrieving stored settings from the database:</p><pre><code>public String getEntry(long rowIndex){    String value = """";	Cursor c = db.query(DATABASE_TABLE, new String[] {KEY_NAME, VALUE}, KEY_NAME + ""="" + rowIndex, null, null, null, null);	int columnIndex = c.getColumnIndex(VALUE);	int rowsCount = c.getCount();	if(rowsCount &gt; 0){		String value = c.getString(columnIndex);	}	return value;}</code></pre><p>On debugging I can see cursor c contains two columns and one row but when it comes to line</p><pre><code>String value = c.getString(columnIndex);</code></pre><p>it throws the CursorIndexOutOfBoundsException although columnIndex = 1 which should point to a valid entry.</p><p>Does anyone know what could be wrong here?</p>","22996","","","","","2014-03-20 12:27:00","Android: Retrieving data from the database issue","<database><android><sqlite>","3","0","3","",""
"1108820","1","1109010","","2009-07-10 10:30:16","3","10519","<p>I am running on helloword application as getting started with android application developement. but i cant able to see output in android emulator. it will show only android in the emulator screen. and i am just print ""Hello from Brijesh"". but it will not display in the emulator of the android. actually i follow the instruction in the following link.<a href=""http://developer.android.com/guide/tutorials/hello-world.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/hello-world.html</a>but not getting out put.can any one help me out.</p><p>thankx.</p>","134861","","","","","2012-08-22 13:08:42","Android emulator Output","<android>","3","1","1","",""
"1109022","1","1109108","","2009-07-10 11:27:17","947","364662","<p>I have an <code>EditText</code> and a <code>Button</code> in my layout. After writing in the edit field and clicking on the <code>Button</code>, I want to hide the virtual keyboard. I assume that there's a simple, one- or two-liner to make this happen. Where can I find an example of it?</p>","133858","","1961262","","2013-12-19 06:11:00","2014-04-08 09:30:41","Close/hide the Android Soft Keyboard","<android><keyboard><android-softkeyboard><android-keypad><android-input-method>","33","3","327","","2013-10-24 11:01:18"
"1110767","1","","","2009-07-10 17:07:39","0","166","<p>I have an idea in mind where a device such as an iPhone or gPhone is attached to a satellite modem for use when out of GPRS/UMTS range.</p><p>Would such an idea be feasible, and what are the high level steps towards implementation?</p>","38522","","114066","","2012-01-20 13:40:12","2012-01-20 13:40:12","Attaching another modem to an iPhone or gPhone","<android><iphone><modem><satellite>","3","0","","",""
"1111844","1","1113204","","2009-07-10 20:33:33","4","7865","<p>The browser does this by calling <code>public void emulateShiftHeld()</code> method on the WebView which is hidden in the SDK.<br>Any other options?</p>","15187","","142162","","2011-09-24 12:55:11","2011-09-24 12:55:11","Selecting text in a WebView?","<android>","2","2","3","",""
"1111980","1","1116717","","2009-07-10 21:05:09","325","155246","<p>My program does some network activity in a background thread. Before starting, it pops up a progress dialog. The dialog is dismissed on the handler. This all works fine, except when screen orientation changes while the dialog is up (and the background thread is going). At this point the app either crashes, or deadlocks, or gets into a weird stage where the app does not work at all until all the threads have been killed.</p><p>How can I handle the screen orientation change gracefully?</p><p>The sample code below matches roughly what my real program does:</p><pre><code>public class MyAct extends Activity implements Runnable {    public ProgressDialog mProgress;    // UI has a button that when pressed calls send    public void send() {         mProgress = ProgressDialog.show(this, ""Please wait"",                       ""Please wait"",                       true, true);        Thread thread = new Thread(this);        thread.start();    }    public void run() {        Thread.sleep(10000);        Message msg = new Message();        mHandler.sendMessage(msg);    }    private final Handler mHandler = new Handler() {        @Override        public void handleMessage(Message msg) {            mProgress.dismiss();        }    };}</code></pre><p>Stack:</p><pre><code>E/WindowManager(  244): Activity MyAct has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@433b7150 that was originally added hereE/WindowManager(  244): android.view.WindowLeaked: Activity MyAct has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@433b7150 that was originally added hereE/WindowManager(  244):     at android.view.ViewRoot.&lt;init&gt;(ViewRoot.java:178)E/WindowManager(  244):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:147)E/WindowManager(  244):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:90)E/WindowManager(  244):     at android.view.Window$LocalWindowManager.addView(Window.java:393)E/WindowManager(  244):     at android.app.Dialog.show(Dialog.java:212)E/WindowManager(  244):     at android.app.ProgressDialog.show(ProgressDialog.java:103)E/WindowManager(  244):     at android.app.ProgressDialog.show(ProgressDialog.java:91)E/WindowManager(  244):     at MyAct.send(MyAct.java:294)E/WindowManager(  244):     at MyAct$4.onClick(MyAct.java:174)E/WindowManager(  244):     at android.view.View.performClick(View.java:2129)E/WindowManager(  244):     at android.view.View.onTouchEvent(View.java:3543)E/WindowManager(  244):     at android.widget.TextView.onTouchEvent(TextView.java:4664)E/WindowManager(  244):     at android.view.View.dispatchTouchEvent(View.java:3198)</code></pre><p>I have tried to dismiss the progress dialog in onSaveInstanceState, but that just prevents an immediate crash. The background thread is still going, and the UI is in partially drawn state. Need to kill the whole app before it starts working again.</p>","62596","","844882","","2014-01-15 20:16:27","2014-01-16 03:38:08","How to handle screen orientation change when progress dialog and background thread active?","<android><android-activity><android-dialog>","19","4","199","",""
"1112068","1","2800113","","2009-07-10 21:25:51","1","1360","<p>How to implement scrolling animation?I'm ok with setting a simple AlphaAnimation that triggers at scrollTo(...) but what kind of animation is required for one screen to replace another in a sophisticated manner?</p>","15187","","","","","2010-05-10 03:14:49","Animating View.scrollTo(...)","<android>","1","1","","",""
"1112206","1","","","2009-07-10 22:01:05","0","10039","<p>I'm designing a game for Android and I would like to use the accelerometer for some aspects of control.  Has anyone come across a tutorial or example for something like this?</p>","16476","","3330969","","2014-03-20 02:56:09","2014-03-20 02:56:09","Android Accelerometer For Gaming","<android><accelerometer>","2","1","2","",""
"1113088","1","7168399","","2009-07-11 06:28:13","60","99586","<p>When I am trying to run an android application which uses Google API I get the following error</p><blockquote>  <p>[2009-07-11 11:46:43 - FirstMapView] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY<br>  [2009-07-11 11:46:43 - FirstMapView] Please check logcat output for more details.<br>  [2009-07-11 11:46:44 - FirstMapView] Launch canceled!</p></blockquote><p>Can anyone help me solve this error?</p>","134861","","497043","","2013-07-23 23:59:53","2014-02-17 22:09:08","INSTALL_FAILED_MISSING_SHARED_LIBRARY error in Android","<android><google-maps><shared-libraries><failed-installation>","9","0","17","",""
"1113606","1","1115998","","2009-07-11 12:21:28","3","2118","<p>I just basically want to add about 20 and sometimes 80 Proximity Alerts with no time expiration with a radius of around 500 meters. Just wondering whether by doing this will suck up the battery real quick? also would it make any difference by reducing the radius?</p>","129688","","129688","","2009-07-21 12:17:40","2010-03-06 07:49:53","Does anyone know whether the Android addProximityAlert on the LocationManager is battery intensive","<android><location><manager><battery><android-1.5-cupcake>","1","0","4","",""
"1113657","1","1114987","","2009-07-11 12:53:15","3","515","<p>Hi I am trying to show map in the android emulator. but it cant display google map in the map view. and also not connect www.google.com from browser on android emulator.so is there any settings regarding to run internet on emulator.can anyone help me out from this problem.</p>","134861","","134861","","2013-03-06 11:42:16","2013-03-06 11:42:16","Google Map View can not display on emulator","<android><google-maps><browser>","1","2","1","",""
"1114052","1","","","2009-07-11 16:25:06","11","10998","<p>I want to import contacts from my gmail account on android emulator in the same way you can do it on <code>T-Mobile G1 phone</code>. </p><p>Is it possible?</p><p>[I have this question too: <a href=""http://stackoverflow.com/users/243782/pentium10"">pentium10</a>]<br><strong>I am wondering if there is a way to do all this?</strong></p>","39726","","750613","","2012-07-05 04:06:15","2013-12-19 14:06:14","Importing gmail contacts on android emulator","<android><gmail><emulator>","4","2","7","",""
"1114199","1","1114281","","2009-07-11 17:20:33","4","6657","<p>I am trying to set up an Android emulator to do some playing around with OpenGL ES on it, but I am stymied by the fact that, every time I run my program on it, it unceremoniously grenades itself. The problem (at least the first nasty red error line in the log) is a missing package called libhgl.so. This is the OpenGL driver file required for running OpenGL ES on Android devices, but for some reason, my emulator doesn't have it. Does anyone know where I can get drivers for the emulator, or how to get an emulator that already has them?</p>","136790","","136790","","2012-09-26 18:24:53","2012-09-26 18:24:53","Missing OpenGL drivers on Android emulator","<android><opengl-es>","1","0","","",""
"1114270","1","1114330","","2009-07-11 17:47:51","8","12747","<p>I know its possible to use a  wakelock to hold the screen, cpu, ect on but how can I programmatically change the ""<strong>Screen Timeout</strong>"" setting on an Android phone.</p>","122547","","750613","","2012-07-05 04:05:12","2013-11-24 16:13:45","Android Screen Timeout","<java><android><android-1.5-cupcake>","4","0","5","",""
"1115413","1","1115855","","2009-07-12 06:27:19","29","14796","<p>What are the differences developers should be aware of?</p>","15187","","53498","","2009-07-12 20:38:23","2013-09-03 09:08:44","Android Emulator vs Real Device","<android>","7","0","18","",""
"1116637","1","","","2009-07-12 18:43:32","2","1106","<p>I am trying to set my application what will be a tool to edit pictures, to the menu in the gallery app of the android phone. I know it should go with the intent-filter but I can not get it to work. </p><pre><code>        &lt;activity android:name="".Compass"" android:label=""@string/main_compass_tool_button""&gt;        &lt;intent-filter android:label= ""@string/main_compass_tool_button""&gt;            &lt;action android:name=""android.intent.action.SHARE""/&gt;            &lt;data android:mimeType=""image/*""/&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre>","","Oliver ","3330969","","2014-03-20 03:01:17","2014-03-20 03:01:17","Adding My App to The Gallery App menu","<android><intentfilter><android-gallery>","1","1","2","",""
"1117641","1","","","2009-07-13 03:58:04","6","33015","<p>Can anyone show me how to make a <code>tab widget</code> in Android?</p>","132724","","750613","","2012-07-05 04:04:21","2013-11-08 13:29:52","How to use a tab widget in Android?","<android>","4","1","3","",""
"1117960","1","","","2009-07-13 06:36:49","0","1540","<p>I am creating simple application in Android and i want to change the focus color.That my application consist of two text box. When moving focus to the textbox,i can get the focus of textbox with the orange color. is it possible to change the color ? If it is possible please tell me how to do it ?</p>","132724","","3330969","","2014-03-20 03:02:43","2014-03-20 03:02:43","How to change the focusable color?","<android>","1","0","","",""
"1118447","1","","","2009-07-13 09:21:31","11","9654","<p>(<strong>Solved - see comment below</strong>)</p><p>I have a class that implements a multipart file upload. The code works on every java client I've tried it on except for Android, and it's the only HTTP request code in my Android app that doesn't play nice with my back end service. </p><p>The connection responseCode is ""-1"" so something pretty nasty is going on here. No entries show up in the Apache access or error logs, it seems as if the request is never making it off of the android platform. The code gets right through the connection writes, but hangs on the connection read, times out and then returns. Behavior is same for real phone and emulator.</p><p>Does anyone know of any gotchas one needs to look out for when posting a multipart file in Android? </p><p>I'm including the class below (minor hygienic mods made) so you can see what I'm up to</p><pre><code>import java.io.ByteArrayOutputStream;import java.io.DataOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.IOException;import java.io.InputStream;import java.net.HttpURLConnection;import java.net.MalformedURLException;import java.net.URL;public class GeoPictureUploader{    static String serviceDomain = ""http://staging.abaqus.net"";    static String postUrl = serviceDomain + ""/geo/upl/wupload/pictures"";    static String CRLF = ""\r\n"";     static String twoHyphens = ""--"";     static String boundary = ""*****mgd*****"";     private String pictureFileName = null;    private String name = null;    private String password = null;    private DataOutputStream dataStream = null;    enum ReturnCode { noPicture, unknown, http201, http400, http401, http403, http404, http500};    public GeoPictureUploader(String name, String password)     {        this.name = name;        this.password = password;    }    public static void setServiceDomain(String domainName)    {        serviceDomain = domainName;    }    public static String getServiceDomain()    {        return serviceDomain;    }    public ReturnCode uploadPicture(String pictureFileName)    {        this.pictureFileName = pictureFileName;        File uploadFile = new File(pictureFileName);         if (uploadFile.exists())            try             {                 FileInputStream fileInputStream = new FileInputStream(uploadFile);                 URL connectURL = new URL(postUrl);                HttpURLConnection conn = (HttpURLConnection)connectURL.openConnection();                 conn.setDoInput(true);                 conn.setDoOutput(true);                 conn.setUseCaches(false);                 conn.setRequestMethod(""POST"");                 conn.setRequestProperty(""User-Agent"", ""myGeodiary-V1"");                conn.setRequestProperty(""Connection"",""Keep-Alive"");                 conn.setRequestProperty(""Content-Type"",""multipart/form-data;boundary=""+boundary);                 conn.connect();                dataStream = new DataOutputStream(conn.getOutputStream());                 writeFormField(""login"", name);                writeFormField(""password"", password);                writeFileField(""photo1"", pictureFileName, ""image/jpg"", fileInputStream);                // final closing boundary line                dataStream.writeBytes(twoHyphens + boundary + twoHyphens + CRLF);                 fileInputStream.close();                 dataStream.flush();                 dataStream.close();                dataStream = null;                String response = getResponse(conn);                int responseCode = conn.getResponseCode();                if (response.contains(""uploaded successfully""))                    return ReturnCode.http201;                else                     // for now assume bad name/password                    return ReturnCode.http401;             }             catch (MalformedURLException mue) {                 // Log.e(Tag, ""error: "" + mue.getMessage(), mue);                 System.out.println(""GeoPictureUploader.uploadPicture: Malformed URL: "" + mue.getMessage());                return ReturnCode.http400;            }             catch (IOException ioe) {                 // Log.e(Tag, ""error: "" + ioe.getMessage(), ioe);                 System.out.println(""GeoPictureUploader.uploadPicture: IOE: "" + ioe.getMessage());                return ReturnCode.http500;            }             catch (Exception e) {                 // Log.e(Tag, ""error: "" + ioe.getMessage(), ioe);                 System.out.println(""GeoPictureUploader.uploadPicture: unknown: "" + e.getMessage());                return ReturnCode.unknown;            }         else         {            return ReturnCode.noPicture;          }    }    /**     * @param conn     * @return     */    private String getResponse(HttpURLConnection conn)    {        try         {            DataInputStream dis = new DataInputStream(conn.getInputStream());             byte []        data = new byte[1024];            int             len = dis.read(data, 0, 1024);            dis.close();            int responseCode = conn.getResponseCode();            if (len &gt; 0)                return new String(data, 0, len);            else                return """";        }        catch(Exception e)        {            System.out.println(""GeoPictureUploader: biffed it getting HTTPResponse"");            //Log.e(TAG, ""GeoPictureUploader: biffed it getting HTTPResponse"");            return """";        }    }    /**     *  this mode of reading response no good either     */    private String getResponseOrig(HttpURLConnection conn)    {        InputStream is = null;        try         {            is = conn.getInputStream();             // scoop up the reply from the server            int ch;             StringBuffer sb = new StringBuffer();             while( ( ch = is.read() ) != -1 ) {                 sb.append( (char)ch );             }             return sb.toString();   // TODO Auto-generated method stub        }        catch(Exception e)        {            System.out.println(""GeoPictureUploader: biffed it getting HTTPResponse"");            //Log.e(TAG, ""GeoPictureUploader: biffed it getting HTTPResponse"");        }        finally         {            try {            if (is != null)                is.close();            } catch (Exception e) {}        }        return """";    }    /**     * write one form field to dataSream     * @param fieldName     * @param fieldValue     */    private void writeFormField(String fieldName, String fieldValue)    {        try        {            dataStream.writeBytes(twoHyphens + boundary + CRLF);                dataStream.writeBytes(""Content-Disposition: form-data; name=\"""" + fieldName + ""\"""" + CRLF);            dataStream.writeBytes(CRLF);            dataStream.writeBytes(fieldValue);            dataStream.writeBytes(CRLF);        }        catch(Exception e)        {            System.out.println(""GeoPictureUploader.writeFormField: got: "" + e.getMessage());            //Log.e(TAG, ""GeoPictureUploader.writeFormField: got: "" + e.getMessage());        }    }    /**     * write one file field to dataSream     * @param fieldName - name of file field     * @param fieldValue - file name     * @param type - mime type     * @param fileInputStream - stream of bytes that get sent up     */    private void writeFileField(        String fieldName,        String fieldValue,        String type,        FileInputStream fis)    {        try        {            // opening boundary line            dataStream.writeBytes(twoHyphens + boundary + CRLF);                dataStream.writeBytes(""Content-Disposition: form-data; name=\""""                                  + fieldName                                  + ""\"";filename=\""""                                   + fieldValue                                  + ""\""""                                   + CRLF);            dataStream.writeBytes(""Content-Type: "" + type +  CRLF);            dataStream.writeBytes(CRLF);             // create a buffer of maximum size             int bytesAvailable = fis.available();             int maxBufferSize = 1024;             int bufferSize = Math.min(bytesAvailable, maxBufferSize);             byte[] buffer = new byte[bufferSize];             // read file and write it into form...             int bytesRead = fis.read(buffer, 0, bufferSize);             while (bytesRead &gt; 0)             {                 dataStream.write(buffer, 0, bufferSize);                 bytesAvailable = fis.available();                 bufferSize = Math.min(bytesAvailable, maxBufferSize);                 bytesRead = fis.read(buffer, 0, bufferSize);             }             // closing CRLF            dataStream.writeBytes(CRLF);        }        catch(Exception e)        {            System.out.println(""GeoPictureUploader.writeFormField: got: "" + e.getMessage());            //Log.e(TAG, ""GeoPictureUploader.writeFormField: got: "" + e.getMessage());        }    }    /**     * @param args     */    public static void main(String[] args)    {        if (args.length &gt;= 0)        {            GeoPictureUploader gpu = new GeoPictureUploader(""john"", ""notmyrealpassword"");            String picName = args[0];            ReturnCode rc = gpu.uploadPicture(picName);            System.out.printf(""done"");        }    }}</code></pre>","14555","","750613","","2012-07-05 04:03:58","2012-07-05 04:21:36","HttpURLConnection fail on Android","<android><http><httpurlconnection>","2","2","7","",""
"1119583","1","1121336","","2009-07-13 13:55:52","60","55904","<p>I just basically want to switch to the number pad mode as soon a certain EditText has the focus.</p>","129688","","3330969","","2014-03-20 03:12:19","2014-03-20 14:38:46","How do I show the number keyboard on an EditText in android?","<android><keyboard><android-edittext>","8","1","7","",""
"1119802","1","1119979","","2009-07-13 14:32:28","2","2330","<p>I created the SQLite database the following way:</p><pre><code>private static final String DATABASE_CREATE = ""create table "" + DATABASE_TABLE_SETTINGS + "" ("" +KEY_ID + "" INTEGER PRIMARY KEY AUTOINCREMENT, "" +KEY_NAME + "" INTEGER UNIQUE not null, "" +VALUE + "" TEXT not null);"" + ""create table "" + DATABASE_TABLE_RECORDINGS + "" ("" +KEY_ID + "" INTEGER PRIMARY KEY AUTOINCREMENT, "" +RECORDING_FILENAME + "" TEXT UNIQUE NOT NULL, "" +RECORDING_TITLE + "" TEXT NOT NULL, "" +RECORDING_TAGS + "" TEXT, "" +RECORDING_LOCATION + "" TEXT, "" +RECORDING_TIME + "" TEXT);"";@Override    public void onCreate(SQLiteDatabase db) {        db.execSQL(DATABASE_CREATE);...}</code></pre><p>I try to store a new entry by calling the following method:</p><pre><code>public long insertRecordingInfo(String filename, String title, String tags, int privacyLevel, String location, String recordingTime){    long res = -1;    ContentValues recordingInfoParameters = new ContentValues();    recordingInfoParameters.put(RECORDING_FILENAME, filename);    recordingInfoParameters.put(RECORDING_TITLE, title);    recordingInfoParameters.put(RECORDING_TAGS, tags);    recordingInfoParameters.put(RECORDING_PRIVACY_LEVEL, privacyLevel);    recordingInfoParameters.put(RECORDING_LOCATION, location);    recordingInfoParameters.put(RECORDING_TIME, recordingTime);    if(db != null){        res = db.insert(DATABASE_TABLE_RECORDINGS, null, recordingInfoParameters);    }    return res;}</code></pre><p>but the db.insert() returns -1 (it doesn't store a new entry) and it returns an IllegalStateException:</p><pre><code>java.lang.IllegalStateException: /data/data/dev.client.android/databases/clientDB.db SQLiteDatabase created and never closed</code></pre><p>Does anyone know what's wrong here and how it could be fixed?</p>","22996","","1777090","","2013-01-17 05:54:10","2013-01-17 05:54:10","Android database: IllegalStateException issue","<database><android><sqlite>","1","0","","",""
"1120247","1","","","2009-07-13 15:40:52","2","1936","<p>I put an ImageView and a TextView within a RelativeLayout that is used as list items, and want the ImageView to grow vertically with the line number of TextView. The drawable of the ImageView is a png picture of vertical bar.</p><p>With the following layout, thought it looks fine in the Layout view in Eclipse, the ImageView does not fill the height of the RelativeView at runtime. Instead, it alway keeps the original picture's height.</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent"" &gt;   &lt;ImageView android:id=""@+id/iv""       android:layout_width=""wrap_content""       android:layout_height=""fill_parent""       android:layout_alignParentLeft=""true""       android:src=""@drawable/vbar""       android:adjustViewBounds=""false""       android:scaleType=""fitXY""/&gt;   &lt;TextView       android:layout_width=""wrap_content""       android:layout_height=""wrap_content""       android:singleLine=""false""       android:layout_toRightOf=""@id/iv""       android:layout_alignParentBottom=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Why does it not work as I expect(or as shown in Eclipse Layout view)?</p>","56149","","","","","2013-01-08 11:59:17","How to make ImageView fill vertically within RelativeLayout","<android>","2","1","5","",""
"1120297","1","","","2009-07-13 15:48:50","4","244","<p>I am interested in developing things for google apps and android using python and java. I am new to both and was wondering if a environment set in <code>windows</code> or <code>linux</code> would be more productive for these tasks?</p>","137521","","750613","","2012-07-05 04:02:42","2012-07-05 04:02:42","Platform for developing all things google?","<java><python><android><platform>","3","2","2","",""
"1121192","1","1562832","","2009-07-13 18:22:07","82","57099","<p>So I have a custom ListView object. The list items have two textviews stacked on top of each other, plus a horizontal progress bar that I want to remain hidden until I actually do something. To the far right is a checkbox that I only want to display when the user needs to download updates to their database(s). When I disable the checkbox by setting the visibility to Visibility.GONE, I am able to click on the list items. When the checkbox is visible, I am unable to click on anything in the list except the checkboxes. I've done some searching but haven't found anything relevant to my current situation. I found <a href=""http://stackoverflow.com/questions/895341/custom-list-clicking-with-checkboxes-in-android"">this question</a> but I'm using an overridden ArrayAdapter since I'm using ArrayLists to contain the list of databases internally. Do I just need to get the LinearLayout view and add an onClickListener like Tom did? I'm not sure.</p><p>Here's the listview row layout XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""?android:attr/listPreferredItemHeight""    android:padding=""6dip""&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""0dip""        android:layout_weight=""1""        android:layout_height=""fill_parent""&gt;        &lt;TextView            android:id=""@+id/UpdateNameText""            android:layout_width=""wrap_content""            android:layout_height=""0dip""            android:layout_weight=""1""            android:textSize=""18sp""            android:gravity=""center_vertical""            /&gt;        &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""0dip""            android:layout_weight=""1""            android:id=""@+id/UpdateStatusText""            android:singleLine=""true""            android:ellipsize=""marquee""            /&gt;        &lt;ProgressBar android:id=""@+id/UpdateProgress""                      android:layout_width=""fill_parent""                      android:layout_height=""wrap_content""                     android:indeterminateOnly=""false""                      android:progressDrawable=""@android:drawable/progress_horizontal""                      android:indeterminateDrawable=""@android:drawable/progress_indeterminate_horizontal""                      android:minHeight=""10dip""                      android:maxHeight=""10dip""                                         /&gt;    &lt;/LinearLayout&gt;    &lt;CheckBox android:text=""""               android:id=""@+id/UpdateCheckBox""               android:layout_width=""wrap_content""               android:layout_height=""wrap_content""               /&gt;&lt;/LinearLayout&gt;</code></pre><p>And here's the class that extends the ListActivity. Obviously it's still in development so forgive the things that are missing or might be left laying around:</p><pre><code>public class UpdateActivity extends ListActivity {    AccountManager lookupDb;    boolean allSelected;    UpdateListAdapter list;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        lookupDb = new AccountManager(this);        lookupDb.loadUpdates();        setContentView(R.layout.update);        allSelected = false;        list = new UpdateListAdapter(this, R.layout.update_row, lookupDb.getUpdateItems());        setListAdapter(list);        Button btnEnterRegCode = (Button)findViewById(R.id.btnUpdateRegister);        btnEnterRegCode.setVisibility(View.GONE);        Button btnSelectAll = (Button)findViewById(R.id.btnSelectAll);        btnSelectAll.setOnClickListener(new Button.OnClickListener() {            @Override            public void onClick(View v) {                allSelected = !allSelected;                for(int i=0; i &lt; lookupDb.getUpdateItems().size(); i++) {                    lookupDb.getUpdateItem(i).setSelected(!lookupDb.getUpdateItem(i).isSelected());                }                list.notifyDataSetChanged();                // loop through each UpdateItem and set the selected attribute to the inverse             } // end onClick        }); // end setOnClickListener        Button btnUpdate = (Button)findViewById(R.id.btnUpdate);        btnUpdate.setOnClickListener(new Button.OnClickListener() {            @Override            public void onClick(View v) {            } // end onClick        }); // end setOnClickListener        lookupDb.close();    } // end onCreate    @Override    protected void onDestroy() {        super.onDestroy();        for (UpdateItem item : lookupDb.getUpdateItems()) {            item.getDatabase().close();                }    }    @Override    protected void onListItemClick(ListView l, View v, int position, long id) {        super.onListItemClick(l, v, position, id);        UpdateItem item = lookupDb.getUpdateItem(position);        if (item != null) {            item.setSelected(!item.isSelected());            list.notifyDataSetChanged();        }    }    private class UpdateListAdapter extends ArrayAdapter&lt;UpdateItem&gt; {        private List&lt;UpdateItem&gt; items;        public UpdateListAdapter(Context context, int textViewResourceId, List&lt;UpdateItem&gt; items) {            super(context, textViewResourceId, items);            this.items = items;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            View row = null;            if (convertView == null) {                LayoutInflater li = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                row = li.inflate(R.layout.update_row, null);            } else {                row = convertView;            }            UpdateItem item = items.get(position);            if (item != null) {                TextView upper = (TextView)row.findViewById(R.id.UpdateNameText);                TextView lower = (TextView)row.findViewById(R.id.UpdateStatusText);                CheckBox cb = (CheckBox)row.findViewById(R.id.UpdateCheckBox);                upper.setText(item.getName());                lower.setText(item.getStatusText());                if (item.getStatusCode() == UpdateItem.UP_TO_DATE) {                    cb.setVisibility(View.GONE);                } else {                    cb.setVisibility(View.VISIBLE);                    cb.setChecked(item.isSelected());                }                ProgressBar pb = (ProgressBar)row.findViewById(R.id.UpdateProgress);                pb.setVisibility(View.GONE);            }            return row;        }    } // end inner class UpdateListAdapter}</code></pre><p>edit: I'm still having this problem. I'm cheating and adding onClick handlers to the textviews but it seems extremely stupid that my onListItemClick() funtion is not being called at all when I am not clicking on my checkbox.</p>","21126","","533552","","2012-01-20 18:09:34","2013-10-01 09:59:36","Android custom ListView unable to click on items","<java><android>","3","0","38","",""
"1121329","1","1122836","","2009-07-13 18:44:49","4","5479","<p>I created a Twitter app I need user of my Android application to authorize its use. I'm at the point where I can call Twitter app page in the browser and successfully authorize. However, the callback seem not to be working, I end up with the confirmation message and PIN in the browser but my Android activity is never called (onResume is not triggered).Here's what I have</p><ol><li>Twitter URL: <a href=""http://twitter.com/oauth/authorize?oauth_token=actualtokenhere&amp;oauth_callback=myapp:///"" rel=""nofollow"">http://twitter.com/oauth/authorize?oauth_token=actualtokenhere&amp;oauth_callback=myapp:///</a></li><li><p>In my activity definition I have this intent-filter </p><pre><code>        &lt;intent-filter&gt;		&lt;action android:name=""android.intent.action.VIEW"" /&gt;		&lt;category android:name=""android.intent.category.DEFAULT"" /&gt;		&lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;	    &lt;data android:scheme=""myapp"" /&gt;    &lt;/intent-filter&gt;</code></pre></li><li><p>As I stated - I get confirmation but not redirect so the Android app is never called back</p></li></ol>","135946","","135946","","2009-07-13 22:25:51","2010-10-01 07:18:12","oauth_callback on Android","<android><twitter><oauth>","1","0","4","",""
"1122570","1","","","2009-07-13 23:00:09","6","2172","<p>I want to control the LED on an Android device with more control than is offered by the Notification class.  Notifications allow you to change the rate of flashing; e.g. 300 milliseconds on, 1000 milliseconds off, but that's it.</p><p>Essentially, I would like to turn the LED on and off at will at arbitrary times. Does anyone know if this is possible? The API does not seem to say so. Does it depend on the specific hardware?  </p>","31351","","584405","","2011-11-28 12:06:41","2012-06-25 11:28:58","Can the Android handset LED be manipulated without using a Notification object?","<android><notifications><hardware><mobile-phones><led>","2","0","1","",""
"1122679","1","1122764","","2009-07-13 23:28:33","18","28288","<p>Not sure if I'm the only one who feels this... </p><p>I find working with the sqlite api in android a complete pain in the butt and pretty soul destroying. Has anyone got any tips/helpers to make my life easier?</p><p>Here's an example of what I'm talking about.</p><pre><code>//create codedb.execSQL(""CREATE TABLE "" + CUSTOMER_TABLE_NAME + "" (""                        + GENERIC_ID_KEY+ "" INTEGER PRIMARY KEY NOT NULL, ""                         + PHONE_KEY + "" INTEGER NOT NULL, ""                        + CUSTOMER_NAME_KEY+ "" TEXT NOT NULL, ""                        + EMAIL_KEY + "" TEXT NOT NULL, ""                        + ADDRESS_KEY +"" TEXT);"");//get code    Cursor mCursor = mDb.query(true, CUSTOMER_TABLE_NAME, new String[] {GENERIC_ID_KEY,                        ADDRESS_KEY, PHONE_KEY, EMAIL_KEY,CUSTOMER_NAME_KEY}, GENERIC_ID_KEY + ""="" + customerDbId, null,                                null, null, null, null);        Customer customer = new Customer (customerDbId, (CharSequence)mCursor.getString(mCursor.getColumnIndexOrThrow(CUSTOMER_NAME_KEY)),                            (CharSequence)mCursor.getString(mCursor.getColumnIndexOrThrow(PHONE_KEY)),                            (CharSequence)mCursor.getString(mCursor.getColumnIndexOrThrow(EMAIL_KEY)),                            (CharSequence)mCursor.getString(mCursor.getColumnIndexOrThrow(ADDRESS_KEY)));</code></pre><p>This a simple exmple of creating a simple customer object from a db query; some of my code is far nastier than this. Hand crafting queries in this way leads to all sort of errors I don't find until runtime.</p><p>Any tips greatly appreiciated!</p><p>Ok after the tips below I now have this:</p><pre><code>  db.execSQL(""CREATE TABLE customer (_id INTEGER PRIMARY KEY NOT NULL, ""                         + ""phone_number INTEGER NOT NULL, ""                        + ""name TEXT NOT NULL, ""                        + ""email TEXT NOT NULL, ""                        + ""address TEXT);"");    //get codeString q = ""SELECT * FROM customer WHERE _id = "" + customerDbId +"";""        Cursor mCursor = mDb.rawQuery(q, null);        Customer customer = new Customer (mCursor);</code></pre><p>in the Customer, I access the fields like this</p><pre><code>mName = cursor.getString(2)</code></pre><p>Ahh, I feel much better :)</p><p>CheersSi</p>","119203","","236247","","2011-06-28 13:36:30","2011-06-28 13:36:30","Querying and working with Cursors in SQLite on Android","<android><sqlite>","2","2","23","",""
"1122768","1","","","2009-07-14 00:01:21","4","2765","<p>I need to detect when the android software keyboard is hidden. My activity currently responds to when the hardware keyboard is hidden but the software keyboard looks like it can only be implied through a size changed event.</p><p>Does anyone know of a way that a view or activity can receive a notification when the software keyboard is hidden by the user cancelling out of keyboard mode?</p>","103345","","3330969","","2014-03-20 03:19:18","2014-03-20 03:19:18","How to detect when Android software keyboard is hidden?","<java><android><android-keypad>","3","1","1","",""
"1123971","1","1124054","","2009-07-14 07:32:07","11","9161","<p>I'm facing a head-scratching moment similar to what <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/cdae98b7832b4754/567ffa7107a73f70"" rel=""nofollow"">this person</a> (from Jan 2008) experienced when I realized that there is no cancel button in Android's progress dialog or spinners. It is now July 2009 and I've just installed the cupcake version of Android. Has this thing changed? If not, are you adding a cancel button into the dialogs and how do you do it?</p>","27328","","250259","","2011-12-07 02:03:33","2012-12-06 11:13:15","Why is there no cancel button in Android's progress dialogs?","<java><android><user-interface>","5","0","3","",""
"1124548","1","1124988","","2009-07-14 10:24:51","26","30688","<p>How do I pass a value from one screen to its previous screen?</p><p>Consider this case: I have two activities. The first screen has one <code>TextView</code> and a button and the second activity has one <code>EditText</code> and a button. </p><p>If I click the first button then it has to move to second activity and here user has to type something in the text box. If he presses the button from the second screen then the values from the text box should move to the first activity and that should be displayed in the first activity <code>TextView</code>.</p>","132724","","984393","","2012-08-07 13:49:21","2013-06-25 20:15:58","How to pass the values from one activity to previous activity","<android><android-activity>","5","0","27","",""
"1124979","1","","","2009-07-14 12:12:13","0","712","<p>I want to know optimization techniques for databases that has nearly 80,000 records,list of possibilities for optimizing </p><p>i am using for my mobile project in android platform i use sqlite,i takes lot of time to retreive the data</p><p>Thanks</p>","138030","","30461","Diago","2009-11-09 05:52:04","2009-11-09 05:52:04","Sql optimization Techniques","<sql><android><sqlite>","8","4","","",""
"1126228","1","1126370","","2009-07-14 15:35:45","4","1762","<p>I was just wondering if anyone had any success in getting <code>XMLBeans</code> (or any other generator) to work on android. It would be very nice if I could use it because I have a very large schema that I would rather not write all the classes by hand.</p><p>I had asked about this on the android developers mailing list, but no one responded. This tells me that either they don't care, or no one feels like telling me its not possible.</p><p>If anyone knows of anything else like <code>XMLBeans</code> that works for android, please let me know. It would be very helpful.</p><p>Thanks,Robbie</p>","138145","","750613","","2012-07-05 04:01:27","2012-11-01 06:29:02","Using XMLBeans on Android","<java><xml><android><xmlbeans>","3","0","3","",""
"1126555","1","1126860","","2009-07-14 16:30:02","2","174","<p>recently I have had to program some applications that require large amounts of timed tasks to occur.  However, I'm afraid to create so many timers because I haven't been able to figure out how they are handled by Java.  Is there a problem with starting large quantities of scheduled tasks?  If so, what is the better alternative?</p>","113946","","","","","2009-07-14 17:31:48","What is the system effect of starting large quantities of timers in Java?","<java><android><multithreading><timer>","2","1","","",""
"1126625","1","1128301","","2009-07-14 16:42:19","2","4826","<p>Can you please tell me how can i query the number of unread SMS in android programmically?</p><p>How can I implement the SMS unread count like <a href=""http://android.kanokgems.com/sms-unread-count/"" rel=""nofollow"">this</a> link:</p>","125440","","1777090","","2013-01-17 06:28:00","2013-01-17 06:28:00","How can I query the number of unread SMS in android","<android><sms>","2","1","2","2013-10-10 13:17:36",""
"1126903","1","1128363","","2009-07-14 17:40:08","3","5035","<p>I was wondering if anyone knew anything about programmatically getting the sms messages off of your phone's sim card on an android platform. I would like to write a program that allows you to save either individual messages or entire threads to the sd card, but after looking around for a bit, I have discovered that google decided to take out that api from the current android sdk. I saw in a few places that there are hidden apis for this, but no one knew what they were or how to use them.</p>","138145","","225647","","2012-10-29 20:42:40","2013-05-26 03:31:34","Retrieving the SMS Messages from the SIM card on with android","<java><android><sms>","3","0","3","",""
"1127757","1","1128276","","2009-07-14 20:17:41","5","6110","<p>how do I use <code>html</code> in an android widget Button?</p>","121196","","750613","","2012-07-05 04:00:50","2012-07-05 04:00:50","android button text and html","<android><html><button>","3","0","","",""
"1129644","1","","","2009-07-15 06:03:42","8","12642","<p>I am creating android application which contains DB that needs to be <code>hidden</code>(not able to access by the user)in the sd card. Can anyone tell me how to do this?</p>","138501","","3330969","","2014-03-20 03:22:30","2014-03-20 03:22:30","How to make a file hidden in android sd card?","<android><android-sdcard>","4","0","","",""
"1129996","1","1130022","","2009-07-15 07:50:21","8","11831","<p>Suppose I have a string like this:</p><pre><code>string = ""Manoj Kumar Kashyap"";</code></pre><p>Now I want to create a regular expression to match where Ka appears after space and also want to get index of matching characters.</p><p>I am using java language.</p>","83905","","15825","","2010-03-30 13:14:51","2010-03-30 13:14:51","How do I create a regular expression for this in android?","<java><android><regex>","3","0","1","",""
"1131412","1","1137371","","2009-07-15 13:29:43","0","1701","<p>when i am trying to run my android application at that time"" <code>The application has stopped unexpactadly,Please try again</code>"" and force to close application.it comes every time.can anyone try to solve this issue?thanks</p>","134861","","750613","","2012-07-05 03:59:50","2012-07-05 03:59:50","Android emulator Output","<android>","4","1","","",""
"1132734","1","1135948","","2009-07-15 17:17:43","2","5614","<p>I need to display a time duration on a few of my Activities within the application. The timer starts when one of the Activity starts.   </p><ul><li>Should I use service for the timer ?</li><li>Is this the best way ?  </li><li>Or should I start thread from one of the Activity ?</li></ul>","121196","","3330969","","2014-03-20 03:24:59","2014-03-20 03:24:59","How to display timer in activity?","<android><timer><android-activity>","2","1","","",""
"1134825","1","2959760","","2009-07-16 00:25:27","23","7900","<p>Android has a nice way of defining stretchable images called a nine-patch.  See <a href=""http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch"">these docs</a> for a description of the concept.  The idea is to surround a png image with a 1-pixel border where you can define the stretchable areas and the padding dimensions of the image.  This is absolutely brilliant and I'd like to use the idea in my iPhone app.  Before writing my own nine-patch to UIImage loader I thought I'd see if one already exists.  Google doesn't return any results so I don't have much hope, but it doesn't hurt to ask, right?  :-)</p><p><strong>EDIT:</strong> Folks, I appreciate the answers but I know about <code>stretchableImageWithLeftCapWidth...</code>.  I'm looking for code that takes a path <code>@""foo.9.png""</code> and returns a stretchable <code>UIImage</code>.  This code will undoubtedly use <code>stretchableImageWithLeftCapWidth...</code> internally.  I'm sure I could write the code myself using that method.  But I'm asking if somebody else has already done it.</p>","103934","","750613","","2012-07-05 03:58:43","2012-07-05 03:58:43","Is there a nine-patch loader for iPhone?","<android><iphone><graphics><uiimage><nine-patch>","4","2","24","",""
"1136600","1","1136853","","2009-07-16 10:02:29","0","477","<p>I have a custom EditText and a TextView in an Activity. The custom EditText traps for key presses and calculates the number of character entered and wants to publish the character count to the TextView. Should I use the java.util.Observable/Observer way? Or is there a more native android method to achive this?</p>","27328","","1777090","","2013-01-17 05:51:41","2013-01-17 05:51:41","What is the native way of implementing Publish Subscribe between Android widgets?","<java><android><user-interface>","1","0","","",""
"1136880","1","","","2009-07-16 11:10:01","3","6685","<p>I am trying to resolve following task: smooth change of brightness from 100% to 0%, but can't gain effect of smoothness. Want to emphasize that I am using following approach of brightness change. The recommended one. </p><pre><code>WindowManager.LayoutParams lp = window.getAttributes();lp.screenBrightness = floatPercent;window.setAttributes(lp);</code></pre><p>Well, it obviously works, but not smooth. I will describe logic: </p><p>I have a thread that changes brightness:</p><pre><code>            while (isRunning()) {                 Thread.sleep(sleepTime);                 spentTime+=sleepTime;                 view.post(new Runnable() {                     public void run() {                         changeBrightness();                     }                 });             } </code></pre><p>I have duration of brightness change, for example 10 seconds. I calculate next value of <code>floatPercent</code> (see code snippet above) the way, <code>sleepTime</code> should always be less than 50ms. So looks like it had to be smooth. But I always get not smooth transition. It relates specially the range of 0% - 5% of brightness. Smoothness is completely lost on this brightness range. </p><p>I have already posted this question on Google Android Developer group, but anyway possibly somebody have already investigated in this area.</p>","139394","","1288","","2011-05-27 14:58:15","2011-05-27 14:58:15","Android. Brightness Change","<java><android><hardware>","3","1","1","",""
"1137350","1","1139868","","2009-07-16 12:49:38","18","42898","<p>I'm using a <code>slidingDrawer</code> in my application that has its handler placed at the bottom when in portrait mode. When the user switches to landscape mode (widescreen) I would like to have the handler located on the left. When I change the orientation from vertical to horizontal, the handler is placed on the right. </p><p>I have defined my layout XML like this:</p><pre><code>&lt;SlidingDrawer    android:id=""@+id/l_drawer""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:handle=""@+id/l_handle""    android:content=""@+id/l_content""    android:orientation=""horizontal""    android:layout_gravity=""left""    &gt;</code></pre><p>Anyone have an idea for how to make it slide from left to right ?</p>","133858","","76835","","2009-10-23 09:18:52","2013-08-26 10:49:35","How to make an Android SlidingDrawer slide out from the left?","<android><layout><android-widget><slidingdrawer>","4","3","11","",""
"1138273","1","","","2009-07-16 15:03:41","0","1424","<p>I am writing a c-jni function in Android, and I am having problems with creating a Long-object. I have succeeded in calling the constructor, but when I read the value of the object with longValue, I get the wrong result.</p><pre><code>jmethodID longConstructor;jmethodID longGetLongValue;jclass cls;jobject obj;// Create a object of type Long.cls = (*env)-&gt;FindClass(env,""java/lang/Long"");longConstructor = (*env)-&gt;GetMethodID(env,cls,""&lt;init&gt;"",""(J)V"");obj = (*env)-&gt;NewObject(env, cls, longConstructor, 4242);// Get the value by calling the function longValue.longGetLongValue= (*env)-&gt;GetMethodID(env,cls,""longValue"",""()J"");long return_long_value = (*env)-&gt;CallLongMethod(env, obj, longGetLongValue);// Log the result.LOGD(""%li"",  return_long_value);</code></pre><p>I would expect that the above code would print 4242 in the log, however the value that is printed in the log is 1691768. </p><p>Does anybody have an idea on why 4242 is not written in the log?</p>","","Torbjörn Eklund","","","","2014-02-23 11:03:18","JNI: Long-object created with wrong value","<android><jni>","2","0","","",""
"1138809","1","1138870","","2009-07-16 16:36:32","29","17866","<p>I know that the following code should show and hide a tiny circular progress bar with the following code in Android:</p><pre><code>requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);setProgressBarIndeterminateVisibility(true);setProgressBarIndeterminateVisibility(false);</code></pre><p>The problem is that I am using a TabHost and I need to be able to do this from one of the ""child"" activities. Is there any way I can go about doing this?</p><p>I found <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg18609.html"">this question</a> on the intarwebs but as you can see, it went unanswered.</p>","21126","","","","","2013-09-25 15:04:50","Android: Showing indeterminate progress bar in TabHost activity","<java><android>","2","0","14","",""
"1139162","1","3994358","","2009-07-16 17:42:24","2","2657","<p>If I have a reference to a view, how can I overlay an icon image on top of an exisiting view?In the screenshot below:<a href=""http://android.kanokgems.com/sms-unread-count"" rel=""nofollow"">http://android.kanokgems.com/sms-unread-count</a></p><p>It overlay an icon at the top right corner of the dialer icon. How can I do that?</p><p>Thank you.</p>","125440","","","","","2011-04-19 02:21:59","How to overlay an icon image on top of an exisiting view","<android><android-widget>","1","1","","",""
"1140564","1","","","2009-07-16 21:56:20","1","1371","<p>When I added the JExcelAPI <a href=""http://jexcelapi.sourceforge.net/"" rel=""nofollow"">http://jexcelapi.sourceforge.net/</a> to theclass path and run my app, I get:trouble writing output: shouldn't happen[<code>2009-07-16 14:32:19 - xxx</code>] Conversion to Dalvik format failed witherror 2</p><p>any idea?thanks </p>","121196","","750613","","2012-07-05 03:57:30","2012-07-05 03:57:30","JEXCelAPI on android","<android><excel>","1","1","","",""
"1141362","1","","","2009-07-17 03:43:51","13","17244","<p>What would be the best way to access the USB as a serial port on an Android device (<code>HTC Magic</code>)?</p><p>I am thinking about an OBD-II interface.  Can I do this on a standard phone or more likely will I need a modified firmware?</p>","23238","","58074","","2012-10-02 18:33:17","2012-10-11 10:57:59","Data collection with Android via USB","<android><usb><serial-port>","7","0","9","",""
"1141651","1","","","2009-07-17 06:18:38","2","3927","<p>actually i have keep one scrollview. Inside that scroll view I set one textview at run time I want to set text in that textview. The string which I'm going to set is some what big in length so i could not get the string in a single line and i can get my string two or three lines. My scroll view layout width size is 250px. I dont want to exceed that size...My expectation is i want to see that string within that scrollview as single line if the string is exceeds the scroll size then it should horizontally scroll in text view. I tried some functions like setting horizontal scroll to scrollview and textview but nothing is work out.Pls help me how to solve this problem.</p><p>urs,</p><p>s.kumaran.</p>","132724","","750613","","2012-07-05 03:56:57","2014-03-27 18:04:54","How to set a long string in a text view in a single line with horizontal scroll","<android>","4","1","","",""
"1141880","1","","","2009-07-17 07:43:29","0","1374","<p>Is there any problem with launching a service via an Alarm'sBroadcastReceiver's onReceive? My service never has it's onCreate oronStart method called.</p><p>My Alarm's receiver gets a wakelock, calls context.startService(newIntent(context, FmiDaemon.class)); (context given via onRecieveparameter),  waits 3 seconds, then releases the lock.</p><p>My service has 2 methods, onCreate and onStart. onCreate gets anotherwakelock, the end of onStart releases the wakelock, and calls""stopSelf"". Both methods are supposed to send data to a log, but neverdo since they're never called.</p><p>Where is the problem? Is that a bad ""context"" to use? Is onCreate andonStart the wrong methods to implement?</p>","","Brandon","267542","","2010-03-04 17:38:37","2011-01-07 19:27:59","Android service not starting via alarm","<android><service><android-context>","2","0","1","",""
"1142979","1","1143375","","2009-07-17 12:27:53","1","3136","<p>I cant find a way to set the orientation on my SlidingDrawer when i change from landscape mode to portrait mode visa versa.</p><p>Initially i set the orientation by xml to vertical. I need to change the orientation to horizontal when the phone is in landscape mode, so i get the handle on the left.</p><p>Any ideas anybody?</p>","133858","","","","","2011-02-17 06:14:28","How to change orientation of Android SlidingDrawer by code?","<android><layout>","2","0","3","",""
"1144534","1","","","2009-07-17 17:03:59","1","1069","<p>is there a way to use somehow <code>IHardwareService</code>.It is not visible, but documentation concerning it can be found. So looks like there should be some way to use it.</p><p>Could you please advice how to do this?</p><p>Thanks.</p>","139394","","750613","","2012-07-05 03:56:10","2012-07-05 03:56:10","IHardwareService. How to use in your code?","<java><android><hardware>","1","0","","",""
"1144761","1","1145470","","2009-07-17 17:48:14","1","137","<p>also I wanted to ask following. In class:</p><pre><code>\\\android 1.5 source\frameworks\base\services\java\com\android\server\HardwareService</code></pre><p>I have found method that looks like would help me in solving my Screen Brightness problems (smooth transitions): </p><p><strong>public void pulseBreathingLight()</strong> </p><p>could you please advice how to invoke this mysterious method? </p><p>Thanks</p>","139394","","750613","","2012-07-05 03:55:51","2012-07-05 03:55:51","Access Hiden API","<java><android><hardware>","2","0","","",""
"1144851","1","","","2009-07-17 18:08:32","5","11194","<p>Using the Android SDK, there doesn't seem to be any way to set the style on a table row.  I want to do the equivalent of:</p><pre><code>&lt;TableRow    style='@style/TableRow_classic' &gt;</code></pre><p>in code.  I would like something like:</p><pre><code>TableRow row = new TableRow(this);row.setStyle(R.style.TableRow_classic);</code></pre><p>Does anyone know how to find this?</p>","116880","","","","","2013-04-03 14:56:52","Set style on TableRow in Android","<java><android><android-styles>","3","0","1","",""
"1146270","1","1289263","","2009-07-18 00:23:24","7","8144","<p>I'm storing my Android project in a Subversion repository. After recently shuffling a bunch of stuff around I started getting tons of errors like:</p><pre><code>syntax error    entries	/project_name/src/.svn	line 1	Android AIDL Problemsyntax error don't know what to do with """"  entries	/project_name/src/.svn	line 28	Android AIDL Problem</code></pre><p>etc. </p><p>It seems as if Eclipse is trying to build the files in the .svn directories now. This setup used to work fine, how can I fix this?</p>","76835","","76835","","2009-07-20 10:34:45","2010-09-24 07:31:16","Eclipse is trying to build the files in my .svn directories... how can I tell it to stop?","<java><android><eclipse><svn>","7","4","7","",""
"1147172","1","1147344","","2009-07-18 10:10:57","103","61698","<p>I've got an Android app developed, and I'm at the point of a phone app development where everything seems to be working well and you want to declare victory and ship, but you know there just have to be some memory and resource leaks in there; and there's only 16mb of heap on the Android and its apparently surprisingly easy to leak in an Android app.</p><p>I've been looking around and so far have only been able to dig up info on 'hprof' and 'traceview' and neither gets a lot of favorable reviews. </p><p>What tools or methods have you come across or developed and care to share maybe in an OS project?</p>","14555","","","","","2013-08-29 15:15:19","What Android tools and methods work best to find memory/resource leaks?","<android><memory-leaks>","8","0","94","2014-02-15 04:01:53",""
"1147608","1","","","2009-07-18 14:01:14","2","719","<p>A recent <a href=""http://ajaxian.com/archives/swipe-flip-iphone"" rel=""nofollow"">Ajaxian post title ""Swipe away, then quickly flip with simple jQuery plugins""</a> tells us about flip events on the iPhone Safari browser and I wanted to use them on another webkit browser, the Android Browser. </p><pre><code>$('.swipe').swipe({     swipeLeft: function() { $('#someDiv').fadeIn() },     swipeRight: function() { $('#someDiv').fadeOut() },})</code></pre><p>The event is triggered, but it still scrolls the page left and right. Anyone know a work around for this? I'd love to see the plugin get whatever fix is possible, so it works in more places, of course.</p>","19687","","23199","","2009-07-18 16:18:22","2009-07-18 16:18:22","""Flip"" events in non-Safari webkit mobile browsers?","<iphone><android><webkit>","0","0","2","","2009-07-18 14:01:14"
"1151664","1","1152878","","2009-07-20 04:08:52","5","20490","<p>I would like to know how to make a validation on EditText. For example, I have one EditText that should only accept numeric values. If something other than a numeric value is typed by the user then it should show an alert message (<strong>i.e.</strong> ""please use a numeric value...."").</p><p>Is there a function available to find out if the entered text is particular type? If possible please include a code snippet.</p>","132724","","750613","","2012-07-05 03:54:33","2012-10-29 07:38:28","Validation on Edit Text","<android><validation><edittext>","4","1","3","",""
"1151960","1","3850568","","2009-07-20 06:26:25","1","2296","<p>Here's the scenario: I have a ListActivity, and long-pressing on an item brings up a context menu. One item in the context menu is ""delete"", and that brings up a confirmation box (and AlertDialog). When the user presses OK in the confirmation dialog, I need to know the ID of the item that was originally selected, so that I can actually delete it.</p><p>The flow looks like this: </p><pre>      This event:             Causes Android to call:-----------------------------------------------------  Long press an item        ->  onCreateContextMenu()Select context menu item  ->  onContextItemSelected()call showDialog()         ->  onPrepareDialog()user clicks OK            ->  onClick()</pre><p>In onCreateContextMenu and onContextMenuSelected, I can get at the id of the selected item from the ContextMenuInfo. In onPrepareDialog, however, I no longer have access to that information. The rub is that onPrepareDialog needs this information to set up an onClick listener on its POSITIVE button.</p><p>I know that, during onContextMenuSelected, I can stash the selected item's ID away into a field of my activity. I have done that, and it works. But it's also really ugly. The statefulness that it introduces makes me uneasy. Has anybody else seen a better way to pass such information around than to use fields in the activity?</p>","120278","","","","","2011-03-24 13:51:58","How do I pass the selected item's ID from a ListView to an AlertDialog in Android?","<android>","3","0","1","",""
"1152839","1","","","2009-07-20 10:44:22","0","813","<ol><li>How to implement Android system l10n ?It has been l10n in German.What is different between  Android and Linux in realizing system localization?   </li><li>What is Operational process of implementing Android l10n ?</li><li>What is needed to implement Android system  localization? such as Unicode UTF8,  charset,other anything else?</li></ol>","","","114066","","2010-07-06 06:53:54","2011-05-21 09:59:48","How to implement Android l10n ?","<android><localization>","1","0","","",""
"1153076","1","1155392","","2009-07-20 11:42:43","18","5261","<p>The justification that I've seen for shall we say ""Bastardizing"" the Java bytecodes in Android was performance.  (I suspect there is another reason.)  However by changing the byte codes haven't they made hardware acceleration technologies such as Jazelle moot, and thus actually degraded the performance available for a Mobile Java platform?</p><p>It appears counter intuitive to me knowing that the target platform is a ARM based mobile platform.  While it MIGHT give you better performance on other CPU architectures it seems to spit in the face of ARM and Jazelle.</p><p>What sort of quantitative effect does it have on Java performance?</p><p>Does it actually improve performance, and if so how?</p><p>What's the effect on other platforms? (i.e. x86,mips,yadda,yadda,yadda...)</p>","134597","","779709","","2013-12-27 05:56:49","2013-12-27 05:56:49","Does Android castrate the ARM's Jazelle technology?","<java><android><architecture><arm><jazelle>","3","2","4","",""
"1153920","1","","","2009-07-20 14:24:51","1","5502","<p>Right.</p><p>So I have an app widget.</p><p>It has 4 buttons, one one of the buttons I want it to show me the current location of the user on the map.</p><p>So - I make a new activity as below:</p><pre><code>package com.android.driverwidget;import java.util.List;import android.os.Bundle;import com.google.android.maps.MapActivity;import com.google.android.maps.MapController;import com.google.android.maps.MapView;import com.google.android.maps.MyLocationOverlay;import com.google.android.maps.Overlay;public class MyLocation extends MapActivity{    	public void onCreate(Bundle icicle) {		  super.onCreate(icicle);		  setContentView(R.layout.main);		  MapView myMapView = (MapView)findViewById(R.id.mapview);		  MapController mapController = myMapView.getController();		  List&lt;Overlay&gt; overlays = myMapView.getOverlays();		  MyLocationOverlay myLocationOverlay = new MyLocationOverlay(this,             myMapView);		  overlays.add(myLocationOverlay);		  myLocationOverlay.enableMyLocation();		}		  protected boolean isRouteDisplayed() {		    return false;		  }}</code></pre><p>And then I added the appropriate uses library line to the manifest</p><pre><code>&lt;activity android:name="".MyLocation""    android:label=""myLocation""&gt;     &lt;/activity&gt;   &lt;uses-library android:name=""com.google.android.maps"" /&gt;</code></pre><p>Ok yet - when I run the app the following errors occur, looks like it cannot find the MapActivity class, im running it on the GoogleApps 1.5 instead of normal android 1.5 as well.</p><p><a href=""http://pastebin.com/m3ee8dba2"" rel=""nofollow"">http://pastebin.com/m3ee8dba2</a></p><p>Somebody plz help me - i am now dying.</p>","","Andy Armstrong","","","","2010-09-09 08:48:28","Android AppWidget maps activity problem","<android><android-mapview>","3","0","1","",""
"1156609","1","","","2009-07-20 23:57:01","0","3245","<p>I was reading <a href=""http://news.bbc.co.uk/2/hi/technology/8157043.stm"" rel=""nofollow"">an article based on Mobile Development in 2020</a> and run into such a pessimistic claim:</p><blockquote>  <p>""But the economics are a different  story. The ratio of those developers  who will fail is about 90%; they will  simply not make a return on their  investment or make a good enough  living at this,""  said Mr Laurs.</p>    <p>He said that will result in developers  taking their talent elsewhere and also  slow down the rate of growth in  applications.</p></blockquote><p>Do you think it will be just another hype so that the majority of the developers will have to switch to something else? or What might be the driving force behind this? </p><p>Ps: I hope my <strong>argumentative</strong> question doesn't violate SO rules.</p><p>Thanks.</p>","12652","","1231016","","2012-05-01 13:12:30","2014-04-17 15:01:53","Future of Mobile Development","<android><iphone><mobile>","4","0","1","2014-04-17 20:28:31","2009-07-20 23:57:01"
"1157338","1","","","2009-07-21 04:40:22","0","107","<p>Am creating a <code>TableLayout</code> which contains 2 <code>TextView</code> , 2 <code>EditText</code> and a <code>Button</code>.After entering input to 2 <code>EditText</code>,and when i scroll back to first <code>EditText</code>...i got ForcedClose Error message. I am creating this using xml.</p><p>I have added this <code>TableLayout</code> in a <code>ScrollView</code>...(i did not got any error while using <code>Android1.1</code>)</p><p>Are there any limitations while placing a component in a layout using <code>XML</code> in <code>Android1.5</code>?</p>","138501","","956183","","2013-02-14 11:48:38","2013-02-14 11:48:38","Error in Android1.5 when using XML","<android>","1","0","","",""
"1157567","1","1159409","","2009-07-21 06:30:35","2","8505","<p>I'm trying to work with a web service (that I have no control over) that returns a SQLite database when you query it. Is there any way to do this?</p>","76835","","","","","2009-10-11 21:20:41","Interacting with external SQLite databases from Android","<android><sqlite>","2","2","5","",""
"1157603","1","1158219","","2009-07-21 06:46:44","8","5703","<p>Is it possible to programmatically send click events to a view? if so, how?</p>","80303","","","","","2011-11-22 07:49:20","Programmatically click views in android","<android>","2","0","2","",""
"1157814","1","1158269","","2009-07-21 07:52:45","28","34686","<p>I have an activity called A, and on the selection of menu item 0, it spawns service B, which starts a runnable C in a new thread.  I have a TextView in activity A, which I want to access in thread C.  </p><p>I've tried making the TextView a public static field, but that generates the following error:</p><pre><code>07-21 07:26:25.723: ERROR/AndroidRuntime(1975): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.view.ViewRoot.checkThread(ViewRoot.java:2440)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.view.ViewRoot.invalidateChild(ViewRoot.java:522)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.view.ViewRoot.invalidateChildInParent(ViewRoot.java:540)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.view.ViewGroup.invalidateChild(ViewGroup.java:2332)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.view.View.invalidate(View.java:4437)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.widget.TextView.updateAfterEdit(TextView.java:4593)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.widget.TextView.handleTextChanged(TextView.java:5932)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:6081)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.text.SpannableStringBuilder.sendTextChange(SpannableStringBuilder.java:889)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:352)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:269)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:432)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.text.SpannableStringBuilder.append(SpannableStringBuilder.java:259)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.text.SpannableStringBuilder.append(SpannableStringBuilder.java:28)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.widget.TextView.append(TextView.java:2191)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at android.widget.TextView.append(TextView.java:2178)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at com.android.peekaboo.DoScan$scanBody.run(DoScan.java:36)07-21 07:26:25.723: ERROR/AndroidRuntime(1975):     at java.lang.Thread.run(Thread.java:1058)</code></pre><p>I have also considered trying to pass the View through an intent, but do not know how that would work. What do I need to make this work?</p>","122961","","","","","2012-05-15 21:52:38","How to access original activity's views from spawned background service","<android><user-interface><pass-by-reference><textview>","4","0","12","",""
"1160876","1","1167247","","2009-07-21 18:25:57","1","9627","<p>How can you read data, i.e. convert simple text strings to voice (speech) in Android?</p><p>Is there an API where I can do something like this:</p><pre><code>TextToVoice speaker = new TextToVoice();speaker.Speak(""Hello World"");</code></pre>","93141","","","","","2012-01-10 08:28:22","Android speech - how can you read text in Android?","<android><text-to-speech>","6","0","1","",""
"1161999","1","10313432","","2009-07-21 22:03:46","13","19267","<p>I'm looking at best way of creating an <a href=""http://labs.adobe.com/technologies/spry/samples/accordion/AccordionSample.html"">Accordion-style widget such as on this page</a>. Is there a way of achieving same effect using standard Android toolkit or do I need to build custom widget? If so -  which one would you recommend extending if any?</p>","135946","","540162","","2011-10-05 18:13:34","2012-04-25 10:03:25","Android - accordion widget","<android><widget><accordion>","2","1","12","",""
"1162260","1","1163712","","2009-07-21 23:19:36","4","18774","<p>Given a Url for an image, I want to downoload it and paste it onto my canvas in android. How  do I retrieve the image into my app ?</p><p>Please help.</p><p>Thanks,de costo.</p>","352341","","1507602","","2012-10-30 16:42:09","2012-10-30 16:42:09","How to work with an image using url in android?","<android>","3","0","5","",""
"1162659","1","1225005","","2009-07-22 01:46:36","4","13443","<p>Here's the deal: I have an Android application that needs to call a web service every X seconds (currently 60 seconds). This application has multiple tabs and these tabs all need to interact with the data themselves. One is a MapView, one is a ListView and then the third is irrelevant but will need to also get some global data eventually. The issue is that I want my main activity to have a thread that runs in the background, gets the results and then instructs both child activities in the TabHost to update themselves with the latest data. Also, when the user clicks on the tabs and the onCreate/onResume activities fire, I would also like to force a redraw by getting the latest data from the main activity. I'm really at a loss here. I've tried this with a service and some ghetto static methods to pass an instance of the Activities to the Service to call specific functions to update their views whenever the timer fired, but the slowdowns were pretty bad and the code was just ugly ugly ugly. Any suggestions?</p><p>edit: So I implemented it as a timer-driven thread in the tabhost activity and then I have timer-driven threads in each child activity that then grab the data (in a synchronized fashion) and update their map/list. It's much faster but still feels slightly hack-ish, especially the part where I'm calling a custom function in the parent activity like so:</p><pre><code>((MainActivity)getParent()).getNearbyMatches();</code></pre><p>This adds an element of strong coupling that I'm not entirely thrilled with, but from a performance standpoint it's much better than it was. I appreciate the answers that have already been given and will do a bit of research on the content provider front but I'm not sure I want to go back to the service model.</p>","21126","","21126","","2009-07-22 15:04:56","2009-08-03 22:51:16","Best way to accomplish inter-activity communication in an Android TabHost application","<java><android><ipc>","3","1","7","",""
"1163812","1","1163899","","2009-07-22 08:20:40","3","4189","<p>Im trying to change the icon on the handle when i try to open the slidingdrawer.When I extract the handle from the view and sets the onclicklistener or ontouchlistener it seems to never get trigget.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    SlidingDrawer drawer = (SlidingDrawer)findViewById(R.id.drawer_landscape);    ImageView handle = (ImageView)findViewById(R.id.handle_l);    handle.setFocusable(true);    handle.setOnClickListener(new OnClickListener(){		@Override		public void onClick(View v) {			// TODO Auto-generated method stub			Log.i(""test"",""onClick"");		}    });}</code></pre><p>And my XML</p><pre><code>&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:id=""@+id/base_frame_layout""     android:layout_gravity=""bottom""     &gt;            &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        &gt;    	&lt;TextView      	    android:layout_width=""fill_parent""     	    android:layout_height=""wrap_content""     	    android:text=""@string/hello""    	    /&gt;    &lt;/LinearLayout&gt;    	&lt;SlidingDrawer    	     android:id=""@+id/drawer_landscape""    	     android:layout_width=""wrap_content""    	     android:layout_height=""wrap_content""    	     android:handle=""@+id/handle_l""    	     android:content=""@+id/content""    	     android:orientation=""vertical""    	     android:visibility=""visible""    	&gt;    		&lt;ImageView    	        android:id=""@+id/handle_l""      	      	android:layout_height=""50px""        	    android:layout_width=""64px""    	        android:padding=""0px""    	        android:src=""@drawable/icon""    	    /&gt;    		&lt;TextView    		    android:id=""@+id/content""            		android:text=""content""       	      	android:layout_height=""50px""        	    android:layout_width=""64px""    		/&gt;        	            	 &lt;/SlidingDrawer&gt;		&lt;/FrameLayout&gt;</code></pre><p>I was hoping this code should log ""onClick"" message, but it doesn't.</p><p>Any ideas?</p>","133858","","","","","2009-10-08 19:43:35","How to change icon on the SlidingDrawer handle when clicked","<android><slider>","1","0","2","",""
"1164493","1","","","2009-07-22 10:55:39","1","1474","<p>how to connect and retrive data from one webserver through coding in android  application?</p><p>How to achieve this ? Give me sample code for this </p>","132724","","3571","","2009-07-22 11:11:09","2009-07-22 17:18:14","How to connect a webserver","<java><android><http>","2","0","1","2012-09-05 11:43:31",""
"1167270","1","","","2009-07-22 18:34:49","5","407","<p>We have a web application and we've built phone applications (iPhone, Android, BlackBerry) to be companions to the site. The usual workflow is that an existing user of the site gets a phone app and then plugs their existing credentials into the phone app and they are off and running, but more often now we are seeing folks who are downloading the app and then (and this should not surprise anyone) don't read the help screen that explains they need to go and get credentials at the web site and therefore cannot connect to the application which does require registration to manage their content. This is a giant usability fail condition.</p><p>So we know that we need to put user registration workflows on the phone app. </p><p>Other than the obvious solution of duplicating our registration page on the mobile, does anyone know of a better identity solution for the phone? For example, on the desktop we also use Facebook Connect as an identity server and the users love it. I'm looking for something that simple that we can implement across the major smartphone platforms.</p><p><strong>Clarifying note:</strong></p><p>I should add here that this registration mechanism is likely to; and it would be desirable if it did, go hand in hand with a general identity/authorization mechanism such as the Facebook mechanism mentioned below.</p><p>One other place I'm poking around is to see whether there's an openId solution that does not require a browser to pop up.</p>","14555","","14555","","2009-07-22 23:26:59","2009-07-22 23:26:59","What is good way to register users from phone app","<iphone><android><blackberry>","3","0","","",""
"1171988","1","1172428","","2009-07-23 14:03:37","3","3326","<p>So I want to make a new music player for Android, it's going to be open source and if you think this idea is any good feel free to let me know and maybe we can work on it.</p><p>I know it's possible to speed up and slow down a song and normalize the sound so that the voices and instruments still hit the same pitch.</p><p>I'd like to make a media play for Android aimed at joggers which will;</p><ul><li>Beat match successive songs</li><li>Maintain a constant beat for running to</li><li>Beat can be established via accelerometer or manually</li><li>Alarms and notifications automatically at points in the run (Geo located or timer)</li></ul><p>Now I know that this will fall down with many use cases (Slow songs sounding stupid, beat changes within song getting messed up) but I feel they can be overcome. What I really need to know is how to get started writing an application in C++ (Using the Android NDK) which will perform the analysis and adjust the stream.</p><p>Will it be feasible to do this on the fly? What approach would you use? A server that streams to the phone? Maybe offline analysis of the songs on a desktop that gets synched to your device via tether?</p><p>If this is too many questions for one post I am most interested in the easiest way of analysing the wave of an MP3 to find the beat. On top of that, how to perform the manipulation, to change the beat, would be my next point of interest.</p><p>I had a tiny crappy mp3 player that could do double speed on the fly so I'm sure it can be done!</p><p>Gav</p>","111734","","","","","2010-11-21 12:55:56","Sound Processing - Beat Matching Music Player on Android","<java><c++><android>","4","2","2","",""
"1173971","1","","","2009-07-23 19:34:34","0","561","<p>I have been looking at the android source and developing some apps. However for my next app, I need information about the cell phone. Similar to what you see when you go into ""Field Test"" mode. However I have not been successful to get RadioInfo.java to work. Is there a way to hack RadioInfo.java so that I can use it in my app OR is there a way to get the data that is displayed in ""Field Test"" Mode. I have looked at the telephony api include the telephony.internal but so far they do not provide as much grained information as I would want.I have been asking around on the net but so far I can't find this information.</p>","","nai","1777090","","2013-01-17 05:43:41","2013-01-17 05:43:41","Hacking RadioInfo.java to work","<java><android>","1","0","","",""
"1174542","1","1174583","","2009-07-23 21:19:21","5","762","<p>First the disclaimer - I've read a bunch of posts already on making money with mobile app development, and I'm not sure I feel encouraged or discouraged at this point :)  I understand the very real ""Gold Rush"" mentality of the iPhone and Android apps...</p><p>Here's my situation:  I've coded professionally solo and on teams for about 10 years now.  I'm going to be starting graduate school in a non-related field in a month.  I have a small stipend to help pay a few bills, my wife is desperately looking for a job, and I'll be taking out student loans...  I'm leaving my full-time coding job behind, along with its decent wage, for the world of Academia (I'm nuts, I know.)  First off, I know that after a few months in school I'll be itching to write up a little app here and there to keep myself sane.  I've programmed to some extent my entire life, and giving it up isn't an option.  At the same time though, I'd looove to make some pocket change off the apps I write - say $100 - $200 a month.  I'm not looking for a full-blown business venture - just something to help us get out of some debt, or reduce the student loan amount.</p><p>Is this still feasable with the iPhone, or is the market too saturated?  Is it an option with Android, without having to use ads (though I'm not against the idea)?  I'm comfortable getting into either development platform, and might consider porting my small apps for both devices.</p><p>To summarize, is making a couple hundred bucks a month (on average) doable, without inventing the next greatest unthought of app?  Or, should I just take out more student loans??  ;)</p><p>Easy question, I know - I'd just like to know if my soon to be hobby can bring in some pocket change so I can by that nice new video card (or pay off debt :)</p><p>Opinions, suggestions?</p>","121504","","","","","2009-07-24 06:30:52","iPhone/Android Dev for Pocket Change?","<iphone><android><apple><money><income>","3","0","3","",""
"1175978","1","","","2009-07-24 06:14:13","0","5759","<p>In my application ,am work with a large database.Nearly 75000 records present in a table(totally 6 tables are there).i want to get a data from three different table at a time.i completed that.but the search process was slow.how can i optimise the searching process?</p>","138501","","115145","","2009-07-24 10:46:46","2011-11-27 15:14:26","Best way to search sqlite database","<android><sqlite><sqlite3>","2","3","2","",""
"1177020","1","1177076","","2009-07-24 11:15:15","26","22621","<p>I would like to create a dialog to display a video title and tags. Below text I would like to add buttons View, Edit and Delete and make these elements same size. Does anyone know how to modify .xml layout file in order to make elements inside LinearView same size?</p><p>The current layout file looks like this:</p><pre><code>&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     android:orientation=""vertical""&gt;    &lt;LinearLayout           android:layout_width=""wrap_content""           android:layout_height=""wrap_content""           android:orientation=""vertical""&gt;          &lt;TextView               android:layout_width=""wrap_content""               android:layout_height=""wrap_content""               android:id=""@+id/txtTitle"" android:text=""[Title]"" &gt;          &lt;/TextView&gt;          &lt;TextView               android:layout_width=""wrap_content""              android:layout_height=""wrap_content""               android:id=""@+id/txtTags""                          android:text=""[Tags]"" &gt;          &lt;/TextView&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:orientation=""horizontal""&gt;        &lt;Button            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:id=""@+id/btnPlay""            android:text=""View""&gt;        &lt;/Button&gt;        &lt;Button             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:id=""@+id/btnEdit""             android:text=""Edit""&gt;        &lt;/Button&gt;        &lt;Button             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:id=""@+id/btnDelete""             android:text=""Delete""&gt;        &lt;/Button&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I would appreciate if anyone could show the solution by modifying the pasted file content.</p><p>Thanks!</p>","22996","","812948","","2013-12-13 21:21:38","2013-12-13 21:21:38","Android: How to make all elements inside LinearLayout same size?","<android><layout>","3","0","8","",""
"1177022","1","","","2009-07-24 11:15:24","2","1158","<p>Is there any way to create a notification when a new e-mail arrives in my Android inbox? I would like to show an animation when I receive a new e-mail or SMS - would this be possible without writing my own e-mail client?</p><p>I'd also like to be able to customize the notifications based on who the sender is, the subject line, etc - basically, the same sort of criteria I can use to filter a message using any of the big existing clients.</p><p>Has anyone tried this before? Do you have any suggestions?</p>","","vinod","811","","2009-07-24 17:32:57","2010-05-03 13:00:05","How can I create an animated e-mail / SMS notification on an Android phone?","<android><events><email><sms>","2","4","1","",""
"1179971","1","1180200","","2009-07-24 20:22:33","2","1557","<p>Are the following actions possible using the latest version of the Android API?:</p><ol><li><p>Temporarily disable sending text messages</p></li><li><p>Temporarily disable receiving text messages </p><p>*Ideally, I would intercept them and queue them up for later delivery.</p></li><li><p>Temporarily disable incoming calls except from certain phone numbers</p></li><li><p>Temporarily disable outgoing calls except to certain phone numbers</p></li></ol>","88847","","","","","2009-07-24 21:19:13","Android - Is it possible to programatically disable certain functionality?","<android>","1","0","1","",""
"1181634","1","","","2009-07-25 08:53:23","1","245","<p>what is the name of this view.<a href=""http://img169.imageshack.us/i/picture1y.jpg/"" rel=""nofollow"">link text</a></p>","138501","","","","","2009-07-25 17:12:52","Name of the spinner event's view","<android>","1","1","1","",""
"1182620","1","","","2009-07-25 17:52:29","2","5943","<p>I have a View that I would like a TextView to pop up over when an event occurs. I have done this before (a long time ago) but can't remember how I did it...</p><p>My code is for the View element. Upon adding the TextView, I would like it to show over the top of the View.</p><pre><code>public class test extends View {    public test(Context context) {        super(context);        setBackgroundColor(Color.RED);    }    TextView tv;    public void adText(TextView tv){        this.tv =tv;        tv.setVisibility(tv.VISIBLE);    }}</code></pre>","","Dawson","496830","","2011-03-09 02:11:39","2012-01-23 09:02:53","Android TextView on top of a View","<android><view>","1","0","","",""
"1182831","1","","","2009-07-25 19:20:31","11","6977","<p>I'm new to SQLite and Java, and I'm trying to learn things on the fly. I have a column that has some numeric values in it, and I would like to get the sum of it and display it in a textview.</p><p>My current code is this:</p><pre><code>public Cursor getTotal() {    return sqliteDatabase2.rawQuery(        ""SELECT SUM(COL_VALUES) as sum FROM myTable"", null);}</code></pre><p>I'm not sure if that code is correct, though. </p><p>I know that I'm supposed to fetch the results of that code, but I'm unsure how to do it. How can I get the results of this query into my Java code?</p>","","JBoob","95589","","2009-07-25 19:26:39","2010-04-15 16:45:31","Fetching a SQLite SUM in Java on Android","<java><android><sqlite>","1","1","1","",""
"1185468","1","1185597","","2009-07-26 20:30:59","0","424","<p>I'm trying to determine how to set the <code>ViewConfiguration.zoomControlsTimeout</code> setting in the Android 1.5 framework, when working with a MapView.  There is <a href=""http://developer.android.com/reference/android/view/ViewConfiguration.html#getZoomControlsTimeout%28%29"" rel=""nofollow"">information</a> on how to get this data, but how can I set it?  </p><p>My end goal is to ensure zoom controls are always displayed on the screen, instead of the default hide/show behavior.</p>","121459","","","","","2009-07-26 21:27:08","ViewConfiguration - Setting the zoomControlsTimeout","<android><google-maps>","1","0","1","",""
"1186475","1","1186994","","2009-07-27 04:45:02","3","17038","<p>I am executing some sqlite query in the Android emulator. I want to know which path that database files are storing. Pls give me some idea how to find it. If u can provide me some code snippet.</p><p>urs,s.kumaran.</p>","132724","","95810","","2009-07-27 05:00:03","2009-10-13 15:09:05","How to find the path of Database file in Android Emulator?","<android>","1","0","1","",""
"1186867","1","1199705","","2009-07-27 07:19:35","1","290","<p><br />I don't how to do this task.using the getpath() method i can get the path of the database.In the Terminal Emulator using commends i can see the database file which contains the queries what i have executed,that file is saved in the emulator memory.How can i access that file from an anroid application.Is this is possible.please help me.</p>","131062","","","","","2009-07-29 11:50:02","How do i access the data files belongs to a application in Android?","<android>","1","2","","",""
"1186943","1","1190587","","2009-07-27 07:47:30","3","4261","<p>I'm a root user but I can't execute certain commands. What Linux commands can be executed in Android Terminal Emulator?</p>","132724","","1448202","","2012-07-12 21:50:16","2012-11-09 10:44:20","Android Terminal Emulator commands","<android>","1","0","5","",""
"1187541","1","1188637","","2009-07-27 10:46:18","12","14811","<p>Where can I get the full list of <code>Content Provider</code> that Android offers out of the box?<br>Specifically, I'm looking for a content provider that lists received SMS.</p>","130929","","1174526","","2012-03-20 01:55:25","2012-03-20 01:55:25","Android Content provider list","<android><android-contentprovider>","3","0","11","",""
"1188346","1","1188651","","2009-07-27 14:08:04","5","39224","<p>I am creating a video recorder and would like to create video player to preview the recorded videos. Modifying the code <a href=""http://davanum.wordpress.com/2007/12/29/android-videomusic-player-sample-from-local-disk-as-well-as-remote-urls/"">from this page</a> I have created a MediaPreview class the following way:</p><pre><code>public class MediaPreview extends Activity implements OnErrorListener, OnBufferingUpdateListener,OnCompletionListener, OnPreparedListener, SurfaceHolder.Callback{private static final String TAG = ""MediaPreview"";private MediaPlayer mp;private SurfaceView mPreview;private SurfaceHolder holder;private Button btnPlay;private Button btnPause;private Button btnReset;private Button btnStop;private String mPath;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.media_preview);    mPreview = (SurfaceView)findViewById(R.id.mPreview);    btnPlay = (Button)findViewById(R.id.btnPlay);    btnPause = (Button)findViewById(R.id.btnPause);    btnReset = (Button)findViewById(R.id.btnReset);    btnStop = (Button)findViewById(R.id.btnStop);    getPathFromParentDialog();    btnPlay.setOnClickListener(new View.OnClickListener(){        @Override        public void onClick(View v) {            playVideo();        }    });    btnPause.setOnClickListener(new View.OnClickListener(){        @Override        public void onClick(View v) {            // TODO Auto-generated method stub            if(mp != null){                mp.pause();            }        }    });    btnReset.setOnClickListener(new View.OnClickListener(){        @Override        public void onClick(View v) {            if(mp != null){                mp.seekTo(0);            }        }    });    btnStop.setOnClickListener(new View.OnClickListener(){        @Override        public void onClick(View v) {            if(mp != null){                mp.stop();                mp.release();            }        }    });    getWindow().setFormat(PixelFormat.TRANSPARENT);    holder = mPreview.getHolder();    holder.addCallback(this);    holder.setFixedSize(400, 300);}@Overrideprotected void onResume() {    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);    super.onResume();}@Overridepublic boolean onError(MediaPlayer mp, int what, int extra) {    if(mp != null){        mp.stop();        mp.release();    }    return false;}@Overridepublic void onBufferingUpdate(MediaPlayer mp, int percent) {    // TODO Auto-generated method stub}@Overridepublic void onCompletion(MediaPlayer mp) {    // TODO Auto-generated method stub}@Overridepublic void onPrepared(MediaPlayer mp) {    // TODO Auto-generated method stub}@Overridepublic void surfaceChanged(SurfaceHolder holder, int format, int width,        int height) {    // TODO Auto-generated method stub}@Overridepublic void surfaceCreated(SurfaceHolder holder) {    // TODO Auto-generated method stub}@Overridepublic void surfaceDestroyed(SurfaceHolder holder) {    // TODO Auto-generated method stub}private void playVideo() {    try{        mp = new MediaPlayer();        mp.setOnErrorListener(this);        mp.setOnBufferingUpdateListener(this);        mp.setOnCompletionListener(this);        mp.setOnPreparedListener(this);        mp.setAudioStreamType(2);        mp.setDisplay(mPreview.getHolder());        Runnable r = new Runnable(){            @Override            public void run() {                try{                    setDataSource(mPath);                }                catch(Exception ex){                    Log.e(TAG, ex.getMessage());                }                try {                    mp.prepare();                    Log.v(TAG, ""Duration: ===&gt; "" + mp.getDuration());                } catch (IllegalStateException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                    Log.e(TAG, e.getMessage());                }                mp.start();            }        };        new Thread(r).start();    }    catch(Exception ex){        String sDummy = ex.toString();        if(mp != null){            mp.stop();            mp.release();        }    }}private void setDataSource(String path) throws IOException {    if(!URLUtil.isNetworkUrl(mPath)){        mp.setDataSource(mPath);    }    else{        URL url = new URL(mPath);        URLConnection cn = url.openConnection();        cn.connect();        InputStream stream = cn.getInputStream();        if(stream == null){            throw new RuntimeException(""stream is null"");        }        File fileTemp = File.createTempFile(""mediaplayerTmp"", ""dat"");        String tempPath = fileTemp.getAbsolutePath();        FileOutputStream out = new FileOutputStream(fileTemp);        byte buf[] = new byte[128];        do{            int numRead = stream.read(buf);            if(numRead &lt;= 0){                break;            }            out.write(buf, 0, numRead);        }while(true);        mp.setDataSource(tempPath);        try{            stream.close();        }        catch(Exception ex){            String sDummy = ex.toString();        }    }}private void getPathFromParentDialog(){    Intent intent = getIntent();    mPath = intent.getExtras().getString(MediaLibrary.FILENAME);}}</code></pre><p>The code successfully executes (without any exceptions) <code>until mp.start();</code>, but the screen is blank (there are only buttons on the screen).</p><p>Does anyone know what could be wrong in the code above or is there any example that works available on the web?</p><p>I would really appreciate your help</p>","22996","","114066","","2010-08-19 10:08:07","2013-09-12 11:08:55","Android: How to create video player?","<android><media-player>","2","1","9","",""
"1191142","1","1194725","","2009-07-27 23:12:24","1","3814","<p>I have 2 questions about android TrackBall Event. I appreciate if you can help me with them:</p><ol><li><p>Can I detect the speed of TrackBall event? like in Fling, I can detect a 'big' fling vs a 'small' fling.  Can I fling via the track ball?</p></li><li><p>Why TrackBall Event always follow by Key left/right events? To me, they seem duplicate.</p></li></ol><p>For example, I put debug statement in both dispatchTrackballEvent() and dispatchKeyEvent(), and i switch to 'track ball' mode in emulator.  When I move my mouse around, I always see dispatchTrackballEventevent with dispatchKeyEvent.</p><p>Thank you for any help.</p>","125440","","491044","","2011-03-10 15:15:34","2011-03-10 15:15:34","Need help with Android TrackBall Event","<android><event-handling>","1","2","0","",""
"1191379","1","","","2009-07-28 00:43:41","4","6035","<p>OK, so I think I've exhausted searching for this question, and it's either that I'm totally missing something or nobody else has tried to create a GridView (showing images) which allows the user to select multiple images.  Basically I want to have the orange selection box appear whenever a user selects an image, or disappear if the user has already chosen the image.</p><p>Is this something that I'll have to roll myself with a customer View?  I may also try including a CheckBox with each image and have the CheckBox selected if the image is.</p><p>Any assistance would be greatly appreciated.</p><ul><li>michael</li></ul>","135048","","","","","2012-03-06 15:30:14","Multiple selectable GridView","<android>","4","0","4","",""
"1192496","1","1205392","","2009-07-28 07:51:09","3","4217","<p>Debugging the following piece of code I get ""Source not found"" notification which probably means some variables are not set:</p><pre><code>btnEdit.setOnClickListener(new View.OnClickListener(){		@Override		public void onClick(View v) {			Intent intent = new Intent(v.getContext(), DlgTitleTags.class);			intent.putExtra(Client.STORED_TITLE, mTitle);			intent.putExtra(Client.STORED_TAGS, mTags);			startActivityForResult(intent, SHOW_SUBACTIVITY_TITLE_TAGS);		}	});</code></pre><p>Here intent is successfully created and all other varables are set as well so I'm still trying to figure out what causes the problem.</p><p>I noticed the log messages:</p><pre><code>07-28 13:29:09.642: DEBUG/dalvikvm(56): GC freed 2010 objects / 86744 bytes in 230ms07-28 13:29:14.861: WARN/WindowManager(56): Key dispatching timed out sending to dev.client.android/dev.client.android.DlgEditFile07-28 13:29:14.862: WARN/WindowManager(56): Dispatch state: {{KeyEvent{action=1 code=4 repeat=0 meta=0 scancode=158 mFlags=8} to Window{43377460 dev.client.android/dev.client.android.DlgEditFile paused=false} @ 1248780547618 lw=Window{43377460 dev.client.android/dev.client.android.DlgEditFile paused=false} lb=android.os.BinderProxy@43449e78 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{43377460 dev.client.android/dev.client.android.DlgEditFile paused=false}}}07-28 13:29:14.862: WARN/WindowManager(56): Current state:  {{null to Window{43377460 dev.client.android/dev.client.android.DlgEditFile paused=false} @ 1248780554868 lw=Window{43377460 dev.client.android/dev.client.android.DlgEditFile paused=false} lb=android.os.BinderProxy@43449e78 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{43377460 dev.client.android/dev.client.android.DlgEditFile paused=false}}}07-28 13:29:14.872: WARN/WindowManager(56): Continuing to wait for key to be dispatched07-28 13:29:15.212: INFO/ActivityManager(56): Starting activity: Intent { comp={dev.client.android/dev.client.android.DlgTitleTags} (has extras) }07-28 13:29:15.522: WARN/ResourceType(1647): Failure getting entry for 0x7f030005 (t=2 e=5) in package 0: 0xffffffb5</code></pre><p>I would really appreciate any help in solving the problem.</p>","22996","","22996","","2009-07-28 11:38:41","2010-11-07 10:08:29","Android: Intent problem","<android><android-intent>","2","2","","",""
"1192604","1","1193252","","2009-07-28 08:15:06","0","2294","<p>I have a database that contains decimals.  The column is set up as "".. decimal(5,2) not null.  What I'm trying to do is to find the sum of the column and displaying it in a text field by using this code..</p><pre><code>public int getTotal() { Cursor cursor = sqliteDatabase2.rawQuery(            ""SELECT SUM(thedata) FROM thetable"", null); if(cursor.moveToFirst()) {     return cursor.getInt(0);     } return cursor.getInt(0);}</code></pre><p>However, when returned the value is a whole number.  It should be something like 20.75 instead of just 20.  </p><p>I'm not very familiar with SQLite, so please help.</p>","","Jim","1777090","","2013-01-17 06:04:38","2013-01-17 06:04:38","displaying integers in android using sqlite","<android><sqlite><decimal>","2","0","","",""
"1193054","1","","","2009-07-28 09:47:53","1","8596","<p>Hay, I'm taying to make a simple Rest web service in C# and client on android.I find a simple C# web service, which add two number, on this link:</p><p><a href=""http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/RESTEnabledService05122009034907AM/RESTEnabledService.aspx"" rel=""nofollow"">http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/RESTEnabledService05122009034907AM/RESTEnabledService.aspx</a></p><p>Can anyone help me to make Android client for this web service</p><p>Thanks </p>","","Milos","23118","","2009-09-02 21:38:36","2010-08-06 10:06:01","C# Rest web service and Android Client","<android><web-services><rest>","2","0","4","",""
"1196560","1","1196614","","2009-07-28 20:33:54","0","1458","<p>Im currently developing a system  where the user will end up having large arrays( using android). However the JVM memory is at risk of running out, so in order to prevent this I was thinking of creating a temporary database and store the data in there. However, one of the concerns that comes to me is the SDcard limited by read and write. Also another problem that comes to mind is the overhead of such an operation. Can anyone clear up my concerns, as well as also suggest a possibly good alternative to handling large arrays ( in the end these arrays will be uploaded to a website by writing a csv file and uploading it).</p><p>Thanks,Faisal</p>","117691","","30461","","2009-11-09 05:57:26","2009-11-09 05:57:26","Caching large Arrays to SQLite - Java/ Android","<java><android><arrays><sqlite><caching>","1","0","","",""
"1198068","1","","","2009-07-29 04:37:40","2","8989","<p>I want to make calendar view in order to support touch interaction.So I'd like to build new custom calendar view. I tried to make mapping function between view offset and real date value.</p><p>Here is my idea:If I can compute the number of weeks since base date(in my case, 1989-12-31),it is easy to know offset. HEIGHT_FOR_WEEK * NUM_OF_WEEK is very simple computationto know exact offset.</p><p>My problem is this:First I got milliseconds value from base date. And I set the milliseconds toanother calendar object. I expected same date from that object. But actually it was different date.</p><pre><code>mBaseDateInMillis = mBaseDate.getTimeInMillis();mAnotherDate.setTimeInMillis(mBaseDateInMillis);/* I expect mBaseDate == mAnotherDate. * but it was different. */</code></pre><p>Here is my code:</p><pre><code>public class CalendarCoordinate {    public static final long ONEWEEK_IN_MILLISECONDS = 60 * 60 * 24 * 7 * 1000;    public Calendar mBaseDate = new GregorianCalendar(TimeZone.getTimeZone(""GMT""));    public long mBaseDateInMillis = 0;    public Calendar mDate = new GregorianCalendar(TimeZone.getTimeZone(""GMT""));    public int  mWeekHeight = 30;    /**     * CTOR     */    public CalendarCoordinate() {        /* Base date is 1989-12-31 0, 0, 0         * It was Sunday and offset 0 will be mapped onto this day.         */        mBaseDate.set(Calendar.MILLISECOND, 0);        mBaseDate.set(1989, 12, 31, 0, 0, 0);        mBaseDateInMillis = mBaseDate.getTimeInMillis();        Log.v(TAG, ""BaseDate:"" + mBaseDate.toString());    }    /**     * Compute DATE from Y-Offset     * @param yOffset     * @return     */     public Calendar dateFromYOffset(int yOffset) {        long nthWeeks = yOffset / mWeekHeight;        long millsSinceBaseDate = nthWeeks * ONEWEEK_IN_MILLISECONDS;        mDate.clear();        mDate.set(Calendar.MILLISECOND, 0);        mDate.setTimeInMillis(mBaseDateInMillis + millsSinceBaseDate);        /* We SHOULD call to update mDate internal data structure.          * Java is really strange for this thing         **/        mDate.getTimeInMillis();        return mDate;    }    /**     * Compute Y-Offset from DATE     * @param date     * @return     */    public long yOffsetFromDate(Calendar cal) {        long mills = cal.getTimeInMillis();        long nthWeeks = (mills - mBaseDateInMillis)/ONEWEEK_IN_MILLISECONDS;        return nthWeeks * mWeekHeight;    }}</code></pre><p>Anybody can help me? I'm not a good Java programmer.</p>","1556","","1432","","2009-07-29 04:42:52","2009-07-29 04:51:55","Android java.util.Calendar - Time Difference","<java><android><datetime>","2","0","","",""
"1198558","1","1201239","","2009-07-29 07:29:21","54","36334","<p>I can find a way to send parameters to my activity from my notification.</p><p>I have a service that creates a notification. When the user clicks on the notification i want to open my main activity with some special parameters. E.g an item id, so my activity can load and present a special item detail view. More spesific, im downloading a file, and when the file is downloaded i want the notification to have an intent that when clicked it opens my activity in a special mode. I have tried to use putExtra on my intent, but cant seem to extract it, so i think im doing it wrong.</p><p>Code from my service that creates the Notification:</p><pre><code>        // construct the Notification object.     final Notification notif = new Notification(R.drawable.icon, tickerText, System.currentTimeMillis());	final RemoteViews contentView = new RemoteViews(context.getPackageName(), R.layout.custom_notification_layout);	contentView.setImageViewResource(R.id.image, R.drawable.icon);	contentView.setTextViewText(R.id.text, tickerText);	contentView.setProgressBar(R.id.progress,100,0, false);	notif.contentView = contentView;			Intent notificationIntent = new Intent(context, Main.class);	notificationIntent.putExtra(""item_id"", ""1001""); // &lt;-- HERE I PUT THE EXTRA VALUE	PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);	notif.contentIntent = contentIntent;    nm.notify(id, notif);</code></pre><p>Code from my Activity that tries to fetch the extra parameter from the notification:</p><pre><code> public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Bundle extras = getIntent().getExtras();    if(extras != null){        Log.i( ""dd"",""Extra:"" + extras.getString(""item_id"") );    }</code></pre><p>The extras is always null and I never gets anything into my log.</p><p>Btw... the onCreate is only run when my activity starts, if my activity is already started I  also want to collect the extras and present my activity acording to the item_id I recieve.</p><p>Any ideas?</p>","133858","","133858","","2009-10-08 19:42:50","2013-10-01 09:33:47","How to send parameters from a notification-click to an activity?","<android><android-intent><bundle><notifications>","5","1","34","",""
"1200688","1","","","2009-07-29 14:30:02","1","3740","<p>I'm trying to write a basic application with http get request. Eclipse validated my code, but when I using IOException in Android console I have this strange messages:</p><pre><code>trouble writing output: null[2009-07-29 17:22:49 - myapp] Conversion to Dalvik format failed with error 2</code></pre><p>And my application doesn't load into the emulator. This is my code:</p><pre><code>HttpHost target = new HttpHost(""google.com"", 80);HttpGet get = new HttpGet(""/"");String result = null;HttpEntity entity = null;HttpClient client = new DefaultHttpClient();try {    HttpResponse response=client.execute(target, get);    entity = response.getEntity();    result = EntityUtils.toString(entity);} catch (Exception e) {    e.printStackTrace();} finally {    if (entity!=null){}    	try {    		entity.consumeContent();    	} catch (IOException e) {}}return result;</code></pre><p>Anyone knows what is the problem?</p>","107977","","107977","","2009-07-29 14:43:05","2010-01-14 04:46:41","Android and IOException - strange error","<java><android>","3","2","","",""
"1201374","1","","","2009-07-29 16:09:50","7","27260","<p>I am writing a RTSP client in Android. I am able to receive the Responses for all the requestsi.e.,</p><ol><li>DESCRIBE it sends back the 200 OK</li><li>SETUP with transport: RTP/AVP:unicast:client_port=4568:4569 got the 200 OK Message back</li><li>Sent PLAY, and got the OK Message</li></ol><p>After that how to get the audio and video frames?</p><p>I have searched on blogs, but all say to listen at client_port but I am not receiving any packets.</p><p>Please let me know am I doing correctly.</p>","28641","","","","","2011-05-30 05:40:06","RTSP client in android","<c++><android><client><rtsp>","4","0","3","",""
"1201426","1","1205377","","2009-07-29 16:21:36","0","846","<p>I have a View Group and it has 2 focusable Views as its children.I would like know how I can customize how focus is being passedbetween these 2 Views. In other words, when I press the Down Key orthe Up Key in the emulator, i want to control which of these childrenhas focus.</p><p>I read the JavaDoc of ViewGroup, I see these 2 methods.</p><pre><code>public View focusSearch (View focused, int direction)public boolean requestFocus (int direction, Rect previouslyFocusedRect)</code></pre><p>But I am confused which of these method I should over-ride to achievewhat I want.</p><p>Thank you for any advice.</p><p>Regards,</p>","125440","","82118","","2010-10-22 17:59:24","2012-04-27 04:55:43","How to customize focus navigation in a ViewGroup","<android>","1","0","1","",""
"1201962","1","1202696","","2009-07-29 17:54:37","3","6856","<p>I am porting an iPhone app over to the Android platform. One of the views has a very large list of data and on the iPhone app, there's a scrollbar of sorts on the right hand side that displays the letters of the alphabet and allows the user to quickly scroll through the list this way. I am having trouble finding such functionality in Android. Is there a simple way to implement this?</p>","21126","","","","","2012-02-04 13:32:32","Android equivalent to iphone indexed UITableView","<iphone><android>","3","2","1","",""
"1203278","1","","","2009-07-29 21:50:53","7","5270","<p>I'm trying to code an app for android that needs to enable and disable 3G (move between 2g and 3g), but can't find anything about it...is that possible? Can I get a snippet code or some documentation? Thanks in advance</p>","","oinquer","","oinquer","2009-07-29 23:43:10","2011-10-25 19:06:28","How Do You Disable/Enable 3G Programatically on Android?","<android>","2","0","3","",""
"1203303","1","1203310","","2009-07-29 21:57:51","6","1761","<p>More or less as it says on the tin.</p><p>Before I even contemplate downloading the SDK, I was wondering if there was any way of testing Android apps that I'd write without an Android phone available to me? I'm unsure as to whether or not the tools that come with the SDK come with an emulator like VS does for Windows Mobile.</p><p>Sorry if this is a stupid question, but maybe I'm searching for the wrong thing.</p><p><strong>Edit</strong> I don't suppose there's anything that'll let me write widgets on/for an emulated version of the interface HTC use on the Hero/G2 either is there? Not that it would matter that much.</p>","147145","","147145","","2009-07-30 14:49:03","2009-07-30 14:49:03","How do I get started with developing for Android without an Android phone?","<android><ide><sdk><htc>","3","0","1","",""
"1203434","1","1203492","","2009-07-29 22:29:26","5","3707","<p>I use a single static class in my code that defines a static field which I'm reusing between Activity onStop/onStart invocations. Here's a scenario:</p><ol><li>User clicks on ""Authorize"" button (static data is initialized)</li><li>Activity is stopped and web browser is called</li><li>Browser executes callback and Activity is restored (static data is reused)</li></ol><p>At least one of my users reports the failure at step 3 which I cannot reproduce but which looks like reset of static data</p><p>Any suggestions?</p>","135946","","","","","2013-01-07 09:46:34","Is the static safe in Android?","<android><static><safety>","2","0","4","",""
"1203555","1","","","2009-07-29 22:56:44","1","2365","<p>I've been trying to get my progress bar view to work in my file scanner application, and I'm thoroughly stumped by the proper combination of Activities, Services, Threads, and Handlers.</p><p>Here's the structure: My Activity contains a Horizontal-styled ProgressBar. On menu item click, I spawn a Service which, onCreate(), which is where I want to be able to update the progress bar.</p><p>My question: what am I missing?</p><ol><li>Activity ""a"" (with ProgressBar)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.  ""a"".onOptionsItemSelected(): Spawn Service ""b""<br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.  ""b"".onCreate(): Control the ProgressBar in ""a"" // here is where I have my trouble</li></ol><p>Layout for Progress Bar (1):</p><pre><code>&lt;ProgressBar 	style=""?android:attr/progressBarStyleHorizontal""	android:layout_height=""wrap_content""	android:max=""100""	android:progress=""0""	android:secondaryProgress=""0"" 	android:layout_width=""300px"" 	android:layout_marginLeft=""10px"" 	android:id=""@+id/progress_horizontal""	/&gt;</code></pre><p>""a"".onOptionsItemSelected (2):</p><pre><code>public boolean onOptionsItemSelected(MenuItem item) {    		if (svc == null)    		{    			android.util.Log.v(""@@@@@@@@@@@@@@@@@@@@@"", ""starting"");    			svc = new Intent(this, DoScan.class);    			// done in ""a"".onCreate()                            // hmap = new HashMap();	                // hmap.put(""tv"", tv);    			svc.putExtra(""hmap"", hmap);    			startService(svc);    		}    		break;}</code></pre><p>""b"".onCreate() (3):</p><pre><code>@Overridepublic void onCreate() {	super.onCreate();	//startThread();	TextView tv = (TextView) Peekaboo.hmap.get(""tv"");	tv.append(""cocktail"");}</code></pre>","122961","","1318946","","2014-01-29 12:55:02","2014-01-29 12:55:02","Update integrated progress bar in original activity","<android><multithreading><service><activity><android-progressbar>","2","1","","",""
"1204012","1","1204419","","2009-07-30 01:27:38","1","20721","<p>My service spawns a new thread, and stops it according to the <a href=""http://java.sun.com/j2se/1.4.2/docs/guide/misc/threadPrimitiveDeprecation.html"" rel=""nofollow"">typically recommended java</a> method of interrupt()'ing. When I stop the service, I stop the thread in onDestroy(). The service is stopped, and the interrupt code is reached. However, soon enough the thread restarts from the beginning of the Runnable.</p><pre><code>public class DoScan extends Service {	public volatile Thread runner;	@Override	public IBinder onBind(Intent intent) {		return null;	}	@Override	public void onCreate() {		super.onCreate();		startThread();	}	@Override	public void onDestroy() {		super.onDestroy();		android.util.Log.v(""@@@@@@@@@@@@@@@@@@@@"", ""DoScan.onDestroy"");		stopThread();	}	public synchronized void startThread(){		if(runner == null){			android.util.Log.v(""@@@@@@@@@@@@@@@@@@@@"", ""DoScan.startthread"");	  			runner = new Thread(new ScanningThread());			runner.start();		}	}	/* use a handler in a loop cycling through most of oncreate.	 * the scanningthread does the work, then notifies the svc's uithread	 */	public synchronized void stopThread(){		if(runner != null){			android.util.Log.v(""@@@@@@@@@@@@@@@@@@@@"", ""DoScan.stopthread"");			Thread moribund = runner;			runner = null;			moribund.interrupt();			android.util.Log.v(""@@@@@@@@@@@@@@@@@@@@"", ""interrupted?"" + moribund.isInterrupted());		}	}        }</code></pre>","122961","","","","","2009-07-30 07:42:05","Why isn't the thread stopping?","<android><multithreading><stop>","3","0","1","",""
"1204943","1","","","2009-07-30 07:16:35","0","621","<p>I want to write a software to allow the parents to set a limit to their children phone calls.</p><p>I need to lock some phone capabilities with a password after the limits are reached.</p><p>I'd like to know how I can block phone calls from being made, and receive. And if it's possible to set a white list for emergency calls (e.g : the teen can't call friend after midnight but can call 911).</p>","9951","","","","","2012-06-01 15:13:24","How can you prevent somebody from calling in Android?","<android><phonecalls>","2","0","1","",""
"1206418","1","1226907","","2009-07-30 12:52:53","3","2830","<p>I have a notification that starts my activity and passes a messages using the intent's  putExtra() function. The message is then displayed to the user in the activity's onCreate function. When the application is restarted due to a orientation change, the message is shown again as it is still in the intent's bundled data.</p><p>How can I remove the extra data?</p><p>I tried the following:</p><pre><code>Bundle bundle = getIntent().getExtras();if (bundle.getBoolean(""showMessage"")) {    // ... show message that is in bundle.getString(""message"")    // remove message    bundle.remove(""showMessage"");}</code></pre><p>But the message will still be shown after the orientation changed, seems like the intent used is not the one I changed, but the original one. The only workaround I found is to save the showMessage additionally in o<code>nSaveInstanceState()</code>.Is there another way? Or is this the way to go?</p>","","","1777090","","2013-01-17 06:09:05","2013-01-17 06:09:05","Change intent bundle data before an activity is re-created after orientation change","<android><android-intent><bundle>","2","0","2","",""
"1206891","1","1213213","","2009-07-30 14:18:38","6","15976","<p>I would receive notifications when signal strength changes. I tried to create the following method and call it in the onCreate():</p><pre><code>private void initializeWiFiListener(){	Log.i(TAG, ""executing initializeWiFiListener"");	String connectivity_context = Context.WIFI_SERVICE;	final WifiManager wifi = (WifiManager)getSystemService(connectivity_context);	if(!wifi.isWifiEnabled()){		if(wifi.getWifiState() != WifiManager.WIFI_STATE_ENABLING){			wifi.setWifiEnabled(true);		}	}	registerReceiver(new BroadcastReceiver(){		@Override		public void onReceive(Context context, Intent intent) {			WifiInfo info = wifi.getConnectionInfo();			//TODO: implement methods for action handling		}	}, new IntentFilter(WifiManager.RSSI_CHANGED_ACTION));}</code></pre><p>I would appreciate if anyone could check if the method is written correctly. I tried to run the app, but haven't received any notifications and am not sure whether it is because the signal strength might be constant in the place I run debug or it is because something is missing.</p><p>Thanks!</p>","22996","","","","","2011-12-24 14:08:21","Android: How to monitor WiFi signal strength","<android><networking>","1","0","8","",""
"1207269","1","1208537","","2009-07-30 15:12:30","28","33620","<p>I have a service running, and would like to send a notification. Too bad, the notification object requires a context, like an Activity, and not a service.</p><p>Do you know any way to by pass that ? I tried to create an Activity for each notification bu it seems ugly, and I can't find a way to launch an Activity without any view.</p>","9951","","","","","2013-11-06 09:20:33","Sending a notification from a service in Android","<android><service><notifications>","2","3","14","",""
"1209469","1","1209573","","2009-07-30 21:24:29","29","76795","<p>Is there a way to store android application data on the SD card instead of in the internal memory?I know how to transfer the application sqlite database from the internal memory to the SDCard, but what if the internal memory gets full in the first place?  How does everyone handle this?</p>","121196","","403455","","2012-08-22 18:22:46","2013-03-07 00:28:15","storing android application data on SD Card","<android><memory-management><android-sdcard>","6","0","17","",""
"1209726","1","","","2009-07-30 22:20:10","1","1960","<p>I want to have more than one expandable list within a layout.  It appears that an expandable list in a custom layout must have an id of ""@id/android:list"".  So, how could I have more than one if they would need to have the same id?  Thanks...</p>","","Michael Grimes","","","","2011-06-23 10:15:18","Multiple Android expandable lists in a layout","<android><expandablelistview>","1","0","","",""
"1211559","1","","","2009-07-31 09:27:59","3","29117","<p>I need a little help from people with expirience. I hope it's easy. I just want to show new View (creating it <strong>without</strong> <code>XML layouts</code>) above main program's view. It's to integrate AdMob.com ad block: </p><p>I wrote such code: </p><pre><code>AdView ad = new AdView(this); ad.layout(10, 10, 100, 100); ad.setVisibility(View.VISIBLE); ad.bringToFront(); ad.requestFocus(); ad.invalidate();</code></pre><p>As you see - nothing helped, no window visible<br>What do I make incorrectly? Thanks! </p><p>P.S. I made in in <code>Activity</code>'s <code>onCreate(Bundle)</code>, but I tried in other locations too.</p>","148387","","1570662","","2014-02-19 06:04:21","2014-02-19 06:04:21","Android, add new view without XML Layout","<java><android><view><control>","1","0","2","",""
"1212430","1","1212444","","2009-07-31 13:05:58","1","3972","<p>I would like to know what is meant by gestures in typical mobiles more specifically android ones. Android supports gesture recognition.</p><ol><li><p>Is a gesture termed as when userholds the device and shakes it(sayupwards, downwards or side- side)?</p></li><li><p>Is a gesture termed as when afinger is placed on the screen andtraced UP,DOWN,RIGHT,LEFT? If sowhat is the difference between touchscreen and gestures.</p></li></ol><p>I am confused between 1) and 2) option.</p><p>What is a gesture exactly?</p>","142521","","114066","","2010-07-05 15:37:04","2012-04-02 12:32:06","What is gesture in Android","<android><gesture-recognition>","3","0","","",""
"1212729","1","1213967","","2009-07-31 14:06:21","7","330","<p>I'm looking at making some mobile apps in my spare time and I want to be able to put them up online for anyone to use (and probably open-source). I've worked with PyS60 a while ago and I really liked it.  </p><p>My problem is, I don't want to spend any money on these apps (I'm not planning on making money from them in any way) and for me to properly distribute PyS60 apps it looks like I need to buy an expensive publisher license, then still pay every time I want an app signed. I know I can just distribute the scripts, but that entails the end user to download the pys60 interpreter...</p><p>I'd be happy to look at other languages / platforms too. IPhone apps need a dev license and I would need a Mac to compile the code (Which I don't have, I'm a linux x86 user).</p><p>J2ME apps seem to need to be ""Java Verified"" in order to be in OVI store. I presume not though if they are distributed by other means?</p><p>Basically I am looking to write apps that will work on my phone (N95) and if someone else sees it, I can say just get it from www.example.com/myapp and it will just work. I would also be interested in using things like the OVI store as a way of distributing it. But I don't want to be spending loads of money.</p><p>Anyone have any experience or knowledge on this matter? Is J2ME my only option?</p>","148464","","148464","","2009-08-01 09:14:26","2009-08-01 09:14:26","Mobile Development barrier to entry","<android><java-me><mobile><pys60><n95>","2","2","3","",""
"1213882","1","1213905","","2009-07-31 17:37:30","2","1930","<p>I have some reference data in a text file (~5MB) that I want to use with might android application.</p><p>The file is of the format:</p><pre><code>1|a|This is line 1a1|b|This is line 1b2|a|This is line 2a2|b|This is line 2b2|c|This is line 2c</code></pre><p>What I want to know is the most efficient way (less memory, fast, size etc.) to use this file within my application.</p><p>a.) Should I save the file as a raw resource and open and read the whole file whenever I need a certain line.</p><p>b.) Should I convert the file to XML and use XPath to query the file when ever I need to look up a value</p><pre><code>&lt;!--sample XML --&gt;&lt;data&gt;  &lt;line number=""1""&gt;     &lt;entry name=""a""&gt;This is line 1 a&lt;/entry&gt;  &lt;/line&gt;&lt;/data&gt;</code></pre><p>c.) Should I just copy &amp; paste the whole file as a static string array in the application and use that.</p><p>... any other suggestions are welcome.</p><p><strong>[EDIT]</strong>I will also need to search this file and jump to arbitrary keywords e.g. ""line 1a"".</p>","61525","","61525","","2009-07-31 20:21:32","2009-08-01 21:00:50","Android: Is it more efficient to use a text file or an XML file to store static data","<android><resources><filereader><text-database>","4","0","1","",""
"1214245","1","1214268","","2009-07-31 18:57:30","2","295","<p>Just for the disclaimer, I'm not trying to win the prize in Android Developer Challenge, but just want to participate.</p><p>I heard about the Android buzz lately and got interested in it. And today I stumbled upon a site talking about Android Developer Challenge 2. Luckily, the submission hasn't ended but unfortunately it starts tomorrow, August 1. Since this is a new opportunity I want to give it a try but I think I'm a little bit late.</p><p>I have configured the development platform and got some tutorials. I wanted to know if I could successfully develop a project within 30 days and submit it. Or is it really a big task which needs months of preparation. I just want to know if it is worth a try.</p><p>And for the record I know nothing about Androids except that it is an open source platform for application development on mobiles. I know Java but not competent, so may be need to touch up on that too.</p><p>It would be nice, if I get some real pointers on what I'm about to embark on. If it isn't possible I may need to pace down and enjoy other things in life too.</p><p>So is is possible to complete a small and decent app within 30 days or is it already late and if so are there any suggestions?</p>","147671","","1777090","","2013-01-21 06:41:33","2013-01-21 06:41:33","Is it realistic for an android newbie to successfully complete a project in 30 days and submit it to ADC2?","<java><android>","3","0","1","",""
"1214293","1","1227887","","2009-07-31 19:05:43","2","2016","<p>I have come up with a disk-based data structure to store incoming realtime data, this is not in memory becuase the array can fill up and cause the jvm to crash. The data-strcture and algorithm work great. My only question is that does this greatly affect the life of an sdcard?</p><p>I know sdcards have limited read and writes on them, but how much is ""limited"". Will writing to the sd Card for say on average 20 minutes per session affect the sd card greatly to the point where the user sees that it was this app that killed it?</p>","117691","","","","","2009-08-04 14:36:32","SD-Card Life while using it to store a data structure","<android><sd-card>","3","3","2","",""
"1214956","1","1215021","","2009-07-31 21:20:10","5","6353","<p>Is there a way I can programatically perform a Fling on a listview? I know there is monkey that does all these things but that requires a computer connection with adb etc etc. I want to do it with my app on any phone, without monkey.</p><p>Thanks,Faisal</p>","117691","","","","","2011-05-17 17:20:31","Programmatically Fling ListView Android","<android><listview>","3","0","4","",""
"1215548","1","1215553","","2009-08-01 01:15:39","33","23438","<p>The following code leads to ""java.lang.IllegalThreadStateException: Thread already started."" the <strong>second</strong> time it is run through on the program.</p><pre><code>updateUI.join();    if (!updateUI.isAlive())     updateUI.start();</code></pre><p>This happens the <strong>second</strong> time <code>updateUI.start()</code> is called.  I've  stepped through it multiple times and the thread is called and completly runs to completion before hitting <code>updateUI.start()</code>.</p><p>Calling <code>updateUI.run()</code> avoids the error but causes the thread to run in the UI thread (the calling thread, as mentioned in other posts on SO), which is not what I want.</p><p>Can a Thread be <em>started</em> only once?  If so than what do I do if I want to run the thread again?  This particular thread is doing some calculation in the background, if I don't do it in the thread than it's done in the UI thread and the user has an unreasonably long wait.</p>","53498","","5812","","2009-08-01 01:21:27","2013-08-14 21:28:15","Is it legal to call the start method twice on the same Thread?","<java><android><multithreading>","7","1","13","",""
"1215757","1","1217340","","2009-08-01 03:23:27","15","5525","<p>I have a vertical, set height (300px) LinearLayout (LL) with 3 nested LLs. 1 and 3rd are set with android:layout_height=""wrap_content"" and the middle one with android:layout_height=""fill_parent"". To my dismay, 3rd LL gets pushed out with 2nd one filling parent layout right to the bottom. How do I achieve desired effect since I want potentially resize the outside container with the middle portion expanding and contracting to accommodate the change</p>","135946","","82118","","2010-05-27 22:17:11","2011-10-04 18:05:58","Android LinearLayout fill-the-middle","<android><android-linearlayout>","1","0","6","",""
"1215817","1","","","2009-08-01 04:13:25","4","4353","<p>I know how to implement this issue by Menuifest.xml, see also:</p><p><a href=""http://groups.google.com/group/android-developers/browse%5Fthread/thread/62a514363c751464/feecc033d0265606?lnk=gst&amp;q=intentfilter+share#feecc033d0265606"" rel=""nofollow"">Google Android Developer Group related issue</a></p><p>But my question is how to add share menu of Gallery by java code not Menuifest.xml.</p><p>My code is as below:</p><pre><code>public class MyActivity extends Activity {private static final String TAG = ""MyActivity"";@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    IntentFilter intentFilter = new IntentFilter();    intentFilter.addAction(Intent.ACTION_SEND);    intentFilter.addCategory(Intent.CATEGORY_DEFAULT);    try {		intentFilter.addDataType(""image/*"");	} catch (MalformedMimeTypeException e) {		Log.e(TAG, e.toString());	}    Intent x = registerReceiver(new BroadcastReceiver() {        public void onReceive(Context context, Intent intent) {         	Log.d(TAG, ""Received intent ""+intent);        	intent.setComponent(new ComponentName(context, Uploader.class));        	startActivity(intent);        }        }, intentFilter);    if (x==null)        Log.i(TAG, ""failed to regist a receiver"");    else        Log.i(TAG, ""registed a receiver successfully"");    // ...</code></pre><p>But registerReceiver always return null, and there is no menu added to Gallery's Share.</p><p>Thank you.</p><p>Anthony Xu</p>","148835","","","","","2010-06-18 13:00:09","How to add share menu item to Gallery by code","<android><intentfilter>","1","0","1","",""
"1215875","1","","","2009-08-01 05:03:48","2","9280","<p>I have a class which extends <code>Activity</code> and I am trying to create an object of that class in a normal java class but it's throwing me an exception :</p><p><code>Can't create handler inside thread that has not called looper.prepare</code></p><p>What am I doing wrong? </p><p>Thanks in advance.</p>","95877","","1059273","","2012-12-23 10:05:31","2012-12-23 10:05:31","Creating an object of Android Activity class","<java><android>","2","1","1","",""
"1215960","1","","","2009-08-01 06:19:18","1","1603","<p>I am working on making RTSP url to work on Android.</p><ol><li><p>I have used MediaPlayer and VideoView to play the RTSP url but both of them fail to play in G1 Device and emulator. Error is PVMFFailureiin PLAYER_INIT.</p></li><li><p>So I thought of implementing a RTSP client from scratch. I have developed a small application, it exchanges all the messages (DESCRIBE, SETUP, PLAY, TEARDOWN). But the problem is after PLAY, I should receive the RTP packets at client_port as mentioned in Transport header but TCP dump shows the following messages. I think UDP packets are coming but not received at the application. </p></li></ol><p>11:38:50.213394 IP ew-in-f177.google.com.6970 > 192.168.1.2.6970: UDP, length 44411:38:50.213451 IP 192.168.1.2 > ew-in-f177.google.com: ICMP 192.168.1.2 udp port 6970 unreachable, length 36</p><p>Please let me know how to solve this issue.</p>","28641","","","","","2010-07-25 11:17:26","RTSP Stack implementation","<android><udp><rtsp>","2","0","1","",""
"1216324","1","1317373","","2009-08-01 10:24:15","7","4175","<p>I am trying to test my DB using <code>ProviderTestCase2&lt;T&gt;</code>. I can see the test DB being created. As such I suppose, the tested content provider should use the test DB. But as soon as I try any calls against the <code>MockContentResolver</code> (or the one created with <code>newResolverWithContentProviderFromSql</code>), I get an <code>UnsupportedOperationException</code>. This is documented for the MockContentResolver as normal behavior. As such I am a bit unsure on the purpose of the ProviderTestCase2.</p><p>How do you test your content providers?</p><p>Thanks</p>","982506","","1636680","","2013-03-06 13:46:23","2013-03-06 13:46:23","How to test content providers on Android","<android><sqlite><junit><content><providers>","4","0","2","",""
"1217141","1","1217162","","2009-08-01 18:12:33","24","46968","<p>I've looked everywhere on the internet and while some people claim to have found the solution, it either does not work or there is no sample code to back it up.<br>Does anyone know how to accept a self signed cert in Java on the Android?<br>A code sample would be perfect.</p>","117691","","469983","","2012-04-09 15:46:15","2013-03-20 18:09:10","Self Signed SSL acceptance Android","<android><ssl><ssl-certificate><self-signed>","7","0","48","",""
"1217449","1","1218712","","2009-08-01 20:41:15","11","10026","<p>I'm trying to write an application for Android and when I launch my new activity, I've set break points and found that it runs through my onCreate without any errors, but after that function returns, the debugger says there is a NullPointer Exception. The problem is, its not in my code, it says its in ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord) line: 2268 and where the source normally would be (if it were my code) I just get ""Source not found."" and a button that says ""Edit Source Lookup Path""</p><p>How can I setup eclipse so I can debug this problem? I'm sure I'm doing something wrong in my code, but because the exception originates in code I can't see, I have no idea how to figure out where the problem is.</p><p>I'm using android-sdk-linux_x86-1.5_r3 and my G1 for this project.</p><p>UPDATE: I think my question really has more to do with android development than using eclipse. I'm not sure where to find the source for the the code that is throwing the exception. Maybe there is a way I can debug it without having that file, but I'm not sure what it would be.</p>","35247","","764272","","2009-08-01 23:13:08","2011-05-15 03:03:22","How can I debug this NullPointer Exception?","<android><eclipse>","8","0","4","",""
"1219133","1","1219196","","2009-08-02 15:57:43","1","4022","<p>How to I properly parameterize the speech recognizer so that it can more easily recognize the words that the user will probably say?</p><p>As far as I can tell there is no way.</p><p>I believe this site is wrong: <a href=""http://www.4feets.com/2009/04/speech-recognition-in-android-sdk-15/"" rel=""nofollow"">http://www.4feets.com/2009/04/speech-recognition-in-android-sdk-15/</a></p><p>According to the site, this code:    ArrayList&lt; String > potentialResults = new ArrayList&lt; String >();<br />    potentialResults.add(""yellow"");<br />    potentialResults.add(""green"");<br />    potentialResults.add(""blue"");<br />    potentialResults.add(""red"");      </p><pre><code>// Create Intent  Intent intent = new Intent(""android.speech.action.RECOGNIZE_SPEECH"");</code></pre><p>Will give a hint to the recognizer that you might say those words. However, it appears to do absolutely nothing. It also conflicts with the google documentation which says:</p><p>""An ArrayList of the potential results when performing ACTION_RECOGNIZE_SPEECH. Only present when RESULT_OK is returned."" This hints that the array is a return value NOT an input.</p><p>To test this out try adding:    ArrayList&lt; String > potentialResults = new ArrayList&lt; String >();<br />    potentialResults.add(""cumin""); and try to get the speech recognizer to recognize it. You will find it very difficult.</p><p>Does any one have insight into how to properly control the speech recognizer?</p>","108495","","","","","2011-11-17 00:42:30","How do I parameterize android speech recognition? android.speech.action.RECOGNIZE_SPEECH does not do anything","<android><speech-recognition>","2","1","1","",""
"1219312","1","1280213","","2009-08-02 17:18:34","58","99612","<p>I want a simple TextView to behave the way simple_list_item_1 in a ListView does. Here's the XML:</p><pre><code>&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content"" android:layout_width=""fill_parent""    android:gravity=""center"" android:focusable=""true""    android:minHeight=""?android:attr/listPreferredItemHeight""    android:textAppearance=""?android:attr/textAppearanceLarge""    android:background=""@android:drawable/list_selector_background"" /&gt;</code></pre><p>Everything works except for the text color that (expectedly) doesn't change in focused state. How do I make it change to <code>textAppearanceLargeInverse</code>?</p><p>TIA.</p>","15187","","15187","","2009-08-02 23:18:21","2014-03-28 14:50:05","Android selector & text color","<android><selector>","7","1","30","",""
"1221534","1","","","2009-08-03 10:05:42","18","8385","<p>I would like to require that a user type a password before being allowed to uninstall/remove my application.  How can I implement this functionality?</p>","138501","","3957","","2009-08-03 10:12:59","2014-02-27 10:42:45","Require a password to uninstall/remove application","<android>","5","7","10","",""
"1221774","1","1221918","","2009-08-03 11:15:20","0","557","<p>As there is JUnit test tool for Desktop java, is there some thing similiar in android so one can apply on android also?</p>","95877","","1065525","","2012-09-10 09:55:02","2012-09-10 09:55:02","Alternative to JUnit in Android","<java><android><unit-testing>","2","0","2","",""
"1222269","1","1223275","","2009-08-03 13:10:05","10","8606","<p>I created an application which creates and stores files to sdcard. Is there a way to bind the folder with application in order to delete all files when the user runs uninstall on android device?</p>","22996","","22996","","2009-08-03 13:15:10","2013-02-23 12:11:09","How to delete files created by the application on uninstall?","<android><uninstall>","6","1","6","",""
"1222302","1","7342278","","2009-08-03 13:16:12","40","15790","<p>Whats the best way to deploy several customized versions of a Android application? </p><p>Currently I have a script to exchange the resource folder for getting a customized version of my app. It works great, but all custom versions still have the same package name in the AndroidManifest.xml. Therefore it is not possible to install two customized versions of the app at the same time.</p><p><a href=""http://droidin.net/2009/05/13/android-multiapp/"">This is one solution for this problem, but that has to be done by hand</a></p><p>Can you think of a more easy solution, or how this could be built into a skript?</p><p>(btw: it is not for a porn/spam/whatever app, not even a paid one)</p>","81364","","","","","2012-12-05 09:40:56","Android – multiple custom versions of the same app","<android><automation>","7","1","36","",""
"1223552","1","1225310","","2009-08-03 17:27:45","6","3738","<p>Hello does anyone have a code example of how I can time bomb an Android application so It will not work after a given date?</p><p>I would like to release a ""beta"" application for testing but would like to make sure it will only work while I have the application officially in beta.</p><p>Thanks.</p>","122547","","","","","2011-12-12 07:07:44","How to time-bomb an Android application?","<android><android-1.5-cupcake>","2","1","6","",""
"1225848","1","","","2009-08-04 05:49:56","1","1296","<p>I need to know about the Android and the API. </p><p>I need information as to what are the latest applications that are developed on Android and/or using API.</p><p>Is there any doc that will explain the use of android or the SDK is self-sufficient? </p><p>If you can give ideas regarding an application that can be developed as a FYP.</p>","125049","","229044","","2012-07-17 04:01:34","2012-07-17 04:01:34","About Google Android and Google API?","<android><api>","3","1","","",""
"1226844","1","","","2009-08-04 11:00:24","2","2486","<p>In my Android application I want to encrypt a db file. How can I do that?</p>","138501","","95589","","2009-08-04 11:41:13","2009-08-05 09:38:58","Encrypting a DB File in Android","<android>","2","0","0","",""
"1229083","1","4651443","","2009-08-04 18:13:06","7","4130","<p>I'm developing on Android at the moment and want to know the best mobile app analytics for android and iPhone. I only need usage stats at the moment.</p>","150531","","","","","2011-07-18 19:23:40","Best Mobile Application Analytics Package?","<iphone><android><analytics>","6","1","2","2011-07-19 10:26:52","2011-07-19 10:27:01"
"1230457","1","4423204","","2009-08-04 23:38:16","9","5872","<p>On the iPhone, if an application is over 10MB, the iPhone will not allow you to download it over the celluar data network, requiring you to either download over wifi, or via iTunes on your computer. Does a similar rule apply to Google's Android Market? If so, what is the size limit for OTA downloads?</p>","92529","","92529","","2010-12-15 16:56:12","2012-08-30 20:12:15","Is there a size limit for Android Market downloads?","<android><google-play>","3","0","3","",""
"1231949","1","","","2009-08-05 08:49:13","3","2741","<p>I've got one of those newfangled Android phones and want to do some app development for it and am looking for guides. I haven't really found anything that looks promising for both an Android newbie and a Java newbie though.  I know PHP and code in it professionally as well as a basic smattering of some other languages so any 'for dummies' resource is probably not for me.</p><p>Are there any advisable books, resource sites or tutorials that focus on both these aspects (rather than one or the other) that assume you know nothing but not treat you like an idiot?</p><p>Thanks.</p>","130417","","","","","2011-09-29 06:47:32","Android development resources for a Java newbie","<java><android><guide>","4","0","4","",""
"1233345","1","","","2009-08-05 13:43:34","3","2651","<p>I'd like to know if there is already a way to know from a given set of markers, the zoom I should apply to the map or do I have to do it my self? (This depends on the resolution so i expected to find it in MapView because it knows its boundaries.)</p>","","Zied Hamdi","1777090","","2013-01-17 06:59:00","2013-01-17 06:59:00","How to compute the zoom level against returned markers?","<android>","4","0","4","",""
"1233812","1","","","2009-08-05 14:56:07","0","1085","<p>I am not able to use MediaPlayer/VideoView to make RTSP to work in Android. So I have created a client to interact with RTSP server, I have succeeded in doing this.I am able to get the video/audio frame from RTSP server (MySpace) in Android. Now I want to play the frames. I have searched OpenCore APIs to play the frames, but didn't get any APIs. </p><p>My investigation:There is a class PlayerDriver.cIt creates two sinks one audio and other video. </p><pre><code>handleSetVideoSurfacehandleSetAudioSink</code></pre><p>Two objects of type <code>PVPlayerDataSinkPVMFNode</code> are created. I suspect this class has a way to give the stream as input, but I am not getting the definition of this class. </p><p>Can you suggest me is there any class I need to look into it?</p>","28641","","1318946","","2014-01-29 12:54:25","2014-01-29 12:54:25","Video/Audio frame as input to OpenCore","<android><android-mediaplayer><android-mediarecorder><rtsp-client><opencore>","1","0","","",""
"1236187","1","1236804","","2009-08-05 22:54:44","0","1853","<p>I need to exclude an activity from appearing in recent launched menu, but i am not able of adding <strong>android:excludeFromRecents=""true""</strong> in AndroidManifest.xml, I have to do it in runtime.</p><p>Does anyone knows if there is possible to set FLAG_EXCLUDE_FROM_RECENTS to the activity?</p>","7363","","","","","2009-08-06 03:15:07","Exclude activity from recents menu by code","<android>","1","0","","",""
"1238708","1","4722971","","2009-08-06 13:00:15","4","2890","<p>I'm interested in using Android for a <a href=""http://www.eink.com/technology/howitworks.html"" rel=""nofollow"">E-Ink</a> based platform. I know it has been <a href=""http://vimeo.com/3162590"" rel=""nofollow"">demonstrated</a> once by MOTO, but I'm interested in using it for a commercial grade product and not 'just' a technology demo.  I have got a question on the ability to change the platform to cope with specific display effect caused by E-Ink. I'm asking this question from the role of system architect and have no prior experience with Android.</p><p>E-ink has several characteristics which are very different than the common LCD displays:</p><ul><li>time to update display (50-700ms)</li><li>it costs power to <em>change</em> the display (none to maintain)</li><li>display life time is determined by number of display updates!</li><li>tradeoffs can be made between quality, performance and display lifetime</li><li>grayscale versions available</li></ul><p>The great thing: it costs no power to retain display information and they can be read in bright sunlight with no backlight. Also the display can be literally as thin as paper...</p><p>This means that the platform software needs to have a degree of control over the number of display updates and the type of display updates to get the best performance. Otherwise, an application which is unaware of the display characteristics could quickly drain the battery, or worse, shorten display life time to months instead of years. Conceptually I'd be interested in replacing a display driver, but I'm not sure if this part is open. I know it is hard to get info on the Qualcomm chipsets.... </p><p>My question: can this be done? Can the Android platform be modified to support a drastically different display effect? Any pointers to an android roadmap?</p><p>The reason I find Android interesting for this application is because there is a significant overlap in functionality (from cell phone to browser).</p><p>Thanks!</p>","147820","","147820","","2009-08-11 13:56:02","2012-01-18 17:02:20","Android with E-Ink display","<android>","5","0","3","",""
"1239026","1","","","2009-08-06 13:54:07","62","137236","<p>How to create a file, write data into it and read data from it on Android? If possible provide a code snippet.</p>","132724","","1448202","","2012-07-12 18:24:29","2013-04-30 22:13:24","How to create a file in Android?","<android>","3","1","26","",""
"1239959","1","1240015","","2009-08-06 16:14:43","0","1709","<p>I need to retain a complex object in my service, so I can reliably come back to it (it holds updates). Initially I coded it just as a class filed in my Service implementation but I'm observing that the updates object is periodically reset to null which tells me that server class itself is recreated. Can someone recommend lightweight reliable strategy to save and recreate such updates object (I can make it serializable)</p>","135946","","","","","2009-08-06 22:26:30","Persistent field in Android service","<android><serialization><persistence>","2","0","0","",""
"1240967","1","1241309","","2009-08-06 19:46:49","4","1725","<p>I created a layout xml file that contains an extended textview.What I want is to draw the textview in a bitmap.What do I have to do after inflating the view so that I can use the draw method on the my canvas?</p><p>Thanks</p>","64475","","","","","2011-10-25 13:12:43","draw inflated layout xml on an bitmap","<android>","1","0","","",""
"1242884","1","","","2009-08-07 04:26:18","0","1686","<p>I am adding layouts programmatically.I have added a scrollview as a parent layout and a combination of horizontal and vertical linearlayouts when I add a list view in the scrollview I am getting an issue that my UI is not taking full screen although the listview height is set to fill parent .There is a blank space added at the bottom and the height of the listview gets very small .I haven't find the reason why it's happening, is it a bug in android for scrollview ?</p>","95877","","1327899","","2012-06-28 04:34:42","2012-06-28 04:34:42","scroll view issue Android","<java><android>","2","0","","",""
"1243066","1","2931033","","2009-08-07 05:42:02","247","147059","<p>I recently learned about the ability of iPhone apps to receive nearly instantaneous <a href=""http://developer.apple.com/iphone/program/sdk/apns.html"">notifications to apps</a>. </p><p>This is provided in the form of push notifications, a bespoke protocol which keeps an always on data connection to the iPhone and messages binary packets to the app, which pops up alerts <em>incredibly</em> quickly, between 0.5 - 5 seconds from server app send to phone app response time. This is sent as data - rather than SMS - in very very small packets charged as part of the data plan not as incoming messages. </p><p>I would like to know if using Android there is either a similar facility, or whether it's possible to implement something close to this using Android APIs. To clarify I define similar as: </p><ul><li>Not an SMS message, but some data driven solution</li><li>As real time as is possible</li><li>Is scalable - ie: as the server part of a mobile app, I could notify thousands of app instances in seconds</li></ul><p>I appreciate the app could be pull based, HTTP request/response style, but ideally I don't want to to be polling that heavily just to check for notification .. besides which it's like drip draining the data plan.</p>","52175","","","","","2014-04-17 12:41:17","Does Android support near real time push notification","<android><push-notification>","15","2","157","",""
"1243079","1","1243134","","2009-08-07 05:45:00","8","4341","<p>Now that we can <a href=""http://developer.android.com/guide/developing/tools/adb.html#sqlite"">Examining sqlite3 Databases from a Remote Shell</a>, is it possible to examine SharedPreferences from adb shell? Since it would be much more convenient to examine and manipulate SharedPreferences from command line when debugging.</p><p>Or put in another way, in what files SharedPreferences are saved, and how to view and modify these files?</p>","56149","","","","","2011-10-19 20:33:55","How to examine SharedPreferences from adb shell?","<android>","1","0","6","",""
"1243083","1","1257102","","2009-08-07 05:46:12","6","2465","<p>In discussion with some colleagues we were wondering whether OpenGL work developed for Android or iPhone are effectively interchangeable given that both support the spec. </p><p>Or is the reality of sharing OpenGL between the two platforms more a case of quirks, tweaks and not as easy as one might have hoped.</p>","52175","","44729","","2011-05-26 15:46:47","2011-05-26 15:46:47","OpenGL for Android and iPhone","<iphone><android><opengl-es>","3","0","2","",""
"1243181","1","","","2009-08-07 06:18:19","15","14956","<p>Is it possible to store user defined objects in a SQLite database from Android? For example: I am creating one class and I want to store that class object in the database.  Is it possible? If it is, how to proceed? On the Blackberry platform, I am able to store objects directly in persistent objects.  Is it possible to do this with SQLite and Android?</p>","132724","","61332","","2009-08-07 06:24:09","2013-04-14 11:11:23","How to store object in sqlite database?","<android>","3","0","7","",""
"1243199","1","1243378","","2009-08-07 06:24:59","38","126677","<p>I am trying to use this query upon my Android database, but it does not return any data.  Am I missing something?</p><pre><code>SQLiteDatabase db = mDbHelper.getReadableDatabase();    String select = ""Select _id, title, title_raw from search Where(title_raw like "" + ""'%Smith%'"" +    "")"";            Cursor cursor = db.query(TABLE_NAME, FROM,             select, null, null, null, null);    startManagingCursor(cursor);    return cursor;</code></pre>","152286","","267702","","2013-06-12 01:16:38","2014-04-14 03:07:06","How to perform an SQLite query within an Android application?","<android><sqlite>","4","0","19","",""
"1243347","1","1251142","","2009-08-07 07:08:19","3","1233","<p>Are calls to Canvas.drawPath()/drawArc()/etc hardware accelerated, passedto a device native implementation or implemented in Java?</p><p>Or is OpenGL the only way to achieve hardware accelerated drawing?</p><p>I am trying to determine if it is feasible to use the Canvas API forrealtime animation.</p>","17424","","","","","2010-07-04 06:11:49","Is drawing through the Canvas class hardware accelerated on Android?","<android><graphics><hardware><2d>","1","0","","",""
"1243433","1","1243448","","2009-08-07 07:31:23","88","36095","<p>When is it necessary, or better to use a SurfaceView instead of a View?</p>","17424","","","","","2014-03-28 08:35:30","Android: Difference between SurfaceView and View?","<android><graphics><2d>","4","0","22","",""
"1244524","1","1275656","","2009-08-07 12:48:28","0","765","<p>I created a table with the name SONGS in the assets/folder. And after that I create a new project, my project run to create a database name ""data"" with table name ""BOOKS"". But I found that the table ""SONGS"" also created in my new database? And now my database have two table ""BOOKS"" and ""SONGS"". I don't know why? How can I delete completely the ""SONGS"" table?</p>","152286","","152286","","2009-08-13 07:01:39","2009-08-14 01:52:25","How to delete completely the initial table in android","<database><android><table>","2","0","1","",""
"1245296","1","","","2009-08-07 15:06:32","1","4724","<p>I have a very popular Apple iPhone app and wish to port to another mobile platform. What is best the Palm Pre or Google Android? The Android has more popularity with manufacturers but I worry about installation issues and incompatibilities. The Pre has one carrier and one mfr but I worry its sales will be too low. </p><p>My app uses an SQLite database and is content rich and over 200MB.</p>","151178","","811","","2009-09-15 21:25:42","2011-08-09 20:13:59","iPhone app port to Palm Pre or Android?","<iphone><android><palm-pre>","8","0","","",""
"1245543","1","1245648","","2009-08-07 15:49:32","13","20541","<p>I have a Listview with a ContextMenu, but when I setIcon for ContextMenu look like it doesn't work</p><pre><code>public void onCreateContextMenu(ContextMenu menu , View v,     	ContextMenuInfo menuInfo){    super.onCreateContextMenu(menu, v, menuInfo);    menu.add(0, DELETE_ID, 0, R.string.context_menu_favorite)    	.setIcon(android.R.drawable.btn_star);    	}</code></pre>","152286","","267542","","2010-03-04 17:37:50","2014-04-03 06:48:09","Add Context Menu Icon in android","<android><icons><android-context>","5","1","6","",""
"1246613","1","","","2009-08-07 19:38:25","1","6538","<p>In Android, I want to present the user with a list.  When an item on the list is selected some action is performed, and this list item is no longer selectable.  It is also 'grayed out' or the like to indicate that it cannot be selected the next time the list is displayed.  I have seen the isSelectable() override in Adapter, but I believe this causes the item to be treated as a separator,  which causes visual problems.  And I have not found a way to 'gray out' an item.  Any ideas?  Thanks...</p>","","Michael Grimes","","","","2012-04-05 12:46:26","Android list with 'grayed out' items","<android><listview>","4","0","2","",""
"1247175","1","1247740","","2009-08-07 21:49:18","1","2557","<p>Hey all. I'm trying to use an imageview as a button, and I want to be able to change the image whenever the button's pressed. I have an OnClickListener set, but what do I have to do about when the user's finger is no longer down, over the button? How do I revert to the original image?</p>","122961","","","","","2009-08-08 04:46:36","android onclickuplistener for an imageview button?","<android><button><onclick><android-widget>","2","0","","",""
"1247983","1","1248019","","2009-08-08 04:34:53","2","7071","<p>i`m trying to send an email using native email client on androidphone.</p><p>I have tried following ways to add an attachment to the mail...</p><p>method--1  </p><pre><code>Intent sendIntent = new Intent(Intent.ACTION_SEND);sendIntent.setType(""image/jpeg"");sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(""file://sdcard/abc.jpg""));</code></pre><p>method 2</p><p>Sending the image as body content---</p><pre><code>sendIntent.putExtra(Intent.EXTRA_TEXT, ""&lt;HTML&gt;&lt;BODY&gt;&lt;b&gt;&lt;IMG**SRC=\""data:image/jpeg;base64,"" + &lt;imagepath&gt; + ""\""**alt = \""**pleaseview thisimage\""/&gt;&lt;/b&gt;&lt;/BODY&gt;&lt;/HTML&gt;"");</code></pre><p>i can successfully attach the image manually but when i tried toattach and send it programmatically the mail was sent withoutattachement.</p><p>Please let me know if there is a way to send an attachmentprogrammatically by using email client</p>","152867","","443387","","2011-03-09 10:31:51","2012-04-08 07:56:11","problem sending an email with an attachment programmatically","<android>","2","1","4","",""
"1248292","1","1253866","","2009-08-08 07:54:14","62","93910","<p>I am creating a file to send as an attachment to an email. Now I want to delete the image after sending the email. Is there a way to delete the file?</p><p>I have tried <code>myFile.delete();</code> but it didn't delete the file.</p><hr><p>I'm using this code for Android, so the programming language is Java using the usual Android ways to access the SD card. I am deleting the file in the <code>onActivityResult</code> method, when an <code>Intent</code> is returned to the screen after sending an email.</p>","152867","","1401895","","2013-03-27 19:19:32","2014-04-07 12:35:20","How to delete a file from SD card?","<android><android-sdcard>","4","3","16","",""
"1249973","1","4177581","","2009-08-08 21:39:45","298","185907","<p>Are there any tools or recipes for turning Android DEX (VM bytecode) files into corresponding Java sourcecode?</p>","15721","","457982","","2011-01-10 10:30:54","2014-03-15 18:41:22","decompiling DEX into Java sourcecode","<java><android><reverse-engineering><decompiler><dex>","9","3","193","2014-04-04 16:14:53",""
"1250220","1","","","2009-08-09 00:10:35","0","690","<p>I understand that if you specify thread priorities other than the default in Java then it makes the program platform specific.  If you were to create threads for an android application and modify the priorities then would the app platform specific across different android versions (i.e. Cupcake/Donut and modified versions of Android like HTC's Sense UI etc.)?</p>","133295","","1777090","","2013-01-17 06:07:05","2013-01-17 06:07:05","Thread portability across Android Platforms","<java><android><multithreading><priority>","2","0","","",""
"1252172","1","","","2009-08-09 20:20:28","8","4169","<p>I am building a camera app, where videos are continuously being captured and saved to the SD card. The videos are short (few minutes), and their length are preset with setMaxDuration().</p><p>The whole process works fine, while the main activity is in the foreground. But, when I go to another activity (e.g. settings), the video recording works in the background only until max duration is reached. The file is saved, but a new sequence can not be startedbecause prepare() fails, apparently because setPreviewDisplay() doesn't like not having a proper surface to attach to.</p><p>I tried to use a dummy Surface, a dummy SurfaceHolder, lockCanvas(), and various other tricks, but nothing works. Is there a way to initialize MediaRecorder without a valid surface? </p>","153385","","213269","","2011-08-12 08:55:36","2013-01-14 08:02:57","Android: How to initialize MediaRecorder without a valid surface for video preview?","<android><video-capture><mediarecorder>","4","0","3","",""
"1252246","1","1252505","","2009-08-09 20:46:45","3","7266","<p>So, I've read the android <a href=""http://developer.android.com/guide/developing/tools/aidl.html"" rel=""nofollow"">AIDL</a> documentation and have a general idea of how RPC works between an Activity and a Service. However, for my application it seems overboard to implement such features: basically, I want to pass a Service a nice handler so its thread can pass data to my Activity. Currently I'm getting around this by using a static public member (a hack) but I would prefer just passing a Handler object in the Service's starting Intent. E.g. I can easily pass ints to my service upon creation:</p><pre><code>int x = 0;Intent svc = new Intent(this, MyService.class);svc.putExtra(""x"",x);startService(svc);</code></pre><p>However since a Handler isn't serialize-able , I haven't found a way to pass it to the service without a simple static member hack. Any insight? Or, am I just going to have to suck it up and do a formal RPC to the service? </p>","136903","","","","","2010-12-03 09:13:36","Android: Passing a Service a Handler","<java><android><rpc>","2","0","","",""
"1254074","1","1254217","","2009-08-10 10:11:10","11","37528","<p>I have a class not extend from ListActivity, so how can I replace this code without error?</p><pre><code>SimpleCursorAdapter adapter = new SimpleCursorAdapter(  this,  R.layout.sbooks_row,  cursor, from,  to);setListAdapter(adapter);</code></pre>","152286","","511736","","2014-01-28 02:22:47","2014-01-28 02:22:47","How to call the setListAdapter in android","<android><listview>","1","0","6","",""
"1254228","1","","","2009-08-10 10:49:24","0","954","<p>How to get attribute and values from xml in android through libxml2 in android give me sample code ........i need to get value type and tag for </p><p>helloguysvodafone</p><p>and populate a class objet which has same data member .like  this ...type =string value= hellotag=APNUserId </p>","","","1318946","","2014-01-29 12:53:42","2014-01-29 12:53:42","How to get attribute and values from xml in android through libxml2","<android><android-xml>","1","1","","",""
"1254467","1","","","2009-08-10 11:54:47","0","252","<p>In one android application, I created a database file in <code>data/data/com.rams/databases/dbfilename</code>.</p><p>If I created a second application with the same package name (<code>com.rams</code>) and I access the database file created with my first application, the second application is able to access the database contents.</p><p>How can I secure the database file created with my first application?</p>","138501","","19410","","2009-08-10 12:11:14","2009-08-10 12:11:14","protect a file","<android><security><encryption>","1","0","","",""
"1254644","1","1254723","","2009-08-10 12:40:50","2","3339","<p>I need some help to store a Object in an SQLite database using Android.I don't know whether it is possible or not.If it is possible means please give some code snippets to create a table which can store an object.</p><p>Regards,Rajapandian.K</p>","131062","","135152","","2011-05-25 03:14:19","2011-05-25 03:14:19","How to store an Object into a SQLite database in Android?","<java><android><sqlite>","1","0","","",""
"1254832","1","1258012","","2009-08-10 13:19:07","0","7662","<p>How to get EditText's value from sub-Activity? With a condition that if I click back button on the phone, there's no error in Sub-Activity?</p><p>This is my <strong>Sub-Activity</strong> code:</p><pre><code>    public class SBooksSearch extends Activity {    private EditText mTextSearch;       @Override    protected void onCreate(Bundle savedInstanceState) {        // TODO Auto-generated method stub        super.onCreate(savedInstanceState);             setContentView(R.layout.sbooks_search);         mTextSearch = (EditText)findViewById(R.id.edit_search);             Button searchButton = (Button)findViewById(R.id.btn_search);                searchButton.setOnClickListener(new View.OnClickListener(){            public void onClick(View v){                                Intent data = new Intent();                             data.putExtra(SBooksDbAdapter.KEY_TITLE_RAW, mTextSearch.getText().toString());                         setResult(RESULT_OK, data);                finish();            }        });    }       @Override    protected void onSaveInstanceState(Bundle outState){        super.onSaveInstanceState(outState);            }    @Override    protected void onPause(){        super.onPause();    }    @Override    protected void onResume(){        super.onResume();           }}</code></pre><p>This is my <strong>Activity-Result:</strong></p><pre><code>@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent intent){super.onActivityResult(requestCode, resultCode, intent);        switch(requestCode){case ACTIVITY_SEARCH:Bundle extras = getIntent().getExtras();mTitleRaw = extras != null ? extras.getString(SBooksDbAdapter.KEY_TITLE_RAW) : null;                 if(mTitleRaw!=null){      Cursor cursor = mDbHelper.searchData(mTitleRaw);    String[] from = new String[]{ SBooksDbAdapter.KEY_ROWID,                        SBooksDbAdapter.KEY_TITLE, SBooksDbAdapter.KEY_LYRICS };        int[] to = new int[]{ R.id.id, R.id.title, R.id.lyrics };        SimpleCursorAdapter adapter =                     new SimpleCursorAdapter(this, R.layout.sbooks_row, cursor, from, to );           setListAdapter(adapter);            }                      break;        }    }</code></pre>","152286","","2617352","","2013-12-19 07:59:00","2013-12-19 07:59:00","Get EditText's value from sub Activity","<android><activity><android-edittext>","1","4","","",""
"1254970","1","1255885","","2009-08-10 13:43:14","2","5392","<p>There's a method for altering background color but not font.<br>Any ideas?</p>","15187","","142162","","2011-09-24 12:50:05","2014-01-23 19:22:56","Changing text color in a WebView?","<android><webview>","5","0","","",""
"1256464","1","","","2009-08-10 18:33:56","1","894","<p>I try to invoke MMS's Attach Image ACtivity, this is my code:</p><pre><code>          Intent intent2 = new Intent(""com.android.mms.action.ATTACH_IMAGE"");          intent2.setType(""image/*"");          intent2.putExtra(Intent.EXTRA_STREAM, mUri);          try {              startActivity(intent);          } catch (ActivityNotFoundException e) {             e.printStackTrace(System.err);          }</code></pre><p>But I get this exception:</p><pre><code>m.android.mms/com.android.mms.AttachImage}: java.lang.IllegalAccessException: access to class not allowedE/AndroidRuntime(  673):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2219)E/AndroidRuntime(  673):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2332)E/AndroidRuntime(  673):        at android.app.ActivityThread.access$1800(ActivityThread.java:110)E/AndroidRuntime(  673):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1717)E/AndroidRuntime(  673):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  673):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  673):        at android.app.ActivityThread.main(ActivityThread.java:4021)E/AndroidRuntime(  673):        at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  673):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  673):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)E/AndroidRuntime(  673):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)E/AndroidRuntime(  673):        at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  673): Caused by: java.lang.IllegalAccessException: access to class not allowedE/AndroidRuntime(  673):        at java.lang.Class.newInstanceImpl(Native Method)E/AndroidRuntime(  673):        at java.lang.Class.newInstance(Class.java:1472)E/AndroidRuntime(  673):        at android.app.Instrumentation.newActivity(Instrumentation.java:1097)E/AndroidRuntime(  673):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)</code></pre><p>Can you please tell me why?Thank you.</p>","125440","","1318946","","2014-01-29 12:52:42","2014-01-29 12:52:42","Exception when invoking MMS's Attach Image activity","<android><android-mms>","1","0","","",""
"1258275","1","7855852","","2009-08-11 02:57:07","42","31498","<p>I need 2 ways of showing vertical label in Android: </p><ol><li>Horizontal label turned 90 degrees counterclockwise (letters on the side)</li><li>Horizontal label with letters one under the other (like a store sign)</li></ol><p>Do I need to develop custom widgets for both cases (one case), can I make TextView to render that way, and what would be a good way to do something like that if I need to go completely custom?</p>","135946","","","","","2011-10-24 05:57:55","Vertical (rotated) label in Android","<android><label><textview><vertical-alignment>","3","1","35","",""
"1258526","1","","","2009-08-11 05:05:42","0","1243","<p>I want to know how to parse the web service response data in android .Actually i m accessing the .net web service.I can get a result of some complex type.i want to know how to retrive a particular value from this complex type.Is there is any parser avilable to parse the content of the response or else we have to parse manually? If u have any code snippet pls bring me.regards,s.kumaran.</p>","132724","","1318946","","2014-01-29 12:51:32","2014-01-29 12:51:32","How to parse the webservice response?","<android><android-webservice>","3","0","","",""
"1258645","1","2800128","","2009-08-11 06:04:26","0","877","<p>Say, a WebView with an html that scrolls vertically. What would be the basic steps to make it scroll horizontally (screen by screen)? Can't grasp the idea.</p>","15187","","","","","2010-05-10 03:21:12","Change scrolling direction","<android>","2","0","1","",""
"1259171","1","1259828","","2009-08-11 09:00:19","1","2147","<p>I would like to create a custom button with framed caption in right top corner.Looks like it requires to use overlays, but it is available only for map view.</p><p>Button should work following way:1. User clicks on button.2. Button behaves as an usual button, so we see that it is focused, pressed or has normal state depending on what is currently performed.3. The caption in right top corner doesn't change.</p><p>So, do you have any ideas how this can be implemented?Possibly, to override onDraw method, but may be there will be better approaches.</p>","139394","","1777090","","2013-01-17 06:20:49","2013-01-17 06:20:49","Android: Custom Button with overlay","<android><user-interface><custom-controls>","1","0","1","",""
"1259908","1","1259937","","2009-08-11 11:59:21","0","895","<p>i want to use JSR 172 API in android.But supports core java,is it possible to use JSR 172 in android.Please give some code snippets or suggests any web sites to learn about it.</p>","131062","","","","","2009-08-18 15:26:07","How can i use JSR 172 in Android?","<android>","2","0","","",""
"1260010","1","1260024","","2009-08-11 12:22:09","5","1699","<p>As for as I know that android application can be developed in core java only. But is it possible to code android with J2ME? Please give some example codes if possible.</p>","132724","","1777090","","2013-01-17 06:19:10","2013-01-17 06:19:10","How can I code Android with J2ME?","<android><java-me><midp>","3","0","2","",""
"1260422","1","","","2009-08-11 13:36:47","21","19374","<p>I'm trying to set the background of a webview to a drawable image resource in Android.</p><p>From the sdk it seems something like this would work but it doesn't.</p><pre><code>WebView web = (WebView) findViewById(R.id.webView);web.setBackgroundResource(R.drawable.backgroundmain);web.loadData(profile, ""text/html"", ""UTF-8"");</code></pre><p>Any idea's?</p>","","JamieBennett","958370","","2012-02-10 12:49:30","2012-02-10 12:49:30","Setting webview background image to a resource graphic in Android","<android><android-webview><android-ui><android-resources>","3","0","8","",""
"1262028","1","","","2009-08-11 18:07:09","2","4406","<p>I'm making a App to send SMS trough VOIP providers from betamax...</p><p>To send I just need to execute the url </p><pre><code>https://www.12voip.com/myaccount/sendsms.php?username=w?&amp;password=x&amp;from=y&amp;to=z&amp;text=some%20text</code></pre><p>My app already creates the URL, but i cant understand how to execute...i think i have to make an http request....but after a few hours after answers i still didnt understood....</p><p>Can anyone help me execute that url with android? </p>","","Oinquer","38971","","2009-08-11 18:18:21","2009-08-11 19:49:33","How to execute an URL using Android?","<java><android>","2","1","","",""
"1262407","1","1262552","","2009-08-11 19:27:56","0","239","<p>How do I read input from the touchscreen in Android?</p>","30059","","","","","2009-08-11 19:56:53","How to pick up input in Android?","<android>","2","1","","",""
"1264207","1","1295814","","2009-08-12 04:24:15","0","4596","<p>I can call a webservice with KSOAP2 from android,now i want to know is it possible to call it without using KSOAP.If anyone knows the answer please help me.</p>","131062","","131062","","2009-08-12 05:29:32","2012-05-22 05:55:09","How can i call a web service without using KSOAP2 in Android?","<android>","2","0","2","",""
"1264397","1","","","2009-08-12 05:45:15","16","33613","<p>In Android, how do I get the application's id programatically (or by some other method), and how can I communicate with other applications using that id?</p>","138501","","15168","","2009-08-12 06:10:16","2011-04-19 14:23:29","How to get Android application id?","<android>","7","0","3","",""
"1264465","1","","","2009-08-12 06:15:05","1","17008","<p>I try to create 2 rows of buttons in android layout.xml file.The first row is left-aligned, the second row is center-aligned.</p><p>Here is what I did, but I end up getting 1 row of buttons. Can you please tell me what am I doing wrong?</p><pre><code>enter code here&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FrameLayoutxmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""wrap_content""android:layout_height=""fill_parent""&gt; &lt;LinearLayout          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:orientation=""horizontal""          android:layout_gravity=""bottom|left""        &gt;         &lt;Button           android:id=""@+id/btn1""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          /&gt;        &lt;/LinearLayout&gt;     &lt;LinearLayout          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:orientation=""horizontal""          android:layout_gravity=""bottom|center""        &gt;         &lt;Button           android:id=""@+id/btn2""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          /&gt;       &lt;Button           android:id=""@+id/btn3""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          /&gt;        &lt;/LinearLayout&gt;&lt;/FrameLayout&gt;&lt;/pre&gt;</code></pre>","89599","","89599","","2009-08-12 06:20:35","2013-04-06 12:55:31","How can I create 2 rows of buttons in android layout.xml file","<android>","4","0","","",""
"1264530","1","","","2009-08-12 06:35:13","0","2609","<p>Can anyone tell me which tool is used to generate Stub in Android and is it possible to use JAX-RPC concept to call the web service in android.If is it possible please provide me some code with example.regards,s.kumaran</p>","132724","","","","","2013-05-27 16:33:04","How to generate stub in android?","<android>","3","0","","",""
"1265095","1","1268442","","2009-08-12 09:14:13","3","28855","<p>I want to get the Text data value from Sub-Activity back. And everything is ok. But when the Sub-activity was opened, then I just click back ""button"" on the phone, it throw an exception error. I found on the android NotePad life-cycle control toturial but It's hard to understand. Can someone help me? This is my code:</p><pre><code>public class SBooks extends ListActivity {private String title_raw;private SBooksDbAdapter mDbHelper;	private static final int ACTIVITY_SEARCH = 0;	private static final int SEARCH_ID = Menu.FIRST;	 @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.sbooks_list);           mDbHelper = new SBooksDbAdapter(this);    mDbHelper.open();                    }// Create Menu Option@Overridepublic boolean onCreateOptionsMenu(Menu menu) {            boolean result = super.onCreateOptionsMenu(menu);    menu.add(0, SEARCH_ID, 0, R.string.menu_search);        	    return result;      }@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch(item.getItemId()){    case SEARCH_ID:        Intent intent = new Intent(this, SBooksSearch.class);        startActivityForResult(intent, ACTIVITY_SEARCH);        	    return super.onOptionsItemSelected(item);}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent intent){	super.onActivityResult(requestCode, resultCode, intent);		switch(requestCode){		case ACTIVITY_SEARCH:			Bundle bundle = intent.getExtras();			title_raw = bundle.getString(SBooksDbAdapter.KEY_TITLE_RAW);			if(title_raw!=null){				Cursor cursor = mDbHelper.searchData(title_raw);				String[] from = new String[]{ SBooksDbAdapter.KEY_ROWID,						SBooksDbAdapter.KEY_TITLE, SBooksDbAdapter.KEY_LYRICS };				int[] to = new int[]{ R.id.id, R.id.title, R.id.lyrics };				SimpleCursorAdapter adapter = 					new SimpleCursorAdapter(this, R.layout.sbooks_row, cursor, from, to );				setListAdapter(adapter);		}	}	}</code></pre><p>}</p><p>This is my Sub-Activity:</p><pre><code>public class SBooksSearch extends Activity {private EditText mTextSearch;private Button searchButton;private SBooksDbAdapter mDbHelper;@Overrideprotected void onCreate(Bundle savedInstanceState) {	// TODO Auto-generated method stub	super.onCreate(savedInstanceState);			setContentView(R.layout.sbooks_search);		mTextSearch = (EditText)findViewById(R.id.text_search);			searchButton = (Button)findViewById(R.id.btn_search);			searchButton.setOnClickListener(new View.OnClickListener(){		public void onClick(View v){							Intent intent = new Intent();			intent.putExtra(SBooksDbAdapter.KEY_TITLE_RAW, mTextSearch.getText().toString());							setResult(RESULT_OK, intent);			finish();		}	});}	@Overrideprotected void onSaveInstanceState(Bundle outState){	super.onSaveInstanceState(outState);}@Overrideprotected void onPause(){	super.onPause();	checkState();}@Overrideprotected void onResume(){	super.onResume();		}private void checkState() {		} }</code></pre><p>This is Logcat:</p><pre><code>08-12 18:44:39.211: WARN/InputManagerService(581): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@43719140 (uid=10004 pid=623)08-12 18:44:39.510: INFO/ActivityManager(581): Displayed activity com.original.sbooks/.SBooks: 4934 ms08-12 18:44:40.821: WARN/KeyCharacterMap(730): No keyboard for id 008-12 18:44:40.821: WARN/KeyCharacterMap(730): Using default keymap: /system/usr/keychars/qwerty.kcm.bin08-12 18:44:41.412: INFO/ARMAssembler(581): generated scanline__00000177:03515104_00001A01_00000000 [ 64 ipp] (89 ins) at [0x297608:0x29776c] in 952924 ns08-12 18:44:41.520: INFO/ARMAssembler(581): generated scanline__00000177:03515104_00000A01_00000000 [ 46 ipp] (70 ins) at [0x297798:0x2978b0] in 517061 ns08-12 18:44:42.171: INFO/ActivityManager(581): Starting activity: Intent { comp={com.original.sbooks/com.original.sbooks.SBooksSearch} }08-12 18:44:52.196: WARN/ActivityManager(581): Launch timeout has expired, giving up wake lock!08-12 18:44:52.279: WARN/ActivityManager(581): Activity idle timeout for HistoryRecord{436bfc80 {com.original.sbooks/com.original.sbooks.SBooksSearch}}08-12 18:44:57.350: DEBUG/dalvikvm(620): GC freed 4103 objects / 231808 bytes in 75ms08-12 18:45:05.130: DEBUG/dalvikvm(649): GC freed 2604 objects / 150112 bytes in 88ms08-12 18:45:10.120: DEBUG/dalvikvm(623): GC freed 2750 objects / 149592 bytes in 71ms08-12 18:45:11.920: INFO/ActivityManager(581): Displayed activity com.original.sbooks/.SBooksSearch: 29748 ms08-12 18:45:17.263: WARN/ActivityManager(581): Activity pause timeout for HistoryRecord{436bfc80 {com.original.sbooks/com.original.sbooks.SBooksSearch}}08-12 18:45:26.762: WARN/ActivityManager(581): Launch timeout has expired, giving up wake lock!08-12 18:45:27.272: WARN/ActivityManager(581): Activity idle timeout for HistoryRecord{435a7760 {com.original.sbooks/com.original.sbooks.SBooks}}08-12 18:46:04.905: DEBUG/AndroidRuntime(730): Shutting down VM08-12 18:46:04.905: WARN/dalvikvm(730): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)08-12 18:46:04.905: ERROR/AndroidRuntime(730): Uncaught handler: thread main exiting due to uncaught exception08-12 18:46:04.991: ERROR/AndroidRuntime(730): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=0, data=null} to activity {com.original.sbooks/com.original.sbooks.SBooks}: java.lang.NullPointerException08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3005)08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3047)08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at android.app.ActivityThread.access$2300(ActivityThread.java:112)08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1721)08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at android.os.Handler.dispatchMessage(Handler.java:99)08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at android.os.Looper.loop(Looper.java:123)08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at android.app.ActivityThread.main(ActivityThread.java:3948)08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at java.lang.reflect.Method.invokeNative(Native Method)08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at java.lang.reflect.Method.invoke(Method.java:521)08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at dalvik.system.NativeStart.main(Native Method)08-12 18:46:04.991: ERROR/AndroidRuntime(730): Caused by: java.lang.NullPointerException08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at com.original.sbooks.SBooks.onActivityResult(SBooks.java:111)08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at android.app.Activity.dispatchActivityResult(Activity.java:3595)08-12 18:46:04.991: ERROR/AndroidRuntime(730):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3001)</code></pre>","152286","","152286","","2009-08-12 12:18:05","2010-12-09 07:36:37","Control the back ""button"" in android","<android><activity>","2","2","0","",""
"1266527","1","1266585","","2009-08-12 14:27:44","0","492","<p>I've just started developing Android applications. I'm having a little problem with networking. If I run the following code I get an ""unknown error"" exception message:</p><pre><code>import org.apache.http.impl.client.DefaultHttpClient;import org.apache.http.client.ClientProtocolException;import.org.apache.http.client.methods.HttpGet;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class Menu extends Activity {    /** Called when the activity is first created. */    @Override   public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    DefaultHttpClient client = new DefaultHttpClient();    HttpGet method = new HttpGet(""http://www.google.com"");    try {        client.execute(method);        TextView t = (TextView) findViewById(R.id.myTextView);        t.setText(""Ok"");    } catch (ClientProtocolException e) {        TextView t = (TextView) findViewById(R.id.myTextView);        t.setText(e.getMessage());    } catch (IOException e) {        TextView t = (TextView) findViewById(R.id.myTextView);        t.setText(e.getMessage());    }    }}</code></pre><p>I've been lookign up the error and it seems fairly common. It's a problem with DNS resolution on the emulator. However, I can use the browser on the emulator without a problem and visit any website I want. I've also tried replacing the domains with IP addresses without luck.</p><p>How can I fix this problem? I'm using Windows Vista and developing in eclipse with the ADT plugin.</p>","130076","","1777090","","2013-01-17 06:20:11","2013-01-17 06:20:11","Android - Unknown Error when trying to use networking","<android><eclipse><exception><networking><dns>","1","0","","",""
"1268942","1","1367997","","2009-08-12 21:49:36","14","10917","<p>I'm trying to create an app for Android that simply sends a command to an SSH server. No response needed, I just need to be able to send a command. I was wondering if there's any java library out there that I could use?</p><p>No advanced stuff needed, just a pure connection to send the command.</p>","155439","","","","","2011-01-31 22:37:20","SSH Java-library for Android?","<java><android><ssh><command>","1","0","9","",""
"1270191","1","2049156","","2009-08-13 05:35:12","4","6441","<p>I am using KSOAP2 to call a .NET webservice from android application,and the response from the web service is in the following format</p><pre><code>anyType{UserName=anyType{}; Password=anyType{}; ApplicationCode=JOB; ActionType=Query; MessageParameters=anyType{Parameters=anyType{}; }; TableData=anyType{TableNo=167;           TableName=Job; 	  DataRows=	  anyType{		DataRow=		  anyType{		     DataRowValues=			anyType{			    DataRowValue=				anyType{					FieldNo=1; 					FieldName=No.; 					PrimaryKey=true; 					FieldType=Code20; DataValue=DEERFIELD, 8 WP; 				       };			   DataRowValue=				anyType				       {					FieldNo=3; 					FieldName=Description; 					PrimaryKey=false; 					FieldType=Text50; 					DataValue=Setting up Eight Work Areas; 				       };			 DataRowValue=				anyType				       {					FieldNo=4; 					FieldName=Description 2; 					PrimaryKey=false; 					FieldType=Text50; 					DataValue=anyType{}; 				       }; 				}; 			  }; 		   }; 	   }; 	};  ResponseForRequest=GETTABLEDATA;  CustomIdentifier=TestBB; Applications=anyType{}; Forms=anyType{}; Menu=anyType{}; }</code></pre><p>I am not aware about the format of this response and i don't know how to parse this response to get particular result.Any one knows about it please help me.</p><p>Note: i manually formatted this response for your understanding.</p>","131062","","131062","","2009-08-13 05:47:21","2012-12-11 12:06:23","How to parse this Web service response in Android?","<android>","4","0","5","",""
"1270610","1","1286603","","2009-08-13 07:47:56","1","1855","<p>I cant find a way to use an url that requires basic auth when im useing mp.setDataSource(url);</p><pre><code>MediaPlayer mp = new MediaPlayer();    mp.setDataSource(url);mp.prepareAsync();</code></pre><p>Anyone that got any ideas?</p>","133858","","6068","","2009-08-17 07:57:20","2012-03-28 21:26:36","Can I use Basic HTTP Authentication with Android MediaPlayer?","<android><http><authentication><media-player>","4","1","","",""
"1271345","1","","","2009-08-13 11:15:44","0","576","<p>I am experiencing a problem with accessing an application from the Android-browser.The application uses DWR to persist connections to the clients that are connected with it.</p><p>Everything works fine for me, except that if the application does not send any data to the client on the Android-phone for 2 minutes, the connection seems to be lost and no data arrive at the client. The same scenario works just fine on Firefox, Opera and Chrome. If the pause between two data transfers is less than 2 minutes, it works just fine.</p><p>So, now my question:Is there some timeout setting for the android browser that I am missing? Or is this some built-in bug/feature/whatever that I cannot circumvent?</p><p>I know that I could prevent this from happening with some sort of heartbeat, I would just like to why this is happening.</p><p>Thanks in advance, Max</p><p>btw: Everything (server, clients) runs on my machine and I am testing this on the android emulator with Windows XP</p><pre><code>Android emulator version 1.10 (build_id CUPCAKE-150240)</code></pre>","132325","","132325","","2009-08-13 13:08:31","2010-03-20 04:00:14","Problem with DWR and Android-Browser","<javascript><android><ajax><dwr>","1","1","","",""
"1271569","1","","","2009-08-13 12:07:15","6","6599","<p>in winzip I am able to encrypt a file using some keys. In my android application I am using the encrypted zip file. I know the way for unzip a file (without encryption). but how can I unzip the encrypted zip file in android?</p>","138501","","488434","","2012-01-22 08:39:59","2012-09-03 04:49:48","Android :How to unzip a encrypted zip file","<android><file><encryption><unzip>","3","0","4","",""
"1271777","1","1287415","","2009-08-13 12:50:43","19","34601","<p>Im trying to find a way to set a new default ringtone by code from my Android activity.</p><p>I have already downloaded the ringtone into a bytearray.</p><p>Anybody got a hint?</p>","133858","","","","","2013-03-26 15:15:43","How to set ringtone in Android from my activity?","<android><activity>","5","0","25","",""
"1272742","1","1274824","","2009-08-13 15:33:40","2","3969","<p>How can you specify a column span in an android's gridview?</p><p>I have a gridview that displays 3 images for each row. Sometimes, there are images that have to span 2 rows. </p><p>Is it possible to do that in Android?or should I be using a different view?</p>","93141","","","","","2009-08-13 21:52:20","Android - GridView : Specify Column Span","<android><gridview><html-table>","1","0","","",""
"1273300","1","1274766","","2009-08-13 17:03:47","8","7922","<p>I'm running into a strange problem while reading from an <em>InputStream</em> on the Android platform.  I'm not sure if this is an Android specific issue, or something I'm doing wrong in general.</p><p>The only thing that is Android specific is this call:</p><pre><code>InputStream is = getResources().openRawResource(R.raw.myfile);</code></pre><p>This returns an <em>InputStream</em> for a file from the Android assets. Anyways, here's where I run into the issue:</p><pre><code>bytes[] buffer = new bytes[2];is.read(buffer);</code></pre><p>When the read() executes it throws an <em>IOException</em>. The weird thing is that if I do two sequential single byte reads (or any number of single byte reads), there is no exception.  In example, this works:</p><pre><code>byte buffer;buffer = (byte)buffer.read();buffer = (byte)buffer.read();</code></pre><p>Any idea why two sequential single byte reads work but one call to read both at once throws an exception? The <em>InputStream</em> seems fine... <code>is.available()</code> returns over a million bytes (as it should).</p><p>Stack trace shows these lines just before the <code>InputStream.read()</code>:</p><pre><code>java.io.IOExceptionat android.content.res.AssetManager.readAsset(Native Method)at android.content.res.AssetManager.access$800(AssetManager.java:36)at android.content.res.AssetManager$AssetInputStream.read(AssetManager.java:542)</code></pre><p>Changing the buffer size to a single byte still throws the error. It looks like the exception is only raised when reading into a byte array.</p><p><strong>If I truncate the file to 100,000 bytes (file is: 1,917,408 bytes originally) it works fine.  Is there a problem with files over a certain size?</strong></p><p>Any help is appreciated!<br>Thanks!</p>","155949","","390177","","2012-01-27 15:52:10","2012-01-27 16:27:24","IOException while reading from InputStream","<java><android><inputstream><ioexception>","5","1","3","",""
"1274657","1","1274817","","2009-08-13 21:22:02","40","20943","<p>I'm playing about with animations with android. The animations android.R.anim.slide_in_left and android.R.anim.slide_out_right are provided. I'm looking for a way to get the opposite animations i.e:</p><p><code>android.R.anim.slide_in_right and android.R.anim.slide_out_left</code></p><p>or how I can specify these myself. </p><p>Cheers,</p><p>Pete</p>","130076","","","","","2012-02-29 13:50:44","Android - how to get android.R.anim.slide_in_right","<android><animation>","2","1","14","",""
"1276346","1","1280337","","2009-08-14 06:36:17","8","34528","<p>I really appreciate if someone can help me with using how to use shape drawable as my background xml for my view.</p><p>This is what I tried:But I never get the color. Android always gives me black text on white background, regardless what color attribute I put.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""            android:shape=""rectangle""&gt;            &lt;stroke android:width=""1dip"" android:color=""#FBBB"" /&gt;            &lt;solid android:color=""#6000""/&gt; &lt;/shape&gt;</code></pre><p>I tried , does not work</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""            android:shape=""rectangle""            android:color=""#6000&gt;&lt;/shape&gt;</code></pre><p>I tried , does not work</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""            android:shape=""rectangle""            android:background=""#6000&gt;&lt;/shape&gt;</code></pre><p>I google this is the limited result I found to try.</p>","125440","","84021","","2012-04-09 17:38:09","2012-09-14 14:10:50","Using shape drawable as my background xml","<java><android>","4","2","3","",""
"1276450","1","1283741","","2009-08-14 07:11:42","22","42484","<p>As far as i know, Android emulator doesn't have a camera. To capture a live image we have to use the web camera. I have seen code in this <a href=""http://www.tomgibara.com/android/camera-source"">web site</a> to use the web camera in the android emulator to capture an image, but I don't know how to use this code.</p>","132724","","114066","","2010-10-11 15:58:35","2011-12-13 12:30:44","How to use web camera in android emulator to capture a live image?","<android><camera><simulator>","1","0","17","",""
"1276635","1","","","2009-08-14 08:14:01","10","22152","<p>I am new to the concept of ZXing,so i want to know the step by step process to use the ZXing in android and i am using elicpse as IDE.Any one knows about it please help me.</p>","131062","","131062","","2009-08-14 09:01:16","2012-06-25 16:28:36","How to include and use ZXing Library in Android with eclipse?","<android>","1","1","4","",""
"1276706","1","1277189","","2009-08-14 08:38:07","1","7665","<p>I have a xml file name ""list_row.xml"", this was load in a listView:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:orientation=""horizontal"" &gt;&lt;ImageView	android:id=""@+id/icon""	android:layout_width=""wrap_content""			android:layout_height=""wrap_content""	android:src=""@drawable/icon_one""/&gt;&lt;TextView	android:id=""@+id/label""	android:layout_width=""wrap_content""	android:layout_height=""wrap_content""		/&gt;</code></pre><p></p><p>I use a function to load data from my table and fill in my ""list_row.xml"" file</p><pre><code>private void fillData() {       	Cursor c = mDbHelper.fetchAllNotes();	String[] from = new String[]{ ListDbAdapter.KEY_ROWID,			ListDbAdapter.KEY_ICON, ListDbAdapter.KEY_LABEL };	int[] to = new int[]{ R.id.id, R.id.icon, R.id.label };	SimpleCursorAdapter adapter = 		new SimpleCursorAdapter(this, R.layout.list_row, c, from, to );			setListAdapter(adapter);}</code></pre><p>My question is how can I check the icon value to set the icon display on my listview (my data have to icon: icon_one, icon_two). Can someone help me with the code?</p>","152286","","","","","2011-03-22 21:05:02","Display different icon on ListView in android","<android><listview><icons>","1","0","1","",""
"1278087","1","7347663","","2009-08-14 14:12:37","3","5841","<p>I am developing an app in which I need the image in TIFF format. But in android you can convert your bitmap/image to only JPEG/PNG image.</p><p>Is there a good way to convert JPEG/PNG file to TIFF format on android?</p>","152867","","30059","","2011-06-19 14:43:31","2013-05-21 20:11:17","Convert JPEG/PNG image to TIFF image format in android OS","<android><image-processing>","4","0","2","",""
"1278275","1","","","2009-08-14 14:43:44","2","910","<p>I'm building an app that has a ListActivity and the view for each item has a progress bar. I've been able to bind my data to the TextView, but I can't seem to figure out how to bind it to the max and progress of the ProgressBar.  </p><p>This is a simplified version of my view:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextView android:id=""@+id/text1""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:layout_alignParentLeft=""true""/&gt;&lt;ProgressBar android:id=""@+id/progress_bar""    style=""?android:attr/progressBarStyleHorizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@+id/text1""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>and I'm using the same method as the Notepad tutorials to put my data into the views:  </p><pre><code>String[] from = new String[]{MyDbAdapter.KEY_AMOUNT};int[] to = new int[]{R.id.text1};SimpleCursorAdapter list_adapter =     new SimpleCursorAdapter(this, R.layout.item_row, myCursor, from, to);setListAdapter(list_adapter);</code></pre><p>Adding MyDbAdapter.KEY_AMOUNT and R.id.progress_bar to the arrays throws an exception (java.lang.IllegalStateException: android.widget.ProgressBar is not a  view that can be bounds by this SimpleCursorAdapter). Is there some kind of @... that I need to use for max and progress to make this work?</p>","35247","","","","","2012-04-01 05:44:59","How do I bind data to the attributes of a progress bar?","<android>","2","0","","",""
"1280618","1","4292607","","2009-08-14 23:10:57","0","261","<p>i have an activity that crashes randomly after the device resume froma long period of sleep, the activity is forced to be landscape modeonly.  When the device resumes from sleep, the activity seems to beredrawing itself in portrait mode, occupying half the horizontal view,then have to force close it.any idea?</p>","121196","","","","","2010-11-27 16:25:18","android activity crashing in","<android>","1","0","","",""
"1281892","1","1282451","","2009-08-15 13:25:36","2","3504","<p>I would like to create a drawable in XML that should include:</p><ol><li>image drawable</li><li>color drawable</li></ol><p>The color drawable provides white transparent color. So, as a result we would have image with some white transparent layer on top.</p><p>I have tried to use LayerDrawable, but it fails to be created during application launch:</p><pre><code>&lt;LayerDrawable xmlns:android=""http://schemas.android.com/apk/res/android""&gt;     &lt;BitmapDrawable android:src=""@drawable/button_play"" /&gt;     &lt;ColorDrawable android:color=""#80FFFFFF""/&gt;&lt;/LayerDrawable&gt;</code></pre><p>Could you please advice what is wrong here?</p><p>Thanks.</p>","139394","","139394","","2009-08-15 13:43:33","2010-03-09 11:30:06","Android Create Layered drawable in XML","<android><user-interface>","1","0","","",""
"1283085","1","1285476","","2009-08-15 23:07:09","8","15540","<p>I am trying to set padding in a <code>&lt;shape&gt;</code> declared within an XML file/layout. But whatever I set, nothing changes related to padding. If I modify any other properties, I see the effects on the UI. But it doesn't work with padding. Could you please advise on the possible reasons for which this might occur?</p><p>Here is the XML Shape I am trying to style:</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""        android:shape=""rectangle""&gt;    &lt;stroke android:width=""1dp"" android:color=""#ffffff""             android:dashWidth=""2dp""    /&gt;    &lt;solid android:color=""@color/button_white_cover"" /&gt;    &lt;corners android:radius=""11dp"" /&gt;    &lt;padding android:left=""1dp""              android:top=""20dp""             android:right=""20dp""              android:bottom=""2dp"" /&gt;&lt;/shape&gt;</code></pre>","139394","","132735","","2012-08-13 09:08:49","2012-08-13 09:08:49","Padding doesn't affect <shape> in an XML Layout","<android><user-interface>","2","0","3","",""
"1283499","1","2637997","","2009-08-16 05:17:57","2","3385","<p>In MediaPlayer.create method an id to a Raw file can be used but how to use that in setDataSource method?</p>","154680","","1675670","","2013-10-11 10:21:03","2013-11-21 02:24:46","Setting data source to an raw ID in MediaPlayer","<android><android-mediaplayer>","3","0","","",""
"1285720","1","1966697","","2009-08-17 00:14:08","3","1963","<p>How can I register for SMS database changes?</p><p>I tried:</p><pre><code>mCursor = mActivity.getContentResolver().query(Sms.CONTENT_URI, new String[] {           Sms.ADDRESS   }, null, null, null);mCursor.registerDataSetObserver(mydataSetObserver);</code></pre><p>where mydataSetObserver is implemented like this:</p><pre><code> private class MyDataSetObserver extends DataSetObserver {       public void onChanged() {           System.out.println (""1"");       }       public void onInvalidated() {            System.out.println (""2"");       }}</code></pre><p>But when I tried sending a SMS message in the emulator,MyDataSetObserver never get called.</p><p>Can you please tell me why?</p><p>Thank you.</p>","125440","","","","","2009-12-27 18:49:31","How to register for SMS database changes?","<java><android>","2","0","2","",""
"1286434","1","1287602","","2009-08-17 06:26:59","2","1989","<p>I'd like to add a menu option to the Android camera app. Is this possible to do using the current SDK?</p><p>Thanks.</p><p><strong>Edit :</strong> Ok I know I need to add an intent-filter tag in my activity. But I don't know what I should put in the mime type. I want to be able to process the live camera previews if the user selects the menu option. So what do I put into the type tag of the intent-filter?<br/><br/>Also I suppose I won't be using ALTERNATIVE or SELECTED-ALTERNATIVE for the category as I want to deal with the whole intent?</p><p>Thanks again.</p>","46297","","12388","","2010-08-09 18:46:26","2010-08-09 18:46:26","Android - add menu item to Android's built-in apps?","<android>","3","0","5","",""
"1287551","1","","","2009-08-17 11:55:30","1","2064","<p>Can any one tell me which version of android sdk contains the class "" android.hardware.CameraDevice "" .At present i m using android-sdk-windows-1.5_r1. I want to capture image from the web cam. Please help me.</p><p>regards,s.kumaran.</p>","132724","","","","","2013-03-07 12:40:58","Which version of Android sdk contains CameraDevice class","<android>","2","1","","",""
"1288740","1","1293523","","2009-08-17 15:51:26","12","14360","<p>I'm currently writing some stylesheets for mobile browsers and have come across a strange issue in the Android browser. When changing the font-size CSS attribute of a text box the box gets bigger to accomodate the larger text. Doing this on a select box however does not change the size of the select box, but the text still gets larger (actually overlapping the top and bottom of the rendered form element).</p><p>Can anyone tell me if it's possible to increase the height of select boxes in the Android browser. Or if not point me in the direction of a list of CSS attributes that can be applied to them.</p><p>Thanks.</p>","132177","","","","","2014-02-02 16:22:50","Android Dropdown (Select) CSS","<css><android><select><drop-down-menu>","5","2","3","",""
"1288957","1","","","2009-08-17 16:19:31","7","9992","<p>I know a variant of this question was asked before <a href=""http://stackoverflow.com/questions/587917/trying-to-attach-a-file-from-sd-card-to-email/1279574#1279574"">trying-to-attach-a-file-from-sd-card-to-email</a>But the solution offered, i.e. a reboot doesn't seem to do it for me.  I have seen a good number of group postings which support this being a problem.  I can only assume the OP for the linked to question made some other changes, possibly to the manifest which allowed his code to work.</p><p>The behaviour I am seeing is the Email intent handling the attachment of the jpeg from the sdcard but dealing with it as a 0 length file which is discarded when sent.  I have tried setType as jpeg/image and image/jpeg as I have seen it expressed both ways.</p><pre><code>Intent sendIntent = new Intent(Intent.ACTION_SEND);    sendIntent.setType(""jpeg/image"");    sendIntent.putExtra(Intent.EXTRA_EMAIL, ""me@gmail.com"");    sendIntent.putExtra(Intent.EXTRA_SUBJECT, R.string.email_subjectStart +         	mWhatYouSpotted.getSelectedItem().toString() +        	R.string.email_subjectEnd);    sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(""file:/""+ sPhotoFileName));    sendIntent.putExtra(Intent.EXTRA_TEXT, sEmailBody);    startActivity(Intent.createChooser(sendIntent, ""Email:""));</code></pre><p>Here is the adb logcat I got when I last tested:</p><blockquote>  <p>V/DumbDumpersMain( 3972): sPhotoUri=file://sdcard/DumbDumpers/DumbDumper.jpg I/ActivityManager( 56): Starting activity: Intent { action=android.intent.action.CHOOSER comp={android/com.android.internal.app.ChooserActivity} (has extras) } I/ActivityManager( 56): Starting activity: Intent { action=android.intent.action.SEND type=jpeg/image flags=0x3000000 comp={com.google.android.gm/com.google.android.gm.ComposeActivityGmail} (has extras) } I/ActivityManager( 56): Starting activity: Intent { action=android.intent.action.SEND type=jpeg/image flags=0x2800000 comp={com.google.android.gm/com.google.android.gm.ComposeActivity} (has extras) } D/gmail-ls( 120): MailProvider.query: content://gmail-ls/labels/me@gmail.com(null, null) D/Gmail ( 2507): URI FOUND:file://sdcard/DumbDumpers/DumbDumper.jpg</p></blockquote><p>I have been banging my head against this one for over a week now and still cannot determine what is wrong.  Any ideas?</p>","156664","","","","","2011-03-04 15:02:36","Android Send Intent attaching photo from sdcard as 0 length file","<android><email><android-intent>","2","0","3","",""
"1289010","1","1307271","","2009-08-17 16:27:26","2","8823","<p>I've come across MANY AR libraries/SDKs/APIs, all of them are marker-based, until I found <a href=""http://www.youtube.com/watch?v=U89Tcc0gjEg"" rel=""nofollow"">this video</a>, from the description and the comments, it looks like he's using SIFT to detect the object and follow it around.</p><p>I need to do that for Android, so I'm gonna need a full implementation of SIFT in pure Java.</p><p>I'm willing to do that but I need to know how SIFT is used for augmented reality first.</p><p>I could make use of any information you give.</p>","89512","","4023","","2009-08-17 16:42:03","2011-03-21 19:37:11","Using SIFT for Augmented Reality","<java><android><algorithm><augmented-reality><sift>","6","0","4","",""
"1292575","1","1293541","","2009-08-18 08:32:09","118","141000","<p>How do you get the text of a <code>TextView</code> to be Justified (with text flush on the left- and right- hand sides)? </p><p>I found a possible solution <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg41067.html"">here</a>, but it does not work (even if you change vertical-center to center_vertical, etc).</p>","130076","","1288","","2013-06-19 16:08:11","2013-12-25 10:33:26","Android TextView Justify Text","<android><text><format><textview><justify>","20","1","36","",""
"1293258","1","","","2009-08-18 11:20:20","2","2844","<p>How to implement internet radio using java?Is there any Java APIs for this?</p><p>I want to make a internet radio using Android / java. But I am not getting any APIs how to connect or how to receive the channel information for streaming the audio.</p><p>Please help me how to create that same and provide some code/API for that.</p>","1524482","","76337","","2009-08-20 00:08:26","2012-05-28 14:05:11","How to implement internet radio using java","<java><android>","2","6","","",""
"1293797","1","1294480","","2009-08-18 13:23:00","1","1825","<p>i want to convert 3gp file to wave file can i do it programmatically . As the headers are different is it possible .Any help would be appreciated Thanks in advance.</p>","95877","","60593","","2009-08-25 15:58:15","2010-10-27 21:37:59","3gp to wav file Android","<java><android><audio>","1","0","","",""
"1295720","1","1295810","","2009-08-18 18:39:27","1","402","<p>Is it possible to evaluate a string of python code (or Perl) from Java when developing Android applications?</p><p>I am try to do something like evaluating a text-input script:</p><p>e.g. </p><pre><code>String script = text1.getText().toString();String result = PythonRuntime.evaluate(script);text2.setText(result);</code></pre>","93141","","110088","","2009-08-18 18:41:55","2009-08-18 18:55:41","Evaluate a script (e.g. Python) in Java for Android platform","<java><python><android><scripting>","2","0","","",""
"1296180","1","","","2009-08-18 20:05:51","31","24170","<p>I want to perform a query like the following:</p><pre><code>uvalue = EditText( some user value );p_query = ""select * from mytable where name_field = '"" +  uvalue + ""'"" ;mDb.rawQuery( p_query, null );</code></pre><p>if the user enters a single quote in their input it crashes.  If you change it to:</p><pre><code>p_query = ""select * from mytable where name_field = \"""" +  uvalue + ""\"""" ;</code></pre><p>it crashes if the user enters a double quote in their input.and of course they could always enter both single and double quotes.</p>","158757","","33006","","2009-08-18 20:47:33","2014-04-09 15:48:23","Android quotes within an sql query string","<android><sqlite>","6","2","15","",""
"1297678","1","","","2009-08-19 03:20:04","4","5022","<p>I am tracing the Dalvik machine source code. According that, I want to make Dalvik runnable. I have seem the dvk project. But there has many problem result in fault. Are there have any way to make dalvik only without all android. Because make android will take too much time (about many hour)</p><p>thx for helping</p><p>dvk project: <a href=""http://code.google.com/p/dvk/"" rel=""nofollow"">http://code.google.com/p/dvk/</a></p>","","Jimms","149841","","2011-07-13 14:40:02","2011-07-13 14:40:02","How do I make isolated dalvik","<android><linux><virtual-machine><dalvik><dex>","1","0","1","",""
"1298202","1","","","2009-08-19 06:57:53","2","5746","<p>How to use my local computer camera in android emulator?</p>","158911","","","","","2009-08-19 07:05:12","How to use my local computer camera in android emulator?","<android>","1","0","","",""
"1302821","1","1303258","","2009-08-19 21:50:29","1","2328","<p>Can you please tell me how to remount /sdcard directory to read/write on emulator?</p><p>I read <a href=""http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html"" rel=""nofollow"">this</a></p><p>But I don't know how to apply that to remount /sdcard directory in read-write mode?</p>","125440","","1777090","","2013-01-17 06:16:08","2013-01-17 06:16:08","How to remount /sdcard directory to read/write on emulator?","<java><android>","1","0","","",""
"1303328","1","1303386","","2009-08-20 00:19:56","2","6513","<p>I download and build android 1.5r3 source.I did 'launch 1' and then 'make'.</p><p>And when it is done, I run my emulator likeout/host/darwin-x86/bin/emulator  -sdcard sd256m.img</p><p>But when I click 'Gallery', it said 'No Media Found'.I am sure the sd card i created (sd256m.img) has images in there.</p><p>Can you please tell me why I don't see any images in the sd card?</p>","125440","","1777090","","2013-01-17 06:14:21","2013-01-17 06:14:21","How to run android emulator with sd card","<java><android>","1","0","1","",""
"1303611","1","1306312","","2009-08-20 02:09:50","2","2087","<p>I am working through my first Android app and have gotten it to work in the emulator but am unable to get it running on a real device (myTouch running cupcake). </p><p>I have put the app out on my web site accessible through a link with type attribute set to ""application/vnd.android.package-archive"" and I have also added that mime type to apache (and restarted it). I can download the app with my phone but when I try and install it I get an error message.</p><p>I have verified that the apk file actually has it, which is does.</p><p>I have signed the apk file with a personal key.</p><p>I tried the same process on the emulator (downloading via web) and had the same negative result. The log does give some additional information, basically that there is a FileNotFoundException while trying to load the AndroidManifest.xml file.</p><p>I looked into installing the app via usb, but found no way to do so.</p><p>All of the documentation I have come across pretty much glosses over installing the app on your own phone, so I am thinking it is easy and I am just missing something.</p><p>Just as a last bit of info... I am developing with Eclipse 3.5 on Ubuntu and Java 6.</p><p>Does anyone have any suggestions?</p>","135294","","","","","2009-08-20 13:46:45","FileNotFoundException AndroidManifest.xml","<android><device>","2","0","","",""
"1304231","1","1305008","","2009-08-20 06:01:37","0","206","<p>In my application I am using a tabactivity. In tab content area I am using multiple views. Some of the views are created by java code and some of them are created using XML. This works fine in android 1.1, but when i move to android1.5 the layouts which are created using xml cause the problem. In ddms/logcat am getting stack overflow error. What do I have to change to move to ANDROID1.5?</p>","138501","","1108032","","2012-03-05 17:36:07","2012-03-05 17:36:07","xml layout definition in android 1.5","<android>","1","1","1","",""
"1305272","1","1314360","","2009-08-20 10:35:55","2","13706","<p>I use this code to get the item from cursor, but it just return one item on my list. So, how can I get all items to my list, this is my code?</p><pre><code>class MyAdapter extends SimpleCursorAdapter{    private Context context;	public MyAdapter(Context context, int layout, Cursor c, String[] from, int[] to)	{		super(context, layout, c, from, to);		this.context = context;	}	public View getView(int position, View convertView, ViewGroup parent){		Cursor cursor = getCursor();		LayoutInflater inflater = ((Activity) context).getLayoutInflater();					View v = inflater.inflate(R.layout.sbooks_row, null);					TextView title = (TextView)findViewById(R.id.title);		if(title != null){			int index = cursor.getColumnIndex(SBooksDbAdapter.KEY_TITLE);			String type = cursor.getString(index);			title.setText(type);		}		TextView lyrics = (TextView)findViewById(R.id.lyrics);		if(lyrics != null){			int index = cursor.getColumnIndex(SBooksDbAdapter.KEY_LYRICS);			String type = cursor.getString(index);			lyrics.setText(type);		}		ImageView im = (ImageView)findViewById(R.id.icon);		if(im!=null){			int index = cursor.getColumnIndex(SBooksDbAdapter.KEY_FAVORITE);			int type = cursor.getInt(index);			if(type==1){				im.setImageResource(android.R.drawable.btn_star_big_on);			}			else{				im.setImageResource(android.R.drawable.btn_star_big_off);			}		}		return v;	}</code></pre>","152286","","","","","2010-09-25 21:18:38","Get all item from cursor in android","<android><list><cursor>","2","0","2","",""
"1305388","1","1305545","","2009-08-20 10:56:26","4","14191","<p>I am trying to implement Camera application in android,and i got some code from net to create a Live Camera through WebCam.Upto this no problem.Now i have to capture the images when click the button, and i displayed the captured images in the Dialog window.Without any exception the program is running but the captured image is not displayed,some default image is displayed.</p><p>My code is</p><pre><code>public void captureImage(){	Camera.Parameters params = camera.getParameters();	camera.setParameters(params);	Camera.PictureCallback jpgCallback = new PictureCallback() 	{		public void onPictureTaken(byte[] data, Camera camera) 		{			try			{				Dialog d=new Dialog(c);		    	d.setContentView(0x7f030000);				BitmapFactory.Options opts = new BitmapFactory.Options();    			Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length,opts);    			TextView tv=(TextView)d.findViewById(0x7f050001);    			ImageView i=(ImageView)d.findViewById(0x7f050000);    	    	i.setImageBitmap(bitmap);    			tv.setText(""Hai""+data.length);    			d.show();			}			catch(Exception e)			{				AlertDialog.Builder alert=new AlertDialog.Builder(c);				alert.setMessage(""Exception1""+e.getMessage());				alert.create();				alert.show();			}		}	};	camera.takePicture(null, null, jpgCallback);}</code></pre><p>I have no idea from where this default image is coming,i don't how to slove this problem.Anyone knows about this please help me.Waiting for the Reply.....</p>","131062","","","","","2010-11-24 07:37:37","How to Capture image from Camera Application in Android Programming?","<android>","1","1","3","",""
"1306689","1","2958586","","2009-08-20 14:46:42","28","28796","<p>Here's the deal. I have an application with three tabs. Through various interactions with the items in the tabs I end up launching other activities. The client has reviewed this and would like the activities launched ""within"" the tabs, so the tabs remain visible and if the user clicks the tab it goes back to the original activity defined in the setContent function. Is this possible and how would I go about this from other activities? (ie the child activities, not the one that defines the TabHost and has access to call setContent)?</p>","21126","","","","","2012-10-26 08:55:45","Launching activities within a tab in Android","<java><android>","7","0","32","",""
"1308346","1","2504264","","2009-08-20 19:33:09","27","17724","<p>As far as I can tell, there is no API (official or unofficial) to access information about Apps on the Android Market (info such as Title, Icon, Description, Downloads, Comments, etc..) However, there are a few <a href=""http://androidstats.com/"">websites</a> that have managed to compile this information anyway.</p><p>My question is: How is this being done?</p><p>A couple of guesses.</p><ul><li>Manually (not likely, due to volume)</li><li>Implemented the protocol used by the official app (by decompiling or observing packets)</li><li>Running some kind of debugger with the official app to extract the live data</li><li>Using some kind of automation + screen shots + text recognition (seems complicated)</li><li>Modifying the (open) source to write a log file</li></ul><p>I'm just curious how this was done because I sure can't figure it out. Thanks. </p>","23977","","23977","","2009-08-20 22:20:57","2014-02-17 16:11:58","How to fetch Android Market data when there is no API?","<java><android>","4","3","22","",""
"1309629","1","1715673","","2009-08-21 01:10:07","30","42066","<p>I'm working on an android application, and I have a drawable that I'm loading up from a source image.  On this image, I'd like to convert all of the white pixels to a different color, say blue, and then cache the resultant Drawable object so I can use it later.</p><p>So for example say I have a 20x20 PNG file that has a white circle in the middle, and that everything outside the circle is transparent.  What's the best way to turn that white circle blue and cache the results?  Does the answer change if I want to use that source image to create several new Drawables (say blue, red, green, orange, etc)?</p><p>I'm guessing that I'll want to use a ColorMatrix in some way, but I'm not sure how.</p>","1322","","1322","","2009-11-11 14:43:06","2014-03-20 22:43:00","How to change colors of a Drawable in Android?","<android>","7","0","25","",""
"1311042","1","1312213","","2009-08-21 09:56:08","37","39323","<p>I'm trying to load a bitmap in Android which I want to tile. I'm currently using the following in my view to display a bitmap:</p><pre><code>canvas.drawBitmap(bitmap, srcRect, destRect, null)</code></pre><p>I essentially want to use this bitmap as a background image in my app and would like to repeat the bitmap in both the X and Y directions.</p><p>I've seen the TileMode.REPEAT constant for the BitmapShader class but am unsure if this is to do with repeating he actual bitmap or to do with applying a filter to the bitmap.</p>","1281","","","","","2014-03-04 11:31:23","Android Tile Bitmap","<android><bitmap>","6","1","22","",""
"1314435","1","1317223","","2009-08-21 22:12:15","2","1086","<p>For the application I'm currently working on, I created something like ImageSwitcher for multiple images (imagine iPhone's UIScrollView with paging enabled).</p><p>At first, I hardcoded some ImageViews and loaded their drawable resources on creation/inflation, but after some tweaks (and what I thought were improvements), I reduced the needed views to 3, of which 2 are ImageViews used for displaying of the current page and animating between current and new page.</p><p>With this change, I began to use setImageResource/setImageDrawable for the dynamic loading of the new image in my 2 ImageViews before sliding through pages (I am using PNG files, sized for HVGA displays).</p><p>To my disappointment, the performance got worse, to the extent of feeling some lag when sliding faster through the pages.A quick look in TraceView revealed that 17.4% of total time while using the app, over 5 times more than the next heavy method, was consumed from BitmapFactory.nativeDecodeAsset, called by my dynamic setting of drawable resource.</p><p>I'm thinking of ways to circumvent this, and I want to do it in the best way possible, so any suggestions are welcome.</p>","144969","","","","","2009-08-22 22:34:49","Optimizing paging between ImageViews in Android?","<android><optimization><drawable>","1","2","","",""
"1315253","1","1315592","","2009-08-22 05:48:50","1","783","<p>I have an app using a ListView as a main screen. Each row displays some text, a checkbox and images according to the data, and since you can't do that with a standard ListAdapter, I crafted my own.</p><p>Every time a change occur (adding / removing a row, checking a tip, navigating, etc) to the list data, I refresh the list display, using this method :</p><pre><code>public void refreshList(){    // fetch the new items    ItemDbHelper items = new ItemDbHelper(this);    Cursor item_cursor = items.fetchItemForCurrentView(this.current_context_filter);    // do not use ""start managing cursor"" here or resume() won't work    // anymore since the cursor will be closed despite we still need it    // set the welcome message if no items to display    if (item_cursor.getCount() == 0)    {        TextView message = (TextView) this.findViewById(R.id.home_message);        message.setVisibility(View.VISIBLE);    }    ListView list = this.task_list;    ItemListAdapter item_cursor_adater = (ItemListAdapter) list.getAdapter();    // close the old cursor manually and replace it with the new one    item_cursor_adater.getCursor().close();    item_cursor_adater.changeCursor(item_cursor);    // reset some cache data in the adapter    item_cursor_adater.reset();    // tell the list to refresh    item_cursor_adater.notifyDataSetChanged();    // to easy navigation, we set the focus the last selected item    // set the last modified item as selected    int selected_index = this.getItemPositionFromId(list,                                                     this.getCurrentContextFilter()                                                        .getSelectedTaskId());    list.setSelection(selected_index);}</code></pre><p>Some facts :</p><ul><li><p><code>items.fetchItemForCurrentView()</code> triggers a very heavy SQL query</p></li><li><p><code>this.getItemPositionFromId()</code> loop on the entire ListView row by row to find the index of row with a given id.</p></li><li><p>the <code>item_cursor_adapter</code> extends SimpleCursorAdapter and overrides </p><p>public View getView(int position, View convertView, ViewGroup parent)</p></li></ul><p>Which is a pretty heavy method.</p><p>This method is called on the user demand quite often in the typical application use case, and waiting a second for the screen to refresh lower the user experience.</p><p>Do you have any suggestion on how this could be improved ?</p><p>Some ideas :</p><ul><li>Use threads to load the data. But then, how to feed up the list afterwards ? How to make it appear not disturbing on the screen ?</li><li>Make reuse of some objects / use  some cache I didn't think of.</li><li>Find a way for the list to update without reloading EVERYTHING</li><li>Change my implementation of the cursor adapter. Maybe extends a more efficient  parent or use something better than getView ?</li></ul>","9951","","","","","2013-06-05 11:03:56","How can I improve (perceived) speed on a complex ListView creation with Android?","<android><listview>","2","0","2","",""
"1317359","1","","","2009-08-22 23:50:19","2","2756","<p>I am trying to create animation that moves an image.</p><p>Lets have a look at following (like image locations on screen):</p><ul><li>01 02</li><li>03 04</li></ul><p>If I move from <strong>01</strong> to <strong>02</strong>, <strong>03</strong> to <strong>04</strong>, <strong>01</strong> to <strong>03</strong>, <strong>02</strong> to <strong>04</strong>, TranslateAnimation works fine.</p><p>But when I do <strong>01</strong> to <strong>04</strong> I will have no visual animation, and image takes immediate vertical position.</p><p>Could you please suggest what could be wrong?</p><p>Thanks.</p>","139394","","","","","2012-10-12 04:38:49","Android. TranslateAnimation takes no effect","<android><animation>","1","2","","",""
"1320108","1","1320185","","2009-08-24 01:35:10","3","7687","<p>I have a list (of messages) and I want to give the user the ability to remove these items from the list. I have extended an ArrayAdapter and give it an ArrayList of my messages and would like to simply remove an item from that list and then refresh the listview instead of reloading the entire list of sent messages. The problem is, if there's only one message and I remove it using listAdapter.remove(messageObject), the adapter is still calling getView and then throwing NullPointerExceptions all over the place. I'm not sure what the best way is to go about this.</p>","21126","","","","","2009-08-24 02:15:54","Android: Removing items from a ListView/ArrayAdapter Activity","<java><android>","1","0","2","",""
"1320241","1","","","2009-08-24 02:34:14","7","7327","<p>I develop all my sites on a OS 10.5.8 server with PHP and MySQL, and I've configured my <code>/etc/hosts</code> and <code>httpd.conf</code> files to display my site at <code>example.dev</code> in any browser on that machine.</p><p>I recently installed Android's software development kit which I'd like to use to develop and test stylesheets targeted to mobile Webkit-- but I can't access my locally-hosted projects in the Android browser.</p><p>This makes sense, since it's emulating the whole Android OS, but is there a workaround? Or can I only test projects that exist somewhere on the actual computer internet, perhaps in a hidden directory?</p><p>Someone suggested that I edit my <code>/etc/resolv.conf</code> file, but I don't know the correct way to format a locally-hosted domain in the <code>resolv.conf</code>-- I tried variations of the following, and nothing works:</p><pre><code>domain example.devnameserver 127.0.0.1</code></pre><p>Or...</p><pre><code>domain example.devnameserver localhost</code></pre><p>In my hosts file, it is set up like this:</p><pre><code>127.0.0.1   localhost example.dev example2.dev [etc]</code></pre>","347662","","","","","2013-09-17 06:03:26","How can I look at locally-hosted projects with the Android SDK emulator?","<android><localhost><virtualhost>","5","0","6","",""
"1320421","1","1321117","","2009-08-24 03:57:22","0","782","<p>I have an image, say 16px from our designer.  I want to Set it as the background image on a view, but the view is larger than the image.  So I want to anchor the image at the top of the view, and then have the view fill in the bottom with a solid color.</p><p>Is this possible in the current version of android, 1.5_r3?</p><p>Here is what I have so far, but the image is scaling to take up the entire view, and I am not sure how to set the image as background and specify a solid color at the same time.  I suspect I need to wrap the view in a containing view which has the color specified, is that the best way to do it?</p><pre><code>&lt;RelativeLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""?android:attr/listPreferredItemHeight""android:padding=""3dip""style=""@style/listItemStyle""&gt;...</code></pre><p>Where listItemStyle is defined as:</p><pre><code> &lt;style  name=""listItemStyle""  parent=""@android:style/Widget.ListView""&gt;   &lt;item name=""android:background""&gt;@drawable/list_background&lt;/item&gt; &lt;/style&gt;</code></pre>","56488","","","","","2009-08-24 08:27:43","Is it possible to set a background png on a view and anchor it to the top and not scale in Android?","<android>","1","0","","",""
"1320478","1","1321565","","2009-08-24 04:27:20","9","17190","<p>I load data from Cursor to listview, but my Listview not really display ""smooth"". The data change when I drag up and down on the scollbar in my ListView. And some items look like duplicate display in my list.I hava a ""complex ListView"" (two textview, one imageview) So I used newView(), bindView() to display data.  Can someone help me?</p>","152286","","152286","","2009-08-25 03:09:59","2012-09-09 11:52:19","How to load the Listview ""smoothly"" in android","<android><listview>","5","0","23","",""
"1321180","1","1323567","","2009-08-24 08:43:44","1","360","<p>The question boils down to whether phone manufacturers are required to keep resources that are available in SDK intact.Say, will android.R.drawable.ic_menu_preferences be the same file on any phone?</p>","15187","","","","","2009-08-24 17:02:42","Referencing android.R resources - am I on the safe side?","<android>","2","0","","",""
"1322289","1","1323391","","2009-08-24 13:06:00","4","983","<p>Are there pitfalls or the points to remember while programming for Android? I think the list will include topics on Multithreading, Persistent Storage, etc.</p>","77087","","","Roger Pate","2010-07-14 01:33:02","2010-10-16 10:55:10","Pitfalls of Android applications","<android>","3","2","5","",""
"1324307","1","1324811","","2009-08-24 19:39:14","14","13302","<p>I have a service that is downloading a file. When the download is done, I would like to update my ""Downloaded files"" list in my <code>Activity</code>, but only if the <code>Activity</code> is running. I do not want the <code>Activity</code> to start if it's not already running.</p><p>I was hoping I could do this by making a new <code>Intent</code> with some special flag.</p><p>Anyone have any idea how I can achieve this? A tiny code example maybe?</p>","133858","","76835","","2009-10-23 09:16:46","2011-03-11 05:32:29","How to use an intent to update an activity?","<android><activity><android-intent>","2","0","8","",""
"1325565","1","1327008","","2009-08-25 01:08:58","5","5866","<p>I haven't been able to find any documentation on Android's sync services, so farI just have the sources from the open source project which are a good start, but I am looking for architecture information, gotchas, etc.</p><p>Thanks.</p>","120659","","4100","","2011-03-24 13:15:59","2011-03-24 13:15:59","Looking for information on Android's Sync Manager","<android><synchronization>","1","3","3","",""
"1325576","1","1325800","","2009-08-25 01:13:36","4","1608","<p>When I switch to landscape mode, the following custom view throws an exception in Android 1.5r3 cupcake:</p><pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.opentable/com.opentable.activity.SearchResults}:     java.lang.IllegalArgumentException: Wrong state class -- expecting View Statepublic class TextProgressBar extends LinearLayout {    public TextProgressBar(Context context, AttributeSet attrs) {        super(context, attrs);        ((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.text_progress_bar, this, true);        setGravity(Gravity.CENTER);    }    public TextProgressBar(Context context) {        this(context,null);    }}</code></pre><p>The XML for this view is fairly straightforward:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;    &lt;ProgressBar        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:indeterminate=""true""        android:id=""@+id/progress"" /&gt;    &lt;TextView        android:text=""Loading...""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Any ideas what might be happening?</p>","82156","","","","","2010-11-09 09:04:29","Wrong state class -- expecting View State exception in Android 1.5 with Custom View","<android>","1","0","0","",""
"1326169","1","1326235","","2009-08-25 05:10:49","0","7176","<p>This <a href=""http://perlbuzz.com/2009/08/perl-coming-to-android-phones.html"" rel=""nofollow"">link</a> says that Android support Python, Lua and BeanShell Scripts, subsequently for Perl too. If it is so, is it possible for developers to write python scripts and call them in their standard Java based android applications?</p>","77087","","7498","","2009-08-25 07:53:30","2012-01-18 19:01:05","Executing Python Scripts in Android","<python><android><scripting>","2","0","1","",""
"1327221","1","","","2009-08-25 09:54:38","4","6362","<p>I want to stream a media file on web, and android developer website has said that <code>MediaPlayer.setDataSource()</code> can set the data source (file-path or http/rtsp URL) to use.But I got an error in both G1 device and emulator when streaming a rtsp url file: Command <code>PLAYER_PREPARE</code> completed with an error or info PVMFailure  error<code>(1, -1)</code>. </p><p>Does anyone know what is this error, or anyone knows where can I get the error description <code>(1, -1)</code> means?</p><p>P.S. the code can work successfully when playing a audio/video file or streaming a http protocal sudio/video file, but can't stream rtsp protocal file. Is android not supported rtsp streaming?</p><p>Thanks very much.</p>","","Allen","350601","","2011-12-31 09:46:18","2013-10-20 20:02:12","Android streaming audio/video can't stream a rtsp file?","<android><video><streaming><rtsp>","4","0","2","",""
"1327816","1","1332737","","2009-08-25 11:57:58","2","1147","<p>I'd like to show a Dialog that occupies as much screen space as possible.</p><p>So, here's a sample:</p><pre><code>AlertDialog dialog = new AlertDialog.Builder(ctx)......create();Window w = dialog.getWindow();WindowManager.LayoutParams lp = w.getAttributes();lp.width = 320;lp.height = 480;w.setAttributes(lp);</code></pre><p>Problem is, this doesn't change a thing. Why?</p><p>TIA.</p>","15187","","","","","2012-07-25 07:52:58","Maximizing an AlertDialog?","<android>","3","2","","",""
"1329720","1","1330200","","2009-08-25 17:28:27","3","5789","<p>I am trying to write an application, that would allow me to render multiple images onto an ImageView in Android. I can find the method to populate it with a sigle bitmap. But, there seems to be no way of getting two images to render in ImageView (Each occuping half the render space). Any help would be really appreciative.</p><p>Thanks,De Costo.</p>","352341","","","","","2011-01-31 22:23:34","Render Two images in ImageView in Android?","<android>","3","0","2","",""
"1332269","1","","","2009-08-26 04:06:14","8","20784","<p>When you want to change the mobile system date or time in your application, how do you go about doing it?</p>","","","101280","","2009-08-26 04:35:18","2014-03-13 00:50:14","How to set mobile system time and date in android?","<android><operating-system>","5","0","5","",""
"1332271","1","1332441","","2009-08-26 04:07:34","0","1561","<p>I have a problem when use ""ViewHolder"" class. I use ""ViewHolder"" to improve my List display speech. I think the code is ok, but why It throw exception when ""setText"" with data from ""Cursor"". My code here:</p><pre><code>if(row==null){			LayoutInflater inflater = LayoutInflater.from(context);						row = inflater.inflate(R.layout.sbooks_row, null);			holder = new ViewHolder();			holder.id = (TextView)row.findViewById(R.id.id);			holder.title = (TextView)row.findViewById(R.id.title);			holder.icon = (ImageView)row.findViewById(R.id.icon);			row.setTag(holder);		}		else		{			holder = (ViewHolder)row.getTag();		}		holder.title.setText(cursor.getString(cursor.getColumnIndex(SBooksDbAdapter.KEY_TITLE)));		holder.id.setText(cursor.getString(cursor.getColumnIndex(SBooksDbAdapter.KEY_ROWID)));</code></pre>","152286","","","","","2009-08-26 05:10:01","Problem with ""ViewHolder"" class in android","<android><list>","1","0","","",""
"1333595","1","","","2009-08-26 09:59:01","2","1764","<p>I'm currently developing a small non-commercial game for Android which is based on OpenGL ES. Except for some minor issues (slow as crap emulator being the biggest) I've really enjoyed it so far and would love to continue developing for it.The question is: What are your thoughts on the future of Android as an environemnt for the  game market? I read an article somewhere that said that the IPhone is the preferred platform for games, but since I don't own a Mac and won't bother with some complicated work around to get it to work on Windows I'm currently not interested in it.So, what do you think? Is it worth spending alot of time (and potentially money) on a larger Android game project?</p>","74581","","","","","2009-11-06 18:08:18","Android as a commercial game platform","<android>","5","1","2","",""
"1334048","1","1335565","","2009-08-26 11:25:47","1","683","<p>In the last couple of days, there were some speculations, circulating through the blogosphere, that the future versions of the Android OS, created from the branches Donut and Eclair, won't be compatible with the T-Mobile G1 and Android Dev Phone 1, because of insufficient OS flash storage on those devices.</p><p>While that's not confirmed from Google representatives, it's very possible, especially when you look at how Cupcake has pretty much reached the limit of the Dev Phone 1's internal flash storage.</p><p>Before HTC releases Donut binaries for the Dev Phone 1, we can't be sure, but this raises some questions like what are the best choices for Android test device and should we be worrying about buying the Dev Phone 1 now.</p><p>Another somewhat related question, that I had in mind, is, do you think that Android-based netbooks (eventually without hardware buttons) will be used as test devices and do you plan your development with resolutions bigger than HVGA in mind?</p><p>I think that before something like Android Dev Phone 2, the developer community will have to resort to the open market devices and that applications for netbook-class devices will slowly differentiate from the ones that target Android smartphones (maybe different departments in Android market).</p><p>What are your thoughts about that?</p>","144969","","995926","","2012-05-22 08:16:55","2012-05-22 08:16:55","Future versions of Android and test devices - possible problems","<android><android-2.0-eclair>","1","1","","",""
"1334694","1","2349063","","2009-08-26 13:28:44","40","28732","<p>I created a video recording application with library dialog. The library dialog displays the list of recorded videos where each item consists of icon, video title, tags and location information the following way:</p><p><img src=""http://img21.imageshack.us/img21/4633/libraryw.png"" alt=""alt text"" /></p><p>Does anyone know whether it is possible to replace icons with video thumbnails (single frame preview)?</p><p>Thanks!</p>","22996","","","","","2013-05-09 13:26:19","Android: Is it possible to display video thumbnails?","<android>","5","1","29","",""
"1334802","1","","","2009-08-26 13:45:00","198","141699","<p>I have created an Android project and added an external JAR (hessian-4.0.1.jar) to my project. I then add the JAR to the buildpath and check it off in Order and Export.</p><p>Order and Export is ignored it seems, and all classes from the external JAR are missing in runtime.</p><p>Is there a trick to properly include the needed classes from an external JAR when building an Android application using the Eclipse Plug-In. I do not want to use ant or Maven.</p>","","Fredrik Olsson","1015226","","2014-01-23 13:53:30","2014-04-09 18:53:14","How can I use external JARs in an Android project?","<eclipse><android><class-library>","8","2","87","",""
"1336905","1","","","2009-08-26 19:19:26","4","2108","<p>We are writing an application for the T-Mobile MyTouch which is an Android based mobile phone. We have images that will be displayed on the default screen portrait mode (320 x 480). </p><p>Anticipating that the Android OS will be appearing on Netbooks with default landscape 16 : 9 screen format, what is the best way to handle images that are in a portrait mode format? In other words since you can't rotate the screen on these Netbooks, if you display a portrait mode image on landscape mode screen there will be large blank rectangles on either side of the image.</p>","151178","","8590","","2009-08-27 04:13:18","2012-02-08 12:29:55","Best way to deal with different Android screen sizes?","<android>","3","0","3","",""
"1337424","1","1714426","","2009-08-26 20:53:46","87","130487","<p>How can you set the event listener for a Spinner when the selected item changes?</p><p>Basically what I am trying to do is something similar to this:</p><pre><code>spinner1.onSelectionChange = handleSelectionChange;void handleSelectionChange(Object sender){    //handle event}</code></pre>","93141","","59947","","2013-08-02 13:45:57","2013-11-11 16:07:53","Android Spinner: Get the selected item change event","<android><events><spinner>","11","2","25","",""
"1338087","1","1340042","","2009-08-26 23:16:03","2","2472","<p>This application I've been working on has databases with multiple megabytes of data to sift through. A lot of the activities are just ListViews descending through various levels of data within the databases until we reach ""documents"", which is just HTML to be pulled from the DB(s) and displayed on the phone. The issue I am having is that some of these activities need to have the ability to search through the databases by capturing keystrokes and re-running the query with a ""like %blah%"" in it. This works reasonably quickly except when the user is first loading the data and when the user first enters a keystroke. I am using a ResourceCursorAdapter and I am generating the cursor in a background thread, but in order to do a listAdapter.changeCursor(), I have to use a Handler to post it to the main UI thread. This particular call is then freezing the UI thread <em>just long enough</em> to bring up the dreaded ANR dialog. I'm curious how I can offload this to a background thread totally so the user interface remains responsive and we don't have ANR dialogs popping up.</p><p>Just for full disclosure, I was originally returning an ArrayList of custom model objects and using an ArrayAdapter, but (understandably) the customer pointed out it was bad memory-manangement and I wasn't happy with the performance anyways. I'd really like to avoid a solution where I'm generating huge lists of objects and then doing a listAdapter.notifyDataSetChanged/Invalidated()</p><p>Here is the code in question:</p><pre><code>private Runnable filterDrugListRunnable = new Runnable() {    public void run() {        if (filterLock.tryLock() == false) return;        cur = ActivityUtils.getIndexItemCursor(DrugListActivity.this);        if (cur == null || forceRefresh == true) {            cur = docDb.getItemCursor(selectedIndex.getIndexId(), filter);            ActivityUtils.setIndexItemCursor(DrugListActivity.this, cur);            forceRefresh = false;        }        updateHandler.post(new Runnable() {           public void run() {               listAdapter.changeCursor(cur);           }        });        filterLock.unlock();        updateHandler.post(hideProgressRunnable);        updateHandler.post(updateListRunnable);    }};</code></pre>","21126","","21126","","2009-08-27 13:11:31","2010-06-15 05:57:14","Android CursorAdapters, ListViews and background threads","<java><android>","2","0","2","",""
"1338475","1","1360693","","2009-08-27 01:51:45","5","7021","<p>I have an Android app with a <code>ListActivity</code> in the main view. The list contains a <code>LinearLayout</code> with a <code>TextView</code> and a hidden delete Button. The delete Button will be hidden by default. I want to use a fling gesture to show the button.  I am able to detect the fling gesture thanks to question #<a href=""http://stackoverflow.com/questions/937313"">937313</a> on stackoverflow. It's not clear to me how to determine which item in the list was flung, since the onTouch listener listens to the <code>ListView</code>. The item is not necessarily selected so getSelected* methods can't be used reliably. I am using the <code>SimpleListAdaptor</code> so I don't have direct access to the View Objects in the <code>ListView</code>.</p><p>Any ideas?</p>","4476","","1341006","","2012-11-22 10:16:09","2014-04-03 09:20:46","How to best handle fling gesture for Android ListActivity","<android><gestures>","1","0","6","",""
"1339136","1","1342999","","2009-08-27 06:10:46","73","61246","<p>I'm currently developing a small OpenGL game for the Android platform and I wonder if there's an easy way to render text on top of the rendered frame (like a HUD with the player´s score etc). The text would need to use a custom font also.I've seen an example using a  View as an overlay, but I don't know if I want to do that since I might want to port the game to other platforms later.Any ideas?</p><p>Regards/Per</p>","74581","","","","","2013-08-28 21:31:21","Draw text in OpenGL ES (Android)","<android><opengl-es>","12","2","59","",""
"1339159","1","","","2009-08-27 06:18:59","0","478","<p>In my application,i override the android's backkey default functions(by Override onkeydown).its works fine.But when a spinner components default selecting elements windows and virtual keypad(In Android 1.5) enter into the screen the default back keys functionality collapsed because of my overriding.</p><p>is there any way to solve this problem? or what is the name of virtualkeypadwindow and spinner components window? Thanks. . . </p>","138501","","","","","2010-11-20 04:10:41","problem in Overriding default backkeys function","<android>","1","2","","",""
"1339367","1","1340004","","2009-08-27 07:14:24","3","4391","<p>In my application has a ListView. When long press on item the ""Context Menu"" will appear. I want to check the data ID, then set disable/enable to my Context Menu ""Items"". I can not find out the function like getMenuInfo() or something like this. </p><pre><code>@Overridepublic void onCreateContextMenu(ContextMenu menu , View v, ContextMenuInfo menuInfo){           super.onCreateContextMenu(menu, v, menuInfo);    	    menu.add(0, ADD_FAVORITE_ID, 0, ""Check"");    	    menu.add(0, ADD_FAVORITE_ID, 0, ""UnCheck"").setEnabled(false);           	    	}</code></pre>","152286","","34813","","2009-10-02 14:44:20","2009-10-02 14:44:20","Check value to disable/enable Context Menu Item (android)","<android><contextmenu>","1","0","","",""
"1339867","1","1340324","","2009-08-27 09:15:53","9","21034","<p>How do we do programmatic reading of a barcode that is captured using a mobile phone camera? For example, how do that using iPhone or Android or Java ME? Do we need separate hardware to read bar code or can we do image manipulation?</p>","77087","","","","","2013-01-10 10:27:26","Barcode reading using picture taken using mobile phone camera","<iphone><android><java-me><mobile><barcode>","5","0","17","",""
"1340528","1","1340726","","2009-08-27 11:38:10","5","4266","<p>Im looking for an event that I can use on the scrollView to be fired when the user has scrolled to the bottom.</p><p>E.g my list of items should be extended with more items automatically.</p><p>Any ideas how this can be done?</p><p>I'm thanksfull for any tip.</p>","133858","","","","","2014-02-06 19:17:12","How to trigger an event when scrollView reach the bottom with Android?","<android><events>","3","0","2","",""
"1342073","1","","","2009-08-27 16:04:30","1","3985","<p>How can I retrieve the positions of the selected item in a multichoice listView?The <code>getSelectedItemPosition</code> method returns only the first one.</p>","","henri51","1777090","","2013-01-17 06:31:20","2013-01-17 06:31:20","Android - selected item position in a listview","<android><listview>","1","0","1","",""
"1342410","1","","","2009-08-27 17:02:23","18","13222","<p>When I call setEnabled(false) for a TextView object the text color doesn't change. I expected it will be changed to gray. If I remove the line of ""android:textColor"" in my XML file, it backs to normal.</p><p>Any ideas ?</p>","","henri51","741249","","2012-05-09 14:26:52","2012-05-09 14:26:52","Android text view color doesn't change when disabled","<android><colors><android-textview>","1","2","","",""
"1343222","1","1343796","","2009-08-27 19:13:08","36","13653","<p>My understanding is that when you have a view that's too small to easily touch, you're supposed to use a TouchDelegate to increase the clickable region for that view.</p><p>However, searching for usage examples on Google turn up multiple people asking the question, but few answers.</p><p>Does anyone know the proper way to set up a touch delegate for a view to, say, increase its clickable region by 4 pixels in every direction?</p>","82156","","","","","2013-07-05 08:19:20","Is there an example of how to use a TouchDelegate in Android to increase the size of a view's click target?","<android>","8","2","21","",""
"1344080","1","","","2009-08-27 22:25:49","31","25708","<p>Now I want to display some unicode characters and I have used tag: <code>&lt;font face=""Arial""&gt;something here&lt;/font&gt;</code>. But it seems that <code>WebView</code> can not find the Arialfont because I can only see UFO-characters. Do I have to copy arial.ttf tosomewhere or how can I use this TrueType font with <code>WebView</code>? Thanks.</p>","","user164542","683261","","2012-01-19 09:03:33","2013-08-14 07:56:32"," How to use custom font with WebView","<android><webview><custom-font>","9","0","13","",""
"1344919","1","1345381","","2009-08-28 03:41:09","1","2145","<p>I'm writing an Android application that I want to be able to send requests to a Google App Engine application.  In order to do this, the Android app needs to authenticate the user (should be able to just use their Google Account).  I'm not sure I'm doing it right, but this is the only way I've found so far:</p><ol><li>Post email, password, etc. to https://www.google.com/accounts/ClientLogin</li><li>Obtain an authorization token from the aforementioned address</li><li>Use the authorization token in the header of the requests to the AppEngine application</li></ol><p>But this isn't working (users.get_current_user() still returns None).  Is there a right way to do it?</p>","123776","","","","","2009-08-28 06:41:51","Sign in to AppEngine web application from an Android client application","<android><google-app-engine>","1","1","3","",""
"1345875","1","1347777","","2009-08-28 09:13:06","1","2080","<p>I choose an item in my list to edit (I use Context Menu) , then I populate data to ""refresh"" the List and my List will display in ""Top-Down"" order. I want to display my list right in position of the item I have just edited (I don't have to drag scrollbar down to find it). So, how can I do that?</p>","152286","","152286","","2009-08-28 13:14:59","2009-08-28 15:34:27","Set ListView display right in position of ""item edited"" in android","<android><listview>","1","0","","",""
"1346558","1","","","2009-08-28 11:55:56","2","1929","<p>Any one Help me the coding to get Out going SMS / MMS count in the Android 1.5.it means my code will know automatically, when the SMS or MSS will be sent from the Mobile  </p><p>please help me any one to find the solution</p><p>thank you </p>","164783","","","","","2009-12-05 13:00:01","Android SMS MMS outgoing count in 1.5","<android>","1","2","1","",""
"1349373","1","1349449","","2009-08-28 21:08:51","3","1670","<p>I have a question about the ListView and how to use it. My Prolem is that my listView is only a part of the view and I am not sure how to do this.</p><pre><code>public class MainActivity extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ListView myListView = (ListView) findViewById(R.id.ListView01);    String[] strings = new String[]{""Test1"",""Test2""};    ArrayAdapter&lt;String&gt; myArrayAdapter= new ArrayAdapter&lt;String&gt;(this, R.id.ListView01,strings);    myListView.setAdapter(myArrayAdapter);</code></pre><p>I think the problem is the ""this"" in myArrayAdapter!?</p>","165106","","1777090","","2013-01-17 06:27:15","2013-01-17 06:27:15","Android ListView understanding","<android><android-listview>","1","0","","",""
"1350656","1","1350863","","2009-08-29 06:26:49","2","475","<p>for website that embed flash to capture camera (red5..etc). may i know is there any handset that currently support flash and can used to capture image from handset camera?</p>","108869","","4228","","2009-12-08 17:22:37","2011-06-17 11:25:01","flash + phone camera","<iphone><android><flash><red5>","3","0","","",""
"1350678","1","1350708","","2009-08-29 06:41:03","0","490","<p>I am facing a problem in adding an image at the end of the  linear layout in android. It is always added at the begining.My   question:</p><ol><li>How to add this image at the end of the Layout?</li><li>Afterwards can I add ab element from beginning?</li></ol>","95877","","1777090","","2013-01-17 06:24:24","2013-01-17 06:24:24","Layout issue for imageview Android","<java><android>","1","1","","",""
"1351218","1","1352180","","2009-08-29 11:34:11","18","16964","<p>I'm making use of an API on the internet that is marshalling objects to XML files. Given that the XSD files are also available I'd like to be able to unmarshall them back in to Java objects once I've downloaded the files.</p><p>After looking around it looks like <a href=""http://jaxb.java.net/"">JAXB</a> is the default library for doing this in Java, but as I'm developing a mobile app the extra 8.6MB dependency just isn't acceptable. I also found <a href=""http://xstream.codehaus.org/"">XStream</a>, but it still weighs in at 7.9MB.</p><p>Poking around the Android SDK it looks like the only real XML parser available is <a href=""http://developer.android.com/reference/org/xml/sax/package-summary.html"">SAX</a>.</p><p>So here's the question:</p><ol><li>Is there a way to get SAX to do what I want? </li><li>Is there another tool in the Android SDK that I've missed?</li><li>Is there another library (that's significantly smaller) that will do this?</li></ol><p>Thanks.</p>","76835","","","","","2010-09-30 21:13:12","Unmarshalling XML files into Java objects in Android?","<java><xml><android><xsd>","6","0","4","",""
"1352949","1","1354387","","2009-08-30 02:42:35","14","14409","<p>I'm connecting to my AppEngine application using the Apache HttpComponents library.  In order to authenticate my users, I need to pass an authentication token along to the application's login address (<a href=""http://myapp.appspot.com/%5Fah/login?auth="">http://myapp.appspot.com/%5Fah/login?auth=</a>...) and grab a cookie from the header of the response.  However, the login page responds with a redirect status code, and I don't know how to stop HttpClient from following the redirect, thus thwarting me from intercepting the cookie.</p><p>Fwiw, the actual method I use to send the request is below.</p><pre><code>private void execute(HttpClient client, HttpRequestBase method) {    // Set up an error handler    BasicHttpResponse errorResponse = new BasicHttpResponse(    		new ProtocolVersion(""HTTP_ERROR"", 1, 1), 500, ""ERROR"");    try {    	// Call HttpClient execute    	client.execute(method, this.responseHandler);    } catch (Exception e) {    	errorResponse.setReasonPhrase(e.getMessage());    	try {    		this.responseHandler.handleResponse(errorResponse);    	} catch (Exception ex) {    		// log and/or handle    	}    }}</code></pre><p>How would I stop the client from following the redirect?</p><p>Thanks.</p><p><strong>Update</strong>:</p><p>As per the solution below, I did the following after creating a <code>DefaultHttpClient client</code> (and before passing it to the <code>execute</code> method):</p><pre><code>if (!this.followRedirect) {    client.setRedirectHandler(new RedirectHandler() {        public URI getLocationURI(HttpResponse response,                HttpContext context) throws ProtocolException {            return null;        }        public boolean isRedirectRequested(HttpResponse response,                HttpContext context) {            return false;        }    });}</code></pre><p>More verbose than it seems it needs to be, but not as difficult as I thought.</p>","123776","","123776","","2009-08-31 01:53:32","2013-04-06 01:04:10","Preventing HttpClient 4 from following redirect","<android><google-app-engine><apache-commons>","4","1","6","",""
"1352950","1","1353713","","2009-08-30 02:42:47","0","962","<p>So it is my first real Android program (!hello world), but i do have java experience.The program compiles fine, but on running it crashes as soon as it opens (tried debugging, but it crashes before it hits my breakpoint). Was looking for any advice from anyone who is more experienced with android.</p><pre><code>package org.me.tipcalculator;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;import android.view.View;import android.widget.Button;import android.widget.EditText;import java.text.NumberFormat;import android.util.Log;public class TipCalculator extends Activity {public static final String tag = ""TipCalculator"";/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    final EditText mealpricefield = (EditText) findViewById(R.id.mealprice);    final TextView answerfield = (TextView) findViewById(R.id.answer);    final Button button =  (Button) findViewById(R.id.calculate);    button.setOnClickListener(new Button.OnClickListener()    {        public void onClick(View v) {            try            {                Log.i(tag, ""onClick invoked."");                String mealprice = mealpricefield.getText().toString();                Log.i(tag, ""mealprice is ["" + mealprice + ""]"");                String answer = """";                if (mealprice.indexOf(""$"") == -1)                {                    mealprice = ""$"" + mealprice;                }                float fmp = 0.0F;                NumberFormat nf =                        java.text.NumberFormat.getCurrencyInstance();                fmp = nf.parse(mealprice).floatValue();                fmp *= 1.2;                Log.i(tag, ""Total Meal Price (unformatted) is ["" + fmp + ""]"");                answer = ""Full Price, including 20% Tip: "" + nf.format(fmp);                answerfield.setText(answer);                Log.i(tag, ""onClick Complete"");            }            catch(java.text.ParseException pe){                Log.i (tag ,""Parse exception caught"");                answerfield.setText(""Failed to parse amount?"");            }            catch(Exception e){                Log.e (tag ,""Failed to Calculate Tip:"" + e.getMessage());                e.printStackTrace();                answerfield.setText(e.getMessage());            }        }    }    );}</code></pre><p>Just in case it helps heres the xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""Android Tip Calculator""/&gt;&lt;EditText    android:id=""@+id/mealprice""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:autoText=""true""/&gt;&lt;Button    android:id=""@+id/calculate""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Calculate Tip""/&gt;&lt;TextView    android:id= ""@+id/answer""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""""/&gt;&lt;/LinearLayout&gt;</code></pre>","119605","","225647","","2012-10-29 20:41:06","2012-10-29 20:41:06","android program crashing (new to platform)","<android><calculator>","2","0","","",""
"1353092","1","1353623","","2009-08-30 04:35:39","1","3319","<p>I want to put a ""All String"" data (get from ""Cursor"") into an ""Array"". But I don't know why the ""Array"" just return one value? I'm get lost here. Can someone help me? This is my code snippet</p><pre><code>private String[] getOneColumn(){            String[] myArray = null;    	    Cursor cursor = mDbHelper.fetchAllNotes();    startManagingCursor(cursor);    if(cursor.moveToFirst()){    	String myTitle = cursor.getString(cursor.getColumnIndex(SBooksDbAdapter.KEY_TITLE_RAW));    	myArray = myTitle.split("";"");    		    } 	    return myArray;}</code></pre>","152286","","152286","","2009-08-30 13:09:42","2011-03-07 17:00:33","How can I put ""String"" (get from cursor) into an ""Array"" in android","<android><cursor>","1","0","","",""
"1353101","1","","","2009-08-30 04:40:10","21","38186","<p>And is it possible to customize the child in expandable list?   </p>","","Raj","298389","","2012-08-08 20:44:03","2012-08-08 20:44:03","How to add image in expandable List in parent in android?","<android><expandablelistview><expandablelistadapter>","5","0","20","",""
"1354006","1","1358213","","2009-08-30 14:31:31","17","27128","<p>How can I create a list Array (the list display First Alphabet when scroll) with the cursor data?</p>","152286","","","","","2014-01-24 11:04:46","How can I create a list Array with the cursor data in android","<android><arraylist><cursor>","3","1","8","",""
"1354524","1","1354863","","2009-08-30 18:25:24","1","767","<p>I've implemented an onSaveInstanceState function in the main activity of my TabHost-based application. I need to save the state of various objects I am keeping in memory that I have all marked as serializable, as well as some basic int and string values. I have stepped through my application and watched it call the onSaveInstanceState function and presumably save everything without any manner of exception or problem. The issue is that my onCreate function is being called with a null Bundle value every time after I start the application again. I'm really at a loss and unsure why it would call the save but not pass anything into the create. Any guidance is appreciated.</p>","21126","","","","","2009-08-30 20:48:21","Android problem with saving state","<java><android>","1","0","","",""
"1354799","1","1354868","","2009-08-30 20:16:37","3","538","<p>I would like my Android application to react to an incoming email from specific address.I've heard that you can do it with incoming SMS, but emails are cheaper. Unfortunately, I am not an expert on Android's ""intents"", so would be really grateful for your help.</p>","165697","","143804","","2009-08-30 21:27:37","2013-05-03 18:33:52","How can I make an app on android start automatically, when an email arrives?","<android><email>","1","0","","",""
"1355217","1","1355372","","2009-08-30 23:34:18","6","3488","<p>Any android developers had any success changing the package name of your application (in the manifest) of an application already being distributed in the Market?</p><p>During my upgrade progress, I decided to change the package name slightly, which means that android identifies it as a new application. So, I suppose saved preferences will be lost, but I'm really hoping there are no other ""surprises"" for upgrading users.</p><p>Cheers!</p>","136903","","","","","2010-11-17 10:00:28","Android Marketplace: Changing application's package","<android><google-play>","1","0","4","",""
"1355771","1","1356529","","2009-08-31 04:20:05","5","10347","<p>I want to add an image icon in expandable list view .I have seen the tutorial they have added only in child elements .Is there any other way to add image icon in parent Any help would be appreciated.Thanks in advance.</p>","95877","","95877","","2009-08-31 06:14:35","2010-11-23 10:32:45","Image icon in expandable list view in android","<java><android>","3","0","4","",""
"1355860","1","1357831","","2009-08-31 05:02:06","0","4304","<p>I am trying to display a SpreadSheet in the Android application with auot adjustable columns and each columns should surrounded by lines.I used the Table Layout the data are displayed in the Table format but i dont know how to surround each column with lines, auto adjustment.If anyone knows it please help me.</p>","131062","","","","","2011-12-22 15:50:09","How to create a SpreadSheet kind of display in Android?","<android>","3","0","","",""
"1356317","1","","","2009-08-31 07:52:51","6","4029","<p>I'm trying to run a background task which runs every minute or so for an android application but I am struggling to ensure that the task actually runs every minute. I've tried a variety of approaches from using SystemClock.sleep() to the AlarmManager (both repeating alarm and a fixed alarm) but it seems that unless the device is charging any kind of repeating system has a variable repeat rate once the device is unplugged. Is there any way to run a stable consistently repeating service?</p>","59283","","","","","2011-05-07 11:27:43","Reliable repeating background task on android","<android>","3","1","3","",""
"1357372","1","1357620","","2009-08-31 13:04:56","29","12240","<p>I am trying to send a GET via Android's HttpURLConnection (which is an org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection), and upon receiving the response, an IOException is thrown:</p><p>in doRequestInternal(): ""Received authentication challenge is null""</p><p>What does this error mean, and what is causing this? I am writing OAuth parameters to the Authorization header, but I do this on other occasions, too, without problems.</p><pre><code>    if (connection == null) {        connection = (HttpURLConnection) new URL(endpointUrl).openConnection();        connection.setRequestMethod(""GET"");    }    //... do some OAuth message signing    connection.connect();    int statusCode = connection.getResponseCode(); // throws IOException</code></pre>","127013","","","","","2014-02-24 13:13:32","IOException: ""Received authentication challenge is null"" (Apache Harmony/Android)","<java><android><httpurlconnection>","3","0","9","",""
"1357577","1","","","2009-08-31 13:54:36","4","30943","<p>Is there     Any  way    to    set  the  width  of the  Layout.</p><p>Because   most   of the   time  it  doesn't    work?</p>","","raj","76835","","2010-02-04 06:52:46","2012-08-29 09:07:37","How to set the width of a layout in Android?","<java><android>","3","2","1","2013-04-28 13:01:54",""
"1359825","1","","","2009-08-31 23:17:14","1","556","<p>In my android project, I have 2 Activities. How can I launch an Activity from an Activity. I know I can do 'startActivity', but my activity has NOT registered for any Intent, is there anyway I can still launch it from my activity?</p><p>Thank you.</p>","128983","","","","","2012-01-26 21:19:55","how can I launch an activity directly from my activity","<android>","2","0","1","",""
"1360134","1","2901782","","2009-09-01 01:17:16","17","5444","<p>Is there any sort of xml reference?</p><p>I found this which turned out to be invaluable for me</p><ul><li><a href=""http://groups.google.com/group/android-developers/msg/d334017d72909c79"">(Multiple) Shape drawing with XML</a></li></ul><p>But I can't figure out how I was supposed to know how to do that, hadI not found that post.</p><p>I know that the api reference has xml attributes listed for many ofthe classes... but what about xml tags? Where is it documented that Icould build a shape using <code>&lt;padding&gt;</code>, <code>&lt;corners&gt;</code>, <code>&lt;solid&gt;</code> tags?</p><p>I'd really like to know where I can find such documentation. </p>","88821","","383414","","2012-09-12 11:56:40","2012-12-03 13:19:47","Is there any Android XML documentation?","<xml><android><api><reference>","4","2","7","",""
"1360352","1","1361011","","2009-09-01 03:14:08","4","27838","<p>I'm trying to teach myself how to write android apps and I'm having trouble registering a button click and taking actions based on which radio button is selected at the time. This is a simple tip calculator:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.widget.Button;import android.widget.EditText;import android.widget.RadioButton;import android.widget.TextView;import android.widget.RadioGroup;import android.view.View;public class TipCalc extends Activity implements RadioGroup.OnCheckedChangeListener,View.OnClickListener{    TextView result;    RadioGroup radiogroup1;    RadioButton r1,r2,r3;    Button calculate;    EditText bill, resulttotal;    private int radioCheckedId = -1;    @Override    protected void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        radiogroup1 = (RadioGroup) findViewById(R.id.radiogroup1);        Button calculate = (Button) findViewById(R.id.calculate);         RadioButton r1 = (RadioButton) findViewById(R.id.poor);        RadioButton r2 = (RadioButton) findViewById(R.id.average);        RadioButton r3 = (RadioButton) findViewById(R.id.excellent);        EditText bill = new EditText(this);        EditText resulttotal = new EditText(this);        radiogroup1.setOnCheckedChangeListener(this);        calculate.setOnClickListener(this);         //bill.setText(""0"");        //resulttotal.setText(""0"");     }    public void onCheckedChanged(RadioGroup group, int checkedId) {    	radioCheckedId = checkedId;    }    public void onClick(View v)    	{    		if (v == calculate)           {    			String billtotal;                double total = 0;                billtotal = bill.getText().toString();                final int aInt = Integer.parseInt(billtotal);                if (radioCheckedId == 1)                {                    total = aInt * 1.1;                    final String aString = Double.toString(total);                	resulttotal.setText(aString);                }               if (radioCheckedId == 2)                {                	total = aInt * 1.15;                	final String aString = Double.toString(total);                	resulttotal.setText(aString);                }               if (radioCheckedId == 3)               {                	total = aInt * 1.2;                	final String aString = Double.toString(total);                	resulttotal.setText(aString);               }            }        }}</code></pre><p>Everything loads just fine, but nothing happens when I press the calculate button in the virtual phone.</p>","104525","","","","","2012-07-26 01:52:55","Android - register button click and take action based on radio selection","<android><button><radio-button>","4","0","2","",""
"1360513","1","1360530","","2009-09-01 04:22:40","1","20268","<p>I get a String data from Cursor, but I don't know how to convert it to Array. How can I do that?</p><pre><code>String[] mString;for(cursor.moveToFirst(); cursor.moveToNext(); cursor.isAfterLast()) {   mTitleRaw = cursor.getString(cursor.getColumnIndex(SBooksDbAdapter.KEY_TITLE_RAW));}mString = mTitleRaw ????</code></pre>","152286","","19410","","2009-09-01 04:25:32","2011-11-02 05:14:45","Convert String to Array (android)","<android><cursor>","2","0","4","",""
"1360948","1","","","2009-09-01 07:02:46","0","471","<p>My application wants a functionality of picking a contact from the phone contact, I have achieved this using the following intent </p><pre><code>Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI); startActivityForResult(intent, 001);</code></pre><p>How do i start pick contact activity with an option to create a new contact from the pick list, similar to the one which is available in inbuilt Launcher appliation </p>","11581","","","","","2009-09-01 07:23:12","Option to create new contact from pick list","<android>","1","0","","",""
"1361332","1","1367734","","2009-09-01 08:54:23","9","36492","<p>How to make android EditText smaller than default in height?</p><p>This is the default hight:</p><p><img src=""http://home.eoeandroid.com//attachment/200908/28/5967%5F1251466521HC91.jpg"" alt=""alt text"" /></p><p>If I change the height, I can't see my text, but it has extra blank on bottom. check this image:</p><p><img src=""http://home.eoeandroid.com//attachment/200908/28/5967%5F1251466529jJSB.jpg"" alt=""alt text"" /></p>","86601","","86601","","2009-09-01 09:04:05","2012-04-27 09:23:57","How to make android EditText smaller than default in height?","<android><edittext>","4","0","3","2013-03-20 12:23:11",""
"1361944","1","1364044","","2009-09-01 11:29:25","3","2992","<p>I'm working on a web-app at work, and would like to access my development computer from my HTC Hero device. Preferably linux, but I have access to windows and mac computers. The emulator can debug locally, and helps a lot, but it's not good enough to debug real touch-events.</p><p>Ad-hoc wifi will breach our strict network policy. No matter how strict key or MAC-address restrictions it has.</p><p>Have anyone found a way to access the LAN through USB or Bluetooth? Bluetooth might be on the edge of our rules, but I will accept it as a solution if it's possible.</p><p>I'm not looking for Tethering, but rather the opposite.</p>","44643","","","","","2009-09-01 18:53:47","Access LAN on Android without wifi","<android><development-environment>","1","0","1","",""
"1361983","1","1391357","","2009-09-01 11:35:41","2","5126","<p>I have an application that differs for different languages by resources.</p><p>Is there a possibility to install the same application on Android several times? </p><p>So, as a result I will have German version, French version, English version of the same program, but each installed as a separate applications with different icons.</p>","139394","","1777090","","2013-01-21 06:42:59","2013-01-21 06:42:59","How to install the same application more than once on Android?","<android>","3","0","","",""
"1362309","1","6292804","","2009-09-01 12:50:25","0","2828","<p>I am using Spinner control in my application and my Code is</p><pre><code>    Spinner s1=new Spinner(this);    s1.setLayoutParams(new LayoutParams(100,30));    ArrayAdapter adapter=new ArrayAdapter(this, android.R.layout.simple_expandable_list_item_1);     adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    adapter.add(""One"");    adapter.add(""Two"");    adapter.add(""Three"");    s1.setAdapter(adapter);</code></pre><p>This will work fine in linearLayout .when I use the code in the TableLayout, the control is not displayed.I have to generate dynamic layout so i am not using the XML part,only through Java code i am adding the contorls.</p><pre><code>TableLayout tl=new TableLayout(this);TableRow tr=new TableRow(this);tr.addView(s1);tl.addView(tr);</code></pre><p>All the components gets added other than Spinner.</p><p>So please anyone give some solution for this.</p>","131062","","","","","2012-04-27 09:23:18","How to Customize the Spinner widget in android?","<android>","2","0","","",""
"1362602","1","","","2009-09-01 13:49:26","2","22144","<p>How to select multiple item in ListView in android.</p>","","raj","114066","","2011-11-11 07:21:03","2013-02-28 08:14:35","Selecting multiple items in ListView","<android>","6","0","13","",""
"1362723","1","1693716","","2009-09-01 14:13:28","60","28249","<p>I am using an activity with the dialog theme set, and I want it to be full screen. I tried all sorts of things, even going through the WindowManager to expand the window to full width and height manually, but nothing works.</p><p>Apparently, a dialog window (or an activity with the dialog theme) will only expand according to its contents, but even that doesn't always work. For instance, I show a progress bar circle which has width and height set to FILL_PARENT (so does its layout container), but still, the dialog wraps around the much smaller progress bar instead of filling the screen.</p><p>There must be a way of displaying something small inside a dialog window but have it expand to full screen size without its content resizing as well?</p>","127013","","","","","2013-12-23 07:47:02","How can I get a Dialog style activity window to fill the screen?","<android><gui><dialog>","3","5","14","",""
"1367284","1","","","2009-09-02 12:01:13","0","7234","<p>How we can send the Url  Using Http Get Method in Android Android ..I tried but it doesn't works.can u give me the code to send url via http get method..</p>","","Raghav","4228","","2009-09-04 15:04:07","2012-07-17 12:22:30","How we can send the Url Using Http Get Method in Android Android","<android><http><get>","2","0","","",""
"1367983","1","","","2009-09-02 14:17:39","30","52785","<p>How    to   use  viewGroup   in android</p>","","raj","","","","2012-07-24 15:12:20","How to use viewGroup in android","<android>","1","5","9","2012-07-24 15:12:24",""
"1370579","1","1382360","","2009-09-02 22:56:44","0","2927","<p>The home screen of my Android application has three EditText views, meant to be used as three different search functions, each with a ""Search"" button.</p><p>The app works perfectly on the device (G1) when using the trackball: I can move between the EditTexts with the trackball, all the events fire as expected, I can enter text using the physical keyboard in the selected EditText, Enter correctly submits the proper search, etc.etc.</p><p>However, I can't switch between the EditText views using touches - only by using the trackball.  Touches seem to be completely ignored by the EditText.  Touches do fire for the buttons, but very hard - takes a lot of tries to make a touch register.</p><p>In the simulator, clicking on any EditText does nothing - the first one always remains selected, and I never get a soft keyboard.</p><p>This is all inside a TabHost - I've read there are some problems with that configuration, but it sounds like a slightly different issue (the EditText doesn't seem to lose focus - everything works perfectly with the trackball).</p><p>Any suggestions for what I can check?</p>","114874","","114874","","2009-09-02 23:15:58","2009-09-05 03:19:58","More than one EditText - not getting focus, no soft keyboard? (Android)","<android>","2","1","","",""
"1370588","1","1370623","","2009-09-02 22:58:35","2","4763","<ol><li>I load HTML data into WebView with loadDataWithBaseURL </li><li>Do it one more time </li><li><p>Execute the following code and instead of going back to the 1st page - whole app exits. What am I doing wrong here? </p><pre><code>public boolean onKeyDown(final int keyCode, final KeyEvent event) {if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; this.browser.canGoBack()) {    this.browser.goBack();    return true;}return super.onKeyDown(keyCode, event);</code></pre><p>}</p></li></ol><p>Also - is it possible for WebView cache to survive Activity#onStop? Basically - if I close app and reopen - I want WebView to display last data that was loaded, currently - I'll get a blank screen and then have to reload same data again </p>","135946","","","","","2009-09-02 23:21:49","WebView data caching (Android)","<android><caching><webview>","1","0","2","",""
"1371312","1","1371337","","2009-09-03 03:35:22","4","1928","<p>Sorry for being the 100000th person to ask the same question. But I guess my case is slightly distinctive.</p><p>The application is that we'd like to have an Android phone client on 3g and a light python web service server.</p><p>The phone would do most of the work and do a lot of uploading, pictures, GPS, etc etc. The server just has to respond with an 'ok' per upload. </p><p>I want to use the lightest method, easiest on the battery. But reading about all these protocols is a bit confusing since they all sound the same. </p><p>Are they all on the same levels? Or can JSON be a RESTful thing etc? So as described, the key here is uploading. Does all the input for a REST transaction have to be in a URI? i.e. <a href=""http://www.server.com/upload/0x81d058f82ac13"" rel=""nofollow"">http://www.server.com/upload/0x81d058f82ac13</a>.XML-RPC and SOAP sound decently similar from Googling too.</p>","167638","","1777090","","2013-01-21 06:44:38","2013-01-21 06:44:38","REST / JSON / XML-RPC / SOAP","<python><android><service>","1","0","0","",""
"1371495","1","","","2009-09-03 04:56:58","0","2166","<p>I am new to Android application Development.</p><p>How can I identify the mouseover action for a list box? On mouse over of a particular cell I want to highlight that cell or change the background color.</p><p>Please help me regarding this.</p>","1524482","","1777090","","2013-01-21 06:43:57","2014-04-07 16:17:44","Android ListView: mouseover action","<android>","2","0","","",""
"1371939","1","","","2009-09-03 07:38:14","167","195014","<p>Can you use Visual Studio for Android Development?</p><p>If so how would you set the android SDK instead of .NET framework and are there any special settings or configuration?</p>","","BurningIce","19476","","2010-11-08 19:45:39","2013-07-04 21:00:07","How can I use MS Visual Studio for Android Development?","<android><visual-studio>","10","4","57","",""
"1372395","1","","","2009-09-03 09:27:29","1","9802","<p>I have one expandable list view and i need to set background to Expandable list view.<br>How to set this background?</p>","","raj","1139398","","2012-04-22 12:36:00","2012-04-22 12:36:00","How  to  set Background  color  of  expandable  List  in android","<android><background><expandablelistview>","1","0","","",""
"1372470","1","","","2009-09-03 09:49:56","4","9448","<p>How can I parse my local XML file located in my android project (inside res/XML folder) and want to get the values in that file.</p>","1524482","","25664","","2009-09-03 10:26:03","2011-12-07 11:03:52","Parse local XML file in Android","<xml><android>","2","2","5","",""
"1376783","1","1377431","","2009-09-04 01:20:47","8","8528","<p>I am experiencing a crash in my app when I quit (via the back button) out of my Activity. So far as I can tell this is happening in the Android codebase and not mine, but I'm not completely convinced of that.</p><p>Here's the stacktrace from adb:</p><pre><code>AndroidRuntime  E  Uncaught handler: thread main exiting due to uncaught exceptionAndroidRuntime  E  java.lang.RuntimeException: Unable to stop activity {MyApp/MyApp.MainActivity}: java.lang.NullPointerExceptionAndroidRuntime  E      at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3097)AndroidRuntime  E      at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3159)AndroidRuntime  E      at android.app.ActivityThread.access$2400(ActivityThread.java:112)AndroidRuntime  E      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1724)AndroidRuntime  E      at android.os.Handler.dispatchMessage(Handler.java:99)AndroidRuntime  E      at android.os.Looper.loop(Looper.java:123)AndroidRuntime  E      at android.app.ActivityThread.main(ActivityThread.java:3948)AndroidRuntime  E      at java.lang.reflect.Method.invokeNative(Native Method)AndroidRuntime  E      at java.lang.reflect.Method.invoke(Method.java:521)AndroidRuntime  E      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)AndroidRuntime  E      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)AndroidRuntime  E      at dalvik.system.NativeStart.main(Native Method)AndroidRuntime  E  Caused by: java.lang.NullPointerExceptionAndroidRuntime  E      at android.app.Activity.performStop(Activity.java:3575)AndroidRuntime  E      at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3092)AndroidRuntime  E      ... 11 more</code></pre><p>Anyone have any ideas/recommendations?</p>","76835","","","","","2012-04-23 04:35:33","Why am I getting a crash when exiting my Activity?","<java><android><crash><activity><nullpointerexception>","3","0","","",""
"1377018","1","1395199","","2009-09-04 03:09:19","0","801","<p>I had put a String value (Edittext input from user in my Search-Activity) in Bundle. Then I had got the Bundle (Result-Activity) to check if the user left the Edittext with no value. But It's not working. If statement have something wrong. It seems like nothing was checked. I debugged and saw first ""If"" being executed and then ""Else"". Can someone help me?</p><p>Search-Activity:</p><pre><code>@Override    protected void onCreate(Bundle savedInstanceState) {        // TODO Auto-generated method stub        super.onCreate(savedInstanceState);        mDbHelper = new SBooksDbAdapter(this);        mDbHelper.open();        setContentView(R.layout.sbooks_search);         mTextSearch = (EditText)findViewById(R.id.text_search);             searchButton = (Button)findViewById(R.id.btn_search);        mTextSearch.setFocusableInTouchMode(true);        mTextSearch.setHint(R.string.button_hint);        searchButton.setOnClickListener(new View.OnClickListener(){            public void onClick(View v){                            startSearch();                                              }        });    }    // Start Activity Search Result    public void startSearch(){                          Bundle bundle = new Bundle();               bundle.putString(SBooksDbAdapter.KEY_TITLE_RAW, mTextSearch.getText().toString());        Intent intentSearch = new Intent(this, SBooksSearchResult.class);        intentSearch.putExtras(bundle);             this.startActivity(intentSearch);               }</code></pre><p>Result-Acitity:</p><pre><code>Bundle bundle = getIntent().getExtras();            String searchText = bundle.getString(SBooksDbAdapter.KEY_TITLE_RAW);            if(searchText != """")    {        // Do nothing               }    else {          searchText = ""Hello"" ;    }</code></pre>","152286","","1777090","","2012-12-06 12:51:42","2012-12-06 12:51:42","Issue with Bundle in android","<android><database><listview><if-statement>","1","2","","",""
"1377336","1","","","2009-09-04 05:11:43","54","67665","<p>How to make the ListView transparent in android?</p><p>The background android screen image should be visible.</p>","1524482","","957654","","2014-03-07 20:53:50","2014-03-07 20:53:50","How to make a ListView transparent in Android?","<android><android-layout><android-listview>","11","3","26","",""
"1378671","1","3385961","","2009-09-04 11:25:06","138","154277","<p>I am looking to write an app which received pushed alerts from a server. I found a couple of methods to do this.  </p><ol><li>SMS - Intercept the incoming SMS and initiate a pull from the server</li><li>Poll the server periodically</li></ol><p>Each has its own limitations. SMS- no guarantee on arrival time. Poll may drain the battery.</p><p>Do you have a better suggestion please?. Thanks much.</p>","165473","","114066","","2010-08-02 08:21:15","2014-04-07 16:50:35","Push Notifications in Android Platform","<android><push><alerts>","16","3","95","",""
"1379200","1","","","2009-09-04 13:18:20","15","7883","<p>I am writing a content provider for this application and in my content provider I am opening a database connection, running a query and returning the cursor of results to the calling program. If I close this database connection in the provider, the cursor has no results. If I leave it open, I get ""leak found"" errors in my DDMS log. What am I missing here? What's the clean, proper way to return a cursor of database results?</p>","21126","","","","","2010-03-15 22:07:33","Android Content Provider database leak issue","<java><android>","3","1","10","",""
"1380378","1","1381670","","2009-09-04 16:46:54","0","242","<p>Is there an equivalent of the convertPointFromScreen method from the SwingUtilities class in the Anrdoid SDK ?</p>","164460","","","","","2009-09-04 22:12:05","Android convertPointFromScreen","<android><swing>","1","0","","",""
"1380981","1","1381425","","2009-09-04 19:00:43","7","15654","<p>I want to know that how voice recognition in android works? Which library it uses for voice recognition? Does it perform voice recognition process on device/mobile it self or it sends all voice to google servers and receives text in responce?</p><p>Thanks,  Sunny.</p>","148869","","","","","2013-10-07 07:51:18","how voice recognition in android works?","<android><voice-recognition>","2","0","5","",""
"1381093","1","1385237","","2009-09-04 19:24:24","0","503","<p>I am using embedded-linux for device which has Arch ARMv5 Speed 266MHZ, vfpu and 32bit bus, 32MB 133 Mhz DDR Ram. can you tell me which windowing system should I use,</p><p>1).QT for embedded linux 2). Android. 3). Other!!</p><p>Well, I am using microwindows for last one year and not satisfied with it as it does not have BSP (Binary Space Partitionin) in its windowing system , No shared memory support for bitmaps. I think Microwindows is just optimized for memory-size not for speed. </p><p>So,Can you please tell me what is better choice for windowing system?</p>","148869","","1777090","","2013-01-21 06:42:46","2013-01-21 06:42:46","Which window-toolkit to use for embedded linux?","<android><qt><embedded><arm><embedded-linux>","3","2","","2012-07-24 15:11:48",""
"1383246","1","1384955","","2009-09-05 12:37:04","4","8924","<p>I've used animated GIFs in Android pre cupcake however my old code no longer works. To be exact:</p><pre><code>Movie.decodeStream</code></pre><p>Always returns null... Does anyone have any workarounds/fixes to play animated GIFs?</p>","","Dawson","114066","","2010-07-02 06:50:15","2010-07-02 06:50:15","Android animated GIF (Cupcake)","<android><animated-gif><android-1.5-cupcake>","1","0","3","",""
"1383457","1","","","2009-09-05 14:31:35","0","1942","<p>1) I    have    made  an  customizable expandable List .</p><p>2) Where I can   customize  the   child.</p><p>3) But    in  parent(Group ID) I    want    to    change  the     default     icon   of  the   parent.which look   like(>).</p><p>4)Can   anyone  help  me?</p><p>ThanksRaj </p>","","raj","","","","2009-09-06 06:37:43","removing parent icon in expandable list","<android>","1","0","","",""
"1387610","1","1408173","","2009-09-07 05:02:25","1","1262","<p>Using Android, here is part of a layout xml file:</p><pre><code>&lt;LinearLayout   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:orientation=""vertical""   android:textColor=""#191919""&gt;      &lt;TextView android:id=""@+id/someTextField""	      android:layout_width=""fill_parent""	      android:layout_height=""wrap_content""	      android:layout_weight=""1"" 	      android:textStyle=""bold"" /&gt;      &lt;TextView android:id=""@+id/anotherTextField""	      android:layout_width=""fill_parent""	      android:layout_height=""wrap_content""	      android:layout_weight=""1"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>I am adding this view (at runtime) to a <code>ViewAnimator</code> like this:</p><pre><code>ViewAnimator viewAnimator = (ViewAnimator)findViewById(R.id.viewAnimator);View newView = View.inflate(this, R.layout.new_view, null);viewAnimator.addView(newView);viewAnimator.showNext();String newValue = ""new value for the text field"";findViewById(R.id.deal_view).setVisibility(View.VISIBLE);TextView someTextField = (TextView)findViewById(R.id.someTextField);someTextField.setText(newValue);</code></pre><p>This seems to be working fine, but when <code>newValue</code> is long enough to take more than 1 line of text in the layout, I am getting a crash:</p><pre><code>09-06 21:36:48.208: ERROR/AndroidRuntime(6561): Uncaught handler: thread main exiting due to uncaught exception09-06 21:36:48.248: ERROR/AndroidRuntime(6561): java.lang.StackOverflowError09-06 21:36:48.248: ERROR/AndroidRuntime(6561):     at android.view.ViewGroup.drawChild(ViewGroup.java:1486)09-06 21:36:48.248: ERROR/AndroidRuntime(6561):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)(many more lines like this)</code></pre><p>Is this enough information to see what I might be doing wrong?  It works perfectly fine when <code>newValue</code> is short enough for one line.  I've thought about trying a <code>TableLayout</code> but it seems like this is exactly what a <code>LinearLayout</code> is good for. </p>","101280","","","","","2009-09-10 23:04:22","TextView inside a LinearLayout, crash with a long string","<android><android-linearlayout>","1","3","","",""
"1387830","1","","","2009-09-07 06:30:44","32","33128","<p>I am not able to access android market through emulator.</p>","168924","","148271","","2011-04-26 14:51:41","2012-01-15 17:04:14","How to install Android Market App on the emulator?","<android><google-play>","7","1","24","",""
"1388336","1","","","2009-09-07 09:00:43","-1","311","<p>I am not able to access any messenger site through emulator even Gtalk also,so please help me if anybody knows.</p>","168924","","168924","","2009-09-07 12:02:40","2009-09-08 04:53:30","I am not able to access any messenger site from Android emulator? please help","<android>","1","5","","",""
"1389279","1","","","2009-09-07 12:48:55","0","181","<p>I  am  facing   problem     in    fixing the    child  in  particular     placein  views   or   layout.</p><ol><li>Can  I  fix   the     child   at      the  starting   and   ending  of  Layout  directly ?</li><li>Can I   fix  the    child  at  the   starting  or  ending  of the   view  directly ?</li></ol>","","raj","996493","","2012-04-01 06:00:36","2012-04-01 06:00:36","How to fix child in views","<android><layout>","1","0","","",""
"1389435","1","","","2009-09-07 13:29:45","5","8589","<p>I have my own custom library apk file (say lib.apk) &amp; i want make itavailable to other applications.How to provide the uses-library in the android manifest.xml file inother apps so as to use my custom library. </p>","164460","","","","","2012-04-01 06:04:08","How to use my custom library apk file in other applications","<android>","5","3","2","",""
"1389679","1","1391345","","2009-09-07 14:32:33","6","5077","<p>I will describe briefly my trouble with audio recording.</p><p>So, I am doing audio recording using MediaRecorder, but unfortunately when I playback the recorded audio, I have media with a very low volume. I hardly hear anything. </p><p>Is there any possibility to setup recording volume?</p><p>Thanks.</p>","139394","","522729","","2012-04-15 21:23:55","2012-04-15 21:23:55","Android. How to Do Audio Recording with High Volume?","<android><audio-recording>","2","0","3","",""
"1389811","1","1391944","","2009-09-07 15:07:00","2","6383","<p>After I closed my app for a while then reopen it again,my app will not update location or sometime it will take long time( about 5min) before update.How can I fix it? This is my code </p><pre><code>  private LocationManager lm;private LocationListener locationListener;  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);        lm = (LocationManager)         getSystemService(Context.LOCATION_SERVICE);        locationListener = new mLocationListener();    lm.requestLocationUpdates(        LocationManager.GPS_PROVIDER, 0, 0, locationListener); }private class myLocationListener implements LocationListener {    @Override    public void onLocationChanged(Location loc) {        if (loc != null) {            TextView gpsloc = (TextView) findViewById(R.id.widget28);            gpsloc.setText(""Lat:""+loc.getLatitude()+"" Lng:""+ loc.getLongitude());        }    }    @Override    public void onProviderDisabled(String provider) {        // TODO Auto-generated method stub        TextView gpsloc = (TextView) findViewById(R.id.widget28);        gpsloc.setText(""GPS OFFLINE."");    }    @Override    public void onProviderEnabled(String provider) {        // TODO Auto-generated method stub    }    @Override    public void onStatusChanged(String provider, int status,         Bundle extras) {        // TODO Auto-generated method stub    }}</code></pre>","169736","","","","","2012-03-11 07:07:35","GPS not update location after close and reopen app on android","<android><gps>","2","3","7","",""
"1391064","1","1520359","","2009-09-07 21:46:54","2","3768","<p>I am trying to calculate a route based on either geographic location or address. I figured the obvious way would be to use some part of the built-in Google Maps package, but it proved harder than assumed. There used to be a package called <code>com.google.googlenav</code>, but from that disappeared with the 1.0 release of the Android SDK.</p><p>I know that Google Maps has a public JavaScript API, but since the application is developed for the Android (in Java) and I would like to have an offline alternative, is there any other library packages, built-in or 3rd party, that I can use to achieve this?</p>","9479","","33051","","2011-09-05 11:18:20","2011-09-05 11:18:20","Calculating map routes on Android","<android><routes><maps>","2","2","2","",""
"1392521","1","","","2009-09-08 07:38:31","0","2875","<p>I am using a GridView. It contains images.  When I click on any item of this grid view I want this image Resource ID to be sent to another activity.  Where can I display this image in larger size?How can I get Image Resource ID and send it to other activity?</p>","","BurningIce","1288","","2009-09-08 19:09:26","2011-10-27 20:18:38","How can i get Image Resource ID and send it to other activity in Android?","<android>","2","0","","",""
"1392842","1","1394582","","2009-09-08 09:02:24","9","8650","<p>If i set a views visibility which as been inflated, to gone, will it Speed up my UI?</p>","117691","","","","","2011-03-16 20:37:53","Android View Visibility GONE","<android>","2","0","1","",""
"1394694","1","1437963","","2009-09-08 15:36:18","3","5699","<p>I setup my <code>SoundPool</code>, and load a sound resource as this in <code>onCreate()</code>:</p><pre><code>soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);soundId = soundPool.load(this, R.raw.edible_underwear, 1);</code></pre><p>And then I try to play this sound twice in a <code>onClick()</code>, one slow mostly in left speaker, and one fast mostly in the right speaker:</p><pre><code>soundPool.play(soundId, 0.9f, 0.1f, 0, -1, 0.7f);soundPool.play(soundId, 0.1f, 0.1f, 0, -1, 1.5f);</code></pre><p>No sound can be heard. I have fiddled with the volumes, priorities and rates. So far to no avail. Am I missing something obvious?</p>","165059","","","","","2011-01-27 00:07:03","Why is my SoundPool mute?","<android><sound-api><soundpool>","2","2","2","",""
"1395639","1","1399841","","2009-09-08 18:44:13","0","3005","<p>This used to work:</p><pre><code>adb shell am start -a android.intent.action.CALL tel:1234</code></pre><p>However, now I get this error:</p><pre>09-08 14:35:57.821 W/dalvikvm( 1107): threadid=3: thread exiting with uncaught exception (group=0x4001b200)09-08 14:35:57.841 E/AndroidRuntime( 1107): Uncaught handler: thread main exiting due to uncaught exception09-08 14:35:57.841 E/AndroidRuntime( 1107): *** EXCEPTION IN SYSTEM PROCESS.  System will crash.09-08 14:35:57.871 E/AndroidRuntime( 1107): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:1234 flg=0x10000000 cmp=com.android.phone/.OutgoingCallBroadcaster } from null (pid=-1, uid=-1) requires android.permission.CALL_PHONE09-08 14:35:57.871 E/AndroidRuntime( 1107):     at android.os.Parcel.readException(Parcel.java:1218)09-08 14:35:57.871 E/AndroidRuntime( 1107):     at android.os.Parcel.readException(Parcel.java:1206)09-08 14:35:57.871 E/AndroidRuntime( 1107):     at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1149)09-08 14:35:57.871 E/AndroidRuntime( 1107):     at com.android.commands.am.Am.runStart(Am.java:202)09-08 14:35:57.871 E/AndroidRuntime( 1107):     at com.android.commands.am.Am.run(Am.java:76)09-08 14:35:57.871 E/AndroidRuntime( 1107):     at com.android.commands.am.Am.main(Am.java:54)09-08 14:35:57.871 E/AndroidRuntime( 1107):     at com.android.internal.os.RuntimeInit.finishInit(Native Method)09-08 14:35:57.871 E/AndroidRuntime( 1107):     at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:186)09-08 14:35:57.871 E/AndroidRuntime( 1107):     at dalvik.system.NativeStart.main(Native Method)09-08 14:35:57.911 E/JavaBinder( 1107): Unknown binder error code. 0xfffffff709-08 14:35:57.921 E/AndroidRuntime( 1107): Crash logging skipped, no checkin service09-08 14:35:57.921 I/Process ( 1107): Sending signal. PID: 1107 SIG: 9</pre><p>Is there a workaround for this?</p>","907","","811","","2009-09-08 18:47:44","2009-09-09 13:55:40","Why am I seeing an error when making a call from the adb shell?","<android><adb>","2","0","1","",""
"1396133","1","1396542","","2009-09-08 20:19:55","5","844","<p>I know Android's Activity model is a bit different from what I usually consider to be an ""app"".</p><p>I want to do something (in this case, check some notifications on a server and show them if available) when my app is ""launched"".  What is a good way to accomplish this?</p><p>I likely don't want to do it in an activity's OnCreate, since each activity can be created any number of times - the code would get called more often than necessary.</p><p>The app also has multiple entry points - would I have to duplicate the check in each activity?</p><p>What I'm thinking of doing is setting up this code inside the Application object, along with a flag that tracks whether it's already been called - and just call it from each Activity's onCreate().</p><p>Is there a better or more ""proper"" way to do this?</p>","114874","","","","","2009-09-08 21:57:27","(android) How to do something on app ""launch""?","<android>","3","0","6","",""
"1396495","1","1396610","","2009-09-08 21:47:01","3","1598","<p>I have a simple WebView-based activity that follows the <a href=""http://developer.android.com/guide/tutorials/views/hello-webview.html"" rel=""nofollow"">Hello, WebView</a> example to enable JavaScript and overload <code>shouldOverrideUrlLoading()</code>.</p><p>This Activity works great when the user touches links on the webpage.  However, if the user uses the trackball and clicks on a link, then the resulting page load shows a page with JavaScript disabled.</p><pre><code>public class ViewUrl extends Activity {    protected WebView view;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.view_url);        final String url = ""http://www.opentable.com/phone/reviews.aspx?rid=2947"";        view = (WebView) findViewById(R.id.widget1);        view.getSettings().setJavaScriptEnabled(true);        view.loadUrl( url );        view.setWebViewClient( new WebViewClient() {            @Override            public boolean shouldOverrideUrlLoading(WebView view, String url) {                view.loadUrl(url);                return true;            }        });    }}</code></pre><p>The view_url.xml file is straightforward:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;WebView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:id=""@+id/widget1"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Below are some screenshots showing both the correct and incorrect behavior.</p><p>Click using Touch (CORRECT):</p><p><img src=""http://img.skitch.com/20090908-g2acnrpb1riuq11ys3p1u6fd4d.png"" alt=""Click using Touch (CORRECT)"" /></p><p>Click using Trackball (INCORRECT):</p><p><img src=""http://img.skitch.com/20090908-my23yxakudwhheq875j2hcwg6h.png"" alt=""Click using Trackball (INCORRECT)"" /></p><p>Any ideas how I can fix the Trackball behavior to be the same as the touch behavior?  Or at least enable JS when links are clicked via the trackball?</p>","82156","","","","","2009-09-08 22:11:52","WebView JavaScript links work on touch but not when using trackball","<android><webview><trackball>","1","0","1","",""
"1396795","1","1399246","","2009-09-08 23:04:12","1","628","<p>Whats a Good Draw Time? Im getting around 30-35 MS when i look at it in HeirchyViewer</p>","117691","","764272","","2009-09-09 00:59:33","2010-05-19 07:03:42","Android Draw Time","<android><performance>","1","1","","",""
"1397183","1","1457477","","2009-09-09 01:45:25","7","20025","<p>I have a <a href=""http://developer.android.com/reference/android/widget/ListView.html"" rel=""nofollow"">ListView</a> that I'm populating from a custom <a href=""http://developer.android.com/reference/android/widget/ListAdapter.html"" rel=""nofollow"">ListAdapter</a>. Inside the Adapter (in the <a href=""http://developer.android.com/reference/android/widget/Adapter.html#getView%28int,%20android.view.View,%20android.view.ViewGroup%29"" rel=""nofollow"">getView(int, View, ViewGroup)</a> method) I'm setting the background color of the <a href=""http://developer.android.com/reference/android/view/View.html"" rel=""nofollow"">View</a> using <a href=""http://developer.android.com/reference/android/view/View.html#setBackgroundColor%28int%29"" rel=""nofollow"">setBackgroundColor(int)</a>. The problem is that no matter what color I set the background to it always comes out a dark grey. It might also be worth noting that I'm using the Light theme.</p><p><strong>Relevant (simplified) bits of code:</strong></p><p>AndroidManifest.xml:</p><pre><code>&lt;activity     android:name="".MyActivity""    android:theme=""@android:style/Theme.Light"" /&gt;</code></pre><p>MyAdapter.java:</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    LayoutInflater inflater = LayoutInflater.from(mContext);    View av = inflater.inflate(R.layout.my_row, parent, false);    av.setBackgroundColor(R.color.myRow_red);    mName = (TextView) av.findViewById(R.id.myRow_name);    mName.setText(""This is a name"");    return av;}</code></pre><p>Any ideas/suggestions?</p>","76835","","76835","","2009-09-09 01:55:27","2014-04-15 11:17:30","Android ListView background colors always showing grey","<android><listview><view><themes>","6","0","2","",""
"1397361","1","","","2009-09-09 03:12:37","125","74569","<p>How do I restart an Android Activity?  I tried the following, but the activity simply quits.</p><pre><code>public static void restartActivity(Activity act){        Intent intent=new Intent();        intent.setClass(act, act.getClass());        act.startActivity(intent);        act.finish();}</code></pre>","157195","","844882","","2012-07-02 03:59:34","2014-01-14 23:32:23","How do I restart an Android Activity","<android><android-activity>","11","1","38","",""
"1397547","1","1397638","","2009-09-09 04:39:07","1","726","<p>In an AR app whereby you annotate objects or buildings in a camera view, I want to understand the role, that different hardware bits - on the phone (iPhone/Android) - play to achieve the AR effect. Please elaborate more on the following:</p><ul><li>Camera: provides the 2D view of reality.</li><li>GPS: provides the longitude,latitude of the device.</li><li>Compass: direction with respect to magnetic north.</li><li>Accelerometer: (does it have a role?)</li><li>Altimeter: (does it have a role?)</li></ul><p>An example: if the camera view is showing the New York skyline, how does the information from the hardware listed above help me to annotate the view ? Assuming I have the longitude &amp; latitude for the Chrysler building and it is visible in my camera view, how does one calculate with accuracy where to annotate the name on the 2D picture ? I know that given 2 pairs of (longitude,latitude), you can calculate the distance between the points.</p>","27328","","27328","","2009-09-09 04:49:44","2009-09-09 05:06:41","Is my understanding of the functions of compass & GPS correct in AR apps?","<iphone><android><graphics><navigation><augmented-reality>","1","0","7","",""
"1397919","1","","","2009-09-09 06:49:37","0","808","<p>How to access android market through third party boards</p>","168924","","110028","","2011-01-18 18:49:33","2011-01-18 18:49:33","Does Android market works on Beagle board(or any Third party board)? if yes How?","<android><beagleboard>","2","0","","",""
"1399605","1","1409629","","2009-09-09 13:11:21","14","34043","<p>I am using a TableLayout. I need to have both horizontal and vertical scrolling for this layout. By default I am able to get vertical scrolling in the view but horizontal scrolling is not working.</p><p>I am using Android SDK 1.5 r3.  I have already tried <code>android:scrollbars=""horizontal""</code>.</p><p>I have read on some forums that in the cupcake update, horizontal scrolling is possible.</p><p>How can I make my layout scroll in both directions?</p>","152867","","1401895","","2013-03-27 19:24:03","2013-03-27 19:26:36","How can I make my layout scroll both horizontally and vertically?","<android><android-widget><android-scrollview>","4","0","9","",""
"1400407","1","","","2009-09-09 15:30:04","2","797","<p>I'm having problem with installing the android in with Eclipse 3.5 sdk.</p><p>Here are some specifications,  </p><ol><li>I have the android 1.5 sdk zip file, and</li><li>And the Eclipse 3.5 sdk zip file. </li></ol><p>I have tried installing android as a plug-in but was unable, please tell me the way so that i can install android in Eclipse with above specifications only. please note that i have the 'ANDROID ZIP FILE'.</p>","125049","","","","","2009-09-09 18:04:21","help me doing this- 'installing Android zip in Eclipse3.5 sdk'","<android><eclipse>","2","0","","",""
"1400782","1","","","2009-09-09 16:46:19","47","87816","<p>On a layout I want to scale the background image (keeping its aspect ratio) to the space allocated when the page gets created. Anyone have any idea how to do this?</p><p>I am using layout.setBackgroundDrawable() and am using a BitmapDrawable to setGravity for clipping and filling, but don't see any option for scaling.</p>","","Sam","72882","","2012-12-14 13:25:26","2014-02-21 09:04:55","Android: Scale a Drawable or background image?","<android>","10","1","13","",""
"1401280","1","1402709","","2009-09-09 18:26:31","20","18561","<p>I am trying to listen for any change in the contact database.</p><p>So I create my contentObserver which is a child class of ContentObserver:</p><pre><code> private class MyContentObserver extends ContentObserver {        public MyContentObserver() {            super(null);        }        @Override        public void onChange(boolean selfChange) {            super.onChange(selfChange);            System.out.println ("" Calling onChange"" );        }    }MyContentObserver contentObserver = new MyContentObserver();context.getContentResolver().registerContentObserver (People.CONTENT_URI, true, contentObserver);</code></pre><p>But When I use 'EditContactActivity' to change the contact database, My onChange function does not get called.</p>","128983","","","","","2013-12-28 12:24:10","how to listen for changes in Contact Database","<android>","2","2","18","",""
"1401537","1","1401551","","2009-09-09 19:17:51","4","9742","<p>This is a dumb question and I know the answer is sitting in front of me, I'm just having trouble searching for it in the right way.</p><p>I've got a custom view that has been set as the content view and inflated from xml.  How can I access the instance to call methods on it from the activity class?  I remember seeing something akin to getResourceById() a while back, but now I can't seem to find it and I'm not even sure if that's the best way to do it.</p><p>Sorry for the dumb question.</p>","150771","","1777090","","2013-01-21 06:59:43","2013-01-21 06:59:43","Get Android View Instance","<android>","1","0","2","",""
"1401791","1","1401833","","2009-09-09 20:06:08","3","1062","<p>How can you implement a RadioButtonPreference in android? Just like the CheckBoxPreference.</p><p>Are there any workarounds?</p>","61525","","21234","","2009-09-09 20:08:53","2009-09-09 20:14:01","Implement a RadioButtonPreference in Android","<android><preferences>","1","0","","",""
"1403352","1","1404549","","2009-09-10 04:29:15","1","1880","<p>I'm trying to build a simple video recorder for an Android device and I've had limited success and mixed results.  It worked once, but now, without changing anything, I'm getting a ""Camera is not available"" error followed by ""prepare failed -2147483648"" error</p><p>The constructor for the previewer looks like</p><pre><code>   private SurfaceHolder holder_;   private MediaRecorder r_;   public CameraPreview(Context context, AttributeSet attrs) {       super(context, attrs);       holder_ = getHolder();       holder_.addCallback(this);       holder_.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);       r_ = new MediaRecorder();       r_.setAudioSource(MediaRecorder.AudioSource.MIC);       r_.setVideoSource(MediaRecorder.VideoSource.CAMERA);       r_.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);       r_.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);       r_.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);    }</code></pre><p>And my </p><pre><code>surfaceCreated()</code></pre><p>method looks like</p><pre><code>    @Override    public void surfaceCreated(SurfaceHolder holder) {        r_.setPreviewDisplay(holder_.getSurface());        r_.setOutputFile(""/sdcard/test.mpg"");        if (r_ != null){            try{                r_.prepare();                r_.start();            }catch(Exception e){                e.printStackTrace();            }        }     }</code></pre><p>Any thoughts?</p><p>Thanks, Chris</p>","150771","","150771","","2009-09-10 05:56:08","2011-11-10 02:24:34","Android Camera Prepare Fails","<android><video>","2","0","1","",""
"1403537","1","1404538","","2009-09-10 05:38:18","0","1353","<p>I have various pieces of generated HTML/JS that I load into Activity with WebView#loadDataWithBaseURL. Is there a way to not load in again and again during Activity lifecycle? For example - user goes to check the message and then calls the app again. At that point - the Activity is stopped and probably destroyed, when it's loaded again I do not want to hiccup on loading the content user was already viewing.</p>","135946","","","","","2010-11-12 06:37:02","Retain data in WebView (Android)","<android><caching><webview>","2","0","","",""
"1403999","1","1404054","","2009-09-10 08:15:10","9","3059","<p>I am very interested in mobile application development. But which language or framework is more popular, useful and usable?</p><p>I know Java well. If you have any idea and/or experience, please help me to take my decision.</p>","169965","","63550","","2010-12-14 01:20:30","2012-07-26 14:45:03","In J2ME and Android which one is more useful, useable and popular as mobile programming language or framework?","<android><java-me><mobile-application>","12","0","6","2013-01-18 20:04:18",""
"1404555","1","","","2009-09-10 10:46:06","2","4918","<p>I need to create view without XML. I retrieve the id by the getID method of the views but I get a ResourceNotFoundException. I tried to use to fix this ID the setID method but it doesn't work anymore.</p>","164460","","","","","2012-04-05 11:34:34","Android view without xml","<xml><android><view>","4","2","1","",""
"1407100","1","","","2009-09-10 19:02:23","8","18701","<p>I am trying to dynamically add and remove rows from a TableLayout.</p><p>The layout is defined in an xml file.</p><p>I am able to successfully remove a row, but when I call the corresponding addView command nothing happens.</p><pre><code>table = (TableLayout)findViewById(R.id.table);row = (TableRow)findViewById(R.id.row);table.removeView(row);table.addView(row);</code></pre><p>This results in a row being removed, but not being added again.</p><p><strong>Edit: It turns out it was adding if after all, just at the bottom of the screen instead of in the same location as it was removed from.</strong></p><p>I am able to add it in the correct position by specifying the index:</p><pre><code>table.addView(row,4); // 4 happens to the the row</code></pre><p>but I can not figure out how to determine the index of the row  , there does not seem to be a method to accomplish this. anyone know how do to that? (ie. if I did not know the index was 4 how could I figure that out)</p><p>Edit: included XML. this is just the row in question, there are other rows above and below it</p><pre><code>&lt;TableRow android:id=""@+id/row""&gt;        &lt;TextView android:id=""@+id/field1""            android:text=""testing""    	android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:padding=""3dip""            android:textStyle=""bold""            android:textSize=""18dip""        /&gt;        &lt;TextView android:id=""@+id/field2""            android:padding=""3dip""            android:text=""test""            android:textSize=""18dip""            android:gravity=""right""        /&gt;    &lt;/TableRow&gt;</code></pre>","62088","","62088","","2009-09-11 16:03:13","2011-12-09 16:34:22","Dynamically adding and removing table rows - Android","<android>","2","2","4","",""
"1407442","1","1408132","","2009-09-10 20:08:27","12","13585","<p>We are creating an app for a client that has hundreds of megabytes of HTML in SQLite databases. We have implemented a way to query this data and scroll through it all in a reasonably fast manner. The issue is that some of the databases have very large queries (20,000+ rows) and we are seeing errors when we are growing the queries as the user is scrolling. So I guess the question is, what options do we have in querying and displaying tens of thousands of rows of data in Android?</p><p>Here is the stacktrace we're seeing:</p><pre><code>09-10 19:19:12.575: WARN/IInputConnectionWrapper(640): showStatusIcon on inactive InputConnection09-10 19:19:18.226: DEBUG/dalvikvm(640): GC freed 446 objects / 16784 bytes in 330ms09-10 19:19:32.886: ERROR/CursorWindow(19416): need to grow: mSize = 1048576, size = 36, freeSpace() = 30, numRows = 1771709-10 19:19:32.896: ERROR/CursorWindow(19416): not growing since there are already 17717 row(s), max size 104857609-10 19:19:32.916: ERROR/CursorWindow(19416): The row failed, so back out the new row accounting from allocRowSlot 1771609-10 19:19:33.005: ERROR/Cursor(19416): Failed allocating fieldDir at startPos 0 row 1771609-10 19:19:35.596: DEBUG/Cursor(19416): finish_program_and_get_row_count row 2431509-10 19:19:41.545: DEBUG/dalvikvm(698): GC freed 2288 objects / 126080 bytes in 260ms09-10 19:19:43.705: WARN/KeyCharacterMap(19416): No keyboard for id 009-10 19:19:43.717: WARN/KeyCharacterMap(19416): Using default keymap: /system/usr/keychars/qwerty.kcm.bin09-10 19:20:04.705: ERROR/CursorWindow(19416): need to grow: mSize = 1048576, size = 17, freeSpace() = 3, numRows = 1709409-10 19:20:04.716: ERROR/CursorWindow(19416): not growing since there are already 17094 row(s), max size 104857609-10 19:20:04.726: ERROR/Cursor(19416): Failed allocating 17 bytes for text/blob at 17093,209-10 19:20:05.656: DEBUG/Cursor(19416): finish_program_and_get_row_count row 525709-10 19:24:54.685: DEBUG/dalvikvm(637): GC freed 9297 objects / 524176 bytes in 247ms09-10 19:32:07.656: DEBUG/dalvikvm(19416): GC freed 9035 objects / 495840 bytes in 199ms</code></pre><p>Here is our CursorAdapter code:</p><pre><code>    private class MyAdapter extends ResourceCursorAdapter {    public MyAdapter(Context context, Cursor cursor) {        super(context, R.layout.my_row, cursor);            }    public void bindView(View view, Context context, Cursor cursor) {                        RowData data = new RowData();        data.setName(cursor.getInt(cursor.getColumnIndex(""name"")));        TextView tvItemText = (TextView)view.findViewById(R.id.tvItemText);        tvItemText.setText(data.getName());        view.setTag(data);    }    @Override    public Cursor runQueryOnBackgroundThread(CharSequence constraint) {        /* Display the progress indicator */        updateHandler.post(onFilterStart);        /* Run the actual query */                       if (constraint == null) {            return myDbObject.getData(null);                             }        return myDbObject.getData(constraint.toString());                    }            }</code></pre>","21126","","21126","","2009-09-10 20:30:17","2013-07-17 23:55:44","Android SQLite and huge data sets","<java><android>","3","2","14","",""
"1408781","1","1409234","","2009-09-11 03:06:01","32","29297","<p>I have an <code>EditText</code> and a <code>Button</code> set next to each other on the same horizontal line.  It looks great, except when the user enters a lot of text, the <code>EditText</code> is resized, and the <code>Button</code> is squished.</p><p>I have both <code>EditText</code> and <code>Button</code> set to <code>layout_width=""wrap_content""</code>.  <code>""fill_parent""</code> messes up the layout, and I don't want to use absolute sizes if I don't have to - the way it is now looks great in both landscape and portrait, I just don't want the <code>EditText</code> to resize.</p><p>My layout:</p><pre><code>&lt;TableLayout    android:id=""@+id/homelayout""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;TableRow&gt;        &lt;TextView            android:id=""@+id/labelartist""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""Find artists:"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;EditText            android:id=""@+id/entryartist""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_weight=""6""            android:background=""@android:drawable/editbox_background""            android:editable=""true""            android:padding=""5px""            android:singleLine=""true"" /&gt;        &lt;Button            android:id=""@+id/okartist""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignParentRight=""true""            android:layout_marginLeft=""10dip""            android:layout_weight=""1""            android:text=""Search"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","114874","","717341","","2013-09-22 01:42:55","2013-09-22 01:42:55","How do I prevent an EditText from resizing itself when the user is typing?","<android><layout><edittext><android-edittext>","7","0","12","",""
"1409623","1","1409727","","2009-09-11 08:07:37","5","10765","<p>This is a very common scenario: displaying images in a ListView which have to be downloaded from the internet.</p><p>Right now I have a custom subclass of ArrayAdapter which I use for the ListView. In my getView() implementation of the ArrayAdapter, I spawn a separate thread to load an image. After the loading is done, it looks up the appropriate ImageView and sets the image with ImageView.setImageDrawable(). So the solution I used is kind of similar to this one: <a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview"">http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview</a></p><p>The problem I'm having is that as soon as I make the call to setImageDrawable() on the ImageView, the ListView somehow refreshes all currently visible rows in the list! This results in kind of an infinite loop:</p><ol><li>getView() is called</li><li>thread is spawned to load image</li><li>image is loaded; setImageDrawable() is called on ImageView</li><li>ListView picks it up for some reason and refreshes itself</li><li>For the ListView to refresh, getView() is called for each visible row, so we go back to step 1 and the whole thing repeats itself</li></ol><p>So as far as I can see, the solution proposed in ""Android - How do I do a lazy load of images in ListView"" (see link above) simply doesn't work. It might look like it does, but it will run very slow because in the background, it keeps reloading the currently visible rows. </p><p>Did anyone encounter this before and/or have a solution for this?</p>","109774","","56338","","2010-07-29 07:08:58","2012-03-07 13:32:32","Android - Issue with lazy loading images into a ListView","<java><android><listview><image><lazy-loading>","4","0","6","",""
"1409894","1","1409913","","2009-09-11 09:16:45","0","5893","<p>Tomorrow I am buying an HTC magic phone on the Rogers network. Since it runs android (the only reason for picking this phone :) ), I was hoping to do some playing around with it, writing applications for it and the like. But first of all, how? Do I need some special cord? I know about the android SDK, but how do I even get started?</p><p>And, the main point of this question: I've never programmed for anything besides a website or a PC before. What is strikingly new and exciting about writing software for a phone? What are some things I should try to write, which aren't too difficult, and will maximize my ""OMG AWESOME"" moment density per unit of time?</p><p>Oh, one more (possibly stupid) question: What language do I write in? Java...right? Is there any other languages or frameworks I can use to write for this phone?</p><p>Note that there's nothing special about this phone: It's not unlocked anything, I didn't order it as a developer phone from Google, I'm buying it out of a Rogers store on a three year contract.</p>","84478","","","","","2011-06-18 01:46:01","What sorts of fun things can I do with an android phone?","<android><projects>","4","0","","2012-07-24 15:50:40",""
"1410504","1","1410588","","2009-09-11 12:11:30","56","46639","<p>Is there a way to make an application completely ignore a screen orientation change?</p>","139394","","63550","","2011-08-29 16:30:57","2013-06-14 07:50:56","How to make application completely ignore screen orientation change in Android?","<android>","6","1","20","",""
"1410885","1","1437989","","2009-09-11 13:31:51","12","10218","<p>I am implementing <code>OnTouchListener</code> and am receiving MotionEvent objects. Some <code>ACTION_MOVE</code> events reports absolute X/Y coordinates, while some reports relative coordinates.</p><p>How can I ask a <code>MotionEvent</code> what kind of coordinates it currently represents?</p>","165059","","","","","2010-01-06 06:36:17","How do I know if a MotionEvent is relative or absolute?","<android><touch>","3","0","5","",""
"1411047","1","1411252","","2009-09-11 14:01:34","1","1847","<p>I want to make my android application as executable file that can install in any other android emulator like JAR in java programming.If anyone know please help me.</p>","131062","","","","","2012-01-05 09:38:25","How to make Android application as executable file like JAR in Java?","<android>","2","0","1","",""
"1412129","1","","","2009-09-11 17:00:05","7","1422","<p>I am using an animation that makes a flip (on <code>ImageView</code>), but animation works not smooth (looks like performance issue). The image is a PNG file of size 128x128.</p><p>Here I will post code of my animation:</p><pre><code>&lt;set xmlns:android=""http://schemas.android.com/apk/res/android"" android:shareInterpolator=""false""&gt;    &lt;scale        android:fromXScale=""1.0""        android:toXScale=""0.0""        android:fromYScale=""1.0""        android:toYScale=""1.0""        android:pivotX=""50%""        android:pivotY=""50%""        android:duration=""500""                android:fillAfter=""false""        android:fillEnabled=""false""    /&gt;&lt;/set&gt;</code></pre><p>I also want to emphasize that the containing view can have up to eight such <code>ImageViews</code> (which are also scaled).</p><p>Could you please provide me with any advice that can improve animation performance ?</p>","139394","","996493","","2012-04-01 05:52:51","2012-04-01 05:52:51","Android. Animation Performance","<android><performance><animation>","1","1","0","",""
"1412221","1","2809165","","2009-09-11 17:19:40","12","4196","<p>Is there a way to open up the Messaging Activity on android with a specific SMS?</p>","125440","","114066","","2010-12-29 19:01:09","2012-01-06 09:04:51","How to open up a specific SMS in android","<android><sms><android-intent>","3","0","2","",""
"1414059","1","","","2009-09-12 02:26:54","1","1343","<p>I want to draw an image that on some levels may be larger than the screen as the background for a Android game.  I want the user to be able to scroll the image using their finger on the touch screen.</p><p>Here is how I am drawing the background:</p><pre><code>Bitmap scratch =  BitmapFactory.decodeResource(getResources(),R.drawable.background);canvas.drawColor(Color.BLACK);canvas.drawBitmap(scratch, 0, 0, null);</code></pre>","","Glen","","","","2009-09-12 03:16:58","How do I draw a scrollable background for an Android game","<android>","1","0","2","",""
"1414288","1","1414473","","2009-09-12 04:37:23","11","34194","<p>I have very little idea about mobile platforms, though I am interested to program for them. </p><p>Would you please compare <strong>J2ME</strong> <em>VS</em> <strong>Android</strong> <em>VS</em> <strong>iPhone</strong> <em>VS</em> <strong>Symbian</strong> <em>VS</em> <strong>Windows CE</strong>.</p><p>I would like to know:</p><ul><li>which one is better</li><li>which one should I choose and why</li><li>if there is any VM technology to test the programs</li><li>is there any IDE, debugging facilities?</li></ul><p>Personally, I would like to code for open source, but any suggestions are welcome. I have preliminary knowledge on Java. I would also like to know, if there is anything else that you can recommend.</p>","170795","","603891","","2011-05-29 20:53:47","2013-03-25 06:02:34","J2ME VS Android VS iPhone VS Symbian VS Windows CE","<iphone><android><java-me><windows-ce><symbian>","13","0","16","2012-01-18 12:40:45",""
"1414812","1","1417008","","2009-09-12 10:27:17","1","2159","<p>I have a LinearLayout defined in XML that I want to use repeatedly to display elements of a list. The XML-layout looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:background=""@drawable/background""android:paddingBottom=""5px""&gt;&lt;TextView  android:id=""@+id/destination""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:textSize=""22dp""android:text=""@string/test_destination""android:paddingLeft=""5px""/&gt;&lt;TextView  android:id=""@+id/date""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:textSize=""15dp""android:text=""@string/test_date""android:paddingLeft=""5px""/&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/info""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:paddingLeft=""5px""android:paddingTop=""10px"" &gt;    &lt;TableRow&gt;        &lt;TextView        	android:id=""@+id/reg_label""        	android:gravity=""right""        	android:paddingRight=""5px""            android:text=""@string/reg_label"" /&gt;        &lt;TextView            android:text=""@string/test_registered""/&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView        	android:id=""@+id/info_label""        	android:gravity=""right""        	android:paddingRight=""5px""            android:text=""@string/info_label"" /&gt;        &lt;TextView            android:text=""@string/test_info""/&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>I gather information about certain events from a webpage, and then I want to display all events in a list using the above layout for each event. My current approach is to have a LinearLayout as parent and then adding each event as a row. </p><p>Problem number one is to add the layout to each event (the number of events is varying). I.e., I want to dynamically inflate this layout for each event. I also don't want the text to be hard coded into the layout (as above) but added at runtime. I don't know how to do this. I have tried something like the following without any success.</p><pre><code>LinearLayout eventView = (LinearLayout) findViewById(R.layout.event);parentView.addView(eventView);</code></pre><p>Problem number two is then to add these layouts to the parent view group and display it on the screen. When I try to do this using parent.addView(child), the program crashes at runtime and I can't figure out why.</p><p>It's kind of hard to describe the specific problem, since I'm new to GUI-programming on Android and I'm sort of programming by trial and error right now. Anyway, if you are able to help me with some of the problems it would be greatly appreciated.</p><p>Linus</p><p>EDIT:</p><p>Thanks commonsware, now the views inflate properly. The problem now is adding text dynamically to the TextViews. I try this:</p><pre><code>TextView dest = (TextView) findViewById(R.id.destination);dest.setText(""myText"");</code></pre><p>only to discover that dest is null. Any ideas why and how to fix this?</p><p>EDIT 2:</p><p>I have narrowed the problem even more, but I really don't understand its nature. This is the trouble-method:</p><pre><code>private void formatEvents(ArrayList&lt;Event&gt; events, LinearLayout parentView) {    Log.d(TAG, ""formatEvents, size: "" + events.size());    for (Event event : events) {    	LinearLayout eventView = new LinearLayout(this);    	eventView = (LinearLayout) getLayoutInflater().inflate(R.layout.event, null);    	parentView.addView(eventView);    	TextView dest = (TextView) findViewById(R.id.destination);    	TextView date = (TextView) findViewById(R.id.date);    	TextView registered = (TextView) findViewById(R.id.registered);    	TextView info = (TextView) findViewById(R.id.info);    	if (dest == null)    		Log.d(TAG, ""null"");    	else {    		Log.d(TAG, ""not null"");    		dest.setText(event.getDestination());    		date.setText(event.getDate());    		registered.setText(event.getDriver() + "" "" + event.getPassengers());    		info.setText(event.getInfo());    	}    }		}</code></pre><p>I get null for the first iteration, but not for the second one. When I change</p><pre><code>parentView.addView(eventView);</code></pre><p>to</p><pre><code>parentView.addView(eventView, 0);</code></pre><p>it somehow works (even though the events are displayed in reverse order). Anyone knows what's going on here?</p>","91098","","91098","","2009-09-12 19:58:33","2013-01-17 06:48:37","Problems with displaying XML-based layout and adding text dynamically","<xml><android><layout>","2","0","1","",""
"1415483","1","","","2009-09-12 16:20:10","7","10308","<p>Is there anyway to write android applications in PHP? </p><p>This page clearly mentions that Android apps should be written in Java. Just wondering if there is another way...</p><p><a href=""http://developer.android.com/guide/topics/fundamentals.html"">http://developer.android.com/guide/topics/fundamentals.html</a></p>","32242","","","","","2013-06-18 13:08:37","Is there anyway to write android applications in PHP?","<php><android>","6","1","3","",""
"1417062","1","1417082","","2009-09-13 07:06:50","2","145","<p>Is there any virtual machine to test Android? How can I debug the program for Android?</p>","170795","","","","","2009-09-13 07:18:25","VM and Debugger for Android","<android><debugging><virtual-machine>","1","0","","",""
"1417503","1","2388517","","2009-09-13 11:18:47","3","7705","<p>I'm trying to draw Arabic text onto a Bitmap for display:</p><pre><code>Bitmap img = Bitmap.createBitmap( (int) f+100, 300, Config.RGB_565);Canvas c = new Canvas();c.setBitmap(  img );mFace = Typeface.createFromAsset(getAssets(),""DejaVuSansCondensed.ttf"");mPaint.setTypeface(mFace);content = ""????"";content = ArabicUtilities.reshape( content );System.out.println(""Drawing text: "" + content);c.drawText(content, 30, 30, mPaint);</code></pre><p>The ArabicUtilities class is a tool to reshape the unicode text so the letters are connected. see: <a href=""http://github.com/agawish/Better-Arabic-Reshaper/"" rel=""nofollow"">http://github.com/agawish/Better-Arabic-Reshaper/</a></p><p>However, the bitmap that is generated looks like this:</p><p><img src=""http://imagebin.ca/img/J1EB8DWc.jpg"" alt=""alt text"" /></p><p>When it should look like <strong>????</strong></p><p>I believe the issue is because, unlike a <a href=""http://developer.android.com/reference/android/widget/TextView.html"" rel=""nofollow"">TextView</a>, the Bitmap class is not BiDi aware, so it draws the letters from left to write.</p><p>Try as I might, I can't figure out how to draw the text in the correct order.</p>","107609","","569101","","2013-06-05 11:26:57","2013-06-05 11:26:57","How to draw RTL text (Arabic) onto a Bitmap and have it ordered properly?","<android><right-to-left><bidi>","1","1","2","",""
"1417561","1","1417597","","2009-09-13 11:46:21","1","181","<p>i would like to buy a new cell phone that runs Android. From what I heard I assume it's quiet programable and customizable. What are your Experiences?</p><p>Are there any good books on the topic?</p>","37758","","1777090","","2013-01-17 06:47:01","2013-01-17 06:47:01","Experiences with Android?","<android><cellphone>","4","2","1","2012-07-24 15:23:31",""
"1418830","1","1418993","","2009-09-13 21:05:13","4","2303","<p>I have notices following: </p><ol><li>if I have a project with minimum files in res folder, the project saves quickly, compiles quickly and launches quickly.</li><li>But if I have a lot of resources, my project is saving, compiling and launching during relatively long period of time. This is really frustrating if you do some minor UI updates, and you have always wait Eclipse to generate R file etc.</li></ol><p>Is there any recipe how to fix this?</p>","139394","","1777090","","2013-01-17 06:47:51","2013-01-17 06:47:51","Android. How to improve Eclipse Performance for projects with lots of resources?","<android><performance>","1","0","1","",""
"1420788","1","","","2009-09-14 10:39:00","1","4690","<pre><code>package com.example.helloandroid;import java.io.IOException;import java.io.InputStream;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;import org.apache.http.HttpResponse;import org.apache.http.HttpStatus;import org.apache.http.client.*;import org.apache.http.client.methods.*;import org.apache.http.impl.client.DefaultHttpClient;//import org.apache.http.util.EntityUtils;public class HelloAndroid extends Activity {    /** Called when the activity is first created. */        @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        try        {            HttpClient hc = new DefaultHttpClient();            HttpGet get = new HttpGet(""http://www.yahoo.com"");            HttpResponse rp = hc.execute(get);            if(rp.getStatusLine().getStatusCode() == HttpStatus.SC_OK)            {                //String str = EntityUtils.toString(rp.getEntity());                InputStream is = rp.getEntity().getContent();                           String str = is.toString();                TextView tv = new TextView(this);                tv.setText(str);                setContentView(tv);            }            else            {                System.out.println(""halo,baby."");            }        }catch(IOException e){            return;        }    }}</code></pre><p>the above is my code.<br>but it seems there are some problems here.<br>So, Anyone can give me some ideas on it?<br>Thank you.  </p><p>Carmen Lau</p>","","Carmen Lau","5441","","2010-02-03 18:08:46","2012-05-30 03:16:38","Request helping for writing HTTP Request in Android","<android>","3","2","2","",""
"1421326","1","1636866","","2009-09-14 12:43:36","8","11180","<p>Two question on Bluetooth development on Android:</p><ol><li><p>Is there a way to enable Bluetooth to be always on (I might have a long device discovery phase in my application) in Android? As far as I can see the default value is a count down from 120s. </p></li><li><p>Does it exist any open source Bluetooth API implementations?</p></li></ol>","11672","","265167","","2011-12-17 13:34:00","2012-05-26 17:45:33","Android - How to enable Bluetooth to be always on?","<android><bluetooth>","6","0","4","",""
"1421853","1","","","2009-09-14 14:18:50","0","1660","<p>I am trying to install XMPP client on Android through adb install command but it gives INSTALL_PARSE_FAILED_NO_CERTIFICATES error, if anybody know about this error please help me</p><p>Please tell how test XMPP client on Android emulator.</p>","168924","","436938","","2012-03-16 19:22:47","2012-03-16 19:22:47","INSTALL_PARSE_FAILED_NO_CERTIFICATES error on installing app","<android>","1","6","","",""
"1423075","1","1423239","","2009-09-14 18:09:59","0","2836","<p>I would like to make a custom CursorAdapter that takes a cursor and provides an extra summary row at the end.  Such that given a Cursor with 4 rows, the ListView will contain 5 rows, the 4 rows from the cursor, plus a fifth row that contains some totals from the previous 4 rows.  From the documentation I'm not clear on which methods to override to get this done.  Or maybe there's a better way to do this..</p>","105878","","","","","2009-09-14 18:42:16","Custom adapter in Android","<android>","2","0","1","",""
"1424276","1","1424686","","2009-09-14 22:49:57","26","22686","<p>I have a listView with custom objects defined by the xml-layout below. I want the textView with id ""info"" to be ellipsized on a single line, and I've tried using the attributes </p><pre><code>android:singleLine=""true""android:ellipsize=""end""</code></pre><p>without success.</p><p>If I set the layout_width to a fixed width like e.g.</p><pre><code>android:layout_width=""100px""</code></pre><p>the text is truncated fine. But for portability reasons this is not an acceptable solution.</p><p>Can you spot the problem?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:paddingBottom=""5px""&gt;&lt;TextView  android:id=""@+id/destination""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:textSize=""22dp""android:paddingLeft=""5px""/&gt;&lt;TextView  android:id=""@+id/date""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:textSize=""15dp""android:paddingLeft=""5px""/&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/info_table""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:paddingLeft=""5px""android:paddingTop=""10px"" &gt;    &lt;TableRow&gt;        &lt;TextView        	android:id=""@+id/driver_label""        	android:gravity=""right""        	android:paddingRight=""5px""        	android:text=""@string/driver_label"" /&gt;        &lt;TextView        	android:id=""@+id/driver"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView        	android:id=""@+id/passenger_label""        	android:gravity=""right""        	android:paddingRight=""5px""        	android:text=""@string/passenger_label"" /&gt;        &lt;TextView        	android:id=""@+id/passengers"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView        	android:id=""@+id/info_label""        	android:gravity=""right""        	android:paddingRight=""5px""         	android:text=""@string/info_label""/&gt;        &lt;TextView        	android:id=""@+id/info""        	android:layout_width=""fill_parent""        	android:singleLine=""true""        	android:ellipsize=""end"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p></p>","91098","","","","","2012-10-23 15:08:07","Ellipsize not working for textView inside custom listView","<xml><android><textview>","6","0","15","",""
"1425222","1","","","2009-09-15 05:11:40","0","969","<p>I saw your name on web as an android specialist and am looking for some guidance which cannot be taken from android developer lists.I am developing an application based on android.It needs to send multiple images to the server.</p><p>I can send multiple emails each having a single image attachment.Can we send multiple images in a single email attachment?i.e(as a zip file or attaching many images)</p><p>or</p><p>Is there a way to append all images to a single image and send a single email with 1 image attachment?</p><p>or</p><p>Any other way to send multiple images ??</p>","","Isuru","21234","","2009-09-15 21:46:01","2009-09-16 12:38:29","Android Imaging","<android>","2","1","","",""
"1425502","1","1426085","","2009-09-15 06:45:37","2","19113","<p>I am using the following code to display a video file in the android emulator,it works fine when the video file is stored in a SDcard.But when i give any URL of a video the code not working.</p><pre><code>import android.app.Activity;import android.media.MediaPlayer;import android.os.Bundle;import android.view.SurfaceHolder;import android.view.View;import android.widget.*;public class playerActivity extends Activity {Button b;VideoView preview;SurfaceHolder holder;MediaPlayer mp; private String path = ""/data/data/payoda.android/funny.mp4"";//private String path = ""http://www.daily3gp.com/vids/3.3gp"";public void onCreate(Bundle savedInstanceState) {	super.onCreate(savedInstanceState);	setContentView(R.layout.main);	preview=(VideoView)findViewById(R.id.surface);	holder=preview.getHolder();	b=(Button)findViewById(R.id.cmd_play);	b.setOnClickListener(new View.OnClickListener()	{	public void onClick(View v)	{		try		{		        mp=new MediaPlayer(); 	    	    mp.setDataSource(path);	    	    mp.setScreenOnWhilePlaying(true);	    	    mp.setDisplay(holder);	    	    mp.prepare();	    	    mp.start();		}		catch(Exception e)		{		}	}	});}}</code></pre><p>The Exception thorwn is:</p><pre><code>prepare failed:status=0xC8</code></pre><p>The LogCat details are:</p><pre><code>09-16 12:16:36.729: ERROR/PlayerDriver(542): Command PLAYER_INIT completed with an error or info PVMFErrContentInvalidForProgressivePlayback09-16 12:16:36.739: ERROR/MediaPlayer(2867): error (200, -27)</code></pre><p>In the above code if change the path variable the Emulator screen is black with single button.May be i have to do some more things to display the video from the Remote URL,i dont know what to do.Any one having any idea about this please help Me.</p>","131062","","131062","","2009-09-16 06:51:33","2012-01-07 21:59:42","How to display Video in the Android Emulator from Remote URL?","<android>","3","0","6","",""
"1426244","1","1430320","","2009-09-15 09:58:26","29","37193","<p>i want to use external fonts in my app. i have tried adding new fonts using asset managers but it did not work. </p><pre><code>Typeface face;face = Typeface.createFromAsset(getAssets(), ""font.otf"");textview.setTypeface(face);</code></pre><p>but it did not show the text...</p><p>plz help..</p>","152867","","159769","","2012-08-01 08:10:22","2013-11-12 14:07:04","Use external fonts in android","<android><fonts><android-widget>","5","0","16","",""
"1427136","1","","","2009-09-15 13:18:51","4","13275","<p>Suppose there are three activity,the display order is a->b->c.Now, I would like to resume the Activity a directly,after <code>Activity</code> c complete some operations.Resume the <code>Activity</code> a by <code>Activity</code> c directly,but create a new instance of Activity a.</p>","158911","","844882","","2012-03-22 20:19:57","2012-03-22 20:20:11","How to resume an activity?","<android>","2","2","","",""
"1428928","1","1429050","","2009-09-15 18:34:19","1","1960","<p>Just a quick question really. Say I have a 10x10 array in Java, some of the places in which are not used, and I'm needing to go through all elements as part of a method. Would it be better to:</p><ol><li><p>Go through all elements with 2 for loops and check for the nulltype to avoid errors, e.g.</p><pre><code>for(int y=0;y&lt;10;y++){    for(int x=0;x&lt;10;x++){       if(array[x][y]!=null)            //perform task here    }}</code></pre></li><li><p>Or would it be better to keep a list of all the used addresses... Say an arraylist of points?</p></li><li><p>Something different I haven't mentioned.</p></li></ol><p>I look forward to any answers :) </p>","173892","","1777090","","2013-01-17 06:46:31","2013-01-17 06:46:31","Array access optimization","<java><android><arrays><optimization>","6","6","","",""
"1429774","1","","","2009-09-15 21:40:41","3","1752","<p>is there any possibility to send mail from phone to phone's email account without any User participation?</p><p>I have found Intent for this, but User has to press button to complete operation. </p><p>Possibly there are some approaches to solve this.</p><p>Thanks.</p>","139394","","","","","2012-08-22 10:50:32","Android. How to send mail without User participation?","<android><email>","1","1","3","",""
"1429981","1","","","2009-09-15 22:37:19","5","10280","<p>I have found an issue. I have a server that uses User Agent header to identify the device that is connecting to it. But when i connect to the server using HttpURLConnection i get no User Agent header, but when i connect with the browser it sends the correct User Agent.</p><p>For testing i am using an echo server that replies with the headers it found on the request.</p><p>When i connect with browser i get:eg: User-Agent: Mozilla/5.0 (Linux; U; Android 1.5; en-fr; HTC Hero Build/CUPCAKE) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1 Up.Link/6.3.1.20.06.3.1.20.0.</p><p>But when i connect by code with UrlConnection i get:</p><p>User-Agent: UNAVAILABLE.</p><p>Does anyone know we i get different behaviors? How i can i connect in the same way the browser does?</p><p><strong>EDIT:</strong></p><p>What i really need is not only the User-Agent header, i also need some special headers (x-up-subno actually). This header is added by the APN of the operator, but for some reason when i connect by code that headers are not added to the request.</p><p>From browser:<img src=""http://bannergame.googlecode.com/files/device%5Fbrowser.png"" alt=""browser"" /></p><p>From code:<img src=""http://bannergame.googlecode.com/files/device%5Fcode.png"" alt=""code"" /></p><p>Thanks,</p>","7363","","7363","","2009-09-16 19:12:40","2013-04-19 11:08:52","HttpURLConnection in android doesn't send correct User-Agent header","<java><android><http-headers><user-agent>","2","2","","",""
"1430741","1","1430772","","2009-09-16 03:07:48","11","44341","<p>I want to make a tile based game for android.  At the moment I am drawing each tile as a separate bitmap.  I have a big for loop that reads from a string and draws different tiles depending on what character it finds to draw the level.</p><p>I have allowed the user to scroll the screen using scrolling gestures.  However the game is too slow.  It takes a long time to update the screen after the user scrolls.  I presume this is because it has to draw each tile's bitmap individually.</p><p>What would be a faster way to draw the level?  I was thinking I could merge all the tiles into one bitmap.  But I don't know how to do this.  Any ideas?</p><p>Anyway here is my code so you can see the problem:</p><pre><code>package org.example.tutorial2d;import android.app.Activity;import android.os.Bundle;import android.view.GestureDetector;import android.view.MotionEvent;import android.view.GestureDetector.OnGestureListener;import org.example.tutorial2d.Panel;public class Tutorial2D extends Activity implements OnGestureListener {GestureDetector gestureScanner;Panel main;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    gestureScanner = new GestureDetector(this);    //requestWindowFeature(Window.FEATURE_NO_TITLE);           main = new Panel(this);    setContentView(main);       }@Overridepublic boolean onTouchEvent(MotionEvent me){ return gestureScanner.onTouchEvent(me);}@Overridepublic boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY){ main.handleScroll(distanceX,distanceY); return true;}/////////////////////////////////////////////////////////@Overridepublic boolean onDown(MotionEvent e){ return true;}@Overridepublic boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY){ return true;}@Overridepublic void onLongPress(MotionEvent e){    }@Overridepublic void onShowPress(MotionEvent e) {   }    @Overridepublic boolean onSingleTapUp(MotionEvent e)    { return true;}/////////////////////////////////////////////////////////}</code></pre><p>And the class that does all the work:</p><pre><code>package org.example.tutorial2d;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.drawable.Drawable;import android.util.Log;import android.view.View;import org.example.tutorial2d.Point;public class Panel extends View {private int scrollX = 0;private int scrollY = 0;public Panel(Context context){	super(context);}@Overridepublic void onDraw(Canvas canvas){	/*Bitmap scratch;	//Drawable scratch;	//scratch = getContext().getResources().getDrawable(    //        R.drawable.icon);	canvas.drawColor(Color.BLACK);	//scratch.draw(canvas);	int origin = 0;	scratch = BitmapFactory.decodeResource(getResources(), R.drawable.horizontal5);	canvas.drawBitmap(scratch, origin, origin, null);	int width = scratch.getWidth();	int height = scratch.getHeight();	scratch = BitmapFactory.decodeResource(getResources(), R.drawable.room4entrynesw3x3);	canvas.drawBitmap(scratch, origin + width, origin - 32, null);	*/	String sucide_mission = ""                  wwwww\n"" +""                  wfffw\n"" +""                  wfffw\n"" +""                  wfffw\n"" + ""                  wwfww\n"" +""                   wfw\n"" + ""                   wfw\n"" +""                   wfw\n"" +""             wwwwwwwfwwwwwfw\n"" +""             wfffffffffffffw\n"" +""             wfwwwwwfwwwwwfw\n"" +""     wwwww   wfw   wfw   wfw\n"" +""wwwwwwfffwwwwwfwwwwwfwwwwwfw\n"" +""fffffffffffffffffffffffffffw\n"" +""wwwwwwfffwwwwwwwwwwwfwwwwwfw\n"" +""     wwfww         wfw\n"" +""      wfw          wfw\n"" +""      wfw          wfw\n"" +""      wfw          wfw\n"" +""      wfw          wfw\n"" +""     wwfww         wfw\n"" +""     wfffwwfw      fff\n"" +""     wffffffw      www\n"" +""     wfffwwfw\n"" +""     wwwww"";	canvas.drawColor(Color.BLACK);	int x = 0, y = 0;	for (int i = 0; i &lt; sucide_mission.length(); i++)	{		Bitmap tileImage;		char tile = sucide_mission.charAt(i);		Log.d(""Draw tiles"", Character.toString(tile) + "" "" + x + "","" + y);		switch (tile)		{			case 'w':				if (x &lt; tileImage = BitmapFactory.decodeResource(getResources(), R.drawable.walla);				canvas.drawBitmap(tileImage, x - scrollX, y - scrollY, null);				x += 32;				break;			case 'f':				tileImage = BitmapFactory.decodeResource(getResources(), R.drawable.floore);				canvas.drawBitmap(tileImage, x - scrollX, y - scrollY, null);				x += 32;				break;			case ' ':				x += 32;				break;			case '\n':				y += 32;				x = 0;				break;		}	}	//canvas.drawBitmap(adapt, 0, 0, paint);	//canvas.drawBitmap(corner, origin -scrollX , origin -scrollY, paint);} public void handleScroll(float distX, float distY) {      // X-Axis ////////////////////////////////      if(distX &gt; 6.0)      {           if(scrollX &lt; 460)           {                scrollX += 30;           }      }      else if(distX &lt; -6.0)      {           if(scrollX &gt;= 30)           {                scrollX -= 30;           }      }      ////////////////////////////////////////////      // Y-AXIS //////////////////////////////////      if(distY &gt; 6.0)      {           if(scrollY &lt; 100)           {                scrollY += 30;           }      }      else if(distY &lt; -6.0)      {           if(scrollY &gt;= 30)           {                scrollY -= 30;           }      }                    ////////////////////////////////////////////      if((scrollX &lt;= 480) &amp;&amp; (scrollY &lt;= 120))      {           //adapt = Bitmap.createBitmap(bmp, scrollX, scrollY, 320, 480);           invalidate();      } }}</code></pre>","","Glen","","","","2011-11-25 11:00:16","How to draw lots of bitmaps on screen in an Android game without slow performance","<android><tile>","5","1","6","",""
"1430843","1","1431384","","2009-09-16 03:48:10","4","10996","<p>Hi I have a problem creating a custom view for an Android application. My custom view wants to  use if permitted the maximum screen width. I couldn't find any way to retrieve this value.</p><p>Can anybody point me to the right method?</p>","124459","","","","","2013-12-18 11:19:33","How do I get a device's maximal width and height in android","<android><view>","4","0","1","",""
"1431042","1","","","2009-09-16 05:07:54","1","10688","<p>In my MediaPlayer application for streaming Video i am using the following code</p><pre><code>File temp = File.createTempFile(""mediaplayertmp"", ""dat"");</code></pre><p>while running it throws exceptions like</p><pre><code>Parent directory of file in not writable:/sdcard/mediaplayertmp43912.dat</code></pre><p>I dont how to handle this problem,and i want to know that when we execute that code means where the file will be created.any one knows the solution means please help with some code.</p>","131062","","","","","2010-08-25 20:45:23","Problem in creating Temporary File in android?","<android>","4","1","2","",""
"1431217","1","","","2009-09-16 06:11:32","1","1329","<p>In android, How can I query the name of the MMS sender and text of the MMS from MMS database?For SMS, there are these 2 columns for that: Sms.PERSON_ID and Sms.Body.</p><p>But what is the equivalent columns in MMS Table?</p>","128983","","1777090","","2013-01-17 06:46:08","2013-01-17 06:46:08","How to query MMS sender and text from MMS database","<android>","1","0","2","",""
"1431722","1","1434324","","2009-09-16 08:37:44","4","3720","<p>[Android Newbie alert]</p><p>I need to capture the contents of a WebView in a BitMap and I've run into a strange problem. My approach is to register a WebViewClient with the WebView, and in <em>onPageFinished</em> I call <em>capturePicture</em>. With a simple URL (e.g. <a href=""http://www.yahoo.com"" rel=""nofollow"">http://www.yahoo.com</a>), it works fine. In other cases, capturePicture returns a Picture with height and width values = 0. The page loads fine, either way. The actual url I have to use has quite a few url parameters and I initially thought having any parameters was the problem, but that's not the case. Here's a few sample urls with comments indicating whether it works or not:</p><ol><li>w.loadUrl(""http://www.yahoo.com""); //yes</li><li>w.loadUrl(""http://search.yahoo.com/search?p=android""); // usually not???</li><li>w.loadUrl(""http://www.yahoo.com?foo=bar""); // nope</li><li>w.loadUrl(""http://www.google.com""); // yep</li><li>w.loadUrl(""http://www.google.com?q=android""); // yep</li><li>w.loadUrl(""http://www.google.com?foo=bar""); // yes</li></ol><p>The second case is particularly frustrating as it appears to not work. However, if I run the test app with #5 first, then switching the url to #2 and running it then works.</p><p>Here's a snippet of an actual simplified test I created:</p><blockquote><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);</code></pre></blockquote><pre><code>    w = new WebView(this);    w.setWebViewClient(new WebViewClient() {        public void onPageFinished(WebView webview, String url) {            Picture picture = webview.capturePicture();            Log.d(""Height"", """" + picture.getHeight());            Log.d(""Width"", """" + picture.getWidth());            Bitmap b = Bitmap.createBitmap(picture.getWidth(), picture                    .getHeight(), Bitmap.Config.ARGB_8888);            Canvas c = new Canvas(b);            picture.draw(c);        }    });    w.getSettings().setJavaScriptEnabled(true);    setContentView(w);    //w.loadUrl(""http://www.yahoo.com""); //yes    w.loadUrl(""http://search.yahoo.com/search?p=android""); // usually not???    //w.loadUrl(""http://www.yahoo.com?foo=bar""); // nope    //w.loadUrl(""http://www.google.com""); // yep    //w.loadUrl(""http://www.google.com?q=android""); // yep    //w.loadUrl(""http://www.google.com?foo=bar""); // yes}</code></pre><p>Has anyone run into this issue? Hopefully I'm just being an idiot and there's a simple solution or workaround?</p>","","ted","1777090","","2013-01-17 06:45:19","2013-01-17 06:45:19","WebView.capturePicture failing with url parameters","<android>","1","0","3","",""
"1432675","1","1432709","","2009-09-16 12:34:33","1","7969","<p>I'm using a Google phone running Android, and I need to figure out how to use the terminal's 'ip' command. </p><p>I found out that Android uses BusyBox in its terminal, but I can't find any help or tutorials or any information regarding it other than the basic information given in the terminal help. Can anyone point me to a site that would give me more information on how to use the commands, or tell me how to use the 'ip' command if you are familiar with it?</p><p>Thanks.</p>","118241","","1288","","2009-10-12 11:52:19","2009-10-12 11:52:19","BusyBox Help, ip Command","<android><linux><terminal>","3","2","","",""
"1433880","1","1434417","","2009-09-16 15:57:24","0","4400","<p>I’m taking the <strong><a href=""http://developer.android.com/guide/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">HelloTabWidget</a></strong> Android example and trying two things:</p><ul><li>Moving the tabs to the bottom vs. thetop (if that’s even desirable from an Android UI POV)</li><li>Making each tab show a particular<strong>WebView</strong> in the space above </li></ul><p>I’ve got this for a layout (high level):</p><pre><code>&lt;TabHost&gt;  &lt;LinearLayout&gt;    &lt;FrameLayout&gt;      &lt;WebView/&gt;      &lt;WebView/&gt;      &lt;WebView/&gt;      &lt;WebView/&gt;      &lt;WebView/&gt;    &lt;/FrameLayout&gt;    &lt;TabWidget/&gt;  &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Everything has a width/height set to <code>fill_parent</code> except for the <strong>TabWidget</strong> which has its <code>layout_height</code> set to <code>wrap_content</code> (and the <code>layout_gravity</code> set to <code>bottom</code>).</p><p>First thing I noticed is that <strong>WebView</strong>s don’t show anything until all the parents have width/height set to <code>fill_parent</code>. However, once I do that, they fill the entire display, obscuring the <strong>TabWidget</strong>.</p><p>Is there some other trick to making these two views play nicely together?</p>","126660","","126660","","2009-09-16 17:05:22","2012-04-02 14:42:42","Getting Android SDK WebView and TabWidget to play nice","<android><layout><webview><android-widget>","1","0","1","",""
"1436449","1","","","2009-09-17 02:34:29","2","927","<p>For several years, I've been facing problems with HTTP 1.1 pipelining &amp; continued to ask the server to send the HTTP Header:</p><pre><code>Connection: close</code></pre><p>I want to revisit this decision. Does your native mobile apps use HTTP pipelining ?Some problems with HTTP pipelining I've faced:</p><ul><li>Server not releasing TCP connections</li><li>My client is receiving multiple replies from one HTTP connection</li></ul>","27328","","","","","2012-01-26 10:45:28","Is HTTP 1.1 pipelining discouraged in native mobile apps?","<iphone><android><http><java-me><mobile>","4","0","3","",""
"1437070","1","1437116","","2009-09-17 06:40:31","2","1201","<p>I am using the JSpeex API to convert a .wav file into .spx file. Everything goes perfect when tested on desktop; it took only 2 seconds.</p><p>Android developer used the same code but it took around 3 minutes to encode the same file on their simulator &amp; phone. Is there any way to reduce this time for encoding? Code used to convert is as follows:</p><pre><code>new JSpeexEnc().encode(new File(""source.wav""), new File(""dest.spx""));</code></pre>","","Rohit Desai","496830","","2011-03-15 22:46:38","2011-03-15 22:46:38","WAV to Speex conversion taking a lot of time","<java><android><jspeex>","1","1","","",""
"1437237","1","1437446","","2009-09-17 07:27:54","2","2183","<p>I'm currently trying out the google's various android examples at <a href=""http://developer.android.com/guide/tutorials/views/hello-spinner.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/views/hello-spinner.html</a></p><p>BUT I can't seem to get this part to work even though the code is exactly the same as the one provided in the website.</p><p>Spinner s = (Spinner) findViewById(R.id.spinner);</p><p>Eclipse keeps saying ""Cannot cast from View to Spinner""</p><p>Anyone of you guys kno how to resolve this?</p><p>Thanks.</p><p>EDIT: Thanks guys! I made a noob mistake, my class was also called Spinner hence my Spinner declaration was actually declaring my class instead of the spinner widget, silly me, thanks again!</p>","159856","","159856","","2009-09-17 23:01:10","2014-02-05 17:26:33","Casting spinners in android","<android><spinner>","3","1","0","",""
"1437477","1","1437549","","2009-09-17 08:30:48","1","5527","<p>I am writing an android game.  I need a Point class that stores x and y coordinates.  I have found a class called java.awt.Point.  Which looks like what I need.  I have created an interface for java.awt.Point and put import java.awt.Point in my code.  But when I do Point pos = new Point.  I get an error: cannot instantiate Point.  Also if I do pos. I don't get x or y member variables.  I could code my own Point class but I need to learn how to import stuff.</p><p>If I delete the interface for Point I get an error on import java.awt.Point.  It says the import cannot be resolved.</p>","","Glen","","Glen","2009-09-17 08:40:36","2011-03-03 23:42:28","How do I import a java Point class in android?","<java><android><point>","4","1","","",""
"1437497","1","1447427","","2009-09-17 08:35:49","4","2173","<p>I've had this problem in a few different apps now and I can't seem to find a solution.</p><p>If, in the onCreate() of an <code>Activity</code>, I start an activity that uses the dialog theme it doesn't draw anything to screen... the whole screen stays black. All the views are there (e.g., I can tap where an <code>EditText</code> should be and it'll give me the keyboard), they're just not visible.</p><p>Anyone have any ideas?</p><p>Stupid simple example, for fun:</p><pre><code>public class MainActivity extends Activity {	@Override	public void onCreate(Bundle savedInstanceState) {		super.onCreate(savedInstanceState);				setContentView(R.layout.main);		startActivityForResult(new Intent(this, CredentialsInputActivity.class), 1);	}	@Override	protected void onActivityResult(int requestCode, int resultCode, Intent data) {		super.onActivityResult(requestCode, resultCode, data);		// do some crap with the result, doesn't really matter what	}}</code></pre><p><code>CredentialsInputActivity</code> is pretty straight forward... just extends <code>Activity</code> and has the theme set to <code>@android:style/Theme.Dialog</code> in the manifest file.</p>","76835","","","","","2009-09-19 02:39:09","Solid black screens when calling Dialogs in onCreate()","<android><dialog>","2","0","2","",""
"1437888","1","1438720","","2009-09-17 10:14:39","22","20883","<p>is there any possibility to make audio recording with higher quality?</p><p>And how can I read information that User is saying something? In Audio Recording application you can see such indicator (I don't know the right name for it).</p><p>Thanks.</p>","139394","","59087","","2009-10-23 18:24:46","2009-10-23 18:27:55","Improve Android Audio Recording quality?","<android><audio-recording>","2","0","21","",""
"1439632","1","","","2009-09-17 15:35:06","1","4980","<p>How  to   open    .png   or  .doc file  in android  in  new Activity.</p>","","raj","","","","2009-09-18 04:56:21","How to open .png or .doc file in android","<android>","1","3","","",""
"1440957","1","1441491","","2009-09-17 19:48:02","22","24777","<p>I seem to be running into a peculiar problem on Android 1.5 when a library I'm using (signpost 1.1-SNAPSHOT), makes two consecutive connections to a remote server.  The second connection always fails with a <code>HttpURLConnection.getResponseCode()</code> of <code>-1</code></p><p>Here's a testcase that exposes the problem:</p><pre><code>// BROKENpublic void testDefaultOAuthConsumerAndroidBug() throws Exception {    for (int i = 0; i &lt; 2; ++i) {        final HttpURLConnection c = (HttpURLConnection) new URL(""https://api.tripit.com/oauth/request_token"").openConnection();        final DefaultOAuthConsumer consumer = new DefaultOAuthConsumer(api_key, api_secret, SignatureMethod.HMAC_SHA1);        consumer.sign(c);                             // This line...        final InputStream is = c.getInputStream();        while( is.read() &gt;= 0 ) ;                     // ... in combination with this line causes responseCode -1 for i==1 when using api.tripit.com but not mail.google.com        assertTrue(c.getResponseCode() &gt; 0);    }}</code></pre><p>Basically, if I sign the request and then consume the entire input stream, the next request will fail with a resultcode of -1.  The failure doesn't seem to happen if I just read one character from the input stream.</p><p>Note that this doesn't happen for any url -- just specific urls such as the one above.</p><p>Also, if I switch to using HttpClient instead of HttpURLConnection, everything works fine:</p><pre><code>// WORKSpublic void testCommonsHttpOAuthConsumerAndroidBug() throws Exception {    for (int i = 0; i &lt; 2; ++i) {        final HttpGet c = new HttpGet(""https://api.tripit.com/oauth/request_token"");        final CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(api_key, api_secret, SignatureMethod.HMAC_SHA1);        consumer.sign(c);        final HttpResponse response = new DefaultHttpClient().execute(c);        final InputStream is = response.getEntity().getContent();        while( is.read() &gt;= 0 ) ;        assertTrue( response.getStatusLine().getStatusCode() == 200);    }}</code></pre><p>I've found <a href=""http://groups.google.com/group/android-developers/browse%5Fthread/thread/bc5454ffc71f77dc"">references</a> to what seems to be a similar problem elsewhere, but so far no solutions.  If they're truly the same problem, then the problem probably isn't with signpost since the other references make no reference to it.</p><p>Any ideas?</p>","82156","","","","","2013-06-03 19:37:56","HttpURLConnection.getResponseCode() returns -1 on second invocation","<java><android><oauth><httpurlconnection><signpost>","4","0","14","",""
"1441871","1","1441919","","2009-09-17 23:33:23","15","15479","<p>Suppose you want to start a new activity and pass it some data from the current activity. If the data is of a primitive type you could simply use an intent and add extras, but how would you do this for more complex data structures like arraylists or objects?</p>","91098","","","","","2012-04-07 11:52:55","Passing data of a non-primitive type between activities in android","<android><data-structures><activity>","3","0","24","",""
"1441969","1","1446698","","2009-09-18 00:06:34","1","409","<p>I'm going to develop a mobile version of my webapp. Most documentation I've read suggests one of the following approaches:</p><ol><li>create a separate domain (m.example.com)</li><li>using conditional css style sheets, but serve the same html</li></ol><p>I'd like to take a completely different approach. I'm using MVC, and would decide which template to render on the server side. My model and controller will be the same, the domain will be the same, but the html will be served differently for mobile users.</p><p>Has anyone tried this? Any pitfalls to this approach?</p>","32899","","32899","","2009-09-18 00:22:03","2009-09-18 20:32:18","iphone webapp, server side view template selection","<iphone><android><web-applications><iphone-web>","1","0","","",""
"1443166","1","1443358","","2009-09-18 08:10:00","18","22817","<p>I am developing an application which connects to the server. By now the login and data transmission works fine if theserver is available. The problem arises when the server is unavailable. In this case the method sends a login request and waits for the response.</p><p>Does anyone know how to check if the server is available (visible)?</p><p>The pseudocode of the simple logic that has to be implemented is the following:</p><ol><li>String serverAddress = (Read value from configuration file) //already done </li><li>boolean serverAvailable = (Check if the server serverAddress is available)//has to be implemented</li><li>(Here comes the logic which depends on serverAvailable)</li></ol>","22996","","12388","","2010-03-11 14:03:01","2013-06-05 23:39:59","Android: How to check if the server is available?","<android><networking><connectivity>","5","1","6","",""
"1443690","1","1443719","","2009-09-18 10:24:37","13","25770","<p>I want to run C# programs on my HTC Magic, I can find the mono app on the Android market but I have no clue on how to run C# using.</p><p>The code is just for fun, I don't want official support and such. After coding Visual Basic on windows mobile, I really want to code C# on Android, whether directly using some sort of editor if exists, or compiling it on a PC then installing it on Android.</p><p>If anyone knows a way to do such please let me know.</p><p>Thank you</p>","66681","","1952862","","2013-02-01 22:44:46","2013-03-13 19:09:14","Is there a way to develop C#/.NET on Android devices?","<c#><android><.net><mono>","4","1","10","",""
"1443748","1","","","2009-09-18 10:11:48","1","13185","<p>I want to run C# programs on my HTC Magic, I can find the mono app on the Android market but I have no clue on how to run C# using.</p><p>The code is just for fun, I don't want official support and such. After coding Visual Basic on windows mobile, I really want to code C# on Android, whether directly using some sort of editor if exists, or compiling it on a PC then installing it on Android.</p><p>If anyone knows a way to do such please let me know.</p><p>Thank you</p>","66681","","","","","2010-12-12 01:32:58","Is there a way to develop C#/.NET on Android devices?","<c#><android><mono><htc>","2","4","1","",""
"1446373","1","","","2009-09-18 19:12:51","24","29982","<p>I have a <code>ListActivity</code> that implements <code>onListItemClick()</code> and calls a <code>doSomething()</code> function of the class. The latter contains <code>l.setSelection(position)</code> where <code>l</code> is the <code>ListView</code> object.</p><p>Now there is a <code>onClickListener()</code> listening for a button click that perfoms some actions and that too calls <code>doSomething()</code>.</p><p>In the first case, the selected item get positioned appropriately, but in the latter, nothing happens.</p><p>Any clues about this strange behaviour and how I might make it work?</p>","95656","","","","","2014-03-19 20:44:40","Android ListView setSelection() does not seem to work","<android><listview>","9","0","6","",""
"1446488","1","1446508","","2009-09-18 19:43:34","1","13137","<p>I want to port Android on the device with ARM9 200Mhz and no-fpu support, Is this possible, Has google revealed all code of android or it is just available to partners? </p><pre>if ANDROID_PORT_POSSIBLE{      Is there any tutorial available for porting? }</pre><p>Thanks and Regards,</p><p>Sunny.</p>","148869","","49246","","2011-08-11 15:57:11","2011-08-11 15:57:11","How to port android to device on ARM9 processor?","<android><linux><arm><arm9>","3","0","4","",""
"1446710","1","","","2009-09-18 20:34:23","0","1006","<p>It appears that, in the transition between the Android 1.1 sdk and 1.5, Google radically changed how ant scripts using AAPT can build Android projects.  Previously they support args allowing developers to specify source, res, asset, and a manifest for a particular build.<br />Now, they seem to allow developers to specify only a single folder containing everything.  While I could rewrite all our build scripts to work in this new way, I rather like our current system (as it doesn't require more hours of work that I don't have).  To that end, has anyone figured out how to go back to the pre 1.5 method of ant script building? Further, has anyone found a rational reason for this change?</p>","62516","","62516","","2009-09-18 23:16:52","2010-03-31 01:25:50","Android ant script workaround?","<android><ant><build-process>","2","0","","",""
"1447084","1","1447095","","2009-09-18 22:25:44","0","684","<p>I have a couple of images on available to my program. They are parts of jigsaw puzzle (with rectangular pieces though). I wanted the look and feel similar to that of google maps in android. </p><p>One way I could implement was to create a set of ImageViews and keep recycling them, as the user pans the image in any direction. However, to me that appears like a brute force method. Is there any alternative approach to implement such kind of application?</p><p>Or rather how is google maps implemented? A set of Imageviews ?</p>","352341","","1777090","","2013-01-17 06:38:22","2013-01-17 06:38:22","How do I implement an application similar to google maps on android?","<android><maps>","2","0","","",""
"1447219","1","","","2009-09-18 23:30:05","0","1059","<p>Is there any api on android which generates a Thumbnail image from an inputstream which is a video file?</p><p>Thank you.</p>","128983","","","","","2011-05-27 02:09:47","Is there any api which generates a Thumbnail image from an inputstream which is a video file","<android>","1","0","1","",""
"1447553","1","","","2009-09-19 02:34:51","2","3532","<pre><code>Intent intent = new Intent(Intent.ACTION_VIEW, Hardware.Preferences.CONTENT_URI); startActivity(intent);</code></pre><p>when i give the above code to enable sensors....they are showing errors....@ Hardware.Preferences.CONTENT_URI);...saying create a class Hardware...plz help...i'm a beginner in android...</p>","","user175829","3043","","2009-12-01 15:04:59","2013-12-25 17:06:46","How to enable sensor simulator in android?","<android><sensor>","2","0","1","",""
"1448630","1","","","2009-09-19 14:19:34","16","10445","<p>What are my options for playing simultaneous audio on an Android device with the least amount of latency?  Am I going to get anything half decent out of the canned SDK, or is that asking too much?  The documentation claims that the SoundPool class is capable of playing multiple sounds simultaneously with relatively good performance, but after running some tests in the emulator and on a physical device it seems pretty weak.  Is there maybe a trick to it, or do I have to go to a much lower level api for this kind of thing?  I've tried using a single sound pool with multiple samples loaded, and I've tried multiple sound pools each managing a single sample.  I'm preloading everything, so that when I attempt to play back I have no additional code being executed other than the call to SoundPool.play().</p>","53501","","","","","2012-09-24 00:21:20","Low latency audio api for Android?","<java><android><audio><mobile>","4","0","13","",""
"1450019","1","1450579","","2009-09-20 01:25:15","8","13966","<p>I have 3 different Activities that user navigates between in no particular order. My goal it twofold:</p><ol><li>When user switches to something else when app is resumed I want to start where user left even if app was terminated</li><li>When last activity is resumed I want to restore it to the last viewed state (this one I think I have a pretty good idea on how to achive)</li></ol><p>I think the problem is not start/stop - where I pretty much get what I need, but onCreate() if app was terminated. In that case - it picks Activity that I configured in the manifest. I suppose I can put something in onCreate method of that default activity but is there a better way that I'm maybe missing?</p>","135946","","","","","2009-09-21 15:20:41","Android - restore last viewed Activity","<android><activity><resume>","3","0","5","",""
"1451350","1","","","2009-09-20 16:01:21","2","2157","<p>I'm writing program for Android (SDK 1.5). I would like to know how to add/register one of my program activities in ""Home Screen -> Menu -> Add-> Shortcuts"" (or on Hero ""Home Screen -> Menu -> Add to Home-> Shortcut"") so that user will be able to add it to his home screen. Is there an Intent Filter or any other way to achieve that?</p><p>Thanks</p>","","gogoad","","gogoad","2009-09-20 16:38:31","2012-05-30 13:00:17","How to add entry (pointing to Activity) to ""Home Screen -> Menu -> Add-> Shortcuts""?","<android>","2","0","1","",""
"1453291","1","","","2009-09-21 07:46:06","13","9062","<p>In the ApiDemos, there is a view example called Gallery1 which declares a custom style in attrs.xml, as such:</p><pre><code>&lt;declare-styleable name=""Gallery1""&gt;    &lt;attr name=""android:galleryItemBackground"" /&gt;&lt;/declare-styleable&gt;</code></pre><p>now, I want to do the same thing for my widgets, but using a different namespace. However, as soon as I replace the android: namespace with something else, I get this error:</p><blockquote>  <p>ERROR: In  Gallery1, unable to find attribute myns:galleryItemBackground</p></blockquote><p>Unable to find attribute? Why does it look for an attribute I am about to declare? Isn't the point of this file to be able to name your own custom attributes?</p><p>It's interesting to note that it works if you do not supply a custom namespace, but just an attribute name.</p>","127013","","","","","2014-04-18 05:47:50","Android custom widget styles: how to put them into a namespace?","<android><widget>","4","0","3","",""
"1454425","1","1454525","","2009-09-21 13:06:29","1","1318","<p>Is it possible to reference the javax.script.ScriptEngine library when developing an android application?If not is there anyway possible to evaluate a javascript expression in android?</p>","61525","","","","","2013-12-20 23:54:23","Reference javax.script.ScriptEngine in android or evaluate a javascript expression","<javascript><android><scriptengine>","2","0","1","",""
"1454848","1","1535613","","2009-09-21 14:37:14","4","17130","<p>I am working on a android project that uses tesseract OCR engines..Ihave been searching on internet from past few days about any support fortesseract for android platform..But I didnt get any help...Please help meabout how I do use tesseract for android platform...or how do Iinstall it on android..</p><p>any kind of help is highly appriciated...please helpthanks in advance </p>","152867","","76465","","2009-09-21 14:52:10","2012-06-23 13:26:43","Using tesseract on android","<android><tesseract>","2","2","6","2012-07-12 12:21:38",""
"1454891","1","1458422","","2009-09-21 14:45:46","2","1416","<p>I have got another mysterious issue. So, I am setting a background image for LinearLayout. This image contains gradient. Don't know why, but after I launch application the image appears to consist of several parts that actually form ""smooth transition"" of gradient, and that's why it seems that background image is not a gradient.</p><p>Could you please advice how to fix this issue?</p>","139394","","1777090","","2013-01-21 06:57:03","2013-01-21 06:57:03","Android. Gradient Image is displayed incorrectly","<android><user-interface>","1","2","","",""
"1456236","1","","","2009-09-21 19:01:28","1","676","<p>I have downloaded the Android source code and can see the java source files for the built-in applications (e.g. com.android.contacts.ContactsListActivity).  I am trying to discover how these applications re-use one another via Intents etc.  I would also like to see how the UI layouts are assembled for these applications as a design for my own apps.</p>","121678","","","","","2009-09-21 20:05:30","Step/Debug Android built-in applications","<java><android>","1","0","1","",""
"1456624","1","1482412","","2009-09-21 20:21:06","4","2285","<p>I'm using OpenGL ES to display some objects exported from Blender.  Blender provides a list of vertices, a list of the face indices and a list of the 2d texture co-ordinates.  Within Blender, and I believe generally in OpenGL, the texture co-ordinates map to each vertex described in the index array.</p><p>I suppose I have two questions:  </p><ol><li><p>I'm <a href=""http://www.rbgrn.net/content/313-light-racer-3d-days-1-2-learning-opengl-es"" rel=""nofollow"">given to understand</a>(see the ""Applying Textures"" section) that in OpenGL ES the texture co-ordinates map to the vertex buffer only, not the index buffer.  Is this the case or is there a way of binding the texture co-ords to the index buffer instead?</p></li><li><p>If the above is true, is there anything to be gained from using an index buffer at all?  After all to properly map the textures one will need to write out the vertex buffer with all the redundancy that would have been saved with the index buffer.  Is there still a performance increase to be gained or are index buffers redundant for textured data?</p></li></ol>","5303","","","","","2009-09-26 23:40:37","Is there any point in using an index buffer with a texture in OpenGL ES (Android)?","<java><android><3d><opengl-es><textures>","1","2","2","",""
"1457803","1","1458341","","2009-09-22 02:04:29","7","6700","<p>Given</p><p>Android.xml:</p><pre><code>&lt;activity android:name='.IconListActivity'  android:label='@string/icon_list_activity_name'/&gt;</code></pre><p>Strings.xml:</p><pre><code>&lt;string name='icon_list_activity_name&gt;Icon List&lt;/string&gt;</code></pre><p>How do I access to the string <em>'Icon List'</em> given <em>IconListActivity.class</em>?</p>","7399","","161457","","2009-09-22 03:24:53","2013-03-08 14:00:06","How do I access android:label for an Activity","<android>","3","2","1","",""
"1458047","1","","","2009-09-22 04:02:01","8","28092","<p>I am trying to make an android game.</p><p>I have a game class that extends activity and handles all the user input.  Then I have a missionView class that extends view and it draws the level on the screen.</p><p>When the user clicks on a door I want to add some animation.</p><p>What happens is:  The game calls door.open.  Changes the state so the view.onDraw function will draw the door half open.  The game calls view.invalidate, which should redraw the screen.  Then the game sleeps for half a second.  Then it calls door.open again.  The second time the function is called it changes the state so the view.onDraw function draws the door completely open.  Then the game calls view.invalidate again.</p><p>The problem is that it does not redraw the screen when it gets to view.invalidate.  If I set a break point on the line and run the debugger and click step into it does not step into my view.onDraw function.  It can't even show me the code it is executing.</p><p>What I have is:Door class:</p><pre><code>public boolean open(){   if (doorState == DoorState.Closed)   {       doorState = DoorState.Opening;       return true;   }   else if (doorState == DoorState.Opening)   {        doorState = doorState.Open;        return true;   }   else   {      return false;   }}</code></pre><p>Game class:</p><pre><code>if (tile instanceof DoorTile){    DoorTile doorTile = (DoorTile) tile;    Door door = doorTile.getDoor();    if (door.isClosed())    {        door.open();        selectedEntity.openDoor();        view.invalidate();    // This line does not work        try         {            Thread.sleep(500);        }         catch (InterruptedException e1)         {             // TODO Auto-generated catch block             e1.printStackTrace();        }        door.open();        // Handled touch event so break switch statement        break;     }}</code></pre>","","Glen","","Glen","2009-09-22 04:07:24","2011-05-10 13:34:03","Why isn't view.invalidate immediately redrawing the screen in my android game","<android>","2","2","4","",""
"1458188","1","1458333","","2009-09-22 05:09:24","0","1268","<p>I am studying RemoteService example in Android's APISample.  In themanifest file, it declares the service like this:My question is how can I specify the service to be 'auto-start', i.e.it gets start whenever the phone start?</p><pre><code>    &lt;service android:name="".app.RemoteService"" android:process="":remote"" &gt;           &lt;intent-filter&gt;               &lt;!-- These are the interfaces supported by the service, which                    you can bind to. --&gt;               &lt;actionandroid:name=""com.example.android.apis.app.IRemoteService"" /&gt;               &lt;actionandroid:name=""com.example.android.apis.app.ISecondary"" /&gt;               &lt;!-- This is an action code you can use to select the service                    without explicitly supplying the implementation class. --&gt;                   &lt;action android:name=""com.example.android.apis.app.REMOTE_SERVICE"" /&gt;           &lt;/intent-filter&gt;       &lt;/service&gt;</code></pre>","125440","","1777090","","2013-01-21 06:58:27","2013-01-21 06:58:27","About API Demo Remote Service example in android","<android>","1","0","1","",""
"1458190","1","1458237","","2009-09-22 05:10:21","1","1756","<p>I want to display a progress when the application start, then close progress when all data load completely. How can I do that?</p>","152286","","","","","2009-09-22 05:22:04","How can I display a Progress at start up application in android","<android><progress>","1","0","2","",""
"1458274","1","","","2009-09-22 05:37:25","0","102","<p>It's already implemented code &amp; I am trying run the same code which is available on this link. <a href=""http://davanum.wordpress.com/2008/12/29/updated-xmpp-client-for-android/"" rel=""nofollow"">http://davanum.wordpress.com/2008/12/29/updated-xmpp-client-for-android/</a></p><p>when I fill the parameters in dialog box like host name,port,service,username &amp; password as talk.google.com, 5222, gmail.com, mygmailid without(@gmail.com),&amp; password respt.after that when i click on OK button, after some time it displays,XMPPClient is not responding, error on emulator,  </p><p>please help me.</p>","168924","","1777090","","2013-01-17 07:01:02","2013-01-17 07:01:02","i am trying to run xmppclient app in android but it is showing ""XMPPClient is not responding "" error at run time.","<android>","1","2","","",""
"1459078","1","","","2009-09-22 09:35:37","3","2009","<p>I'm working on an android application that plays video, by using an intent:</p><pre><code>tostart = new Intent(Intent.ACTION_VIEW);tostart.setDataAndType(Uri.parse(movieurl), ""video/*"");startActivity(tostart);</code></pre><p>This works great. However, when you press the back button (on the device), the movieplayer goes back to the beginning of the movie. Only when you press back again, it goes back to my application. While the current behaviour makes some sense, I would like to know if I can change it: Is is possible to directly go back after pressing back? Thanks!PanMan.</p>","49852","","","","","2009-12-19 06:24:24","Android video intent: Control back button?","<android><android-intent><movieplayer>","1","2","","",""
"1461094","1","1461360","","2009-09-22 16:18:01","1","246","<p>Is it possible to evaluate a string expression script from within an android app? Using either ruby, javascript or perl?</p>","61525","","61525","","2009-09-22 17:08:47","2009-09-22 17:10:40","Evaluate a ruby or javascript script string from within an android program","<android><scripting>","1","0","","",""
"1461351","1","1461458","","2009-09-22 17:08:49","1","159","<p>I'm a programmer looking to play in the mobile world. The application I'd like to play with would support my musical hobbies. I suspect a mobile phone with a music player could easily be programmed to support a classical musicians practice sessions. </p><ol><li>Should be Easy: Play an A at 440 Hz (or 438,442)  for tuning.</li><li>Should be easy: Metronome with beat patterns</li><li>The fun part: I hit a simple record, play a snippet, and can play it back so I can hear the notes I missed. You can almost do this with some sound recorders - but the need to clumsily select a file, save, open a different app to play back, usually makes it unusable. The value add is found in making this extremely easy.</li></ol><p>Technically: </p><ol><li>A microphone and existing API for sound input. The ability to use an external microphone would be even better. </li><li>Access to media player APIs without the need to open external apps or do clunky things    with files.</li><li>Adequate access to playback API to create specific notes and beat patterns. </li><li>As a hobby application, this should not require expensive tooling. I can switch to a new phone to use the application. </li><li>Bonus points for something that easily ports to a netbook.</li></ol><p>I will admit I new to the world of sexy phones. I currently use an obsolete voice device with text messaging. I won't revealing my current flavor of programming because learning a new platform is just fine.  </p>","77784","","77784","","2009-09-22 17:24:53","2009-09-24 15:31:29","Which mobile platform to use creation of a musicians support application - recording and playback?","<iphone><android><media><mobile-phones><sound-api>","3","2","","",""
"1462653","1","","","2009-09-22 21:15:49","2","1988","<p>I have this method in my .aidl file:</p><pre><code>void getObjects(out List&lt;MyObject&gt; objList);</code></pre><p>But I get this error</p><p>src/com/mycompany/mypackage/ITestService.aidl:26 parameter objList (1) unknown type List objList</p><p>How to create a List of MyObject in .aidl?</p><p>Thank you.</p>","125440","","","","","2012-11-23 07:40:39","How to return a list of MyObject in android aidl file?","<android>","2","1","","",""
"1463054","1","1463205","","2009-09-22 22:50:07","3","11852","<p>The code snippet below displays a Dialog with a simple login-form. The problem is that when the user hits the login-button, the text that was entered into the EditTexts are not returned on the getText()-call. However, if I set android:setText=""foo"" on the EditTexts in the xml-layout ""foo"" is returned on getText(). Any idea why the text entered at runtime won't stick?</p><pre><code>private void showLoginDisplay() {    loginDialog = new Dialog(GOFdroid.this);    loginDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,                                 WindowManager.LayoutParams.FLAG_BLUR_BEHIND);    loginDialog.setTitle(""Logga in"");    LayoutInflater li = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);    View dialogView = li.inflate(R.layout.login_dialog, null);    loginDialog.setContentView(dialogView);    loginDialog.show();    Button loginButton = (Button) dialogView.findViewById(R.id.login_button);    Button cancelButton = (Button) dialogView.findViewById(R.id.cancel_button);    EditText unameView = (EditText) dialogView.findViewById(R.id.uname_id);    if (unameView != null)        Log.d(TAG, ""unameView != null"");        Log.d(TAG, ""uname.getText(): "" + unameView.getText().toString());        uname = unameView.getText().toString();    EditText pwdView = (EditText) dialogView.findViewById(R.id.pwd_id);    if (pwdView != null)            pwd = pwdView.getText().toString();    Log.d(TAG, ""uname = "" + uname + "", pwd = "" + pwd);    loginButton.setOnClickListener(new OnClickListener() {        //@Override        public void onClick(View v) {            Log.d(TAG, ""Clicked &lt;logga in&gt;"");            loginDialog.dismiss();            viewEvents = new Runnable() {                //@Override                public void run() {                    getEvents(uname, pwd);                }            };            Thread thread =  new Thread(null, viewEvents, ""MagentoBackground"");            thread.start();            pDialog = ProgressDialog.show(GOFdroid.this,                        ""Uppdaterar..."", ""Hämtar registrerade körningar..."", true);        }    });}</code></pre><p>and the XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:paddingLeft=""10dip""    android:paddingRight=""10dip""&gt;&lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""@string/uname_label""/&gt;&lt;EditText    android:id=""@+id/uname_id""    android:layout_width=""220dip""    android:layout_height=""wrap_content""    android:text=""foo"" /&gt;&lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""@string/pwd_label""    android:paddingTop=""10dip""/&gt;&lt;EditText    android:id=""@+id/pwd_id""    android:layout_width=""220dip""    android:layout_height=""wrap_content""    android:text=""""    android:inputType=""textPassword"" /&gt;&lt;LinearLayout    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:paddingTop=""15dip""&gt;&lt;Button     android:id=""@+id/login_button""    android:layout_width=""100dip""    android:layout_height=""fill_parent""    android:text=""Logga in"" /&gt;&lt;Button     android:id=""@+id/cancel_button""    android:layout_width=""100dip""    android:layout_height=""fill_parent""    android:text=""Avbryt"" /&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","91098","","1777090","","2013-01-17 07:00:37","2013-01-17 07:00:37","EditText not returning content on getText()","<android><dialog>","1","0","1","",""
"1463325","1","","","2009-09-23 00:23:38","0","271","<p>I am experiencing a problem where when the android device wake up from sleep, the Activity would take forever to get redrawn(and have to terminate it most of the time).  I am not sure why, but when I comment out the code below where it retrieves an object from the database based on id stored in the bundle, the problem goes away.<br />Not sure why the db transaction is causing an issue.  any idea?<br />secondly, is it better to store the object in bundle instead of storing its id and retrieving it from db in onCreate?</p><pre> public void onCreate(Bundle bundle) {            super.onCreate(bundle);        setContentView(R.layout.track_act);     /*        final Bundle extras=getIntent().getExtras();        long actId=extras.getLong(""activity_id"");        System.err.println(""actId is ""+actId);        Data.Activity act=DBManager.getActivity(actId, this);    */}</pre>      ","157195","","","","","2009-11-09 21:00:03","android data passing and database access","<android>","1","1","","",""
"1463906","1","1493557","","2009-09-23 04:10:59","7","9758","<p>I have an activity that extends ExpandableListActivity. I use SimpleCursorTreeAdapter to fill ExpandableListView.My layout contains list view and empty view.On app start ExpandableListActivity automatically chooses the right view to display.</p><p>My steps:</p><ol><li>App starts, there is no data. (empty view on the screen) </li><li>Insert some data into db.</li><li>Call adapter.notifyDataSetChanged(); But empty view is still on the screen and there is no any item in my list view. </li></ol><p>Then I restart app:</p><ol><li>List view appears. I expand all groups and scroll to the bottom. </li><li>I click on the item in the list. New activity appears.  </li><li>Click back button. All groups are collapsed and we are at the top of the screen. Scroll position and expanded groups are not remembered. </li><li>Delete all data from db and call adapter.notifyDataSetChanged(); </li><li>Child views have disappeared, but top-level groups are still visible.</li></ol><p>Questions:</p><ol><li>What can I do to replace empty view with list view? </li><li>What can I do to do to save state of groups and scroll position of the list view?</li></ol><p>Tested on SDKs: 1.5r3, 1.6r1</p><p>Code:</p><pre><code>public class MainActivity extends ExpandableListActivity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        dbHelper = new DBOpenHelper(this);        rubricsDbAdapter = new RubricsDBAdapter(dbHelper);        rubricsDbAdapter.open();        itemsDbAdapter = new ItemsDBAdapter(dbHelper);        itemsDbAdapter.open();        rubricsCursor = rubricsDbAdapter.getAllItemsCursor();    	startManagingCursor(rubricsCursor);        // Cache the ID column index    	rubricIdColumnIndex = rubricsCursor.getColumnIndexOrThrow(RubricsDBAdapter.KEY_ID);        // Set up our adapter        mAdapter = new MyExpandableListAdapter(rubricsCursor,                this,                android.R.layout.simple_expandable_list_item_1,                android.R.layout.simple_expandable_list_item_1,                new String[] {RubricsDBAdapter.KEY_NAME},                new int[] {android.R.id.text1},                new String[] {ItemsDBAdapter.KEY_NAME},                 new int[] {android.R.id.text1});        setListAdapter(mAdapter);    }    public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {    	Intent i = new Intent(this, ItemViewActivity.class);    	i.putExtra(ItemsDBAdapter.KEY_ID, id);    	startActivity(i);    	return super.onChildClick(parent, v, groupPosition, childPosition, id);    }    private void updateMyData() {    	int i;    	int k;    	long rubricId;    	for (i = 1; i &lt;= 5; i++) {    		rubricId = rubricsDbAdapter.insert(""rubric "" + i);    		for (k = 1; k &lt;= 5; k++) {    			itemsDbAdapter.insert(""item "" + i + ""-"" + k, rubricId);    		}    	}    	mAdapter.notifyDataSetChanged();    }    private void deleteMyData() {    	rubricsDbAdapter.deleteAll();        itemsDbAdapter.deleteAll();    	mAdapter.notifyDataSetChanged();    }    public class MyExpandableListAdapter extends SimpleCursorTreeAdapter     {        public MyExpandableListAdapter(Cursor cursor, Context context, int groupLayout,                int childLayout, String[] groupFrom, int[] groupTo, String[] childrenFrom,                int[] childrenTo) {            super(context, cursor, groupLayout, groupFrom, groupTo, childLayout, childrenFrom,                    childrenTo);        }        @Override        protected Cursor getChildrenCursor(Cursor notebookCursor) {            // Given the group, we return a cursor for all the children within that group             long id = notebookCursor.getLong(rubricIdColumnIndex);            Cursor itemsCursor = itemsDbAdapter.getRubricItemsCursor(id);            startManagingCursor(itemsCursor);            return itemsCursor;        }    }}</code></pre>","117073","","","","","2011-05-20 16:11:33","How to update expandable list view when adapter's data changes","<java><android>","2","3","3","",""
"1464072","1","1464803","","2009-09-23 05:10:29","0","2275","<p>I am new for android development. I am trying read and write contacts to android addressbook.</p><p>I tried following line of code for write name into android</p><pre><code>public class SecondApp extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState); setContentView(R.layout.main); ContentValues values = new ContentValues();values.put(Contacts.People.NAME, ""Rishabh"");ContentResolver cr = getContentResolver();Uri uri = cr.insert(People.CONTENT_URI, values); </code></pre><p>but i am getting ""The application has stopped unexpectedly. Please try again"" message.</p><p>what is wrong in it ?How can i access contacts of android ?</p><hr><p>Hi MannyNS thanks for replyI have given write permission as you defined above.</p><p>but i am still getting the ""The application has stopped unexpectedly. Please try again"", even when i start android its giving message ""Process android.process media is not responding"".</p><p>Can you suggest me whole procedure to read and write contacts to android ?Do you have any sample code for it ?</p><p>Thanks Rishabh</p>","177571","","1288","","2011-08-29 01:57:32","2012-12-03 05:24:21","Issue while access contacts of android","<java><android>","3","1","","",""
"1464263","1","","","2009-09-23 06:28:36","1","9504","<p>How     to   add   title   in the   is  the  ListView   in android.</p><p>Means </p><h2>Subject         From    &lt;--------Title</h2><p>hiiiii     |    Raj     &lt;--------List Content<br />hello      |    srss</p><p>Here I  have  used</p><p>EfficientAdapter extends BaseAdapter .</p>","","raj","","","","2010-01-16 07:34:56","How to add title in the is the ListView in android","<android>","2","0","","",""
"1464853","1","1464893","","2009-09-23 09:05:36","7","20982","<p>I am having issue when sending data from Service to Activity through Notification , I click a Notification an Activity get invoked but when i try to add some parameters through bundle i am not able to get the parameters in that called intent , I have gone through the link <a href=""http://stackoverflow.com/questions/1198558/how-to-send-parameters-from-a-notification-click-to-an-activity"">How to send parameters from a notification-click to an activity?</a></p><p>But still no luck.</p><p>Has the same issue occurred with somebody else ?</p><p>Thanks in advance.</p>","95877","","588916","","2013-08-01 10:59:53","2013-08-01 10:59:53","Sending data from service to activity","<java><android>","1","0","14","",""
"1465121","1","1465523","","2009-09-23 10:12:20","4","1193","<p>do you know any ways how to protect your database in Android?</p><p>I consider following ways, but don't know whether it is possible to do:</p><ol><li>access to database has only application owner (which created and serves it)</li><li>restrict or deny access to database to all applications during the usage session of DB owner application</li><li>are there any ways to password protect your database?</li></ol><p>Test with sqlite3 showed that you can change database while other application uses it. So, I assume that possibly some external application can corrupt your data or use it which is bad.</p><p>And also how do you propose to process database exception that could occur during such simultaneous database usage:</p><ol><li>show to user message and close</li><li>show to user message and continue working</li><li>just close ?</li></ol><p>and after all this happens how do you propose to launch application next time?</p><p>Thanks</p>","139394","","139394","","2009-09-23 11:20:48","2011-02-24 10:06:24","Android. How to protect your database?","<database><android>","2","0","2","",""
"1465122","1","","","2009-09-23 10:12:27","3","1568","<p>I am creating an Android application and in that application I created one DB. </p><p>I'm querying the values in the DB and its working fine. </p><p>I need to know where the SQLite DB is stored in my system.</p><p>Can you give me the path, please?</p><p>Thank you!</p>","164783","","638994","","2012-04-05 14:02:43","2012-04-05 14:02:43","in android sdk1.5 where do i find my Sqlite Db in my system","<android><sqlite><path>","3","1","1","",""
"1466788","1","1467179","","2009-09-23 15:33:53","87","109785","<p>Setting the background color programatically of an android TextView doesn't seem to work.I'm I missing something!</p><pre><code>TextView et = new TextView(activity);et.setText(""350"");et.setBackgroundColor(R.color.white);</code></pre><p>I also have this file (colors.xml) in my res/values folder</p><pre><code>&lt;resources&gt;        &lt;color name=""white""&gt;#ffffffff&lt;/color&gt;        &lt;color name=""black""&gt;#ff000000&lt;/color&gt;&lt;/resources&gt;</code></pre><p>[EDIT]: Also, setting the text color causes the TextView to disappear.</p><pre><code>TextView c1 = new TextView(activity);c1.setTextColor(R.color.solid_red);c1.setText(""My Text"");</code></pre>","61525","","61525","","2009-09-23 15:40:00","2013-06-10 05:46:44","android TextView: setting the background color dynamically doesn't work","<android><textview>","10","0","24","",""
"1467442","1","1467927","","2009-09-23 17:18:17","0","428","<p>is it possible to do some visible actions during telephone call?</p><p>It could be something like:</p><ul><li>play custom animation</li><li>inject some custom layout with controls</li></ul>","139394","","1777090","","2013-01-17 07:00:08","2013-01-17 07:00:08","Android. How to do some visible actions during telephone call?","<android><telephone-api>","1","2","","",""
"1468412","1","1468479","","2009-09-23 20:43:38","0","5562","<p>I'm trying to build ""Hello, Android"" with the Android SDK, but Android won't say ""hello"" to me.</p><p>I build with the 2.6 version of the SDK and run in Eclipse on Win XP.  (I've installed the plug-in.)</p><p>Here's what I get:</p><blockquote>  <p>[2009-09-23 16:35:19 -  HelloAndroid]Android Launch!</p>    <p>[2009-09-23 16:35:19 -  HelloAndroid]adb is running normally.</p>    <p>[2009-09-23 16:35:19 -  HelloAndroid]Performing  com.example.helloandroid.HelloAndroid  activity launch</p>    <p>[2009-09-23 16:35:19 -  HelloAndroid]Automatic Target Mode:  launching new emulator with compatible  AVD 'my_avd'</p>    <p>[2009-09-23 16:35:19 -  HelloAndroid]Launching a new emulator  with Virtual Device 'my_avd'</p>    <p>[2009-09-23 16:35:21 -  HelloAndroid]New emulator found:  emulator-5554</p>    <p>[2009-09-23 16:35:21 -  HelloAndroid]Waiting for HOME  ('android.process.acore') to be  launched...</p>    <p>[2009-09-23 16:36:20 -  HelloAndroid]HOME is up on device  'emulator-5554'</p>    <p>[2009-09-23 16:36:20 -  HelloAndroid]Uploading  HelloAndroid.apk onto device  'emulator-5554'</p>    <p>[2009-09-23 16:36:30 -  HelloAndroid]Installing  HelloAndroid.apk...</p>    <p>[2009-09-23 16:36:43 -  HelloAndroid]Success!</p>    <p>[2009-09-23 16:36:44 -  HelloAndroid]Starting activity  com.example.helloandroid.HelloAndroid  on device </p>    <p>[2009-09-23 16:36:44 -  HelloAndroid]Launch <strong><em>error</em></strong>:  device (emulator-5554) request  rejected: <strong><em>device not found</em></strong></p></blockquote>","67875","","308315","","2011-05-10 13:14:30","2011-05-10 13:14:30","Android device not found","<android>","1","1","","",""
"1469618","1","1469638","","2009-09-24 03:19:01","0","1610","<p>Can someone give me a ""simple"" definition about Thread in android. I read the definition on the Android Site but It's really hard for me to imagine!</p>","152286","","","","","2013-09-10 08:29:17","What is thread (java, android)?","<android><multithreading>","3","5","0","",""
"1470438","1","1470842","","2009-09-24 08:37:56","47","22363","<p>Are there any frameworks out there which make it even more easy than it is to build Android applications and would you be interested in one?</p>","174868","","58792","","2010-09-28 13:15:33","2013-08-08 00:52:50","Android Framework?","<java><android><sdk>","8","5","29","",""
"1470867","1","1471197","","2009-09-24 10:34:25","4","19421","<p>I create a custom image view by extending ImageView that just draws some text on the screen, however I don't see anything painted in the Emulator Screen, but the log messages and the printlns get printed in the log console. Am I not doing something?</p><p>This is my activity</p><pre><code>public class HelloAndroidActivity extends Activity{    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        //        setContentView(R.layout.main);        CustomImageView myView = new CustomImageView(getApplicationContext());        System.out.println(""Setting the view"");        myView.invalidate();        setContentView(myView);        System.out.println(""Calling invalidate"");    }}</code></pre><p>This is my CustomImageView</p><pre><code>public class CustomImageView extends ImageView{    /**     * @param context     */    public CustomImageView(Context context)    {        super(context);        // TODO Auto-generated constructor stub        setBackgroundColor(0xFFFFFF);    }    /**     * @param context     * @param attrs     */    public CustomImageView(Context context, AttributeSet attrs)    {        super(context, attrs);        // TODO Auto-generated constructor stub    }    /**     * @param context     * @param attrs     * @param defStyle     */    public CustomImageView(Context context, AttributeSet attrs, int defStyle)    {        super(context, attrs, defStyle);        // TODO Auto-generated constructor stub    }    @Override    protected void onDraw(Canvas canvas)    {        // TODO Auto-generated method stub                super.onDraw(canvas);        System.out.println(""Painting content"");        Paint paint  = new Paint(Paint.LINEAR_TEXT_FLAG);        paint.setColor(0x0);        paint.setTextSize(12.0F);        System.out.println(""Drawing text"");        canvas.drawText(""Hello World in custom view"", 100, 100, paint);    }    @Override    public boolean onTouchEvent(MotionEvent event)    {        // TODO Auto-generated method stub        Log.d(""Hello Android"", ""Got a touch event: "" + event.getAction());        return super.onTouchEvent(event);    }}</code></pre><p>Even the log message in the onTouchEvent() gets printed, but nothing is painted.</p><p>This is my main.xml that has the layout</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/AbsoluteLayout""&gt;&lt;/AbsoluteLayout&gt;</code></pre>","77087","","","","","2012-07-09 16:35:13","Creating Custom ImageView","<android><android-widget><custom-component>","2","0","1","",""
"1471072","1","1530360","","2009-09-24 11:24:54","2","3818","<p>I tried to create byte array blocks from file whil the process was still using the file for writing. Actually I am storing video into file and I would like to create chunks from the same file while recording.</p><p>The following method was supposed to read blocks of bytes from file:</p><pre><code>private byte[] getBytesFromFile(File file) throws IOException{    InputStream is = new FileInputStream(file);    long length = file.length();    int numRead = 0;    byte[] bytes = new byte[(int)length - mReadOffset];    numRead = is.read(bytes, mReadOffset, bytes.length - mReadOffset);    if(numRead != (bytes.length - mReadOffset)){        throw new IOException(""Could not completely read file "" + file.getName());    }    mReadOffset += numRead;    is.close();    return bytes;}</code></pre><p>But the problem is that all array elements are set to 0 and I guess it is because the writing process locks the file.</p><p>I would bevery thankful if anyone of you could show any other way to create file chunks while writing into file.</p>","22996","","","","","2009-10-07 08:52:02","How to split file into chunks while still writing into it?","<java><android><file-io><filestream>","2","3","2","",""
"1471501","1","1494485","","2009-09-24 12:52:18","1","373","<p>What is the best way to learn Android? I'm reading Rogers's at al.'s book Android Application Development. However, as I tried the following code, nothing outputs except a mobile phone:</p><pre><code>package org.qwerty.com;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class HelloWorld extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TextView tv = new TextView(this);        tv.setText(""Hello, Android"");        setContentView(tv);    }}</code></pre><p>I tried also search for the Dalvik Debug Monitor <a href=""http://stackoverflow.com/questions/1108820/android-emulator-output"">http://stackoverflow.com/questions/1108820/android-emulator-output</a> but I couldn't find the option where I can open my hello android project.</p>","","Jaska","","Jaska","2009-09-28 06:56:23","2009-09-29 19:32:32","On studying Android","<android>","5","0","2","2012-07-24 16:05:02",""
"1472382","1","1504000","","2009-09-24 15:18:21","1","2591","<p>I'm trying to implement my first android Program. It should write calendar entries (I know, not the best task to begin programming Andorid). </p><p>I've tried:</p><pre><code>Uri CALENDAR_URI = Uri.parse(""content://calendar/events"");ContentResolver cr = getContentResolver();cr.delete(CALENDAR_URI, null, null); // Delete allcr.delete(CALENDAR_URI, ""calendar_id=1"", null); // Delete all in default calendarcr.delete(CALENDAR_URI, ""_id=1"", null); // Delete specific entry</code></pre><p>Nothing worked. I allays get a ""cannot delete that URL"".</p><p>Inserting an Calendar Entry was simple:</p><pre><code>ContentValues values = new ContentValues();values.put(""calendar_id"", 1);values.put(""title"", this.title);values.put(""allDay"", this.allDay);values.put(""dtstart"", this.dtstart.toMillis(false));values.put(""dtend"", this.dtend.toMillis(false));values.put(""description"", this.description);values.put(""eventLocation"", this.eventLocation);values.put(""visibility"", this.visibility);values.put(""hasAlarm"", this.hasAlarm);cr.insert(CALENDAR_URI, values);</code></pre><p>According to my insert method accessing the calendar worked.</p><p>Thanks, Arthur!</p>","178517","","","","","2010-07-29 14:59:58","How to delete a calendar entry?","<android><calendar>","2","0","3","",""
"1472898","1","1473056","","2009-09-24 16:48:26","4","10634","<p>I want to store some data from structures like this:</p><pre><code>class Project {    ChildA a;    ChildB b;}class ChildA {    ChildC c;    ...}...</code></pre><p>I have created data like:</p><pre><code>Projet x = new Project();x.a = new ChildA();x.a.c = new ChildC();</code></pre><p>... and I want to save it to an external file on the sdcard of my device so that other apps can read it (and users can open/copy it).</p><p>I thought I should use a DOM parser because my data structures are not very big, but I find no tutorials or anything like that. Is there a better way to store this information?</p><p>If not, are there any instructions how to use the parsers in android?</p>","165106","","15825","","2010-03-19 14:00:52","2010-03-19 14:00:52","How do I save data structures in android?","<xml><android><dom><parsing>","1","0","1","",""
"1472976","1","1479768","","2009-09-24 17:02:27","4","1944","<p>I wonder what is the right way to implement this? Could anybody advice whether my solution is correct?</p><p>So:</p><ol><li>Activity is created</li><li>User clicks on button and dialog is launched (Dialog, not dialog styled activity)</li><li>User opens keyboard</li><li>we have onSaveInstanceState called where we save that our dialog was opened and all respective dialog input</li><li>we have onRestoreInstanceState and here we check whether dialog was shown, recreate the dialog with respective input.</li></ol><p>Is it the right approach? or there is smth. that is done by Android and I am doing some redundant actions.</p><p>Thanks</p>","139394","","","","","2009-10-22 04:47:53","Android. Save Instance State for Dialogs?","<android><state-management>","2","0","","",""
"1473185","1","1473245","","2009-09-24 17:49:50","9","12236","<p>I just downloaded the <a href=""http://developer.android.com/sdk/1.6%5Fr1/index.html"">android</a> sdk from the adnroid site and followed <a href=""http://wiki.netbeans.org/IntroAndroidDevNetBeans"">this</a> tutorial to set it up on netbeans. Everything to seem to have installed fine but whenever i try to run the application this window pops up:</p><p><img src=""http://img80.imageshack.us/img80/4327/androidemulator.png"" alt=""alt text"" /></p><p>What I am assuming it asking me to choose the emulator, but it is not showing up on the list. Is there a reason why?</p>","45471","","1288","","2009-09-24 17:51:22","2014-03-19 13:31:38","Android Emulator not loading on netbeans","<java><android><netbeans>","7","1","3","",""
"1473355","1","1473642","","2009-09-24 18:26:08","2","2827","<p>I did search around various questions related to the one I'm about to ask. I just want to ask it in clear and simple manner and hopefully get a clear and simple answer :)</p><p>I have a <code>List</code> of several hundred items that I want to present to the user in <code>ListView</code> widget. Initially I want to start with say 50 items and as user scrolls near the bottom I want to add another 50 and so forth. I think GMail Inbox would be a good example of what I need. I'm not interested in <code>Cursor</code> implementation - the dataset is quite simple as I said for now it's just a <code>List</code>.</p><p>Also - say <code>ListView</code> grows too big, it would be nice to start chopping it from the top so it behaves as a sliding ruler at it max showing about 200 rows (with 30 viewable)</p>","135946","","","","","2009-09-24 19:17:29","Autogrow ListView in Android","<android><listview><autogrow>","1","0","4","",""
"1474206","1","1475570","","2009-09-24 21:18:28","1","949","<p>I have pretty unassuming preferences screen based on<code>PreferenceActivity</code>. (You can see it in <code>DroidIn</code> app) I'm having someproblems with it that I think have to do with redrawing the screenafter updates. Here are the symptoms:</p><ol><li><code>OnPreferenceChangeListener#onPreferenceChange</code> if I change summaryof the preference by doing <code>Preference#setSummary</code> the new value ispainted over the old one creating unsightly effect</li><li>My preferences screen is large enough that user has to scroll.While scrolling, the whole screen get all messed up, again it lookslike view is redrawn (when scrolled) without erasing the backgroundfirst.</li></ol><p>Preferences are defined in XML file - nothing funky just somecategories and preferences nested within <code>&lt;PreferenceScreen/&gt;</code></p><p>Do I need to explicitly redraw the view? That seem excessive - whywouldn't that happen by default?Since this is an existing app - it's build and distributed with v. 1.5 </p><p>P.S. I also want to mentioned that this behavior occurs in emulator and on G1 in both 1.1 and 1.5. It looks like I need to log it as a bug</p>","135946","","135946","","2009-09-25 04:58:42","2009-09-25 05:29:10","Android: Mangled PreferenceActivity view","<android><redraw><preferenceactivity>","1","0","2","",""
"1474247","1","","","2009-09-24 21:26:43","2","588","<p>I want to adjust display settings in my activity.</p><pre>Intent intent=new Intent(Settings.ACTION_DISPLAY_SETTINGS); 			startActivity(intent);</pre><p>got exception:</p><pre><code>09-24 21:24:35.901: ERROR/AndroidRuntime(5892): android.content.ActivityNotFoundException:     No Activity found to handle Intent         { action=android.settings.DISPLAY_SETTINGS }</code></pre>","157195","","1432","","2009-09-24 21:39:19","2013-11-16 12:58:05","Android Settings.ACTION_DISPLAY_SETTINGS not found","<java><android>","2","0","","",""
"1475190","1","1480295","","2009-09-25 02:48:18","0","3524","<p>My ListView (two TextView, one Icon) have more than 4000 rows and It sroll very slowly. The problem is ""For{} statement"" with ""Cursor"" make my program worse.I want to get the ""First Character""(from one of two TextView) to display when User Scroll. So, any solutions to archive this and make my program better.My function like this:</p><pre><code>public void onScroll(AbsListView view, int firstVisibleItem, int VisibleItemCount, int totalItemCount){ //int lastItem = firstVisibleItem + VisibleItemCount - 1; Cursor cursor = mDbHelper.loadTitleRaw(); startManagingCursor(cursor); ArrayList&lt;String&gt; myArrayList = new ArrayList&lt;String&gt;(); for(cursor.moveToFirst(); cursor.moveToNext(); cursor.isAfterLast()) {    String mTitleRaw = cursor.getString(cursor.getColumnIndex(SBooksDbAdapter.KEY_TITLE_RAW));    myArrayList.add(mTitleRaw); } String[] mString = myArrayList.toArray(new String[myArrayList.size()]);           if(mReady){  char firstLetter = mString[firstVisibleItem].charAt(0);  if(!mShowing &amp;&amp; firstLetter != mPrevLetter){   mShowing = true;   mDialogText.setVisibility(View.VISIBLE);  }  mDialogText.setText(((Character)firstLetter).toString());  mHandler.removeCallbacks(mRemoveWindow);  mHandler.postDelayed(mRemoveWindow, 3000);  mPrevLetter = firstLetter; }}</code></pre>","152286","","","","","2009-09-26 02:47:49","Check data when Scroll with the OnScrollListener in ListView (android)","<android><listview>","1","2","1","",""
"1476371","1","1476696","","2009-09-25 09:35:35","97","21799","<p>The Android app I'm currently developing has a main activity that has grown quite large. This is mainly because it contains a <code>TabWidget</code> with 3 tabs. Each tab has quite a few components. The activity has to control of all those components at once. So I think you can imagine that this Activity has like 20 fields (a field for almost every component). Also it contains a lot of logic (click listeners, logic to fill lists, etc).</p><p>What I normally do in component based frameworks is to split everything up into custom components. Each custom component would then have a clear responsibility. It would contain it's own set of components and all other logic related to that component.</p><p>I tried to figure out how this can be done, and I found something in the Android documentation what they like to call a ""Compound Control"". (See <a href=""http://developer.android.com/guide/topics/ui/custom-components.html#compound"">http://developer.android.com/guide/topics/ui/custom-components.html#compound</a> and scroll to the ""Compound Controls"" section) I would like to create such a component based on an XML file defining the view structure.</p><p>In the documentation it says:</p><blockquote>  <p>Note that just like with an Activity,  you can use either the declarative  (XML-based) approach to creating the  contained components, or you can nest  them programmatically from your code.</p></blockquote><p>Well, that's good news! The XML-based approach is exactly what I want! But it doesn't say how to do it, except that it is ""like with an Activity""... But what I do in an Activity is call <code>setContentView(...)</code> to inflate the views from XML. That method is not available if you for example subclass <code>LinearLayout</code>.</p><p>So I tried to inflate the XML manually like this:</p><pre><code>public class MyCompoundComponent extends LinearLayout {    public MyCompoundComponent(Context context, AttributeSet attributeSet) {        super(context, attributeSet);        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        inflater.inflate(R.layout.my_layout, this);    }}</code></pre><p>This works, except for the fact that the XML I'm loading has <code>LinearLayout</code> declared as the root element. This results in the inflated <code>LinearLayout</code> being a child of <code>MyCompoundComponent</code> which itself already is a <code>LinearLayout</code>!! So now we have a redundant LinearLayout in between <code>MyCompoundComponent</code> and the views it actually needs.</p><p>Can somebody please provide me with a better way to approach this, avoiding having a redundant <code>LinearLayout</code> instantiated?</p>","109774","","603444","","2012-06-28 21:23:44","2012-10-22 15:53:23","Android - Writing a custom (compound) component","<java><android><custom-component>","2","2","36","",""
"1476392","1","1476628","","2009-09-25 09:39:14","3","832","<p>I am facing a problem of installing ADT from </p><pre><code>https://dl-ssl.google.com/android/eclipse/</code></pre><p>and </p><pre><code>http://dl-ssl.google.com/android/eclipse/</code></pre><p>It shows some transfer error.</p><p>I have downloaded the ADT plugin archive ADT-0.9.3.zip</p><p>Can i use this archive? If yes please let me know.If no, then please tell me some alternatives.</p>","169965","","","","","2009-09-25 10:56:09","I want to plug ADT plugins with eclipse 3.5 using ADT-0.9.3.zip archive","<android><eclipse-plugin><setup><adt>","1","0","","",""
"1477106","1","1477824","","2009-09-25 12:48:29","2","7684","<p>I am writing an Android application which uses WikiTude API. I installed the WikiTude browser application in the Android SDK emulator from Android Market (To get Android Market in emulator I followed this link <a href=""http://forum.xda-developers.com/archive/index.php/t-529170.html"" rel=""nofollow"">http://forum.xda-developers.com/archive/index.php/t-529170.html</a>).</p><p>When I run the WikiTude browser application in emulator it asks me to set location settings. I enabled “Enable GPS satellites” option &amp; run the application, again it make an alert for location settings. I am not able to run this application. Please help me.</p><p>Can anyone tell me is it possible to run GPS based application in Android Emulator? Or not?                          If it is, Is there any work around to run GPS based application in emulator ?</p>","179043","","996493","","2012-04-01 11:16:52","2012-04-01 11:16:52","How to run GPS based application (WikiTude) in Android SDK Emulator?","<android><gps><emulator>","1","1","3","",""
"1478849","1","","","2009-09-25 18:23:24","3","2672","<p>For my useless project of the month I'm working on a 'emulator' to run J2ME programs on Android. But now I'm stuck with the J2ME Sprite implementation. Specifically the transformations used in it.</p><p>In my Sprite I have a bitmap with three character images. I would like to paint the second frame mirrored or rotated 90 degrees. What would be the best way for it?</p><p>I have following code that paints the given frame without any transformations.</p><p>frameX, frameY are frame position coordinates on give sprite bitmap.</p><pre><code>Rect src = new Rect(frameX, frameY, frameX + spriteWidth, frameY + spriteHeight);Rect dst = new Rect(paintX, paintY, paintX + spriteWidth, paintY + spriteHeight);canvas.drawBitmap(image, src, dst, null);</code></pre><p>As I understand I need to make some matrix magic on the canvas, but I have not been able to figure this out :)</p>","706","","","","","2010-04-30 21:15:26","J2ME like Sprite on Android","<android><java-me><sprite><transformation>","3","0","1","",""
"1480762","1","1480833","","2009-09-26 08:21:52","1","311","<p>I have a quite general question about java and regular expression.</p><p>If we lock at embedded use, say mobile phones with J2ME or Android, how common is it that regexp is included and how resource hungry is it?</p><p>I mean regular expression is a powerful beast, and a lot of magic is done in the background to make it happen. And my question is if there maybe are to much magic?Or if it is safe to use it with care (like most things).</p><hr><p><strong>Update</strong>:Thanks DigitalRoss for pointing out that <a href=""http://developer.android.com/reference/java/util/regex/package-summary.html"" rel=""nofollow"">java.util.regex</a> is a part of android.</p>","51425","","1777090","","2013-01-21 07:19:45","2013-01-21 07:19:45","Java regexp: How common is it? And how much resource does it use?","<java><android><regex><java-me>","4","0","","",""
"1480765","1","1480775","","2009-09-26 08:22:55","0","2290","<p>I have stacked here, because i am totally new in android world. Can show the way please?</p>","169965","","","","","2013-05-01 10:17:59","creating Android Virtual Device (AVD) in eclipse 3.5 on windows xp","<android><eclipse><avd>","2","0","","",""
"1482206","1","1765381","","2009-09-26 21:18:12","7","8291","<p>For an application I am working on, I need to display custom raster image tiles (not vector based, probably from satellite imagery), and I need to do so offline.  I would like to use the MapView, but I cannot see a way to tell it to use custom, offline map tiles instead of pulling down data from google's servers.</p><p>I've seen a few alternatives, but none seem appropriate to my need</p><p>MapDroyd Seems to only support vector-based maps.  mapdroyd.com/</p><p>OSMDroid Appears to use Open Street Maps; I don't see any documentation anywhere stating that you can use custom map tiles.  code.google.com/p/osmdroid/</p><p>There was a third alternative, but my post got eaten and I can't find it in my history.  </p><p>Am I going to have to bite the bullet and 'roll my own'?</p>","155392","","","","","2011-07-19 11:29:03","Android - offline, non-vector based, custom maps","<android><google-maps>","5","0","4","",""
"1482586","1","1806940","","2009-09-27 01:46:50","310","173497","<p>I am a web developer and I want to move my web products to iPhone. One of the products is like Google Maps: show map on the phone screen, you can drag or resize the map and view some information that we add to the map.</p><p>I know there are some technologies that enables you to use HTML, CSS and Javascript to develop native iPhone apps.  I've identified a few:</p><ul><li><a href=""http://www.anscamobile.com/"" rel=""nofollow"">Ansca Mobile</a></li><li><a href=""http://phonegap.com/"" rel=""nofollow"">PhoneGap</a></li><li><a href=""http://www.appcelerator.com/"" rel=""nofollow"">Appcelerator</a></li></ul><p>Are there other, similar products?  What are the differences between them?  Which should I choose?</p>","115781","","-1","Roger Pate","2011-02-18 10:17:17","2012-10-28 01:12:52","Comparison between Corona, Phonegap, Titanium","<iphone><android><html><mobile-website>","14","2","380","",""
"1483047","1","1483161","","2009-09-27 07:45:42","24","5064","<p>Is there an easy way to simulate low memory inside the emulator ?I'm interested to perform resource cleanups similar to <a href=""http://groups.google.com/group/android-developers/browse%5Fthread/thread/59b726243404440b/720d28bd1bc3fcee"">this post</a></p>","27328","","","","","2012-05-29 13:17:41","How do you simulate low memory in the Android emulator?","<java><android><mobile>","2","0","18","",""
"1483316","1","1483452","","2009-09-27 10:46:28","0","476","<p>I choose an item to remove from my ListView. And after the Item was removed, my ListView was scrolled back and display at the first Item.I want my ListView display in right place where the Item I had removed (It like remove a contact in Android Contact list). How can I do that?</p>","152286","","152286","","2009-09-27 12:59:11","2009-09-27 13:39:01","How can I ""set View"" in right place where I remove an item in ListView (Android)","<android><listview>","1","4","","",""
"1483629","1","2485145","","2009-09-27 14:02:56","39","8710","<p>I posted <a href=""http://groups.google.com/group/android-developers/browse%5Fthread/thread/1678a8b9bc7b6a8a"">this</a> back in May on the [android-developers] Google Group. I never heard back and was not able to reproduce the problem until one of my students did last week. I figured I'd post it here and see if it rang any bells for anyone.</p><p>In one of my code samples, I have the following method:</p><pre><code>static Cursor getAll(SQLiteDatabase db, String orderBy) {        return(db.rawQuery(""SELECT * FROM restaurants ""+orderBy, null));}</code></pre><p>When I run it, sporadically, I get this:</p><pre><code>05-01 14:45:05.849: ERROR/AndroidRuntime(1145):java.lang.IllegalStateException: attempt to acquire a reference on aclose SQLiteClosable05-01 14:45:05.849: ERROR/AndroidRuntime(1145):     atandroid.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:31)05-01 14:45:05.849: ERROR/AndroidRuntime(1145):     atandroid.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:56)05-01 14:45:05.849: ERROR/AndroidRuntime(1145):     atandroid.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:49)05-01 14:45:05.849: ERROR/AndroidRuntime(1145):     atandroid.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:49)05-01 14:45:05.849: ERROR/AndroidRuntime(1145):     atandroid.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1118)05-01 14:45:05.849: ERROR/AndroidRuntime(1145):     atandroid.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1092)05-01 14:45:05.849: ERROR/AndroidRuntime(1145):     atapt.tutorial.Restaurant.getAll(Restaurant.java:14)</code></pre><p>This makes no sense to me. The database is definitely open. The<code>SQLiteClosable</code> is the <code>SQLiteQuery</code> created by <code>SQLiteQueryDriver</code>, and Isee no evidence that there is an object pool or something going on herethat might explain how a ""new"" <code>SQLiteClosable</code> is already closed. Thefact that it is sporadic (meaning the same UI operations sometimestrigger the exception, but not always) suggests some sort of pool, racecondition, or something...but I'm not sure where. </p><p>Thoughts?</p><p>Thanks!</p><p><strong>UPDATE</strong>: The code in question is from the LunchList tutorials out of my <a href=""http://commonsware.com/AndTutorials/"">Android Programming Tutorials</a> book. It's a bit spread out and not terribly suitable for posting directly in SO. You can download the code for that book from the above link if you want to take a look at it. I do not recall exactly which edition of the tutorial the student was working on at the time, though it was in the Tutorial 12-Tutorial 16 range. I was mostly hoping to run across somebody who had tripped over this problem before and had a likely culprit. I'm fairly certain my database is open. Thanks again!</p>","115145","","115145","","2009-10-10 11:59:08","2012-04-01 06:11:26","Exception: attempt to acquire a reference on a close SQLiteClosable","<android>","4","4","19","",""
"1484122","1","1544391","","2009-09-27 18:23:30","12","60653","<p>I have some web services that uses WSDL/SOAP for communication. Specifically, I am using PHP and Nusoap to make them. How can I use these web services on Android? I am going to get a new Android phone soon, so I need to know. </p><p>It is easy to do it with Windows Mobile and Visual Studio.</p><p>Thanks</p>","74984","","","","","2014-03-12 10:06:55","Android WSDL/SOAP service client","<android><soap><service><wsdl>","9","0","14","",""
"1484528","1","1484546","","2009-09-27 21:31:18","15","16880","<p>I'm having some problem with setSelection on a Spinner. I set the value to be pre-selected when the spinner is shown in code, but it has no effect and the first alternative in the list is always selected. The code looks like this: </p><pre><code>    LayoutInflater li = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);    final View dialogView = li.inflate(R.layout.edit_event, null);    ...    ArrayList&lt;String&gt; routes = new ArrayList&lt;String&gt;();    // routes filled with values at runtime    ...    ArrayAdapter&lt;String&gt; aa = new ArrayAdapter&lt;String&gt;(GOFdroid.this, android.R.layout.simple_spinner_item, routes);    aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    Spinner destSpinner = (Spinner) dialogView.findViewById(R.id.edit_event_destination);    String dest = events.get(pos).getDestination();    int routesPos = routes.indexOf(dest);    Log.d(TAG, ""Dest: "" + dest + "", pos: "" + routesPos);    destSpinner.setSelection(routesPos);    destSpinner.setAdapter(aa);</code></pre><p>The code works as intended except for the setSelection-part, and I just can't figure out why.</p><p>The XML-layout of the spinner looks like this (not the entire layout, only the spinner part):</p><pre><code>// DESTINATION&lt;TextView   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:text=""Destination:"" /&gt;&lt;Spinner   android:id=""@+id/edit_event_destination""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:prompt=""@string/choose_dest""   android:layout_marginBottom=""10dip""   android:text="""" /&gt;</code></pre><p>Help is very much appreciated!</p><p>Linus</p>","91098","","","","","2013-06-28 18:02:22","Android: setSelection having no effect on Spinner","<android><spinner>","6","0","4","",""
"1486281","1","","","2009-09-28 10:05:30","0","981","<p>My android app contains a suite of mini apps. In short, the main screen contains several icons, one each for the mini apps. When an icon is clicked, the mini app is launched. In total I have 4 mini apps. So you could imagine that my main screen is like the Home Screen Launcher. Although these mini apps could run standalone by their own, I want the user to be authenticated. Thus there is a LoginActivity right before the MainActivity.</p><pre><code>LoginActivity -&gt; MainActivity ---&gt; AppOneActivity                              ---&gt; AppTwoActivity                              ---&gt; AppThreeActivity                              ---&gt; AppFourActivity (aka PresenceListActivity)</code></pre><p>I'm still not pretty sure of the benefit of Tasks (arranged set of Activities), so I would like comments from Android experts on my design decisions:-</p><p>(1) I plan to set the attribute <strong>finishOnTaskLaunch</strong> to true for <strong>LoginActivity</strong>. As I understand it, once the login is authenticated, I will navigate the user to <strong>MainActivity</strong>, and I want <strong>LoginActivity</strong> to disappear. Is this better than calling <em>#finish</em> on the Activity ? Will MainActivity automatically become the root of the Task without any extra configuration/code ?</p><p>(2) One of the mini app is an IM client. The <strong>PresenceListActivity</strong> will hosts many instances of <strong>ChatActivity</strong> (one-to-one chat session with an active contact in the buddylist). I plan to use the default launchmode for <strong>ChatActivity</strong> since each Chat should be handled by a new instance. Sounds correct ?</p><p>(3) A sticky navigation bar will exists in the top corner of <strong>AppOneActivity</strong>, <strong>AppTwoActivity</strong> etc.. I plan to set the <em>clearTaskOnLaunch</em> attribute to true for all of them. As I understand it, I should clear the stack whenever I plan to launch into any of the mini apps. Also their <em>launchModes</em> will be <em>singleTask</em>. Am I on the right path ?</p><p>(4) Finally I don't really understand how to read the output of <em>adb shell dumpsys activity</em>. For example</p><pre><code>Task{10 com.me.rnd.exit}clearOnBackground=false numActivities=1affinity=com.me.rnd.exitlastActiveTime=5513102 (inactive for 5s)  History #1: .....Task{2 com.android.launcher}clearOnBackground=true numActivities=1 rootWasReset=trueaffinity=com.android.launcherlastActiveTime=5512949 (inactive for 6s)  Running #0:</code></pre><p>Sometimes underneath the Tasks, you will see <strong>History</strong> and in others <strong>Running</strong>, what do these mean ? Even stranger, sometimes I have two <strong>History</strong> under a task.</p>","27328","","1777090","","2013-01-21 07:03:14","2013-01-21 07:03:14","Wondering about the correct use of taskAffinity & launchModes?","<java><android><mobile>","1","0","","",""
"1487125","1","1487219","","2009-09-28 13:43:40","2","10237","<p>I created an application which is asynchronously communicating with the server. When the application makes a server request a new dialog (activity) with ""loading"" notification is created. The main activity implements methods for handling server responses and I would like to close the foreground activity when the main activity receives the answer from the server.</p><p>Notification dialog is created the following way:</p><pre><code> private void showServerRequestDialog(String actionLabel){    Intent intent = new Intent(this, DlgServerRequest.class);    intent.putExtra(SERVER_REQUEST_ACTION, actionLabel);    startActivity(intent);}</code></pre><p>so when the user tries to authenticate the following method is called:</p><pre><code>private void authenticateUser(String IMEI, String username, String password){    mEncoderConnection.authenticateRequest(IMEI, username, password);    showServerRequestDialog(""Authenticating..."");}</code></pre><p>and onAuthenticateResponse handles authentication response:</p><pre><code>public void onAuthenticateResponse(AuthenticateResponse pkg) {    //code for response handling    //TODO: close ServerRequestDialog    }}</code></pre><p>I would appreciate if anyone could suggest a way to close the notification dialog (DlgServerRequest) when the onAuthenticateUser() is executed.</p>","22996","","1777090","","2013-01-21 07:14:29","2013-01-21 07:14:29","Android: How to close foreground activity from active activity?","<android><activity><subactivity>","1","0","3","",""
"1487284","1","1487408","","2009-09-28 14:16:14","0","1185","<p>I'm working on an Android Application for AutiPlan, which is a web-based planner tool for people with an Autism-related disorder.</p><p>I want to create an application which shows the current activity (planned item), together with a clock. (AnalogClock) On this clock, I want to paint a red background from the current-minute to the minute at which the activity ends.</p><p>To clarify, if it is now 12:00 and the current activity ends at 12:15, the right-top quarter of the circle that makes out the analog clock is red. This has to be updated every minute, so that it is clear how much time is left for the current activity. (The red section gets smaller each minute).</p><p>Also, (question 2) I want to use AnalogClock to display a small (stationary) clock with the time that the next activity starts. Can I set the time of the object so it displays a specific time?</p>","159814","","1777090","","2013-01-21 07:03:34","2013-01-21 07:03:34","Painting over analog clock in Android application and setting it","<java><android><gui>","1","0","","",""
"1487333","1","","","2009-09-28 14:26:50","1","12810","<p>I try to display italic text in a textview. I use the method TypeFace.defaultFromstyle(TypeFace.ITALIC) but it doesn't work, the style of the text is not set to italic. If i call the getStyle() method on the return of defaultFromstyle() it returns 0.Any idea ?</p>","164460","","","","","2012-12-11 11:37:22","android italic typeface","<android><fonts>","3","0","1","",""
"1489852","1","1489895","","2009-09-28 23:27:56","107","84178","<p>I am wondering if there is a way to handle the user pressing <kbd>Enter</kbd> while typing in an <code>EditText</code>, something like the onSubmit HTML event.</p><p>Also wondering if there is a way to manipulate the virtual keyboard in such a way that the ""Done"" button is labeled something else (for example ""Go"") and performs a certain action when clicked (again, like onSubmit).</p>","180784","","2117960","","2014-03-03 09:29:14","2014-03-03 09:29:14","Android - Handle ""Enter"" in an EditText","<android>","8","0","50","",""
"1490045","1","","","2009-09-29 00:49:35","0","1641","<p>is it possible to make large/custom size icon on the desktop for android?  </p>","157195","","","","","2012-05-23 07:22:40","android custom application icon","<android>","2","0","","",""
"1490962","1","1490977","","2009-09-29 06:46:46","0","1447","<p>In <a href=""http://code.google.com/intl/fr-FR/events/io/sessions/SupportingMultipleDevicesBinary.html"" rel=""nofollow"">this</a> Google IO 2009 presentation, a GIT url is provided in the slides.The URL looks like this</p><pre><code>http://android.git.kernel.org/?p=platform/development.git;a=commit;h=a42091afb7b122c753f9050ff5dbcb792eb36a78</code></pre><p>I want to check out the code, so I ran</p><pre><code>git clone http://android.git.....rest...of....URI.shown..above</code></pre><p>But git is aborting with the error <em>fatal: <a href=""http://android.git.kernel.org/?p=platform/development.git/info/refs"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/development.git/info/refs</a> not found: did you run git update-server-info on the server</em>. Am I doing anything wrong ?</p>","27328","","","","","2009-09-29 06:53:27","Given a GIT URI, how can I check it out?","<android><git><dvcs><checkout>","1","1","1","",""
"1491048","1","1491908","","2009-09-29 07:20:15","2","1518","<p>We've been using Frame Buffer Objects in our application, and trying to port it to android.</p><p>However it seems that the FBO extension isn't implemented in Android 1.4 (which we are using).</p><p>We essentially need to render a scene to a texture, we don't need z-buffer, just general poly and texturing primatives.</p><p>Any suggestions on how to get round the problem?</p><p>Regards,nash</p>","","Brett Nash","44729","","2010-06-18 18:09:27","2010-06-18 18:09:27","Android OpenGL ES + Frame Buffer Objects","<android><opengl-es>","1","0","","",""
"1491428","1","1492417","","2009-09-29 09:10:20","1","6957","<p>In Android, how can I replace the user interface of an emulator by my own interface? I would like to start my own interface immediately as the emulator gets started and that the user can't use the original interface but the original interface is on the background.</p><h3>Update:</h3><p>Now my code looks like this:</p><pre><code>public class NewHomeScreen extends Activity {/** Called when the activity is first created. */@Override public void onCreate(Bundle state) {    super.onCreate(state);    setContentView(R.layout.main);    Intent mainIntent = new Intent(this,Hello.class);    startActivity(mainIntent);    }}</code></pre><p>As I run the program, Eclipse displays</p><p>ActivityManager: Warning: Activity not started, its current task has been brought to the front</p><p>Does anyone knows why?</p>","","Jaska","1288","","2009-10-09 14:10:14","2010-10-01 12:58:49","Changing the user interface of an Android","<android><user-interface>","2","3","","",""
"1492401","1","1501361","","2009-09-29 13:01:38","37","177221","<p>I got this error while installing the android application (<code>Parse Error : There is a problem parsing the package.</code>). I did the following steps.</p><ol><li><p>First time I installed the application and it works fine.</p></li><li><p>I made changes to the existing application and change the version no in Manifest file.</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android"" package=""org.openintents.samples.BasicOpenARDemo"" android:versionCode=""2"" android:versionName=""1.0.1""&gt;</code></pre></li><li><p>Then I export the application and finish the code signing process.For this, Right Click your Project node > select Export. There you will see a wizard. Follow the steps and finish the code signing also.</p></li><li><p>I got the ARDemo.apk file, Then I changed it’s name to ARDemo1.apk</p></li><li><p>Then I shipped this apk file to mobiles SD Card and started the installation I got the above error.</p></li></ol><p>I googled, they say that problem with unpacking manifest file.</p><p>Can anyone tell me what could be wrong with me?</p>","179043","","9702","","2009-10-27 18:47:59","2013-06-14 06:38:37","""Parse Error : There is a problem parsing the package"" while installing Android application","<android>","6","7","7","",""
"1492430","1","","","2009-09-29 13:11:46","0","3186","<p>I am new to android. I want to display the list of images using the ListView. The images which are displayed are decided at runtime according to server response. and also i want to embedd some text on this image(like match scoring chip). the number of images are not fix. Can anybody help me here?</p>","181135","","","","","2009-09-29 14:22:29","How to display list of images in ListView in android?","<android><listview>","1","0","","",""
"1492554","1","6873336","","2009-09-29 13:27:49","53","139360","<p>I am using a web view in which I am adding an image view. Now I want to set the background of this image view transparent. I have tried this:</p><pre><code>mImageview.setBackgroundResource(R.color.trans);</code></pre><p>Where <code>trans</code> => <code>&lt;color name=""trans""&gt;#00000000 &lt;/color&gt;</code>.</p>","152867","","1128737","","2012-01-16 17:03:07","2013-08-01 02:47:46","Set transparent background of an imageview in Android","<android><android-widget>","9","1","33","",""
"1492919","1","1493829","","2009-09-29 14:30:37","1","325","<p>I am planning to develop a game for all of the mobile platform and have pretty much zeroed down on the concepts of the game. but the only issue I'm facing as of now is that I have no idea what would be the best libraries + 3d Engine to us to achieve the best results on the hardware on some of the upcoming mobiles. I'm talking about the iPhone 3GS, the new WinMo and Android devices with the famed Snapdragon, other processors from Samsung, ARM, Qualcomm and even Intel and AMD.as of now i plan to use the ogre libraries for now, but then what will offer portability?? This is much more of a design question rather than just coding. Any help is appreciated, others who wish to collaborate are very much welcome too. just drop me a mail.</p>","180950","","","","","2011-02-20 18:07:12","3D Engines for development on any mobile platform","<iphone><android><windows-mobile><intel><amd>","2","0","","",""
"1493003","1","1494086","","2009-09-29 14:43:19","2","5023","<p>Here's scenario:</p><ol><li>Client makes remote call to the service (returns void) and providesa callback object</li><li>Service executes some long running logic on the background threadand then uses callback object to trigger ether success or failurewhich (since these manipulate visual elements) execute inActivity#runOnUiThread block</li></ol><p>The scenario runs fine. The question is - can I use AsyncTask to makecode less verbose (how?) and would be there any advantages in doing itthat way?</p><p>Or should I just get away from client callbacks alltogether andexecute remote service calls retrofitted to return some value withinAsyncTask#doInBackground?</p>","135946","","","","","2009-11-13 14:36:44","Android asynchronous service calls strategy","<android><asynchronous><service>","2","0","3","",""
"1493107","1","","","2009-09-29 14:59:15","4","3560","<p>I am trying to install apk file in G1 device and get following error:</p><p>Failure[INSTALL_FAILED_ALREADY_EXISTS]</p><p>I have already change the name of main file using Manifest too. change the icon too.</p><p>though the same problem is come over.</p><p>Any suggestions are welcome.</p><p>Thanks in Advanced..Sunil Mishra</p>","","sunil","","","","2012-05-10 10:44:36","android apk file installation","<android>","3","0","3","",""
"1493781","1","1493805","","2009-09-29 16:58:07","1","898","<p>could you please advice how to connect to development machine from device?</p><p>I can easily do this from Emulator, but from device I have connection timeout exception.</p><p>Here is my code:</p><pre><code>String hostname = ""10.0.2.2"";int port = 4444;Socket socket = null;try{      socket = new Socket(InetAddress.getByName(hostname), port);} catch(UnknownHostException e) {      Log.e(""Capturer"",""UnknownHostException : "" + e.getMessage(), e); } catch(IOException e) {      Log.e(""Capturer"", ""IOException : "" + e.getMessage(), e); }</code></pre>","139394","","1777090","","2013-01-21 07:02:47","2013-01-21 07:02:47","Android. How to connect to development machine from device?","<android><sockets>","2","0","1","",""
"1495585","1","1495767","","2009-09-30 00:22:31","4","16735","<p>My Android application has some files in the assets directory that I want to open on startup by listing the files in the directory and opening each. I am trying to use the AssetManager to do this but it does not seem to do as I would expect.  My sample code is below.  Is this the correct way or is there a better way to do this?</p><p>And I am using the following method to print out the assets directory tree.</p><pre><code>void displayFiles (AssetManager mgr, String path) {    try {        String list[] = mgr.list(path);        if (list != null)            for (int i=0; i&lt;list.length; ++i)                {                    Log.v(""Assets:"", path +""/""+ list[i]);                    displayFiles(mgr, path + list[i]);                }    } catch (IOException e) {        Log.v(""List error:"", ""can't list"" + path);    }}</code></pre><p>From my Activity's onCreate method I do the following: </p><pre><code>final AssetManager mgr = getAssets();    displayFiles(mgr, ""/assets""); displayFiles(mgr, ""./assets""); displayFiles(mgr, ""/"");displayFiles(mgr, ""./"");</code></pre><p>Which gives me the following output</p><pre>09-29 20:08:27.843: DEBUG/GFlash(6543): //AndroidManifest.xml 09-29 20:08:27.954: DEBUG/GFlash(6543): //META-INF09-29 20:08:28.063: DEBUG/GFlash(6543): //assets09-29 20:08:28.233: DEBUG/GFlash(6543): //classes.dex 09-29 20:08:28.383: DEBUG/GFlash(6543): //com09-29 20:08:28.533: DEBUG/GFlash(6543): //res09-29 20:08:28.683: DEBUG/GFlash(6543): //resources.arsc</pre><p>Thanks in advance!  </p><p>John</p>","4476","","","","","2011-07-28 14:39:05","How can I get a directory listing of resources from my Android app?","<android>","2","0","5","",""
"1497074","1","","","2009-09-30 09:41:06","0","416","<p>What are the settings required to access network for those who dont have ADSL connection?Thanks.</p>","168924","","88558","","2009-09-30 09:58:14","2013-10-21 04:21:40","Is it necessary that we should have ADSL connection to access internet(network) through Android Emulator?","<android>","1","5","","",""
"1497755","1","1498064","","2009-09-30 12:18:38","14","46948","<p>I created a user form which fits the window in vertical orientation. When the user slides the keyboard the form doesn't fit the screen (horizontal orientation). I tried to add the scrollbar but it is not visible.</p><p>I would appreciate if anyone could show how to modify the following layout file in order to display scrollbar when the orientation is set to horizontal.</p><p>Thanks!</p><pre><code>&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""     android:orientation=""vertical""     android:scrollbars=""vertical""     android:scrollbarAlwaysDrawVerticalTrack=""true""&gt;        ...    &lt;/LinearLayout&gt;</code></pre>","22996","","","","","2011-08-04 13:56:49","Android: How to automatically display vertical scrollbar?","<android><layout>","2","0","8","",""
"1498046","1","1498095","","2009-09-30 13:15:23","1","4898","<p>How can I display a button on screen? I have defined it as</p><pre><code>final Button nappi = (Button) findViewById(R.id.soita);</code></pre><p>and</p><pre><code>&lt;Button   android:layout_width=""100px""  android:layout_height=""wrap_content""  android:text=""@+string/Soita""  android:id=""@+id/soita"" /&gt;</code></pre>","","Jaska","","","","2012-12-14 06:49:54","A new button to Android screen","<android><button>","3","0","","",""
"1498520","1","1499385","","2009-09-30 14:35:53","3","3279","<p>I need to implement a screen containing a list of blocks one below the other. Each block will contain mutiple superimpose elements (Images, text) for which the relative position needs to be specified with respect to the top left corner of the block.</p><p>For creating the list of blocks  i have used listview. For each  block i tried to use relative layout.This works ok when the phone is in landscape mode and absolute position is specified relative to left edge of the phone. But when the phone is put in the portrait mode the layout gets distorted. </p><p>1) What layout can be used for this scenario?</p><p>2) Can relative positions be specified in terms of percentage of screen width/height instead of pixels?</p>","181135","","","","","2009-09-30 16:52:30","Specifying relative positions in Layout?","<android><layout>","1","0","","",""
"1499258","1","","","2009-09-30 16:29:45","28","33408","<p>I want to put layout in center of the screen. </p>","181135","","507810","","2012-07-20 13:14:26","2013-05-06 06:45:01","How to center a View inside of an Android Layout?","<android><android-layout><android-view>","5","0","11","",""
"1499555","1","1503477","","2009-09-30 17:28:10","15","36565","<p>I'm really pulling my hair out over this one. Some background. I have a list of items that all have checkboxes next to them. When you deselect a checkbox, a button appears that allows you to delete the item from the list. This seems backwards at first but we only want ""selected"" items to be eligible for further processing, etc. This is my layout:</p><pre><code>&lt;RelativeLayout android:id=""@+id/rlBlahBlah""                 android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:minHeight=""?android:attr/listPreferredItemHeight""                xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;CheckBox android:text=""""             android:id=""@+id/cbDeleteItem""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:layout_gravity=""center_vertical""            android:focusable=""false""            /&gt;  &lt;TextView android:text=""""             android:id=""@+id/tvItemText""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:textSize=""14dip""            android:paddingLeft=""3dip""            android:paddingRight=""3dip""            android:paddingTop=""13dip""            android:gravity=""fill_vertical""            android:layout_toRightOf=""@id/cbDeleteItem""            /&gt;  &lt;Button android:layout_height=""wrap_content""           android:id=""@+id/btnDelete""           android:text=""Delete""           android:layout_width=""wrap_content""          android:layout_alignParentRight=""true""          android:gravity=""center_vertical""          android:focusable=""false""          /&gt;&lt;/RelativeLayout&gt;</code></pre><p>I cannot get the 3 items to center vertically in my row to save my life. <code>layout_gravity</code>, <code>gravity</code>, <code>layout_centerVertical</code>, none of it works. I'm sure my issue is some tiny setting to flip somewhere, but I'm really at wits end on this.</p><p>edit: I know the textview is ""fill_vertical"", that's some random stuff I was trying.</p>","21126","","","","","2012-06-14 13:37:30","Android layout centering in RelativeLayout for custom ListView","<java><android><listview>","6","1","2","",""
"1504140","1","1504176","","2009-10-01 14:00:20","0","2004","<p>If I have an EditText component on my screen that I have specified <code>inputType=""decimal""</code> for (i.e. a numeric/decimal field), what is the best way to convert it to an decimal value in the application code?</p><p><img src=""http://codingbone.files.wordpress.com/2009/10/android-decimal.png"" alt=""Numeric EditText"" /></p><p><a href=""http://developer.android.com/guide/practices/design/performance.html#avoidfloat"" rel=""nofollow"">Google recommends</a> avoiding <code>float</code>s, and avoiding creating objects unnecessarily (and I assume any auto-unboxing code is bad too), so I take these as my constraints. I realise a small application probably doesn't need to worry too much, but I haven't been able to find a 'best-practice' solution to this.</p><p>The most common solution appears to be this:</p><pre><code>double value = Double.parseDouble(txtInput);</code></pre>","6340","","918414","","2013-03-16 03:15:14","2013-03-16 03:15:14","Converting from a text field to an numeric in Android","<java><android><mobile><floating-point>","2","0","","",""
"1504160","1","1504365","","2009-10-01 14:03:26","14","62058","<p>Let's say I have a few buttons in a LinearLayout, 2 of them are:</p><pre><code>mycards_button = ((Button)this.findViewById(R.id.Button_MyCards));exit_button = ((Button)this.findViewById(R.id.Button_Exit));</code></pre><p>I register <code>setOnClickListener()</code> on both of them:</p><pre><code>mycards_button.setOnClickListener(this);exit_button.setOnClickListener(this);</code></pre><p>How do I make a SWITCH to differentiate between the two buttons within the Onclick ?</p><pre><code>public void onClick(View v) {  switch(?????){    case ???:      /** Start a new Activity MyCards.java */      Intent intent = new Intent(this, MyCards.class);      this.startActivity(intent);      break;    case ???:      /** AlerDialog when click on Exit */      MyAlertDialog();      break;}</code></pre>","116573","","246263","","2012-10-06 15:26:33","2013-05-28 12:20:33","Android: Use a SWITCH statement with setOnClickListener/onClick for more than 1 button?","<android><button><listener>","3","1","10","",""
"1505213","1","1505354","","2009-10-01 17:04:25","0","1072","<p>I'm trying to run the ""HelloTriangle"" example, from <a href=""http://ptgmedia.pearsoncmg.com/images/9780321502797/samplepages/0321502795%5FSample.pdf"" rel=""nofollow"">The OpenGL ES 2.0 Programming Guide</a>, in the Android emulator.  </p><p>I import egl.EGLConfig and opengles.GL10 from javax.microedition.khronos, but the <strong>ESContext</strong> type and definitions such as GL_COMPILE_STATUS and GL_FRAGMENT_SHADER can't be resolved.</p><p>I reworked the triangle example somewhat for Android in that I'm using GLSurfaceView.  I undertand that it is supposed to be used instead of OpenGLContext in the newer versions of the SDK.</p><p>Am I using a ""non-Android"" approach to OpenGL ES?  If so, what's the right one?</p>","67875","","","","","2009-10-01 17:36:38","Android OpenGL ES missing some components?","<android><opengl-es>","1","0","","",""
"1505446","1","1505485","","2009-10-01 17:51:16","5","1182","<p>What are the most easy mistakes to make that can be performance sinks on Android?</p><p>The documentation mentions ""some floating point operations"" can be ""on the order of milliseconds"" - has someone tested this?</p><p>For the sake of discussion, let's assume its running on a G1/similar device.</p>","17424","","","","","2010-02-24 07:49:36","Common performance pitfalls on Android?","<java><android><performance><optimization><dalvik>","5","0","2","",""
"1505751","1","1506425","","2009-10-01 18:46:30","34","66609","<p>I'm trying to bind data from my <code>SQLiteDatabase</code> to a <code>ListView</code>. I'm currently using a <code>SimpleCursorAdapter</code> to fill in my <code>ListView</code>. Unfortunately this doesn't seem to work with setting a CheckBox's checked attribute.</p><p>This is how I do it now; instead of changing the CheckBox's checked status the adapter is filling in the value to the text argument, so the value is displayed right of the CheckBox as text.</p><p>Java:</p><pre><code>setListAdapter( new SimpleCursorAdapter( this,      R.layout.mylist,      data,      new String[] { Datenbank.DB_STATE, Datenbank.DB_NAME },      new int[] { R.id.list_checkbox, R.id.list_text }    ) );</code></pre><p>mylist.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;CheckBox android:text=""""    android:id=""@+id/list_checkbox""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:checked=""false""    &gt;&lt;/CheckBox&gt;&lt;TextView android:text=""""    android:id=""@+id/list_text""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    &gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>Edit: The field in the database is of course of type boolean and I've also tried to assign an id to the checked field to fill the value in.</p>","182689","","1029088","","2012-11-29 08:46:52","2012-11-29 08:46:52","Android: Binding data from a database to a CheckBox in a ListView?","<android><listview><checkbox><cursor>","3","0","42","",""
"1506301","1","1508414","","2009-10-01 20:32:25","7","887","<p>I am interested in getting my feet wet in PDA/mobile development.The only two drivers for me are the drive to learn cool (or at least, new) stuff, and may be to code some app that I felt I really needed but lacked. </p><p>As such, I would like to know what the comparative benefits/downsides would be for me as a developer in choosing one of the three platforms (iPhone vs Palm Pre vs. Android - I will have access to any of the 3 but not to Windows mobile). E.g. </p><ul><li><p>What exciting new technologies I can learn? </p></li><li><p>How good the available development environments are? </p></li><li><p>What existing frameworks/libraries are available or are under active development?</p></li><li><p>How well documented the platform and APIs are?</p></li><li><p>What neat features of the platform are accessible via the APIs vs. blocked off?</p></li><li><p>Any other developer-centric considerations I missed?</p></li></ul><p>I am pretty open to either the benefits of leveraging my existing skill-set to ease the learning curve, or the benefits of learning something entirely new and cool, so while I'm curious how the platforms' development relates to my current set (recently, Perl, SQL, web development, C++ and some Java, but I'm also quite comfortable with functional programming), so it will not be a deciding point.</p><p>NOTE: This is not a duplicate of <a href=""http://stackoverflow.com/questions/1092144/what-mobile-platform-should-i-start-learning"">this question</a>, since I do not care at all about that question's data points (cost of the handheld, popularity of the platform). Also, just to be clear, my goal is not financial at all - I don't plan to make money off of such development nor directly use the skills in the area I might obtain in my career (e.g. I work on stuff that has zilch mobile exposure and will remain so). So concerns such as ""installed user base"" are pretty irrelevant. All I care about are tangible (learning) and intangible (sheer joy of it) benefits to me as a developer.</p><p>Also, <strong>please be positive and don't put down other platforms or otherwise use this as a holy platform war excuse</strong>. I have edit privileges and will mercilessly edit any un-backed-up-by-facts attacks on any platform that aren't downvoted. </p>","119280","","30461","","2009-10-02 03:55:16","2009-10-03 13:00:51","Which mobile platform would be more rewarding to learn as a developer (iPhone vs Palm Pre vs. Android)?","<iphone><android><cocoa-touch><webos><palm-pre>","7","4","1","2012-07-24 16:34:29",""
"1508158","1","","","2009-10-02 07:34:04","0","1605","<p>i am getting an image from web server (<strong>which has transparent background</strong>).now i need to save this image on my sdcard and show it to user.but when i save the image to sdcard.. it saves with a black background..i need this image with background..</p><p>i hv tried following methods to save the image ---</p><p>Method 1:</p><pre><code>Bitmap bitmap = BitmapFactory.decodeStream(is);byte[] b;ByteArrayOutputStream bytes = new ByteArrayOutputStream();bitmap.compress(Bitmap.CompressFormat.PNG, 75, bytes);b = bytes.toByteArray();	try {		File myFile = new File(""/sdcard/"" + image_id + "".jpg"");		myFile.createNewFile();		OutputStream filoutputStream = new FileOutputStream(myFile);		filoutputStream.write(b);		filoutputStream.flush();		filoutputStream.close();        }catch (IOException e) {				// TODO Auto-generated catch block				e.printStackTrace();				Log.d(""file"", ""not created"");			}</code></pre><p>Method 2:</p><pre><code>MediaStore.Images.Media.insertImage(getContentResolver(),			bitmap, ""sample"", ""image/png"");</code></pre><p>plz help...</p>","152867","","152867","","2009-10-05 15:10:44","2009-10-05 15:10:44","create a transparent image programmatically in android","<android>","1","0","","",""
"1509719","1","1510005","","2009-10-02 14:03:54","13","15475","<p>In android, how do we make the device keypad always visible in the application? The top portion displays the content the application wants to render and bottom portion displays the keypad always.</p>","77087","","","","","2014-02-19 10:56:51","Android: How to make the keypad always visible?","<android><keypad>","3","0","4","",""
"1509958","1","1513351","","2009-10-02 14:44:21","2","502","<p>I'm working on a 1.5 Android application.  Developing in Eclipse 3.4.2 on Windows XP.  I have a MapView, have requested updates, etc.</p><p>The problem is that after the first manually injected GPS coordinate, the app stops recognizing that a GPS coord has been sent.  </p><pre><code>LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);  MapController mc = mapView.getController();TextView locationText = (TextView) findViewById(R.id.LocationBar);LocationListener locationListener = new MyLocationListener(mc, itemizedOverlay, locationText);lm.requestLocationUpdates(    LocationManager.GPS_PROVIDER,     0,     0,     locationListener);</code></pre><p>Then MyLocationListener simply changes the value in a TextView to match the new GPS coordinate.</p><pre><code>public void onLocationChanged(Location loc) {		if (loc == null) {			return;		}		double lat = loc.getLatitude();        double lng = loc.getLongitude();        GeoPoint p = new GeoPoint(            (int) (lat * 1E6),             (int) (lng * 1E6));        mc.animateTo(p);        itemizedOverlay.addOverlay(new OverlayItem(p, ""title"", ""snippet""));        String location = String.format(""%f lat %f long"", lat, lng);        locationText.setText(location);	}</code></pre><p>I added some logging in the onLocationChanged method and it only ever sees a Location the <em>first</em> time that I attempt to send an update.  All subsequent ones don't fire the onLocationChanged method.</p><p>Additional info:</p><p>The logcat output is as follows:</p><pre><code>10-02 17:22:34.423: INFO/gps(6671): Provider gps is has status changed to 1. Extras: Bundle[mParcelledData.dataSize=52]</code></pre><p>First GPS update is faked:</p><pre><code>10-02 17:22:49.383: INFO/gps(6671): Location provided by location provider: Location[mProvider=gps,mTime=-1000,mLatitude=25.0,mLongitude=23.0,mHasAltitude=true,mAltitude=0.0,mHasSpeed=false,mSpeed=0.0,mHasBearing=false,mBearing=0.0,mHasAccuracy=false,mAccuracy=0.0,mExtras=Bundle[mParcelledData.dataSize=52]]10-02 17:22:49.444: INFO/gps(6671): Provider gps is has status changed to 2. Extras: Bundle[mParcelledData.dataSize=52]</code></pre><p>According to <a href=""http://developer.android.com/reference/android/location/LocationProvider.html#AVAILABLE"" rel=""nofollow"">http://developer.android.com/reference/android/location/LocationProvider.html#AVAILABLE</a> , that 2 maps to ""Available"".</p><p>As soon as that ""Available"" gets set, no other locations get passed through.  Seems a bit counterintuitive.</p>","155392","","155392","","2009-10-02 17:29:11","2009-10-03 09:42:13","Manually added location updates stop working in Eclipse","<android><eclipse>","1","1","2","",""
"1510840","1","1511159","","2009-10-02 17:20:32","61","67632","<p>I'm working on an Android application that stores data in a SQLite database.  My question is, where does this database file get stored on the filesystem when you're using an emulator?</p><p>I have seen that it's stored in </p><p><code>/data/data/package_name/databases</code></p><p>but I need to know where on my local machine's hard drive that actually maps to.  The database persists on multiple runs of the emulator, even after having shut down the machine, so it can't just reside in RAM...</p>","155392","","","","","2014-03-10 23:19:09","Where does Android emulator store SQLite database?","<android><sqlite>","5","0","32","",""
"1512045","1","1512263","","2009-10-02 22:12:44","132","121202","<p>I have an application that I just would like to use in portrait mode, so I have definedandroid:screenOrientation=""portrait"" in the manifest XML. This works OK for the HTC magic phone (and prevents orientation changes on other phones as well). </p><p>But I have a problem with the HTC G1 phone as i open the hardware qwerty keyboard (not the virtual keyboard). My activity stays in portrait mode, but seems to get restarted and loses all its states. This does not happen with the hero version.</p><p>My application is quite big so I don't want it to restart and lose all its states when the keyboard is opened. Any idea on how I can prevent that?</p>","133858","","844882","","2012-07-02 03:58:49","2013-07-30 17:40:57","How to disable orientation change in Android?","<android><orientation><android-activity><restart>","10","2","54","",""
"1513485","1","1513569","","2009-10-03 10:59:06","195","273840","<p>I need to get my current location using GPS programmatically. How do I do that?</p>","152867","","356895","","2012-01-04 15:38:00","2014-03-16 12:05:48","How do I get the current GPS location programmatically in Android?","<android><geolocation><gps><location>","9","3","136","",""
"1516173","1","1516244","","2009-10-04 11:14:57","3","1022","<p>How can I edit an SQLite database after it has been created and stored on my phone together with the corresponding app? I want to add a new column to the database but I can't figure out how. Is it possible to do this via the adb shell or maybe eclipse? Or in code?</p><p>I tried to just update my db-adapter class, but then the app fails at compile time with the following Exception:</p><pre><code>android.database.sqlite.SQLiteException: No such columns &lt;column_I_want_to_add&gt;</code></pre><p>Simply removing and reinstalling the app won't work either.</p><p>Here's a link to my db-adapter class if it's of any help. The column I'm trying to add is the MILLIS_COLUMN. <a href=""http://www.pastie.org/private/9ciezcuv0pc8zeuseaxoga"" rel=""nofollow"">Pastie link.</a></p><p>Linus</p>","91098","","","","","2009-10-04 14:02:21","Edit application database in android","<android><sqlite><adb>","1","1","1","",""
"1516211","1","1516220","","2009-10-04 11:47:37","7","19272","<p>I created a broadcast receiver in the main activity and the background service which is sending broadcast intents. The application crashes each time I try to run it and the Log displays the following error message:</p><blockquote>  <p>10-04 13:30:43.218:  ERROR/AndroidRuntime(695):  java.lang.RuntimeException: Error  receiving broadcast Intent {  action=com.client.gaitlink.CommunicationService.action.LOGIN_STATUS_UPDATE  (has extras) } in  com.client.gaitlink.GaitLink$LoginStatusReceiver@431690e8</p></blockquote><p>The broadcast message is sent from CommunicationService class in the following method:</p><pre><code>private void announceLoginStatus(){    Intent intent = new Intent(LOGIN_STATUS_UPDATE);    intent.putExtra(SERVER_MESSAGE, mServerResponseMessage);    intent.putExtra(SESSION_STRING, mSessionString);    sendBroadcast(intent);}</code></pre><p>where </p><pre><code>String LOGIN_STATUS_UPDATE = ""com.client.gaitlink.CommunicationService.action.LOGIN_STATUS_UPDATE""</code></pre><p>in the main activity the following broadcast reveiver is defined:</p><pre><code>public class LoginStatusReceiver extends BroadcastReceiver {        public void onReceive(Context context, Intent intent) {            String serverMessage = intent.getStringExtra(CommunicationService.SERVER_MESSAGE);            String sessionString = intent.getStringExtra(CommunicationService.SESSION_STRING);            userInfo.setSessionString(sessionString);            saveSettings();        }    }</code></pre><p>and registered in onResume method:</p><pre><code>        IntentFilter loginStatusFilter;        loginStatusFilter = new IntentFilter(CommunicationService.LOGIN_STATUS_UPDATE);        loginStatusReceiver = new LoginStatusReceiver();        registerReceiver(loginStatusReceiver, loginStatusFilter);</code></pre><p>And the manifest file includes the following:</p><pre><code>&lt;activity android:name="".GaitLink""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            ...            &lt;action android:name=""com.client.gaitlink.CommunicationService.action.LOGIN_STATUS_UPDATE"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>I would really appreciate if anyone could explain why the Log displays the message above and the application crashes.</p><p>Thanks!</p>","22996","","","","","2014-01-13 04:52:14","Error Receiving Broadcast Intent Problem","<android><android-intent><broadcastreceiver>","6","0","","",""
"1517016","1","1517122","","2009-10-04 18:11:20","2","605","<p>I have a small application which can be used to set reminders for future events. The app uses an AlarmManager to set the time for when the user should be reminded. When the alarm goes off, a BroadcastReceiver registers this and in turn starts a service to notify the user via a toast and a notification in the status bar.</p><p>In order to display the correct information in the notification and toast, some extra information is passed along with the intent. The first time a reminder is registered, the info received by the BroadcastReceiver and passed on to the service is correct. But for each following reminder (i.e. each new intent received by the BroadcastReceiver) this information stays the same even when the information sent is different.</p><p>As an example, if the string ""foo"" is put as an extra with the first intent, ""foo"" is correctly extracted by the BroadcastReceiver. If ""bar"" is put as an extra in the second intent, ""foo"" is still extracted by the BroadcastReceiver. </p><p>This is the code that registers the alarm and passes the intent (main ui-class):</p><pre><code>Intent intent = new Intent(ACTION_SET_ALARM);intent.putExtra(""desc"", desc);intent.putExtra(""time"", time);intent.putExtra(""dbId"", dbId);intent.putExtra(""millis"", millis);PendingIntent pIntent = PendingIntent.getBroadcast(quickAlert.this, 0, intent, 0);// Schedule the alarm!AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);am.set(AlarmManager.RTC_WAKEUP, millis, pIntent);</code></pre><p>The onReceive()-method in the BroadcastReceiver class:</p><pre><code>@Overridepublic void onReceive(Context context, Intent intent) {	Intent i = new Intent(context, AlertService.class);	String desc = intent.getStringExtra(""desc"").equals("""") ? """": "": "" + intent.getStringExtra(""desc"");	String time = intent.getStringExtra(""time"");	long dbId = intent.getLongExtra(""dbId"", -1);	long millis = intent.getLongExtra(""millis"", -1);	i.putExtra(""desc"", desc);	i.putExtra(""time"", time);	i.putExtra(""dbId"", dbId);	i.putExtra(""millis"", millis);	Log.d(TAG, ""AlertReceiver: "" + desc + "", "" + time + "", "" + dbId + "", "" + millis);	Toast.makeText(context, ""Reminder: "" + desc, Toast.LENGTH_LONG).show();	context.startService(i);}</code></pre><p>The intent-filter in the manifest:</p><pre><code>&lt;receiver android:name="".AlertReceiver""&gt;        &lt;intent-filter&gt;        	&lt;action android:name=""com.aspartame.quickAlert.ACTION_SET_ALARM"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;</code></pre><p>I've been stuck with this for some time now, so help is very much appreciated!</p>","91098","","","","","2011-08-10 01:03:37","Incorrect extras received with all intents but the first one","<android><android-intent><broadcastreceiver>","2","0","","",""
"1517312","1","1517604","","2009-10-04 20:35:01","1","3765","<p>I've been looking everywhere to see if there is a standard way of achieving this but I find a different solution everytime. Basically, I am trying to build a Custom ListView with an image and two-three lines of text besides it. In order to optimize it, I understand that the following have to be used:</p><ol><li>convertView: Basically if the view was already inflated, use it</li><li>Lazy-Loading: Do not load the content of the rows until they are called for</li><li>Background Downloading &amp; Caching: Download images in their own threads and then update the row (and possible cache them?)</li></ol><p>I could manage 1 and 2 but the third one is really confusing me. Is there a best practice for this?</p><p>Thanks</p>","184046","","","","","2010-01-10 16:44:09","Android: How to optimize ListView with ImageView + 3 TextViews?","<android>","2","0","","",""
"1517372","1","1519428","","2009-10-04 20:59:23","1","680","<p>I'd like to use python scripts as plugins for an app I'm developing. This seems to be possible by interacting with android-scripting-environment (ASE), as is done by Locale, but I haven't found any documentation about this. How you execute ASE scripts from your own app?</p>","51647","","51647","","2009-10-05 13:52:42","2009-10-05 13:52:42","How can I interact with the android scripting environment from an android app?","<python><android><ase><android-scripting>","1","2","0","",""
"1517532","1","1517558","","2009-10-04 22:17:54","1","561","<p>I never designed UIs (more of a middleware guy) before so I apologize if the question is stupid. I am designing a UI to look something like the following: </p><blockquote>  <p><hr /></p>    <h2>ImageView    ImageView </h2>    <p>TabHost </p>    <h2>Tab 0 ------ Tab 1 ------ Tab 2 </h2>    <h2>-----INSIDE EACH TAB----- </h2>    <p>TextView </p>    <p>ListView </p>    <h2>    - Consists of ImageView   TextView </h2>    <p><hr /></p></blockquote><p>The problem is I think I am following a very inefficient way of doing the whole stuff. The onCreate method is as follows:</p><p>CODE:</p><pre><code>public void onCreate(Bundle savedInstanceState) {           super.onCreate(savedInstanceState);           setContentView(R.layout.main);           TabHost mTabHost = getTabHost();           Drawable Tab1Icon = getResources().getDrawable(R.drawable.tab1_icon);           Drawable Tab2Icon = getResources().getDrawable(R.drawable.tab2_icon);           Drawable Tab3Icon = getResources().getDrawable(R.drawable.tab3_icon);           mTabHost.addTab(mTabHost.newTabSpec(""Tab1"").setIndicator(""Tab 1"", Tab1Icon).setContent(new Intent(this, Tab1.class)));           mTabHost.addTab(mTabHost.newTabSpec(""Tab2"").setIndicator(""Tab 2"", Tab1Icon).setContent(new Intent(this, Tab2.class)));           mTabHost.addTab(mTabHost.newTabSpec(""Tab3"").setIndicator(""Tab 3"", Tab1Icon).setContent(new Intent(this, Tab3.class)));           mTabHost.setCurrentTab(0);      }</code></pre><p>This program crashes on CupCake (v1.5) complaining about StackOverflowException but runs well on Donut (v1.6). This is my main.xml: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:orientation=""vertical""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:background=""@color/application_background""     &gt;     &lt;TableLayout                android:id=""@+id/TableLayout01""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:stretchColumns=""0""                android:background=""@color/application_background""&gt;           &lt;TableRow&gt;                &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""               android:orientation=""horizontal""               android:layout_width=""fill_parent""               android:layout_height=""fill_parent""&gt;                &lt;ImageView id=""@+id/picview1""                   android:layout_width=""wrap_content""                   android:layout_height=""wrap_content""                   android:src=""@drawable/leftlogo""                   android:paddingRight=""105sp""                 /&gt;                 &lt;Button                     android:id=""@+id/picview2""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:background=""@drawable/rightlogo""                    /&gt;           &lt;/LinearLayout&gt;           &lt;/TableRow&gt;           &lt;TableRow&gt;                &lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""                    android:id=""@android:id/tabhost""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""&gt;                    &lt;LinearLayout                        android:orientation=""vertical""                        android:layout_width=""fill_parent""                        android:layout_height=""fill_parent""&gt;                        &lt;TabWidget                            android:id=""@android:id/tabs""                            android:layout_width=""fill_parent""                            android:layout_height=""wrap_content"" /&gt;                        &lt;FrameLayout                            android:id=""@android:id/tabcontent""                            android:layout_width=""fill_parent""                            android:layout_height=""fill_parent""&gt;                     &lt;/FrameLayout&gt;                    &lt;/LinearLayout&gt;                &lt;/TabHost&gt;           &lt;/TableRow&gt;      &lt;/TableLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>Any suggestions regarding the design please? </p><p>Thanks</p>","184046","","","","","2009-10-04 22:26:12","Android: Anyone wants to take a shot at suggesting a better layout?","<android>","1","0","","",""
"1517654","1","","","2009-10-04 23:06:12","2","2795","<p>I am not able to detect when outgoing call has been answered, I have registered BroadcastReceiver for PHONE_STATE broadcast, but onReceive() gets called only when number is dialed and when call has ended.</p><p>Edit: If it is not possible with current API (1.5 or 1.6) please enlighten me ?</p>","103176","","103176","","2009-10-11 22:32:42","2014-02-17 08:22:49","How can I detect when outgoing call has been accepted (answered)","<android><telephony>","2","2","2","",""
"1518154","1","1518486","","2009-10-05 03:29:36","6","4237","<p>In google's Calendar app for Android OS, you will encounter this line in the onCreate method of <a href=""http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/2.3.7_r1/com/android/calendar/CalendarActivity.java#CalendarActivity"" rel=""nofollow"">CalendarActivity</a>.</p><pre><code>// Eliminate extra GCs during startup by setting the initial heap size to 4MB.VMRuntime.getRuntime().setMinimumHeapSize(INITIAL_HEAP_SIZE)</code></pre><p>Can someone explain why setting it to 4MB will eliminate GCs?</p>","27328","","1777090","","2013-01-21 07:15:22","2013-01-21 07:15:22","What is the objective of setting the minimum heap size in an android app?","<java><android><mobile>","1","0","12","",""
"1518338","1","","","2009-10-05 05:06:16","14","19036","<p>I have Implemented a custom <code>ListView</code> by extending <code>LinearLayout</code> for every row. Every row has a small thumbnail, a text and a <code>check box</code>. The <code>list view</code> is deployed properly and I can scroll and fling through it without any problems. </p><p>But The <code>ListView</code> doesn't seem to respond to the <code>setOnItemClickListener()</code> at all, So I had to find a workaround by setting click listener in the <code>getView()</code> of the Text inside every row which is obviously creating problem when I am trying to reuse the <code>adapter</code>. Does anyone have a solution?</p>","184150","","2169012","","2013-06-05 10:43:57","2013-06-05 10:43:57","setOnItemClickListener() not working on custom ListView @ Android","<android><listview>","4","0","7","",""
"1520503","1","","","2009-10-05 14:40:11","3","3842","<p>I'm trying to run the Webkit Layout Tests on the Android emulator using the command line shell in Ubuntu 9.04.<code><pre>adb -s emulator-5554 shell am instrument -w \com.android.dumprendertree/com.android.dumprendertree.LayoutTestsAutoRunner</pre></code></p><p>I get this error:</p><pre><code>INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: ComponentInfo{com.android.dumprendertree/com.android.dumprendertree.LayoutTestsAutoRunner}</code></pre><p>I found that you need to use development/testrunner/runtest.py to push tests in android/frameworks/base/tests.</p><p>I've tried this to push the AndroidTests:<code><pre>. ./build/envsetup.sh emulator&amp;./development/testrunner/runtest.py android</pre></code></p><p>But it gives me this error:</p><pre><code>Error: ANDROID_PRODUCT_OUT not defined. Please run envsetup.sh</code></pre><p>I did run envsetup.sh! Anyone know how to do this?</p>","184413","","184413","","2009-10-05 14:53:21","2010-02-25 16:41:13","How do you push Android Instrumentation Tests to Emulator/Device?","<android><webkit>","2","1","4","",""
"1520887","1","3039718","","2009-10-05 15:50:13","96","196494","<p>I want to make a pause between two lines of code, Let me explain a bit : </p><p>-> the user clicks a button (a card in fact) and I show it by changing the background of this button : </p><pre><code>thisbutton.setBackgroundResource(R.drawable.icon);</code></pre><p>-> after let's say 1 second, I need to go back to the previous stade of the button by changing back its background : </p><pre><code>thisbutton.setBackgroundResource(R.drawable.defaultcard);</code></pre><p>-> I've tried to pause the thread between these two lines of code with :</p><pre><code>try {Thread.sleep(1000);                } catch (InterruptedException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }</code></pre><p>but It does not work. Maybe it's the process and not the Thread that I need to pause ??</p><p>What is the best solution to implement this ?</p><p>Many txs for your help.</p><p>H.</p><p>I've tried (but it doesn't work ?)</p><pre><code>new Reminder(5);</code></pre><p>with :</p><pre><code>public class Reminder {Timer timer;        public Reminder(int seconds) {            timer = new Timer();            timer.schedule(new RemindTask(), seconds*1000);        }        class RemindTask extends TimerTask {            public void run() {                System.out.format(""Time's up!%n"");                timer.cancel(); //Terminate the timer thread            }        }      }</code></pre>","116573","","116573","","2010-03-07 05:44:08","2014-01-31 21:14:42","How to pause / sleep thread or process in Android?","<android><process><multithreading>","7","2","45","",""
"1521317","1","1522047","","2009-10-05 17:20:28","1","3232","<p>Im wondering if there is a way to call gc from code, hopefully to free some memory...</p>","133858","","","","","2009-10-05 19:53:12","Is it possible to call GC in Android?","<android><memory>","1","0","","",""
"1521608","1","1522520","","2009-10-05 18:19:29","10","8057","<p>Does anybody have any advice, experience, suggestions? I'm prettycomfortable with Google plugin - what would make me change to MOTODEV?Needless to say - I will download and play with it but I'm alsointerested in fellow developer's feedback. </p>","135946","","","","","2011-01-29 15:15:20","MOTODEV Studio vs. Android Google plugin","<android><ide><comparison>","3","2","4","2012-07-24 16:34:17",""
"1521640","1","1726352","","2009-10-05 18:23:30","401","232520","<p>I'd like to change the color of a standard Android button slightly in order to better match a client's branding.  For example, see the ""Find a Table"" button for the OpenTable application:</p><p><img src=""http://img.skitch.com/20091005-bhadhc9e1e4uigqn9ca513cu8k.png"" alt=""alt text"" /></p><p>The best way I've found to do this so far is to change the <code>Button</code>'s drawable to the following drawable located in <code>res/drawable/red_button.xml</code>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_pressed=""true"" android:drawable=""@drawable/red_button_pressed"" /&gt;    &lt;item android:state_focused=""true"" android:drawable=""@drawable/red_button_focus"" /&gt;    &lt;item android:drawable=""@drawable/red_button_rest"" /&gt;&lt;/selector&gt;</code></pre><p>But doing that requires that I actually create three different drawables for each button I want to customize (one for the button at rest, one when focused, and one when pressed).  That seems more complicated and non-DRY than I need.</p><p>All I really want to do is apply some sort of color transform to the button.  Is there an easier way to go about changing a button's color than I'm doing?</p>","82156","","","","","2014-03-01 06:31:52","Standard Android Button with a different color","<android><layout><drawable>","8","1","312","",""
"1521750","1","1521990","","2009-10-05 18:49:13","1","868","<p>How can I launch an android activity via a specified class name of an activity?.</p>","125440","","1777090","","2013-01-28 07:16:44","2013-01-28 07:16:44","Launching an android activity via a class name","<android>","1","0","","",""
"1523156","1","1523211","","2009-10-06 01:10:40","1","325","<p>is it possible to mount another usb device x to gphone and then create a program that communites to x on the usb port?  X is used for capturing data and gphone will be used for analysis/display.thanks</p>","121196","","114066","","2012-01-20 13:39:46","2012-01-20 13:39:46","attaching usb device to android gphone host","<android>","1","0","","",""
"1523784","1","","","2009-10-06 05:43:57","7","7120","<p>Can any one tell me how to make page turn effect in Android?<br>Can any one please provide me some code snippet.</p>","132724","","617750","","2011-03-03 15:23:18","2011-03-03 15:23:18","How to make page turning effect in Android?","<android><animation><effects>","1","2","7","",""
"1524111","1","","","2009-10-06 07:39:54","1","1523","<p>I tried to make an Android program where I can call a single number by clicking button. Works fine but as I end calling, the emulator shows call log. Instead of this I would that my program returns to the screen where is that calling button I made. How can I do this? My code is now like this</p><pre><code>((Button) findViewById(R.id.soita)).setOnClickListener(    		new Button.OnClickListener() {    			@Override public void onClick(View arg0) {String nro=""9999999"";Intent intent1 = new Intent(Intent.ACTION_CALL,Uri.parse(""tel:""+nro));startActivity(intent1);Intent intent2 = new Intent(Intent.CATEGORY_HOME);startActivity(intent2);</code></pre>","","Jaska","881229","","2014-02-25 01:36:41","2014-02-25 01:36:41","Android ending call and going to home screen","<android>","1","1","1","",""
"1526831","1","1528015","","2009-10-06 16:59:44","10","22590","<p>I have several ListViews in a LinearLayout.  It's listing things by day, so I have a TextView containing ""Sunday:"" followed by a list of items, followed by a ""Monday"" TextView, etc.  Works great, but doesn't fit in the screen.  So I added a ScrollView as a parent of the LinearLayout.  Now it scrolls, but the ListViews all have room for 2 entries, whether they have 0 or 3 entries.  Something about adding the ScrollView parent caused the ListViews to not size dynamically.  I tried calling requestLayout() on the ScrollView after the list adapters had filled their views, but that didn't do anything.  Any ideas?</p><p>Edit:From <a href=""http://www.anddev.org/viewtopic.php?p=25194"">http://www.anddev.org/viewtopic.php?p=25194</a> and other links it seems that ListViews inside a ScrollView are not handled correctly.  Anyone have a good suggestion for implementing a list-of-lists?</p>","105878","","105878","","2009-10-06 17:48:33","2011-06-29 14:47:38","Android ScrollView layout problem","<android><scrollview>","3","3","5","",""
"1528988","1","","","2009-10-07 01:02:49","8","26323","<p>I'm trying to create a TableLayout programatically. It just won't work. The same layout in an xml file works though. This is what I have:</p><pre><code>public class MyTable extends TableLayout{    public MyTable(Context context) {        super(context);        setLayoutParams(new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));        TableRow row = new TableRow(context);        row.setLayoutParams(new TableRow.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));        Button b = new Button(getContext());        b.setText(""hello"");        b.setLayoutParams(new LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT));        row.addView(b);         addView(row)    }}...// In main activity:MyTable table = new MyTable(this);mainLayout.addView(table);</code></pre><p>When I run this, I don't get a crash, but nothing appears. If I get rid of the TableRow instance, at least the button does appear as a direct child of the TableLayout. What am I doing wrong?</p><p>Thanks</p>","185329","","","","","2014-01-11 06:39:13","Create TableLayout programatically","<android><tablelayout>","4","0","2","",""
"1529068","1","1533512","","2009-10-07 01:33:34","260","104487","<p>Is it possible to set multiple styles for different pieces of text inside a TextView?</p><p>For instance, I am setting the text as follows:</p><pre><code>tv.setText(line1 + ""\n"" + line2 + ""\n"" + word1 + ""\t"" + word2 + ""\t"" + word3);</code></pre><p>Is it possible to have a different style for each text element? E.g., line1 bold, word1 italic, etc.</p><p>The developer guide's <a href=""http://developer.android.com/guide/faq/commontasks.html"">Common Tasks and How to Do Them in Android</a> includes <a href=""http://developer.android.com/guide/faq/commontasks.html#selectingtext"">Selecting, Highlighting, or Styling Portions of Text</a>:</p><blockquote><pre><code>// Get our EditText object.EditText vw = (EditText)findViewById(R.id.text);// Set the EditText's text.vw.setText(""Italic, highlighted, bold."");// If this were just a TextView, we could do:// vw.setText(""Italic, highlighted, bold."", TextView.BufferType.SPANNABLE);// to force it to use Spannable storage so styles can be attached.// Or we could specify that in the XML.// Get the EditText's internal text storageSpannable str = vw.getText();// Create our span sections, and assign a format to each.str.setSpan(new StyleSpan(android.graphics.Typeface.ITALIC), 0, 7, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);str.setSpan(new BackgroundColorSpan(0xFFFFFF00), 8, 19, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);str.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 21, str.length() - 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);</code></pre></blockquote><p>But that uses explicit position numbers inside the text. Is there a cleaner way to do this?</p>","184046","","85950","","2012-10-24 00:59:51","2013-12-09 11:17:47","Is it possible to have multiple styles inside a TextView?","<android><styles><textview>","8","2","135","",""
"1529766","1","1529804","","2009-10-07 06:02:27","1","651","<p>Is there a way to control the optimization level of the java compiler that Eclipse uses when building a project?Or is this question not relevant anymore, is all optimization deferred to the vm?</p><p>The reason I'm asking is that I recently wrote a quick test doing this:</p><pre><code>private static int test_f(int i) { return i * 42; }...int z = 41;for(int i = 0; i &lt; 10000; ++i) { z = z*42; }         // this loop runs in X secondsfor(int i = 0; i &lt; 10000; ++i) { z = test_f(z); }    // this loop runs in 10*X seconds</code></pre><p>The results of this tests imples test_f() is not being inlined, even though it reallyis a prime candidate for it. It should also be possible to do this inlining at compile time.</p><p>The environment/target vm is Android/Dalvik.</p><p>UPDATE:I investigated this further, and it turns out Dalvik doesn't do inlining at this date.</p>","17424","","17424","","2009-10-07 18:21:26","2009-10-07 18:21:26","Controlling compiler options in Eclipse","<java><android><eclipse><optimization><virtual-machine>","1","0","1","",""
"1530229","1","1530651","","2009-10-07 08:15:34","0","1240","<p>I've an application which receives and sends data (JSON) from/to a HTTP server via HTTP POST requests. There is not really any payload except of a few strings, so I'm wondering if it would make sense to build this whole HTTP communication as an <a href=""http://developer.android.com/reference/android/app/Service.html"" rel=""nofollow"">Android Service</a> or just to create a separate thread within my application?</p>","184367","","","","","2009-10-07 10:05:29","Android: HTTP/JSON communication within application or separate thread?","<android><json><http><service><multithreading>","1","0","2","",""
"1530239","1","","","2009-10-07 08:19:45","0","2220","<p>I want to learn mobile programming, specifically Android or iPhone programming, but not sure if it is necessary to learn J2ME before working with Android or iPhone. I know only core Java (and OOP concepts very well).</p><p>I need your suggestion, especially if any one working in mobile development field.Hoping for favorable reply...!Thanks. </p>","128647","","56285","","2009-10-07 08:25:56","2009-10-07 18:14:39","It it necessary to learn J2ME for Android or iPhone development?","<java><iphone><android><java-me><mobile>","6","2","1","2012-08-01 14:01:58",""
"1530288","1","","","2009-10-07 08:32:25","0","68","<p>My custom ViewGroup expects a certain number of strings for an array specified in arrays.xml. I want the app to stop if that condition is not met. What is the best practice for this? Should I just throw an IllegalStateException from the ViewGroup constructor ?</p><pre><code>public MyViewGroup( Context context, AttributeSet attrs ){    super( context, attrs );    if( getResources().getStringArray( R.array.carousellabels ).length != 7 )        throw new IllegalStateException( ""There must exactly 7 items for              array resource R.array.carousellabels"" );}</code></pre>","27328","","","","","2009-10-08 04:32:32","Aborting ViewGroup if a condition is not met?","<java><android><mobile><android-widget>","1","0","","",""
"1532759","1","1532799","","2009-10-07 16:35:52","3","544","<p>I have been an avid fan of lazy loading but yesterday I was talking with a fellow programmer who showed me another application and expressed how happy he was about the initial waiting time that the application takes (Android Marketplace to be precise) to load up the list and allow him to scroll smoothly than implement lazy loading and make his life miserable...</p><p>Though I can get lazy loading to work using background downloading of images to make the whole feel uninterrupted, I still am not sure which is the preferred design methodology... Any suggestions?</p>","184046","","","","","2009-10-07 19:34:59","Android: Which is a better design choice? Lazy Loading or Initial Waiting Time?","<android><user-interface><lazy-loading>","2","0","1","",""
"1532876","1","1533089","","2009-10-07 16:56:31","246","219461","<p>I'm trying to have an image (as the background) on a button and add dynamically, depending on what's happening during run-time, some text above/over the image.</p><p>If I use <strong>ImageButton</strong> I don't even have the possibility to add text.If I use <strong>Button</strong> I can add text but only define an image with <em>android:drawableBottom</em> and similar XML attributes as defined <a href=""http://developer.android.com/reference/android/widget/TextView.html#attr_android%3adrawableBottom"">here</a>.</p><p>However these attributes only combine text &amp; image in x- and y-dimensions, meaning I can draw an image around my text, but not below/under my text (with the z-axis defined as coming out of the display).</p><p>Any suggestions on how to do this? One idea would be to either extend <strong>Button</strong> or <strong>ImageButton</strong> and override the <code>draw()</code>-method. But with my current level of knowledge I don't really know how to do this (2D rendering). Maybe someone with more experience knows a solution or at least some pointers to start?</p>","184367","","948041","","2012-06-12 10:58:17","2013-12-17 08:23:22","Android: combining text & image on a Button or ImageButton","<android><image><text><button>","10","0","110","",""
"1533038","1","1533412","","2009-10-07 17:24:33","74","57128","<p>I'm attempting to override the default <code>ToggleButton</code> appearance. Here's the XML that defines the <code>ToggleButton</code>:</p><pre><code>&lt;ToggleButton android:id=""@+id/FollowAndCenterButton""        android:layout_width=""30px""        android:layout_height=""30px""        android:textOn="""" android:textOff="""" android:layout_alignParentLeft=""true""        android:layout_marginLeft=""5px""        android:layout_marginTop=""5px"" android:background=""@drawable/locate_me""/&gt;</code></pre><p>Now, we have two 30 x 30 icons we want to use for the clicked/non-clicked states. Right now we have code that programmatically changes the background icon depending on the state:</p><pre><code>centeredOnLocation.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            if (centeredOnLocation.isChecked()) {                centeredOnLocation.setBackgroundDrawable(getResources().getDrawable(R.drawable.locate_me_on));            } else {                centeredOnLocation.setBackgroundDrawable(getResources().getDrawable(R.drawable.locate_me));            }        }});</code></pre><p>Obviously I'm looking for a better way to do this. I've tried to make a selector for the background image, which would automatically switch between the states:</p><pre><code> &lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;item android:drawable=""@drawable/locate_me"" /&gt; &lt;!-- default --&gt; &lt;item android:state_checked=""true""       android:drawable=""@drawable/locate_me_on"" /&gt; &lt;!-- pressed --&gt; &lt;item android:state_checked=""false""       android:drawable=""@drawable/locate_me"" /&gt; &lt;!-- unchecked --&gt;</code></pre><p></p><p>But this does not work; reading the <code>ToggleButton</code> API (<a href=""http://developer.android.com/reference/android/widget/ToggleButton.html"">http://developer.android.com/reference/android/widget/ToggleButton.html</a>), it appears that the only inherited xml attributes are</p><pre><code>    XML AttributesAttribute Name  Related Method  Descriptionandroid:disabledAlpha       The alpha to apply to the indicator when disabled. android:textOff         The text for the button when it is not checked. android:textOn      The text for the button when it is checked. </code></pre><p>There does not seem to be the android:state_checked attribute, despite the class having the method <code>isChecked()</code> and <code>setChecked()</code>.</p><p>So, is there a way to do what I want in XML, or am I stuck with my messy workaround?</p>","155392","","1639356","","2013-04-30 14:59:07","2013-04-30 14:59:07","Android: Specify two different images for togglebutton using XML","<java><android><xml><togglebutton>","1","2","32","",""
"1533340","1","1534414","","2009-10-07 18:25:17","2","942","<p>Is there a way to use m4 macros when developing in Java for Eclipse, ie. making sure the preprocessor is automatically invoked before Eclipse compiles?</p><p>Or has anyone used another preprocessor successfully with Eclipse?</p>","17424","","","","","2012-05-09 01:25:54","Using m4 macros with Eclipse & Java","<java><android><eclipse><m4>","2","0","","",""
"1533377","1","1541530","","2009-10-07 18:32:35","4","5635","<p>For some reason, whenever I scroll through my list of items, the background inside my listview disappears and reappears giving rise to a ""flicker"" effect which I don't really want. I've tried the suggestion at: <a href=""http://stackoverflow.com/questions/1377336/android-make-listview-transparent"">http://stackoverflow.com/questions/1377336/android-make-listview-transparent</a> but it doesn't work for some reason. Any suggestions?</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/screenLayout""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/background""    &gt;        &lt;TextView        	android:layout_width=""fill_parent""        	android:layout_height=""wrap_content""        	android:gravity=""center""        	android:background=""@color/title_background""        	android:text=""@string/whatsnew_title""        	&gt;       	&lt;/TextView&gt;       	&lt;ListView    		android:id=""@android:id/list""    		android:layout_width=""fill_parent""    		android:layout_height=""fill_parent""    		&gt;    	&lt;/ListView&gt; 	&lt;/LinearLayout&gt;</code></pre>","184046","","","","","2012-10-09 20:56:12","Android: ListView Flicker effect. Any hints on how to get rid of this?","<android><listview><transparent><flicker>","3","0","1","",""
"1533753","1","1534212","","2009-10-07 19:42:37","1","4219","<p>I would if anyone can help.. I am coming from a c# background so i have the syntax basics of java and i following the hello world tutorial which has 1 activity (inherits from Activity) which basically shows my view like so</p><pre><code>     setContentView(R.layout.main);</code></pre><p>So what i wanted to do (by viewing a tutorial) is create a menu by implementing (override) this method</p><pre><code>     onCreateOptionsMenu</code></pre><p>but my activity class inherits Activity and it seems that this is not available in the superclass..</p><p>I am a little confused, can i create more than 1 Activity class? hence should i create a Menus Activity class that inherits from a different superclass?</p><p>If this is the case how would i call the new activity class i have created from my </p><pre><code>     public void onCreate</code></pre><p>which is implemented on my main activity class that inherits Activity.</p><p>I am a little confused and i can't seem to find any concrete info with regards to this.</p><p>Any ideas?</p><p>Here is my simple activity class (its basically shows the view)</p><pre><code>public class DGAdmin extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    //TextView tv = new TextView(this);    //tv.setText(""Hello, Android"");    //setContentView(tv);}</code></pre><p>}</p>","85040","","","","","2011-10-08 15:25:27","Android: Error in using onCreateOptionsMenu, not available in superclass?","<android>","1","0","","",""
"1534522","1","1536968","","2009-10-07 22:10:04","0","2511","<p>I have made an BaseAdapter that does not show the onclick effect on the rows when the items get selected (orange background).</p><p>Im wondering what is needed to make the OnClickedItem effect appear. I tried to set the OnItemClickListener on the list, but it did not help.</p><p>here is my code:</p><pre><code>    private class MyAdapter extends BaseAdapter{      private Bingo activity;  public MyAdapter(Bingo context){   this.activity = context;   items = new ArrayList&lt;String&gt;();  }  public void add(String item){   items.add(item);   notifyDataSetChanged();  }  public void clear(){   items.clear();   notifyDataSetChanged();  }  private ArrayList&lt;String&gt; items;  public int getCount() {   return items.size();  }  public Object getItem(int position) {   return items.get(position);  }  public long getItemId(int position) {   return position;  }  public boolean isEnabled(int position){   return true;  }  public View getView(int position, View convertView, ViewGroup parent) {   if(position == getCount() - 5 &amp;&amp; getCount() &lt; 100){    Log.d(""dbg"",""Autoadding..."");    activity.add();   }   View view = null;            if (convertView == null) {             Log.i(""dbg"",""new:""+position);             view = View.inflate(activity, R.layout.item, null);            }            else {             Log.i(""dbg"",""recycle:""+position);             view = convertView;            }            TextView text = (TextView)view.findViewById(R.id.text);            text.setText(items.get(position)+"" -------&gt; pos:""+position);   return view;  } }</code></pre><p>item.xml that is inflated...</p><pre><code>LinearLayoutandroid:id=""@+id/root"" android:orientation=""horizontal""android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" ImageView  android:id=""@+id/image""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:scaleType=""fitXY""  android:layout_marginRight=""10dp""  android:src=""@drawable/icon"" LinearLayout android:orientation=""horizontal""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:gravity=""right""  TextView   android:id=""@+id/text""   android:layout_width=""wrap_content""  android:layout_height=""wrap_content""   android:textColor=""#FFF""  android:singleLine=""true""   Button   android:id=""@+id/button""   android:layout_width=""wrap_content""  android:layout_height=""wrap_content""   android:text=""OK""  android:layout_gravity=""right""   android:gravity=""center_horizontal""  android:inputType=""textUri"" /LinearLayout/LinearLayout</code></pre>","133858","","133858","","2009-10-07 22:17:23","2011-02-10 07:18:11","ListView and onitemClicked effect in Android?","<android><listview><adapter>","2","0","","",""
"1534961","1","1558056","","2009-10-08 00:18:17","0","561","<p>In android, how can I observe for any changes made to a contact?I know I need to register for a content observer? But what should be the URI for passing to the registerContentObserver function?</p><p>Here is what I tried:</p><pre><code>registerContentObserver( ContentUris.withAppendedId(People.CONTENT_URI, personId), true, myContactsObserver);</code></pre><p>But I don't get notified when I change the phone number of the contact.</p><p>Thank you for any pointers.</p>","125440","","","","","2009-10-13 03:24:13","How can I observe for any changes to a contact","<android>","1","0","1","",""
"1535138","1","1535484","","2009-10-08 01:27:48","2","9905","<p>I was just wondering if anyone solved this problem. Googling gives tons of posts having this question but not one with a proper reply. I tried literally every combination of the following two pieces of code with and without proxy: </p><pre><code>/*********** URL METHOD ***************///URLConnection conn = aURL.openConnection(); //conn.connect(); //InputStream is = conn.getInputStream(); /*********** HTTP METHOD ***************/HttpClient client = new DefaultHttpClient();HttpGet get = new HttpGet(urlString);HttpResponse resp = client.execute(get);InputStream is = resp.getEntity().getContent();</code></pre><p>I am trying to connect to a site on my intranet (its not localhost). I've tried the following:</p><ol><li>Setting Proxy inside Eclipse settings</li><li>Setting my own localhost and writing a small php script that takes the url, connects to it and then gets the file from the intranet site - This works from the Browser though! It does not work when I use the 10.0.2.2 IP address</li></ol><p>Any thoughts?</p>","184046","","1039608","","2013-03-19 14:32:10","2013-03-19 14:32:10","Android: Has anyone encountered the localhost HttpClient Connection Refused error?","<android><http><internet>","4","0","2","",""
"1535915","1","1536082","","2009-10-08 06:22:34","12","20193","<p>I'm using Eclipse 3.3 and Android 1.6. I installed DDMS on my Eclipse and tried to insert breakpoints as in tutorial <a href=""https://www.ibm.com/developerworks/library/os-ecbug/"">https://www.ibm.com/developerworks/library/os-ecbug/</a> . However, as I run my project, the program won't stop when it reaches the breakpoint. Is there a bug in Eclipse or am I doing something wrong?</p>","","Jaska","","","","2013-02-12 23:05:07","Inserting breakpoints on Eclipse for an Android program","<android><eclipse><debugging>","5","0","1","",""
"1536054","1","1536365","","2009-10-08 07:01:34","22","92718","<p>I have to convert a byte array to string in Android, but my byte array contains negative values.</p><p>If I convert that string again to byte array, values I am getting are different from original byte array values.</p><p>What can I do to get proper conversion? Code I am using to do the conversion is as follows:</p><pre><code>// Code to convert byte arr to str:byte[] by_original = {0,1,-2,3,-4,-5,6};String str1 = new String(by_original);System.out.println(""str1 &gt;&gt; ""+str1);// Code to convert str to byte arr:byte[] by_new = str1.getBytes();for(int i=0;i&lt;by_new.length;i++) System.out.println(""by1[""+i+""] &gt;&gt; ""+str1);</code></pre><p>I am stuck in this problem.</p>","68274","","28169","","2009-10-08 07:08:31","2014-04-15 13:05:49","how to convert byte array to string and vice versa","<java><android>","11","2","4","",""
"1536384","1","1536652","","2009-10-08 08:20:22","68","30963","<p>I have added a second Virtual Device to test a different screen resolution (QVGA), but now I wanna switch back to the first AVD (HVGA) again. How can I set the virtual device in Eclipse to be used by default or even specifically for my project? In the properties I can only set the API level.</p><p>I also couldn't find any information in the <a href=""http://developer.android.com/guide/developing/tools/avd.html"">command line tool documentation</a> to set this manually.</p>","184367","","","","","2014-03-19 00:56:38","Android Emulator: select AVD (Android Virtual Device) to run by default","<android><eclipse><avd>","3","0","13","",""
"1536601","1","1536886","","2009-10-08 09:10:17","1","3137","<p>I am writing an android application that has 3 views one below the other. Each view has to be of equal height, depending on the screen size. Each view occupies the full width of the screen. How do you specify in the layout xml that the view has to take up 1/3rd height of the device display height? What would be the appropriate layout to use in this case?</p>","77087","","","","","2009-10-08 10:18:49","Specifying the relative dimension of views in a layout based on device screen width/height","<android><design><layout>","1","0","","",""
"1536654","1","1537085","","2009-10-08 09:26:00","5","15750","<p>An application I am currently developing is communicating with the server and the communication process runs in its own thread. There are asynchronous calls - for example login() and onLoginResponse().</p><p>login() is called in the main activity and the response is handled in main activity as well (onLoginResponse()). In onLoginResponse() method there is updateGUIState() method which modifies layout elements:</p><pre><code>private void updateGUIState() {    Log.i(TAG, ""executing updateGUIState"");    arrangeLayoutElements();    txtTime.setText(mStrRecordingTime);    if (settings.isRecording()) {        //btnAction.setText(""Stop"");        btnAction.setImageResource(R.drawable.button_stop);    } else {        //btnAction.setText(""Capture"");        btnAction.setImageResource(R.drawable.button_record);    }    //set privacy level text    if (settings.getPrivacyLevel() == 0) {        txtPrivacyLevel.setText(""Private"");    } else if (settings.getPrivacyLevel() == 1) {        txtPrivacyLevel.setText(""Public"");    }    if (settings.isMute()) {        muteIcon.setIconImage(R.drawable.ic_volume_off_small);    } else {        muteIcon.setIconImage(R.drawable.ic_volume_small);    }    if (mIsUploading) {        txtUploadingText.setVisibility(View.VISIBLE);        uploadingProgressBar.setVisibility(View.VISIBLE);    } else {        txtUploadingText.setVisibility(View.INVISIBLE);        uploadingProgressBar.setVisibility(View.INVISIBLE);    }    if (mEncoderConnection != null) {        txtConnectionStatus.setText(""Connected"");    } else {        txtConnectionStatus.setText(""Disconnected"");    }}</code></pre><p>When the execution reaches this method (when called from onLoginResponse()) the application crashes and the log displays the following message:</p><blockquote>  <p>android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</p></blockquote><p>Does anyone know how it is possible to modify the logic in order to switch to appropriate thread before modifying the layout and fix the problem?</p><p>Thanks!</p>","22996","","","","","2009-10-09 00:23:54","Android:android.view.ViewRoot$CalledFromWrongThreadException - How to solve the problem?","<android><layout><multithreading>","3","0","2","",""
"1536749","1","1537134","","2009-10-08 09:51:03","1","1369","<p>For ease of use I want to extend an Android Activity with a certain class to give it extra functionality and then extend my main activity with that class e.g.</p><pre><code>class SuperActivity extends Activity {    //Very nice extra functions}//Class defined in the manifest.xmlclass ApplicationActivity extends SuperActivity {    //Start the application}</code></pre><p>is there any way to do this? currently in the above form its giving me an class not found exception..</p><p>Logcat: </p><pre><code>10-08 12:23:28.316: ERROR/AndroidRuntime(678): Uncaught handler: thread main exiting due to uncaught exception10-08 12:23:28.336: ERROR/AndroidRuntime(678): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{ntx.app/ntx.app.AppActivity}: java.lang.ClassNotFoundException: ntx.app.AppActivity in loader dalvik.system.PathClassLoader@437601e810-08 12:23:28.336: ERROR/AndroidRuntime(678):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2324)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at android.os.Handler.dispatchMessage(Handler.java:99)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at android.os.Looper.loop(Looper.java:123)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at android.app.ActivityThread.main(ActivityThread.java:4203)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at java.lang.reflect.Method.invokeNative(Native Method)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at java.lang.reflect.Method.invoke(Method.java:521)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at dalvik.system.NativeStart.main(Native Method)10-08 12:23:28.336: ERROR/AndroidRuntime(678): Caused by: java.lang.ClassNotFoundException: ntx.app.AppActivity in loader dalvik.system.PathClassLoader@437601e810-08 12:23:28.336: ERROR/AndroidRuntime(678):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at android.app.Instrumentation.newActivity(Instrumentation.java:1097)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)10-08 12:23:28.336: ERROR/AndroidRuntime(678):     ... 11 more</code></pre><p>The error doesn't occur when I let the AppActivity extend android.app.Activity</p>","174868","","174868","","2009-10-08 11:03:23","2009-10-16 13:30:31","Indirectly extend Activity","<java><android><activity>","1","1","","",""
"1536802","1","","","2009-10-08 10:02:17","1","6459","<p>Being a newbie to Android I can't work out how to call the camera application (or you can say camera preview?) when I click a button in my custom application.</p>","","user186255","28169","","2009-10-08 10:30:46","2013-08-28 10:50:47","How to call built-in camera app from my own application in Android?","<android>","1","0","","",""
"1536924","1","1538516","","2009-10-08 10:24:30","0","455","<p>I want to use default Android credentials for specific phone to pass authentication test in Google Apps, but documentation is terrible :-(, and worst of all I'm a newbie.</p><p>Anyone have a idea how to do it? There are some apache libs for it, but as I mentioned documentation is very weak. <a href=""http://developer.android.com/reference/org/apache/http/auth/Credentials.html"" rel=""nofollow"">Here is reference to this class</a>.</p><p>best,Patrick</p>","186268","","","","","2009-10-08 15:21:22","How to use default account parameters (login/pwd) in Android phone?","<android><credentials>","2","0","","",""
"1538331","1","1541161","","2009-10-08 14:52:25","16","10438","<p>What I want to do is change the default ""Done"" label that appears in the virtual keyboard. Here's what I've tried without any luck:</p><pre><code>mSearchInput.setImeOptions(EditorInfo.IME_ACTION_DONE);mSearchInput.setImeActionLabel(getString(R.string.search_action_label), EditorInfo.IME_ACTION_DONE);</code></pre><p>I <strong>am</strong> able, however, to handle a click on that button, with this:</p><pre><code>mSearchInput.setOnEditorActionListener(new TextView.OnEditorActionListener() {    @Override    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {        if (actionId == EditorInfo.IME_ACTION_DONE) {            performSearch();            return true;        }        return false;    }});</code></pre><p>I'm clueless as to how I can change the label on that button at the moment.</p>","180784","","","","","2010-10-16 11:28:53","Android: Can't figure how to use setImeActionLabel","<java><android><edittext>","1","0","4","",""
"1538796","1","1538828","","2009-10-08 16:05:56","13","17574","<p>i want to know how to refresh the ListActivity when i change/add data to the list wich is dispayed.</p><p>i first thougt the ListAdapter would know when the list is changed but when i add elements to the list there is no update, only when i close the activity and reopen it i see the changes.so i searched for any update() refesh() or something like that method but there is none.so it seem i didnt get the concept, can someone help me please?</p>","165106","","","","","2013-12-26 04:17:17","update Android ListActivity when list data changes","<android><listactivity>","4","0","6","",""
"1539976","1","1540395","","2009-10-08 19:39:16","1","7115","<p>I want to have a dialog containing 3 views1. title with black background2. some body text white background3. a line with 2 buttons with gray background.</p><p>The problem is that i want the background color of the body to be WHITE, but even my view has set backgroundcolor to WHITE, there seems to be some margins at top and bottom of the body that got a diffrent background color.</p><pre><code>       TextView title = new TextView(this);    title.setText(""This is my title"");    title.setBackgroundColor(Color.BLACK);    title.setPadding(10, 10, 10,10);    title.setGravity(Gravity.CENTER);    title.setTextColor(Color.WHITE);    title.setTextSize(20);    TextView view = new TextView(this);    view.setText(""Lorem Ipsum blabla bla \n more bla bla aha hhahah blablalblal."");    view.setBackgroundColor(Color.WHITE);    AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder.setCancelable(false);    builder.setCustomTitle(title);    builder.setView(view);    builder.setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {               public void onClick(DialogInterface dialog, int id) {                    Bingo.this.finish();               }           })           .setNegativeButton(""No"", new DialogInterface.OnClickListener() {               public void onClick(DialogInterface dialog, int id) {                    dialog.cancel();               }           });    AlertDialog alert = builder.create();    alert.show();    ((View)view.getParent()).setBackgroundColor(Color.WHITE);  // &lt;-- UGLY fix to avoid stupid margins at top and bottom of the body...</code></pre><p>Any ideas how i can remove the last line of the code the ""UGLY fix"" ?</p>","133858","","","","","2009-10-08 20:52:37","How can i optimize this dialog code for Android?","<android><dialog>","1","2","0","",""
"1540272","1","2287218","","2009-10-08 20:34:48","17","45512","<p>I have two questions actually:</p><ol><li>Is it better to draw an image on a bitmap or create a bitmap as resource and then draw it over a bitmap? Performance wise... which one is better?</li><li>If I want to draw something transparent over a bitmap, how would I go about doing it?</li><li>If I want to overlay one transparent bitmap over another, how would I do it?</li></ol><p>Sorry for the long list, but in the interest of learning, I would like to explore both the approaches...</p>","184046","","","","","2012-10-19 09:41:34","Android: How to overlay-a-bitmap/draw-over a bitmap?","<android><graphics><drawing><bitmap><overlay>","3","0","27","",""
"1540979","1","1545081","","2009-10-08 22:57:11","2","3800","<p>I just tried a stupid approach and it crashed my app... Basically I have an activity that has three tabs (containing three activities). Each of the tabs gets its input from an xml file downloaded off the net. Everything is fine but when I start my app, it has download the xml file and there's a ""wait"" time for this.</p><p>I managed to get around this by adding a splash screen. It looks beautiful but the problem is when I click on the second tab, it still has to get the list off the net, so it looks ugly now... It waits before displaying the list. So what I did was design an AsyncTask that just downloads the xml file. In my main activity, I spawn two tasks initially and send the URL and Intent as parameters. And inside the acitivities that start inside the tabs, I use a wait(). Inside the AsyncTask, after it is done with the download, I notify the Intent using notify(). This crashed! Of course, I didn't expect it to work but just wanted to try :) Writing it so that I can either get a feedback as to why this failed or to prevent others from wasting their time on this...</p><p>Now, I am sure many face the problem of a ""wait"" time inside the tabs. How do I solve this? I am thinking of either dimming the screen and then displaying a series of toasts or display a progress indicator inside the tabs or pre-fetching the xml files... I don't have a clue on how these can be achieved... Any thoughts?</p>","184046","","","","","2009-10-09 17:23:50","Android: Loading data and then notifying an Activity? Also documented a failed approach!","<android><download><progress-bar><prefetch>","2","0","","",""
"1541125","1","1541204","","2009-10-08 23:38:07","4","2846","<p>I'm trying to parse JSON in android but am having trouble with accessing sub children of an object. I am trying to extract augment from the following,</p><pre><code>{""augment-list"": {  ""time"": ""12:01"",  ""channel"": ""channel1"",    ""augment"": [      {""id"": ""123"", ""name"": ""here"", ""x"": ""5"", ""y"": ""10"", ""orientation"": ""up"", ""content"": ""some stuff""},      {""id"": ""456"", ""name"": ""there"", ""x"": ""12"", ""y"": ""25"", ""orientation"": ""down"", ""content"": ""more stuff""},      {""id"": ""789"", ""name"": ""over there"", ""x"": ""1"", ""y"": ""2"", ""orientation"": ""left"", ""content"": ""and more""}    ]}}</code></pre><p>I've tried accessing the augments by getting the JSON object of augment-list named augment, or augment[0] but cant figure it out how to access each augment inside. </p>","","user186824","","","","2009-10-09 00:01:31","Parsing JSON in java","<java><android><json>","1","0","2","",""
"1541884","1","1542314","","2009-10-09 05:03:06","2","7869","<p>I want to incorporate small, lean and mean C-based parser into my Android project. I've done JNI programming in the past but not any type of native (C) development on Android. My plan is to compile C lib into SO and create JNI wrapper around it which I'm going to use in my app. Is this how it can/should be done? Second and most important question - how can I include .so into my APK? Where would it go?</p>","135946","","","","","2012-04-25 13:34:38","Android - JNI guidelines","<android><jni>","4","0","1","",""
"1542008","1","","","2009-10-09 05:54:33","2","2516","<p>The the client side of a content provider consumer I can do something like this, to get a proper InputStream for reading the picture:</p><pre><code>InputStream is = getContentResolver().openInputStream(pictureUri);</code></pre><p>It is a nice API, and will on the server side, the actual content provider result in a call to:</p><pre><code>public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {  // Open a proper ParcelFileDescriptor, most likely using openFileHelper(uri, mode)}</code></pre><p>But what if the picture mapped to the URI is not to be found on the filesystem, but as a memory resource, or generated on the fly.</p><p>Can I create a memory mapped <code>File</code> or <code>InputStream</code>, or anything else, so that I am not required to save a temporary file to disk, just to be able to return it to my content provider consumer?</p>","165059","","","","","2013-02-06 16:45:04","Returning a memory mapped InputStream from a content provider?","<android><memory-mapped-files><android-contentprovider>","2","0","4","",""
"1542353","1","1543391","","2009-10-09 07:35:47","0","599","<p>Whenever I try to upgrade my application in <code>Android Market</code>, I am getting this error:</p><pre><code>The `apk` file must be signed with at least one certificate in common with the previous version.</code></pre><p>and I have lost my previous <code>keystore</code>. </p>","83905","","493939","","2012-05-03 11:16:03","2012-05-03 11:16:03","Getting an error while upgrading my application in android market","<android>","1","0","","",""
"1542499","1","1543405","","2009-10-09 08:11:53","1","5891","<p>So far I've a class for a simple local service. What I want to do is to <strong>send requests</strong> to this local service <strong>from different activies</strong> in my application. Depending on the parameters of these requests the service will connect via HttpClient to a webserver and receive a JSONObject and return it to the activity. All the HTTP communication is already working within my activity, but I'd like it to <strong>run in a separate thread in my local service</strong> now.</p><p>The source code of my very simple local service looks like this so far:</p><pre><code>// BackgroundService.javapackage com.test.localservice;import android.app.Service;import android.content.Intent;import android.os.IBinder;import android.util.Log;public class BackgroundService extends Service{    @Override    public void onCreate() {        super.onCreate();        Log.i(""BackgroundService"", ""onCreate()"");        Thread thr = new Thread(null, new RunThread(), ""BackgroundService"");        thr.start();    }    class RunThread implements Runnable    {        public void run() {            Log.i(""BackgroundService"", ""run()"");            /* Here the HTTP JSON communication is going to happen */            //BackgroundService.this.stopSelf();        }    }    @Override    public void onDestroy()    {        Log.i(""BackgroundService"", ""onDestroy()"");        super.onDestroy();    }    @Override    public void onStart(Intent intent, int startId) {        Log.i(""BackgroundService"", ""onStart()"");        super.onStart(intent, startId);    }    @Override    public IBinder onBind(Intent intent) {        Log.i(""BackgroundService"", ""onBind()"");        return null;    }}</code></pre><p>The problem I'm facing now (due to a lack of knowledge) is the communication part <strong>Activities &lt;--> Local Service</strong>. I found some communication and object exchange examples for a <strong>Remote Service</strong> using <a href=""http://developer.android.com/guide/developing/tools/aidl.html"" rel=""nofollow"">AIDL</a> (Android Interface Definiton Language). However, I'm not sure if I've to go this path. I would simply like to exchange either my own defined objects or if that is not possible then just a JSONObject or if it makes things much easier even just simple String Arrays would work (for now).</p><p>Can someone please point me in the right direction and if possible give a simple example of an Object exchange (both ways) with a local service.</p><p>Thanks in advance.</p>","184367","","184367","","2009-10-09 08:18:44","2009-10-09 12:10:07","Android: How to communicate and exchange objects with a Local Service","<android><json><http><service><local>","1","0","2","",""
"1542797","1","","","2009-10-09 09:31:36","4","4630","<p>I'm running the following line in an Activity, which is within the same application, but in a different package:</p><pre><code>AppObject appObj = (AppObject)this.getApplication();// FYI: AppObject is my extension class of Application.</code></pre><p>It returns only a null pointer, while when I move it to the ""main"" package and run it from there it returns the application reference as expected.</p><p>I've defined the activity in my AndroidManifest.xml  with the full qualified class name, since it is in another package: <code>&lt;activity android:name=""com.foo.bar.TestActivity""&gt;&lt;/activity&gt;</code> </p><p>Any ideas of what I've to do different?</p><p>Thanks</p><p><hr /></p><p><strong>Update:</strong> As suggested in a question below <code>android:name=""AppObject""</code> was already in the <code>&lt;application&gt;</code> tag of the AndroidManifest.xml</p>","184367","","184367","","2009-10-15 09:42:24","2011-05-11 05:37:23","Android: this.getApplication() returns NULL pointer","<android><nullpointerexception>","3","0","1","",""
"1542806","1","","","2009-10-09 09:32:29","6","11649","<p>I'm trying to create a color picker for Android that looks like a minimalistic version of Gimp's. So, it has a hue slider and a rectangle with saturation/value variants of a color chosen in hue slider.</p><p>Question: what is the best way to create the rectangle?</p><p>Right now, I'm creating an 200x200 array of pixels, but it takes ~5sec to create and display rectangle with that array. And I need colors in rectangle to change whenever I change the value in hue slider...</p><p>Rectangle is bitmap, btw. Can I use color matrices on that and how? Any examples?</p><p>Thanks in advance!</p>","133648","","","","","2011-01-24 20:57:52","Android color picker - updating color array","<java><android>","4","2","3","",""
"1542862","1","1547126","","2009-10-09 09:45:33","0","4250","<p>How can I start a new application on Android? I have done a new applications NewHomeScreen and Hello and on NewHomeScreen I wrote this code.</p><pre><code>@Override public void onCreate(Bundle state) {    super.onCreate(state);    setContentView(R.layout.main);    Intent mainIntent = new Intent(this,Hello.class);    startActivity(mainIntent);}</code></pre><p>However, it does not start Hello application. Debugger says that state has value null but what should it be? I also wrote this to Manifest:</p><pre><code>&lt;activity android:name=""Hello""&gt;    &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.HELLO"" /&gt;            &lt;category android:name=""android.intent.category.HELLO""/&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;/intent-filter&gt; &lt;/activity&gt;</code></pre>","","Jaska","","","","2009-10-10 05:15:06","How to start a new application on Android","<android><launching-application>","2","1","","",""
"1542887","1","1543420","","2009-10-09 09:52:54","1","676","<p>I export my application to .apk file, sign it then install it. But when I run my App, it displays an error because there's no data in my database. The database was created as a new one when I installed the application, so all the data were lost! How can I include database data when exporting an Android application?</p>","152286","","26428","","2009-10-10 18:18:00","2009-10-10 18:18:00","Include database data when exporting an Android application","<database><android>","1","0","1","",""
"1544429","1","","","2009-10-09 15:12:24","6","6413","<p>GridView is not behaving like it is supposed to.This <a href=""http://www.flickr.com/photos/37403003@N08/3994585989/"" rel=""nofollow"">screenshot</a> shows that the GridView (in landscape mode) is flushed left.I want it centered. </p><p>This is the XML layout for the GridView.</p><pre><code>&lt;LinearLayout   xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/templatelandscape""  android:orientation=""horizontal""  android:layout_width=""fill_parent""   android:layout_height=""wrap_content""&gt;&lt;GridView   android:id=""@+id/commandsbarlandscape""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:layout_weight=""1.0""  android:layout_alignParentTop=""true""  android:layout_centerInParent=""true""  android:padding=""0dp""  android:verticalSpacing=""2dp""  android:horizontalSpacing=""2dp""  android:numColumns=""auto_fit""  android:columnWidth=""52dp""  android:stretchMode=""spacingWidth""  android:gravity=""fill_horizontal"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>What am I doing wrong ? </p>","27328","","213269","","2011-12-18 17:56:53","2013-02-18 12:52:15","How do I center a GridView in its LinearLayout parent?","<android><layout><gridview><android-linearlayout>","6","2","1","",""
"1546423","1","1546611","","2009-10-09 22:47:25","0","273","<p>I was wondering if it is possible to have different behavior depending on a click on the icon and the text inside a TextView... Any suggestions?</p>","184046","","","","","2009-10-09 23:59:05","Android: Is it possible to have different handlers for drawableLeft and the text inside a TextView?","<android><textbox>","1","0","","",""
"1547103","1","1547561","","2009-10-10 05:02:18","1","6414","<p>Im wondering how much data storage is available for my application in android?</p><p>I need to cache lots of files, and i was thinking to store it inside the sharedpreferences, this way it gets deleted if the application is uninstalled. Afterall its just alot of cache files. I guess i could also use the SDCard, but than i dont have any controll of what the user does outside the application...</p><p>So, how many MB can my application steel from SharedPreferences when storing files ?</p>","133858","","","","","2009-11-08 12:59:06","Android and data storage space?","<android><diskspace>","2","0","0","",""
"1547236","1","1547253","","2009-10-10 06:48:00","6","1638","<p>I have an automatic bug reporting facility in my app that includes useful information for debugging. </p><p>One thing that I would like to include is the ROM provider. In particular I would like to know if the user is running a custom ROM and which, preferably even with the version number.</p><p>Any idea how to retrieve this information programmatically?</p><p>--- Taken from the Quintin (see below)</p><p><a href=""http://code.google.com/p/cyanogen-updater/source/browse/trunk/src/cmupdaterapp/utils/SysUtils.java#19"">http://code.google.com/p/cyanogen-updater/source/browse/trunk/src/cmupdaterapp/utils/SysUtils.java#19</a>:</p><pre><code>public static String getReadableModVersion() {   String modVer = getSystemProperty(Constants.SYS_PROP_MOD_VERSION);   return (modVer == null || modVer.length() == 0 ? ""Unknown"" : modVer); }</code></pre><p>Whereby the constant is this: </p><pre><code>public static final String SYS_PROP_MOD_VERSION = ""ro.modversion"";</code></pre><p>And here is the getSystemProperty();</p><pre><code>public static String getSystemProperty(String propName){            String line;            BufferedReader input = null;    try    {            Process p = Runtime.getRuntime().exec(""getprop "" + propName);        input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024);        line = input.readLine();        input.close();    }    catch (IOException ex)    {            Log.e(TAG, ""Unable to read sysprop "" + propName, ex);            return null;    }    finally    {            if(input != null)            {                            try                            {                                    input.close();                            }                            catch (IOException e)                            {                                    Log.e(TAG, ""Exception while closing InputStream"", e);                            }            }    }    return line;}</code></pre><p>Could anybody with a CM ROM can run this for me?</p><p>Btw. Careful, this is GPL code. I for one can not use it.Any easier or non-GPL way?</p>","45867","","45867","","2009-10-10 12:09:07","2012-04-02 21:20:55","How to find out who the ROM provider is?","<android>","3","0","3","",""
"1547435","1","1548047","","2009-10-10 09:02:42","3","3851","<p>I have noted that in my computer Android and Eclipse are very slow. I agree that my computer has not very much memory but I was wondering is there any lightweight version of the emulator and is there some lighter IDE than Eclipse which supports Android development and Android debugger?</p>","156943","","","","","2013-09-21 18:37:32","Faster Android development","<android><lightweight>","5","1","","",""
"1547766","1","1547901","","2009-10-10 11:56:52","0","1402","<p>I already have a sqlite3 db file that I created in Windows, is there a way to package this file into my android application and access it as a sqlite db from within the application or do I have to create a db on application load or something in Android only? The db has about a 1000 records, writing sql scripts again might be monotonous and cumbersome</p>","77087","","","","","2009-10-10 13:12:01","Using sqlite db created in Windows but to be accessed in Android","<android><sqlite3>","2","0","","",""
"1547923","1","1547988","","2009-10-10 13:21:03","1","2360","<p>How can I create a Slide-Bottom-To-Top animation when close/stop an activity in android application? </p>","152286","","","","","2009-10-10 13:40:16","How to create a Bottom-Top animation when close/stop an activity in android","<android><animation>","1","0","","",""
"1548489","1","1743605","","2009-10-10 17:07:28","4","13818","<p>Hi i have problem with a class i want to pass in an intent by putting it into the putExtras()Its serializable and the code looks like this:</p><pre><code>public abstract class ObjectA extends ArrayList&lt;ObjectA&gt; implements java.io.Serializable{...}public class ObjectB extends ObjectA {...}...Bundle extras = new Bundle();extras.putSerializable(""blabla"", ObjectB);intent.putExtras(extras);...Object y = getIntent().getExtras().get(""blabla"");</code></pre><p>the problem is, that y now is an ArrayList and no longer an ObjectB so i cant cast it..if i change the code to </p><pre><code>public class ObjectB implements java.io.Serializable {...}</code></pre><p>it works fine</p>","165106","","165106","","2009-10-12 07:37:03","2011-07-03 13:04:15","android: problem with Serializable object put into intent","<android><arraylist><android-intent><serializable>","4","5","2","",""
"1548550","1","1549330","","2009-10-10 17:32:44","0","334","<p>Does anyone have experience with java voice recognition and localization? </p><p>I'm thinking to build an android application, with some basic voice recognition options, but I want to implement localization for that based on some translate tool, maybe Google translate, and users can update his ""dictionary"" with new languages from remote dictionary...this project is in first phase, and I'm still brainstorming, so does anyone have some experience or is something like that even possible?</p>","16039","","","","","2009-10-10 23:07:02","Voice recognition and localization?","<android><localization><google-translate><voice-recognition>","1","1","","",""
"1549356","1","1549381","","2009-10-10 23:17:18","1","3978","<p>I'm building a chat room application where new events are being polled for every X seconds.  Every time that happens, this code updates the RoomAdapter (a custom subclass of ArrayAdapter)  with the new data and scrolls it to the bottom:</p><pre><code>RoomAdapter adapter = (RoomAdapter) getListAdapter();for (int i=0; i&lt;newEvents.size(); i++) adapter.add(newEvents.get(i));getListView().setSelection(events.size()-1);</code></pre><p>This is fine, except that if the user is scrolling up to glance at the room's history, it's going to jump her down to the bottom when the poll happens.  What I'd like to do is have it so that if the user is already at the bottom of the list, it stays there after a poll for new events. If the user's intentionally scrolled upwards, I'd like the user not to be disturbed.</p><p>How do I detect when I'm already scrolled to the bottom of a ListView?</p><p>Note: I can't do getListView().getSelectedItemPosition(), because <a href=""http://developer.android.com/reference/android/widget/ListView.html#setSelection%28int%29"" rel=""nofollow"">as the docs note</a>, calling setSelection when in touch mode does not actually select the item, just scrolls to it.</p>","16075","","","","","2012-09-06 12:19:28","Detecting scroll position inside a ListView (or ScrollView)","<android>","2","0","2","",""
"1550657","1","1551671","","2009-10-11 13:12:00","4","9202","<p>I'm trying to launch an image which is written to my application directory with the builtin Android image viewer. This image has been written in a different part of the app to the app directory. When getting the following file:</p><p><code>super.getFilesDir() + ""/current.png""</code></p><p>File.exists() returns true.</p><p>How can i launch the builtin Android image viewer to view this file?Currently i'm doing:</p><pre><code>File f = new File(super.getFilesDir()+""/current.png"");uri = Uri.parse(""file://""+super.getFilesDir()+""/current.png"");startActivity(new Intent(Intent.ACTION_VIEW, uri));</code></pre><p>And it keeps churning out:</p><blockquote>  <p>10-11 13:09:24.367:  INFO/ActivityManager(564): Starting  activity: Intent {  act=android.intent.action.VIEW  dat=file:///data/data/com.davidgoemans.myapp/files/current.png  } 10-11 13:09:24.367:  ERROR/myapp(2166): Exception  occuredandroid.content.ActivityNotFoundException:  No Activity found to handle Intent {  act=android.intent.action.VIEW  dat=file:///data/data/com.davidgoemans.myapp/files/current.png  }</p></blockquote><p>irrespective of what i change the uri schema to ( eg, content://, file://, media://, image:// ).</p>","25893","","","","","2011-03-02 05:25:23","Android Image Viewer from App","<java><android>","3","0","6","",""
"1551856","1","1552215","","2009-10-11 21:37:54","1","2242","<p>I have a code sample (from Reto Meier's book) on receiving SMS messages in an android application using a broadcast receiver.</p><p>I am looking to be able to receive a SMS message in my application however the code I already have a sample of seems to be depreciated from what I can tell...</p><p>Does anyone have a more up to date (android 1.5 or 1.6) example of how to receive SMS messages in an android application?</p><p>Thanks.Tom.</p>","122547","","246246","","2013-07-11 18:51:04","2013-07-11 18:51:04","Receiving SMS messages in Android 1.6","<android><sms><android-1.6-donut>","1","1","1","",""
"1551951","1","1551972","","2009-10-11 22:24:38","1","8364","<p>Is it possible to set the width of a spinner dropdown list in code? I have a spinner populated with integers, and it does not look good with the list expanding to full width. Can I set the width to wrap the content somehow?</p><pre><code>Spinner hSpinner = (Spinner) timerView.findViewById(R.id.timer_hour_spinner);ArrayList&lt;Integer&gt; hList = new ArrayList&lt;Integer&gt;(21);for (int i = 0; i &lt;= 20; i++) { hList.add(i); }ArrayAdapter hAdapter = new ArrayAdapter(RemindMe.this, android.R.layout.simple_spinner_item, hList);hAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);hSpinner.setAdapter(hAdapter);</code></pre><p>Thanks!</p><p>Linus</p>","91098","","","","","2013-05-06 20:55:35","Manually set width of spinner dropdown list in android","<android><layout><spinner>","3","0","1","",""
"1552289","1","1552298","","2009-10-12 01:19:17","8","5208","<p>Where should I store my Android application's configuration settings? Coming from the .NET world I was expecting something like .config. Do I create a file under res/values, and use that?</p>","4593","","4593","","2009-10-12 01:29:02","2009-10-12 01:29:02","Android application configuration","<android><configuration>","1","0","1","",""
"1554099","1","","","2009-10-12 11:45:53","1258","419951","<p>I have a 2.67&nbsp;GHz Celeron processor, 1.21&nbsp;GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all the instructions in setting up the IDE, SDKs, JDKs and such and have had some success in starting the emulator quickly but that is very rare. How can I, if possible, fix this problem?</p><p>Even if it starts and loads the home screen, it is very sluggish. I have tried the Eclipse IDE in Galileos, and Ganymede.</p>","188383","","1066497","","2014-03-15 22:19:32","2014-04-06 04:11:33","Why is the Android emulator so slow?","<android><performance><android-emulator><qemu>","64","24","666","","2012-04-10 11:11:52"
"1554969","1","1557495","","2009-10-12 14:41:53","0","1052","<p>I have an activity that starts with an AsyncTask to check the connection to my servers api.Since this should not run in the UI thread i have made a AsyncTask for this.</p><p>The problem is that is get an runtime exception when i start the background process of the Asynctask.</p><p>How can i avoid this?</p><p>From log:</p><pre><code>10-12 14:18:56.476: ERROR/AndroidRuntime(1523): java.lang.RuntimeException: An error occured while executing doInBackground()10-12 14:18:56.476: ERROR/AndroidRuntime(1523):     at android.os.AsyncTask$3.done(AsyncTask.java:200)10-12 14:18:56.476: ERROR/AndroidRuntime(1523):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:234)10-12 14:18:56.476: ERROR/AndroidRuntime(1523):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258)10-12 14:18:56.476: ERROR/AndroidRuntime(1523):     at java.util.concurrent.FutureTask.run(FutureTask.java:122)10-12 14:18:56.476: ERROR/AndroidRuntime(1523):     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)10-12 14:18:56.476: ERROR/AndroidRuntime(1523):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)10-12 14:18:56.476: ERROR/AndroidRuntime(1523):     at java.lang.Thread.run(Thread.java:1058)10-12 14:18:56.476: ERROR/AndroidRuntime(1523): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()10-12 14:18:56.476: ERROR/AndroidRuntime(1523):     at android.os.Handler.&lt;init&gt;(Handler.java:121)</code></pre>","133858","","","","","2011-08-21 16:18:57","AsyncTask in OnCreate fails at runtime, how can this be avoided in Android?","<android><activity><asynchronous>","2","1","1","",""
"1555109","1","1662088","","2009-10-12 15:03:22","741","160394","<p>I have an Android Activity, with two elements:</p><ol><li>EditText </li><li>ListView</li></ol><p>When my Activity starts, the EditText immediately has input focus (flashing cursor). I don't want any control to have input focus at startup. I tried:</p><pre><code>EditText.setSelected(false);</code></pre><p>No luck. How can I convince the EditText to not select itself when the Activity starts?</p>","137193","","1279334","","2012-09-22 13:07:22","2014-04-15 10:56:57","Stop EditText from gaining focus at Activity startup","<android><listview><edittext>","28","3","258","",""
"1555829","1","1557477","","2009-10-12 17:20:43","4","9997","<p>I'm sure this is a simple threading issue but...</p><p>I'm starting a ProgressDialog using:</p><pre><code>ProgressDialog.show(Example.this, "" "" , "" Loading. Please wait ... "", true,true);</code></pre><p>Then running a block of code to download and parse XML.</p><p>The problem I'm having is that this is all running under a onClick button method, and that the xml is downloaded and parsed before the dialog is shown.</p><p>Any help would be greatly appreciated!</p>","173892","","","","","2009-10-12 23:23:31","Progressdialog slow to show in Android","<android><multithreading>","2","0","1","",""
"1556930","1","1557465","","2009-10-12 21:03:53","16","14609","<p>Can two or more Android Activities open an sqlite3 database for write? </p><p>I have two Activities that need to insert data into the same sqlite database. When the second Activity calls <code>SQLiteOpenHelper.getWriteableDatabase()</code> an IllegalStateException is thrown with the message ""<strong><em>SQLiteDatabase created and never closed</em></strong>"". </p><p>I've been able to avoid the Exception by making my database object a singleton but I'm thinking there must be a better way. </p><p>Thanks,</p><p>John</p>","4476","","","","","2010-07-01 02:13:27","Sharing sqlite database between multiple Android Activities","<android><sqlite3>","2","4","11","",""
"1556981","1","1557094","","2009-10-12 21:13:37","1","1024","<p>This is continuation to the question I already asked a while back. I've been offered <a href=""http://stackoverflow.com/questions/1473355/autogrow-listview-in-android"">a solution</a> which is not really working. Anyway - here's the problem/question</p><p>I look at some posts from the past and it seems that if I add items tothe ListView adapter it should update itself and user should be ableto scroll to the newly appended items. Unfortunately it's not what Iobserve. If I append new items to my existing ArrayAdapter I only willsee updated results if I rerun ListView#setAdapter again. Doingnothing, invalidating view etc. doesn't do anything. Here's a snippet:</p><pre><code>SearchItemsAdapter a = (SearchItemsAdapter) listview.getAdapter();List&lt;SearchItem&gt; values = fetchNextSetOfItems();a.append(values);// unless I do this - I will not see the update, but if I do - // I'll jump to the toplistview.setAdapter(a);</code></pre><p>Here's append method:</p><pre><code>public void append(List&lt;SearchItem&gt; values) {        this.items.addAll(values);}</code></pre><p>Anything I'm missing? </p>","135946","","","","","2009-10-12 21:39:40","Android - ListView autogrow is not working as expected","<android><listview><autogrow>","1","0","1","",""
"1556987","1","","","2009-10-12 21:14:07","71","111805","<p>I am launching an activity to make a phone call, but when I pressed the 'end call' button, it does not go back to my activity.  Can you please tell me how can I launch a call activity which comes back to me when 'End call' button is pressed? This is how I'm making the phone call:</p><pre><code>    String url = ""tel:3334444"";    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(url));</code></pre>","128983","","114066","","2011-11-04 11:10:57","2014-02-26 09:53:13","How to make a phone call in android and come back to my activity when the call is done?","<android>","16","0","45","","2009-10-12 21:14:07"
"1557366","1","1557432","","2009-10-12 22:48:13","1","1392","<p><strong>OLD QUESTION (Already answered by Mark - The answer is to use getTag()):</strong> </p><p>Let's say I have a ListView with a custom layout for each row having an ImageView and a TextView. Now, when a click is made, I am able to determine which image and which textview were clicked based on the view but if I have to pass this information to say another activity, I need the position. But, how would I get the position of the item clicked in the listview?</p><p><strong>REVISED QUESTION:</strong></p><p>I am doing the following: Custom ListView with an ImageView and a TextView. I would like to perform different actions depending on whether an image or a text element was clicked. Now, there are two approaches I can take to perform event handling:</p><p>Approach #1: Attach an OnItemClick Listener to an item in the ListView and perform a suitable action.Problem: It remains in question as to which element (image or text) was clicked. How would I determine this piece of information and then take the necessary action?</p><p>Approach #2: Attach an OnClick Listener to the image and text separately inside each listview item and then perform a suitable action.Problem: I am highly skeptical about the performance of this approach. Added to that, when a click is performed, the row of the item is not being highlighted which makes it highly non-intuitive. How would I make the row highlight in this case?</p><p>Any suggestions? </p>","184046","","184046","","2009-10-13 14:30:35","2009-10-13 14:30:35","Android: Event handlers for a custom view? (QUESTION REVISED)","<android><listview><event-handling><click>","1","3","1","",""
"1557830","1","1562103","","2009-10-13 01:36:53","3","8732","<p>I am trying to design my first Android application with the use of GPS. As of right now, I have a drawable button that when clicked, alerts a Toast message of the longitude and latitude. I have tried to use the <strong>telnet localhost 5554</strong> and then <strong>geo fix #number #number</strong> to feed in values but no results display just <code>0</code> <code>0</code>. I have also tried DDMS way of sending GPS coordinates and I get the same thing. </p><p>My question is what exactly is the correct way of using the geo fix and the DDMS way of sending coordinates. I have used <code>Location</code>, <code>LocationManger</code> and <code>LocationListener</code> but I am not sure which is the right choice.</p><p>Code is given, just in case if the error exists with the code</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button button = (Button) findViewById(R.id.track);    button.setOnClickListener(this);    LocationManager location =(LocationManager)getSystemService(Context.LOCATION_SERVICE);    Location loc = location.getLastKnownLocation(location.GPS_PROVIDER);    updateWithNewLocation(loc);  } private final LocationListener locationListener = new LocationListener() {   public void onLocationChanged(Location location) {     updateWithNewLocation(location);   }  private void updateWithNewLocation(Location l) {  longitude = l.getLongitude();  latitude = l.getLatitude();  provider = l.getProvider();       }    public void onClick(View v) {      Toast.makeText(this, ""Your location is "" +       longitude + "" and "" + latitude + "" provided by: "" +       provider, Toast.LENGTH_SHORT).show();             }     }</code></pre>","166712","","166712","","2010-06-21 23:24:26","2010-06-21 23:24:26","Android GPS cloud of confusion!","<android><gps><emulator><ddms>","2","2","3","",""
"1558750","1","2142792","","2009-10-13 07:45:40","1","2278","<p>I wonder if there is a way to get information on which activity currently has focus (is in the foreground)? I am using instrumentation and I would like to know which activity is currently running in the application that I am testing against. </p><p>Thanks</p>","188914","","","","","2010-01-26 21:30:35","Android, how to get information on which activity is currently showing (in foregorund)?","<android><focus><activity>","1","3","1","",""
"1558824","1","1561186","","2009-10-13 08:09:22","0","483","<p>I have made an application of reading all contacts and its values from android address book, but i am not able to read all the vlaues of contact.Currently i am getting only its name and mobile number. </p><p>How can i get its all phone numbers,all eamil values and address values ?</p><p>Thanks in advance...</p>","177571","","","","","2009-10-13 15:57:23","Not able to read contact's all values","<java><android>","1","5","","",""
"1559057","1","1564675","","2009-10-13 09:07:28","4","6424","<p>I have some <code>WebView</code> widgets inside my <code>Activity</code>. I use <code>loadData()</code> to set the content, and this html contains a link. Some of my <code>WebViews</code> work okay, when I click the link, the web browser is started in a new window, but some make my app crash when I click on a link.</p><pre><code>10-13 08:45:24.257: ERROR/AndroidRuntime(751): Uncaught handler: thread main exiting due to uncaught exception10-13 08:45:24.308: ERROR/AndroidRuntime(751): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?10-13 08:45:24.308: ERROR/AndroidRuntime(751):     at android.app.ApplicationContext.startActivity(ApplicationContext.java:627)10-13 08:45:24.308: ERROR/AndroidRuntime(751):     at android.content.ContextWrapper.startActivity(ContextWrapper.java:236)10-13 08:45:24.308: ERROR/AndroidRuntime(751):     at android.webkit.CallbackProxy.uiOverrideUrlLoading(CallbackProxy.java:185)10-13 08:45:24.308: ERROR/AndroidRuntime(751):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:277)10-13 08:45:24.308: ERROR/AndroidRuntime(751):     at android.os.Handler.dispatchMessage(Handler.java:99)10-13 08:45:24.308: ERROR/AndroidRuntime(751):     at android.os.Looper.loop(Looper.java:123)10-13 08:45:24.308: ERROR/AndroidRuntime(751):     at android.app.ActivityThread.main(ActivityThread.java:3948)10-13 08:45:24.308: ERROR/AndroidRuntime(751):     at java.lang.reflect.Method.invokeNative(Native Method)10-13 08:45:24.308: ERROR/AndroidRuntime(751):     at java.lang.reflect.Method.invoke(Method.java:521)10-13 08:45:24.308: ERROR/AndroidRuntime(751):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)10-13 08:45:24.308: ERROR/AndroidRuntime(751):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)10-13 08:45:24.308: ERROR/AndroidRuntime(751):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>There seems to be a problem with the <code>Intent</code> that the <code>WebView</code> fires when I click the URL, but I have no control of this <code>Intent</code>, I think.</p><p>Does anybody have any idea?</p><p>I use this <code>AsyncTask</code> to set the content in the <code>WebView</code>, and it works fine:</p><pre><code>public class SetAdTask extends AsyncTask&lt;Void, Void, String&gt;{    private Main main;    private WebView webView;    public SetAdTask(Main main, WebView webView){    	this.main = main;    	this.webView = webView;    }    protected void onPreExecute() {        Main.Log(""onPreExecute()"");                    }    protected String doInBackground(Void... params) {        Main.Log(""doInBackground()"");                    	return main.getRestClient().getAdCode();    }    protected void onPostExecute(String result) {        Main.Log(""onPostExecute()"");    	String html = ""&lt;html&gt;&lt;head&gt;&lt;title&gt;ad&lt;/title&gt;&lt;/head&gt;&lt;body&gt;"";    	html += ""&lt;div style=\""color:grey;font-size:12px;\""&gt;ADVERTISEMENT&lt;br/&gt;"";    	html += result;    	html += ""&lt;/body&gt;&lt;/html&gt;"";    	webView.loadData(html, ""text/html"", ""latin-1"");    }}</code></pre>","133858","","76835","","2009-10-23 09:24:40","2014-01-12 14:15:09","Android WebView crashes when clicking on a link","<android><webview>","2","2","1","",""
"1559575","1","","","2009-10-13 11:12:35","0","366","<p>I have recently started on android.</p><p>i have written this piece of code</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class ArrangeMe extends Activity {    private Button button1;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        this.button1 = (Button)findViewById(R.id.buttonOne);        this.button1.setOnClickListener(new OnClickListener() {            //@Override            public void onClick(View v) {            	finish();            }        });        setContentView(R.layout.main);    }}</code></pre><p>and my main.xml looks as below</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content"" android:text=""ArrangeMe""/&gt;&lt;Button android:text=""Button01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/buttonOne""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>but when i pass through this line</p><pre><code>this.button1 = (Button)findViewById(R.id.buttonOne);</code></pre><p>i observe button1 = null. but when i type R.id. eclipse does suggest an auto complete buttonOne (that suggests layout xml is correct !)</p><p>where am I going wrong ?</p><p>edit:</p><p>interstingly, i tried the following code,</p><p>still the button does not appear. it has stopped crashing, but the button does not appear !</p><pre><code>   button1 = new Button(getContext());    button1.setText(""1"");    addView(button1, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));    button1.setOnClickListener(new OnClickListener() {        //@Override        public void onClick(View v) {        	finish();        }    });</code></pre><p>this was giving error</p><p>i changed them to</p><pre><code>   button1 = new Button(getBaseContext());    button1.setText(""1"");    addContentView(button1, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));    button1.setOnClickListener(new OnClickListener() {        //@Override        public void onClick(View v) {        	finish();        }    });</code></pre>","","user189020","","user189020","2009-10-13 12:57:29","2013-02-27 07:37:03","button question","<android><button>","3","0","","",""
"1560788","1","4009133","","2009-10-13 14:59:51","244","175213","<p>I got a <code>AsyncTask</code> that is supposed to check the network access to a host name. But the <code>doInBackground()</code> is never timed out. Anyone have a clue?</p><pre><code>public class HostAvailabilityTask extends AsyncTask&lt;String, Void, Boolean&gt; {    private Main main;    public HostAvailabilityTask(Main main) {        this.main = main;    }    protected Boolean doInBackground(String... params) {        Main.Log(""doInBackground() isHostAvailable():""+params[0]);        try {            return InetAddress.getByName(params[0]).isReachable(30);         } catch (UnknownHostException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        }        return false;           }    protected void onPostExecute(Boolean... result) {        Main.Log(""onPostExecute()"");        if(result[0] == false) {            main.setContentView(R.layout.splash);            return;        }        main.continueAfterHostCheck();    }   }</code></pre>","133858","","1628280","","2014-02-17 22:44:24","2014-03-07 17:39:27","How to check internet access on Android? InetAddress never timeouts...","<android><networking><asynchronous>","25","1","165","",""
"1561234","1","1561441","","2009-10-13 16:06:44","4","4422","<p>Because Java uses object references and not objects themselves, what prevents me from using setTag() to tag a view with an entire object instead of an object's property? Is it just the attribute lookup time when trying to resolve one of the attributes after the getTag() call or is there any other specific thing I should be concerned about?</p><p>As for my specific problem, I am using a custom listview that has an imageview and a textview. Initially I bind the listview to a custom adapter to fetch some xml data and then use certain tags inside each item's xml to populate my listview. So the ""entire object"" I was referring to  was the parsed version of the entire XML of an item...</p>","184046","","184046","","2009-10-13 17:10:30","2011-09-01 07:14:02","Android: What care should I take when using a View's setTag() property?","<android><views>","2","0","","",""
"1561535","1","1561699","","2009-10-13 16:56:17","1","1157","<p>I am essentially using a listview but am looking at providing a bookmark functionality. I am thinking that I should store the item attributes in a file when bookmarked and retrieve when required to populate a bookmark listview. </p><p>I was wondering if there is a de facto standard used in achieving this or do I follow just the ""writing into a file"" and ""reading from a file"" when necessary style? </p>","184046","","","","","2013-03-06 12:28:38","Android: How do I deal with storing Bookmarks?","<android><listview><storage><bookmarks><data-storage>","1","0","","",""
"1561675","1","","","2009-10-13 17:17:10","4","3093","<p>I'm interested in whether there is a way to monitor HTTP(S) traffic on an Android phone? What I would like to do is to be able to retrieve all URLs that have been accessed on the phone's browser. I thought that there would be a browser intent for that, but have not seen anything - given I'm green, maybe I just did not know where to look?</p><p>I followed the question and answer <a href=""http://stackoverflow.com/questions/525063/android-respond-to-url-in-intent"">here</a>, but it works only for hyperlinks which were clicked by the user, however I need to catch all URLs - including the ones typed in by the user. Basically I need to know about every single URL that was opened in the web browser.</p><p>Can I register some kind of a handler with the browser?</p><p>Is something like that feasible at all?</p>","41420","","","","","2012-10-09 22:17:32","How to monitor HTTP(S) traffic / URLs in Android?","<android>","2","0","1","",""
"1561803","1","1562567","","2009-10-13 17:41:19","81","87285","<p>I can't seem to grasp why this is happening. This code:</p><pre><code>mProgressDialog = ProgressDialog.show(this, """", getString(R.string.loading), true);</code></pre><p>works just fine. However, this code:</p><pre><code>mProgressDialog = ProgressDialog.show(getApplicationContext(), """", getString(R.string.loading), true);</code></pre><p>throws the following exception:</p><pre><code>W/WindowManager(  569): Attempted to add window with non-application token WindowToken{438bee58 token=null}.  Aborting.D/AndroidRuntime( 2049): Shutting down VMW/dalvikvm( 2049): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)E/AndroidRuntime( 2049): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime( 2049): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tastekid.TasteKid/com.tastekid.TasteKid.YouTube}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an applicationE/AndroidRuntime( 2049):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)E/AndroidRuntime( 2049):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)E/AndroidRuntime( 2049):    at android.app.ActivityThread.access$2100(ActivityThread.java:116)E/AndroidRuntime( 2049):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)E/AndroidRuntime( 2049):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime( 2049):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 2049):    at android.app.ActivityThread.main(ActivityThread.java:4203)E/AndroidRuntime( 2049):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 2049):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 2049):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)E/AndroidRuntime( 2049):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)E/AndroidRuntime( 2049):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime( 2049): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an applicationE/AndroidRuntime( 2049):    at android.view.ViewRoot.setView(ViewRoot.java:460)E/AndroidRuntime( 2049):    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)E/AndroidRuntime( 2049):    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)E/AndroidRuntime( 2049):    at android.app.Dialog.show(Dialog.java:238)E/AndroidRuntime( 2049):    at android.app.ProgressDialog.show(ProgressDialog.java:107)E/AndroidRuntime( 2049):    at android.app.ProgressDialog.show(ProgressDialog.java:90)E/AndroidRuntime( 2049):    at com.tastekid.TasteKid.YouTube.onCreate(YouTube.java:45)E/AndroidRuntime( 2049):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)E/AndroidRuntime( 2049):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)E/AndroidRuntime( 2049):    ... 11 more</code></pre><p>Any ideas why this is happening? I'm calling this from the <code>onCreate</code> method.</p>","180784","","","","","2014-03-17 22:24:09","Android: ProgressDialog.show() crashes with getApplicationContext","<android><progressdialog>","15","0","21","",""
"1561938","1","3191539","","2009-10-13 18:03:28","10","24755","<p>When I use the Gallery widget, how do I get the images to say scale up &amp; glow on being selected and scaled down &amp; un-glow on being unselected? All the tutorials I've seen have this effect but I am not able to see it... Is there some kind of an animation that I have to attach to the Gallery?</p>","184046","","","","","2012-10-23 13:44:14","Android: Animation in Gallery View?","<android><image><gallery>","3","1","9","",""
"1562190","1","","","2009-10-13 18:45:36","0","298","<p>Android 1.6 supports video capture, however, not all phones will support video capture.  Is there a way I can tell if the phone I am running on supports video capture or not?</p>","","user189350","","","","2009-10-14 16:24:49","How to determine if an Android phone can capture video?","<android><video-capture>","1","0","1","",""
"1562240","1","1562840","","2009-10-13 18:54:33","3","2883","<p>In my app I have a ListView backed by ArrayAdapter. In it I'm detecting events in OnScrollListener#onScroll method to find end of the list. I noticed that on the phone (MyTouch) both track-ball and gesture/touch scrolling will trigger the event twice. On the emulator I get the same behavior with a scrolling wheel and click-and-drug scrolling. However in emulator if I use down-arrow button to scroll the event is fired only once.</p><p>Here's the code:</p><pre><code>this.view.setOnScrollListener(new OnScrollListener() {    @Override    public void onScroll(final AbsListView view, final int first,                                 final int visible, final int total) {        // detect if last item is visible        if (visible &lt; total &amp;&amp; (first + visible == total)) {            Log.d(""OnScrollListener - end of list"", ""fvi: "" +                first + "", vic: "" + visible + "", tic: "" + total);            // this line gets called twice            onLastListItemDisplayed(total, visible);        }    }}</code></pre><p>How do I suppress or handle this behavior? I need just a single event and trying not to revert to silly hacks such as boolean field.</p><p>As far as I can tell - both events have identical stacktrace</p><pre><code>Thread [&lt;3&gt; main] (Suspended (breakpoint at line 116 in SearchResultsView$4))  SearchResultsView$4.onScroll(AbsListView, int, int, int) line: 116  ListView(AbsListView).invokeOnItemScrollListener() line: 655  ListView.arrowScrollImpl(int) line: 2256  ListView.arrowScroll(int) line: 2172  ListView.commonKey(int, int, KeyEvent) line: 1977  ListView.onKeyMultiple(int, int, KeyEvent) line: 1929  KeyEvent.dispatch(KeyEvent$Callback) line: 899  ListView(View).dispatchKeyEvent(KeyEvent) line: 3647  ListView(ViewGroup).dispatchKeyEvent(KeyEvent) line: 744  ListView.dispatchKeyEvent(KeyEvent) line: 1909  FrameLayout(ViewGroup).dispatchKeyEvent(KeyEvent) line: 746  LinearLayout(ViewGroup).dispatchKeyEvent(KeyEvent) line: 746  PhoneWindow$DecorView(ViewGroup).dispatchKeyEvent(KeyEvent) line: 746  PhoneWindow$DecorView.superDispatchKeyEvent(KeyEvent) line: 1708  PhoneWindow.superDispatchKeyEvent(KeyEvent) line: 1197  SearchResultsView(Activity).dispatchKeyEvent(KeyEvent) line: 1967  PhoneWindow$DecorView.dispatchKeyEvent(KeyEvent) line: 1684  ViewRoot.deliverKeyEventToViewHierarchy(KeyEvent, boolean) line: 2329  ViewRoot.handleFinishedEvent(int, boolean) line: 2299  ViewRoot.handleMessage(Message) line: 1621  ViewRoot(Handler).dispatchMessage(Message) line: 99  Looper.loop() line: 123  ActivityThread.main(String[]) line: 4203  Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  Method.invoke(Object, Object...) line: 521  ZygoteInit$MethodAndArgsCaller.run() line: 791  ZygoteInit.main(String[]) line: 549  NativeStart.main(String[]) line: not available [native method]</code></pre><p>P.S. <a href=""http://code.google.com/p/android/issues/detail?id=4239"" rel=""nofollow"">Bug is created</a></p><p>P.P.S. And closed with very useful reply <code>The trackball and the touch screen send several motion events very rapidly. This behavior is expected.</code></p>","135946","","135946","","2009-10-13 20:00:41","2012-02-20 21:24:15","Android - ListView duplicate events","<android><listview><onscroll>","2","2","2","",""
"1563328","1","1563485","","2009-10-13 22:37:16","10","14821","<p>Is there a url format available such that clicking on the url willopen the Android (Gphone) Marketplace to a particular app's page for installation?</p><p>Does it work with the 'current' Android OS ver in the wild?</p><p>Eg, can I put something on my customized Android website better than</p><ol><li>Please open the Marketplace application,</li><li>search for FBReader</li><li>then install it</li></ol><p>The app that I want to point people to is the epub reader, FBReader<a href=""http://www.fbreader.org/FBReaderJ/"">http://www.fbreader.org/FBReaderJ/</a></p><p>Thanks,</p><p>Larry</p>","64904","","","","","2012-11-30 17:12:10","Android: Special url to open Marketplace to a specific app?","<android><marketplace>","4","0","2","",""
"1563370","1","1565107","","2009-10-13 22:44:49","24","30996","<p>I would like to check from my app whether the device has WiFi connectivity, but in order to do that, I must first find a way to get ""WiFi"" in the emulator. Just going to <strong>Settings -> Wireless controls -> Wifi</strong> says <em>Unable to start Wi-Fi</em>, while <code>logcat</code> says:</p><pre><code>E/WifiService(  566): Failed to load Wi-Fi driver.D/SettingsWifiEnabler(  695): Received wifi state changed from Unknown to EnablingD/SettingsWifiEnabler(  695): Received wifi state changed from Enabling to Unknown</code></pre><p>How can I simulate WiFi connectivity in the emulator?</p>","180784","","94687","","2012-05-06 01:56:27","2012-05-06 12:52:54","Android: Simulate WiFi in the emulator?","<android><testing><android-emulator><wifi><device-emulation>","3","0","5","",""
"1563785","1","1563816","","2009-10-14 01:16:00","5","4242","<p>I have a TextView in my android application that has a set width on it.  It's currently got a gravity of ""center_horitonzal"" and a set textSize (9sp).  I pull values to put on this label from a sqlite database, and some of the values are too large to fit in the TextView at the current textSize.</p><p>Is there a way to detect that the text inside a TextView is going to be clipped?  I'd like to detect this, and lower the font until it fits.  There is a nice property in the iPhone UILabel that handles this called ""adjustToFit"" (which also has a minimum font size), and I'm basically trying to emulate that.</p><p>Here's an example of the TextView that I'm working with:</p><pre><code>&lt;TextView android:id=""@+id/label5"" android:layout_width=""62px""            android:layout_height=""wrap_content"" android:layout_x=""257px""            android:layout_y=""169px"" android:textSize=""9sp""             android:textColor=""#000""            android:typeface=""sans"" android:textStyle=""bold""            android:gravity=""center_horizontal"" android:lines=""1"" /&gt;</code></pre>","99131","","","","","2011-04-03 00:24:24","detect clipping in android TextView","<android>","3","0","3","",""
"1564688","1","1566667","","2009-10-14 07:04:40","0","940","<p>Is there any open source telephone directory application for Android or how can I make one myself? </p>","","Jaska","","","","2009-10-14 14:30:32","Android telephone directory","<android><directory><telephone>","1","0","","",""
"1564867","1","","","2009-10-14 07:53:27","13","17137","<p>I would like to add a vertical scrollbar to an AlertDialog because my text is too long to display on 1 screen: </p><p>I have tried to use : </p><pre><code>android:scrollbars=""vertical"" android:scrollbarAlwaysDrawVerticalTrack=""true""</code></pre><p>but the scrollbars don't even display ?</p><p>Here's the xml layout file I'm using:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:scrollbars=""vertical""     android:scrollbarAlwaysDrawVerticalTrack=""true""    android:id=""@+id/instructions_view"" &gt;&lt;TextView   android:id=""@+id/TextView01""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:text=""section 1 :...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            ""&gt;&lt;/TextView&gt;&lt;TextView   android:id=""@+id/TextView02""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:text=""section2 :...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            end ... end ... end !""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>I call the AlertsDialog with :</p><pre><code>public void onClick(View v) {  switch(v.getId()){    case R.id.Button_Instructions:      InstructionsDialog();    break;    case R.id.Button_Exit:      ExitDialog();    break;    } }public void InstructionsDialog(){  AlertDialog.Builder ad = new AlertDialog.Builder(this);  ad.setIcon(R.drawable.icon);  ad.setTitle(""Instructions ..."");  ad.setView(LayoutInflater.from(this).inflate(R.layout.instructions_dialog,null));  ad.setPositiveButton(""OK"",     new android.content.DialogInterface.OnClickListener() {     public void onClick(DialogInterface dialog, int arg1) {      // OK, go back to Main menu     }    }   );   ad.setOnCancelListener(new DialogInterface.OnCancelListener(){    public void onCancel(DialogInterface dialog) {     // OK, go back to Main menu       }}   );  ad.show(); }</code></pre><p>I found the answer now=> IT WORKS NOW WITH THIS :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView android:id=""@+id/ScrollView01""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""             xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:scrollbars=""vertical""     android:scrollbarAlwaysDrawVerticalTrack=""true""    android:id=""@+id/instructions_view"" &gt;&lt;TextView   android:id=""@+id/TextView01""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:text=""section 1 :...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            ""&gt;&lt;/TextView&gt;&lt;TextView   android:id=""@+id/TextView02""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:text=""section2 :...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            text...text...text...text...text...text...text...text...text...text...            end ... end ... end !""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre>","116573","","996493","","2012-04-01 11:37:28","2012-04-01 11:37:28","Adding a vertical scrollbar to an AlertDialog in Android?","<android><dialog><scrollbar>","1","4","8","",""
"1565349","1","1565909","","2009-10-14 10:03:43","2","3660","<p>I'm using <a href=""http://developer.android.com/reference/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.html"" rel=""nofollow"">ThreadSafeClientConnManager</a> to manage a <em>pool of client connections</em>, because my application has several threads, which are simultaneously connecting to a webserver.</p><p>Abstract sample code: </p><pre><code>HttpClient httpClient;ClientConnectionManager conMgr = new ThreadSafeClientConnManager(parameters,schReg);httpclient = new DefaultHttpClient(conMgr, parameters);</code></pre><p>Now lets say on of this threads is downloading a large file, but then the user of my application is switching to another activity/screen. Therefor the file is needless and I'd like to abort this download connection.</p><p>In <a href=""http://developer.android.com/reference/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.html"" rel=""nofollow"">ThreadSafeClientConnManager</a> I found this method:</p><p><code>public ClientConnectionRequest requestConnection (HttpRoute route, Object state)</code>Returns a new ClientConnectionRequest, from which a ManagedClientConnection can be obtained or the <strong>request can be aborted</strong>.</p><p>So far I've been using:</p><pre><code>HttpGet httpRequest = new HttpGet(URL_TO_FILE);HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);[...]</code></pre><p>Now from what I understand, I've to use:</p><p><code>httpclient.getConnectionManager().requestConnection(HttpRoute route, Object state);</code></p><p>And that's the point where I'm stuck. I assume that for the route I can just use <code>new HttpRoute(new HttpHost(""10.0.0.1""))</code> or whatever my server is, but what to put in for <code>Object state</code>?</p><p>And second, as soon as I've the <code>ClientConnectionManager</code> I can call <code>getConnection(long timeout, TimeUnit tunit)</code>. But then from there, how I do I execute my <code>HttpGet httpRequest = new HttpGet(URL_TO_FILE);</code> as I did before with <code>HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);</code>?</p><p>I've been gone through the documentation and tried out quite a few different things, but I wasn't able to obtain a working solution. Therefor any suggestions and/or code examples are more than welcome.</p>","184367","","","","","2009-10-14 12:20:32","Cancel/abort a connection from the ThreadSafeClientConnManager connection pool","<java><android><thread-safety><connection-pooling><httpclient>","1","0","4","",""
"1565596","1","1565656","","2009-10-14 11:00:49","0","3302","<p>In the application there is deleteFile(String path) method implemented which has to delete the file located at the given path.</p><p>If the path contains pah separator (char '/') the method throws an exception but to delete a specific file a full path has to be used and it contains a separator sign. Due to conflicting condition I haven't found a way to successfully delete the file.</p><p>Does anyone know how is it possible to bypass the problem?</p><p>Thanks!</p>","22996","","","","","2009-10-14 11:39:31","How to use deleteFile() with argument that contains path separator?","<android><file>","2","0","0","",""
"1565869","1","1565925","","2009-10-14 12:11:41","2","1027","<p>I am developing an app on Android that will randomly pick and display an inspirational quotation (or verse) from a large collection of quotations. On Android I can choose between a flat file and an SQLite database. </p><p>The app should satisfy the following conditions:</p><ol><li><p>Be scalable to 10^6 quotations and/or verses</p></li><li><p>Be very fast (i.e. retrieve and display a quotation, immediately at the touch of a button)</p></li><li><p>Be able to load new quotations from an external source (in a format I have not yet decided)</p></li></ol><p>What data format must I use? Thanks.</p>","189785","","","","","2009-10-14 12:24:15","Should I use a flat file or database for storing quotes for a random quotations app on Android?","<database><android><sqlite><flat-file>","1","0","","",""
"1567443","1","1567468","","2009-10-14 16:28:25","17","37862","<p>I thought I have read somewhere that the accuracy of Android's GPS is about 10cm?</p><p>Can anyone verify or correct this? Reason being is that my application I am trying to develop keeps track of locations an user has visited and it would help me out tremendously to know the margin of error I can expect?</p>","166712","","166712","","2010-06-23 21:08:22","2013-12-17 15:52:16","How accurate is Android GPS?","<android><gps>","5","2","7","2012-08-25 18:12:01",""
"1567601","1","1651337","","2009-10-14 16:52:49","21","33150","<p>I'm looking for a java library that works on the android that can download and resume files from an FTP server.  Does anyone know of such a library.  I've found lots of client apps, but no stand alone libraries.</p>","149358","","","user942821","2012-02-22 00:27:36","2012-12-03 15:58:00","Android FTP Library","<java><android><ftp>","2","1","14","",""
"1567732","1","","","2009-10-14 17:17:32","2","11715","<p>I was capturing images before that were showing up in the gallery, but now they are not and I can't figure out why.  Here is my code:</p><pre><code>    	ContentValues values = new ContentValues();	values.put(android.provider.MediaStore.Images.Media.IS_PRIVATE, false);	String name = ""ugc_"" + String.valueOf(System.currentTimeMillis());	values.put(android.provider.MediaStore.Images.Media.TITLE, name);	imageURI = getContentResolver().insert(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);</code></pre><p>I've also tried:    values.put(android.provider.MediaStore.Images.Media.IS_PRIVATE, 0);as well as leaving at that value, but nothing seems to work now.</p>","","user189350","","","","2009-10-14 19:11:07","How can I capture an image in Android and have it show up in the gallery?","<android><image-capture>","1","0","2","",""
"1567791","1","1568311","","2009-10-14 17:27:50","0","1107","<p>I have noticed with testing GPS locations, a value such as -123 might come up on Android as -123.83333336... is there anyway to format incoming GPS locations, such as within 2 decimal points? This way I can store values like -123.83 opposed to longer numeric values. I have checked out DecimalFormat and NumberFormat, these are strings and my numbers are doubles, I cannot find a better way. And does anyone know a maximum value of a location in numeric values? Knowing that, I can do something like</p><pre><code>DecimalFormat df = new DecimalFormat(""####.##"");</code></pre><p>knowing the highest number is in the thousands, etc.</p><p>Thanks!</p>","166712","","","","","2009-10-14 19:02:41","Android GPS Result Format","<android><formatting><gps><double><decimal>","2","0","0","",""
"1568459","1","","","2009-10-14 19:29:34","0","1213","<p>I'm trying to make my app to play intro clip for only when I start activities.But from my code it's always play the clip after wakeup before resume to app  although I did not closed the app. What can I do to fix this prob? Thanks</p><p>From main:</p><pre><code>startActivity(new Intent(this, MyIntro.class));</code></pre><p>From MyIntro:</p><pre><code>public class MyIntro extends Activity implements OnCompletionListener {    int a;    @Override    protected void onCreate(Bundle bundle) {        super.onCreate(bundle);        setContentView(R.layout.intro);        playIntro();    }    public void onConfigurationChanged(Configuration newConfig) {        setContentView(R.layout.intro);    }    public void onCompletion(MediaPlayer arg0) {        // TODO Auto-generated method stub        this.finish();    }    private void playIntro(){        setContentView(R.layout.intro);        VideoView video = (VideoView) this.findViewById(R.id.VideoView01);        Uri uri = Uri.parse(""android.resource://real.app/"" + R.raw.intro);        video.setVideoURI(uri);        video.requestFocus();        video.setOnCompletionListener(this);        video.start();      }}</code></pre>","169736","","76835","","2009-10-15 20:00:06","2011-04-11 13:56:07","Android always play intro clip","<android><video>","2","0","","",""
"1568674","1","1568826","","2009-10-14 20:08:00","1","2664","<p>I'm am creating an Android application, but in order to have one of the functionalities working I need to read a predefined xml file whilst only knowing its name, not the R.id..</p><p>In normal Java I know I can use </p><p><code>getClass().getClassLoader().getResource(xmlName)</code></p><p>but using the limited Android SDK thats not working, any knows how to solve this?</p>","174868","","","","","2009-10-14 20:35:06","How to get File within' package, in an Android application","<java><android><file><package>","2","2","","",""
"1568739","1","1568808","","2009-10-14 20:21:19","6","6291","<p>I've read at a few places that I should not be using Activities as contents of my tabs. I would like to know why this is not a recommended approach... Any suggestions?</p>","184046","","","","","2012-04-04 12:05:08","Android: Why shouldn't I use activities inside tabs?","<android><tabs><activity>","2","2","5","",""
"1571615","1","1571632","","2009-10-15 10:55:49","1","194","<p>I have an Activity X which is only accessible after you've entered a valid credential. </p><p>How can I prevent other apps from calling startActivity with an Intent pointing to X ?</p><p>e.g.</p><pre><code>Intent intent = new Intent( this, ActivityX.class );startActivity( intent );</code></pre><p>Basically I don't want Activity X to be exported to any apps except my app.</p>","27328","","","","","2009-10-15 10:59:44","Preventing apps from invoking my Activity","<java><android><mobile>","1","0","","",""
"1571649","1","1571717","","2009-10-15 11:04:00","0","2139","<p>There are several custom-made graphic objects (.png files) included in the project inside res/drawable map.</p><p>All elements are normally loaded and displayed in the user interface except two icons and so far haven't figured out what causes the problem.</p><p>The code which doesn't affect the user interface as it should is the following:</p><pre><code>if (settings.isMute()) {        muteIcon.setIconImage(R.drawable.ic_volume_off_small);    } else {        muteIcon.setIconImage(R.drawable.ic_volume_small);    }</code></pre><p>In both cases there is only <code>ic_volume_small</code> displayed on the screen and the Variables window in the IDE displays the following:</p><blockquote>  <p>R.drawable.ic_volume_small = Class not  loaded : net.client.android.R$drawable  R.drawable.ic_volume_of_small = Class  not loaded :  net.client.android.R$drawable</p></blockquote><p>The method (member of IconImage class) which should change the icon image is the following:</p><pre><code>public void setIconImage(int imageFromResources) {    iconImage = BitmapFactory.decodeResource(getResources(), imageFromResources);    iconWidth = iconImage.getWidth();    iconHeight = iconImage.getHeight();    invalidate();}</code></pre><p>Does anyone know what could cause the described problem?</p><p>Thanks!</p>","22996","","22996","","2009-10-15 11:48:58","2011-02-08 23:04:32","Android: Any idea why cannot load drawable object?","<android><resources>","2","0","","",""
"1572107","1","","","2009-10-15 12:39:29","18","32723","<p>I'm trying to play video's on Android, by launching an intent.The code I'm using is:</p><pre><code>tostart = new Intent(Intent.ACTION_VIEW);tostart.setDataAndType(Uri.parse(movieurl), ""video/*"");startActivity(tostart);</code></pre><p>This works on most phones, but not on the HTC Hero. It seems to load a bit different video player. This does play the first video thrown at it. However, every video after that it doesn't respond. (it keeps in some loop).</p><p>If I add an explicit </p><pre><code>tostart.setClassName(""com.htc.album"",""com.htc.album.ViewVideo"");</code></pre><p>(before the startactivity) it does work on the HTC Hero. However, since this is a HTC specific call, I can't run this code on other phones (such as the G1).On the G1, this works:</p><pre><code>tostart.setClassName(""com.android.camera"",""com.android.camera.MovieView""); //g1 version</code></pre><p>But this intent is missing from the hero.Does anybody know a list of intents/classnames that should be supported by all Android devices? Or a specific one to launch a video?Thanks!</p>","49852","","","","","2014-03-10 12:25:22","Android intent for playing video?","<android><video><sdk><android-intent>","4","0","9","",""
"1572868","1","1572926","","2009-10-15 14:46:39","2","2888","<p>I have this custom layout:</p><pre><code>- LinearLayout    - FrameLayout        - ImageView    - TextView</code></pre><p>This layout reacts to click events (using <code>LinearLayout.setOnClickListener()</code>) and is made focusable using <code>android:focusable=""true""</code> in the layout XML file. This all works fine if you're using the touchscreen, but I'm thinking about users who don't use the touchscreen that much and prefer navigation keys or maybe even don't have a touchscreen. These users won't be able to see when that <code>ViewGroup</code> is focused (although it <strong>can</strong> be focused using the keyboard).</p><p>My question is: how can I make a change in that layout when it is focused (I need to change the <code>android:background</code> of the <code>ImageView</code>)? I suppose I could use <code>LinearLayout.setOnFocusChangeListener()</code>, but I'm thinking maybe there's a better way, using just XML files.</p>","180784","","","","","2010-02-05 15:42:44","Android: change style when focused","<android><layout><focus>","1","0","1","",""
"1573391","1","1576513","","2009-10-15 16:10:01","79","31154","<p>I've a HTTP communication to a webserver requesting JSON data. I'd like compress this data stream with <code>Content-Encoding: gzip</code>. Is there a way I can set <code>Accept-Encoding: gzip</code> in my HttpClient? The search for <code>gzip</code> in the Android References doesn't show up anything related to HTTP, as you can see <a href=""http://developer.android.com/search.html#q=gzip&amp;t=0"">here</a>.</p>","184367","","","","","2014-03-27 08:39:47","Android: HTTP communication should use ""Accept-Encoding: gzip""","<android><http><gzip><content-encoding>","6","0","57","",""
"1573557","1","1574355","","2009-10-15 16:34:59","12","14797","<p>When android unbind a service I created (service.MyService), I see thefollowing DeadObjectException.</p><p>Can you please tell me how  what does this mean and can I fix this exception?</p><pre><code>W/ActivityManager(  583): Exception when unbinding servicecom.mycompany/.service.MyServiceW/ActivityManager(  583): android.os.DeadObjectExceptionW/ActivityManager(  583):       atandroid.os.BinderProxy.transact(Native Method)W/ActivityManager(  583):       atandroid.app.ApplicationThreadProxy.scheduleUnbindService(ApplicationThreadNative.java:516)W/ActivityManager(  583):       atcom.android.server.am.ActivityManagerService.removeConnectionLocked(ActivityManagerService.java:9609)W/ActivityManager(  583):       atcom.android.server.am.ActivityManagerService.killServicesLocked(ActivityManagerService.java:8515)...</code></pre><p>Thank you.</p>","125440","","","","","2014-01-28 11:12:41","How to fix android.os.DeadObjectException android X","<android>","1","0","3","",""
"1573966","1","1577763","","2009-10-15 17:42:50","1","1236","<p>I have a problem then trying to put an intent with <code>AppWidgetManager.ACTION_APPWIDGET_PICK</code> there is a problem somethere inside of android AppWidget ecosystem as I can see from the logs.So that I doing wrong?<br />See sample code and stack trace below</p><pre><code>public class NPEDemoActivity extends Activity {    private final static int HOST_CODE = 1024;    private AppWidgetHost host;    private AppWidgetManager manager;    private int PICK_WIDGET_RC = 1;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);                setContentView(R.layout.main);        host = new AppWidgetHost(this, HOST_CODE);        host.startListening();        manager = AppWidgetManager.getInstance(this);        Button b = (Button)findViewById(R.id.Button01);        b.setOnClickListener(new View.OnClickListener() {    		@Override    		public void onClick(View v) {    			int nextId = host.allocateAppWidgetId();    			Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK);				                pickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, nextId);                startActivityForResult(pickIntent, PICK_WIDGET_RC);       		}    	});    }    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        super.onActivityResult(requestCode, resultCode, data);    }}</code></pre><p>stack trace from log cat:</p><pre><code>10-15 17:33:06.873: ERROR/AndroidRuntime(821): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.AppWidgetPickActivity}: java.lang.NullPointerException10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at android.os.Handler.dispatchMessage(Handler.java:99)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at android.os.Looper.loop(Looper.java:123)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at android.app.ActivityThread.main(ActivityThread.java:4203)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at java.lang.reflect.Method.invokeNative(Native Method)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at java.lang.reflect.Method.invoke(Method.java:521)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at dalvik.system.NativeStart.main(Native Method)10-15 17:33:06.873: ERROR/AndroidRuntime(821): Caused by: java.lang.NullPointerException10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at com.android.settings.AppWidgetPickActivity.putAppWidgetItems(AppWidgetPickActivity.java:170)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at com.android.settings.AppWidgetPickActivity.putCustomAppWidgets(AppWidgetPickActivity.java:132)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at com.android.settings.AppWidgetPickActivity.getItems(AppWidgetPickActivity.java:208)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at com.android.settings.ActivityPicker.onCreate(ActivityPicker.java:99)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at com.android.settings.AppWidgetPickActivity.onCreate(AppWidgetPickActivity.java:63)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)10-15 17:33:06.873: ERROR/AndroidRuntime(821):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)</code></pre><p>Another small question, in which of android projects does com.android.settings live in? (I'm stuck with windows so can't use repo unfortunatly) Help really apreciated.</p>","88165","","76835","","2009-10-15 20:03:00","2010-01-15 07:49:56","Android:NPE while trying to activityForResult with ACTION_APPWIDGET_PICK intent","<java><android><android-intent>","3","0","","",""
"1574654","1","","","2009-10-15 19:53:13","10","23757","<p>I am trying to play a video in my app. It has to be embedded. </p><p>I went through the <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/63692208da946ead"">""Play Video Files in Android""</a> thread.</p><p>I am able to play my video using VideoView as mentioned in this discussion. But there are a few problems. </p><ol><li><p>I need full screen video, how do I stretch VideoView to full screen? Will that stretch the video too? </p></li><li><p>I don't need the default play/forward/stop buttons at all. Basically I need continuous loop playing of the video. </p></li></ol><p>I tried the MediaPlayer class as in <a href=""http://davanum.wordpress.com/2007/12/29/android-videomusic-player-sample-from-local-disk-as-well-as-remote-urls/"">here</a>,but it never worked. What should the string format look like if I have my video file in res/raw directory? I really don't want the video file played from sdcard. How can it be bundled along with the app? </p><p>If any of these two approaches work, I will be better off.</p><p>This is my code:</p><pre><code>videoHolder = new VideoView(this); // videoHolder = (VideoView)findViewById(R.id.videoview); LayoutParams params = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); videoHolder.setLayoutParams(params); videoHolder.setMediaController(new MediaController(this)); setContentView(videoHolder); // // //// I tested and found that it works fine for .wmv, .3gp and .mp4 //// videoHolder.setVideoURI(Uri.parse(""file:///sdcard/video.3gp"")); videoHolder.setVideoURI(Uri.parse(""res/raw/demo.3gp"")); videoHolder.requestFocus(); videoHolder.start(); </code></pre><p>Strangely the commented url works (the one with sdcard).The other one does not work. I have tried many combinations from ""file:// res/raw/demo.3gp"" to only ""demo"".</p><p>What would be the correct string to access the file?</p>","","user189020","56338","","2010-08-02 01:30:01","2012-06-02 02:38:30","playback video full screen","<android><video><playback>","4","0","8","",""
"1575306","1","","","2009-10-15 21:51:01","0","1210","<p>I'm trying to use OpenGL on Android using C. I'm following this <a href=""http://jiggawatt.org/badc0de/android/index.html#sdl"" rel=""nofollow"">excellent tutorial</a>, but I've hit a wall.</p><p>I'm using an ARM compiler (arm-none-linux-gnueabi-ld) on Linux Mint 7 (Ubuntu 9.04 branch).</p><p>I can copy the compiled binary to the Android emulator just fine, it runs. But when I try to <code>make</code> it myself, I get the following error:</p><pre><code>knight666@Desktop-Linux ~/Android/Test $ make( for f in src; do ( cd $f ; make all ) || exit 1 ; done )make[1]: Map '/home/knight666/Android/Test/src' wordt binnengegaanarm-none-linux-gnueabi-ld --entry=_start --dynamic-linker ../../system/bin/linker -nostdlib -rpath ../../system/lib -rpath ../../system/lib  -L ../../system/lib  -lm -lc -lui -lGLES_CM main.o start.o -o ../test1 arm-none-linux-gnueabi-ld: cannot find -lGLES_CMmake[1]: *** [test1] Fout 1make[1]: Map '/home/knight666/Android/Test/src' wordt verlatenmake: *** [all] Fout 1</code></pre><p>It complains it can't find ""GLES_CM"". I'm at a loss as to what that is and where I can find it. A Google search comes up empty. There is also no man page for <code>arm-none-linux-gnueabi-ld</code> and I can't figure out what the <code>-l</code> flag is or does.</p><p>Has anyone done this kind of thing before or can you help me understand what I'm doing wrong?</p><p>Thanks in advance.</p><p>P.s. here's a small script I wrote to copy and run a compiled binary in the Android emulator:</p><pre><code>#!/bin/shFILEPATH=`dirname $1`adb push $FILEPATH/$1 /system/sbin/$1adb shell chmod 777 /system/sbin/$1adb shell /system/sbin/$1</code></pre>","141057","","","","","2009-10-18 10:56:28","Using SDL on Android: can't compile because of missing ""GLES_CM""","<android><linux><gcc><sdl>","1","0","","",""
"1575892","1","1576316","","2009-10-16 00:40:34","10","20738","<p>I know Java apps can be run in Android. But what I want to know is this: I have a perfectly normal Java app and I want to port it to an android platform. What changes would I need to do to my app in terms of GUI and other code to make it usable in Android? I know Android uses XML file to control the look and feel of its app. So would I need to change my GUI completely?<br/><br/>I just want to know the general overview of how porting may be done. If anyone could point me to right resources, that would be great. Also, for your info I'm a newbie to developing android app, so please be patient with me :)</p><p>Update: Both very helpful answers. Thank you!</p>","123938","","123938","","2009-10-20 21:13:27","2013-07-14 04:36:19","Porting java apps to Android platform","<java><android><gui><porting>","2","1","2","",""
"1576152","1","","","2009-10-16 04:58:11","0","128","<p>I am looking to create an app with plugin functionality. What I want is to allow a separate plugin ""app"" to provide me with the view, and take care of the updating of the view that I will use in my list adapter. Essentially, I want the separate app to take care of the <em>bindView</em> and <em>newView</em> methods of my adapter.</p><p>I am looking at RemoteViews, but I am not sure if that is exactly what I need, if it would work, or maybe it's what I have to use, since it would be cross-process.</p><p>Thanks for your help.</p>","190303","","","","","2010-05-17 15:00:06","Request View and View Updates from Another Application","<java><android><view><adapter>","1","0","","",""
"1580558","1","1798193","","2009-10-16 21:35:02","0","385","<p>I'm making an app which has a flow roughly as below:</p><ol><li>User starts on the main screen with an empty list, hits menu, and goes to ""add item.""  (Activity A)</li><li>User is given a new activity which allows them to specify search criteria, then hits ""go"" to do a search.  (Activity B)</li><li>User gets a list of results, and can click on one of them to view more details.  (Activity C)</li><li>User sees details of item, and can use a menu item to save it to their list in Activity A.  (Activity D)</li></ol><p>Right now, I am having each Activity call each other Activity for results, and then it is passing the result all the way back up the stack as it returns to Activity A.  Is there a way to jump this, since all I want is for a result in Activity D to get to Activity A directly?</p><p>Note that a user should still be able to navigate backwards (using the back button) through each activity, but if they explicitly save the item in Activity D, I want it to jump straight to Activity A.</p>","60261","","","","","2009-11-25 16:33:41","How do you skip parts of an Activity stack when returning results in Android?","<android>","2","0","","",""
"1580576","1","1581208","","2009-10-16 21:40:07","1","1622","<p>I am trying to perform a rating system, where with the choices to select from returns a constant number so I can insert a value into a database. My intentions are to have 3 choices, 'Great', 'Mediocre' and 'Bad'. I would like Great to be a constant for '3', Mediocre to have a constant '2' and Bad to have a constant for '1'. I would like to insert only the numerical values if possible, any easy way to do this?</p><p>Anthony</p>","166712","","","","","2009-10-17 02:11:51","Android RadioButton return a constant?","<database><android><radio-button><constants>","1","0","2","",""
"1581440","1","1582661","","2009-10-17 04:47:44","2","6612","<p>I've been trying to bind a service that was started on boot from an activity. The code for starting on boot was mostly taken from the <a href=""http://www.google.com/codesearch/p?hl=en#XLdVEa1vc-g/"" rel=""nofollow"">instant messenger</a>.</p><p>This is the AndroidManifest.xml definition for the 3 main components:</p><pre><code>	&lt;!-- Receiver --&gt;	&lt;receiver android:name="".receiver.LifestylePPAutoStarter""		android:process=""android.process.lifestylepp""&gt;		&lt;intent-filter&gt;			&lt;action android:name=""android.intent.action.BOOT_COMPLETED""/&gt;		&lt;/intent-filter&gt;	&lt;/receiver&gt;	&lt;!-- Service --&gt;	&lt;service android:name="".service.LifestylePPService""		android:process=""android.process.lifestylepp""		android:enabled=""true""		android:exported=""true""&gt;		&lt;intent-filter&gt;			&lt;action android:name=""edu.gatech.lifestylepp.ILifestylePPService"" /&gt;			&lt;action android:name=""edu.gatech.lifestylepp.SERVICE"" /&gt;		&lt;/intent-filter&gt;	&lt;/service&gt;	&lt;!-- Activity --&gt;	&lt;activity android:name="".app.LifestylePPActivity""		android:label=""@string/app_name""&gt;		&lt;intent-filter&gt;			&lt;action android:name=""android.intent.action.MAIN"" /&gt;			&lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;		&lt;/intent-filter&gt;	&lt;/activity&gt;</code></pre><p>The receiver starts the service on boot without any problems. However when I try to bind the service from my activity, Context::bindService returns true, but ServiceConnection::onServiceConnected is never called. Also, when I start the service from the activity it works as expected (ServiceConnection::onServiceConnected is called).</p>","191584","","","","","2011-10-11 17:54:33","ServiceConnection::onServiceConnected not called even though Context::bindService returns true?","<android><service>","1","0","1","",""
"1582182","1","3970823","","2009-10-17 13:08:57","2","5173","<p>I have a <code>TextView</code> inside a <code>LinearLayout</code>. The <code>LinearLayout</code> is able to receive focus, and I want the <code>textColor</code> of the <code>TextView</code> to change when it does. I thought using a <a href=""http://developer.android.com/reference/android/content/res/ColorStateList.html"" rel=""nofollow"">ColorStateList</a> would work, but it would seem that the <code>TextView</code> does not receive focus when the <code>LinearLayout</code> does. I know that, because I have tried this code:</p><pre><code>mTextView.setOnFocusChangeListener(new OnFocusChangeListener() {    @Override    public void onFocusChange(View v, boolean hasFocus) {    	Log.d(TAG, ""Changed TextView focus to: "" + hasFocus);    }});</code></pre><p>And nothing gets logged. I don't want to use an <code>OnFocusChangeListener</code> on the LinearLayout to change the <code>textColor</code> of the <code>TextView</code>, I think this has to be done from XML. The reason for that is because in another activity I have an <code>ExpandableListView</code> with a custom adapter and custom views and Android changes the <code>textColor</code>s of the <code>TextView</code>s (from light to dark) inside my custom views when items are focused.</p>","180784","","","","","2012-04-28 05:00:02","Android: change TextView textColor when parent is focused","<java><android><focus><themes>","2","0","1","",""
"1582326","1","1584591","","2009-10-17 14:39:34","1","4211","<p>I am pondering the alternatives on how to scroll an ""infinite"", scale-like, control in android. The simple idea is to redraw the entire view on each scroll movement, but somehow it doesn't seem like the proper way. It is possible to draw the contents before-hand, but I have no clue how wide I should make the view in the first place, and what happens when the user scrolls to the end of the view? I guess I need to extend the view towards that direction. </p><p>Should I go towards programatically adding (and removing) chunks of view to a linear layout? It would be great to hear what experiences are out there regarding drawing this kind of long-scrolling custom control.</p><p>Thanks/Erik</p>","191704","","","","","2012-02-04 20:04:29","How to scroll ""infinitely"" wide view in Android?","<android><scrolling><custom-view><custom-scrolling>","3","1","3","",""
"1583237","1","1583441","","2009-10-17 21:16:48","1","1959","<p>All,</p><p>1.) I have a Dialog showing on my application. Right now it is showing in the center of the device. But i want to see that dialog in Top of layout. How to move it?</p><p>2.) How to add an image in a Dialog box?</p><p>EDIT: I added an image in background of Button. I want to move this button into right corner of  Pop up Dialog. How to do that? And also i want to know how to move the entire Pop up Dialog itself into Top of the Layout screen?As i'm new to this development, please some one suggest me how do i achieve this?</p><p>EDIT:CAN SOME ONE TELL ME HOW TO MAKE THREE CONTROLS IN A SINGLE LINE USING LAYOUT? I WANT TO SHOW AN IMABE, A BUTTON AND TEXT LABEL IN A SINGLE LINE. I TRIED THAT ON LAYOUT IN ECLIPSE. BUT IT ACCEPTS ONLY ONE CONTROL FOR ONE LINE, IF ADD NEXT CONTROL IT GOES TO NEXT LINE(ROW). I WANT TO MAKE THREE CONTROLS TO BE IN SINGLE LINE. HOW DO I ACHIEVE THIS?</p>","187532","","243782","","2010-08-13 09:31:43","2012-03-01 11:08:20","i want to see the dialog in Top of layout. How to move it?","<android><sdk>","2","1","","",""
"1583692","1","1584607","","2009-10-18 01:17:38","1","944","<p>I am using the Android Emulator to debug my application, first off it is ridiculously slow, I mean like 15mins to load slow and on top of it, my Alarm Clock application fails?</p><p>Am I the only one, or do other people experience this? Is there a fix or will I just have to go cook steaks while the emulator is booting?</p><p>EDIT: I am running it on a Vista laptop, which as fixxed describe does not work well with the alarm clock failing, but I don't think it could be my laptop, its 2GB RAM Intel Dual CPU T2390 1.87GHz, its not even a year old. Could it be that I am creating new AVD's each time I run the emulator?</p><p>Anthony</p>","166712","","166712","","2009-10-18 15:07:29","2011-03-11 15:47:06","Android Emulator Alarm Clock Crashes","<android><crash><emulator><alarm>","4","0","","",""
"1584940","1","2321879","","2009-10-18 13:51:09","5","10390","<p>I've been trying to make my app implement the built in quick search, similar to how it is done in ApiDemos' ""app/search/invoke search"". I have tried everything from trying to follow different examples, to copying the code exactly as it is in ApiDemos.</p><p>All I've found for the former have been concerned with older versions of the SDK, and simply not worked. As for the stuff that I can actually run and see working in ApiDemos, I've tried copying the following</p><pre><code>com.example.android.apis.app.SearchInvoke.javacom.example.android.apis.app.SearchQueryResults.javacom.example.android.apis.app.SearchSuggestionSampleProvider.javares/layout/search_invoke.xmlres/layout/search_query_results.xmlres/values/arrays.xmlres/values/strings.xmlres/xml/searchable.xml... and everything under ""Search Samples"" in AndroidManifest.xml</code></pre><p>This copying gets me a view that looks exactly like the one I'm facing when running ApiDemos, but when I click the search button, in the quick search box, Android always just opens up a browser window, with Google search results for the given query. I simply cannot find the critical component in ApiDemos that tells android that I want to use my own custom code for handling the search request.</p><p>I would really appreciate some help in this matter. Both documentation and other online resources seem very lacking when it comes to this.</p><p>Thanks.</p>","133802","","","","","2010-02-23 21:28:43","android app search button","<android><quick-search>","4","0","1","",""
"1585714","1","1585809","","2009-10-18 18:56:23","1","464","<p>How Good are broadcast intents in terms of say I wanted to fire broadcast intents 10times a second for half hour. Right now i have a service doing this and it runs perfectly well until the user rotates the screen, and then it gets all messed up and stupid and gives errors. However broadcast intents are short live objects and so how would these perform in my conditions?</p>","117691","","","","","2009-10-18 19:34:24","Broadcast Intents Android","<android>","1","0","","",""
"1586685","1","4039822","","2009-10-19 02:13:34","17","31652","<p>Getting an Exception in the BitmapFactory. Not sure what is the issue. (Well I can guess the issue, but not sure why its happening)</p><pre>ERROR/AndroidRuntime(7906): java.lang.OutOfMemoryError: bitmap size exceeds VM budgetERROR/AndroidRuntime(7906):     at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:295)</pre><p>My code is pretty straight forward. I defined an XML layout w/ a default image. I try to load a bm on the SDCard (if present - it is). If not it shows the default image. Anyway.. Here is code :</p><pre><code>public class showpicture extends Activity {  public void onCreate(Bundle savedInstanceState) {         /** Remove menu/status bar **/         requestWindowFeature(Window.FEATURE_NO_TITLE);         final Window win = getWindow();            win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);            Bitmap bm;         super.onCreate(savedInstanceState);         setContentView(R.layout.showpicture);            try {         ImageView mImageButton = (ImageView)findViewById(R.id.displayPicture);         bm = Bitmap.createScaledBitmap(BitmapFactory.decodeFile(""/sdcard/dcim/Camera/20091018203339743.jpg""),100, 100, true);         parkImageButton.setImageBitmap(bm);         }         catch (IllegalArgumentException ex) {          Log.d(""MYAPP"",ex.getMessage());         }             catch (IllegalStateException ex) {</code></pre><p>It fails on the <code>bm=Bitmap.createScaledBitmap</code> any thoughts? I did some research on the forums, and it pointed to <a href=""http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html"">this post</a>I just don't know why it is not working. Any help would be great! Thanks,</p><p>Chris.</p>","393258","","21234","","2012-02-19 10:13:57","2013-02-18 01:54:57","OutofMemoryError: bitmap size exceeds VM budget (Android)","<android><exception><bitmap><virtual-machine>","9","1","8","",""
"1587028","1","4059553","","2009-10-19 04:55:04","25","39369","<p>I declare my Spinner in the following manner (it's very static so Ihave 2 string arrays in <code>array.xml</code> for titles and values)</p><pre><code>&lt;Spinner android:id=""@+id/searchCriteria"" android:entries=""@array/searchBy"" android:entryValues=""@array/searchByValues""&gt;&lt;/Spinner&gt;</code></pre><p>I expect <code>spinner.getSelectedItem()</code> to return an array <code>[title, value]</code>but in fact it returns just a title String. Is it ignoring<code>android:entryValues</code>? How do I get a value, not a title from it? Isthis doable with XML only or do I need to create adapter and do itprogrammatically? </p>","135946","","","","","2013-11-12 05:21:53","Android - configure Spinner to use array","<android><arrays><spinner>","4","1","15","",""
"1587056","1","2206684","","2009-10-19 05:06:56","72","29760","<p>I have to concatenate these two strings from my resource/value files:</p><pre><code>&lt;string name=""Toast_Memory_GameWon_part1""&gt;you found ALL PAIRS ! on &lt;/string&gt;&lt;string name=""Toast_Memory_GameWon_part2""&gt; flips !&lt;/string&gt;</code></pre><p>I do it this way :</p><pre><code>String message_all_pairs_found = getString(R.string.Toast_Memory_GameWon_part1)+total_flips+getString(R.string.Toast_Memory_GameWon_part2);Toast.makeText(this, message_all_pairs_found, 1000).show();</code></pre><p>BUT THE SPACES at the end of the first string and at the beginning of the second stringhave disappeared (when the Toast is shown) ...</p><p>What should I do ?</p><p>I guess the answer is somewhere here :<a href=""http://developer.android.com/reference/java/util/regex/package-descr.html#impnotes"">http://developer.android.com/reference/java/util/regex/package-descr.html#impnotes</a></p><p>or is it something like using &amp; for the ""&amp;"" caracter ??</p>","116573","","","","","2013-11-23 04:45:56","Android - String concatenate - how to keep the spaces at the end and/or beginning of String?","<android><string-concatenation>","7","2","18","",""
"1587813","1","","","2009-10-19 09:49:25","3","2071","<p>I'm using the following code :</p><pre><code>Intent sendMailIntent = new Intent(Intent.ACTION_SEND);         sendMailIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.Share_Mail_Subject));        sendMailIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.Share_Mail_Text));         sendMailIntent.setType(""text/plain"");startActivity(Intent.createChooser(sendMailIntent, ""Email / SMS / Tweet ?""));</code></pre><p>Then I would like to be able to make the difference between:1. my user has indeed sent en email/SMS ... OR2. my user has in fact pushed the BACK BUTTON ... and didn't send anything.</p><p>Is there a way to make this difference ?</p><p>=> Should I launch the activity with startActivityForResult ? and catch the requestCode/resultCode with onActivityResult ...</p><p>=> What king of resultCode should I expect ? how to grab it correctly ? Where should I put these lines of code ? Any snippet of code would be very helpful here.</p><p>thanks in advance.</p><p>Hub</p>","116573","","","","","2011-08-17 18:41:20","Android: Sending a Mail/SMS/Tweet with Intent.ACTION_SEND / requestCode / resultCode?","<android><sendmail><sendmessage>","1","0","2","",""
"1587886","1","1597701","","2009-10-19 10:09:37","1","473","<p>Did anybody watch jsharkey's <a href=""http://code.google.com/intl/fr-FR/events/io/2009/sessions/CodingLifeBatteryLife.html"" rel=""nofollow"">battery life google io presentation</a> ? </p><p>How does one toggle the option returned by ConnectivityManager#getBackgroundDataSetting() in the emulator ?</p>","27328","","","","","2009-10-20 22:33:56","How to toggle the option returned by ConnectivityManager.getBackgroundDataSetting()?","<java><android><networking>","1","0","","",""
"1588061","1","1588267","","2009-10-19 11:01:12","32","17272","<pre><code>    &lt;application&gt;         &lt;receiver android:name="".MyBroadcastReceiver"" android:enabled=""true""&gt;                &lt;intent-filter&gt;                      &lt;action android:name=""android.intent.action.ACTION_SCREEN_ON""&gt;&lt;/action&gt;                      &lt;action android:name=""android.intent.action.ACTION_SCREEN_OFF""&gt;&lt;/action&gt;                &lt;/intent-filter&gt;         &lt;/receiver&gt;...    &lt;/application&gt;</code></pre><p><code>MyBroadcastReceiver</code> is set just to spit foo to the logs. Does nothing.Any suggestions please? Do I need to assign any permissions to catch the intent?</p>","53330","","","","","2013-11-27 05:49:18","Android - how to receive broadcast intents ACTION_SCREEN_ON/OFF?","<android><broadcast>","3","0","24","",""
"1588176","1","1588257","","2009-10-19 11:31:07","0","304","<p>I am a complete newbie to Android development;</p><p>Basically, I am about to write an application, that will let the user to take photo, which (with a bunch of extra data) will be submitted to the remote webservice.</p><p>So I'm guessing I will need:</p><ol><li>A Photo-taking application (Activity) that will gather all the extra data and put in the SQLite DB.</li><li>A background service looking up the DB in time intervals and sending the data over the Internet, optionally making web requests with current GPS location (I'm trying to keep in mind, that sometimes network would not be accessible).</li><li>A receiver object that will run the service at boot, and optionally check if the service needs to be restarted.</li></ol><p>My concerns are:</p><ol><li>Do I really need to monitor the service and care about anything bad that could kill it.</li><li>Will the battery last for at least 12 hours with a non-stop running service, making some networking/GPS actions in, let's say, 30-minute intervals. (G1/Dream)</li><li>What else should I be careful about?</li></ol><p>Any ideas/suggestions will be appreciated.</p>","53330","","","","","2009-10-19 11:53:05","Android app components - a word of advice needed","<java><android><mobile><mobile-phones>","1","0","","",""
"1588378","1","2671646","","2009-10-19 12:23:57","3","6163","<p>Are there any possibilities to extract contacts in some of the following formats, vCard, hCard or json/xml, using the standard Android API?</p>","","anon","","","","2011-09-28 19:27:10","Android contacts extraction","<android>","4","1","2","",""
"1590340","1","1590476","","2009-10-19 18:35:55","9","14140","<p>We're in the process of writing an app that has 4 tabs: Map, People, Places, Events.  The People, Places, and Events in the App show up as Icons on the map.  By default the People, Places, and Events tabs each show a listview, custom rendered, displaying all the People, Places, and Events respectively.</p><p><img src=""http://web6.twitpic.com/img/37202700-f92052dc474b74e1760edda1c47f6940.4adcb134-scaled.png"" alt=""alt text"" /></p><p>Now, right now each of the tabs has as its content an Intent set to launch the corresponding activity.  For instance, there is a MapTabActivity that extends MapActivity, a ShowPeopleListActivity that shows the people, and so on and so forth.  </p><p>I see a <a href=""http://stackoverflow.com/questions/1088810/how-to-communicate-between-android-tabs"">lot</a> <a href=""http://stackoverflow.com/questions/1306689/launching-activities-within-a-tab-in-android"">of</a> <a href=""http://stackoverflow.com/questions/1162659/best-way-to-accomplish-inter-activity-communication-in-an-android-tabhost-applica"">StackOverflow</a> <a href=""http://stackoverflow.com/questions/1568739/android-why-shouldnt-i-use-activities-inside-tabs"">questions</a>/answers saying that due to various limitations in the way the TabHost is setup, it's best NOT to use activities as the content of tabs.  For instance, it's impossible to launch a new activity and have it take the place of the existing activity within a tab, whereas it's possible to switch out a View with a different view.  </p><p>Now, I'm at a crossroads.  We've (for better or worse) devoted a fair amount of time trying to get this app to work the way it's currently structured, with the Activities as the content of the tabs.  When an icon corresponding to a Person, Place, or Event is clicked, it fires off a VIEW Intent on a URI corresponding to that object; this is picked up by an Activity that then shows the object.  The same mechanism is at work both in the Map and in the individual lists.  We really like the loose coupling this provides us; we just give a VIEW command and the URI to the person/place/event and it automatically brings us to the right activity.  Granted, the activity that's launched covers up the tab view rather than appearing inside of that, but we were willing to live with this.</p><p>Here's an issue though:  from the Show activity, we want to be able to go back to the map, centered at that person, place, or event.  We can launch a new activity to show the map again, but now we have the map activity as the content of the tab, plus the show activity, plus the new map activity in the activity stack; given how resource intensive the map activity is, I'm guessing this is not the ideal way to go.</p><p>I guess my question is, is there a GOOD tutorial somewhere showing exactly how to do complex tasks with a TabHost?  I've seen <a href=""http://developer.android.com/guide/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">HelloTabWidget</a>; I'm looking for something much more sophisticated than this.  I'm worried that if we switch to the View based way of doing things, we'll have to do a LOT of housekeeping to intercept all the back events, try to switch out the views, etc., etc., as well as strongly coupling our program in a way we don't want.  </p><p>Any suggestions on a way forward would be extremely appreciated.  We're new to Android so we're trying to follow the established best practices, but it's difficult when the few examples we've seen are too simplistic for our use case.</p>","155392","","","","","2012-04-04 11:56:39","Android - Tabs, MapView, activities within tabs","<java><android><android-widget>","3","0","12","",""
"1591164","1","","","2009-10-19 21:09:02","7","3535","<p>Has anyone succeeded in running the Java bindings for dbus on Android? All indications point at dbus already running as a process within the Android OS, but there is no official access point for them through the Java interface.  Thanks in advance!</p>","180739","","","","","2011-05-25 22:15:43","Getting Java Binding for Dbus to Run on Android","<java><android><dbus>","2","0","1","",""
"1592559","1","1595840","","2009-10-20 05:02:53","2","8004","<p>I've created a simple android game, based on the Lunar Lander sample, and I'm having a problem with handling key events.  When the activity starts, the only keys that onKeyDown or onKeyUp get called for are the dpad up/down/left/right keys.  Neither the menu, back, or dpad_center keys trigger onKey methods.  However, once I've pushed one of the dpad up/down/left/right buttons, pressing the menu, back, or dpad_center keys do trigger these methods.  I'm not getting any errors, or any indication of what's going wrong.</p><p>It's possible that the focus is set wrong - the activity is started from a button on screen, so it could be in touchscreen mode.  If that's the case, shouldn't touching the back button get me in to the right focus mode so that I can catch the event?</p><p>I'm using the emulator from SDK-1.5r3.  I have not been able to try this on a real phone yet.  Here's my onKeyDown.</p><pre><code>public boolean onKeyDown(int keyCode, KeyEvent msg){    Log.d(TAG, ""onKeyDown: "" + keyCode);    return super.onKeyDown(keyCode, msg);}</code></pre><p>Thanks</p><p>Matt </p>","1322","","","","","2012-12-14 03:20:23","onKeyDown not always called in Android app","<android><gui><events>","1","0","1","",""
"1593022","1","","","2009-10-20 07:41:50","4","1966","<p>I am trying to register a Broadcast Receiver to receive broadcast events for the package events. Following is the code and my receiver in the manifest file. The log statment never happens, but I can clearly see the same broadcast firing for ""HomeLoaders"" (the Launcher) debug statements. What am I missing?</p><pre><code>public class IntentListener extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        // TODO Auto-generated method stub        Log.i(""INTENT LISTNER:"", intent.getAction());    }}&lt;receiver android:name=""IntentListener"" android:enabled=""true"" android:exported=""true""&gt;    &lt;intent-filter&gt;        &lt;data android:scheme=""package""&gt;&lt;/data&gt;        &lt;action android:name=""android.intent.action.PACKAGE_ADDED""&gt;&lt;/action&gt;        &lt;action android:name=""android.intent.action.PACKAGE_ADDED""&gt;&lt;/action&gt;        &lt;action android:name=""android.intent.action.PACKAGE_CHANGED""&gt;&lt;/action&gt;    &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre>","192896","","63550","","2013-08-10 06:55:55","2013-08-10 06:55:55","Can't receive broadcasts for PACKAGE intents","<android>","3","1","2","",""
"1593529","1","1596453","","2009-10-20 09:45:50","12","34463","<p>What is the way (if there is a way) to customize the menu (the one triggered by the MENU button of the phone). I'm especially interested in two things:</p><ul><li>changing the background color from the standard light gray into a darker gray</li><li>how the menu items are aligned. I have 4 items and they are automatically aligned 2x2, but I would prefer to have them all in one line (1x4)</li></ul>","184367","","56285","","2013-11-19 23:42:08","2013-11-19 23:42:08","Android: customize application's menu (e.g background color)","<android><customization><android-menu>","6","1","6","",""
"1593810","1","1596263","","2009-10-20 10:54:55","2","436","<p>Is it possible and if yes, how to start application directly from email, or browser.</p><p>What I want to achieve:user receives in email some activation link, clicks it and he is redirected to app, possibly with some Extras put into intent.</p><p>Thanks in advance,Patryk</p>","186268","","179850","","2011-02-21 19:12:39","2011-02-21 19:12:39","How to start application in android system directly from the browser?","<android>","1","0","","",""
"1593813","1","2432615","","2009-10-20 10:55:14","7","841","<p><a href=""http://www.j2mepolish.org"" rel=""nofollow"">J2ME Polish</a> claims to support <a href=""http://www.j2mepolish.org/cms/leftsection/documentation/platforms/android.html"" rel=""nofollow"">porting of existing J2ME applications to Android</a>. Has anyone tested the quality of such a port. How reliable is it?</p>","77087","","","","","2011-03-15 12:32:37","Are there any benchmarks on J2MEPolish converting a J2ME app to Android?","<android><java-me><porting><j2mepolish>","1","0","2","",""
"1594018","1","","","2009-10-20 11:40:52","6","2841","<p>I am using android's default camera to click images from within my app. I want to stop the click sound that it does on clicking an image. Is there a way to stop that click sound programtically?</p><p>Thanks.</p>","152867","","","","","2013-02-13 11:13:44","stop camera click sound programmatically in android","<android>","4","1","3","",""
"1594668","1","","","2009-10-20 13:38:50","1","1848","<p>I should write in the title instead of 'doesn't work' something like 'Idon't know how to do it' but the first version feels better :).What I am trying to do is the following:</p><ol><li>Download the xml from the web, parse it and create ArrayList of someobjects (done and working)</li><li>Display the objects using custom Adapter (doesn't work)</li></ol><p>The second one works if I add the items to my ArrayList before I add it tothe view using</p><pre><code>m_orderAdapter = new OrderAdapter(this,m_orders); //code for orderadapterbelowsetListAdapter(m_orderAdapter);</code></pre><p>I have found on the web something like this: (in my onCreate method)</p><pre><code>handler = new Handler();        viewOrders = new Runnable(){            @Override            public void run() {                getOrders();            }        };        new Thread(){            @Override            public void run(){                handler.post(viewOrders);            }        }.start();</code></pre><p>then, the following code for the methods:</p><pre><code>private void getOrders(){      try{          OrderManager om = new OrderManager();           m_orders = om.getOrdersFromWeb();           Log.i(""ARRAY"", """"+ m_orders.size());      } catch (Exception e) {          Log.e(""BACKGROUND_PROC"", e.getMessage());      }      runOnUiThread(returnRes);    }</code></pre><p>OrderManager downloads and parse the xml into Order objects and returnsarray list of those. Then I set this list to my member array list m_orders.Once downloading and parsing is done I run returnRes method on the ui threadusing <code>runOnUiThread</code> method</p><pre><code>private Runnable returnRes = new Runnable() {        @Override        public void run() {            if(m_orders != null &amp;&amp; m_orders.size() &gt; 0){                Log.i(""ORDER"",m_orders.get(0).getOrder_id());                setListAdapter(m_orderAdapter);                m_orderAdapter.notifyDataSetChanged();            }          m_orderAdapter.notifyDataSetChanged();        }      };</code></pre><p>and I call notifyDataSetChanged() on my adapter.</p><p>The view I do all this stuff extends ListView and the code for the adapteritself is listed below:</p><pre><code>public class OrderAdapter extends BaseAdapter{    private Context ctx;    private List&lt;Order&gt; orders;    public OrderAdapter(Context ctx, List&lt;Order&gt; orderLst){        this.ctx = ctx;        this.orders = orderLst;    }    @Override    public int getCount() {        return orders.size();    }    @Override    public Object getItem(int pos) {        return orders.get(pos);    }    @Override    public long getItemId(int position) {        return position;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        Order o = orders.get(position);        return new OrderListAdapterView(this.ctx,o);    }}</code></pre><p>When I debug I have the data inside my m_orders list but when I callnotifyDataSetChanged nothing happens, I've read that I have to execute thaton the UI thread which I think I do. So whats the problem ?any help highly appreciated, or maybe just a link to the nice tutorial onthe web explaining this issue on how to update the list view at runtime ?</p>","164460","","996493","","2012-04-28 04:44:13","2012-04-28 04:44:13","Android listview item doesn't appear","<android><listview>","1","0","1","",""
"1595429","1","1596147","","2009-10-20 15:22:05","4","7124","<p>I'd like to map an Array of ""complex"" data to a ListView. In a very simplified form my data model would look like something like this:</p><pre><code>class ListPlacesValues {  String idObject;  String name;  String city;  String country;  ArrayList&lt;String&gt; classification;  double distance_quantity;  DistanceUnit distance_unit;            [...more stuff ...]}</code></pre><p>I know that I can convert my complex data into a HashList and then just use a SimpleAdapter:</p><pre><code>   SimpleAdapter mAdapter = new SimpleAdapter(     this,     hashList,     R.layout.places_listitem,     new String[] { ""name"", ""city"", ""country""},      new int[] { R.id.name, R.id.city, R.id.country}   );  </code></pre><p>However, I would rather use my data model directly, but I've no idea where and how to start, so that in the end I can do something like this:</p><pre><code>ArrayList&lt;ListPlacesValues&gt; values = getData();  MyAdapter mAdapter = new MyAdapter(          this,          values,          R.layout.places_listitem,          ListPlacesValues { values.name, values.city, values.country},           new int[] { R.id.name, R.id.city, R.id.country});  </code></pre><hr><p><strong>Solution:</strong> I found this Android API sample (<a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html"" rel=""nofollow"">List14</a>), which was really helpful.</p>","184367","","184367","","2010-09-29 11:33:37","2010-09-29 11:33:37","Android: ListView with complex data model","<android><listview><adapter>","2","2","1","",""
"1596325","1","1649687","","2009-10-20 18:02:29","0","1354","<p>I was wondering if there is a way to observe the system calls in Android using a service... Is something like this remotely possible using Java or do I have to get down into native code...?</p><p>Thanks</p>","184046","","","","","2009-10-30 12:57:54","Android: Is it possible to observe system calls?","<android><event-handling><system-calls>","2","0","1","",""
"1596947","1","1597342","","2009-10-20 20:00:20","16","17790","<p>I'm working on an application that lists a stored library using a ListActivity.</p><p>My question is, is when I open application it has a visible loading time before the XML view is inflated. During this time only the application name is shown. This is noticeable on quite a few application out there but others seem to have implemented loading screens and what not. </p><p>Does anyone have a solution to this or know how to make a good loading screen?</p><p>Cheers!</p>","173892","","","","","2011-06-08 18:16:27","Android application loading screen","<android>","2","0","6","",""
"1596980","1","1597952","","2009-10-20 20:05:50","2","262","<p>I'm trying to set the background of a RelativeLayout to a particular color.  However, the color that's being displayed by the emulator and by the device is off by quite a bit.  </p><p>For example, </p><pre><code>&lt;RelativeLayout    android:background=""#e1e5e8""    android:layout_width=""wrap_content""    android:layout_height=""85px""&gt;</code></pre><p><code>#e1e5e8</code> is a nice silvery color.</p><p>However, when I view the that layout in the emulator, the color I get back (using xScope on Snow Leopard to get the pixel values) is <code>#e7e7ef</code>, which looks a bit purpley.</p><p>Looking at the view on the G1 also looks a bit off from what I want.  If I take a screenshot of the G1 using the debugger and examine the pixels, they too are <code>#e7e7ef</code>.</p><p>What gives?  It seems like it must be more than simply a gamma issue, no?</p>","82156","","","","","2009-10-20 23:43:10","Android colors aren't reflected properly in emulator or device","<android><colors>","1","0","","",""
"1598119","1","4313329","","2009-10-21 00:34:14","121","132620","<p>I have a TextView and I'd like to add a black border along its top and bottom borders.  I tried adding <code>android:drawableTop</code> and <code>android:drawableBottom</code> to the TextView, but that only caused the entire view to become black.</p><pre><code>&lt;TextView    android:background=""@android:color/green""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:drawableTop=""@android:color/black""    android:drawableBottom=""@android:color/black""    android:text=""la la la"" /&gt;</code></pre><p>Is there a way to easily add a top and bottom border to a View (in particular, a TextView) in Android?</p>","82156","","56285","","2013-10-23 13:08:30","2014-02-07 12:53:37","Is there an easy way to add a border to the top and bottom of an Android View?","<android><border><android-view><android-textview>","12","0","66","",""
"1598461","1","1603651","","2009-10-21 02:38:05","0","3860","<p>I have a MenuItem in my Android application that deletes all the values in the database, its used more for my debugging purposes, after a while, inserting dummy values get redundant. Anyways, I have used LogCat to debug my program as it runs in the emulator and it gives me an error:</p><pre><code>Failure 21 (out of memory) on 0x0 when preparing 'DELETE FROM &lt;MY DBTABLE&gt;'</code></pre><p>I can post the code but I doubt its the code.</p><pre><code>public void deleteAll(SQLiteDatabase db) {   try {        db.execSQL(""DELETE FROM "" + DATABASE_TABLE);}         Log.v(TAG, ""Deleting database"");        db.execSQL(""DROP TABLE IF EXISTS "" + DATABASE_TABLE);        Log.v(TAG, ""Dropping table"");        onCreate(db);        Log.v(TAG, ""Creating new database"");}    catch (NullPointerException e) { }   catch (SQLException e) {}   } }    @Overridepublic void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stubdb.execSQL(""CREATE TABLE "" + DATABASE_TABLE + ""(ID INTEGER PRIMARY KEY AUTOINCREMENT,""
+ ""LATITUDE INTEGER NOT NULL, LONGITUDE INTEGER NOT NULL, RATING INTEGER NOT NULL)"");}</code></pre><p>This isnt my existing function, I had originally had just the:</p><pre><code>db.execSQL(""DELETE FROM "" + DATABASE_TABLE);</code></pre><p>but it didn't work, so I commented it out and then tried dropping the table first and <b>THEN</b> create a new table, but same error every time.</p><p>Does anyone know why this error occurred or a way for this error not to?</p><p><b>EDIT:</b> This method does not run inside of a loop, its part of a Menu button, that when you select it, invokes the deleteAll() method. A point to note that I call this method through an Adapter class I had made, just to clarify here is the step-through of my code:</p><pre><code>private TrackerDBAdapter db;public boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case VIEW_DATABASE:        Log.v(TAG, ""Clicking on the view database menu option"");        Toast.makeText(this, ""This should show the databases."",                Toast.LENGTH_LONG).show();        return true;    case DELETE_VALUES:        Log.v(TAG, ""Clicking on the delete values menu option"");        db.deleteAll();        Toast.makeText(this, ""Database is empty"",                Toast.LENGTH_LONG).show();        return true;    }</code></pre><p>Then inside my TrackAdapter class. The variable dbhelper is a DatabaseHelper object, which has the first deleteAll(SQLiteDatabase db) code in the question.</p><pre><code>private DatabaseHelper dbhelper;private SQLiteDatabase db;public void deleteAll() {        dbhelper.deleteAll(db);}</code></pre><p>I do not remember why I call a method, to call another method. It was out of desperation perhaps? But anyways, I am going to fiddle around with it and see if I clean up the code, maybe by doing so I can answer my own question.</p>","166712","","16036","","2010-07-08 20:55:47","2010-07-08 20:55:47","Android Database error?","<sql><android><database>","1","2","","",""
"1599026","1","1599593","","2009-10-21 06:21:59","0","1208","<p>Is it possible to create a <code>custom ContentProvider</code> to</p><ul><li>Access android existing database (e.g. Contacts, SMS)?</li><li>Extend an Exciting ContentProvider which has access to android existing database (e.g. ContactsProvider to access Contacts DB)?</li></ul><p>Thank you.</p>","128983","","1043882","","2012-08-29 06:13:12","2012-08-29 06:13:12","Android custom ContentProvider","<android><android-contentprovider>","1","0","1","",""
"1599725","1","1600865","","2009-10-21 09:35:35","12","1547","<p>There's a lot of mobile platforms out there at the moment; iPhone, Android, WebOS, Symbian. If creating a startup for mobile development (i.e. as a commercial endeavour, not a hobby), which mobile platform is worth focusing on?</p>","130659","","50049","","2009-10-22 13:59:42","2009-11-27 10:11:42","Which mobile programming environment do you recommend for a startup to target?","<iphone><android><symbian><webos>","15","4","5","2012-08-09 12:44:19",""
"1600225","1","1603258","","2009-10-21 11:24:52","1","1894","<p>I'm learning the Android api from a book, and it seems like there isn't any mention of a stream-lined api for dealing with raw xml (reading <em>and</em> writing).  His suggestion for parsing is the XmlPullParser, and his examples look horrendous considering the kind of api's I'm spoiled by in other platforms (LINQ to XML especially).  Is this the best available technique on the Android platform?  Obviously I can write a wrapper to avoid the repetitive stuff, but I'd be surprised if no such thing already exists.  Also, he doesn't even make mention of creating xml structures in code.  What are my options for both?</p><p>On a side note, do any Java devs that are familiar with LINQ to XML in .Net know of anything equivalent in Java?</p>","53501","","","","","2009-10-22 11:02:18","Stream-lined xml builder/parser in Android?","<java><xml><android>","3","0","2","",""
"1600634","1","1600715","","2009-10-21 12:53:32","2","2010","<p>Does anyone know where to find informations about streaming protocols supported by Android.</p><p>As I have to write an official documentation I don't want to rely on any blog post and would like to find the official Android (Google) specifications.</p><p>Thanks!</p>","22996","","","","","2009-10-21 13:06:21","Android: supported streaming protocols","<android><documentation>","1","0","3","",""
"1600650","1","1603214","","2009-10-21 12:56:23","1","6269","<p>I'm developing on Android and currently haev various methods which manage my database in a convenient class.</p><p>What I'd ideally like, though, is a (preferably GUI) sql client that would allow me to view the contents of a different apps' DB.</p><p>Eg:</p><p>I install my own app (App1). It creates and uses a DBI install I use SQLClient to examine App1's DB.</p><p>Does anyone know if anything like this exists? If not, I can see a way that it could be implemented assuming I can get permission (and a naming convention) for accessing another apps' DB.</p><p>Any ideas/suggestions greatly appreciated.</p><p>As an alternative, I'd be willing to run something on the PC while the phone is connected via USB (I know there's a tool that comes with the android SDK but it's a little clunky and as I mentioned, a GUI would be preferable)</p>","156755","","30461","","2009-11-09 05:57:44","2012-03-22 12:31:40","SQL Client on Android","<android><sqlite><mobile>","4","0","2","",""
"1603901","1","1629448","","2009-10-21 21:57:47","11","3510","<p>I am working on a system on which currently linux kernel and microwindows windowing system is running. Code of current linux system drivers is available to me. I want to port android on it, just as a hobby project. </p><p>can you please tell me what all understanding of linux-kernel is required to port it?</p><p>Please give me references (Books, Tutorials) to build-up understandings.</p><p>Thanks, Sunny.</p><p>P.S. I have basic understanding of linux.</p><p>Configuration of device is </p><pre>450 Mhz ARM9,64 MB RAM,256 MB NAND480x272 resolution.</pre>","148869","","148869","","2009-10-23 04:19:01","2014-04-02 00:11:06","What knowledge/expertize is required to port android to custom arm device?","<android><linux><arm>","3","2","4","","2009-11-14 16:41:59"
"1605074","1","","","2009-10-22 04:50:49","1","11628","<p>I want to launch any one of the existing android applications (contacts, call dialer, etc.)from my app upon on click of a button.</p><p>All that I know is to get the Intent of the particular app and start the activity. But I don't  know how to set the class path for the intent for contacts.</p><p>Am I following the correct solution? What is the way to launch another application?</p>","142521","","309308","","2010-12-18 11:07:56","2010-12-18 11:07:56","How to launch android applications from another application","<android>","1","0","4","",""
"1606320","1","1606642","","2009-10-22 10:26:25","11","21711","<p>I've a ListView with items containing information about places with a <strong>rating</strong> and the <strong>distance</strong> to the current location.</p><p>The items are sorted into groups:</p><ul><li>Group 1: within 500m</li><li>Group 2: 500m - 1km</li><li>Group 3: 1km - 1.5km</li><li>...</li></ul><p>Withing these groups the items are sorted by their rating.</p><p>Now I put out these items via my custom adapter (extension of <code>BaseAdapter</code>) into the <code>ListView</code>, which works perfectly.</p><p>However, what I'd like to do is to put a separator before the each first item of each group. This separator can be a <code>TextView</code> saying e.g. <em>500m - 1km</em> followed by all the <code>ListView</code> items in that group.</p><p>Any idea on how to realize this?</p>","184367","","","","","2012-06-09 19:52:45","Android: custom separator (or even item) in ListView depening on content of item","<android><listview><separator>","2","0","16","",""
"1607477","1","1817794","","2009-10-22 14:06:21","3","5752","<p>I posted this on the android dev forums, but wanted to reach out here. </p><p>One of the activities in our app was taking a picture. The picture preview shows the correct way on screen in 1.5 &amp; 1.6, but when it is saved, it saves the jpg 90 rotated.</p><p>I can rotate it realtime when displaying, and I guess I could re-save it once saved. My issue is I would like to save it correctly when taking the picture.</p><blockquote>  <p>My app while compiled in 1.5 works fine. I had some memory issues w/      1.6 due to image size, which was strange b/c the image size increased      when taking photos by taking a picture w/ surfaceholder/imagecapture      callback. I seem to have fixed re-displaying those images by resizing      them using a bitmapfactory matrix. But my camera is now rotating      everything 90 degrees. It appears that my Override of surfaceChanged      does nothing, which is where I was setting rotation at 90 (I can't      remember why, it was 10 months ago!). I have tried at rotating the      camera parameters paramters at 90 degrees, 0 degrees. It does not seem      to do anything... any thoughts? </p></blockquote>","393258","","459","","2009-11-30 04:32:48","2009-11-30 06:36:12","Android 1.6 Camera rotation?","<android><camera><rotation>","1","0","3","",""
"1607822","1","2242698","","2009-10-22 14:56:29","4","811","<p>Im using google analytics to track the user in my android application, but in my log i keep getting warnings like: </p><pre><code>10-22 14:44:08.879: WARN/googleanalytics(1266): Dispatcher thinks it finished, but there were 56 failed events</code></pre><p>Anyone knows what the problem can be? Im using a correct account key?</p><p>Has somebody solved the problem with this appearing if there are no whitespaces?</p>","133858","","114066","","2010-07-23 14:20:17","2012-04-05 13:58:25","Android: What does this google analytics dispatcher warning mean?","<android><google-analytics>","2","6","2","",""
"1608632","1","1609593","","2009-10-22 17:07:44","11","56712","<p>So I'm trying to sample the gps coordinates just once in an application.  I don't want to create a LocationListener object to constantly get gps updates.  I want to wait until receiving the coordinates, and then proceed on to another task.</p><p>Here is a code snippet</p><pre><code>LocationManager lm = (LocationManager)act.getSystemService(Context.LOCATION_SERVICE);Criteria crit = new Criteria();crit.setAccuracy(Criteria.ACCURACY_FINE);String provider = lm.getBestProvider(crit, true);Location loc = lm.getLastKnownLocation(provider);</code></pre><p>The loc variable is always null in the emulator.  I tried using the command ""geo fix latitude longitude"" to set it, and also I tried using the DDMS way of setting it.  Neither method had any effect on the code.  Also the snippet isn't causing any exceptions.</p><p>Thanks for your help.</p>","189155","","","","","2010-12-27 14:46:04","Android LocationManager.getLastKnownLocation() returns null","<android><gps>","2","1","10","",""
"1608762","1","1615121","","2009-10-22 17:32:35","0","2585","<p>I have a ListView backed by customized ArrayAdapter where each item has 2 LinearLayouts - one I call head, and the other one - body.The body is hidden (gone) until user clicks on the row at which time it slides out. The second click (on the head) will hide the body. However if user clicks on the body it brings another activity. All of this works just fine, here comes the problem: </p><p>When user presses on body I want a visual indication of the action just the same way as regular list item will flicker an orange background when pressed. I'm not getting this by default since (my theory) the onPress event is intercepted by body's view and not processed by the list item. </p><p>The first thing I tried was to execute <code>body.setBackground('#ff00ff')</code> (never mind the color) in onPress event. That didn't work since (I suspect) there's no repainting after the call. Then I dig a little bit more and decided to use <code>&lt;selector/&gt;</code>-based background. I defined <code>body_background.xml</code> in <code>drawable</code> folder and assigned that to the body's background property.</p><p>There I noticed that background will only change if the even is processed by the list. For example if I set <code>&lt;item android:state_selected=""true"" android:drawable=""@drawable/selected""/&gt;</code> then when I press on the head - the background of both elements (head and body) will change, however when I press on body - nothing.</p><p>So to summarize my question - how do I change background of the child element in the list item if I assign custom onClick handler to it? Any hints will be greatly appreciated</p>","135946","","135946","","2009-10-22 17:50:15","2009-10-27 05:10:47","Android - fancy ListView background problem","<android><listview><background-color>","1","0","","",""
"1609573","1","1609662","","2009-10-22 19:53:20","46","20647","<p>I'd like to be able to prompt my app to open a link when the user clicks on a URL of a given pattern instead of allowing the browser to open it.  This could be when the user is on a web page in the browser, or in an email client, or within a WebView in a freshly-minted app.</p><p>For example, click on a YouTube link from anywhere in the phone and you'll be given the chance to open the YouTube app. </p><p>How do I achieve this for my own app?</p>","4737","","267702","","2013-04-30 23:09:47","2013-04-30 23:09:47","Intercepting links from the browser to open my Android app","<android><url-interception>","2","0","39","",""
"1610045","1","1610062","","2009-10-22 21:23:12","57","34906","<p>I am attempting to use the android NDK.</p><p>Is there a way to return an array (in my case an <code>int[]</code>) created in JNI to Java?  If so, please provide a quick example of the JNI function that would do this.</p><p>-Thanks</p>","135135","","1288","","2011-05-26 17:49:25","2013-05-10 01:49:09","How to return an array from JNI to Java?","<java><android><arrays><jni>","2","3","18","",""
"1610903","1","","","2009-10-23 01:08:11","0","4092","<p>My Android application stores all user data in a Sqlite database.  What are my options to backup/export/import/copy this data?  I know I can easily copy the database to the SD card.  I would also like to send the data to a network server.  Are there any packages/classes available to facilitate getting sqlite information to/from a network server?  Thanks for the help...</p>","152714","","","","","2013-12-24 17:20:12","Exporting Sqlite data from an Android Application","<database><android><sqlite>","3","2","","",""
"1612533","1","1614144","","2009-10-23 10:16:31","1","8333","<p>It seems that <code>DrivingDirections</code> have been removed since Android API 1.0</p><p>What's the way now to display a map with two points (one of them might be the current location, but can also be any other location) and the direction from one to another in Android 1.6?</p>","184367","","","","","2012-02-17 22:35:10","Android: DrivingDirections removed since API 1.0 - how to do it in 1.5/1.6?","<android><android-mapview><driving-directions>","5","0","2","",""
"1612628","1","","","2009-10-23 10:39:11","4","8778","<p>I want to determine the width and the height of the webview .i have already tried using</p><pre><code>webView.getWidth();webView.getHeight();</code></pre><p>but the log always show them 0.any help will be appreciated..</p><p>thanks....</p>","195224","","55093","","2011-06-10 15:58:06","2014-03-20 16:41:12","How to get width and height of a Webview in android","<android><android-widget>","8","2","1","",""
"1613703","1","1614959","","2009-10-23 14:06:49","19","4479","<p>Until recently, our app shared a single Apache HttpClient instance using the ThreadSafeClientConnManager across the whole application. The http client instance was held by a singleton class.</p><p>Since I dislike the singleton pattern for its numerous problems, I refactored our API accessor to be a per-thread object, but now for every thread (which mostly means per Activity/Service in our case) a new HttpClient instance is created.</p><p>It's not that I have problems with this new approach, but I've read that the Apache folks suggest to only have one instance per app for performance reasons.</p><p>Visually, what we did before was this:</p><pre><code>HttpClient (thread safe)          |          |         /\        /  \Activity1...ActivityN</code></pre><p>Now, we do this:</p><pre><code>Activity1 ... ActivityN    |             |    |             |HttpClient1   HttpClientN</code></pre><p>How do you guys do this in your applications? If you share one single HttpClient across your app and potentially many concurrent threads, how do you handle access to it?</p>","127013","","21234","","2012-05-18 18:28:04","2012-05-18 18:28:04","Android: One vs many instances of HttpClient per application","<android><concurrency><singleton>","1","2","16","",""
"1613737","1","1974214","","2009-10-23 14:12:39","3","14587","<p>Can Flash Media Server 3.5 serve a video rtsp stream to the Android media player?  </p><p>Or do we need to use Wowza or red5 to serve an rtsp stream to the Android media player rtsp client?</p><p>Are there any other rtsp servers to consider when the video needs to be viewed on Android (without the Adobe Flash app)?</p>","56488","","56488","","2011-01-04 20:05:27","2012-12-11 23:40:00","Server to stream RTSP to android","<android><fms><rtsp>","6","2","3","",""
"1616151","1","1617121","","2009-10-23 22:00:38","1","209","<p>We currently build our Android (Java) projects using the built-in Eclipse build tools. Then we have a separate ANT build script for automated building, unit testing, etc.</p><p>I would like to switch to using the ANT script inside Eclipse as well. What I can't figure out is how Eclipse content assist and refactoring tools will interact with such an arrangement. </p><p>Can I continue to use the Eclipse refactoring / content assist tools, while never using the Eclipse build button? We don't currently use the ""Automatic Building"" mode for Eclipse, so I don't care about that.</p><p>On a related note, will a tool like ANT be able to build just as little as Eclipse does? Or does Eclipse do something a lot more intelligent that modification-date checking to limit how much it builds?</p>","120237","","","","","2009-10-24 06:06:57","Java Content Assist / Refactoring with External Build tools","<java><android><eclipse><ant>","1","0","1","",""
"1616530","1","","","2009-10-24 00:05:27","0","1954","<p>Ive got a input tag in an HTML page in an Android WebView. I want the background to be transparent. It is (via background-color: transparent) UNTIL the user selects it (gives it focus, to input data). Then the background is white.</p><p>I've tried background-color on textbox and textbox:focus and Ive tried -webkit-appearance: none. None of these worked.</p><p>Anyone messed with this?</p>","195696","","","","","2010-02-23 00:19:40","How to set Android WebView background of selected textbox","<css><android><webkit>","1","1","1","",""
"1617114","1","1619334","","2009-10-24 06:05:06","0","913","<p>How can I stop a background thread on keyboard flip in android?</p>","193545","","","","","2009-10-24 22:20:44","How to stop a background thread on keyboard flip in android","<android><multithreading>","1","2","","",""
"1617280","1","1617300","","2009-10-24 07:33:32","2","23624","<p>I have a sql query like this</p><pre><code>String loadFav = ""SELECT _id, title, name, favorite FROM table1 where favorite= 1 ""     				 + ""UNION ALL""     		         + ""SELECT _id, title, name, favorite FROM table2 where favorite= 1""    				 ;    Cursor mCursor = mSQLiteDatabase.rawQuery(loadFav, null);</code></pre><p>I got an error when run this query. Is it right structure? Can someone help me?</p>","152286","","","","","2010-10-24 16:51:56","How to use rawQuery() in android","<sql><android>","1","1","","",""
"1617482","1","","","2009-10-24 09:27:59","0","3406","<p>I am having an issue related to home key . when i press home key all current activity gets hidden . but when i press the executable it again starts from the fisrt screen . I have overidden all methods onsaveInstaceState     opPause    onStop    onResumebut there are still issues what is the right way to handle those conditions .When i am pressing home button i am storing the widgets state in database and  when i again click the exectable i am checking the database state and starting the new Intent as saved when user presses the home button .Is it the right way to do that as i am facing the problem when user does the same and again presses the back  button , there is already on intent available in stack of activity .     Thanks in advance.</p>","95877","","","","","2011-03-04 22:57:19","state of activity saving in android when home button pressed","<java><android>","2","4","1","",""
"1617521","1","","","2009-10-24 09:51:44","0","489","<p>How can I create my own JAR file for an Android application using Eclipse or Ant?</p>","","user195808","651104","","2012-08-21 02:36:03","2012-08-21 02:36:03","How can I create my own JAR file for an Android application using Eclipse or Ant?","<eclipse><ant><android>","1","0","","",""
"1617524","1","1627609","","2009-10-24 09:53:05","7","6337","<p>I plan on writing a Java 3D game that will work both on PC and Android. Unfortunately it looks like there is no common OpenGL API for both platforms.</p><p>Do the APIs differ significantly? Is there a way I could use the same 3D code in both versions? Is it a good idea?</p>","78145","","","","","2010-08-30 22:12:54","Writing a portable Java application using JOGL and Android OpenGL","<java><android><opengl><opengl-es><jogl>","3","2","4","",""
"1617925","1","","","2009-10-24 12:44:23","2","4357","<p>What is the general communication architecture for two android applications?</p><p>Case 1:</p><p>I have two android applications, </p><p>a) One is a server that waits for client request, process the request( read data from some sqlite db) and return the results to the client. This server application runs on its own independent android phone.</p><p>b) The second is the client that sends the request to the server application in (a) and it too runs on its own independent android phone.</p><p>Question is, do the two applications have to go through the Mobile Service Provider to enable communication? or they can just talk to each other directly via some public IP/WIFi etc. What is the communication structure/architecture for this applications?</p><p>Case 2:</p><p>I have an android application running on an independent android phone, and i want it to talk to some server application (Web Server / Application Server) running in some machine somewhere on the internet, sends request and get some feed back.</p><p>Again, do the two applications have to go through the Mobile Service Provider to facilitate communication? or they just establish a straight TCP/IP communication via some public IP?</p><p>Any reference articles would really help.</p><p>Thanks</p><p>Gath</p>","26143","","","","","2009-10-26 16:57:38","How do two android applications talk to each other?","<android><communication><mobile-phones>","3","0","3","",""
"1618587","1","1621189","","2009-10-24 17:35:35","0","866","<p>I'm making a popup in Android using Toast, is there any way when shown to blur the window behind. I'd usually use:</p><pre><code>getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,                       WindowManager.LayoutParams.FLAG_BLUR_BEHIND);</code></pre><p>But in this case am not sure how to go about it... Any help would be great, thanks!</p>","173892","","","","","2009-10-25 15:32:00","Android toast blur","<android>","1","0","","",""
"1618800","1","1619828","","2009-10-24 19:12:20","2","7989","<p>I wonder if someone can help me. I'm trying to display a toast element when an SMS is received. This toast should contain a layout which has an image (SMS Icon) and 2 textviews (sender, message)</p><p>If I call the following method from an activity, it works as expected...</p><pre><code>public void showToast(Context context, String name, String message) {	LayoutInflater inflater = getLayoutInflater();	View layout = inflater.inflate(R.layout.toast_sms,	                               (ViewGroup) findViewById(R.id.toast_sms_root));	TextView text = (TextView) layout.findViewById(R.id.toastsms_text);	text.setText(message);	Toast toast = new Toast(getApplicationContext());	toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);	toast.setDuration(Toast.LENGTH_LONG);	toast.setView(layout);	toast.show();}</code></pre><p>However, if I try to call the same code in the same way from my SMSReceiver, I get:</p><pre><code>The method getLayoutInflater() is undefined for the type SmsReceiverThe method findViewById(int) is undefined for the type SmsReceiverThe method getApplicationContext() is undefined for the type SmsReceiver</code></pre><p>Can someone please advise how I can do tihs from an intent. I assume the issue is somehow related to cross-threading however, I'm unsure how to proceed. I've seen a couple of examples online but they seem to either use deprecated code or only display simple text</p><p>Can someone please point me in the correct direction</p><p>Many thanks</p>","156755","","","","","2012-02-02 07:23:29","Show Complex Toast From BroadcastReceiver","<android><user-interface><dalvik><toast>","3","1","2","",""
"1619133","1","1665926","","2009-10-24 21:09:52","121","17857","<p>I am surprised that there is no Android <em>Hidden Features</em> post yet in the <strong><a href=""http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/"" rel=""nofollow"">Hidden Features series</a></strong> that I've been tracking for a while now.</p><p>The Hidden Features series is great for people who are new to a certain language. It shows the ropes and certain valuable tricks, all in one place. I think it's a brilliant idea. Even experts sometimes find tricks they'd never heard about.</p><p>I am starting Android development and I'd love to hear about its hidden features, tips, tricks, and pitfalls.</p><p>So, here goes: what are some <strong>hidden features</strong> of <strong>Android</strong>?</p>","47680","","102937","","2012-03-10 04:02:20","2012-03-10 04:02:20","Hidden features of Android development?","<android><hidden-features>","6","0","208","","2009-10-24 21:09:52"
"1620053","1","1621213","","2009-10-25 04:56:56","1","8212","<p>My application have three tabs with <code>ListView</code> display inside each one. How to write code to refresh <code>ListView</code> when click between tabs ? </p><pre><code>@Overridepublic void onTabChanged(String tabId) {			if(tabId == ""tab_1"")	{		refresh ListView ???	}	}</code></pre>","152286","","","","","2010-02-10 15:08:22","How can refresh ListView when tab in android","<android>","3","0","4","",""
"1620191","1","","","2009-10-25 06:42:34","11","5575","<p>Can you please tell me the difference between context menu and option menu in android?When I click the menu button on the emulator, is that option menu? or context menu?And how to invoke the other menu (not trigger by the menu button)?</p><p>Thank you.</p>","128983","","","","","2014-04-03 11:58:30","Difference between context menu and option menu in android","<android>","3","0","","",""
"1620231","1","1620253","","2009-10-25 07:11:58","0","1657","<p>I have just begun working with the Android SDK and I am having problems with my first app.  Currently, I am trying to list all of the users in a big list.  However, no matter what I try, the app continues to force close.  I found the code in the sample files, but this is still giving me issues.  Below is the code I am using.</p><pre><code> public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        String[] projection = new String[] {                People._ID,                People._COUNT,                People.NAME,                People.NUMBER             };    	//Get the base URI for the People table in the Contacts content provider.    	Uri contacts =  People.CONTENT_URI;    	//Make the query.     	Cursor managedCursor = managedQuery(contacts,    	            projection, // Which columns to return     	            null,       // Which rows to return (all rows)    	            null,       // Selection arguments (none)    	            // Put the results in ascending order by name    	            People.NAME + "" ASC"");    	        Cursor c = getContentResolver().query(Contacts.CONTENT_URI, null, null, null, null);        startManagingCursor(c);        String[] columns = new String[] {People.NAME};        int[] names = new int[] {R.id.text1};        SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this,           R.layout.main, c, columns, names);        setListAdapter(mAdapter);    }</code></pre><p>This is directly from the sample file, yet it still errors out.  I have found that the line that causes the problem is the ""Cursor managedCursor = managedQuery(contacts,"" line.  Has anyone else out there seen this?  I am at a loss and have not found any solutions after 2 hours or research.</p><p>Also, I have added the following line to my app's manifest file:</p><pre><code>&lt;uses-permission android:name=""android.permission.READ_CONTACTS""&gt;&lt;/uses-permission&gt;</code></pre><p>Thanks, and if you need more information please let me know.</p>","143310","","","","","2009-10-25 07:32:42","Android SDK - List All Users","<android>","1","0","1","",""
"1620400","1","1621172","","2009-10-25 08:51:52","2","986","<p>I am firing off an AsyncTask to fetch images via HttpClient.</p><p>Via DDMS in eclipse, the view shows that the AsyncTask runs and then hangs around.</p><p><a href=""http://imgur.com/pDcqh"" rel=""nofollow"">This</a> is a screenshot of the DDMS threads view.</p><p>Should the AsyncTask #1 thread disappear or is it benign ? What does the status <em>wait</em> mean anyway ?</p>","27328","","","","","2009-10-25 15:26:44","AsyncTask and Android threading: how to get it right?","<java><android><multithreading><concurrency><mobile>","1","0","2","",""
"1621513","1","1646417","","2009-10-25 17:40:53","3","16454","<p>I'm tinkering around with android on Netbeans and did a simple math application. Somewhere along the way the application suddenly force closes as soon as it opens(On the emulator)... I tried commenting all the code in the class that hosts the main activity but to no avail. Since it doesn't give me a specific error message, I feel kind of lost. </p><p>Any reason why this is happening?</p><p>Here is the layout file as requested:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TextView  android:id=""@+id/result""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""""/&gt;        &lt;LinearLayout android:orientation=""horizontal""    	android:layout_width=""fill_parent""    	android:layout_height=""wrap_content""&gt;    	&lt;TextView android:layout_width=""wrap_content""    		android:layout_height=""wrap_content""    		android:text=""@string/number"" /&gt;    	&lt;EditText android:id=""@+id/n""    	  android:layout_width=""wrap_content""    		android:layout_height=""wrap_content""    		android:layout_weight=""1""                        android:numeric=""decimal""/&gt;                &lt;Button android:id=""@+id/calc""                  android:text=""@string/calculate""                        android:layout_width=""wrap_content""                        android:layout_height=""wrap_content"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>As suggested I checked logcat and this is the list of errors</p><pre><code>E/AndroidRuntime(  881): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(  881): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.me.mathdroid/org.me.mathdroid.MainActivity}: java.lang.NullPointerExceptionE/AndroidRuntime(  881):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2324)E/AndroidRuntime(  881):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)E/AndroidRuntime(  881):        at android.app.ActivityThread.access$2100(ActivityThread.java:116)E/AndroidRuntime(  881):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)E/AndroidRuntime(  881):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  881):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  881):        at android.app.ActivityThread.main(ActivityThread.java:4203)E/AndroidRuntime(  881):        at java.lang.reflect.Method.invokeNative(NativeMethod)E/AndroidRuntime(  881):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  881):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)E/AndroidRuntime(  881):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)E/AndroidRuntime(  881):        at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  881): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime(  881):        at android.app.Activity.findViewById(Activity.java:1610)E/AndroidRuntime(  881):        at org.me.mathdroid.MainActivity.&lt;init&gt;(MainActivity.java:22)E/AndroidRuntime(  881):        at java.lang.Class.newInstanceImpl(Native Method)E/AndroidRuntime(  881):        at java.lang.Class.newInstance(Class.java:1472)E/AndroidRuntime(  881):        at android.app.Instrumentation.newActivity(Instrumentation.java:1097)E/AndroidRuntime(  881):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)E/AndroidRuntime(  881):        ... 11 more</code></pre>","45471","","45471","","2009-10-29 14:11:17","2012-05-11 13:00:50","Android: Application force closing as soon as it opens","<android>","6","4","1","",""
"1621796","1","1630532","","2009-10-25 19:21:57","8","4522","<p>I run a web project targeted to be deployed on the Google Appengine locally from within Eclipse. So the server starts up and it can be accessed normally by typing localhost:8080 into some browser. Everything fine so far.But what I need is to access it from outside, say from a friend's machine (which obviously resides in the same wireless network). So when he types the following &lt;my-notebook-ip-address&gt;:8080 he should reach the locally running webserver (within Eclipse). But that doesn't work!</p><p>The reason I need this is that I want my Android app running on my notebook within the Android emulator to access my locally running webserver. This is just possible by using the notebooks real ip address since localhost on the Android will be the phone itself.</p><p>Some more details</p><ul><li>Mac OSX Snow Leopard</li><li>Eclipse Galileo</li><li>Webserver: Google Appengine (launched within Eclipse)</li></ul><p>When launching the Appengine server from within Eclipse I <strong>can</strong> access it with: <code>http://localhost:8080</code>.<br>I <strong>cannot</strong> access it however from my local notebook (where the webserver is running within Eclipse) with: <code>http://192.168.0.5:8080</code> where the IP is my IP address in the network.</p><p>I have all Firewalls disabled!</p>","50109","","31671","","2012-05-08 07:07:19","2013-09-02 01:18:05","Accessing webserver running within Eclipse from outside the workstation","<android><eclipse><google-app-engine><webserver>","4","0","5","",""
"1622364","1","1622379","","2009-10-25 22:51:53","13","13703","<p>I have a shape with a gradient that I'm using as a divider between <code>ListView</code> items.  I've defined it as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;shape    xmlns:android=""http://schemas.android.com/apk/res/android""    android:shape=""rectangle""&gt;&lt;gradient    android:startColor=""#ccd0d3""    android:centerColor=""#b6babd""    android:endColor=""#ccd0d3""    android:height=""1px""    android:angle=""0"" /&gt;&lt;/shape&gt;</code></pre><p>I would like to add 6 pixels of padding on either side of the gradient, so that it doesn't extend from edge to edge of the screen.</p><p>However, no matter where I put an <code>android:left=""6px""</code> and <code>android:right=""6px""</code>, it doesn't seem to take effect.  I can put it in the <code>&lt;shape&gt;</code> element, the <code>&lt;gradient&gt;</code> element, or in a separate <code>&lt;padding&gt;</code> child of <code>&lt;shape&gt;</code>, and it doesn't change anything.</p><p>How can I add padding on the left and right of my list divider?</p>","82156","","","","","2013-02-10 11:50:59","How to add padding to gradient <shape> in Android?","<android>","3","2","7","",""
"1623725","1","1624689","","2009-10-26 08:51:11","6","11597","<p>I'd like to grow a view with each click using a ScaleAnimation. I've managed the effects of the animation persist after it has finished with the fillAfter, but the problem now is, the animation always starts from state 0 (as the View is defined in the XML) - on click the view resets and animates back to the state it was just after the first animation.</p><p>The animation is defined in an XML:</p><pre><code>&lt;scale   xmlns:android=""http://schemas.android.com/apk/res/android""   android:interpolator=""@android:anim/accelerate_decelerate_interpolator""   android:fromXScale=""1""   android:toXScale=""1.5""   android:fromYScale=""1""   android:toYScale=""1.5""   android:pivotX=""50%""   android:pivotY=""50%""   android:duration=""1000""   android:fillAfter=""true"" /&gt;</code></pre>","196496","","82118","","2011-04-11 18:36:22","2012-11-23 18:21:11","Android ScaleAnimation","<android><animation>","2","0","2","",""
"1624338","1","6741963","","2009-10-26 11:39:16","4","16442","<p>I have an android application with a LOT of activities, think of something like a book where every page is a new activity. The user can make changes in each activity, for example highlight certain texts with different colored markers etc. and it's crucial that I'll remember this information as long as the application stays alive (and I don't want/need to remember any of this when it's not). As I understand the best mechanism for storing this kind of information is via <code>onSaveInstanceState(Bundle outState)</code> and <code>onCreate(Bundle)</code>/<code>onRestoreInstanceState(Bundle)</code> rather than lets say, the Preferences mechanism. My only problem is that the user can navigate backwards to previous pages (Activities) and the only way i know of achieving this is by calling <code>finish()</code> which of course kills the current activity without calling <code>onSaveInstanceState(Bundle outState)</code> and even if it did call it, the next time I would launch an activity representing that page it would be an entirely new instance. So my question is: Is there a way to go back to the previous activity without calling <code>finish()</code>? or, is there a better way to save this information? maybe through static variables?</p><p>Thanks!</p><p>P.S.I know I could also implement my app differently so that not every page would have its own activity but this isn't the answer I'm looking for.</p>","101334","","","","","2012-08-23 05:30:10","Android: Return to previous activity without calling finish()","<android>","2","0","1","",""
"1624678","1","1625091","","2009-10-26 13:07:16","4","15386","<p>Can Android OS that is installed on actual devices be emulated in VMWare or VirtualBox. Are there any such distros or images available?</p>","77087","","","","","2013-02-07 13:05:09","Android on VMWare or VirtualBox","<android><image><vmware><virtualbox>","3","1","1","",""
"1625183","1","","","2009-10-26 14:34:29","2","6038","<p>In my <code>ListView</code>, I choose an Item to ""Add Favorite"" and I have to do some stuff work, I fill data again to refresh the List, then I implement <code>OnScrollListener</code> use <code>setSelection(firstVisibleItem)</code> to set List display right on Item was added.</p><p>Are there any better way to do that. I mean like <code>mCursor.requery()</code> or something like that in android APIs ? Or any suggest way?</p>","152286","","","","","2012-08-14 23:12:37","Better way for ""refresh"" and ""setSelection"" after Update ListView (android)","<android><listview>","4","1","2","",""
"1625249","1","1626016","","2009-10-26 14:45:09","14","36756","<p>In the user interface there has to be a spinner which contains some names (the names are visible) and each name has its own ID (the IDs are not equal to display sequence). When the user selects the name from the list the variable currentID has to be changed.</p><p>The application contains the ArrayList</p><p>Where User is an object with ID and name:</p><pre><code>public class User{        public int ID;        public String name;    }</code></pre><p>What I don't know is how to create a spinner which displays the list of user's names and bind spinner items to IDs so when the spinner item is selected/changed the variable currentID is set to appropriate value.</p><p>I would appreciate if anyone could show the solution of the described problem or provide any link useful to solve the problem.</p><p>Thanks!</p>","22996","","","","","2014-04-09 19:18:40","Android: How to bind spinner to custom object list?","<android><adapter><spinner>","7","1","15","",""
"1625633","1","1628502","","2009-10-26 16:02:40","6","30216","<p>I have a problem with EditText background like this</p><pre><code>&lt;EditText	 android:id=""@+id/edit""	 android:layout_width=""fill_parent""	 android:layout_height=""35sp""																			 android:singleLine=""true""	 android:layout_marginLeft=""5px""	 android:layout_marginRight=""5px""	 android:layout_marginTop=""5px""	 android:textAppearance=""?android:attr/textAppearanceSmall""		 	  /&gt;</code></pre><p><img src=""http://i765.photobucket.com/albums/xx299/trieutrinhtrinh/edittext.jpg"" alt=""alt text"" /></p><p>After try to set the background, It look worse</p><pre><code>&lt;EditText	 android:id=""@+id/edit""	 android:layout_width=""fill_parent""	 android:layout_height=""35sp""																			 android:singleLine=""true""	 android:layout_marginLeft=""5px""	 android:layout_marginRight=""5px""	 android:layout_marginTop=""5px""	 android:textAppearance=""?android:attr/textAppearanceSmall""	 android:background=""#ffffff""	 	  /&gt;</code></pre><p><img src=""http://i765.photobucket.com/albums/xx299/trieutrinhtrinh/edittext2.jpg"" alt=""alt text"" /></p><p>What's happen with EditText background? How to make EditText keep default style?</p>","152286","","","","","2012-06-29 08:44:24","Problem with EditText background (android)","<android>","7","2","7","",""
"1626667","1","1678057","","2009-10-26 18:53:28","28","38207","<p>I'm trying to use <code>Parcel</code> to write and then read back a <code>Parcelable</code>.  For some reason, when I read the object back from the file, it's coming back as <code>null</code>.</p><pre><code>public void testFoo() {    final Foo orig = new Foo(""blah blah"");    // Wrote orig to a parcel and then byte array    final Parcel p1 = Parcel.obtain();    p1.writeValue(orig);    final byte[] bytes = p1.marshall();    // Check to make sure that the byte array seems to contain a Parcelable    assertEquals(4, bytes[0]); // Parcel.VAL_PARCELABLE    // Unmarshall a Foo from that byte array    final Parcel p2 = Parcel.obtain();    p2.unmarshall(bytes, 0, bytes.length);    final Foo result = (Foo) p2.readValue(Foo.class.getClassLoader());    assertNotNull(result); // FAIL    assertEquals( orig.str, result.str );}protected static class Foo implements Parcelable {    protected static final Parcelable.Creator&lt;Foo&gt; CREATOR = new Parcelable.Creator&lt;Foo&gt;() {        public Foo createFromParcel(Parcel source) {            final Foo f = new Foo();            f.str = (String) source.readValue(Foo.class.getClassLoader());            return f;        }        public Foo[] newArray(int size) {            throw new UnsupportedOperationException();        }    };    public String str;    public Foo() {    }    public Foo( String s ) {        str = s;    }    public int describeContents() {        return 0;    }    public void writeToParcel(Parcel dest, int ignored) {        dest.writeValue(str);    }}</code></pre><p>What am I missing?</p><p><strong>UPDATE:</strong>  To simplify the test I've removed the reading and writing of files in my original example.</p>","82156","","82156","","2009-11-05 02:41:47","2013-11-19 16:58:16","How to use Parcel in Android?","<android><parcel>","4","0","17","",""
"1628655","1","1628816","","2009-10-27 03:42:06","0","2916","<p>I want to continue running my application when the backlight and screen goes off and lock. How do i find out whether the device screen goes off and lock from my application through notification so that i can ignore it and continue running my app.?</p><p>Appreciate your help.</p>","187532","","","","","2011-02-09 19:29:06","Android:Screen Off and Lock Notfication?","<android>","2","1","1","",""
"1628677","1","1631426","","2009-10-27 03:50:54","5","16924","<p>My goal is store temporary files in the directory returned by Context#getCacheDir().</p><pre><code>/data/data/my.app/cache/somedir/foo.json</code></pre><p>I presume I can just use java.io apis to write files there. But I'm not sure how to set permissions on files there because I would not be able to use Context#MODE_PRIVATE.</p><p>The filename parameter to Context#openFileOutput and Context#openFileInput cannot accept input with path delimiters. Thus they are only useful for files created in directory:</p><pre><code>/data/data/my.app</code></pre>","27328","","","","","2010-12-21 13:59:52","How to store files in Android's cache directory?","<java><android><mobile>","2","0","","",""
"1628866","1","1630933","","2009-10-27 05:06:19","0","1450","<p>I have a mix-case IDL service that I'm using in 2 ways:</p><ol><li>The service will spawn a thread and make a network call to grab some XML content on Activity's behalf. The content is return back to the Activity through client's IDL that defines callback methods</li><li>If user chooses notification option then service creates a Timer that gets executed repeatedly and creates a toolbar notification. It also cached the content so when Activity request an update it is served from the cache rather than another network call </li></ol><p>So my questions are </p><ol><li>For scenario #1 what is the price (if any) I'm paying for using service for network calls instead of creating background thread directly in the Activity?</li><li>For #2 - am I better off changing implementation to AlarmManager? I noticed that when I kill processes with TasKiller my service dies and never gets restarted, would AlarmManager-base job have better chance of recovery?</li></ol>","135946","","135946","","2009-11-02 01:56:57","2009-11-02 01:56:57","Android - using background service","<android><service><background-process>","1","0","2","",""
"1629304","1","","","2009-10-27 07:52:55","2","5228","<p>What is the best way to read the text from an EditText into code, and to write some text from code to the EditText?</p><hr><p>Sorry I have ment not the TextView but the EditText</p><p>Hi all</p><p>I am a new to android I wish to write automatically from code to EditText and read in code from EditText</p><p>What is the best way to do it.</p>","196524","","1288","","2011-11-28 12:41:56","2014-02-19 04:48:00","Reading from and writing to EditText","<android><edittext>","1","1","","",""
"1629775","1","1632857","","2009-10-27 10:02:03","131","69399","<p>What tutorials and libraries are available which can help beginners to develop 2D and 3D games on Android using OpenGL-ES? I'm looking for tutorials which can help me learn OpenGL-ES, and I'm looking for OpenGL-ES libraries which can make life easier for beginners in OpenGL-ES.</p><p>Since Android is still small, I guess it may be help-full to read iPhone OpenGL-ES tutorials as well, as I suppose the OpenGL-ES functionality is much the same.</p><p>I have found the following useful information which I would have liked to share:</p><p>Android tutorials:  </p><ul><li><a href=""http://www.droidnova.com/android-3d-game-tutorial-part-i,312.html"">DroidNova: Basic tutorial covering polygons, no textures</a>  </li><li><a href=""http://www.anddev.org/tut-sequence_android_gl_-_learning_opengl_from_scratch-t229.html"">anddev forum with some tutorials</a></li></ul><p>Other Android OpenGL-ES information:  </p><ul><li><a href=""http://www.youtube.com/watch?v=U4Bk5rmIpic"">Google IO lecture</a> regarding games, not much OpenGLES  </li><li>The <a href=""http://www.khronos.org/opengles/sdk/1.1/docs/man/"">The Khronos Reference Manual</a> is also relevant to have, but its not exactly the best place to start.</li></ul><p>iPhone OpenGL-ES tutorials (where the OpenGl-ES information is probably useful):  </p><ul><li><a href=""http://web.me.com/smaurice/AppleCoder/iPhone_OpenGL/Archive.html"">http://web.me.com/smaurice/AppleCoder/iPhone_OpenGL/Archive.html</a></li><li><a href=""http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-table-of.html"">http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-table-of.html</a></li></ul><p>As for libraries which a beginner might use to get a simpler hands-on experience with OpenGL-ES, I have only found <a href=""http://rokon-android.blogspot.com/"">Rokon</a>, which is recently started, thus has many holes and bugs. And it's gnuGPL licensed (at the moment) which means it cannot be used, if we wish to sell our games.</p><p>What else is out there?</p>","197141","","683261","","2012-01-23 08:15:33","2013-03-05 23:01:25","Tutorials and libraries for OpenGL-ES games on Android","<android><opengl-es><3d>","10","0","158","2013-03-05 22:56:05",""
"1630258","1","","","2009-10-27 11:41:28","11","12342","<p>For my current application I collect images from different ""eventproviders"" in Spain.</p><pre><code>  Bitmap bmp=null;  HttpGet httpRequest = new HttpGet(strURL);  long t = System.currentTimeMillis();  HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);  Log.i(TAG, ""Image [""+ strURL + ""] fetched in ["" + (System.currentTimeMillis()-t) + ""ms]"");     HttpEntity entity = response.getEntity();     InputStream instream = entity.getContent();     bmp = BitmapFactory.decodeStream(instream);     return bmp;</code></pre><p>However, when downloading images from salir.com I get the followinglogcat output:</p><pre><code>13970     Gallery_Activity  I  Fetching image 2/8 URL: http://media.salir.com/_images_/verticales/a/0/1/0/2540-los_inmortales_la_trattoria-marc_aureli_27_29_no.jpg13970     ServiceHttpRequest  I  Image [http://media.salir.com/_images_/verticales/a/0/1/0/2540-los_inmortales_la_trattoria-marc_aureli_27_29_no.jpg] fetched in [146ms]13970     skia  D  --- decoder-&gt;decode returned false</code></pre><p>A search for that error message didn't provide much useful results.</p><p>Anyone an idea what the problem could be?</p><p>Gracias! </p><hr><p><strong>Update 1:</strong></p><p>After inquiring a bit more and testing different stuff I figured out that the problem seems to lie somewhere else. Even though my logcat output says</p><pre><code>13970     ServiceHttpRequest  I  Image [http://media.salir.com/_images_/verticales/a/0/1/0/2540-los_inmortales_la_trattoria-marc_aureli_27_29_no.jpg] fetched in [146ms]getContentLength(): 93288</code></pre><p>which is the correct length of the image in bytes it seems that there's something wrong with the stream or HTTP connection.</p><p>My original code (above) is taking advantage of the <a href=""http://developer.android.com/reference/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.html"" rel=""nofollow"">ThreadSafeClientConnManager</a>. If I replace it with just a simple <code>URLConnection</code> it works perfectly:</p><pre><code>URL url = new URL(strURL);URLConnection conn = url.openConnection();conn.connect();InputStream instream = conn.getInputStream();bmp = BitmapFactory.decodeStream(instream);</code></pre><p>So, I'm wondering now why does my <code>ThreadSafeClientConnManager</code> work flawlessly (at least it seems it does) with all my other connections (mostly exchanging <code>JSONObjects</code>) but not with images from some specific websites (e.g. salir.com - for most other websites it works, though). Is there a HTTP parameter I'm missing?</p><p>My current setup is:</p><pre><code>HttpParams parameters = new BasicHttpParams();HttpProtocolParams.setVersion(parameters, HttpVersion.HTTP_1_1);HttpProtocolParams.setContentCharset(parameters, HTTP.UTF_8);HttpProtocolParams.setUseExpectContinue(parameters, false); // some webservers have problems if this is set to trueConnManagerParams.setMaxTotalConnections(parameters, MAX_TOTAL_CONNECTIONS);HttpConnectionParams.setConnectionTimeout(parameters, CONNECTION_TIMEOUT);HttpConnectionParams.setSoTimeout(parameters, SOCKET_TIMEOUT);SchemeRegistry schReg = new SchemeRegistry();schReg.register(new Scheme(""http"",      PlainSocketFactory.getSocketFactory(), HTTP_PORT));ClientConnectionManager conMgr = new ThreadSafeClientConnManager(parameters,schReg);DefaultHttpClient http_client = new DefaultHttpClient(conMgr, parameters);</code></pre><hr><p><strong>Update 2:</strong></p><p>Now, the strange thing is, that it actually does work with the <code>ThreadSafeClientConnManager</code> <strong>-sometimes-</strong>. If I keep trying downloading the image and decoding it for a couple of times in a row it might work after 15-30 trials. Very strange.</p><p>I hope there's a solution to that since I would prefer using the <code>ThreadSafeClientConnManager</code> instead of <code>URLConnection</code>.</p><hr><p><strong>Update 3:</strong></p><p>As suggest by Mike Mosher below, it seems that by using <a href=""http://developer.android.com/intl/fr/reference/org/apache/http/entity/BufferedHttpEntity.html"" rel=""nofollow"">BufferedHttpEntity</a> the <em>decoding error</em> doesn't appear any more. However now, even though less often than before, I get a <code>SkImageDecoder::Factory returned null</code> error.</p>","184367","","184367","","2010-01-08 11:51:44","2012-12-06 23:49:30","Android: Problem/bug with ThreadSafeClientConnManager downloading images","<java><android><apache><thread-safety><httpclient>","11","0","12","",""
"1630816","1","1631099","","2009-10-27 13:31:19","2","4777","<p>I have a code snippet to detect accelerometer movements. It works some times by properly detecting slight movements, but sometimes it detects movements when I kept my device idle too. Are there any problems with built-in accelerometer detection on Android?</p><p>I use an HTC G-1 device. My code snippet is below. How do I resolve it so I can detect small device movements but not detect anything when the device is idle?</p><pre><code>private static final int SHAKE_THRESHOLD = 50;public void onSensorChanged(int sensor, float[] values) {    if (sensor == SensorManager.SENSOR_ACCELEROMETER) {        long curTime = System.currentTimeMillis();        // only allow one update every 100ms.        if ((curTime - lastUpdate) &gt; 100) {            long diffTime = (curTime - lastUpdate);            lastUpdate = curTime;            x = values[SensorManager.DATA_X];            y = values[SensorManager.DATA_Y];            z = values[SensorManager.DATA_Z];            float speed = Math.abs(x+y+z - last_x - last_y - last_z) / diffTime * 10000;            if (speed &gt; SHAKE_THRESHOLD) {                 long curTime = System.currentTimeMillis();                long diff = (curTime - shakeTime);    			                shakeTime = curTime;                if (myFlagIgnoreShakeDetection==true)  //Caused unneccessary accelerometer                                                          //notification looping when device is idle                   return;                // Doing something...            }         last_x = x;         last_y = y;         last_z = z;        }    }}</code></pre>","187532","","187532","","2009-10-28 13:29:45","2010-10-17 22:34:00","Android: Accelerometer false detection","<android><accelerometer>","2","10","10","",""
"1631125","1","1631220","","2009-10-27 14:16:27","6","2651","<p>We have a project that uses <code>JPA/Hibernate</code> on the server side, the mapped entity classes are in their own Library-Project and use Annotations to be mapped to the database. </p><p>I want to use these classes in an Android-Project - </p><p><em>Is there any way to ignore the annotations within Android, to use these classes as standard <kbd>POJOs</kbd>?</em></p>","73198","","1543541","","2014-01-24 05:25:01","2014-01-24 05:25:01","JPA Annotations in Android","<java><android><jpa><annotations>","3","0","1","",""
"1631710","1","1631793","","2009-10-27 15:40:52","1","959","<p>I have an application that uses the Google Maps API to geocode distances between lat/long pairs as a way of displaying people near to you on your phone (currently Android, working on iPhone). The issue is that even with a test group of 40 users, we are taking upwards of 10 seconds to do our calculations and send the results back to the users. While 10 seconds sounds like a long time, it's not really an issue as far as the client app goes because it's not a real-time update of people's locations (the updates occur every few minutes). Obviously this is a problem though since we'd obviously love to ramp up to tens or even hundreds of thousands of users. I'm curious if anyone else has any experience in this arena in regards to using the Google Maps API for calculating distances between points for large volumes of data?</p><p>As an aside, we're using Rails on the server, which is where all of the location calculations are occurring. The phone(s) are merely displaying the maps and updating the server with lat/long coordinates.</p>","21126","","","","","2009-10-28 18:02:46","Strategies for large volume of location geocoding","<iphone><ruby-on-rails><android><google-maps><geolocation>","3","0","2","",""
"1633198","1","3336072","","2009-10-27 19:42:15","0","1138","<p>I've run into an issue with an autocomplete field I'm working on.  The field I'm working with is composed of the form <code>""&lt;NAME&gt; (&lt;CODE&gt;)""</code>.  When a user starts typing in text, I want to display any results that match either <code>NAME</code> or <code>CODE</code>.</p><p>For example, if this list contains items and their codes, like ""Personal Computer (PC)"", then I'd want the list to pop up that row if the user types ""P"", ""PC"", ""Per"", etc.</p><p>I've gotten this to work fine in SQLite with a query like this:</p><pre><code>SELECT *FROM tableWHERE name LIKE ""?%"" or code LIKE ""?%""</code></pre><p>However, the problem I'm running into now is how to best sort the results that come back from this.  For example, If someone enters ""PC"", I want ""Personal Computer (PC)"" to be the first result.  However, if there's another row (you'll have to bear with me as this is contrived) ""PC Case (301)"", then there's no simple ordering I can do on the results to ensure that the <strong>best</strong> match appears first.  Ordering by name and code both returns PC Case first.</p><p>I want a query where it returns the best match first, rather than items in alphabetical order.  Is there such a function I can use in SQLite to get this, or should I return the results and then mess with the order in the code?</p><p>If it helps any, I'm using this for FilterQueryProviders on Android.</p>","60261","","","","","2010-07-26 14:58:38","Sorting results when autocomplete matches multiple columns in SQL","<sql><android><sqlite><autocomplete>","2","1","","",""
"1634252","1","1636611","","2009-10-27 23:20:17","71","60763","<p>I'm using a <code>RotateAnimation</code> to rotate an image that I'm using as a custom cyclical spinner in Android.  Here's my <code>rotate_indefinitely.xml</code> file, which I placed in <code>res/anim/</code>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;rotate    xmlns:android=""http://schemas.android.com/apk/res/android""    android:fromDegrees=""0""    android:toDegrees=""360""    android:pivotX=""50%""    android:pivotY=""50%""    android:repeatCount=""infinite""    android:duration=""1200"" /&gt;</code></pre><p>When I apply this to my <code>ImageView</code> using <code>AndroidUtils.loadAnimation()</code>, it works great!  </p><pre><code>spinner.startAnimation(     AnimationUtils.loadAnimation(activity, R.anim.rotate_indefinitely) );</code></pre><p>The one problem is that the image rotation seems to pause at the top of every cycle.</p><p>In other words, the image rotates 360 degrees, pauses briefly, then rotates 360 degrees again, etc.</p><p>I suspect that the problem is that the animation is using a default interpolator like <code>android:iterpolator=""@android:anim/accelerate_interpolator""</code> (<code>AccelerateInterpolator</code>), but I don't know how to tell it not to interpolate the animation.</p><p>How can I turn off interpolation (if that is indeed the problem) to make my animation cycle smoothly?</p>","82156","","82156","","2009-10-27 23:52:47","2014-02-28 11:45:24","How to make a smooth image rotation in Android?","<android><animation><view>","6","0","46","",""
"1634700","1","","","2009-10-28 01:30:28","2","6966","<p>I was wondering if anyone got this working. I am trying to do a basic authentication but for some reason it keeps complaining ""Could not authenticate you."". How would I go about getting it to run with OAUTH?</p>","184046","","","","","2012-06-07 06:28:28","Android: Twitter and OAuth anyone?","<android><twitter><oauth>","2","0","2","",""
"1634752","1","2186023","","2009-10-28 01:53:18","1","2615","<p>For my application, I am trying to add entries without having a duplicate entry, and if there are a duplicate notify the user and have him try again. Using SQLite, which I know very very little about, I have tried these two ways and want to know which one is better, more efficient or a better way to develop it?</p><p>First way:</p><pre><code>db.execSQL(""INSERT INTO "" + DatabaseHelper.DATABASE_TABLE + ""(LATITUDE, LONGITUDE, RATING) SELECT "" + latitude + "", "" + longitude + "", "" + rating +"" WHERE NOT EXISTS (SELECT 1 FROM "" + DatabaseHelper.DATABASE_TABLE +"" WHERE LATITUDE = "" + latitude + "" AND LONGITUDE = "" + longitude + "")"");</code></pre><p>Second way:</p><pre><code>	long id = -1;	try {		id = db.compileStatement(				""SELECT COUNT(*) FROM "" + DatabaseHelper.DATABASE_TABLE						+ "" WHERE LATITUDE = "" + latitude						+ "" AND LONGITUDE = "" + longitude)				.simpleQueryForLong();	} catch (NullPointerException e) {		return -1;	}	return id;</code></pre><p>The first way, either inserts or ignores the values, I check by doing so, storing the row-count of the rows into a variable before the call, call that function, and then check its results. If the results is not higher than it was before the call, the insert was made ignored, prompt the user with the 'values exist' message. (Very sloppy, I know but desperate times calls for desperate measures)</p><p>The second way, returns the actual count of rows that match the numbers I want to store, if the number returned greater than 1, prompt the user with the 'values exist' message.</p><p>I have been going back and forth, trying different ways but I do not know how to set up SQLite to have UNIQUE pairs, which I was told would be the easiest. If anyone can correct either of these ways and/or comment on them, that'd be greatly appreciated. </p><p>Thanks</p>","166712","","","","","2010-02-02 17:06:35","which sqlite statement can produce a result to indicate duplicate entries? Android","<android><sqlite><insert><return-value><exists>","3","0","","",""
"1635699","1","7387615","","2009-10-28 07:41:38","2","626","<p>I have extended LinearLayout (vertical) to create a custom compound component. This in turn contains two children:</p><ul><li>one custom view that is drawn directly onto the view canvas. </li><li>one HorizontalScrollView->LinearView(Horizontal)->Multiple custom views.</li></ul><p>I would now like to redraw the <strong>custom view to match the visible contents of the scroll view</strong>. The reason for this is that the long array of custom components in the scroll view are mainly static and suitable to be drawn ahead of time, while the top view is supposed to be highly dynamic and relate to whatever things are visible in the scroll view.</p><p>I hope I made the problem/idea somewhat clear. I am not att all confident this is the best approach, and I'd enjoy hearing any suggestions on alternative solutions or perhaps some idea on how to trigger a redraw-event everytime the scroll position changes in the HorizontalScrollView.</p><p>Thank!</p>","191704","","","","","2011-09-12 12:10:31","How to synchronize content of one view depending on scroll position in sibling ScrollView?","<android><events><scroll><synchronize>","1","0","","",""
"1636211","1","1639859","","2009-10-28 09:55:58","2","4038","<p>I want to get an array of strings reading from arrays.xml file we add in android values/ folder. Could any one kindly give a solution for this. Otherwise I will have to input each these entries in strings.xml and take them to java code using <code>getResources()getString()</code></p><p>Thank you.Tharindu</p>","152853","","","","","2013-05-27 12:09:58","How to get a String array with java code from <string-item> list in arrays.xml in Android?","<android><mobile>","3","0","","",""
"1636500","1","1638782","","2009-10-28 10:51:03","4","4591","<p>I frequently run into the problem that I have to preserve state between several invocations of an activity (i.e. going through several onCreate()/onDelete() cycles). Unfortunately, Android's support for doing that is really poor.</p><p>As an easy way to preserve state, I thought that since the class is only loaded once by the class loader, that it would be safe to store temporary data that's shared between several instances of an activity in a static Bundle field.</p><p>However, occasionally, when instance A creates the static bundle and stores data in it, then gets destroyed, and instance B tries to read from it, the static field is suddenly NULL.</p><p>Doesn't that mean that the class had been removed and reloaded by the classloader while the activity was going through a create/destroy cycle? How else could a <em>static</em> field suddenly become NULL when it was referencing an object before?</p>","127013","","127013","","2009-10-28 11:17:03","2009-10-28 18:47:57","Are static fields in Activity classes guaranteed to outlive a create/destroy cycle?","<java><android><static><class-loading>","2","2","9","",""
"1636623","1","","","2009-10-28 11:16:05","18","15250","<p>Say I have a Java Bean object which is serializable. I want to store it away safely when an Activity goes through onDestroy() <em>on purpose</em> (i.e. onSaveInstanceState() is <em>not</em> called).</p><p>I am looking for a way which doesn't involve creating a database and write the object to that (mostly since a) Android's DB API is horrible and b) since databases make application updates a nightmare, because there is no decent support for applying migrations).</p><p>I thought about serializing the object to a ByteArrayOutputStream, base64 encode that and write it to a SharedPreferences file as a string. Or is that too far off?</p><p><strong>UPDATE</strong></p><p>Maybe that serialize-to-string idea wasn't that bad after all, seems to work out pretty well. Here's what I'm doing now:</p><pre><code>    public static String objectToString(Serializable object) {    ByteArrayOutputStream out = new ByteArrayOutputStream();    try {        new ObjectOutputStream(out).writeObject(object);        byte[] data = out.toByteArray();        out.close();        out = new ByteArrayOutputStream();        Base64OutputStream b64 = new Base64OutputStream(out);        b64.write(data);        b64.close();        out.close();        return new String(out.toByteArray());    } catch (IOException e) {        e.printStackTrace();    }    return null;}public static Object stringToObject(String encodedObject) {    try {        return new ObjectInputStream(new Base64InputStream(                new ByteArrayInputStream(encodedObject.getBytes()))).readObject();    } catch (Exception e) {        e.printStackTrace();    }    return null;}</code></pre><p>in onDestroy() I can then simply write the Base64 string to a preference file, where it's safe until I read it again during the next activity launch. It's a lot faster than I expected and unless your beans carry huge amounts of data, it works pretty well. And even better, you don't have to maintain a DB schema.</p><p>Still, I'm curious about how others do this.</p>","127013","","127013","","2009-10-28 13:41:31","2013-02-16 14:56:04","How do I preserve a complex object across Activity restarts?","<android><serialization><activity><lifecycle>","2","5","15","",""
"1636685","1","1636921","","2009-10-28 11:30:17","0","374","<p>How do I install the android apps on <a href=""http://code.google.com/p/live-android/"" rel=""nofollow"">live-android</a> distribution? Is it even possible?</p>","77087","","","","","2009-10-28 12:21:49","How do I install the apps that I develop on liveandroid distribution","<android>","1","0","","",""
"1636901","1","1636922","","2009-10-28 12:18:16","25","43018","<p>Android is based on Linux; can native Linux applications be run on Android?</p>","77087","","134877","","2009-10-28 12:26:03","2013-12-01 01:12:44","Can Linux apps be run in Android?","<android><linux>","11","1","10","",""
"1638864","1","1736623","","2009-10-28 17:39:21","8","17893","<p>How do I filter noise of the accelerometer data in Android? I would like to create a high-pass filter for my sample data so that I could eliminate low frequency components and focus on the high frequency components. I have read that Kalman filter might be the best candidate for this, but how do I integrate or use this method in my application which will mostly written in Android Java? or can it be done in the first place? or through Android NDK? Is there by any chance that this can be done in real-time?</p><p>Any idea will be much appreciated. Thank you!</p>","196863","","","","","2013-11-02 01:24:40","Filtering accelerometer data noise","<android><accelerometer>","5","0","13","",""
"1640659","1","1644061","","2009-10-28 22:54:02","15","8346","<p>Is there a way to adjust the spacing between characters in an Android <code>TextView</code>?  I believe this is typically called ""kerning"".</p><p>I'm aware of the <code>android:textScaleX</code> attribute, but that compresses the characters along with the spacing.</p>","82156","","","","","2014-03-19 13:51:32","How to adjust text kerning in Android TextView?","<android><textview><spacing><kerning>","5","0","5","",""
"1640799","1","","","2009-10-28 23:29:37","4","2558","<p>I am currently using the AlertDialog.builder to create a multichoice list for the user (checkboxes).  This works great, except we want one of the buttons to deselect all of the others in the list. </p><pre><code>builder.setMultiChoiceItems(list, checked,  new DialogInterface.OnMultiChoiceClickListener() {   public void onClick(DialogInterface dialog,     int item, boolean isChecked) {    if(item == ANY_ITEM_BUT_0)    {     ((AlertDialog) dialog).getListView().setItemChecked(0, false);    }   }  });</code></pre><p>When using ""true"" it will successfully check the box, but when using false it does not uncheck it (unless i have manually set it to true before hand.)  Is there a separate listener I should be using to detect when a user clicks these?  It seems to me that there are two checkmarks set, one by the ""setItemChecked(0, true);"", and one by actually selecting it.</p><p>This has been driving me nuts for a couple days now, any help would be greatly appreciated.</p>","198523","","198523","","2009-10-28 23:47:27","2013-10-06 18:42:30","AlertDialog MultiChoiceItems Listener problems","<android><android-1.5-cupcake>","4","0","2","",""
"1640806","1","1641125","","2009-10-28 23:30:27","6","3394","<p>Is there any reason to favor Python or Java over the other for developing on Android phones, other than the usual Python v. Java issues?</p>","173922","","38146","","2009-10-29 03:10:31","2009-10-29 03:10:31","Android: Java v. Python","<java><python><android>","3","0","1","2014-01-08 13:41:20",""
"1640957","1","","","2009-10-29 00:21:09","3","856","<p>I'm trying to make a custom list divider.  It has one horizontal line that's a subtle gradient, and a second horizontal white line immediately below it as a sort of ""drop shadow"".</p><p>I'm trying to use <code>&lt;layer-list&gt;</code> to accomplish what I want, but it's not working out the way I expect.</p><p>Here's the code:</p><pre><code>&lt;layer-list    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item&gt;        &lt;shape&gt;            &lt;gradient                android:startColor=""#ccd0d3""                android:centerColor=""#b6babd""                android:endColor=""#ccd0d3""                android:height=""1px""                android:angle=""0"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;    &lt;item android:top=""2px""&gt;                &lt;shape            android:color=""@android:color/white""            android:height=""1px"" /&gt;    &lt;/item&gt;&lt;/layer-list&gt;</code></pre><p>If I use <code>android:divider</code> to assign this to a <code>ListView</code> and set the <code>android:dividerHeight=""2""</code>, I get a grey gradient that's two pixels high.  The white line is nowhere to be seen.</p><p>If I set the white line's <code>android:top=""1px""</code>, I see a one pixel grey gradient and a one pixel black line below it.</p><p>Any ideas what I'm doing wrong?</p>","82156","","","","","2011-05-12 06:42:25","How to make two parallel and adjacent lines in Android xml?","<android><view>","1","0","","",""
"1641049","1","1643289","","2009-10-29 00:52:27","7","5017","<p>I have an Android application that generates some HTML which is rendered locally, in a Webkit view.</p><p>The details of the HTML generation aren't really that important except for: </p><ul><li>the bulk of it comes from one place, and I cannot change it</li><li>the template around that HTML (including headers, footers, HEAD etc), the CSS, and Javascript is under my control.</li><li>most images are under my control, and rendered separately from the untouchable HTML. These images come from local disk, and do not require the network. It can be assumed that these images are always available.</li><li>the untouchable HTML contains images which would, ideally be displayed. If the network is unavailable, it is these images that would fail to load.</li><li>the complete HTML file is likely to be stashed to disk, long before it is rendered. i.e. we cannot render different HTML based on network availability.</li></ul><p>The app is likely to be offline for at least some of the time, so I wish to handle the case where images fail to load. </p><p>The images in question are predominantly 1x1 tracking images, but may include images that should be visible if they're available.</p><p>Without invoking JQuery, or an external library, what would you advise my plan of attack?</p><p>I have thoughts on how to do this, but realise that they are many pitfalls to worry about:</p><ul><li>with a CSS selector, select all the images that haven't loaded (is there such a selector?) and use <code>display:none;</code>.</li><li>with Javascript, set the <code>alt</code> attribute on every image to the empty string. This would need to be done on <code>document.onLoad</code>?</li><li>check the availability of the network, and then using CSS hide all images with @href~=^http. I'm not sure how/when to apply this style.</li></ul><p>If it helps, for this problem, I seem to have the following sub-problems. It is not clear the optimal strategy for any of them:</p><ul><li>how to determine the loaded-ness of the images or the state of the network.</li><li>how to hide/mask the failed to load images, such that it is not detectable by the user that the image is missing.</li><li>when to perform these tasks (e.g. when the document/window has finished loading?)</li><li>how to apply them.</li></ul><p>Any thoughts, code, suggestions would be gratefully received.</p>","4737","","","","","2009-10-29 12:12:20","Hiding images that failed to load","<javascript><html><css><android>","4","0","5","",""
"1641102","1","1641133","","2009-10-29 01:11:14","2","512","<p>I'm interested in learning Android development.... but if I install the latest 2.0 SDK, will I still be able to target 1.5 and 1.6 devices? (since there is only one 2.0 device right now)Basically I'm wondering if it will tell me if I'm doing something that won't work on older versions of the OS</p>","194","","","","","2009-10-29 01:25:39","Targeting Android 1.5 and 1.6 from the 2.0 SDK","<android>","2","0","1","",""
"1641792","1","","","2009-10-29 05:41:58","0","1427","<p>I am new to google android will anyone please tell me how to edit google android code to develop my own applications?</p>","198673","","30225","","2009-10-29 05:44:54","2009-10-29 05:46:45","How to edit Google Android Code","<android>","4","2","","",""
"1642142","1","1645023","","2009-10-29 07:39:01","1","1441","<p>Here is some background about my app:</p><p>I am developing an Android app that will display a random quote or verse to the user. For this I am using an SQLite database. The size of the DB would be approximately 5K to 10K records, possibly increasing to upto 1M in later versions as new quotes and verses are added. Thus the user would need to update the DB as and when newer versions are of the app or DB are released.</p><p>After reading through some forums online, there seem to be two feasible ways I could provide the DB:1.  Bundle it along with the .APK file of the app, or 2.  Upload it to my app's website from where users will have to download it </p><p>I want to know which method would be better (if there is yet another approach other than these, please do let me know).</p><p>After pondering this problem for some time, I have these thoughts regarding the above approaches:</p><p>Approach 1:Users will obtain the DB along with the app, and won't have to download it separately. Installation would thereby be easier. But, users will have to reinstall the app every time there is a new version of the DB. Also, if the DB is large, it will make the installable too cumbersome.</p><p>Approach 2:Users will have to download the full DB from the website (although I can provide a small, sample version of the DB via Approach 1). But, the installer will be simpler and smaller in size. Also, I would be able to provide future versions of the DB easily for those who might not want newer versions of the app.</p><p>Could you please tell me from a technical and an administrative standpoint which approach would be the better one and why?</p><p>If there is a third or fourth approach better than either of these, please let me know. </p><p>Thank you!</p><p>Andruid</p>","189785","","","","","2009-10-29 23:43:01","Provide a database packaged with the .APK file or host it separately on a website?","<database><android><sqlite><website>","3","1","1","",""
"1642526","1","1643742","","2009-10-29 09:30:53","1","946","<p>Does anyone know how to handle Android HTC device Red (power) button programatically to stop my operation. I want to stop running some of my operation when user presses REd button when user is in my screen. I know for other buttons like Back button i could use ""keyCode == KeyEvent.KEYCODE_BACK"" event. But what is for Power(End) Red button? I'm not getting any keycode events for Red button when i'm in my application. </p><p>thanks.</p>","187532","","187532","","2009-10-29 11:05:09","2009-10-29 13:29:34","Android:Handling my function under Power(Red) button programmatiacally","<android>","1","0","","",""
"1644367","1","1645134","","2009-10-29 15:04:51","5","2213","<p>Is there any chance to fake a call on Android?I want it to ring and behave like there´s a real call (without the need of a second phone).</p><p>I searched the whole web. In the emulator I would telnet it and type ""gsm call 12345"", but I don´t know how to do it on a real device (rooted).</p><p>Thanks,Tom</p>","198996","","","","","2012-05-05 02:23:01","Fake a real call on Android","<android>","2","4","1","",""
"1645209","1","1645686","","2009-10-29 17:07:42","19","25659","<p>I have a <code>ListView </code> and a <code>EditText</code>. How can I filter ListView data when typing on <code>EditText </code>? </p>","152286","","","","","2012-11-22 14:25:21","How can I filter ListView data when typing on EditText in android","<android>","5","3","11","",""
"1645963","1","1645994","","2009-10-29 19:21:16","0","296","<p>Basically I am creating a database driven website in Web Developer 2008. The database is stored in the App_Data folder of my website project. Could I have an iPhone, Blackberry, Symbian, Windows Phone, webOS or Android app access the database via an HTTP (or some other type of) request?</p><p>I would like to know if this is possible before I move too far in the programming.</p>","199178","","168225","","2010-05-16 20:32:03","2010-05-16 20:32:03","Can I access my websites MS SQL 2008 database from another application","<iphone><android><sql-server-2008><visual-studio-express><visual-web-developer>","2","2","","",""
"1646106","1","1646297","","2009-10-29 19:45:37","7","1198","<p>If I have a free version of a paid app in the Android market how can I place a button in the free app that opens the paid version in the market?</p>","67386","","881229","","2014-04-01 19:22:51","2014-04-01 19:22:51","How do I link from free to paid app in the Android market?","<android><app-store><google-play>","2","0","6","",""
"1646445","1","1647168","","2009-10-29 20:46:12","0","880","<p>The app I'm working on has 4 tabs, 3 of which share many features, including a navigation bar a the bottom with Back, Edit, and Map buttons.  There is <em>exactly</em> the same xml in all 3 layouts, so I'm trying to DRY this out by extracting that xml into a separate component, including it, and then going from there.</p><p>Previously I had</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    			android:layout_height=""fill_parent""    			android:layout_width=""fill_parent""&gt;        &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""                        android:id=""@+id/showedit_toolbar""                        style=""@style/showItemToolbar""&gt;            &lt;ImageButton android:id=""@+id/show_person_back_button""            		style=""@style/blackToolbarButton""            		android:src=""@drawable/left_white_arrow""                   	android:layout_alignParentLeft=""true""/&gt;            &lt;Button android:id=""@+id/show_person_map_button""            		style=""@style/blackToolbarButton""    	       		android:text=""map""                   	android:layout_alignParentRight=""true""/&gt;            &lt;Button android:id=""@+id/show_person_edit_button""    				style=""@style/blackToolbarButton""    				android:text=""edit""        	    	android:layout_toLeftOf=""@id/show_person_map_button""/&gt;		    		    	        &lt;/RelativeLayout&gt;        &lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_height=""fill_parent""             android:layout_width=""fill_parent""                       android:layout_above=""@id/showedit_toolbar""            style=""@style/CoinLightTheme""&gt;// Lots more layout omitted</code></pre><p>I extracted out the bit that's repeated into an xml file called show_toolbar.xml, changing the names of variables to make it more generic across the 3 views</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/show_toolbar""    style=""@style/showItemToolbar""&gt;    &lt;ImageButton style=""@style/blackToolbarButton""        android:src=""@drawable/left_white_arrow""    	android:layout_alignParentLeft=""true""     	android:id=""@+id/show_back_button""/&gt;    &lt;Button android:id=""@+id/show_map_button""        style=""@style/blackToolbarButton""    	android:text=""map""        android:layout_alignParentRight=""true""/&gt;    &lt;Button android:id=""@+id/show_edit_button""        style=""@style/blackToolbarButton""    	android:text=""edit""        android:layout_toLeftOf=""@id/show_map_button""/&gt;		    		    	&lt;/RelativeLayout&gt;</code></pre><p>Then from within my original layout file, I replaced that big block of code with</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    			android:layout_height=""fill_parent""    			android:layout_width=""fill_parent""&gt;    &lt;include android:id=""@+id/show_toolbar"" layout=""@layout/show_toolbar""/&gt;    &lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_height=""fill_parent""         android:layout_width=""fill_parent""        android:layout_above=""@id/showedit_toolbar""                 style=""@style/CoinLightTheme""&gt;</code></pre><p>Now, the problem is that the view no longer shows up.  I can still click the buttons and they respond (i.e. if I click in the corner where the button should be, it still works), but I cannot see the buttons or bar onto which they were drawn.  </p><p>I cannot find very good documentation on how Include is supposed to work, so perhaps I am using it incorrectly.  Any help would be appreciated</p><p>Before</p><p><img src=""http://i34.tinypic.com/2dl0hm1.png"" alt=""Before"" /></p><p>After</p><p><img src=""http://i38.tinypic.com/racgvl.png"" alt=""After"" /></p>","155392","","155392","","2009-10-30 14:10:37","2009-10-30 14:10:37","Android - Including custom component causes it to be hidden behind main view","<java><android><gui><layout>","1","2","","",""
"1648105","1","","","2009-10-30 05:07:32","0","1252","<p>How to create an alert dialog with radio button on the side?I can create a dialog with 3 selection strings using AlertDialog.Builder, but how can I create the one with radio button on the side (i.e. allow only 1 selection)?</p><p>Thank you.</p>","128983","","","","","2010-03-10 07:00:03","How to create an alert dialog with radio button on the side?","<android>","1","0","","",""
"1648253","1","1649824","","2009-10-30 06:05:21","1","602","<p>My ListView have more than 3000 rows. And when I typing on EditText to filter data in my ListView it run slowly. Look at my code here</p><pre><code>final TextWatcher textChecker = new TextWatcher() {    public void afterTextChanged(Editable s) {}    public void beforeTextChanged(CharSequence s, int start, int count,                    int after) {}    public void onTextChanged(CharSequence s, int start, int before,                    int count) {        filterData(search.getText().toString());    }};private void filterData(String textinput){	mCursor = mHelperData.searchData(textinput);	startManagingCursor(mCursor);	String[] from = new String[]{ MyData.KEY_ROWID,			MyData.KEY_TITLE, MyData.KEY_DESCRIPTION };	int[] to = new int[]{ R.id.id, R.id.title, R.id.description, R.id.icon };			setListAdapter(new MyAdapter(this, R.layout.list_row, mCursor, from, to ));}</code></pre><p>I think retrieve data with Cursor is not a good way here. So, Is there any better way to improve the speech in this case?</p>","152286","","","","","2009-10-30 19:32:17","EditText filter run slowly when filter data","<android><listview>","2","0","","",""
"1649086","1","2307936","","2009-10-30 10:43:20","115","86341","<p>I know that in Safari on an iPhone you can detect the screen's orientation and change of orientation by listening for the <code>onorientationchange</code> event and querying <code>window.orientation</code> for the angle.</p><p>Is this possible in the browser on Android phones?</p><p><strong>Update</strong></p><p>To be clear, I am asking whether the rotation of an android device can be detected by <strong>JavaScript</strong> running on a standard web page. It is possible on an iPhone and I wondered whether it could be done for Android phones.</p><p>Thanks</p>","28376","","250260","","2011-12-08 22:27:49","2013-05-26 08:50:59","Detect rotation of Android phone in the browser with javascript","<javascript><android><webkit>","9","0","110","",""
"1650963","1","4429618","","2009-10-30 16:41:52","28","18261","<p>I'm working with the Android NDK, and since it does not currently support the STL, I was wondering if there are any brilliant people out there who have had success with this, or know which is better suited for the Android platform: uSTL or STLPort.</p><p>Thanks!</p><p>EDIT:Looks like another option may be <a href=""http://www.crystax.net/android/ndk-r3.php"">CrystaX .NET</a>. </p><p>From their website:</p><blockquote>  <p>...customized distribution of Android  NDK r3 which I have rebuilt from  official sources. Support of C++  exceptions, RTTI and Standard C++  Library added.</p></blockquote>","16460","","16460","","2010-08-13 19:15:52","2011-05-20 22:51:33","uSTL or STLPort for Android?","<c++><android><android-ndk>","6","2","20","",""
"1650983","1","","","2009-10-30 16:45:05","12","14971","<p>As I understand it, Android will only play AAC format audio if it's encoded as MPEG-4 or 3GPP.</p><p>I'm able to play AAC audio encoded as M4A when it's local to the app, but it fails when obtaining it from a server.</p><p>The following works, as the m4a file is held locally in the res/raw directory.</p><pre><code>MediaPlayer mp = MediaPlayer.create(this, R.raw.*file*);mp.start();</code></pre><p>The following doesn't work. (But does with MP3's).</p><pre><code>Uri uri = Uri.parse(""http://*example.com*/blah.m4a"");MediaPlayer mp = MediaPlayer.create(this, uri);mp.start();</code></pre><p>Can anyone shed any light on why it fails when the m4a audio file is not local?</p><p>Here's (some of) the error...</p><pre><code>ERROR/PlayerDriver(542): Command PLAYER_INIT completed with an error or info UNKNOWN PVMFStatusERROR/MediaPlayer(769): error (200, -32)  WARN/PlayerDriver(542): PVMFInfoErrorHandlingComplete  DEBUG/MediaPlayer(769): create failed:  DEBUG/MediaPlayer(769): java.io.IOException: Prepare failed.: status=0xC8  DEBUG/MediaPlayer(769):     at android.media.MediaPlayer.prepare(Native Method)  DEBUG/MediaPlayer(769):     at android.media.MediaPlayer.create(MediaPlayer.java:530)  DEBUG/MediaPlayer(769):     at android.media.MediaPlayer.create(MediaPlayer.java:507)   ...</code></pre><p>I'm targeting SDK 1.6.</p>","172749","","172749","","2012-03-21 21:40:08","2013-04-20 13:10:30","Streaming AAC audio with Android","<android><audio><aac><m4a>","5","2","11","",""
"1652706","1","","","2009-10-30 22:57:08","3","573","<p>I am trying to find a way to detect in the android browser whether my application has been installed.</p><p>Use case:I have a web page that a user can reach via their android web browser.  If the application is installed it would show ""Tips &amp; tricks"".  If it is not installed, it would show promotional material and a link to download the app.</p><p>Attempted solution:My initial thoughts have been to associate my application with a custom mime type using  the apps manifest and in the web page iterate javascript's mimeTypes array.  I figured if the mime type showed up in the array, I could assume that the application was installed.</p><p>Unfortunately, the mimeTypes array doesn't ever change.</p><p>Any ideas how I could determine if my application is installed when the user accesses my web page via the android browser?</p><p>Thanks for any help / insight you might have.</p>","199970","","649687","","2011-12-20 13:33:23","2012-01-21 23:58:58","Exposing that your app is installed to the android browser","<android>","1","2","2","",""
"1652850","1","","","2009-10-30 23:51:14","34","59452","<p>I have a server that sends my android app a session cookie to be used for authenticated communication.  I am trying to load a WebView with a URL pointing to that same server and I'm trying to pass in the session cookie for authentication.  I am observing that it works intermittently but I have no idea why.  I use the same session cookie to make other calls on my server and these never fail authentication.  I only observe this problem when trying to load a URL in a WebView, and it does not happen every time.  Very frustrating.</p><p>Below is the code that I'm using to do this.  Any help will be greatly appreciated. </p><pre><code>String myUrl = """"http://mydomain.com/""; CookieSyncManager.createInstance(this); CookieManager cookieManager = CookieManager.getInstance(); Cookie sessionCookie =  getCookie(); if(sessionCookie != null){     String cookieString = sessionCookie.getName() +""=""+sessionCookie.getValue()+""; domain=""+sessionCookie.getDomain();     cookieManager.setCookie(myUrl, cookieString);     CookieSyncManager.getInstance().sync(); } WebView webView = (WebView) findViewById(R.id.webview); webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setJavaScriptEnabled(true); webView.setWebViewClient(new MyWebViewClient()); webView.loadUrl(myUrl);</code></pre>","199982","","199982","","2009-10-31 00:22:27","2013-10-21 20:51:02","Android WebView Cookie Problem","<android><cookies><webview>","8","1","36","",""
"1653066","1","1654313","","2009-10-31 01:16:59","1","3638","<p>I'm trying to start doing Android development on OS X (trying is the key here).  I've read all the fun stuff at <a href=""http://developer.android.com/sdk/index.html"" rel=""nofollow"">http://developer.android.com/sdk/index.html</a>.  I get the basics, install the JDK, Eclipse, the Android SDK, the Eclipse plugin and ADT.  That's a lot to do but I get the point of each step, so, OK, fine.  Then there are a million (OK, a few less than that) little things like adding the location of the SDK to your path.  Which ostensibly means editing the .profile file that you can't see in OS X unless you use terminal (or some other method of dealing with hidden files).  Ostensible because, for me, that file isn't in the normal place for some reason.  Since I don't know where it is, for now I can't run anything from the Android SDK without manually going to the tools directory (and maybe this is the answer to the question that I'm getting to...).  </p><p>Regardless, once all that is done the SDK location needs to be chosen from within Eclipse after the Android plugin installer went out and did a whole lot of stuff.  Stuff that doesn't include installing or locating the SDK.  But, OK, done.  However, doing so was also supposed to add at least one Target, but it hasn't.  Normally that just means quick search on Google, but apparently none of the documentation on the Internet knows about this case...other than to point me to the Android plugin source code that presents the error (in case you're curious: <a href=""http://www.netmite.com/android/mydroid/cupcake/development/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/SdkTargetSelector.java"" rel=""nofollow"">http://www.netmite.com/android/mydroid/cupcake/development/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/SdkTargetSelector.java</a>).  </p><p>There just seem to be so many manual steps for what I would think are standard operations; i.e. install SDK and use it.  Then, if something goes wrong there's just a bunch ""in"" knowledge *nix developers just need to know.  I'm all for knowing the system you're developing on but I'm not a sysadmin.  I just want to write code.  Why can't there just be an installer that puts things where they need to go so I can get on with some actual development?</p><p>But, I suppose my real question is: if you've followed all the directions on Google's Android developer site for installing all the various bits and there are no Targets, why aren't they there and how is that corrected?</p><p>Thanks.</p>","136596","","","","","2009-10-31 12:57:33","Setting up OS X for Android development. OR Are *nix environments intentionally prohibitive?","<android><osx><eclipse-plugin><unix>","3","3","","",""
"1653100","1","","","2009-10-31 01:27:14","2","7641","<p>I have an Android <code>Spinner</code> and I'd like to get a callback when the user selects something from its popup dialog.  It seems like <code>setOnItemClickListener()</code> or <code>setOnItemSelectedListener()</code> would be the right method to use, but neither get invoked when I select one of the items in the spinner.</p><p>Is there a correct way to do this?</p><p><strong>UPDATE</strong></p><p>Per commonsware's suggestion, I did the following, but my <code>onItemSelected()</code> method is never being called:</p><pre><code>    final Spinner spinner = (Spinner) findViewById(R.id.spinner);    spinner.setAdapter( new ArrayAdapter&lt;SettingValue&gt;(getContext(), android.R.layout.simple_list_item_1, android.R.id.text1, setting.getSettingValues() ) );    spinner.setOnItemSelectedListener( new OnItemSelectedListener() {        public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {            Log.d(""BOOGA"");            final SettingValue settingValue = (SettingValue)parent.getSelectedItem();            final Editor edit = getContext().getSharedPreferences( PREFS_CONTEXT_NAME, Context.MODE_PRIVATE).edit();            edit.putString(setting.name(), settingValue.name());            edit.commit();        }        public void onNothingSelected(AdapterView&lt;?&gt; parent) {            // do nothing        }    });</code></pre>","82156","","82156","","2009-10-31 02:24:34","2009-10-31 02:24:34","How to get a callback when a Spinner popup dialog is dismissed?","<android><spinner>","1","0","1","",""
"1653491","1","","","2009-10-31 05:18:15","0","1324","<p>I am facing some problem during reading data from socket If there is some null data in socket stream so the DataInputStream would not read the full data and the so at the receiving end there is exception for parsing data. What is the right way to read the data from socket so there is no loss of data at any time ?Thanks in advance. </p>","95877","","","","","2009-11-02 06:54:00","Issue in reading data from Socket","<java><android>","3","0","","",""
"1653617","1","","","2009-10-31 06:36:49","4","24572","<p>The <code>onClick</code> never fires! Why not? Please help me.</p><pre><code>for(int i = 0; i &lt; 12; i++) {    String title = ""Button"" + i;    Button sliderButton = new Button(this);    sliderButton.setText(title);    glideMenuTray.addView(sliderButton,100,40);    sliderButton.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            Log.d(""gm"", ""Tapped "");        }    });}</code></pre>","200057","","844882","","2012-03-17 08:14:07","2014-01-15 05:17:28","Android Dynamically Created Button: setOnClickListener doesn't work","<android><button><onclick>","5","1","0","",""
"1654901","1","1654918","","2009-10-31 16:45:48","11","19058","<p>Is there a way in android to invoke a numeric only keypad, i.e. a virtual keypad that contains only the numbers 0 to 9 and a ""."" sign?</p>","61525","","","","","2011-12-05 08:37:11","Does android have a numeric keypad?","<android><numeric-keypad>","5","0","5","",""
"1655322","1","","","2009-10-31 19:19:58","0","4957","<p>I am building a custom listview used to list contacts from the contact cursor into a list with  two text view for the phone number and name of the contact as well as a place for the images. I am getting a nullpoint error when i try to setText for my TextView Even though i checked the variable to see if they contained a string I have no ideas whats wrong with it.</p><pre><code> public View getView(int position, View convertView, ViewGroup parent) { View rowView=convertView; ViewCache viewCache=null; if (rowView==null) {  LayoutInflater inflater=(LayoutInflater)_context.getSystemService(        Context.LAYOUT_INFLATER_SERVICE);  rowView=inflater.inflate(R.layout.row, null);  viewCache = new ViewCache(rowView);  rowView.setTag(viewCache); } else {  viewCache=(ViewCache)rowView.getTag(); } _cursor.moveToPosition(position); int id = _cursor.getColumnIndex(People._ID); int numbercolumn = _cursor.getColumnIndex(People.NUMBER); int namecolumn = _cursor.getColumnIndex(People.NAME); String tag = ""tag""; Log.i(tag, getItem(position).toString()); String name; String number; number = _cursor.getString(numbercolumn); name = _cursor.getString(namecolumn); Log.i(""test6386"", number); Log.i(""Test456"", name); TextView nameView = viewCache.getName(); TextView numberView = viewCache.getNumber(); nameView.setText(name); numberView.setText(number); Uri uri = ContentUris.withAppendedId(People.CONTENT_URI, _cursor.getLong(id)); Bitmap bitmap = People.loadContactPhoto(_context, uri, R.drawable.icon, null); viewCache.getIcon().setImageBitmap(bitmap); return(rowView);    }</code></pre>","200233","","","","","2012-11-22 15:10:35","Apply Custom ListView For a CursorAdapter","<android><cursor>","1","1","","",""
"1655675","1","1656542","","2009-10-31 21:23:54","1","364","<p>I am assuming that the Android Market app source code is closed but I have a few questions regarding this:</p><ol><li>Why didn't they follow the tabbed UI design which is normally followed? (Is it only because they had more activities to display?)</li><li>How would I go about designing an app like this? I first set up the gallery view and attach an onClick event listener to it. But, upon receiving a click, what should I do? Do I have to use a framelayout or something?</li></ol><p>Thanks</p>","184046","","","","","2009-11-02 01:53:47","Android: Market design philosophy?","<android><design><google-play>","1","0","","2012-06-11 23:54:43",""
"1656593","1","1656792","","2009-11-01 07:19:02","4","4457","<p>Im using the endless adapter <a href=""http://github.com/commonsguy/cwac-endless"" rel=""nofollow"">http://github.com/commonsguy/cwac-endless</a>  however whenever i return false (because i dont have anymore data to append) , as stated here <a href=""http://github.com/commonsguy/cwac-endless/blob/master/README.markdown"" rel=""nofollow"">http://github.com/commonsguy/cwac-endless/blob/master/README.markdown</a>  in appendinbackground, my activity crashes and in Logcat i get a message saying indexoutofbounds etc. </p><p>How do I make it so that I can stop loading extra data? </p>","117691","","2619912","","2014-02-08 14:41:41","2014-02-08 14:41:41","Android Endless Adapter","<android><endlessadapter>","1","0","1","",""
"1657160","1","1657278","","2009-11-01 13:22:05","2","6216","<p>I am interested in developing an app for my HTC Magic (Android) phone.Using instructions on <a href=""http://developer.android.com"" rel=""nofollow"">android's developer site</a>, I installed eclipse with the right plugins, got created the AVD and wrote my first Hello World app which ran in the AVD. I would now like to install that Hello World app on my HTC Magic, but I can't seem to figure out how to do that. I've managed to create a signed .apk file and I've stored that file on the SD card of my phone, but still I can't install it.</p><p>Can anyone please help me?!</p>","94870","","","","","2011-09-14 18:57:31","How do I install my android app on my HTC Magic?","<android><htc>","2","0","1","",""
"1657640","1","","","2009-11-01 16:48:10","2","900","<p>Is there a way, from within my own application, to open up the default camera app and use <em>that</em> to get a picture/video? I keep trying to look it up but I only ever find instructions on cloning the camera app myself (usually with very bad instructions). I know this can be done with the iPhone, I would be surprised if it wasn't possible with Android.</p>","","James","","","","2009-11-02 14:19:00","Android Defer to Camera","<android><camera>","3","0","2","",""
"1659396","1","","","2009-11-02 04:17:49","7","3499","<p>Android 2.0 has <a href=""http://www.guardian.co.uk/technology/blog/2009/oct/28/google-sat-nav-android"">turn-by-turn directions</a>, however, I do not yet see an API exposed for this in the 2.0 SDK.  Are there any documented plans to expose an API for calling into the new turn-by-turn features?</p>","1432","","","","","2009-11-02 12:33:41","Android Turn-by-Turn API?","<java><android><google-maps><gps>","1","1","1","",""
"1659533","1","1659846","","2009-11-02 05:22:13","2","1909","<p>how would I save a drawable to the SDcard (custom folder) and later retrieve it assuming im keeping track of the path of the saved item.</p><p>Thanks,Faisal</p>","117691","","","","","2009-11-02 07:18:09","Saving Drawable to Disk and retrieving - Android","<android><saving><drawable>","1","0","1","",""
"1660150","1","6556498","","2009-11-02 09:09:39","5","12221","<p>I need to move an ImageView (or anything else, for that matter) around inside a RelativeLayout. Does any one know the proper way to do this?</p>","92259","","","","","2012-02-17 21:28:14","Move ImageView around inside RelativeLayout","<android>","4","2","2","",""
"1660417","1","1661446","","2009-11-02 10:13:50","9","11003","<p>I'm using an extended version of BaseAdapter based on the <a href=""http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/List14.html"">EfficientAdapter example</a> from the SDK demo samples.</p><p>My data is basically an object (<code>ListPlaces</code>) which holds an <code>ArrayList</code> with the actual list of places, accessible via <code>listPlaces.getValues()</code>. This ArrayList data is sorted by range and the <code>ArrayList</code> consist of some special items (separators), with no data, but a <code>separator</code> flag set to <code>true</code>. </p><p>Now whenever my <code>EfficientAdapter</code> gets a data object which is a separator it returns <code>false</code> for <code>public  boolean isEnabled(int position)</code> and <code>public View getView(int position, View convertView, ViewGroup parent)</code> inflates two different layouts depending on if the current data object consists of real data or is just a separator dummy.</p><p>This works great, if I inflate the layout every time. However, inflating the layout every time and calling <code>findViewById</code> makes the <code>ListView</code> almost unusabely slow.</p><p>So I tried to use the EfficientAdapter with <code>ViewHolder</code> approach. But that didn't work right out of the box, because of the two different views I try to access. So whenever my <code>convertView != null</code> (the else-case) accesses the items on the layout via our <code>ViewHolder</code> and when the previous View was a separator it of course doesn't work to access a TextView there which is only available on the ""real"" items layout.</p><p>So I also force my <code>getView()</code> to inflate the layout not only when <code>convertView == null</code>, but also when the previous listRow is different than the current one: <code>if (convertView == null || (listRow != listRow_previous)) { [....] }</code></p><p>This seems to almost work now. Or at least it doesn't crash right from the beginning. But it still crashes and I don't know what I've to do different. I've tried to look into <code>convertView.getID()</code> and <code>convertView.getResources()</code>, but that wasn't really helpful so far. Maybe someone else has an idea how I can check whether my current <code>convertView</code> matches with the list item layout or the list separator layout. Thanks.</p><p>Here's the code. Where ever there is a [...] I took out some less important code to make it easier to read and understand:</p><pre><code>private class EfficientAdapter extends BaseAdapter {  private LayoutInflater mInflater;  private ListPlaces listPlaces;  private ListRow listRow;  private ListRow listRow_previous;  public EfficientAdapter(Context context, ListPlaces listPlaces) {      // Cache the LayoutInflate to avoid asking for a new one each time.      mInflater = LayoutInflater.from(context);      // Data      this.listPlaces = listPlaces;  }  /**    * The number of items in the list is determined by the number of items    * in our ArrayList    *    * @see android.widget.ListAdapter#getCount()    */  public int getCount() {      return listPlaces.getValues().size();  }  /**    * Since the data comes from an array, just returning the index is    * sufficent to get at the data. If we were using a more complex data    * structure, we would return whatever object represents one row in the    * list.    *    * @see android.widget.ListAdapter#getItem(int)    */  public Object getItem(int position) {      return position;  }  /**    * Use the array index as a unique id.    *    * @see android.widget.ListAdapter#getItemId(int)    */  public long getItemId(int position) {      return position;  }  @Override  public  boolean isEnabled(int position) {      // return false if item is a separator:      if(listPlaces.getValues().get(position).separator &gt;= 0)    	  return false;      else    	  return true;  }  @Override  public boolean  areAllItemsEnabled() {      return false;			  }  /**    * Make a view to hold each row.    *    * @see android.widget.ListAdapter#getView(int, android.view.View,    *      android.view.ViewGroup)    */  public View getView(int position, View convertView, ViewGroup parent) {      // Get the values for the current list element      ListPlacesValues curValues = listPlaces.getValues().get(position);      if (curValues.separator &gt;= 0)     	  listRow = ListRow.SEPARATOR;      else    	  listRow = ListRow.ITEM;      Log.i(TAG,""Adapter: getView(""+position+"") "" + listRow + "" ("" + listRow_previous + "") -&gt; START"");      // A ViewHolder keeps references to children views to avoid unneccessary calls      // to findViewById() on each row.      ViewHolder holder;      // When convertView is not null, we can reuse it directly, there is no need      // to reinflate it. We only inflate a new View when the convertView supplied      // by ListView is null.      if (convertView == null || (listRow != listRow_previous)) {    	  Log.i(TAG, ""--&gt; (convertView == null) at position: "" + position);    	  // Creates a ViewHolder and store references to the two children views    	  // we want to bind data to.    	  holder = new ViewHolder();    	  if (listRow == ListRow.SEPARATOR) {    		  convertView = mInflater.inflate(R.layout.taxonomy_list_separator, null);    		  holder.separatorText = (TextView) convertView.findViewById(R.id.separatorText);    		  convertView.setTag(holder);    		  Log.i(TAG,""\tCREATE SEPARATOR: convertView ID: "" + convertView.getId() + "" Resource: "" + convertView.getResources());    	  }    	  else {    		  convertView = mInflater.inflate(R.layout.taxonomy_listitem, null);    		  holder.name = (TextView) convertView.findViewById(R.id.name);    		  holder.category = (TextView) convertView.findViewById(R.id.category);    		  // [...]    		  convertView.setTag(holder);    		  Log.i(TAG,""\tCREATE ITEM: convertView ID: "" + convertView.getId() + "" Resource: "" + convertView.getResources());    	  }      } else {    	  // Get the ViewHolder back to get fast access to the TextView    	  // and the ImageView.    	  Log.i(TAG,""\tconvertView ID: "" + convertView.getId() + "" Resource: "" + convertView.getResources());    	  holder = (ViewHolder) convertView.getTag();    	  convertView.setAnimation(null);      }      /* Bind the data efficiently with the holder */      if (listRow == ListRow.SEPARATOR) {    	  String separatorText;    	  switch (curValues.separator) {    	  case 0: separatorText=""case 0""; break;    	  case 1: separatorText=""case 1""; break;    	  case 2: separatorText=""case 2""; break;    	  // [...]    	default: separatorText=""[ERROR]""; break;    	  }    	  holder.separatorText.setText(separatorText);      }       else {    	  // Set the name:    	  holder.name.setText(curValues.name);    	  // Set category    	  String cat = curValues.classification.toString();    	  cat = cat.substring(1,cat.length()-1);	// removing ""["" and ""]""    	  if (cat.length() &gt; 35) {    		  cat = cat.substring(0, 35);    		  cat = cat + ""..."";    	  }    	  holder.category.setText(cat);    	  // [...] (and many more TextViews and ImageViews to be set)      }      listRow_previous = listRow;      Log.i(TAG,""Adapter: getView(""+position+"") -&gt; DONE"");      return convertView;  }  private class ViewHolder {      TextView name;      TextView category;      // [...] -&gt; many more TextViews and ImageViews      TextView separatorText;  }}</code></pre><p>And here my <strong>Logcat</strong> output:</p><pre><code>  755     ListPlaces_Activity  I  onPostExecute: notifyDataSetChanged()                                                                                                  755     ListPlaces_Activity  I  Adapter: getView(0) SEPARATOR (null) -&gt; START                                                                                          755     ListPlaces_Activity  I  --&gt; (convertView == null) at position: 0                                                                                               755     ListPlaces_Activity  I        CREATE SEPARATOR: convertView ID: 2131296317 Resource: android.content.res.Resources@437613e0                                    755     ListPlaces_Activity  I  Adapter: getView(0) -&gt; DONE                                                                                                            755     ListPlaces_Activity  I  Adapter: getView(1) ITEM (SEPARATOR) -&gt; START                                                                                          755     ListPlaces_Activity  I  --&gt; (convertView == null) at position: 1                                                                                               755     ListPlaces_Activity  I        CREATE ITEM: convertView ID: 2131296317 Resource: android.content.res.Resources@437613e0                                         755     ListPlaces_Activity  I  Adapter: getView(1) -&gt; DONE                                                                                                            755     ListPlaces_Activity  I  Adapter: getView(2) SEPARATOR (ITEM) -&gt; START                                                                                          755     ListPlaces_Activity  I  --&gt; (convertView == null) at position: 2                                                                                               755     ListPlaces_Activity  I        CREATE SEPARATOR: convertView ID: 2131296317 Resource: android.content.res.Resources@437613e0                                    755     ListPlaces_Activity  I  Adapter: getView(2) -&gt; DONE                                                                                                            755     ListPlaces_Activity  I  Adapter: getView(3) ITEM (SEPARATOR) -&gt; START                                                                                          755     ListPlaces_Activity  I  --&gt; (convertView == null) at position: 3                                                                                               755     ListPlaces_Activity  I        CREATE ITEM: convertView ID: 2131296317 Resource: android.content.res.Resources@437613e0                                         755     ListPlaces_Activity  I  Adapter: getView(3) -&gt; DONE                                                                                                            755     ListPlaces_Activity  I  Adapter: getView(4) ITEM (ITEM) -&gt; START                                                                                               755     ListPlaces_Activity  I        convertView ID: 2131296317 Resource: android.content.res.Resources@437613e0                                                      755     ListPlaces_Activity  I  Adapter: getView(4) -&gt; DONE                                                                                                            755     ListPlaces_Activity  I  Adapter: getView(5) ITEM (ITEM) -&gt; START                                                                                               755     ListPlaces_Activity  I        convertView ID: 2131296317 Resource: android.content.res.Resources@437613e0                                                      755     ListPlaces_Activity  I  Adapter: getView(5) -&gt; DONE                                                                                                            755     ListPlaces_Activity  I  Adapter: getView(6) ITEM (ITEM) -&gt; START                                                                                               755     ListPlaces_Activity  I        convertView ID: 2131296317 Resource: android.content.res.Resources@437613e0                                                      755     ListPlaces_Activity  I  Adapter: getView(6) -&gt; DONE                                                                                                            755     ListPlaces_Activity  I  Adapter: getView(0) SEPARATOR (ITEM) -&gt; START                                                                                          755     ListPlaces_Activity  I  --&gt; (convertView == null) at position: 0                                                                                               755     ListPlaces_Activity  I        CREATE SEPARATOR: convertView ID: 2131296317 Resource: android.content.res.Resources@437613e0                                    755     ListPlaces_Activity  I  Adapter: getView(0) -&gt; DONE                                                                                                            755     ListPlaces_Activity  I  Adapter: getView(1) ITEM (SEPARATOR) -&gt; START                                                                                          755     ListPlaces_Activity  I  --&gt; (convertView == null) at position: 1                                                                                               755     ListPlaces_Activity  I        CREATE ITEM: convertView ID: 2131296317 Resource: android.content.res.Resources@437613e0                                         755     ListPlaces_Activity  I  Adapter: getView(1) -&gt; DONE                                                                                                            755     ListPlaces_Activity  I  Adapter: getView(2) SEPARATOR (ITEM) -&gt; START                                                                                          755     ListPlaces_Activity  I  --&gt; (convertView == null) at position: 2                                                                                               755     ListPlaces_Activity  I        CREATE SEPARATOR: convertView ID: 2131296317 Resource: android.content.res.Resources@437613e0                                    755     ListPlaces_Activity  I  Adapter: getView(2) -&gt; DONE                                                                                                            755     ListPlaces_Activity  I  Adapter: getView(3) ITEM (SEPARATOR) -&gt; START                                                                                          755     ListPlaces_Activity  I  --&gt; (convertView == null) at position: 3                                                                                               755     ListPlaces_Activity  I        CREATE ITEM: convertView ID: 2131296317 Resource: android.content.res.Resources@437613e0                                         755     ListPlaces_Activity  I  Adapter: getView(3) -&gt; DONE                                                                                                            755     ListPlaces_Activity  I  Adapter: getView(4) ITEM (ITEM) -&gt; START                                                                                               755     ListPlaces_Activity  I        convertView ID: 2131296317 Resource: android.content.res.Resources@437613e0                                                      755     ListPlaces_Activity  I  Adapter: getView(4) -&gt; DONE                                                                                                            755     ListPlaces_Activity  I  Adapter: getView(5) ITEM (ITEM) -&gt; START                                                                                               755     ListPlaces_Activity  I        convertView ID: 2131296317 Resource: android.content.res.Resources@437613e0                                                      755          AndroidRuntime  D  Shutting down VM                                                                                                                       755                dalvikvm  W  threadid=3: thread exiting with uncaught exception (group=0x4001aa28)                                                                  755          AndroidRuntime  E  Uncaught handler: thread main exiting due to uncaught exception                                                                        755          AndroidRuntime  E  java.lang.NullPointerException                                                                                                         755          AndroidRuntime  E        at com.tato.main.ListPlaces_Activity$EfficientAdapter.getView(ListPlaces_Activity.java:330)                                      755          AndroidRuntime  E        at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:191)                                                  755          AndroidRuntime  E        at android.widget.AbsListView.obtainView(AbsListView.java:1255)                                                                  755          AndroidRuntime  E        at android.widget.ListView.makeAndAddView(ListView.java:1658)                                                                    755          AndroidRuntime  E        at android.widget.ListView.fillDown(ListView.java:637)                                                                           755          AndroidRuntime  E        at android.widget.ListView.fillFromTop(ListView.java:694)                                                                        755          AndroidRuntime  E        at android.widget.ListView.layoutChildren(ListView.java:1502)                                                                    755          AndroidRuntime  E        at android.widget.AbsListView.onLayout(AbsListView.java:1112)                                                                    755          AndroidRuntime  E        at android.view.View.layout(View.java:6569)                                                                                      755          AndroidRuntime  E        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)                                                             755          AndroidRuntime  E        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)                                                             755          AndroidRuntime  E        at android.widget.LinearLayout.onLayout(LinearLayout.java:918)                                                                   755          AndroidRuntime  E        at android.view.View.layout(View.java:6569)                                                                                      755          AndroidRuntime  E        at android.widget.FrameLayout.onLayout(FrameLayout.java:333)                                                                     755          AndroidRuntime  E        at android.view.View.layout(View.java:6569)                                                                                      755          AndroidRuntime  E        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)                                                             755          AndroidRuntime  E        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)                                                             755          AndroidRuntime  E        at android.widget.LinearLayout.onLayout(LinearLayout.java:918)                                                                   755          AndroidRuntime  E        at android.view.View.layout(View.java:6569)                                                                                      755          AndroidRuntime  E        at android.widget.FrameLayout.onLayout(FrameLayout.java:333)                                                                     755          AndroidRuntime  E        at android.view.View.layout(View.java:6569)                                                                                      755          AndroidRuntime  E        at android.view.ViewRoot.performTraversals(ViewRoot.java:979)                                                                    755          AndroidRuntime  E        at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)                                                                       755          AndroidRuntime  E        at android.os.Handler.dispatchMessage(Handler.java:99)                                                                           755          AndroidRuntime  E        at android.os.Looper.loop(Looper.java:123)                                                                                       755          AndroidRuntime  E        at android.app.ActivityThread.main(ActivityThread.java:4203)                                                                     755          AndroidRuntime  E        at java.lang.reflect.Method.invokeNative(Native Method)                                                                          755          AndroidRuntime  E        at java.lang.reflect.Method.invoke(Method.java:521)                                                                              755          AndroidRuntime  E        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)                                               755          AndroidRuntime  E        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)                                                                  755          AndroidRuntime  E        at dalvik.system.NativeStart.main(Native Method)</code></pre>","184367","","","","","2009-11-02 15:01:46","Android: EfficientAdapter with two different Views","<java><android><listview><view><adapter>","2","1","8","",""
"1660650","1","1661683","","2009-11-02 11:11:49","5","5280","<p>I want to deploy my application on different screen sizes using the 1.6 feature.I exported the drawable resources with different resolutions in drawable-ldpi, drawable-mdpi and drawable-hdpi folders.On android 1.6 and 2.0 everything looks good.</p><p>My problem is that on 1.5 the drawable-ldpi resources are used instead of drawable or drawable-mdpi ... the application still works but it renders the images scaled and the image quality is lost.</p><p>How can I configure the application so that on 1.5 the only the drawable-mdi folder will be used?</p><p>I'd like to keep the apilevel to 3 so that the same apk will run on 1.5, 1.6 and 2.0.</p>","64475","","","","","2009-11-02 14:41:08","different drawable resolutions","<android>","1","0","4","",""
"1660740","1","1662032","","2009-11-02 11:32:34","7","10980","<p>What is the best way to let my users perform an application update?</p><p>Is there any way to force device reboot after the update? I'm asking this because my application registers some behavior on boot.</p><p>Please note, the application would not be published in the Market. </p><p>Update:</p><p>My app will be preinstalled on a set of ~100 handsets.Should I periodically call a webservice that will inform the device about upgrade available, and then, redirect to an .apk file within a webkit view?</p>","53330","","53330","","2009-11-03 08:25:12","2014-03-01 11:41:13","Android application update - how to?","<android>","1","0","","",""
"1661293","1","1674185","","2009-11-02 13:20:10","29","24263","<p>I have a rather complex ListView, with variable list item heights. Under certain conditions, I need to display an additional view in a list item, which is hidden by default (View.GONE). By enabling it (View.VISIBLE), the list item grows in height (or at least it's supposed to).</p><p>The problem:Even though I declare the item's root layout to wrap_content, and each component in the item to fill_parent, the view I hide/show which is supposed to change the item's height is simply cut off at the bottom instead of its parent (the item layout) growing in height to fully display it.</p><p>Are there any gotchas related to ListViews and item layouts and item height which I may have missed?</p><p><strong>Some more observations:</strong></p><p>For testing purposes I have now reduced the list item layout to just contain the root LinearLayout and an ImageView. When I set the LinearLayout height to e.g. 200dip and the ImageView to fill_parent, I would have expected the ImageView to grow until it hits the 200dip limit set by its parent.</p><p>However, the image will instead be only ever as tall as its bitmap resource (as if I had set it to wrap_content) and the whole list item will be of the same height (i.e. as if I had set it to wrap_content, too).</p><p>If however I set the image height to e.g. 200dip, then the list item will grow in height, and so will the item layout.</p><p>In other words, the layout_height of the list item layout is completely ignored, and so is any height value on ImageView other than a hard-coded pixel value.</p>","127013","","127013","","2009-11-02 14:34:10","2013-01-10 00:05:44","Why do ListView items not grow to wrap their content?","<android><listview>","6","1","16","",""
"1661638","1","1662798","","2009-11-02 14:32:23","0","343","<p>There is a thread that fills the db and I am trying to make my ListActivity to grow dynamically according to the entries in the db. By dynamically I mean to grow in real time while the db is filling.</p><p>What is the best way to implement this.</p>","184601","","184601","","2009-11-02 16:17:56","2009-11-02 18:12:34","dynamically fill ListActivity","<android>","2","0","","",""
"1661697","1","","","2009-11-02 14:44:20","1","903","<p>There is a stack of activity i want to call the activity from that stack , My question is that is it possible to check from that stack and call that intent  . When i press home button and again when i press the executable it should start the activity where i have left . Is it possible ?Any example related to the same would be great help </p><p>Thnx in advance  .</p>","95877","","","","","2010-01-14 00:48:20","Stack of activity from Activity stack","<java><android>","1","2","1","2012-08-01 12:26:18",""
"1663514","1","","","2009-11-02 20:32:56","13","18619","<p>I have a app, which sends a lot of SMS messages to a central server.  Each user will probably send ~300 txts/day.  SMS messages are being used as a networking layer, because SMS is almost everywhere and mobile internet is not.  The app is intended for use in a lot of 3rd world countries where mobile internet is not ubiquitous.</p><p>When I hit a limit of 100 messages, I get a prompt for each message sent.  The prompt says ""A large number of SMS messages are being sent"".  This is not ok for the user to get prompted each time to ask if the app can send a text message.  The user doesn't want to get 30 consecutive prompts.  </p><p>I found this android source file with google.  It could be out of date, I can't tell.  It looks like there is a limit of 100 sms messages every 3600000ms(1 day) for each application.</p><p><a href=""http://www.netmite.com/android/mydroid/frameworks/base/telephony/java/com/android/internal/telephony/gsm/SMSDispatcher.java"" rel=""nofollow"">http://www.netmite.com/android/mydroid/frameworks/base/telephony/java/com/android/internal/telephony/gsm/SMSDispatcher.java</a></p><pre><code>/** Default checking period for SMS sent without uesr permit */private static final int DEFAULT_SMS_CHECK_PERIOD = 3600000;/** Default number of SMS sent in checking period without uesr permit */private static final int DEFAULT_SMS_MAX_ALLOWED = 100;</code></pre><p>and</p><pre><code>/** *  Implement the per-application based SMS control, which only allows *  a limit on the number of SMS/MMS messages an app can send in checking *  period. */private class SmsCounter {    private int mCheckPeriod;    private int mMaxAllowed;    private HashMap&lt;String, ArrayList&lt;Long&gt;&gt; mSmsStamp;    /**     * Create SmsCounter     * @param mMax is the number of SMS allowed without user permit     * @param mPeriod is the checking period     */    SmsCounter(int mMax, int mPeriod) {        mMaxAllowed = mMax;        mCheckPeriod = mPeriod;        mSmsStamp = new HashMap&lt;String, ArrayList&lt;Long&gt;&gt; ();    }    boolean check(String appName) {        if (!mSmsStamp.containsKey(appName)) {            mSmsStamp.put(appName, new ArrayList&lt;Long&gt;());        }        return isUnderLimit(mSmsStamp.get(appName));    }    private boolean isUnderLimit(ArrayList&lt;Long&gt; sent) {        Long ct =  System.currentTimeMillis();        Log.d(TAG, ""SMS send size="" + sent.size() + ""time="" + ct);        while (sent.size() &gt; 0 &amp;&amp; (ct - sent.get(0)) &gt; mCheckPeriod ) {                sent.remove(0);        }        if (sent.size() &lt; mMaxAllowed) {            sent.add(ct);            return true;        }        return false;    }}</code></pre><p>Is this even the real android code?  It looks like it is in the package ""com.android.internal.telephony.gsm"", I can't find this package on the android website.</p><p>How can I disable/modify this limit?  I've been googling for solutions, but I haven't found anything.</p><hr><p>So I was looking at the link that commonsware.com posted, and I found that the source had actually changed.  And so I might still have a shot.</p><pre><code>    int check_period = Settings.Gservices.getInt(mResolver,            Settings.Gservices.SMS_OUTGOING_CEHCK_INTERVAL_MS,            DEFAULT_SMS_CHECK_PERIOD);    int max_count = Settings.Gservices.getInt(mResolver,            Settings.Gservices.SMS_OUTGOING_CEHCK_MAX_COUNT,            DEFAULT_SMS_MAX_COUNT);    mCounter = new SmsCounter(max_count, check_period);</code></pre><p>This is getting checkPeriod and maxCount from a settings table.  But I don't seem to have access to the same table.  That source should be Android 1.1, which is the same I'm using.  When I try to import android.provider.Settings.Gservices, I get an error saying that the import can't be resolved.</p><p>What is going on?</p>","189155","","50776","","2013-01-14 13:51:12","2013-05-15 03:24:28","Android sending lots of SMS messages","<android><sms>","3","8","7","",""
"1663979","1","","","2009-11-02 21:56:30","3","6644","<p>In my app I am drawing bus routes on top of a <a href=""http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapView.html"" rel=""nofollow"">MapView</a>. The routes have anywhere between a dozen and a few hundred GPS coordinates that describe the route that the bus takes.</p><p><img src=""http://imgur.com/GC2T1.png"" alt=""Hosted by imgur.com"" /></p><p>The problem I'm having is that once I draw out all these lines panning/zooming the <code>MapView</code> is incredibly slow (even clicking the 'Back' button takes a minute to happen). </p><p>I'm not sure how relevant it is, but I put in some debug code then checked the logcat output and the <code>MapView</code> is repeatedly calling the <code>draw()</code> method of the <a href=""http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/Overlay.html"" rel=""nofollow"">Overlay</a> whether anything has changed or not. This is happening several times a second and is causing a massive amount of garbage collection to happen (2-3 MB every second).</p><p>Does anyone have any ideas/suggestions for a method to try and speed this up?</p>","76835","","","","","2012-01-01 15:24:22","More efficient map overlays in Android","<android><overlay><android-mapview>","2","1","5","",""
"1664472","1","1673374","","2009-11-02 23:58:43","3","3136","<p>I have an activity that on it's onCreate method it does:</p><blockquote>  <p>registerForContextMenu(theView);</p></blockquote><p>and in onCreateContextMenu:</p><pre><code>super.onCreateContextMenu(menu, v, menuInfo);menu.add(blablabla);</code></pre><p>This works great, but the problem is that the context menu disappears when the screen rotates.How to fix this?</p><p>Thanks for reading!</p>","119895","","","","","2010-06-01 23:47:31","Persisting a context menu after screen rotation","<android><contextmenu>","3","0","1","",""
"1666431","1","1671896","","2009-11-03 10:17:25","1","4407","<p>I'm trying to make sync according <a href=""http://source.android.com/download"" rel=""nofollow"">http://source.android.com/download</a> manual,so everything is good, except syncing :)</p><pre><code>repo sync...Fetching projects:   5% (8/143)  Initializing project platform/development ...fatal: The remote end hung up unexpectedlyerror: Cannot fetch platform/development.. orFetching projects:   2% (3/143)  fatal: read error (Connection reset by peer)error: Cannot fetch platform/bootable/diskinstaller</code></pre><p>I've found this <a href=""http://code.google.com/p/android/issues/detail?id=989"" rel=""nofollow"">issue</a>, but there is not valuable information</p><p>Any ideas?</p>","170649","","7498","","2009-11-03 11:04:32","2011-07-27 11:14:19","cannot sync from android repository","<android><git><repository>","2","1","","",""
"1666685","1","1859999","","2009-11-03 11:10:43","32","29197","<p>I am displaying a table of values in my android application, and would like the columns to be distributed evenly in terms of size , instead of sizing according to content. </p><p>Been playing around with stretchColumns but couldn't manage to figure out the right combination, Any Ideas?</p>","45471","","","","","2014-02-25 16:05:10","Android Stretch columns evenly in a TableLayout","<android>","5","4","10","",""
"1666736","1","1667339","","2009-11-03 11:26:03","39","20224","<p>If a <code>String</code> is longer than the <code>TextView</code>'s width it automatically wraps onto the next line. I can avoid this by using <code>android:singleLine</code> (deprecated) or by setting <code>android:inputType=""text""</code>. What I need now is something that replaces the last 3 characters of my <code>String</code> with ""<strong>...</strong>"". Since I'm not using a monospace font this will always be different depending on the letters used in my <code>String</code>. So I'm wondering what's the best way to get the last 3 characters of a String in a <code>TextView</code> and replace them. Maybe there's already something implemented in the Android framework, since this must be a common problem.</p>","184367","","1193519","","2013-06-12 20:41:05","2013-06-12 20:41:05","Android: TextView automatically truncate and replace last 3 char of String","<java><android><textview>","2","0","6","",""
"1667278","1","4342549","","2009-11-03 13:15:24","158","87252","<p>Java EE has <a href=""http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletRequest.html"">ServletRequest.getParameterValues()</a>.</p><p>On non-EE platforms, <a href=""http://download.oracle.com/javase/1.4.2/docs/api/java/net/URL.html#getQuery%28%29"">URL.getQuery()</a> simply returns a string.</p><p>What's the normal way to properly parse the query string in a URL when <em>not</em> on Java EE?  </p><hr><p>&lt;<strong>rant</strong>&gt;</p><p>It is popular in the answers to try and make your own parser.  This is very interesting and exciting micro-coding project, but <strong><em>I cannot say that it is a good idea</em></strong> :(</p><p>The code snippets below are generally flawed or broken, btw.  Breaking them is an interesting exercise for the reader.  <em>And to the hackers attacking the websites that use them</em>.</p><p>Parsing query strings is a well defined problem but reading the spec and understanding the nuances is non-trivial.  It is far better to let some platform library coder do the hard work, and do the fixing, for you!</p><p>&lt;<strong>/rant</strong>&gt;</p>","15721","","1525300","","2012-10-11 06:04:11","2013-07-09 10:43:54","Parsing query strings in Java","<java><android><parsing><url>","19","9","25","",""
"1669215","1","1670296","","2009-11-03 18:22:29","4","559","<p>Thus far, all the Android applications I've worked on, are multimedia-oriented. In this context, support for Flash in Android is very intriguing topic for me (and many others, I believe).</p><p>Do you think that HTC Hero's Flash in the browser is strong enough indication that, at one point in the future, Android will support the Adobe platform?The inconsistency and scarcity of the info on this topic is really strange to me and the <a href=""http://www.talkandroid.com/1308-adobe-flash-player-10-for-android/"" rel=""nofollow"">postponement</a> of the awaited October release of FP10 for Android doesn't make it any better.</p><p>Still, if we assume that some future version of the SDK offers the developers support for SWF files (please, don't call it FlashView...), how would that impact the Android application environment, in your opinion?</p><p><strong>P.S.</strong> And somewhat related side question: Can I make a sample application that uses <code>WebView</code> + HTC Hero and loads simple Flash content as media source? Maybe simple HTML document, containing only embedded SWFObject? It would be pretty hacky, but the concept seems cool to me.</p>","144969","","321731","","2014-03-23 21:04:02","2014-03-23 21:04:02","Flash and Android - common future?","<android><flash><adobe>","4","0","1","2011-11-16 20:38:28","2009-11-03 19:28:32"
"1669632","1","","","2009-11-03 19:31:07","1","1105","<p>I have the following in my layout.xml file:</p><pre><code>&lt;CheckedTextView     android:id=""@+id/checktext""    android:layout_width=""fill_parent""    android:layout_height=""?android:attr/listPreferredItemHeight""    android:textAppearance=""?android:attr/textAppearanceLarge""    android:gravity=""center_vertical""    android:checkMark=""?android:attr/listChoiceIndicatorSingle""    android:paddingLeft=""6dip""    android:paddingRight=""6dip""/&gt;</code></pre><p>It shows the 'radio button', but when I call in my onClickListener()? </p><pre><code>CheckedTextView numberView2 = (CheckedTextView) v.findViewById(R.id.checktext);numberView2.setSelected(true);v.invalidate();</code></pre><p>It does not show the 'radio button' as selected. I have stepped via the source code, it does execute 'numberView2.setSelected(true);', but it still does not show the radio button as selected.</p><p>Can you please tell me why is that? And how can I fix my problem.</p>","128983","","","","","2012-11-05 08:32:30","Need help in using CheckedTextView in android","<android>","1","2","","",""
"1670050","1","","","2009-11-03 20:50:00","3","1294","<p>There are currently push notifications available for iPhones, Palm Pre and Blackberries each provided by their respective manufacturer. However I have heard nothing for Androids (probably because google does not actually sell the phones themselves. Are there any solutions out there at all?</p>","56952","","14343","","2010-07-14 12:34:26","2010-07-14 12:34:26","Are there any push notification system in place for Androids?","<android><mobile><push-notification>","4","3","","",""
"1670446","1","1671398","","2009-11-03 22:07:16","5","7510","<p>If you own Android phone you are no doubt have noticed how in the certain apps the keyboard layout can change from the standard issue to digits-only or to have <code>.com</code> or <code>.net</code> special buttons based on the text field input type (e.g. phone number). So I have 2 questions: </p><ol><li>how to trigger this customization? I suspect it has to do with <code>EditText</code> format</li><li>Can this be taken even further if I want to add some custom buttons to inject a specific pattern? Say I would have an <code>AND</code> button which when pressed will add all uppercase "" AND "" surrounded by spaces to the text field. Can this be done? </li><li>What I'm <em>not</em> asking is how to capture some key combination in onKeyPress event and then populate text field with a pattern - I pretty much know how to do that already.</li></ol>","135946","","","","","2009-12-18 00:38:25","Android - cutomized keyboard key and action","<android><keyboard><customization>","2","0","1","",""
"1670594","1","1671780","","2009-11-03 22:35:20","2","4141","<p>I have trying to set an OnKeyListener, but I am not sure how can I get the selected row on the list view in the OnKeyListener().  The 'v' parameter always give me the ListView, not the selected row.  Any idea how to solve this problem? Thank you.</p><pre><code>listView.setOnKeyListener(new OnKeyListener() {            public boolean onKey(View v, int keyCode, KeyEvent event) {             //....            }}</code></pre>","125440","","","","","2009-11-04 05:32:54","Setting setOnKeyListener for a ListView","<android>","1","1","1","",""
"1671462","1","1671523","","2009-11-04 02:55:11","10","17402","<p>i am using eclipse with android plugin and sdk, but i can not create a virtual device due to there is no target,  and when I execute this:</p><pre><code>  $ ./android list targets   Available Android targets:</code></pre><p>what should i do?</p><p>and..............</p><p>when i try to install the available packages in eclipse avd manage it comes to:</p><p>Downloading SDK Platform Android 2.0 API5, revision1SSL peer shutdown incorrectly....</p>","179620","","179620","","2009-11-04 03:16:04","2011-08-20 18:37:06","android can not find a target","<android><linux><eclipse>","4","0","3","",""
"1671569","1","","","2009-11-04 03:44:53","11","11699","<p>With the physical keyboard you can catch key presses with a <a href=""http://developer.android.com/reference/android/text/method/KeyListener.html"">KeyListener</a>, something like:</p><pre><code>myEditText.setOnKeyListener(new OnKeyListener() {    @Override    public boolean onKey(View v, int keyCode, KeyEvent event) {        if (keyCode == KeyEvent.KEYCODE_ENTER) {             /* do something */         }    }});</code></pre><p>Does anyone know how to do this (or similar) with the virtual keyboard?</p>","76835","","","","","2010-11-01 13:17:28","Catching key pressed with the virtual keyboard in Android?","<android><edittext><keylistener>","1","1","2","",""
"1671903","1","","","2009-11-04 05:54:44","0","408","<p>How do you remove an item from a ListView in Android?</p>","202362","","584405","","2011-11-28 12:16:13","2011-11-28 12:16:13","Remove item from listview","<android><listview>","1","0","","",""
"1671967","1","","","2009-11-04 06:15:42","0","1310","<p>I want store an image using a SQLite database in Android (using an insert statement).</p><p>Also I need to retrieve the image from the SQLite database and display it on the screen.</p><p>Thank you.</p>","202362","","47680","","2009-11-04 06:38:41","2009-11-04 06:40:37","android database","<android>","1","0","","",""
"1672157","1","","","2009-11-04 07:18:05","2","720","<p>I have an android client which will make Http connections to a server.</p><p>The server requires that all Http request provide a monotonically increasing counter in the Http header. e.g.</p><pre><code>POST /foo/serverX-count: 43</code></pre><p>Places that will initiate Http connections:</p><ol><li>Inside activities under the user's command e.g. button clicks</li><li>Inside a Service (started by <code>Context#startService</code>)</li></ol><p>To dish out counter values, I plan to host an <code>AtomicInteger</code> in my <code>Application</code> subclass. All code will then retrieve a count from a central place. </p><p>If the Http connection fails (e.g. server is down), I need to decrement the counter.</p><p>Do you think AtomicInteger is a good fit for my scenario ?</p>","27328","","","","","2009-11-04 21:20:17","Is AtomicInteger a good solution to provide a counter for multithreaded app?","<java><android><multithreading><concurrency>","3","0","1","",""
"1672587","1","1672899","","2009-11-04 09:18:05","5","1406","<p>How can I find hardware properties at runtime?I want to be able to know if the device has a physical keyboard, d-pad, trackball, etc.</p>","13186","","","","","2010-12-27 13:10:31","Android hardware properties","<android><hardware>","2","0","1","",""
"1674101","1","1676204","","2009-11-04 14:29:45","34","33731","<p>I have an Android 1.5 project in Eclipse and whenever I merely have an xml resource file open the build dies with an error. E.g. if I have the <code>res\layout\main.xml</code> open as the active document it won't build and throws the following error:</p><pre><code>Error in an XML file: aborting build.res\layout\main.xml:0: ERROR Resource entry main is already defined.</code></pre><p>Then I have to delete <code>main.out.xml</code> and switch to any .java file in the project to get it to build.</p><p>Do I have something configured incorrectly or is this just an Eclipse or ADT bug?It drove me nuts for an hour before I figure out what the cause was.</p>","12915","","1544250","","2012-04-08 18:28:51","2013-04-04 09:30:16","Android project won't build when editing a resource file","<java><android><eclipse>","8","3","8","",""
"1674410","1","1674695","","2009-11-04 15:10:38","0","1359","<p>Hi I want to customize colour palette in Android widgets. </p><p>Orange colour is good but it can be done better.</p><p>Things which I want to do:- override colours in menu after press and focus- override colours in ongoing notification bar- override colour in EditText frameand finally - override spinner focus and press colour</p><p>I want to use build-in method forcing Android do build menu and passing it for me.</p><p>As a last resort I may build it from scratch, but this is less welcome, from obvious reasons :-).</p><p>thanks in advance,Patrick</p>","186268","","","","","2009-11-04 15:51:06","How to customize build-in widgets in Android (menu, notification, spinners etc.)?","<android><layout><widget>","1","0","","",""
"1675402","1","1675614","","2009-11-04 17:29:09","0","207","<p>I'm re-inventing the wheel here, but as I'm a beginner programmer I'm curious as to the best way to do this...</p><p>As part of an Android app, I'm developing a very simple media player. It plays the file, and I want a m:s timer, so the user can see how far into the file they are (e.g. ""04:56"").I'm probably missing the obvious, but what's the best way to do this?</p><p>One way would be to generate a new thread which sleeps for 1000ms, then calls MediaPlayer.getCurrentPosition() and updates the UI. However, this seems slightly ridiculous - my thread isn't guaranteed to come back every second, so I'm going to be displaying an inaccurate time. There must be a better way of doing this?</p><p>Educate me (or link for me).</p>","202807","","","","","2009-11-04 18:04:46","Efficient way to update mm:ss from a playing MP3 file","<android><media>","2","0","","",""
"1675502","1","","","2009-11-04 17:46:03","0","1103","<p>I've been looking into the Android SDK's example of the <a href=""http://developer.android.com/guide/samples/SearchableDictionary/index.html"" rel=""nofollow"">SearchableDictionary</a> for a while now, but I'm still not sure if that is the right approach.</p><p>The problem is, that I want to fill my hint list (see picture below) with data, which I will receive via a HTTP/JSON query. So I'm not sure if using a <a href=""http://developer.android.com/guide/topics/providers/content-providers.html"" rel=""nofollow"">ContentProvider</a> as used in the above example is the right thing to do. Can I access the hint list of the SearchBox in some way more direct?</p><p><img src=""http://developer.android.com/guide/samples/images/SearchableDictionary1.png"" alt=""alt text""></p>","184367","","","","","2009-11-09 14:29:52","Android: SearchBox -> fill hint list dynamically with data received via HTTP/JSON","<java><android><json><http><android-contentprovider>","1","0","1","",""
"1675937","1","1690672","","2009-11-04 19:06:47","2","932","<p>Since Android supports <a href=""http://developer.android.com/guide/topics/ui/themes.html"" rel=""nofollow"">styles</a> and it's good practice to use them (similar to CSS), I made a new style and applied it to 3 buttons.</p><p>The Layout builder in Eclipse did not register the changes and either broke (showed nothing) or didn't apply styles at all.</p><p>After running the app in the emulator, styles are correctly applied.</p><p>So is there something I'm missing or the Android plugin doesn't support styles?</p>","47680","","","","","2010-06-15 05:13:21","Eclipse doesn’t recognize style in the Android Layout builder?","<android><coding-style><styles>","1","0","1","",""
"1676353","1","1676898","","2009-11-04 20:18:52","0","726","<p>I am trying to update the ListView with periodic updates taken from an HTTP response. Now, I am thinking that because this is very specific to my application, I can get away by using a background thread and then updating the ListView using the magic UI thread. The last time I tried this, I had to remove the entire adapter of the ListView and then fill it up again so it  worked. But this time, what I am trying to do is a more ""smooth"" scrolling ListView... something like a scrolling ticker... Is there a different approach to achieve this?</p>","184046","","","","","2009-11-04 21:50:24","Android: Moving window of items in a ListView?","<android><http><listview><user-interface><rss>","1","0","0","",""
"1676545","1","","","2009-11-04 20:54:56","0","1499","<p>I want to cause the focus of one edit text box to move to another on editting (meaning you can only type on letter before it automatically moves on to the next edit text).</p><p>It's the ""on edit"" that I can't get my head around. Can anyone help me out with a simple example? Theres a lot I need to implement it into, so just a basic understanding should set the ball rolling ^_^</p>","202943","","","","","2010-07-18 22:41:52","Android EditText boxes","<android><events><focus><edit><edittext>","2","0","","",""
"1676767","1","3280461","","2009-11-04 21:32:21","1","729","<p>I'm developing my first Android application and it is based partly on displaying some information in Google Maps. I've managed to set a new center point and a new default zoom level (the area I want to display is a city).</p><p>Now is it possible to ""lock"" that new default view somehow? That is, the user should be able to zoom in/out and pan around only within this default area.</p>","202968","","","","","2010-07-19 11:02:06","Howto limit the map in Android?","<android><google-maps><locking><limit><zoom>","1","0","2","",""
"1677038","1","1677529","","2009-11-04 22:13:24","26","17176","<p>I'm trying to center a <code>View</code> vertically on screen with the following layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""	android:orientation=""vertical""	android:layout_width=""fill_parent""	android:layout_height=""fill_parent"" &gt;	&lt;EditText 		android:text=""example text""  		android:layout_width=""wrap_content"" 		android:layout_height=""wrap_content""		android:layout_gravity=""center_vertical"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>However it doesn't work. The <code>EditText</code> is still at the top of the screen. Can someone explain what I'm doing wrong here?</p><p><strong>NOTE:</strong> if I add <code>center_horizontal</code> to the <code>layout_gravity</code> attribute then it centers it horizontally, but still does not center vertically.</p><p><strong>UPDATE:</strong> using <code>android:gravity=""center_vertical""</code> on the parent worked. I still don't understand why <code>android:layout_gravity=""center_vertical""</code> on the child didn't work.</p>","76835","","76835","","2009-11-04 22:36:03","2011-09-28 20:37:16","Vertically centering a view in Android","<android><gui><layout>","1","1","3","",""
"1677346","1","","","2009-11-04 23:15:03","9","2159","<p>In android, there are different sub-directory under 'res'* layout* layout-finger* layout-land-finger</p><p>Can you please explain what are the difference between these directories?</p><p>Thank you.</p>","125440","","","","","2009-11-05 01:45:19","difference between layout-finger and layout directory","<android>","1","0","1","",""
"1678067","1","1678248","","2009-11-05 03:02:16","3","3500","<p>So I have a webview I'd like to display as a dialog. I'd like the webview to fill the entire screen, except for a button below it that I'd like to stay at the bottom of the dialog regardless of how much content is in the webview. Currently my webview fills up the dialog just enough to push the button off the screen. I'm sure this is something pretty easy but for the life of me, I haven't been able to find the magical combination of layouts, views and attribute values to get it to play nice. Just to be clear, I've gotten it so the button floats over the webview but I'd like the webview to stop just above the button and scroll, if that makes sense.</p><pre><code>&lt;RelativeLayout android:id=""@+id/RelativeLayout01""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;WebView android:id=""@+id/webview""           android:layout_width=""fill_parent""           android:layout_height=""wrap_content""           /&gt;   &lt;Button android:text=""Ok""           android:id=""@+id/btnOk""           android:layout_width=""120px""           android:layout_height=""wrap_content""          android:layout_gravity=""center_horizontal""          android:layout_alignParentBottom=""true""          /&gt;&lt;/RelativeLayout&gt;</code></pre>","21126","","21126","","2012-05-11 14:25:53","2012-05-11 14:25:53","Android layout issue with buttons below WebView","<android><android-layout>","1","0","4","",""
"1678122","1","1678170","","2009-11-05 03:17:53","644","131340","<p>Anytime I have to re-import my projects into Eclipse (if I reinstalled Eclipse, or changed the location of the projects), <strong>almost all</strong> of my overridden methods are not formatted correctly, causing the error <code>The method must override a superclass method</code>.</p><p>It may be noteworthy to mention this is with Android projects - for whatever reason, the method argument values are not always populated, so I have to manually populate them myself. For instance:</p><pre><code>list.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {    //These arguments have their correct names    public void onCreateContextMenu(ContextMenu menu, View v,                                     ContextMenuInfo menuInfo) {                     }});</code></pre><p>will be initially populated like this:</p><pre><code>list.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {    //This methods arguments were not automatically provided        public void onCreateContextMenu(ContextMenu arg1, View arg2,                                    ContextMenuInfo arg3) {    }});</code></pre><p>The odd thing is, if I remove my code, and have Eclipse automatically recreate the method, it uses the same argument names I already had, so I don't really know where the problem is, other then it auto-formatting the method for me.</p><p>This becomes quite a pain having to manually recreate ALL my overridden methods by hand. If anyone can explain why this happens or how to fix it .. I would be very happy.</p><p>Maybe it is due to the way I am formatting the methods, which are inside an argument of another method?</p>","190303","","2888561","","2014-03-30 05:55:47","2014-03-30 05:55:47","'Must Override a Superclass Method' Errors after importing a project into Eclipse","<java><android><eclipse><override><superclass>","8","1","130","",""
"1678493","1","","","2009-11-05 05:15:56","20","21753","<p>How do I long click on a mapview so that a place marker appears at that point on the map? </p><p>I tried a couple ways without success: </p><p>1) Using <code>setOnLongClickListener</code> on the <code>MapvView</code> which never detected the longclicks.</p><p>2) My other idea was to extend <code>MapView</code> to override <code>dispatchTouchEvent</code> .. Create a GestureDetector to respond to longpress callback. But I was stuck midway here as I could not get a handle to my subclassed Mapview. i.e.</p><pre><code>MyMapview mymapview; //MyMapView extends MapView//results in a classcast exceptionmymapView = (MyMapView) findViewById(R.id.map);</code></pre><p>3) The only other way I know how to try this is: Detect a <code>MotionEvent.ACTION_DOWN</code> and post a delayed runnable to a handler and detect longpress if the two other events: acton_move or an action_up, have not happened.</p><p>Can someone provide thoughts on any of these methods to detect long presses? </p>","203181","","213269","","2011-01-14 12:40:45","2012-08-14 21:16:26","android maps: How to Long Click a Map?","<android><android-mapview><long-click>","8","0","15","",""
"1678804","1","1679412","","2009-11-05 07:02:44","0","1765","<p>When my app upload to android market,Upload assets have a warnig message about this:</p><p>""This apk requests 1 permissions that users will be warned aboutandroid.permission.INTERNET""</p><p>I check the app of manifest.xml,I'm sure there are manifest.xml to join the line</p><p>""uses-permission android:name=""android.permission.INTERNET""</p><p>so...Why are there warning message about ""android.permission.INTERNET""?</p><p>And another question,the Upload assets of  ""Localized to""  appear unknown,how to set this field about ""Localized to""?</p><p>thanks~</p>","1225005","","1225005","","2009-11-05 07:11:00","2009-11-29 06:26:41","About android market to upload an application","<android><localization><google-play>","2","0","","",""
"1679707","1","1679926","","2009-11-05 10:41:59","0","407","<p>Taken from the Android documentation about <a href=""http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html"" rel=""nofollow"">LayoutParams</a>:</p><blockquote>  <p>FILL_PARENT, which means the view wants to be as big as its parent (minus padding)</p>    <p>WRAP_CONTENT, which means that the view wants to be just big enough to enclose its content (plus padding)</p></blockquote><p>Now, if the parent sets its height to <code>wrap_content</code>, and the child sets its height to <code>fill_parent</code>, what does that actually mean? I mean, this sounds like a ""tie"" between size requests: the child wants to be as big as its parent, but the parent wants to be as big as its child.</p><p>I've read <a href=""http://developer.android.com/guide/topics/ui/how-android-draws.html"" rel=""nofollow"">How Android Draws Views</a>, but the article doesn't explain how layout params and MeasureSpecs actually work together.</p>","127013","","","","","2009-11-05 11:26:04","What does it mean when a parent wraps_content and a child fills_parent?","<android><layout><rendering>","1","0","","",""
"1679767","1","1679802","","2009-11-05 10:54:00","0","517","<p>If you run this command:</p><pre><code>$ curl -XHEAD -i -H ""User-Agent: myuseragent"" http://www.google.comHTTP/1.1 302 Found ... snip ...Server: gwsContent-Length: 222X-XSS-Protection: 0</code></pre><p>you will notice immediately that the curl command hangs. (I am running this in cygwin/VISTA)</p><p>If you run it against twitter or facebook, curl terminates immediately.I suspect it's because twitter &amp; facebook returns <code>Connection: close</code>.</p><p>In my Android 1.5 cupcake app, I am running the same command using the HttpClient framework. And I notice that the connection hangs but terminates after the timeout (Thank god for Http 4.0 !! ).</p><p>Is there an option to set in HttpClient to terminate once I've received the relevant HEADhttp headers?</p>","27328","","1777090","","2013-01-21 07:25:03","2013-01-21 07:25:03","How to force a Http HEAD command to terminate (for HttpClient and curl)?","<java><android><unix><tcp><httpclient>","1","0","","",""
"1680394","1","","","2009-11-05 12:56:20","2","555","<p>I am trying to bring an activity to the foreground from inside the activity. I am implementing multiple applications that do not cover the whole screen, so you can see other applications (activities) in the background and even touch them. The activities in the background react on the touch event (e.g. one of it's button is pressed), but it is not getting focus. This is what I would like to change. I want the activity to get focus and come to the foreground, whenever it is touched.I tried to call startActivity from inside, but this resulted in either starting a new activity or no reaction at all (depending on the used intent flags). I want to achieve the exact same behavior that is shown, when the activity is called from recent activities window. (the window opened when you long press the home button); bring the existing activity from the background to the foreground and focus it.Is there a way to achieve this?</p>","67350","","","","","2011-04-10 21:26:17","How to bring an activity to the forground from inside the activity?","<android>","1","0","1","",""
"1681200","1","1681332","","2009-11-05 15:16:08","1","636","<p>This is for an Android application but I'm broadening the question to Java as I don't know how this is usually implemented.</p><p>Assuming you have a project that targets a specific SDK version. A new release of the SDK is backward incompatible and requires changing three lines in one class.</p><p>How is this managed in Java without duplicating any code(or by duplicating the least amount)?I don't want to create two projects for only 3 lines that are different.</p><p>What I'm trying to achieve in the end is a single executable that'll work for both versions. In C/C++, you'd have a <code>#define</code> based on the version. How do I achieve the same thing in Java?</p><p><strong>Edit</strong>: after reading the comments about the #define, I realized there were two issues I was merging into one:</p><ul><li>So first issue is, how do I notduplicate code ? What construct is there that is the equivalent of a<code>#define</code> in C.</li><li>The second one is: is    it possibleto bundle everything in    the sameexecutable? (this is less of    aconcern as the first one).</li></ul>","35501","","35501","","2009-11-05 15:53:19","2009-11-06 07:29:24","How to manage multiple versions of same class file for different SDK targets?","<java><android>","5","4","0","",""
"1681817","1","1705041","","2009-11-05 16:34:05","4","6346","<p>For a semester project, I had the idea to implement Windows 7's Play to infrastructure to either use a phone as the end point (the player) or to stream stuff from the phone to a Windows 7 machine.  Does anybody have experience working with this API?  Is this do able over a couple of weeks (prototype, just proof of concept, not end-user ready) or is it too much for a project of this scope?  Note: I'm not looking for code samples, just an assessment of the feasibility of this project.  If you have any documentation from MS or otherwise that would be awesome although not the crux of the question.</p><p><strong>Edit:</strong>  I discovered that the Windows 7 Play-to functionality is based on DLNA and any device supporting DLNA (I think) can be used as a destination for the Play-To context menu.  However, I'm having a really difficult time finding any sort of documentation on DLNA.  I'm wondering if you need to be a member of the DNLA to actually get access to the spec?  Alternatively, I know DLNA is built on UPnP, it wouldn't exactly do what I want, but it would be a step in the right direction, so, to revise my question <strong>does anybody know of any open-source C/C++ or Java (preferable) libraries that would help me implement UPnP or DLNA?</strong></p><p>Thanks!Chris</p>","150771","","150771","","2009-11-08 23:12:41","2009-11-10 01:05:34","Implementing DLNA/UPnP (Win7 Play To) on a mobile device","<java><android><multimedia>","1","0","6","",""
"1683185","1","1683195","","2009-11-05 20:04:25","121","73420","<p>How do I create a ListView with rounded corners in Android?</p>","184046","","2001600","","2013-08-23 17:28:53","2014-02-27 19:37:21","How do I create a ListView with rounded corners in Android?","<android><listview>","6","1","99","",""
"1683514","1","1688543","","2009-11-05 20:52:43","4","3541","<p>I'm trying to put a checkbox into ExpandableListView. How do I do that? I extend BaseExpandableListAdapter and put the following into getGroupView():</p><pre><code>@Overridepublic View getGroupView(int groupPosition, boolean isExpanded, View convertView,   ViewGroup parent) {    View view = convertView == null ?      context.getLayoutInflater().inflate(R.layout.onet_head, null) : convertView;     ((TextView)view.findViewById(R.id.onetText)).setText(cats.get(groupPosition).value);     return view;}</code></pre><p>Notice that inflated layout? That's where I'm putting TextView and CheckBox.I noticed that placing a checkbox into my group row layout disables default group row functionality when clicking on the row makes a secondary (child) list appear. CheckBox is functioning as expected but when I click outside of the it theclick is never detected by ether CheckBox or by OnGroupClickListener. I suspect that placing CheckBox into group row this way interferes with event detection/handling but thus far I'm not able to track it down</p><p>Cansomeone help me to resolve this?The CheckBox works fine though including detecting clicks whenclicking directly on the box </p>","135946","","135946","","2009-11-06 01:21:37","2009-11-06 16:04:49","Android - CheckBox blocks ExpandableListView.OnGroupClickListener","<android><onclick><expandablelistview>","1","0","3","",""
"1684055","1","1689508","","2009-11-05 22:21:52","0","1361","<p>I have an android library which is distributed as a jar file for inclusion in 3rd party applications. </p><p>Within the jar file is an Android Service.The service is exposed through a facade class in the jar file.Hence 3rd parties do not directly bind to the service, they just use the facade class.</p><p>I have 2 questions about this architecture:</p><p>1)If two completely separate 3rd party applications use this facade (different package names, different user ids etc..) class are two instances of the service created or is a single instance shared?</p><p>2)Does it make a difference if the service is bound directly to the 3rd party apps rather than accessed thru a facade?</p><p>P.S.<a href=""http://developer.android.com/reference/android/app/Service.html"" rel=""nofollow"">http://developer.android.com/reference/android/app/Service.html</a>Does not answer these questions.</p>","21297","","21297","","2009-11-05 22:30:24","2009-11-06 18:44:30","Android - Are services shared among processes?","<java><android><service><soa>","2","0","","",""
"1685585","1","1685751","","2009-11-06 05:22:18","1","1036","<p>I've been trying to create a color LinearLayout object (1) within another LinearLayout object (2), while having (1) not display beyond the bounds of (2) - in short, I wish to assign the equivalent of the CSS overflow:hidden property to LinearLayout (2) so that LinearLayout (1) doesn't bleed beyond the edges of (2).</p><pre><code>&lt;LinearLayout&gt;   &lt;!-- (2) --&gt;   &lt;LinearLayout&gt;      &lt;!-- (1) --&gt;   &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Is this possible within Android?</p><p>Thank you for the help!</p>","204499","","204499","","2009-11-06 05:35:03","2009-11-06 06:15:08","Equivalent to ""overflow"" property in LinearLayout on Android SDK?","<android><android-linearlayout>","1","0","","",""
"1686244","1","","","2009-11-06 08:39:28","0","1861","<p>I am trying to play a mp4 video file from remote url in android media player.but I am getting an error code --</p><p>Command PLAYER_PREPARE completed with an error or info PVMFErrNoResourceserror (1, -15) </p><p>I have searched for the error code and found that this error is returned if the resource required in processing of a request is not being available.A typical example is, a socket node connection not available for streaming.</p><p><a href=""http://www.netmite.com/android/mydroid/cupcake/external/opencore/doc/pvmf_return_codes.pdf"" rel=""nofollow"">link text</a></p><p>any help would be appreciated...</p>","152867","","1714146","","2013-04-25 07:50:44","2013-04-25 07:50:44","Playing mp4 video file in Android","<android><media><mp4>","1","2","0","",""
"1686303","1","1687197","","2009-11-06 08:54:43","1","2035","<p>If I don't include a background in my root layout then everything renders as I expect:</p><p><img src=""http://dl.dropbox.com/u/299320/correct.png"" alt=""alt text""></p><p>However, if I add JUST ONE LINE adding in a background then the layout goes completely haywire:</p><p><img src=""http://dl.dropbox.com/u/299320/foobared.png"" alt=""alt text""></p><p>The relevant bit of the XML layout is:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width =""fill_parent""    android:layout_height=""fill_parent""    android:paddingRight =""20dip""     android:paddingLeft  =""20dip""    android:gravity      =""center_vertical""    android:background   =""@drawable/main_background""&gt;</code></pre><p>Quite literally the only difference between the above two screenshots is the inclusion of <code>android:background=""@drawable/main_background""</code>. I'll give you a cookie if you can help me out here :)</p>","76835","","76835","","2009-11-06 09:54:45","2009-11-06 12:11:43","Including a background drawable foobars my layout in Android. Ideas why?","<android><layout><background><android-linearlayout>","1","2","2","",""
"1686446","1","","","2009-11-06 09:26:43","1","1009","<p>i am trying upload a video from the application.i am able to upload videos of size lesser than 2 MB but when i am trying to upload videos more 2MB i am getting out of memory error.</p><p>plz suggest how do i upload videos??</p>","152867","","135946","","2009-11-06 19:14:27","2011-02-20 10:51:38","upload videos in android","<android><video-processing>","1","1","","2014-02-08 17:48:14",""
"1686784","1","1688489","","2009-11-06 10:39:08","1","155","<p>I have created a method updateGUI() which include the following method calls:</p><pre><code>if (settings.isMute()) {            muteIcon.setIconImage(R.drawable.ic_volume_off_small);} else {            muteIcon.setIconImage(R.drawable.ic_volume_small);}</code></pre><p>Where setIconImage() is defined the following way:</p><pre><code>public void setIconImage(int imageFromResources) {    iconImage = BitmapFactory.decodeResource(mContext.getResources(), imageFromResources);    iconWidth = iconImage.getWidth();    iconHeight = iconImage.getHeight();    invalidate();}</code></pre><p>While running this code the icon image doesn't change as it should. There are both images stored in the res/drawable directory but the ic_volume_off_small does never appear. Does anyone know what could be changed here in order the program works as it should?</p><p>Thank you!</p>","22996","","","","","2010-01-10 12:00:01","Problem with displaying/updating drawable resources","<android><resources>","2","0","","",""
"1686846","1","","","2009-11-06 10:54:22","4","1792","<p>I am trying to swap the position of two buttons.My swapping code looks is:</p><pre><code>private void exchangeButtons(Button btn1, Button btn2) {    // Create the animation set    AnimationSet exchangeAnimation = new AnimationSet(true);    TranslateAnimation translate = new TranslateAnimation(        Animation.RELATIVE_TO_SELF, btn2.getLeft(),        Animation.RELATIVE_TO_SELF, btn1.getLeft(),        Animation.RELATIVE_TO_SELF, btn2.getRight(),        Animation.RELATIVE_TO_SELF, btn1.getRight());    translate.setDuration(500);    exchangeAnimation.addAnimation(translate);    //int fromX = btn1.getLeft();    //int fromY = btn1.getRight();    //int toX = btn2.getLeft();    //int toY = btn2.getRight();    Log.d(""ArrangeMe"",         ""view1 pos:"" + btn1.getLeft() + "",         "" +btn1.getRight() + ""view2 pos:"" +         btn2.getLeft() + "", "" + btn2.getRight());    AnimationSet exchangeAnimation1 = new AnimationSet(true);    TranslateAnimation translate1 = new TranslateAnimation(         Animation.RELATIVE_TO_SELF, btn1.getLeft(),        Animation.RELATIVE_TO_SELF, btn2.getLeft(),        Animation.RELATIVE_TO_SELF, btn1.getRight(),        Animation.RELATIVE_TO_SELF, btn2.getRight());    translate1.setDuration(500);    exchangeAnimation1.addAnimation(translate1);    // EXECUTE btn1.startAnimation(exchangeAnimation);    btn2.startAnimation(exchangeAnimation1);}</code></pre><p>I call the code as below:</p><pre><code>exchangeButtons(button1, button2);</code></pre><p>My layout looks as below:</p><pre><code>&lt;LinearLayout     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:orientation=""horizontal""&gt;    &lt;Button         android:text=""One""         android:id=""@+id/button1""         android:layout_height=""70px""         android:layout_width=""70px""         android:layout_weight=""1""&gt;    &lt;/Button&gt;    &lt;Button         android:text=""Two""         android:id=""@+id/button2""         android:layout_height=""70px""         android:layout_width=""70px""         android:layout_weight=""1""&gt;    &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>What happens when I execute the code is:</p><p>Instead of the buttons exchanging their positions, they just disappear for sometime[may be 500 ms] and reappear as they were originally.</p><p>How to resolve this problem ? Will it work properly in device ?</p>","204714","","835806","","2012-06-20 13:45:56","2014-03-22 20:13:33","Animated swap position of two buttons","<android><animation><button><swap>","2","1","2","",""
"1689326","1","","","2009-11-06 18:08:50","0","345","<p>There is this xml file under frameworks/base.</p><p>/frameworks/base/core/res/res/layout/simple_dropdown_item_2line.xml</p><p>How can I inflate that in my own android application?</p><p>Thank you.</p>","128983","","","","","2009-11-06 19:16:19","How to inflate core/res/res/layout/simple_dropdown_item_2line.xml","<android>","2","0","","",""
"1690201","1","1690403","","2009-11-06 20:31:52","20","12881","<p>I'm looking for a single book source for Android 2.0 development.While I may be ok with a general Android development book, a book which covers 2.0 features is ideal.</p><p>What is the best Android 2.0 book out there, or upcoming?</p>","24126","","","","","2012-11-11 00:59:28","Best Android 2.0 development book?","<android><android-2.0-eclair>","1","2","17","2013-07-04 03:01:29",""
"1690229","1","1690470","","2009-11-06 20:35:04","12","13961","<p>I'm currently in the research phase of my dissertation project.</p><p>My project is a ticket booking system for a mobile device and I have chosen to target Android.</p><p>I anticipate the need for a client/server architecture with a central server, and so am currently looking at how Android could communicate with such a server. The server would grant the client access to ticketing information, and the client would send information about ticket bookings to the server. I'm looking at Java EE for the server as Java is the language I'm most experienced with.</p><p>I'm aware that Android comes with <code>java.nio</code> and <code>java.net</code>, as well as some <code>org.apache</code> packages, but am also looking for libraries/technologies that would be possible to use with Android.</p><p>So far I've not found anything massively helpful on the internet, so I'm seeing what SO can suggest.</p><p>Specifically I am interested in knowing:</p><ol>   <li>What support is there for various middleware technologies in Android? e.g.      <ul>         <li>RPC based middleware</li>         <li>CORBA</li>         <li>Message based middleware</li>         <li>Web services such as XML-RPC, SOAP, REST</li>      </ul>   </li>   <li>How well (or not) do existing Java libraries work when used on the Android platform? (e.g. If I wanted to use a library/API designed for Java SE rather than Android what problems might I encounter?)</li></ol><p>Ideally, as the focus of my project isn't meant to be the communication between the server and client, I could use an existing middleware to handle the communication, but I am prepared for the worst case, which is having to write my own.</p>","110255","","","","","2009-11-06 21:09:31","Options for Client Server Communication in Android","<java><android><networking><client-server><middleware>","1","0","7","",""
"1690696","1","7095622","","2009-11-06 21:45:47","9","1138","<p>I'm trying to port an app from Eclipse to IntelliJ.  The app builds fine but it fails to run properly.</p><p>Here's a partial stack trace I receive:</p><pre><code>ERROR/AndroidRuntime(957):             java.io.IOException: Resource not found: ""org/joda/time/tz/data/ZoneInfoMap"" ClassLoader: dalvik.system.PathClassLoader@43761190        at org.joda.time.tz.ZoneInfoProvider.openResource(ZoneInfoProvider.java:209)        at org.joda.time.tz.ZoneInfoProvider.&lt;init&gt;(ZoneInfoProvider.java:123)        at org.joda.time.tz.ZoneInfoProvider.&lt;init&gt;(ZoneInfoProvider.java:82)        at org.joda.time.DateTimeZone.getDefaultProvider(DateTimeZone.java:439)        at org.joda.time.DateTimeZone.setProvider0(DateTimeZone.java:393)        at org.joda.time.DateTimeZone.&lt;clinit&gt;(DateTimeZone.java:114)        at org.joda.time.chrono.GregorianChronology.&lt;clinit&gt;(GregorianChronology.java:71)        at org.joda.time.chrono.ISOChronology.&lt;clinit&gt;(ISOChronology.java:66)        at org.joda.time.base.BaseDateTime.&lt;init&gt;(BaseDateTime.java:97)        at org.joda.time.DateTime.&lt;init&gt;(DateTime.java:120)</code></pre><p>For some reason, the app isn't able to find the joda-time resources, even though they're specified in the module's build path.  These are the same jarfiles used by the eclipse version of the app.</p><p><img src=""http://img.skitch.com/20091106-pgqujbb5eaeqc2wfiqc2c1p39a.png"" alt=""alt text""></p><p>The APK built by the IntelliJ tool is about 20% smaller than the one built by Eclipse, but I don't know why.</p><p>Any idea what might be the problem?</p><p><strong>UPDATE:</strong></p><p>I spoke with romain and xav yesterday, and it appears that the problem is that intellij is not bundling resources into the apk.  Evidently aapt does a two pass approach - first it bundles all the class files into a .dex file, and then it bundles all of the resource files separately into the top level of the apk file.  It's this second pass that intellij seems to be missing.</p><p>As a workaround, they suggested that I unjar all the resource files from the joda-time jar, and place them in my src directory.  The expectation was that intellij would then bundle them into my apk as though they were part of my own source, thus solving the problem.  However, when I did this, IntelliJ ignored those files entirely when it created the apk.</p><p>I don't know why.  Is there maybe a workaround I can use to get the joda-time resource files into my apk that isn't terribly inconvenient every time I want to build?</p>","82156","","82156","","2009-11-10 18:30:48","2011-08-17 15:42:02","""Resource not found"" when building Android app under IntelliJ 9.0 Maia Public Beta","<android><intellij-idea><jodatime><intellij-plugin>","2","4","2","",""
"1690786","1","1700017","","2009-11-06 22:02:56","8","2580","<p>I'm specifically interested in how portable it is between various phones. We have an application with some computation heavy code we'd like to share between Android and iPhone. If we could write it in C, we'd have a single code-base, but if the NDK only supports a subset of the processors that phone manufacturers are creating, or if we have to recompile for each processor, that's not a workable solution.</p><p>Thanks for any experiences with it.</p>","24309","","","","","2011-07-07 14:28:04","Any experience with Android NDK?","<android><android-ndk>","4","2","2","",""
"1691569","1","1691670","","2009-11-07 01:26:32","56","35694","<p>I have a <code>res/layout/main.xml</code> including these elements and others:</p><pre><code>&lt;some.package.MyCustomView android:id=""@+id/foo"" (some other params) /&gt;&lt;TextView android:id=""@+id/boring"" (some other params) /&gt;</code></pre><p>In my Activity's onCreate, I do this:</p><pre><code>setContentView(R.layout.main);(TextView) boring = findViewById(R.id.boring);// ...find other elements...MyCustomView foo = (MyCustomView) findViewById(R.id.foo);if (foo == null) { Log.d(TAG, ""epic fail""); }</code></pre><p>The other elements are found successfully, but <code>foo</code> comes back null. MyCustomView has a constructor <code>MyCustomView(Context c, AttributeSet a)</code> and a <code>Log.d(...)</code> at the end of that constructor appears successfully in logcat just before the ""epic fail"".</p><p>Why is <code>foo</code> null?</p>","6540","","6540","","2009-11-08 01:20:31","2014-04-15 18:12:46","findViewById() returns null for custom component in layout XML, not for other components","<xml><android><layout>","17","0","3","",""
"1693715","1","1694265","","2009-11-07 17:07:23","2","1751","<p>Is there any API that will give me those 6 neighborhood cell ids on Android, or shall I try to send AT commands to the Android modem. </p><p>If someone could explain that to me I would be very grateful.</p>","31207","","68939","","2010-04-21 18:52:48","2010-04-21 18:52:48","How to get all 6 neighborhood cell ids on Android","<android><localization><cellid>","1","0","1","",""
"1694301","1","1695016","","2009-11-07 20:27:10","6","803","<p>This is a question I've now had for a few different apps I've built, and I have yet to be satisified with any of the solutions I've come up with.  I thought I'd put it out there to the community to see other solutions there might be.</p><p>Let's say you have an Activity that downloads a complex tree of data (in this case via json, but it could be anything), unmarshalls that data to a set of java objects (in this case using gson, but again, could be whatever), then spawns additional activities to view different parts of that data.  There might be one activity to view Trips in your response, and another to view Flights in those trips, and maybe another to view Passengers of those flights.</p><p>My initial implementation of this app was to unmarshall all the Trips in the first activity, then pass them by value (as an extra in the intent) to the TripActivity.  The TripActivity then passes individual flights to the FlightActivity, and so on.</p><p>The problem with this is that there's a noticeable pause between activities while the app serializes and deserializes the data.  We're talking several seconds.  The pause is quite noticeable when my tree uses Serialization or Parcelable to pass data around.  Initial performance testing with using google's Parcelable instead show a roughly 30% speedup over serialization, but Parcelable is difficult to work with and doesn't seem to handle circular object references well like Serialization does, and besides it still pauses for almost as many seconds, so I've put that experiment on the backburner while I try other things.  </p><p>So then I tried moving the tree of objects directly into the Application class.  Each activity just gets the tree directly from the app whenever it needs it.  This makes performance quite snappy, but handling corner cases like unexpected activity start/stops (either due to activity crashes or because the activity has been closed temporarily to make more memory available, or whatever other cause) seems tricky.  Perhaps it's no more than implementing <code>onSaveInstanceState()</code>, I'm not sure, but the solution seems a bit hacky so I haven't investigated further yet.</p><p>So in search of a less cobbled-together solution, I tried creating a custom ContentProvider to store and retrieve my objects.  Since ContentProviders can be configured to run in-process using <code>multiprocess=true</code>, I thought that would be an excellent way to avoid serialization costs while doing something more ""standard"" than storing data in the Application object.  However, ContentProviders were clearly not intended to return arbitrary object types -- they only support types such as numbers, strings, booleans, etc.  It appears I can finagle one to store arbitrary objects by using <code>ContentResolver.getContentProviderClient().getLocalContentProvider()</code> and accessing my custom class directly, but I'm not sure that's less hacky than storing data in the Application object.</p><p>Surely someone must have a good solution to this problem.  What am I doing wrong?</p>","82156","","","","","2012-12-18 17:10:16","Good alternatives to share a complex tree of objects between activities in Android?","<android>","3","0","2","",""
"1695035","1","1695083","","2009-11-08 01:28:13","0","928","<p>I'm not sure which is these is appropriate for my current application.  </p><p>I need to switch wallpaper on a given, but user changeable, interval.  I've been using a BroadcastReceiver to check every minute, but then I saw <a href=""http://stackoverflow.com/questions/1619133/hidden-features-of-android-development"">this question</a>.</p><p>Is there any particular advantage to one method over another?  Right now I've got to keep a service alive to receive the broadcast, but would using alarms obviate that?</p>","73865","","","","","2009-11-08 01:51:15","Alarms vs. TIME_TICK in Android","<android>","1","0","","",""
"1695512","1","1695664","","2009-11-08 05:48:03","3","4453","<p>Ive looked into the APIDemos and they have an example of the gallery where they show just text, the code however just uses a Cursor , however I want to use a String array. how would i go about doing this? This is the code for the example in API Demos:</p><pre><code>        Cursor c = getContentResolver().query(People.CONTENT_URI, null, null, null, null);    startManagingCursor(c);    SpinnerAdapter adapter = new SimpleCursorAdapter(this,    // Use a template that displays a text view            android.R.layout.simple_gallery_item,            // Give the cursor to the list adatper            c,            // Map the NAME column in the people database to...            new String[] {People.NAME},            // The ""text1"" view defined in the XML template            new int[] { android.R.id.text1 });</code></pre>","117691","","","","","2009-11-08 07:31:06","Android Gallery Text Only","<android><gallery>","2","0","2","",""
"1695849","1","1862000","","2009-11-08 09:26:58","0","762","<p>I'm working in with the Android SDK 2.0 / Galileo / ADT 0.9.4 (latest to date).Against Android 1.5 API layer.</p><p>If I go to the layout editor and add an AutoCompleteTextView the screen immediately gives me a NullPointerException.</p><p>Does anyone have a documented workaround for this problem?</p><p>I can't seem to find one.This is obviously a bug in the Android SDK. (It's been filed anyway.)</p>","42005","","","","","2010-10-27 07:35:36","Android Layout AutoCompleteTextView NullPointerException Workaround","<layout><android><nullpointerexception><autocompletetextview>","1","0","","",""
"1696432","1","1702475","","2009-11-08 13:15:35","2","10904","<p>I installed ADT plugin to Eclipse 3.5. But at <kbd>Window</kbd> ? <kbd>Preferences</kbd> Android node is not shown.</p>","150121","","944657","","2012-12-28 08:17:25","2013-08-30 10:19:07","ADT plugin and Eclipse 3.5","<android><eclipse><adt>","9","2","","",""
"1697084","1","3452944","","2009-11-08 16:42:02","62","47417","<p>I'm currently rendering HTML input in a TextView like so:</p><pre><code>tv.setText(Html.fromHtml(""&lt;a href='test'&gt;test&lt;/a&gt;""));</code></pre><p>The HTML being displayed is provided to me via an external resource, so I cannot change things around as I will, but I can, of course, do some regex tampering with the HTML, to change the href value, say, to something else.</p><p>What I want is to be able to handle a link click directly from within the app, rather than having the link open a browser window. Is this achievable at all? I'm guessing it would be possible to set the protocol of the href-value to something like ""myApp://"", and then register something that would let my app handle that protocol. If this is indeed the best way, I'd like to know how that is done, but I'm hoping there's an easier way to just say, ""when a link is clicked in this textview, I want to raise an event that receives the href value of the link as an input parameter""</p>","133802","","","","","2014-04-08 19:06:58","handle textview link click in my android app","<android><textview>","6","1","48","",""
"1697904","1","1697953","","2009-11-08 20:56:04","2","1908","<p>Does Java pass by reference or value to C when using JNI ( more specifically Android NDK)</p>","117691","","","","","2009-11-08 21:21:56","Does Java pass by reference or value to C when using JNI ( more specifically Android NDK)","<android><jni><android-ndk>","2","0","2","",""
"1697908","1","1697913","","2009-11-08 20:58:09","9","14231","<p>How would I go about adding clickable links inside a ListView?</p>","184046","","","","","2013-05-19 11:15:42","Android: How can I add HTML links inside a ListView?","<html><android><listview><links>","4","0","10","",""
"1698050","1","","","2009-11-08 21:52:24","13","3844","<p>Is there a way to use <code>intent.setType()</code> and supply multiple broad types (like images <em>and</em> video)?</p><p>I am using an <code>ACTION_GET_CONTENT</code>. It seems to be working with just comma-separated types.</p>","206431","","403455","","2012-09-07 16:16:02","2014-03-04 16:38:56","Multiple MIME types in Android","<android><android-intent><mime-types>","3","2","4","",""
"1698772","1","1704773","","2009-11-09 02:09:00","4","4664","<p>I am able to deploy my application but for some reason, I am not able to get the icon to display in the pull up menu on the Home page of the OS. Does anyone know what I can do to solve this?</p><p>By the way, the application shows up in ""Manage Applications"" but does not show up as an icon for some reason. Through Eclipse, I am able to start the application after deployment but that's it... After that, I don't have any way to start it because there is no icon. :( Following is my manifest file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.android.ApplicationName""      android:versionCode=""1""      android:versionName=""2.0""&gt;    &lt;application android:icon=""@drawable/icon""         		 android:debuggable=""true""                 android:label=""@string/app_name""&gt;        &lt;activity android:name="".EntrySplash""            	  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;                &lt;category android:name=""android.intent.category.BROWSABLE""&gt;&lt;/category&gt;      			&lt;data android:scheme=""com.android.ApplicationName""&gt;&lt;/data&gt;             &lt;/intent-filter&gt;        &lt;/activity&gt;    	&lt;activity android:name="".EntryScreen"" android:label=""@string/app_name""&gt;    	&lt;/activity&gt;			    	&lt;activity android:name="".ApplicationName"" android:label=""@string/app_name""&gt;    	&lt;/activity&gt;		    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt;</code></pre>","184046","","184046","","2009-11-09 02:25:34","2013-04-08 20:42:06","Android: APK Icon is not being installed","<android><menu><icons>","7","3","1","",""
"1698881","1","1703629","","2009-11-09 03:00:05","6","8175","<p>I have a TextView. I want it to ellipsize if longer than its available width. This does not work unless the input string has no spaces... can anyone provide an example of this working? I've tried different combinations of:</p><p>singleLine=""true"" maxLines=""1"" scrollHorizontally=""false""</p><p>none of these have any effect. Again, if I supply a string that has no spaces in it, then the ellipsis appears correctly. What am I missing? I've tried this on 1.5, 1.6, 2.0, all same problem.</p><p>Thanks</p>","137193","","","","","2013-02-15 08:18:39","Can't get ellipsis to work on Android","<android><android-widget>","4","1","2","",""
"1698975","1","1700463","","2009-11-09 03:41:05","0","438","<p>I am having a hard time in DDMS ""Push a file onto device"" I have an old database file that I like to replace with a new file that I created using sql studio. If anybody have any idea on how to do this please let me know,thankstj</p>","206567","","","","","2009-11-09 15:04:46","Copy New Version of a Database File onto Device","<android>","1","0","","",""
"1698978","1","3879041","","2009-11-09 03:43:58","7","10541","<p>Okay, so I've got this TableLayout, and its full of data - with all of the rows added programmatically. I've got the TableLayout inside of a HorizontalScrollView, which in turn is inside a ScrollView - this gives me scrolling both horizontally and vertically. What I'm trying to do now is add a header row to it that will not scroll. I've tried moving things around so that both of my scroll views were actually inside of the TableLayout and adding the TableRows to the HorizontalScrollView; my hope was to be able to then add the header row outside of the scroll views.</p><p>The only other thing I can think of is having a second table layout just for the header row, but getting the columns to line up seems like it would be difficult. Any ideas?</p>","62676","","56285","","2013-12-30 08:45:14","2014-03-10 13:57:49","Android TableLayout Header row","<android><android-layout><android-tablelayout>","2","0","","",""
"1700099","1","1700171","","2009-11-09 10:02:59","20","11330","<p>I got a pattern (.png image 4x4px) and have to fill the layout with it.</p><p>Does anyone know how to do it? </p><p>If I simply select the drawable as a background the image is streched but it has to be repeated along the x and y axis.</p>","22996","","","","","2009-11-09 10:20:59","Android: how to create a background from pattern?","<android><background><design-patterns>","1","0","2","",""
"1700422","1","1705474","","2009-11-09 11:19:57","0","982","<p>In an Activity, I have some snippet of code that fires off a Message:</p><pre><code>        Message m = _handler.obtainMessage( UPDATE_PROGRESS );        Bundle bundle = new Bundle();        bundle.putInt( BUNDLE_KEY, 50 );        m.setData( bundle );        Log.d( LOG_TAG, ""value "" + bundle.getInt( BUNDLE_KEY, 0 ) ); // prints 50        Log.d( LOG_TAG, ""sent:"" + _handler.sendMessage( m ) ); // prints true</code></pre><p>In another part of the Activity, I am handling it like this:</p><pre><code>    public void handleMessage( final android.os.Message msg )     {        switch( msg.what )        {        case UPDATE_PROGRESS:            post( new Runnable()             {                @Override                public void run()                {                    Bundle aBundle = msg.getData();                    Log.d( LOG_TAG, ""value in bundle="" +                          aBundle.getInt( BUNDLE_KEY, 0 ) ); // prints 0                    Log.d( LOG_TAG, ""contains 'progress' : "" +                          aBundle.containsKey( BUNDLE_KEY ) ); // prints 'false'                }            });            break;          }</code></pre><p>Why is the Bundle not preserved in the Message ? Who is resetting the values of the Bundle ?</p>","27328","","","","","2013-01-14 00:47:20","Why is my Bundle inside android.os.Message being reset?","<java><android><mobile>","3","0","","",""
"1701445","1","","","2009-11-09 14:44:40","7","701","<p>I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? </p><p>Also what new languages would I need to learn ? </p><p>If any one could provide links to a beginners guide or something similar that would be much appreciated </p><p>Thanks</p>","123663","","","","","2012-04-01 11:59:49","From Web Development to Android Development","<android>","5","0","2","",""
"1702323","1","1704380","","2009-11-09 16:56:08","2","2745","<p>How much RAM is available for use by each app?  </p><p>I read somewhere that each app could only use a max of 16 mb, but the total system memory is much higher.  </p>","149358","","171461","","2009-11-09 16:59:39","2009-11-09 22:29:38","Android Available Ram","<android><ram>","1","3","2","",""
"1702889","1","1703233","","2009-11-09 18:36:23","0","476","<p>For a widget I am creating for the Android OS, I want the user to first select a certain option from a Spinner. Just like when you add a shortcut to the homescreen.</p><p>Is that possible or do you have to start an Activity?If it is possible, can anyone explain how to do it?</p>","174868","","","","","2009-11-09 19:35:26","show spinner before adding widget android","<android><widget><spinner>","1","0","","",""
"1703148","1","1703184","","2009-11-09 19:19:51","5","3337","<p>I want to use the speech to text api in android, but I don't want to be slowed down by those dialogs. Is it possible to use the functionality without them?</p>","432","","","","","2012-04-17 23:16:20","Is it possible to use android's speech recognition without showing the dialog?","<android>","3","0","2","",""
"1704872","1","1706765","","2009-11-10 00:21:47","3","10530","<p>I have a <code>WebView</code> that I'm using to open some files stored in the <code>assets/</code> directory of my project. It works fine for most of the files, but there's one in particular (and I'm sure others I haven't found) that it just <strong>will not</strong> open. </p><p>The file I'm having problems with is named: </p><pre><code>""assets/ContentRoot/Photos/XXX Software Logo - jpg - 75%.JPG""</code></pre><p>When I pass it to <code>WebView</code>, and it shows the error page, it shows it as: </p><pre><code>""file:///android_asset/ContentRoot/Photos/XXX%20Software%20Logo%20-%20jpg%20-%2075%.JPG""</code></pre><p>I then tried running <code>URLEncoder.encode()</code> on it and got the error page with the URL presented as: </p><pre><code>""file:///android_asset/ContentRoot/Photos/XXX+Software+Logo+-+jpg+-+75%.JPG""</code></pre><p>Neither of these URLs were able to open the file (and they both look okay to me). Anyone have any ideas?</p><p><strong>UPDATE:</strong> If I encode the <code>%</code> by hand (using <code>%25</code>, as commonsware.com suggested) then it loads the image, but it tries to parse it as text, not as an image, so I just get a lot of (basically) garbage.</p><p><img src=""http://imgur.com/zgZSj.png"" alt=""Hosted by imgur.com""></p><p>Also, referring to the image in an HTML document with a relative URL isn't working (probably because it's not being parsed as an image?):</p><pre><code>&lt;img src=""../Photos/XXX%20Software%20Logo%20-%20jpg%20-%2075%.JPG"" /&gt;&lt;img src=""../Photos/XXX%20Software%20Logo%20-%20jpg%20-%2075%25.JPG"" /&gt;</code></pre>","76835","","76835","","2009-11-10 01:40:32","2010-11-16 18:47:06","Why is WebView unable to open some local URLs (Android)?","<android><url><webview>","3","0","1","",""
"1705239","1","5343009","","2009-11-10 02:10:10","30","25250","<p>I would like to change an image I loaded to have round corners. </p><p>Any hints, tutorials, best practices you know of?</p>","204499","","114066","","2010-06-23 09:39:43","2012-12-12 17:12:16","How should I give images rounded corners in Android?","<java><android><image>","5","0","51","",""
"1705728","1","1705756","","2009-11-10 05:06:02","3","6308","<p>I'm starting to learn how to develop apps for Android, and I'm having some issues with intents--it just doesn't seem like they're documented <strong>at all</strong>. All I want to do is send the user to the video recorder, where they record a video, and the video information is returned to my app. I know this is possible, as I've seen it in other apps, but it seems like the intent is undocumented (or I'm just not completely understanding how intents work).</p><p>Any thoughts?</p>","135180","","46914","","2009-11-10 05:09:35","2012-07-12 03:13:11","Where is a list of available intents in Android?","<java><android><multimedia><android-intent>","3","0","2","",""
"1705868","1","1709977","","2009-11-10 05:45:52","2","2433","<p>I am having a List of Item which I retrieved from my Sqlite DB...I wants to set Click event for each n every item.. How I can customise this event based on Item clicked????Be Descriptive... I am a Begineer..</p><p>The method tht I used to fill data in my List ..</p><pre><code>private void fillData() {	db = new DBAdapter(this);	db.open();	ArrayList db_results = new ArrayList();	//All Category	//Cursor cursor = db.getAllTitles();	//Single Category	Cursor cursor = db.getTitle(1);	if (cursor.moveToFirst())    {        do {                      db_results.add(cursor.getString(4));        } while (cursor.moveToNext());    }	cursor.close();    this.list.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, db_results));}</code></pre>","206809","","12707","","2009-11-10 05:47:09","2009-11-10 18:05:42","ListView Click event","<android><listview>","1","1","1","",""
"1706040","1","1706289","","2009-11-10 06:45:45","3","5865","<p>Received an email from my first Motorola Droid user. The new 480x854 resolution introduced in Android 2.0 (as opposed to 320x480) is wreaking havoc with my user interfaces. Everything is smaller and ill-positioned.</p><p>I was under the impression that if we follow the XML layout guides we were resolution-safe, as no absolute coordinates are used. Does anyone have experience in making the UI  resolution-safe? Will we need a main.xml for each resolution times each orientation?</p>","192863","","61332","","2009-11-10 06:48:57","2009-11-10 17:32:17","Resolution support in Android 2.0","<android><resolution><motorola>","3","0","","",""
"1706250","1","1710750","","2009-11-10 07:48:52","1","959","<p>I am trying to build an Android Service that should get notified when the user starts playing an MP3. I checked LogCat when I start playing a song and saw that the following Intent is logged: </p><p><code>Intent { act=com.android.music.PLAYBACK_VIEWER flg=0x4000000 cmp=com.android.music/.MediaPlaybackActivity }</code></p><p>I couldn't figure out how to write an IntentFilter to let my Service know that this event has occurred and let me know the name of the song that will be played. I searched Android reference but could not find anything on PLAYBACK_VIEWER.</p><p>Thanks,</p><p>C</p>","129116","","","","","2010-01-20 13:01:12","Receiving MP3 play actions in a BroadcastReceiver in Android","<android><android-intent><media-player>","1","1","","",""
"1707083","1","1913829","","2009-11-10 10:50:47","2","1206","<p>Right now I'm adding</p><pre><code>&lt;intent-filter&gt; &lt;action android:name=""android.intent.action.SEARCH"" /&gt; &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;&lt;/intent-filter&gt;&lt;meta-data android:name=""android.app.searchable"" android:resource=""@xml/searchable"" /&gt;</code></pre><p>to every single <code>&lt;activity&gt;</code> in the AndroidManifest.xml, receive the <code>Intent</code> in each activity and forward the search string to one <code>singleTop</code> activity that actually performs the search (via HTTP/JSON) and displays the results in a list.</p><p>I'm wondering if there's a way how I can set-up the AndroidManifest.xml, so that search is activated in each activity within my application, but the search string will get forwarded from Android's search box directly to my <code>singleTop</code> SearchResults_Activity instead of going the way through validating events in each activity and then forwarding the search string.</p>","184367","","184367","","2009-11-10 16:05:43","2009-12-16 10:47:20","Android: making search available throughout the whole application","<android><search><manifest>","1","0","1","",""
"1707601","1","1707640","","2009-11-10 12:27:13","2","3583","<p>I am using the requestLocationUpdates method of <a href=""http://developer.android.com/reference/android/location/LocationManager.html"" rel=""nofollow"">LocationManager</a> to get GPS location updates. I am using a minTime parameter of 60000 to indicate that I'd like a location update every minute - I don't care about minDistance (I use a value of 0 as minDistance).</p><p>If I can understand correctly the android documentation, my LocationListener will be executed every minute to receive the current location. This is what happens with the emulator.</p><p>However, I couldn't understand what would happen between executions: Will the GPS be turned off every time ? And If the GPS is turned off, what will happen with the time needed to get a GPS fix (that time could be more than one minute) ? Will I get updates every 1 minute + (time neede to get the GPS fix) ?</p><p>Unfortunately the emulator cannot help me with these problems and I do not have an Android device in my hands right now, so If anybody has experience with this stuff help me !</p><p>Thanks in advance!</p>","119071","","","","","2010-07-19 20:09:46","Android requestLocationUpdates and time needed to get a gps fix","<android><geolocation><gps>","2","0","1","",""
"1707727","1","","","2009-11-10 12:50:51","3","956","<p>Imagine I have a toolbar implemented as a horizontal LinearLayout as follows:</p><pre><code>  [___Button1____] [___Button2___] [___Button3___] [___Button4___]</code></pre><p>When someone clicks on Button2, I want the toolbar to change to:</p><pre><code>  [___Button1____] [___________Button2___________] [___Button3___]</code></pre><p>The toolbar should transition from the first state to the second state through a smooth animation. I would like to use a scale animation on Button2, and while that is happening, Button3 and Button 4 should move to the right (while the animation is going on). At the end of the animation (or maybe during), I will fade Button4 out.</p><p>Question: How do I achieve an animation of the layout of the toolbar such that only one component (i.e. Button2) is being scaled while the others are not being scaled - the layout is simply updated during the animation of Button2. </p><p>I looked at LayoutAnimationController, but it does not appear to allow me to either:  1. specify different animations for the different components, OR  2. indicate that only animate one component and don't animate the others.</p><p>I can't scale the entire toolbar because that distorts Button1/3/4 which I don't want.</p><p>Any thoughts on how to do this?</p>","178238","","","","","2013-01-01 03:22:32","Can I animate(scale) just one component of an android layout and have the layout update during animation","<android><animation>","1","1","2","",""
"1709166","1","1776328","","2009-11-10 16:17:31","87","110769","<p>I've a <code>ListView</code> where every element in the list contains a TextView and two different Buttons. Something like this:</p><pre><code>ListView--------------------[Text][Button 1][Button 2]--------------------[Text][Button 1][Button 2]--------------------... (and so on) ...</code></pre><p>With this code I can create an <code>OnItemClickListener</code> for the whole item:</p><pre><code>listView.setOnItemClickListener(new OnItemClickListener() {    @Override    public void onItemClick(AdapterView&lt;?&gt; list, View view, int position, long id) {    	Log.i(TAG, ""onListItemClick: "" + position);    	}    }});</code></pre><p>However, I don't want the whole item to be clickable, but only the two buttons of each list element.</p><p>So my question is, how do I implement a onClickListener for these two buttons with the following parameters:</p><ul><li><code>int button</code> (which button of the element has been clicked)</li><li><code>int position</code> (which is the element in the list on which the button click happened)</li></ul><p><hr></p><p><strong>Update:</strong> I found a solution as described in my answer below. Now I can click/tap the button via the touch screen. However, I can't manually select it with the trackball. It always selects the whole list item and from there goes directly to the next list item ignoring the buttons, even though I set <code>.setFocusable(true)</code> and <code>setClickable(true)</code> for the buttons in <code>getView()</code>.</p><p>I also added this code to my custom list adapter:</p><pre><code>@Overridepublic boolean  areAllItemsEnabled() {    return false;			}@Overridepublic boolean isEnabled(int position) {        return false;}</code></pre><p>This causes that no list item is selectable at all any more. But it didn't help in making the nested buttons selectable.</p><p>Anyone an idea?</p>","184367","","184367","","2009-11-21 19:09:37","2014-02-03 01:09:25","Android: ListView elements with multiple clickable buttons","<android><listview><button>","7","3","67","",""
"1710214","1","","","2009-11-10 18:39:33","1","1110","<p>With the application i am working on i came with the following problem. I have a listview that should display data from a data base table. There are two scenarios that could happen:</p><ul><li>Scenario one - the database table is filling dynamically and the listview also should dynamically display table's information e.g to grow depending on table size.</li><li>Scenario two - the table has been already filled and the listview has to just display the content</li></ul><p>So the problem is how to accomplish this behavior using ListView and ListAdapter.</p><p>So far i have solution for each scenario but no for the two together.</p><ul><li>Scenario one - Use AsyncTask and ArrayAdapter. In doInBackGround query the db periodically and pass the result to onProgressUpdate, than just fill the ArrayAdapter with the newly added values. But when came scenario two i query all the table than copy all values to the ArrayAdapter in one step which is pretty slow.</li><li>Scenario two - Query the db again the just use CursorAdapter. But in this case i can't update the ListView dynamically using CursorAdapter.</li></ul><p>So any ideas how to implement this using one adapter, or just should i use ArrayAdapter and CursorAdapter depending on the case ?</p>","184601","","52249","","2009-11-10 18:50:37","2009-11-11 18:35:22","listview adapter implementation","<android>","1","0","","",""
"1711078","1","3205501","","2009-11-10 20:48:27","57","114678","<p>According to:</p><p><a href=""http://developer.android.com/sdk/android-2.0-highlights.html"">http://developer.android.com/sdk/android-2.0-highlights.html</a></p><p>Android 2.0 should support the HTML5 video element. I haven't been able to get this to work using a Motorola Droid, and haven't been able to successfully view a video on any of the HTML5 video example pages out there. Since there currently isn't support for QuickTime or Flash, this is the only other thing I can think of for embedding mp4 video in a web page. Has anyone had any luck with this?</p>","30953","","","","","2013-04-16 07:06:50","HTML5 <video> element on Android","<android><video><mobile><html5>","12","2","53","",""
"1711785","1","1715405","","2009-11-10 22:45:16","17","33212","<p>I read in the Android documentation that by setting my Activity's launchMode property to singleTop OR by adding the <code>FLAG_ACTIVITY_SINGLE_TOP</code> flag to my Intent, that calling <code>startActivity(intent)</code> would reuse a single Activity instance and give me the Intent in the <code>onNewIntent</code> callback.  I did both of these things, and <code>onNewIntent</code> never fires and <code>onCreate</code> fires every time.  The docs also say that <code>this.getIntent()</code> returns the intent that was first passed to the Activity when it was first created.  In <code>onCreate</code> I'm calling <code>getIntent</code> and I'm getting a new one every time (I'm creating the intent object in another activity and adding an extra to it...this extra should be the same every time if it was returning me the same intent object).  All this leads me to believe that my activity is not acting like a ""single top"", and I don't understand why.</p><p>To add some background in case I'm simply missing a required step, here's my Activity declaration in the manifest and the code I'm using to launch the activity.  The Activity itself doesn't do anything worth mentioning in regards to this:</p><p>in AndroidManifest.xml:</p><pre><code>    &lt;activity        android:name="".ArtistActivity""        android:label=""Artist""        android:launchMode=""singleTop""&gt;    &lt;/activity&gt;</code></pre><p>in my calling Activity:</p><pre><code>    	Intent i = new Intent();    	i.putExtra(EXTRA_KEY_ARTIST, id);    	i.setClass(this, ArtistActivity.class);    	i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);    	startActivity(i);</code></pre>","53501","","","","","2012-10-09 19:53:43","Android ""single top"" launch mode and onNewIntent method","<java><android><activity><android-intent><android-manifest>","1","1","6","",""
"1712173","1","1712212","","2009-11-11 00:14:53","0","1735","<p>I was wondering if there is a way to take a screenshot of the current screen inside the mobile phone using a service (I know how to do it through DDMS though)</p>","184046","","99834","","2012-10-23 09:40:24","2012-10-23 09:40:24","Can I take a screen capture from an Android app by using a service?","<android><service><screenshot>","2","2","3","",""
"1712557","1","","","2009-11-11 02:10:32","6","2044","<p>It appears that Parcelable doesn't gracefully handle circular references like Serializable does.  In the following example, the Serialization of Bar works just fine, but writing it to a Parcel causes a stackoverflow:</p><pre><code>I/TestRunner( 1571): java.lang.StackOverflowErrorI/TestRunner( 1571):    at android.os.Parcel.writeParcelable(Parcel.java:1106)I/TestRunner( 1571):    at android.os.Parcel.writeValue(Parcel.java:1029)I/TestRunner( 1571):    at com.XXX.util.ParcelableTest$Bar.writeToParcel(ParcelableTest.java:209)I/TestRunner( 1571):    at android.os.Parcel.writeParcelable(Parcel.java:1106)I/TestRunner( 1571):    at android.os.Parcel.writeValue(Parcel.java:1029)I/TestRunner( 1571):    at com.XXX.util.ParcelableTest$Baz.writeToParcel(ParcelableTest.java:246)I/TestRunner( 1571):    at android.os.Parcel.writeParcelable(Parcel.java:1106)I/TestRunner( 1571):    at android.os.Parcel.writeValue(Parcel.java:1029)I/TestRunner( 1571):    at com.XXX.util.ParcelableTest$Bar.writeToParcel(ParcelableTest.java:209)I/TestRunner( 1571):    at android.os.Parcel.writeParcelable(Parcel.java:1106)I/TestRunner( 1571):    at android.os.Parcel.writeValue(Parcel.java:1029)public void testCircular() throws Exception {    final Bar bar = new Bar();    final Baz baz = new Baz(bar);    bar.baz = baz;    // First, serialize    final ByteArrayOutputStream bytes = new ByteArrayOutputStream();    new ObjectOutputStream(bytes).writeObject(bar);    final ByteArrayInputStream bytesIn = new ByteArrayInputStream(bytes.toByteArray());    final Bar bar2 = (Bar) new ObjectInputStream(bytesIn).readObject();    assertNotNull(bar2);    assertNotNull(bar2.baz);    assertEquals( bar2, bar2.baz.bar );    // Now try same thing using parcelable    final Parcel p = Parcel.obtain();    p.writeValue(bar); // FAIL!  StackOverflowError    p.setDataPosition(0);    final Bar bar3 = (Bar) p.readValue(Bar.class.getClassLoader());    assertNotNull(bar3);    assertNotNull(bar3.baz);    assertEquals( bar3, bar3.baz.bar );}protected static class Bar implements Parcelable, Serializable {    private static final long serialVersionUID = 1L;    public static final Parcelable.Creator&lt;Bar&gt; CREATOR = new Parcelable.Creator&lt;Bar&gt;() {        public Bar createFromParcel(Parcel source) {            final Bar f = new Bar();            f.baz = (Baz) source.readValue(Bar.class.getClassLoader());            return f;        }        public Bar[] newArray(int size) {            throw new UnsupportedOperationException();        }    };    public Baz baz;    public Bar() {    }    public Bar( Baz baz ) {        this.baz = baz;    }    public int describeContents() {        return 0;    }    public void writeToParcel(Parcel dest, int ignored) {        dest.writeValue(baz);    }}protected static class Baz implements Parcelable, Serializable {    private static final long serialVersionUID = 1L;    public static final Parcelable.Creator&lt;Baz&gt; CREATOR = new Parcelable.Creator&lt;Baz&gt;() {        public Baz createFromParcel(Parcel source) {            final Baz f = new Baz();            f.bar = (Bar) source.readValue(Baz.class.getClassLoader());            return f;        }        public Baz[] newArray(int size) {            throw new UnsupportedOperationException();        }    };    public Bar bar;    public Baz() {    }    public Baz( Bar bar ) {        this.bar = bar;    }    public int describeContents() {        return 0;    }    public void writeToParcel(Parcel dest, int ignored) {        dest.writeValue(bar);    }}</code></pre><p>I'm trying to port some code over from using Serializable to Parcelable that uses circular references.  Is there a good strategy for handling this with Parcelable?</p>","82156","","","","","2011-01-12 18:08:32","Using Parcelable with circular references","<android><parcelable>","1","2","5","",""
"1713714","1","1715229","","2009-11-11 07:55:25","0","1497","<ol><li>I have Activity with some data displayed in WebView that I load with <code>WebView#loadDataWithBaseURL</code></li><li>Then I have/click menu option that fires <code>android.content.Intent.ACTION_SEND</code></li><li>Choose email from the chooser</li><li>Google email comes up (as expected)</li><li>Discard email and hit back button </li><li>Action with WebView tries to <code>resume</code></li><li>Bang - I get NullPonterException at line 4380 in WebView.java <code>if (mWebViewCore.getSettings().getNeedInitialFocus())</code> since mWebViewCore is now null</li></ol><p>The only place in code where mWebViewCore is nullified is at WebView#destroy - how do I recover from this? Do I need to recreate the browser and load my data all over again, that seems pretty wasteful? I really appreciate good suggestion at this point</p>","135946","","","","","2009-11-11 13:40:41","Android - WebView dies on resume","<android><webview><nullpointerexception><onresume>","1","0","","",""
"1713974","1","","","2009-11-11 09:12:56","9","4890","<p>When following the <a href=""http://source.android.com/download/using-repo"" rel=""nofollow"">Android Open Source Project instructions on installing repo</a> for use with <code>Git</code>, after running the <code>repo init</code> command, I run into this error:</p><blockquote>  <p>/c/Users/Andrew Rabon/bin/repo: line  23: exec: python: not found</p></blockquote><p>I've downloaded repo and put it in <code>~/bin</code> like it says, and I've installed <code>Python</code>. I wonder what the issue could be.</p><p>For reference, I'm using <code>msysgit</code> on <code>Windows Vista</code>, I understand <code>msysgit</code> is limited, but I hope it can at least pull the android source.</p>","","Andrew Rabon","493939","","2012-05-06 10:26:20","2012-06-06 20:34:11","Using Repo with Msysgit","<android><msysgit><repository>","3","0","","",""
"1714297","1","1714510","","2009-11-11 10:23:11","74","48509","<p>I'm adding TextViews programmatically in a for-loop and add them to an ArrayList.</p><p>How do I use <code>TextView.setId(int id)</code>? What Integer ID do I come up with so it doesn't conflict with other IDs?</p>","184367","","","","","2014-04-05 05:39:42","Android: View.setID(int id) programmatically - how to avoid ID conflicts?","<android><view><conflict>","9","0","16","",""
"1714761","1","1718140","","2009-11-11 12:00:19","6","7039","<p>i am downloading files from web server programatically. after download is complete, i checked the file.the size ,extension and all other parameters are correct but i when i try to play that file in media player it is showing that it is corrupt.</p><p>plz help..</p><p>code:</p><pre><code>    byte[] b = null;    InputStream in = null;    b = new byte[Integer.parseInt(size)];    // size of the file.    in = OpenHttpConnection(URL);                in.read(b);    in.close();    File folder = new File(""/sdcard"", ""folder"");   boolean check = folder.mkdirs();   Log.d(""HttpDownload"", ""check "" + check);   File myFile = new File(""/sdcard/folder/"" + name);    myFile.createNewFile();   OutputStream filoutputStream = new FileOutputStream(myFile);   filoutputStream.write(b);   filoutputStream.flush();   filoutputStream.close();</code></pre>","152867","","880619","","2013-11-05 15:49:07","2013-11-05 15:49:07","Download a file programatically on Android","<android>","4","0","6","",""
"1714788","1","1715799","","2009-11-11 12:07:44","0","673","<p>I have a TabActivity with a tab, which shows a list. I'd like to display a WebView whenever a list item is clicked. I tried calling listSpec.setContent(R.id.details); but it would not find the resource.</p><p>Any clues what I am doing wrong?</p><p>UPDATE: I found the following clue from Mark in the mailing list</p><p>You don't change the View inside of a tab. You cause the existing Viewto show something else (e.g., use FrameLayout and make one layer VISIBLEand another layer GONE, or use ViewFlipper to swap between contents).</p><p>You <em>might</em> be able to get setContent() to replace the current View bypassing in another layout ID or TabContentFactory, but I'm skepticalthis will work.</p><p>The tab widget framework in Android is designed for simple stuff. Youmay wish to grab the source code for the relevant classes out of Androidand make your own version that handles your own scenario.</p><p>-- Mark Murphy (a Commons Guy)<a href=""http://commonsware.com"" rel=""nofollow"">http://commonsware.com</a> | <a href=""http://twitter.com/commonsguy"" rel=""nofollow"">http://twitter.com/commonsguy</a></p>","","user111823","","user111823","2009-11-11 12:30:24","2009-11-11 15:10:39","Replace tab with another view","<android>","1","0","","",""
"1715697","1","1715759","","2009-11-11 14:56:09","181","201139","<p>I am about to start developing an android app and need to get an IDE. Eclipse and the android eclipse plugin appears to be the natural choice. However I am familiar with intelliJ and re-sharper so I would prefer use intelliJ. </p><p>Has anyone used <a href=""http://code.google.com/p/idea-android"">http://code.google.com/p/idea-android</a>? Is this any good?</p><p>Should I just bite the bullet and learn Eclipse?</p>","30099","","71421","","2011-05-03 22:39:59","2013-12-03 10:26:02","What is the best IDE to develop Android apps in?","<android><eclipse><intellij-idea>","21","3","76","2013-01-11 01:00:53",""
"1716728","1","1717520","","2009-11-11 17:21:29","6","8270","<p>I write graphics apps for the iPhone and I'm looking to port my most recent app, 'Layers,' to the Android platform. Layers is painting app that allows users to draw on the screen and create multi-layered paintings with different brushes, colors, etc... and export to PSD. It's got desktop sync, a smudge tool, lots of good stuff... <a href=""http://www.layersforiphone.com/"">http://www.layersforiphone.com/</a></p><p>I started looking at the Android platform Monday and I've run into a major problem. I use OpenGL to do all the drawing because it offers the best performance. However, there are several places where I need to render into a texture and then use the texture. For example:</p><ol><li>Use brush texture and a line of sprites to create a black paint stroke in texture A</li><li>Put brush color+alpha in glColor4f and then draw texture A onto the screen. </li></ol><p>On the iPhone, I do this continually as the user's finger moves and I am able to achieve 12-15fps on a 1st gen iPod Touch. It's necessary because applying color and alpha to the individual sprites making up the brush stroke doesn't produce the right result (since sprites overlap and make the stroke too dark).</p><p>The android platform supports OpenGL ES 1.0 but seems to omit key functions for dealing with framebuffers. I can't find a way to bind a texture to the framebuffer and draw into it using OpenGL.</p><p>Here's how I'd normally go about it on the iPhone:</p><pre><code>// generate a secondary framebuffer and bind it to OpenGL so we don't mess with existing output.glGenFramebuffers(1, &amp;compositingFramebuffer);glBindFramebuffer(GL_FRAMEBUFFER, compositingFramebuffer);// attach a texture to the framebuffer.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);// subsequent drawing operations are rendered into the texture// restore the primary framebuffer and (possibly) draw the rendered textureglBindFramebuffer(GL_FRAMEBUFFER, originalActiveFramebuffer);</code></pre><p>Is there anything like this on the Android platform? On the iPhone, OpenGL is significantly faster than software-based drawing and is the only viable solution (trust me - I wrote a CoreGraphics painting app too...). Maybe there's another route I could take on Android? I'm willing to jump through whatever hoops are necessary, but I won't publish the app unless performance is <em>good</em> (10fps+ as you're drawing on the screen).</p>","100363","","44729","","2011-05-26 15:46:41","2011-05-26 15:46:41","Android OpenGLES Render-to-Texture","<android><opengl-es><render-to-texture>","1","0","6","",""
"1717489","1","1717532","","2009-11-11 19:29:20","35","34616","<p>When working on the Hello, Gallery tutorial/sample app, after <a href=""http://developer.android.com/guide/tutorials/views/hello-gallery.html"">following the instructions</a> on the site, Eclipse reported that R.styleable cannot be resolved.</p><p>What is the reason for this error, and how can it be fixed or worked around?</p>","2194","","","","","2014-03-25 12:56:39","Android Hello, Gallery tutorial -- ""R.styleable cannot be resolved""","<android><eclipse>","6","0","18","",""
"1718748","1","1944637","","2009-11-11 23:11:15","1","2389","<p>I am having an issue while trying to use a GridView in aPopupWindow.  On my Activity's onCreate method, I am inflating agridview from xml as follows:</p><pre><code>LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);final GridView popupview = (GridView) inflater.inflate(R.layout.gridviewpopup, null, false);popupview.setAdapter(new ImageAdapter(this));</code></pre><p>would like this GridView to popup on a button click. Also inside ofmy activity's onCreate, I have: </p><pre><code>final Button addButton = (Button) findViewById(R.id.add); addButton.setOnClickListener(new View.OnClickListener() {   public void onClick(View v) {       PopupWindow mwindow = new PopupWindow(popupview, 100, 100);     mwindow.showAtLocation(findViewById(R.id.main), Gravity.CENTER, 100, 100);     mwindow.setFocusable(true);              }   }); </code></pre><p>On button click, I am throwing a ClassCastException fromGridView.onMeasure(int, int).</p><p>Can anyone please explain to me what I am doing wrong? </p>","208501","","715458","","2013-02-07 14:13:34","2013-02-07 14:13:34","PopupWindow with GridView - Trouble with inflating view","<android><gridview><popupwindow>","1","1","1","",""
"1718765","1","1737316","","2009-11-11 23:14:02","4","3032","<p>I'm attempting to use a ContextMenu.<br>I've successfully done this for a simple ListActivity using SimpleCursorAdapter.<br>Moving on I want to replace SimpleCursorAdapter with CursorAdapter but still retain the ContextMenu behaviour, so I've added the two mandatory override functions bindView and newView</p><pre><code>public View newView(Context context, Cursor cursor, ViewGroup parent) {    View view = mLayoutInflater.inflate(R.layout.check_row, parent, false);    registerForContextMenu(view);    return view;}</code></pre><p>Note the registerForContextMenu which replaces the registerForContextMenu(getListView()) in the onCreate method of the ListActivity. I found this necessary to get a call to onCreateContextMenu(...)</p><p>All this works (rows created with the expected widgets, callbacks on them working etc etc). All that is except that the ContextMenuInfo parameter supplied to onCreateContextMenu(...) is now null - stopping me accessing the rowId.<br>Is there another trick to perform - perhaps in the bindView(...) method of the CursorAdapter?</p>","208689","","208689","","2009-11-11 23:19:46","2009-11-15 11:38:31","onCreateContextMenu is invoked with a null value for ContextMenuInfo","<android><listview><cursor>","2","0","","",""
"1719261","1","1719284","","2009-11-12 01:20:51","21","11990","<p>I'm trying to figure out how to parse some XML (for an Android app), and it seems pretty ridiculous how difficult it is to do in Java. It seems like it requires creating an XML handler which has various callbacks (startElement, endElement, and so on), and you have to then take care of changing all this data into objects. Something like <a href=""http://www.anddev.org/parsing%5Fxml%5Ffrom%5Fthe%5Fnet%5F-%5Fusing%5Fthe%5Fsaxparser-t353.html"">this tutorial</a>.</p><p>All I really need is to change an XML document into a multidimensional array, and even better would be to have some sort of <a href=""http://wiki.github.com/hpricot/hpricot"">Hpricot</a> processor. Is there any way to do this, or do I really have to write all the extra code in the example above?</p>","135180","","","","","2012-06-08 09:51:41","Is there an easier way to parse XML in Java?","<java><xml><android>","13","2","9","",""
"1719802","1","1720064","","2009-11-12 04:02:22","2","3106","<p>Essentially Im trying to get many many java clients connect to a socket on my ColdFusion server (Using the Socket Gateway). However before i even start to code this, Im a little confused about sockets and their performance. First of all, are sockets meant for many(1000+) clients connecting to one socket (say port 2202) on one server? How is the performance if all there waiting for is basically a ping, or something such that when these clients receive this ""ping"" they can go get some new data.</p><p>Thanks,Faisal Abid</p>","117691","","","","","2010-07-02 06:13:12","Socket Programming -Java - Many Clients One Socket Question(s)","<java><android><coldfusion>","4","0","2","",""
"1720346","1","1722427","","2009-11-12 06:44:24","33","31253","<p>I want to get the currently running <a href=""http://en.wikipedia.org/wiki/Android%5F%28operating%5Fsystem%29#Software%5Fdevelopment%5Fkit"">Android Emulator</a>'s IP address through code.How can it be achieved?</p>","131062","","164148","","2012-11-05 13:29:39","2013-06-22 20:45:49","How to get the Android Emulator's IP address?","<android><ip><avd>","6","1","17","",""
"1721000","1","1721374","","2009-11-12 09:26:13","1","500","<p>I have a home screen replacement app.  It is set via the GUI to always be used as the home screen.  How can I get that activity to start the original home screen on demand?  Is there a published activity name for it?  I want my replacement home screen to remain the default.</p>","41742","","","","","2011-05-05 06:25:36","How to start the Google home screen on Android when it's not the default?","<android>","1","0","1","",""
"1721249","1","","","2009-11-12 10:17:08","3","3131","<p>The Android 2.0 SDK has a import/export option to export or import contacts in VCard format.</p><p>Is there any API to achieve this functionality.</p>","209445","","","","","2011-11-07 09:25:36","Import/Export to VCard format programmatically using android OS 2.0 API level 5","<android>","1","0","1","",""
"1721279","1","","","2009-11-12 10:23:09","88","82346","<p>I'm working on Android 2.0 and am trying to receive a list of all contacts.</p><p>Since <em>android.provider.Contacts.People</em> is deprecated, I have to use <em>android.provider.ContactsContract</em>, But I can't find a proper example of how to use it (ex: retrieve a list of all contacts on the phonebook).</p><p>Anyone knows where to find such an example?</p>","209477","","2390083","","2013-10-11 19:21:56","2013-10-11 19:21:56","How to read contacts on Android 2.0","<android><contacts><android-2.0-eclair>","8","1","93","",""
"1723412","1","","","2009-11-12 16:14:07","7","6841","<p>I am writing an Android application that would both store data and communicate with a server using protocol buffers. However, the <a href=""http://code.google.com/apis/protocolbuffers/"" rel=""nofollow"">stock implementation</a> of protocol buffers compiled with the LITE flag (in both the JAR library and the generated .java files) has an overhead of ~30 KB, where the program itself is only ~30 KB. In other words, protocol buffers doubled the program size.</p><p>Searching online, I found a <a href=""http://groups.google.com/group/android-developers/browse%5Fthread/thread/c7b68765a02f74df/978cd88517a5fc25?#978cd88517a5fc25"" rel=""nofollow"">reference</a> to an <a href=""http://android.git.kernel.org/?p=platform/external/protobuf.git;a=tree;f=src/com/google/common/io/protocol;h=44814a7cc40a99cf6a866e219793976de8f283a7;hb=HEAD"" rel=""nofollow"">Android specific implementation</a>. Unfortunately, there seems to be no documentation for it, and the code generated from the standard .proto file is incompatible with it. Has anyone used it? How do I generate code from a .proto file for this implementation? Are there any other lightweight alternatives?</p>","196980","","213269","","2010-04-20 18:11:11","2011-11-10 11:36:40","Android and Protocol Buffers","<android><serialization><protocol-buffers>","3","0","2","",""
"1723415","1","","","2009-11-12 16:14:35","1","1369","<p>In my android application, I have an EditText. When I click in this field, the soft keyboard appears, expanding from the bottom of the screen. It seems to actually modify my layout, pushing contents upwards. When I dismiss the keypad, it retracts, and I see my layout re-expand to take up the space it previously occupied.</p><p>Is there a way to get the keyboard to simply appear ""on top"" of my layout, so that I don't get this somewhat unpleasant relayout animation? The EditText is pinned to the very top of the screen, so I don't have to worry about the keypad hiding it.</p><p>Thanks</p>","137193","","","","","2010-08-12 03:25:48","Get soft keypad to stop modifying my LinearLayout on display?","<android><android-widget>","2","0","1","",""
"1723846","1","2151964","","2009-11-12 17:13:19","19","23681","<p>I'm trying to draw some text onto an MapView on Android.  The drawing of the text goes fine, but it's very hard to read the text because it's white with no black border (like the rest of the text that appears naturally on MapViews to denote cities, states, and countries).  I can't seem to figure how to draw the text with a black border.  Anyone know how to do this?</p><p>This is the sort of code I'm using right now (this is just example code, found in one of my overlays):</p><pre><code>@Overridepublic void draw(Canvas canvas, MapView mapView, boolean shadow) {	Paint textPaint = new Paint();	textPaint.setARGB(255, 255, 255, 255);	textPaint.setTextAlign(Paint.Align.CENTER);	textPaint.setTextSize(16);	textPaint.setTypeface(Typeface.DEFAULT_BOLD);	canvas.drawText(""Some Text"", 100, 100, textPaint);	super.draw(canvas, mapView, shadow);}</code></pre>","60261","","","","","2012-02-19 18:23:45","How do you draw text with a border on a MapView in Android?","<android><google-maps><android-mapview>","4","0","17","",""
"1724344","1","","","2009-11-12 18:26:28","2","312","<p>I have an activity that looks up telephone numbers inputted from the UI out of a local sqlite database that shows the originating city/state of the number. Part of the activity also consists of a service that listens for incoming and outgoing calls on the phone. When a call is made, or a call comes in, it displays a Toast message at the bottom of the screen with that number's city/state from the database. As far as I am aware, there is no way to achieve this functionality without making the service live forever. Right now I have an alarm setup to run every hour and restart the service if it has been killed. I remember an old app that worked this way called ""missed call"" which changed the notification LED color based on the message received (missed call, sms, email etc.). My question is, is there a better way to go about doing this? I know keeping services running forever is extremely frowned upon, but I don't see any other method unless I'm missing something.</p><p>Thanks!</p>","209842","","","","","2010-10-03 13:01:24","What is the best way to handle a service that needs to live forever? Or is there a better way of doing it","<android>","1","6","","",""
"1724937","1","1738061","","2009-11-12 19:55:44","6","22421","<p>I coded an own Adapter and added it to my ListActivity via an ListView. The reason why I wrote an own Adapter is, that i had to make some layout changes to the list-entrys. In every entry of the list i've got 3 TextViews.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""?android:attr/listPreferredItemHeight""android:padding=""6dip""&gt;&lt;TextView    android:id=""@+id/myNr""    android:layout_width=""40dip""    android:layout_height=""fill_parent""    android:layout_marginRight=""15dip""    android:text=""id""     android:textSize=""25dip""    android:background=""#333333""    android:gravity=""center_horizontal""/&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""0dip""    android:layout_weight=""1""    android:layout_height=""fill_parent""&gt;    &lt;TextView        android:id=""@+id/editor""        android:layout_width=""fill_parent""        android:layout_height=""0dip""        android:layout_weight=""1""        android:gravity=""center_vertical""        android:text=""Editor: "" /&gt;    &lt;TextView        android:id=""@+id/date""        android:layout_width=""fill_parent""        android:layout_height=""0dip""        android:layout_weight=""1""         android:singleLine=""true""        android:ellipsize=""marquee""        android:text=""Date: "" /&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>The next thing i did, was to implement a ""onListItemClick-Methode"". Afterwards i implemented a onListItemLongClick - Listener with the following code: </p><p>in onCreate of the Activity i added:</p><pre><code> registerForContextMenu(getListView());</code></pre><p>then i added the following methode:    </p><pre><code>Overridepublic void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo){         AdapterView.AdapterContextMenuInfo info;         info = (AdapterView.AdapterContextMenuInfo) menuInfo;            long id = getListAdapter().getItemId(info.position);        }</code></pre><p>where ""id"" is the index of the item in the list. I now want to get the Text of the texview with the id=""myNr of this ListItem.Is there any way get this Text?</p>","209902","","288773","","2011-09-20 09:01:58","2013-10-08 22:59:55","Android, Custom ListAdapter get TextView-Text","<android><listview><adapter>","12","0","4","",""
"1725651","1","1726986","","2009-11-12 21:49:58","0","552","<p>I’m scoping a new software project and haven’t had much experience with software development. This is a multipart question. </p><ol><li><p>What are some recommended books for web application architecture?</p></li><li><p>We are basically looking to develop several front end applications (mobile and websites) that can query a central application pool that’ll hit our backend database to retrieve the data. Is there a name for this kind of architecture?</p></li></ol>","209971","","102704","","2009-11-12 21:56:55","2009-11-13 03:36:54","Web Application Architecture?","<iphone><android><web-services><architecture>","3","0","","",""
"1725880","1","3824119","","2009-11-12 22:33:40","43","14475","<p>My Android app is reading and writing to a local SQLite DB from a few different Activities and a Service. Pretty standard. But I'm not happy with the way I've got all the DB details stored as constants that I then use anywhere I access the DB. I've been advised to wrap the DB in a ContentProvider. Sounds good to me. While I'm refactoring my code, I figured I'd ask: </p><ul><li>What are your best practices for local DB data storage in Android?</li><li>Where and how do you store ""CREATE TABLE"" statements, column names, other SQL?</li><li>Would you mind sharing a list of the classes you instantiate and what goes into each (ContentProvider, DatabaseProvider, DatabaseHelper...)?</li><li>How do you coordinate the structure of your local Android DB with a server-side DB available through a REST interface?</li></ul><p>Yeah, I realize I'm getting at the perennial ""where's the Android object-relation-mapping framework?"" question. For now, I'm mainly curious to hear how you structure your Android apps with what's available in the standard SDK.</p><p>As always, thanks for the pointers!</p>","40956","","179850","","2012-09-28 14:53:31","2013-07-15 09:58:54","Best practices for SQLite DB and ContentProvider","<android><orm>","4","2","29","",""
"1725947","1","","","2009-11-12 22:46:35","0","1018","<p>I've created my own compound widget, something just like this:</p><pre><code>&lt;LinearLayout&gt;  &lt;TextView /&gt;  &lt;Button /&gt;&lt;/LinearLayout&gt;</code></pre><p>I'm putting 15 of these in a ScrollView. I want it to behave similar to a ListView (I cannot use a ListView directly for this task).</p><p>I need the each widget to highlight when pressed. I've gotten this to work, but it's too sensitive - as soon as my finger hits the layout, it highlights - I'd like there to be a delay before highlight to discern between a real tap, and just a scroll gesture.</p><p>For example, in ListView, when you drag your finger to scroll, the row items don't get highlighted unless you leave your finger on the row for a second.</p><p>This is how I've set the background of each of my compound items:</p><pre><code>private void setBg() {  ColorDrawable blr = new ColorDrawable(0xFFFFFFFF);  Drawable pressed = getContext().getResources().getDrawable(android.R.drawable.list_selector_background);  StateListDrawable bg = new StateListDrawable();  bg.addState(View.PRESSED_ENABLED_STATE_SET, pressed);  bg.addState(View.FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, pressed);  bg.addState(View.PRESSED_ENABLED_FOCUSED_STATE_SET, pressed);  bg.addState(View.ENABLED_WINDOW_FOCUSED_STATE_SET, pressed);  bg.addState(View.ENABLED_STATE_SET, blr);  bg.addState(View.SELECTED_WINDOW_FOCUSED_STATE_SET, blr);  setBackgroundDrawable(bg);}</code></pre><p>so I'm not sure if I just have set one of the above background drawable states incorrectly - or does ListView do some sort of touch handling internally for that tap delay?</p><p>Thanks</p>","137193","","","","","2009-12-08 22:18:42","Highlight layout after delay?","<android><android-widget>","2","4","1","",""
"1726436","1","","","2009-11-13 00:46:25","2","3776","<p>I'm able to play a media using a MediaPlayer.</p><p>But how can I play the media with speaker phone only? I have tried:</p><pre><code>AudioManager audioManager = (AudioManager) mActivity.getSystemService(Context.AUDIO_SERVICE);audioManager.setSpeakerphoneOn(true);</code></pre><p>That does not work. And I have add this to my Manifest file</p><pre><code>&lt;uses-permission android:name=""android.permission.MODIFY_AUDIO_SETTINGS"" /&gt;</code></pre><p>Can someone please tell me what am i missing?</p>","128983","","114066","","2010-07-05 10:48:50","2011-04-08 04:54:40","How to play media via speaker phone","<android><sound-api>","1","0","2","",""
"1726646","1","","","2009-11-13 01:55:09","0","1745","<p>I just purchased an Archos 5 and I'm wondering if it is possible to put a .JAR file on it and use it as an application. I read somewhere that it is possible but saw somewhere else that it wasn't. If it is possible, is there anything I have to do differently? Or do I just run it like I would on my computer?</p>","","user210116","","","","2012-08-18 11:56:01",".JAR + Android?","<android><jar>","2","0","","",""
"1726897","1","1727012","","2009-11-13 03:12:12","7","7795","<p>Is it possible to do the equivalent of</p><pre><code>setTextAppearance(context, android.R.style.TextAppearance_Medium);</code></pre><p>in the manifest file for an Android app?</p>","41742","","","","","2011-03-03 21:03:59","How to set Text Appearance in Android manifest file?","<android><android-manifest>","1","0","4","",""
"1727560","1","","","2009-11-13 06:45:43","2","3114","<p>I want to change the current activity inside a tab in a tab activity, </p><p>after some research, I know that I need to use activity group to go this.</p><p>then I created a new class extends ActivityGroup with the code below:</p><p>public class FavShop extends ActivityGroup{ protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       LocalActivityManager m = getLocalActivityManager();       Intent i = new Intent(this, fav_shops.class);       Window window = m.startActivity(""favourite shop"",i);       setContentView(window.getDecorView());   } }</p><p>then I run the program, the program throw the ActivityNotFoundException when the intent for the tab is launched</p><p>I have no idea how to solve this problem, could anyone help me?</p>","210235","","","","","2011-09-01 23:16:22","Activity group throw ActivityNotFoundException?","<android><activity>","2","0","","",""
"1728179","1","1729163","","2009-11-13 09:36:42","2","1236","<p>I am creating an android application that has a lot of different screens where the user can navigate to those screens using the buttons or list provided in those screens. What would be the best way to design the entire app's navigation flow? Should I map each screen to be View or an Activity? Can an design an entire android app with just one activity and many views, where each view represents one screen with many other UI elements (buttons, lists, images etc)</p>","77087","","","","","2009-11-14 20:45:53","Android designing application flow","<android><design>","2","0","1","",""
"1728476","1","1730143","","2009-11-13 10:46:18","14","17188","<p>I know that on android there is android.database.sqlite package that provides helpfull classes to manage the internal android database.</p><p>The question is - can i use the standard java.sql package to manipulate android's database without using anything from android.database.sqlite.* I try to open connection using sqlite JDBC driver but when i added the library as e reference to the project eclipse crashes with ""java heap out of memory ... couldn't convert to dalvik VM"".</p>","184601","","184601","","2009-11-13 13:50:21","2011-06-17 12:53:46","does android support JDBC","<android><sqlite><jdbc>","3","0","10","",""
"1728674","1","1729709","","2009-11-13 11:29:57","0","892","<p>To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?</p>","77087","","","","","2009-11-13 14:55:34","TiledLayer equivalent in Android","<android><tiles>","1","0","","",""
"1729319","1","1732502","","2009-11-13 13:54:15","0","221","<p>I created an application which stores values into the database and retrieves the stored data. While running an application in run mode everything seems to work fine (the values are stored and retrieved successfully) but when I run in the debug mode the process throws IllegalStateException and so far haven't found a cause.</p><p>The method which retrieves an object Recording is the following:</p><pre><code>public Recording getRecording(String filename) {    Recording recording = null;    String where = RECORDING_FILENAME + ""='"" + filename + ""'"";    Log.v(TAG, ""retrieving recording: filename = "" + filename);    try {        cursor = db.query(DATABASE_TABLE_RECORDINGS, new String[]{RECORDING_FILENAME, RECORDING_TITLE, RECORDING_TAGS, RECORDING_PRIVACY_LEVEL, RECORDING_LOCATION, RECORDING_GEO_TAGS, RECORDING_GEO_TAGGING_ENABLED, RECORDING_TIME_SECONDS, RECORDING_SELECTED_COMMUNITY}, where, null, null, null, null);        if (cursor.getCount() &gt; 0) {            cursor.moveToFirst();            //String filename = c.getString(0);            String title = cursor.getString(1);            String tags = cursor.getString(2);            int privacyLevel = cursor.getInt(3);            String location = cursor.getString(4);            String geoTags = cursor.getString(5);            int iGeoTaggingEnabled = cursor.getInt(6);            String recordingTime = cursor.getString(7);            String communityID = cursor.getString(8);            cursor.close();            recording = new Recording(filename, title, tags, privacyLevel, location, geoTags, iGeoTaggingEnabled, recordingTime, communityID);        }    }    catch (SQLException e) {        String msg = e.getMessage();        Log.w(TAG, msg);        recording = null;    }    return recording;}</code></pre><p>and it is called from another class (Settings):</p><pre><code>private Recording getRecording(String filename) {    dbAdapter = dbAdapter.open();    Recording recording = dbAdapter.getRecording(filename);    dbAdapter.close();    return recording;}</code></pre><p>While running through the code above everything works fine but then I notice an exception in another thread:<img src=""http://img509.imageshack.us/img509/862/illegalstateexception.jpg"" alt=""alt text""></p><p>and don't know neither what is the possible cause of this exception nor how to debug the code from that thread to diagnose the cause.</p><p>I would be very thankful if anyone knew what is the possible issue here.</p><p>Thank you!</p>","22996","","","","","2009-11-13 23:17:12","Database problem: how to diagnose and fix the problem?","<database><android><exception>","1","1","","",""
"1732299","1","","","2009-11-13 22:27:43","0","270","<p>How can I make a ProgressBar in Android not changeable by user.I don't mean 'disabled', since my application will update it dynamically. I would like the ProgressBar to update by my application but user can't move the bar in the Progress bar to change value?</p>","128983","","114066","","2010-08-17 08:07:37","2010-08-17 08:07:37","ProgressBar not changeable by user","<android><progress-bar>","1","1","","",""
"1732501","1","","","2009-11-13 23:17:06","1","1866","<p>I'm trying to emulate an Acer AOD250 that has a 1024x600 screen and comes with Android.  If I create an AVD with default settings except for resolution of 1024x600 and SDK 3, the emulator does not start.  The largest I can get working is 670x600.  At larger resolutions, sometimes the emulator starts, but does not complete the boot.  Is there a memory setting or something that I can change to allow the emulator to work on a screen this big?</p>","41742","","","","","2011-11-01 06:35:01","How to get a 1024 x 600 Android emulator working?","<android><emulator>","2","0","1","",""
"1732537","1","1737114","","2009-11-13 23:25:46","11","15654","<p>Is there a way to intercept an SMS with <a href=""http://developer.android.com/reference/android/content/BroadcastReceiver.html"">BroadcastReceiver</a> as for example <a href=""http://www.androidcompetencycenter.com/2008/12/android-api-sms-handling/"">here</a> but without showing any notifications to the user and immediately deleting the message that contains for example some keyword </p><p>EDIT:</p><p>What I need is to have some communication between android phones, one to one, and I thought that sending SMS messages would solve the problem, but the SMS notification are not needed for that, maybe the WAP PUSH messages would better for that but I have no idea how to send them from android phone.If someone has any idea that would help, please put it here :)</p>","31207","","31207","","2009-11-16 16:45:21","2011-03-28 07:12:15","Android SMS intercept without notification icon or WAP-PUSH messages","<android><sms><notifications><broadcastreceiver>","4","2","4","",""
"1733039","1","","","2009-11-14 02:37:32","0","175","<p>I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for the web? I mean, with a predefined list of widgets that can be defined using a markup language and then control them using code? </p><p>I have come across Google's Web Toolkit that does something like this but I'd like to hear what other's think as well.</p>","184046","","","","","2011-02-06 19:05:30","Android & Web: What is the equivalent style for the web?","<html><android><design><markup>","4","0","1","",""
"1733195","1","","","2009-11-14 03:55:26","37","31943","<p>I want to be able to download a file with a particular extension from the 'net, and have it passed to my application to deal with it, but I haven't been able to figure out the intent filter.  The filetype is not included in the mimetypes, and I tried using </p><pre><code>&lt;data android:path=""*.ext"" /&gt;</code></pre><p>but I couldn't get that to work.</p>","41742","","","","","2014-03-18 07:58:27","Android intent filter for a particular file extension?","<android><android-intent><android-manifest>","8","0","47","",""
"1734602","1","1734726","","2009-11-14 15:43:07","3","911","<p>My application uses a remote service to play audio.  I do this so thatno activity owns the playback of the audio - the user can trigger someaudio to be played from one Activity, and the audio will continue toplay as they navigate around the app.  I do, however, want to tell theservice to pause or stop playing audio when the user ""unloads"" the appeither by backing out, locking the display, or hitting Home.  When the app was a singleactivity, I was doing this in onPause.  So, I guess I'm essentiallylooking for ""onPause"" at the application/task level.  Does such thingexist?  If not, what is the ""best practice"" way of getting notifiedthat the task has been put on hold by the user either backing all theway out or hitting Home?</p>","53501","","","","","2009-11-16 06:50:13","Android: Task or application equivalent of onPause","<android><aidl><application-lifecycle>","2","0","","",""
"1735245","1","1736521","","2009-11-14 19:09:28","0","1169","<p>I'm writing a simple Android app, and I'd like better control over the navigation/relationship between the activities.  I don't want my activities to act like android activities...I don't want them to stack up within the Task.  I want one activity (let's call it MainActivity) to be the landing point and always be at the bottom of the stack, and I want only one instance of my second activity (call it SecondActivity) to be above it in the stack...would be nice to reuse it as well.  I thought I could get this behavior by making MainActivity be the ""main"" activity, and declare them both as launchMode=singleTop.  This isn't working at all.  I provide navigation between them using menus, so when I go back and forth a bunch of times and back out of the app, I go through the whole stack.</p><p>How's the best way to have fine control over the Task's Activity stack?  I want MainActivity to always back out of the app, and SecondActivity to always back into a single instance of MainActivity.  As well, I'd love to get singleTop working so I would use onNewIntent instead of creating and destroying every time.  Using the manifest as well as the intent flag is just not working.  Any ideas?</p>","53501","","","","","2009-11-15 04:03:35","Overriding the Activity/Task behavior in Android","<android><activity><android-intent><application-lifecycle>","1","0","1","",""
"1737009","1","1737042","","2009-11-15 08:38:19","134","74103","<p>I want a nice looking filter for my ListView in Android.  </p><p>How can I do this?</p>","119592","","114066","","2010-07-15 10:35:46","2012-12-17 10:12:59","How to make a nice looking ListView filter on Android","<android><listview><filter><android-widget>","4","0","132","2013-05-09 19:17:48",""
"1737877","1","","","2009-11-15 15:43:45","4","10108","<p>How can I determine the current internet connection type available to an Android device? e.g. have it return WiFi, 3G, none.</p>","211475","","","","","2012-11-16 09:09:06","How to determine Android internet connection?","<android><networking>","4","0","4","",""
"1738011","1","","","2009-11-15 16:29:14","4","6972","<p>I have a custom view, derived from <code>Button</code>, which I want to position at runtime, relative to another view. Because I don't know that other view's position yet when my view is being inflated (because layouting hasn't started), I leverage the <code>onSizeChanged</code> handler to set my view's position relative to the other view.</p><p>In <code>onSizeChanged</code>:</p><pre><code>LayoutParams lp = new LayoutParams(this.getMeasuredWidth(), this.getMeasuredHeight());lp.leftMargin = x;lp.topMargin = y;this.setLayoutParams(lp);forceLayout();</code></pre><p>That, however, has no effect. How come?</p>","127013","","","","","2009-11-15 22:27:26","Changing LayoutParams programatically has no effect. Why?","<android><layout>","1","1","1","",""
"1738124","1","","","2009-11-15 17:12:47","0","888","<p>Is it possible to define a shortcut key to launch the app I'm developing for android?</p><p>Can a service running in the background get hardware button events like the camera or send button for example.</p><p>Thanks</p>","211523","","","","","2011-07-25 11:37:40","shortcut key to launch an app","<android>","2","0","","",""
"1739458","1","1955183","","2009-11-16 00:27:47","0","2422","<p>I have a ListView with an adapter extending BaseAdapter. I create a view (from a LinearLayout and I put some items ont it depending on some parameters. I have a textview, with a drawable and sometime another textview next to the drawable in this horizontal linearlayout. For some reason, this command doesn't seems to work. </p><pre><code>setLayoutParams(newListView.LayoutParams(ListView.LayoutParams.FILL_PARENT,          ListView.LayoutParams.WRAP_CONTENT));</code></pre><p>So when my textview doesn't fill the full width of the list, I can only click on the part of the elements with the widget on it. I have try playing a lot with the layout and I can't get this to work. The parameters seems to be ignore all together. Only hack that would work I found was to set a big minimum width on my linearlayout but I don't think that's the best solution.</p>","211682","","72882","","2012-11-30 13:55:43","2012-11-30 13:55:43","How to add elements to an Android ListView programmatically?","<android><listview>","1","0","","",""
"1739515","1","1739676","","2009-11-16 00:45:34","88","21613","<p>I'm converting my code from using <code>Handler</code> to <code>AsyncTask</code>. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread.  What's unclear to me is how to handle exceptions if something goes haywire in <code>AsyncTask#doInBackground</code>. </p><p>The way I do it is to have an error Handler and send messages to it. It works fine, but is it the ""right"" approach or is there better alternative?</p><p>Also I understand that if I define the error Handler as an Activity field, it should execute in the UI thread.  However, sometimes (very unpredictably) I will get an Exception saying that  code triggered from <code>Handler#handleMessage</code> is executing on the wrong thread. Should I initialize error Handler in <code>Activity#onCreate</code> instead? Placing <code>runOnUiThread</code> into <code>Handler#handleMessage</code> seems redundant but it executes very reliably.</p>","135946","","85950","","2012-04-11 19:31:26","2014-01-10 13:28:42","AsyncTask and error handling on Android","<android><error-handling><handler><android-asynctask>","8","2","20","",""
"1739677","1","1746298","","2009-11-16 02:05:24","0","2126","<p>I'm relatively new to Android development. I'm developing an app with a ListView. I've followed the info in #<a href=""http://stackoverflow.com/questions/1338475/how-to-best-handle-fling-gesture-for-android-listactivity"">1338475</a> and have my app recognizing the fling gesture, but after the gesture is complete, it pulls up the context menu for the item. I just want the fling action to be handled in code (my app does one list per date and I want to use the fling gesture to move back and forth in days). Does anyone know how to suppress the context menu if the gesture is recognized?</p><p>Thanks,Jason</p>","211734","","","","","2009-11-17 02:54:20","Android - ListView fling gesture triggers context menu","<android><gesture>","1","0","","",""
"1740339","1","1743028","","2009-11-16 06:00:57","9","6690","<p>I'm currently using the following code to format time on Google Android:</p><pre><code>DateFormat.getDateTimeInstance().format(millis)</code></pre><p>While this code honors my timezone and locale settings, it ignores the '24 hour mode' setting in system preferences, always returning time in AM/PM. Is there any way to get time in the same format as that on the status bar?</p>","132628","","2961","","2009-11-16 07:15:04","2012-04-28 06:20:28","Formatting time on Android, while following preferences (24 hr clock vs. AM/PM, etc..)","<android><time><date-format>","3","0","1","",""
"1740654","1","","","2009-11-16 07:37:15","3","31876","<p>I'd like to show a png or jpg I downloaded from the next in an image viewer intent, but can't get it to work.</p><pre><code>Bitmap bmp = getImageBitmap(jpg);String path = getFilesDir().getAbsolutePath() + ""/test.png""; File file = new File(path); FileOutputStream fos = new FileOutputStream(file);bmp.compress( CompressFormat.PNG, 100, fos ); fos.close(); Intent intent = new Intent();intent.setAction(android.content.Intent.ACTION_VIEW);intent.setDataAndType(Uri.fromFile(new File(path)), ""image/png"");startActivity(intent);</code></pre><p>I know the bitmap is downloaded ok (use the same routine for supplying it my ImageView instances elsewhere in my app) - I think it wrote to file ok, I can see it on disk and the file size is correct. The intent is launched but an exception is thrown:</p><p>ERROR/ImageManager(1345): got exception decoding bitmap java.lang.NullPointerException</p><p>then the new activity just sits there, blank. How does this work?</p>","137193","","","","","2011-09-23 15:11:32","View image in ACTION_VIEW intent?","<android>","2","0","7","",""
"1740834","1","","","2009-11-16 08:31:01","39","32369","<p>When I launch the emulator I face many problems (Errors):-</p><pre><code>HttpConnectionApp]emulator-5554 disconnected!Cancelling 'net.paxcel.http.HttpConnectionApp activity launch'!Emulator]emulator: ERROR: the user data image is used by another emulator.aborting</code></pre><p>Each time I have to re-run it but all in vain.</p><p>How can I improve this so that I can re-run the application on same AVD?</p>","211887","","648313","","2011-07-13 11:23:38","2013-12-10 16:15:10","Emulator problem in Android","<android><eclipse><android-emulator><adt><avd>","15","0","18","",""
"1741334","1","","","2009-11-16 10:35:33","10","10078","<p>I've had fine luck using SQLite with straight, direct SQL in Android, but this is the first time I'm wrapping a DB in a ContentProvider. I keep getting a null pointer exception when calling <code>getWritableDatabase()</code> or <code>getReadableDatabase()</code>. Is this just a stupid mistake I've made with initializations in my code or is there a bigger issue?</p><pre><code>public class DatabaseProvider extends ContentProvider {  ...  private DatabaseHelper                   databaseHelper;  private SQLiteDatabase                   db;  ...  @Override  public boolean onCreate() {    databaseHelper = new DatabaseProvider.DatabaseHelper(getContext());    return (databaseHelper == null) ? false : true;  }  ...  @Override  public Uri insert(Uri uri, ContentValues values) {       db = databaseHelper.getWritableDatabase(); // NULL POINTER EXCEPTION HERE    ...  }  private static class DatabaseHelper extends SQLiteOpenHelper {    public static final String DATABASE_NAME = ""cogsurv.db"";    public static final int DATABASE_VERSION = 1;    public static final String[] TABLES = {      ""people"",       ""travel_logs"",       ""travel_fixes"",      ""landmarks"",       ""landmark_visits"",      ""direction_distance_estimates""     };    // people._id does not AUTOINCREMENT, because it's set based on server's people.id    public static final String[] CREATE_TABLE_SQL = {      ""CREATE TABLE people (_id INTEGER PRIMARY KEY,"" +                  ""server_id INTEGER,"" +                 ""name VARCHAR(255),"" +                 ""email_address VARCHAR(255))"",      ""CREATE TABLE travel_logs (_id INTEGER PRIMARY KEY AUTOINCREMENT,"" +                                ""server_id INTEGER,"" +                                ""person_local_id INTEGER,"" +                                ""person_server_id INTEGER,"" +                                ""start DATE,"" +                                ""stop DATE,"" +                                ""type VARCHAR(15),"" +                                ""uploaded VARCHAR(1))"",      ""CREATE TABLE travel_fixes (_id INTEGER PRIMARY KEY AUTOINCREMENT,"" +                                 ""datetime DATE, "" +                                 ""latitude DOUBLE, "" +                                 ""longitude DOUBLE, "" +                                 ""altitude DOUBLE,"" +                                 ""speed DOUBLE,"" +                                 ""accuracy DOUBLE,"" +                                 ""travel_mode VARCHAR(50), "" +                                 ""person_local_id INTEGER,"" +                                 ""person_server_id INTEGER,"" +                                 ""travel_log_local_id INTEGER,"" +                                 ""travel_log_server_id INTEGER,"" +                                 ""uploaded VARCHAR(1))"",      ""CREATE TABLE landmarks (_id INTEGER PRIMARY KEY AUTOINCREMENT,"" +                              ""server_id INTEGER,"" +                              ""name VARCHAR(150),"" +                              ""latitude DOUBLE,"" +                              ""longitude DOUBLE,"" +                              ""person_local_id INTEGER,"" +                              ""person_server_id INTEGER,"" +                              ""uploaded VARCHAR(1))"",      ""CREATE TABLE landmark_visits (_id INTEGER PRIMARY KEY AUTOINCREMENT,"" +                                    ""server_id INTEGER,"" +                                    ""person_local_id INTEGER,"" +                                    ""person_server_id INTEGER,"" +                                    ""landmark_local_id INTEGER,"" +                                    ""landmark_server_id INTEGER,"" +                                    ""travel_log_local_id INTEGER,"" +                                    ""travel_log_server_id INTEGER,"" +                                    ""datetime DATE,"" +                                    ""number_of_questions_asked INTEGER,"" +                                    ""uploaded VARCHAR(1))"",      ""CREATE TABLE direction_distance_estimates (_id INTEGER PRIMARY KEY AUTOINCREMENT,"" +                                                 ""server_id INTEGER,"" +                                                 ""person_local_id INTEGER,"" +                                                 ""person_server_id INTEGER,"" +                                                 ""travel_log_local_id INTEGER,"" +                                                 ""travel_log_server_id INTEGER,"" +                                                 ""landmark_visit_local_id INTEGER,"" +                                                 ""landmark_visit_server_id INTEGER,"" +                                                 ""start_landmark_local_id INTEGER,"" +                                                 ""start_landmark_server_id INTEGER,"" +                                                 ""target_landmark_local_id INTEGER,"" +                                                 ""target_landmark_server_id INTEGER,"" +                                                 ""datetime DATE,"" +                                                 ""direction_estimate DOUBLE,"" +                                                 ""distance_estimate DOUBLE,"" +                                                 ""uploaded VARCHAR(1))""    };    public DatabaseHelper(Context context) {      super(context, DATABASE_NAME, null, DATABASE_VERSION);      Log.v(Constants.TAG, ""DatabaseHelper()"");    }    @Override    public void onCreate(SQLiteDatabase db) {      Log.v(Constants.TAG, ""DatabaseHelper.onCreate() starting"");      // create the tables      int length = CREATE_TABLE_SQL.length;      for (int i = 0; i &lt; length; i++) {        db.execSQL(CREATE_TABLE_SQL[i]);      }      Log.v(Constants.TAG, ""DatabaseHelper.onCreate() finished"");    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {      for (String tableName : TABLES) {        db.execSQL(""DROP TABLE IF EXISTS"" + tableName);      }      onCreate(db);    }  }}</code></pre><p>As always, thanks for the assistance!</p><p>--</p><p>Not sure if this detail helps, but here's LogCat showing the exception:<img src=""http://img149.imageshack.us/img149/5590/errorup.png"" alt=""alt text""></p>","40956","","1431239","","2012-09-05 18:38:03","2012-11-15 16:25:28","SQLiteOpenHelper.getWriteableDatabase() null pointer exception on Android","<android><sqlite>","7","1","2","",""
"1741628","1","","","2009-11-16 11:33:43","77","26816","<p>I am deleting an SMS from the inbox but I want to know: How can I delete it before it reaches the inbox?</p>","211996","","201113","","2011-12-29 20:24:52","2013-10-31 00:13:48","Can we delete an SMS in Android before it reaches the inbox?","<android><sms>","4","8","57","",""
"1743683","1","10662310","","2009-11-16 17:36:39","36","6945","<p>I'm building an Android application and would like to maintain a few environment variables that I can tweak depending on whether I'm in development mode or release mode. For example, I need to invoke a web service and the URL will be slightly different in either mode.  I'd like to externalize this and other settings so I can change them easily based on my target deployment.</p><p>Are there any best practices or anything in the SDK to assist with this need?</p><p>Thanks</p>","48837","","48837","","2009-11-16 17:50:17","2012-09-07 07:01:09","Distinguishing development mode and release mode environment settings on Android","<android><development-environment><release-management>","7","0","18","",""
"1744091","1","1744182","","2009-11-16 18:50:39","2","5520","<p>If a page has a URL or a phone number on it that isn't a link is there any way to have <a href=""http://developer.android.com/reference/android/webkit/WebView.html"" rel=""nofollow"">WebView</a> recognize it and automatically turn it into a link like you can with <a href=""http://developer.android.com/reference/android/widget/TextView.html"" rel=""nofollow"">TextView</a>s?</p><p>With a <code>TextView</code> you would simply set the <code>android:autoLink</code> to the desired settings:</p><pre><code>&lt;TextView    android:autoLink=""web|phone""    ... /&gt;</code></pre><p>but I can't find any equivalent for <code>WebView</code>.</p>","76835","","76835","","2009-11-16 19:03:19","2011-03-02 07:49:57","Is there any way to have WebView auto-link URLs and phone numbers in Android?","<android><hyperlink><webview>","2","0","1","",""
"1744718","1","7675761","","2009-11-16 20:39:41","10","2820","<p>The Android TextView clips off my text subscripts (see image below) even when I use <code>android:layout_height=""wrap_content""</code> for the TextView.Is there a fix/work-around for this?</p><p><img src=""http://i38.tinypic.com/qy8n7m.png"" alt=""alt text""></p><p>P/S: Superscripts work fine</p><p><strong>Note:</strong> padding doesn't work. </p><ul><li>I tried even adding a padding of <em>50dip</em> but it did not help.</li><li>I can use an absolute height such as <em>50dip</em> but that messes everything up when I need text to wrap around.</li></ul><p><strong>Sample Code:</strong> </p><p><code>mtTextView.setText(Html.fromHtml(""HC0&lt;sub>3&lt;/sub>""));</code></p>","61525","","29553","","2011-11-28 10:38:22","2014-03-01 06:26:29","Android TextView's subscript being clipped off","<android><textview><subscript>","5","3","3","",""
"1744938","1","1745141","","2009-11-16 21:21:46","1","1492","<p>Is there a way I can be notified of an application launch and termination in Android? I mean, more like subscribing to the Activity Manager and then determining which applications have been started and stopped...</p>","184046","","","","","2010-02-12 22:35:09","Android: Callback for an application launch","<android><event-handling><android-intent><notifications><termination>","1","0","1","",""
"1745175","1","1746587","","2009-11-16 22:11:13","1","1219","<p>How can I layout 2 TextViews and a SeekBar on the same line in my layout xml file?I know </p><p>But how can i specify TextView (one on the right, one on the left) to use only the width it needs to display the string in the TextView while SeekBar will use up the rest of the line?</p><p>And i don't know the text vale of each TextView in the beginning and these TextView can change value in my application.</p><p>   </p><p></p><p>Thank you for any suggestion.</p>","128983","","128983","","2009-11-17 03:42:12","2009-11-17 04:29:24","How can I layout 2 TextViews (1 on left, 1 on right) and a SeekBar on the same line","<android>","1","0","","",""
"1745440","1","1749206","","2009-11-16 23:05:10","0","1189","<p>I want to encrypt individual contacts stored by the <em>Contacts</em> application on Android based on user's preference. So, I am thinking I'll have to hook/extend the <em>Contacts</em> application before the it stores data into the database and decrypt it when the user wants to view it. Also, I am assuming I will have to store the key for encryption in a file. Can anybody suggest how to go about it?</p><p>Thanks!</p>","212464","","","","","2009-11-17 14:20:40","Extend Contacts application on Android to provide encryption","<android><encryption><contacts>","1","0","","",""
"1745688","1","","","2009-11-16 23:58:53","4","13656","<p>I apologize in advance for this long post, but it's necessary to show what is happening.</p><p>I've been working on an app that works on the 1.6 emulator, but bombs on my G1.</p><p>Here is the Photographer activity:</p><pre><code>public class Photographer extends Activity { private SurfaceView preview = null; private SurfaceHolder previewHolder = null; private Camera camera = null; public static final int IMAGE_HEIGHT = 320; public static final int IMAGE_WIDTH = 480; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.photographer);  preview = (SurfaceView)findViewById(R.id.preview);  previewHolder = preview.getHolder();  previewHolder.addCallback(surfaceCallback);  previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } private void takePicture() {  camera.stopPreview();  camera.takePicture(null, null, photoCallback); } SurfaceHolder.Callback surfaceCallback = new SurfaceHolder.Callback() {  public void surfaceCreated(SurfaceHolder holder) {   camera = Camera.open();   try {    camera.setPreviewDisplay(previewHolder);   }   catch (Throwable t) {    Log.e(""Photographer"", ""Exception in setPreviewDisplay()"", t);   }   try {    takePicture();   } catch (Throwable t) {    Log.e(""Photographer"", ""Exception in takePicture()"", t);   }  }  public void surfaceChanged(SurfaceHolder holder,         int format, int width, int height) {   Camera.Parameters parameters=camera.getParameters();   parameters.setPreviewSize(IMAGE_WIDTH, IMAGE_HEIGHT);   parameters.setPictureFormat(PixelFormat.JPEG);   camera.setParameters(parameters);   camera.startPreview();  }  public void surfaceDestroyed(SurfaceHolder holder) {   camera.stopPreview();   camera.release();   camera = null;  } }; Camera.PictureCallback photoCallback = new Camera.PictureCallback() {  public void onPictureTaken(byte[] data, Camera camera) {   new SavePhotoTask().execute(data);   camera.startPreview();  } }; class SavePhotoTask extends AsyncTask&lt;byte[], String, String&gt; {  @Override  protected String doInBackground(byte[]... jpeg) {   File photo = new File(Environment.getExternalStorageDirectory(), ""WIIA-new.jpg"");   if (photo.exists())    photo.renameTo(new File(Environment.getExternalStorageDirectory(), ""WIIA-old.jpg""));   try {    FileOutputStream fos = new FileOutputStream(photo.getPath());    fos.write(jpeg[0]);    fos.close();    Log.e(""Photographer"", ""Picture taken"");    // returning result      Intent returnIntent = new Intent();      setResult(RESULT_OK, returnIntent);           finish();   }   catch (java.io.IOException e) {    Log.e(""Photographer"", ""Exception in photoCallback"", e);    // returning result      Intent returnIntent = new Intent();    setResult(RESULT_CANCELED, returnIntent);    finish();   }   return(null);  } }}</code></pre><p>and here is where this activity gets called from:</p><pre><code>    public class WIIA extends Activity { public class CountDown extends CountDownTimer {  private TextView tvCountDown = (TextView) findViewById(R.id.progress);  private TextView tvSystemState = (TextView) findViewById(R.id.system_state);  public CountDown(long millisInFuture, long countDownInterval) {   super(millisInFuture, countDownInterval);  }  @Override  public void onFinish() {   tvSystemState.setText(R.string.system_state_armed);   tvCountDown.setText(R.string.armed);   snapshotInterval = Long.parseLong(settings.getString(""snapshot_interval_list"", ""5""));   imgCaptureTimer = new Timer(""imageCapture"");   imgCaptureTimer.scheduleAtFixedRate(doRefresh, 0, snapshotInterval*1000);  }  @Override  public void onTick(long millisUntilFinished) {   tvCountDown.setText(millisUntilFinished/1000 + "" seconds until Armed"");  } } private TimerTask doRefresh = new TimerTask() {  public void run() {   if (armed) {    refreshImage();   } else {    imgCaptureTimer.cancel();   }  } }; private void refreshImage() {  Thread updateThread = new Thread(null, backgroundCaptureImage, ""capture_image"");    updateThread.start();         } private Runnable backgroundCaptureImage = new Runnable() {  public void run() {   doRefreshImage();  }         }; private void doRefreshImage() {  Intent photographer = new Intent(this, Photographer.class);  startActivityForResult(photographer, GET_PHOTO); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) {  super.onActivityResult(requestCode, resultCode, data);  switch(requestCode) {   case (GET_PHOTO) : {    if(resultCode == RESULT_OK) {    // go on to compare images     new ProcessImageTask().execute();    }    break;   }  } }</code></pre><p>Having trouble pasting the relevant portions of AndroidManifest.xml, but I have permissions for Camera:</p><pre><code>  &lt;uses-permission android:name=""android.permission.CAMERA"" /&gt;</code></pre><p>here's the Photographer part:</p><pre><code>      &lt;activity android:name="".Photographer""   android:configChanges=""keyboardHidden|orientation""   android:screenOrientation=""landscape""   android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""&gt;  &lt;/activity&gt;</code></pre><p>also set for testing on G1:</p><pre><code>android:debuggable=""true""</code></pre><p>and working off of 1.6:</p><pre><code>&lt;uses-sdk android:minSdkVersion=""4"" /&gt;</code></pre><p>All this works on a 1.6 emulator, but when I run this on the G1, LogCat shows:</p><pre><code>INFO/ActivityManager(74): Starting activity: Intent { cmp=com.androidsecurity.wiia/.Photographer }WARN/WindowManager(74): App freeze timeout expired.WARN/WindowManager(74): Force clearing freeze: AppWindowToken{432e1520 token=HistoryRecord{43124c10 com.androidsecurity.wiia/.Photographer}}WARN/ActivityManager(74): Activity pause timeout for HistoryRecord{43124c10 com.androidsecurity.wiia/.Photographer}ERROR/QualcommCameraHardware(51): native_get_picture: MSM_CAM_IOCTL_GET_PICTURE fd 13 error Connection timed outERROR/QualcommCameraHardware(51): getPicture failed!DEBUG/QualcommCameraHardware(51): snapshot_thread XINFO/QualcommCameraHardware(51): initPreview E: preview size=480x320DEBUG/QualcommCameraHardware(51): frame_thread EDEBUG/CameraService(51): CameraService::connect E (pid 1031, client 0x3b510)DEBUG/CameraService(51): CameraService::connect X (pid 1031, new client 0x3b510) rejected. (old pid 1031, old client 0x3b2e0)DEBUG/AndroidRuntime(1031): Shutting down VMWARN/dalvikvm(1031): threadid=3: thread exiting with uncaught exception (group=0x4001da28)ERROR/AndroidRuntime(1031): Uncaught handler: thread main exiting due to uncaught exceptionERROR/AndroidRuntime(1031): java.lang.RuntimeException: Fail to connect to camera serviceERROR/AndroidRuntime(1031):     at android.hardware.Camera.native_setup(Native Method)ERROR/AndroidRuntime(1031):     at android.hardware.Camera.native_setup(Native Method)ERROR/AndroidRuntime(1031):     at android.hardware.Camera.open(Camera.java:67)ERROR/AndroidRuntime(1031):     at com.androidsecurity.wiia.Photographer$1.surfaceCreated(Photographer.java:78)ERROR/AndroidRuntime(1031):     at android.view.SurfaceView.updateWindow(SurfaceView.java:392)ERROR/AndroidRuntime(1031):     at android.view.SurfaceView.dispatchDraw(SurfaceView.java:264)ERROR/AndroidRuntime(1031):     at android.view.ViewGroup.drawChild(ViewGroup.java:1524)ERROR/AndroidRuntime(1031):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)ERROR/AndroidRuntime(1031):     at android.view.ViewGroup.drawChild(ViewGroup.java:1524)ERROR/AndroidRuntime(1031):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)ERROR/AndroidRuntime(1031):     at android.view.View.draw(View.java:6277)ERROR/AndroidRuntime(1031):     at android.widget.FrameLayout.draw(FrameLayout.java:352)ERROR/AndroidRuntime(1031):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1883)ERROR/AndroidRuntime(1031):     at android.view.ViewRoot.draw(ViewRoot.java:1332)ERROR/AndroidRuntime(1031):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1097)ERROR/AndroidRuntime(1031):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)ERROR/AndroidRuntime(1031):     at android.os.Handler.dispatchMessage(Handler.java:99)ERROR/AndroidRuntime(1031):     at android.os.Looper.loop(Looper.java:123)ERROR/AndroidRuntime(1031):     at android.app.ActivityThread.main(ActivityThread.java:4203)ERROR/AndroidRuntime(1031):     at java.lang.reflect.Method.invokeNative(Native Method)ERROR/AndroidRuntime(1031):     at java.lang.reflect.Method.invoke(Method.java:521)ERROR/AndroidRuntime(1031):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)ERROR/AndroidRuntime(1031):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)ERROR/AndroidRuntime(1031):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>and /data/anr/traces.txt shows:</p><pre><code>`DALVIK THREADS:""main"" prio=5 tid=3 NATIVE  | group=""main"" sCount=1 dsCount=0 s=N obj=0x4001db08 self=0xbc48  | sysTid=358 nice=0 sched=0/0 handle=-1343996920  at android.os.BinderProxy.transact(Native Method)  at android.app.ActivityManagerProxy.handleApplicationError(ActivityManagerNative.java:2243)  at com.android.internal.os.RuntimeInit.crash(RuntimeInit.java:302)  at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:75)  at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:887)  at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:884)  at dalvik.system.NativeStart.main(Native Method)""imageCapture"" prio=5 tid=17 TIMED_WAIT  | group=""main"" sCount=1 dsCount=0 s=N obj=0x432a66f0 self=0x1dc820  | sysTid=366 nice=0 sched=0/0 handle=1938080  at java.lang.Object.wait(Native Method)  - waiting on &lt;0x1c8cd8&gt; (a java.util.Timer$TimerImpl)  at java.lang.Object.wait(Object.java:326)  at java.util.Timer$TimerImpl.run(Timer.java:250)""Binder Thread #3"" prio=5 tid=15 NATIVE  | group=""main"" sCount=1 dsCount=0 s=N obj=0x4327aa38 self=0x160ea0  | sysTid=365 nice=0 sched=0/0 handle=1406616  at dalvik.system.NativeStart.run(Native Method)""Binder Thread #2"" prio=5 tid=13 NATIVE  | group=""main"" sCount=1 dsCount=0 s=N obj=0x4327a978 self=0x1609c0  | sysTid=364 nice=0 sched=0/0 handle=498392  at dalvik.system.NativeStart.run(Native Method)""Binder Thread #1"" prio=5 tid=11 NATIVE  | group=""main"" sCount=1 dsCount=0 s=N obj=0x432799d0 self=0x155268  | sysTid=363 nice=0 sched=0/0 handle=1397288  at dalvik.system.NativeStart.run(Native Method)""JDWP"" daemon prio=5 tid=9 VMWAIT  | group=""system"" sCount=1 dsCount=0 s=N obj=0x432782a0 self=0x15f788  | sysTid=361 nice=0 sched=0/0 handle=1614352  at dalvik.system.NativeStart.run(Native Method)""Signal Catcher"" daemon prio=5 tid=7 RUNNABLE  | group=""system"" sCount=0 dsCount=0 s=N obj=0x432781e8 self=0x18a0f0  | sysTid=360 nice=0 sched=0/0 handle=1614000  at dalvik.system.NativeStart.run(Native Method)""HeapWorker"" daemon prio=5 tid=5 VMWAIT  | group=""system"" sCount=1 dsCount=0 s=N obj=0x422dd3e8 self=0x1177a8  | sysTid=359 nice=0 sched=0/0 handle=1613728  at dalvik.system.NativeStart.run(Native Method)`</code></pre><p>It sounds like the problem is a timeout issue, but I am at a loss as to where I should be looking .... does anyone have a clue?</p><p>Thanks!</p>","212494","","80701","","2009-11-17 00:13:27","2011-03-31 20:10:17","Fail to connect to camera service on G1","<android>","3","0","3","",""
"1747072","1","1757461","","2009-11-17 07:00:18","6","6963","<p>I have a WebView that I'm using to display some html/image files stored in the <code>assets/</code> directory. I'm able to have the WebView load and html page fine with:</p><pre><code>mWebView.loadUrl(""file:///android_asset/ContentRoot/SubDir/file.html"");</code></pre><p>or </p><pre><code>String data = StaticFunctions.inputStreamToString(getAssets().open(""ContentRoot/SubDir/file.html""));mWebView.loadDataWithBaseURL(""file:///android_asset/ContentRoot/SubDir/file.html"", data, ""text/html"", ""UTF-8"", null);</code></pre><p>The problem I'm having is that there are images in the HTML like:</p><pre><code>&lt;img src=""../Photos/image.jpg"" alt=""whatever"" /&gt;</code></pre><p>and instead of loading from <code>assets/ContentRoot/Photos/image.jpg</code> it's trying to load them from <code>assets/Photos/image.jpg</code>. </p><p>Why is it trying to load them from the wrong (relative) location and what can I do to correct the issue?</p>","76835","","76835","","2009-11-17 23:42:04","2012-02-19 09:45:13","WebView not loading Assets correctly","<android><webview><assets>","1","0","1","",""
"1747178","1","1750875","","2009-11-17 07:31:37","56","43433","<p>My android app has nothing to do with phone calls, but I'm seeing that when I install a debug build on my test device it requires ""Phone Calls: read phone state and identity"" permissions.  (I make no mention of this in <code>AndroidManifest.xml</code>).</p><p>I'd like to have the minimum possible permissions, and wondered if anyone knew how to get rid of this?  I commented out the part where I was logging some stuff from <code>Build.MODEL</code>, <code>Build.VERSION.*</code>, etc.  I also commented out the part where I was detecting the landscape/portrait orientation thinking that that might be the ""phone state"".  But neither of those seemed to remove that permission required.</p><p>I found this bug report: <a href=""http://code.google.com/p/android/issues/detail?id=4101"">http://code.google.com/p/android/issues/detail?id=4101</a>  but it's marked working-as-intended with a note about permissions being correct from the market but not otherwise.  Is this other people's experience?  (I'd hate to have to publish to the market just to test that out.)  Otherwise, does anyone know if there's an API I can avoid calling that will make it so my app doesn't need this permission?</p><p>Thanks!</p>","4627","","844882","","2012-03-17 08:13:38","2012-03-17 08:13:38","Android permissions: Phone Calls: read phone state and identity","<android>","2","0","26","",""
"1747196","1","6573535","","2009-11-17 07:36:48","9","19635","<p>How to align the text to top of a TextView?<br/>Equivalent Android API for Swings setInsets()?<br/>that is top of text should start be in (0,0) of TextView </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:orientation=""vertical""&gt;    &lt;TextView         android:id=""@+id/text1""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:text=""TextView""         android:textSize=""42sp""         android:paddingTop=""0px""         android:gravity=""top""&gt;    &lt;/TextView&gt; &lt;/LinearLayout&gt;</code></pre><p>I have used above snippet, however still output is not as expected <br/>Any ideas? </p>","11581","","76835","","2009-11-17 21:58:20","2014-04-01 12:30:19","How to align the text to top of TextView?","<android><layout>","5","0","8","","2009-11-17 07:36:48"
"1747310","1","","","2009-11-17 08:12:37","5","8624","<p>I am looking for a ARM processor version of Android BSP to port it for one of my experimental boards.Where can I download this?</p>","212682","","246246","","2012-05-05 22:38:06","2013-02-22 19:34:41","Sample Android BSP(Source) for ARM","<android><arm><boot><bsp>","1","0","5","",""
"1747957","1","","","2009-11-17 10:36:19","0","438","<p>currently I used a map view and placed some overlay items in them</p><p>I overiden the onTap function in ItemizedOverlay so that when user tap on the markers icons on the map, some action will perform.</p><p>However, I don't know how to know which marker is being tapped so that the related data of the item will be displayed in the screen. How can I do that?</p><p>Thanks!!!</p>","210235","","","","","2009-11-17 15:30:07","How to know which overlayitem is being tapped?","<android>","1","0","","",""
"1748453","1","","","2009-11-17 12:12:45","0","846","<p>actually i want to delete sms  from inbox as per id i am using following code</p><p>but it showing error</p><p>my code:</p><pre><code>Uri deleteUri = Uri.parse(""content://sms/"");Cursor m_cCursor=context.getContentResolver().query(deleteUri, null, null,    null, null);int m_cnum=m_cCursor.getCount();int id =m_cCursor.getInt(0);int thread_id = m_cCursor.getInt(1);</code></pre><p>the error is:</p><pre><code> 0  new java.lang.RuntimeException [2]     3  dup     4  ldc &lt;String ""Stub!""&gt; [3]     6  invokespecial java.lang.RuntimeException(java.lang.String) [4]     9  athrow      Line numbers:        [pc: 0, line: 21]      Local variable table:        [pc: 0, pc: 10] local: this index: 0 type: android.content.ContextWrapper        [pc: 0, pc: 10] local: name index: 1 type: java.lang.String        [pc: 0, pc: 10] local: mode index: 2 type: int</code></pre>","211996","","819367","","2011-12-01 15:09:47","2014-01-28 07:27:30","how i can get the each sms id in android","<android>","2","1","","",""
"1748977","1","3256305","","2009-11-17 13:43:03","206","149646","<p>I am displaying text in a textview that appears to be too long to fitinto one screen. I need to make my TextView scrollable. How can i dothat? Here is the code</p><pre><code>   final TextView tv = new TextView(this);   tv.setBackgroundResource(R.drawable.splash);   tv.setTypeface(face);   tv.setTextSize(18);   tv.setTextColor(R.color.BROWN);   tv.setGravity(Gravity.CENTER_VERTICAL| Gravity.CENTER_HORIZONTAL);   tv.setOnTouchListener(new OnTouchListener(){           public boolean onTouch(View v, MotionEvent e)           {                   Random r = new Random();                   int i = r.nextInt(101);                   if (e.getAction() == e.ACTION_DOWN)                   {                           tv.setText(tips[i]);                           tv.setBackgroundResource(R.drawable.inner);                   }           return true;           }   });   setContentView(tv);</code></pre>","2355649","","182895","","2011-04-09 22:44:38","2014-01-06 09:45:34","Making TextView Scrollable in Android","<android><scroll><textview>","14","2","109","",""
"1749263","1","1749341","","2009-11-17 14:27:55","0","333","<p>Next year there will be Android programming classes on Wroclaw University (Poland) but handsets for excersises needs to be choosen now. I was thinking about HTC Hero because:</p><ul><li>as HTC device it is a reference model for Android ecosystem;</li><li>it will run system version 2.0;</li><li>it has fair features/price ratio.</li></ul><p>Are there any arguments against Hero? Or maybe there is another handset more suitable for programming classes? </p>","7162","","1228","","2013-08-23 15:23:06","2013-08-23 15:23:06","Which handset for university Android programming classes?","<android><htc-hero><handset>","5","4","1","2013-08-23 17:12:49",""
"1750927","1","","","2009-11-17 18:43:57","2","166","<p>I have a CLIQ 1.5 and a Droid 2.0 each wired to my PC via USB.  I have written an application that simply reads contacts from the device (not some linked account) and they show up fine on the CLIQ but an empty list appears on the Droid.  Don't tell me I need two versions of this app???  My manifest is targeting the least common denominator 1.5</p>","121678","","142162","","2011-09-25 02:47:19","2011-09-25 02:47:19","Is Android 2.0 backward compatible","<android>","1","0","","",""
"1750959","1","13855005","","2009-11-17 18:50:06","7","6852","<p>I have 3 Activities that my user continuously is looping through. When user is back to the main screen I need to terminate previous history so user cannot hit back button and end up on screen #2, what would be a good way to do something like that? BTW - I'm using 1.6 (API level 4)</p><p>To reiterate - say I don't know or predict the path which leads me to the original view. But once I load it I want to clear history that led user to that view. In 2.0 it's possible with overwriting Activity#onBackPressed but I need something like that in 1.6</p>","135946","","135946","","2009-11-18 20:58:33","2012-12-13 07:27:45","Android - clear history when navigating between Activities","<android><history><activity>","2","0","2","",""
"1751328","1","","","2009-11-17 19:54:42","2","2833","<p>I would love to use the Web Inspector development tools that come with webkit on a mobile browser.  Does anyone know if it is possible to enable web inspector on say the Android web browser ??</p>","70711","","","","","2012-05-18 12:30:02","Is it possible to enable the WebKit JavaScript Inspector in mobile web browsers?","<android><webkit><web-inspector>","5","0","0","",""
"1751553","1","","","2009-11-17 20:30:10","3","2096","<p>I'm scaling markers on a MapView with the following code</p><pre><code>OverlayItem oi = new OverlayItem(point,""Title"", ""Desc"");oi.setMarker(getCustomMarker(0.5f, 0.5f));itemizedOverlay.addOverlay(oi);</code></pre><p>and:</p><pre><code>private BitmapDrawable getCustomMarker(float scaleWidth, float scaleHeight){    int width = originalMarker.getWidth();    int height = originalMarker.getHeight();    Matrix matrix = new Matrix();    matrix.postScale(scaleWidth, scaleHeight);    Bitmap bitmap = Bitmap.createBitmap(originalMarker, 0, 0, width, height, matrix, true);    BitmapDrawable bm = new BitmapDrawable(bitmap);    bm.setBounds(0,0,bitmap.getWidth(),bitmap.getHeight());    return bm;}</code></pre><p>which works, but the shadow below the marker has wrong offset when scaled. Also; i override the <code>public boolean onTap(int index)</code> in ItemizedOverlay to detect taps on the markers, but it seems inaccurate. I can click some range outside the marker and still trigger onTap...</p>","76799","","","","","2010-08-19 07:32:36","How to scale markers on Android, and set shadow and onTap correctly","<java><android><google-maps>","1","0","2","",""
"1753470","1","","","2009-11-18 03:35:14","0","377","<p>In the following code, these lines:</p><pre><code>score.setText(shops[i].getScore());</code></pre><p>and <code>icon.setImageResource(R.drawable.test1);</code></p><p>the app keep throws the <code>Resources.NotFoundException.</code> I checked the XML file, all the ids are defined and they are all in the <code>R.java.</code> So I really don't know why the app throw this exception. Could anyone help me on this problem? Thank you very much!!!</p><pre><code>    try{    TextView name= (TextView)findViewById(R.id.name);    TextView description = (TextView)findViewById(R.id.description);    TextView score = (TextView)findViewById(R.id.score);    ImageView icon = (ImageView)findViewById(R.id.icon);    name.setText(shops[i].getName());    description.setText(shops[i].getDescription());    score.setText(shops[i].getScore());    UrlImage urlImage = new UrlImage(context,shops[i].getIconUrl());    Drawable drawable = urlImage.getDrawable(context);    if(drawable!=null){        icon.setImageDrawable(urlImage.getDrawable(context));    }else{        icon.setImageResource(R.drawable.test1);    }    }catch(NotFoundException e){         Toast.makeText(walkstreet.this,                 ""marker""+i,                 Toast.LENGTH_SHORT).show();    }</code></pre>","210235","","1553563","","2012-12-10 06:57:45","2012-12-10 06:57:45","Why keep throws Rescources.NotFoundException?","<android><resources>","3","0","","",""
"1754162","1","1931633","","2009-11-18 07:08:18","47","17752","<p>Is it possible to write the code/compile Android application on one machine and debug it remotely on the emulator launched on another? I'm sick and tired of the emulator constantly eating half of my laptop's CPU.</p>","71743","","71743","","2011-02-09 22:02:25","2013-09-19 07:31:24","Remote debugging with Android emulator","<android><android-emulator>","9","0","32","",""
"1754713","1","1836087","","2009-11-18 09:23:51","7","9273","<p>I know that the SMS content provider is not part of the public API (at least not documented), but if I understand correctly it's still possible to use many of the SMS features as long as you know how to use the API(?).</p><p>E.g it's pretty straightforward to insert an SMS into your inbox:</p><pre><code> ContentValues values = new ContentValues(); values.put(""address"", ""+457014921911"");  contentResolver.insert(Uri.parse(""content://sms""), values);</code></pre><p>Unfortunately this does not trigger the standard ""new-SMS-in-your-inbox"" notification. Is it possible to trigger this manually? </p><p><strong>Edit</strong>: AFAIK the ""standard mail application (Messaging)"" in Android is listening for incoming SMSes using the android.permission.RECEIVE_SMS permission. And then, when a new SMS has arrived, a status bar notification is inserted with a ""special"" notification id.So one solution to my problem (stated above) could be to find, and send the correct broadcast intent; something like ""NEW SMS HAS ARRIVED""-intent.</p><p><strong>Edit</strong>: Downloaded a third party messaging application (<a href=""http://www.chompsms.com/"" rel=""nofollow"">chompsms</a>) from Android market. This application satisfies my needs better. When i execute the code above the chompsms notice the new sms and shows the ""standard status bar notification"". So I would say that the standard Android Messaging application is not detecting sms properly? Or am I wrong?</p>","148909","","148909","","2009-12-04 13:28:37","2013-04-05 10:15:37","Android SMS API","<java><android>","3","0","5","",""
"1754714","1","1754743","","2009-11-18 09:23:55","16","23403","<p>I get the impression that Android supports reflection. But does it really? How sensible would it be to rely on reflection heavily? What's the penalty?</p>","136476","","","","","2013-09-19 10:13:33","Android and reflection","<android>","5","0","7","",""
"1755546","1","","","2009-11-18 12:03:57","0","1943","<p>we are designing the page and we need to change background image dynamically.</p><p>Is there any way to load(or change) android application background image dynamically?</p><p>help me from come out this problem?</p>","212809","","520372","","2012-03-14 15:45:28","2012-04-28 06:05:06","How to change the Backgroung Image Dynamically according to my spinner selection in Android ?","<android>","1","0","","",""
"1755860","1","1766899","","2009-11-18 13:11:11","10","5291","<p>I am a new comer in Android development, I have downloaded and installed the Android SDK, but not find any GUI or Form designer, can any one know about some Form designer in for Android, Thanks in advance.</p>","203207","","","","","2011-01-27 11:40:43","Is there any form designer available for Google Android","<java><android>","4","0","6","",""
"1756034","1","1756067","","2009-11-18 13:39:37","4","11443","<p>Android empty list layout</p><p>Whatever I do, I can't get the empty tag to display. Inside my tabs, I've got:</p><pre><code>&lt;LinearLayoutandroid:id=""@+id/thisParticularTab""android:orientation=""vertical""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;TextView android:id=""@+id/LastUpdated""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:text=""List last updated: N/A"" /&gt;&lt;ListView android:id=""@+id/mySpecialListView""android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" /&gt;&lt;Button id=""@android:id/empty""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:text=""Click to fill the list"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>However despite my ListView being empty (no items are displayed, and the database table being read from is empty), the button is not displayed. Any ideas?</p><p>Also, when it appears, will I be able to refer to R.id.empty? Does this really mean I can only have 1 ListView/empty per activity? My understanding is that 'id' is used to define UI define; how can I give it a name and also assign it as the empty View within the XML? (I'd prefer not to use setEmptyView())</p>","202807","","306405","","2010-07-14 22:24:41","2010-07-14 22:24:41","Android empty list layout","<android><gui><listview><user-interface>","2","1","2","",""
"1756296","1","","","2009-11-18 14:17:35","43","64219","<p>I'm Trying to Write Logs to Custom Log.txt File on Android File using this code of Mine but then this method creates file but contains nothing. Basically I want to read previous contents of the file and then append my data with the existing content. </p><p>The Code is as follows :</p><pre><code>public static void write(String str)     {        InputStream fileInputStream = null;        FileOutputStream fileOutpurStream = null;        try        {             fileInputStream = new FileInputStream(file);            fileOutpurStream = new FileOutputStream(file);            if(file.exists())            {                int ch = 0;                int current = 0;                StringBuffer buffer = new StringBuffer();                while((ch = fileInputStream.read()) != -1)                {                    buffer.append((char) ch);                    current++;                }                byte data[]=new byte[(int)file.length()];                fileInputStream.read(data);                   fileOutpurStream.write(data);                fileOutpurStream.write(str.getBytes(),0,str.getBytes().length);                fileOutpurStream.flush();            }             else            {                   file.createNewFile();                fileOutpurStream.write(str.getBytes(),0,str.getBytes().length);                fileOutpurStream.flush();            }        }        catch(Exception e)        {            e.printStackTrace();        }        finally        {            try            {                fileInputStream.close();                fileOutpurStream.flush();                fileOutpurStream.close();                fileOutpurStream = null;                fileInputStream = null;            }            catch (IOException e)            {                // TODO Auto-generated catch block                e.printStackTrace();            }        }</code></pre>","92039","","281545","","2013-04-27 13:29:16","2014-02-06 07:26:16","Android Writing Logs to text File","<android>","6","0","18","",""
"1756457","1","1757038","","2009-11-18 14:39:26","4","262","<p>These days everyone who worked in mobile software talks about Android and iPhone.I just wonder what is missing part from Java ME compared to these mobile software platforms.</p><ul><li>Open application store?</li><li>Rich APIs?</li><li>Compatibility?</li><li>Big company support?</li></ul><p>...</p><p>Do you have any idea on it? How Sun (or Oracle) can strengthen Java ME?</p>","212862","","77538","","2009-11-18 14:58:56","2010-01-29 14:12:04","How to strengthen Java ME eco-system","<iphone><android><java-me>","4","0","2","",""
"1756727","1","4274669","","2009-11-18 15:20:15","12","8204","<p>I've read some articles on the web and some questions on StackOverFlow, but no one seems to have a definite answer over a) If google uses Long Lived TCP connections for Gmail, Mail etc, and b) If using it in a custom app will drain battery life , and if so roughly how much?</p>","117691","","","","","2010-11-25 07:36:44","Long Lived Persistent TCP Connection on the Android","<android><tcp><persistent>","3","2","7","",""
"1757643","1","","","2009-11-18 17:20:32","4","1904","<p>I am rendering an <code>EditText</code> as one element of a list-style <code>AlertDialog</code> (which is backed by the default <code>ListView</code> implementation). I sort of expected that this circumstance would not change the behavior of EditText, but it does: a click on the EditText does not spawn the soft keyboard anymore.</p><p>After an hour of messing around with focus settings and click handlers I got fed up and debugged into <code>InputMethodManager.showSoftInput()</code>, and found this:</p><pre><code>    public boolean showSoftInput(View view, int flags,        ResultReceiver resultReceiver) {        ...        if (mServedView != view &amp;&amp; (mServedView == null                || !mServedView.checkInputConnectionProxy(view))) {            return false;        }        ...    }}</code></pre><p>The problem here is that <code>mServedView</code> is the ListView that's backing the dialog, while <code>view</code> is the EditText, and <code>ListView.checkInputConnectionProxy()</code> does simply <code>return false</code> in the default implementation of ListView (to be overridden by subclasses).</p><p>Worse, I couldn't find a way to set a custom ListView which allows proxying IME requests; <code>AlertDialog.Builder.setView()</code> accepts a custom ListView, but this is not the ListView that InputMethodManager sees.</p><p>Any suggestions how to solve this?</p>","127013","","759866","","2013-12-29 14:36:00","2013-12-29 14:36:00","Any painless way to trigger the soft keyboard for EditText in dialogs?","<android><dialog>","2","0","2","",""
"1757800","1","1757831","","2009-11-18 17:44:37","1","279","<p>Looking for write once deploy across multiple platforms, is there such a thing? Also looking for an tools that would help speed up mobile development, OSX/Linux based preferred.</p>","93966","","918414","","2013-03-16 03:14:59","2013-03-16 03:14:59","What are the latest tools for mobile development - iPhone/Android/etc","<android><iphone><mobile><devtools>","1","0","","",""
"1757990","1","","","2009-11-18 18:13:27","1","306","<p>I have a layout xml file which includes another smaller xml file.</p><pre><code>&lt;include layout=""@layout/text"" android:id=""@+id/test1""/&gt;&lt;include layout=""@layout/text"" android:id=""@+id/test2""/&gt;</code></pre><p>where my text.xml is </p><pre><code>&lt;merge xmlns:android=""http://schemas.android.com/apk/res/android""&gt;        &lt;TextView android:id=""@android:id/text1""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:textAppearance=""?android:attr/textAppearanceLarge""        /&gt;&lt;/merge&gt;</code></pre><p>My question is how can I specify different text view in my text view in test1 and test2 in my layout xml file? Or I have to do that in my java code?</p><p>Thank you.</p>","125440","","","","","2014-02-02 22:52:37","How to specify text view when I use include in my layout xml file","<android>","1","2","1","",""
"1759099","1","","","2009-11-18 21:07:55","21","7007","<p>In my layout xml file, I have included other layout xml file (eachwith a different android id).</p><pre><code>&lt;include layout=""@layout/view_contact_name"" android:id=""+id/test1""/&gt;&lt;include layout=""@layout/view_contact_name"" android:id=""+id/test2""/&gt;</code></pre><p>But when I run it in the emulator, and start Hierarchy Viewer, each ofthe layout still shows 'NO_ID', and in my code, I have<code>findViewById(R.id.test1)</code> and <code>findViewById(R.id.test2)</code> both returns null.</p><p>Can anyone please help me with my problem ?</p>","128983","","996493","","2012-04-01 13:42:36","2014-01-13 08:57:49","How to specify id when uses include in layout xml file","<android>","4","0","6","",""
"1759183","1","","","2009-11-18 21:24:03","1","1264","<p>Let's say that I have Microsoft Media Server stream (i.e. mms://[some ip address here]).  This stream contains both audio and video. Is it possible to stream this to an Android phone?  How would I go about doing this?  Preferably with video, but if it is an audio stream only that would also be okay.</p>","396","","396","","2009-11-19 21:53:58","2010-04-09 10:00:04","Is it possible to stream to an Android phone with Microsoft Media Server?","<android><microsoft><stream><multimedia>","2","0","","",""
"1759298","1","1759647","","2009-11-18 21:45:34","0","2712","<p>Firstly, I have found many examples of how to grab data from a db and place it into a list, however this seems to be all for ListActivites.</p><p>My list is part of the UI and therefore I can't use a ListActivity because it does not consume the whole screen (or can I?).</p><p>This is the UI:</p><pre><code>&lt;SlidingDrawer android:layout_width=""wrap_content""  android:layout_height=""wrap_content""    android:id=""@+id/Drawer""  android:orientation=""vertical""  android:handle=""@+id/handle""    android:content=""@+id/content""&gt;&lt;ImageViewandroid:id=""@id/handle""android:src=""@drawable/tray_handle_normal""android:layout_height=""wrap_content"" android:layout_width=""wrap_content""/&gt;&lt;RelativeLayout android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@id/content"" android:background=""@color/black""&gt;&lt;ListView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/List""&gt;&lt;/ListView&gt;&lt;/RelativeLayout&gt;</code></pre><p></p><p>So, from what ive read I need to grab the data from the db, then place it into some sort of array then use an array adapter to fill the list view. Is that correct? If so, is there some sample code because all I can find is code releated to ListActivites.</p>","122547","","","","","2009-11-18 22:34:52","Android: SQLite and ListViews","<database><android><sqlite><listview>","2","0","","",""
"1759626","1","1811665","","2009-11-18 22:30:23","56","32090","<p>We are building a complex Android application consisting of many screens and workflows spread across many Activities. Our workflows are similar to what you might see on a Bank's ATM machine, for example, there is an <code>Activity</code> to login in that transitions to a main menu <code>Activity</code> which can transition to other activities based on the user's choices.</p><p>Since we have so many workflows we need to create automated tests that span multiple activities so we can test a workflow from end to end. For example, using the ATM example, we would want to enter a valid PIN, verify that sends us to the main menu, choose withdraw cash, verify that we are on the withdraw cash screen, etc., etc., and eventually find ourselves back on the main menu or ""logged"" out.</p><p>We've toyed with the test APIs that come with Android (e.g. <code>ActivityInstrumentationTestCase2</code>) and also with <a href=""http://code.google.com/p/autoandroid/"">Positron</a>, but neither seem capable of testing beyond the bounds of a single <code>Activity</code>, and while we can find some utility in these tools for some unit testing, they won't meet our needs for testing scenarios that cut across multiple Activities.</p><p>We are open to an xUnit framework, scripting, GUI recorders/playbacks, etc. and would appreciate any advice.</p>","168212","","477415","","2012-04-04 15:53:16","2014-03-12 14:23:56","How do you test an Android application across multiple Activities?","<android><automated-tests><integration-testing><android-testing>","12","2","38","",""
"1759862","1","1760186","","2009-11-18 23:28:37","8","19938","<p>I've created a layout.xml file with the following XML, but I can't get the MediaController to appear at all.</p><pre><code>&lt;MediaController android:id=""@+id/media_controller""    android:layout_width=""fill_parent""    android:layout_height=""200px""    android:visibility=""visible""/&gt;</code></pre><p>In code, I can obtain a reference to it from code, call show(), etc, but it never appears.</p><p>I have noticed in the android dev documentation (<a href=""http://developer.android.com/reference/android/widget/MediaController.html"">MediaController.html</a>) that it states, ""The way to use this class is to instantiate it programatically."", so maybe I'm a dufus and just need to do something differently such as not do what I'm doing.  :)</p><p>I CAN get it to appear if I do it programmatically, but I need it to always appear on the screen.  Am I just being stupid, or is it just not meant to be inflated via XML?</p>","7888","","","","","2013-12-10 19:19:22","How can I get an Android MediaController to appear from layout xml?","<android>","7","0","7","",""
"1759981","1","","","2009-11-18 23:57:03","5","2073","<p>How to open the email application from my app. I want to launch directly the compose email screen with the email id that the user should email to. I want to do something similar to what happens on a pc. If you click on an email address, system will automatically opens the email client with the compose screen. The compose screen will ofcourse contain the email id.</p>","214201","","","","","2012-12-04 20:58:46","Open Email application from my application","<android>","3","0","0","",""
"1760107","1","","","2009-11-19 00:25:54","1","4097","<p>As a simple test I'm trying to have a broadcastReceiver that will notify the user with a Toast message that an hardware button was clicked in android.</p><p>I've created a receiver tag in my manifest file with a name .TestReceiver that listens to Action_CALL_BUTTON to be informed when the user clicks on the green SEND button:</p><pre><code>&lt;receiver android:name="".TestReceiver"" &gt;    &lt;intent-filter&gt;                     &lt;action android:name=""android.intent.action.ACTION_CALL_BUTTON"" /&gt;    &lt;/intent-filter&gt;            &lt;/receiver&gt;</code></pre><p>Next, I created the TestReceiver class that extends BroadcastReceiver and creates a Toast.When I click on the call button I don't see the Toast message but I tested it on an activity and it shows.What am I missing here?</p><pre><code>package com.example.helloandroid;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.widget.Toast;public class TestReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {    	// TODO Auto-generated method stub    	CharSequence text = ""Hello toast!"";    	int duration = Toast.LENGTH_SHORT;    	Toast toast = Toast.makeText(context, text, duration);    	toast.show();    }}</code></pre><p>Thanks</p>","214211","","","","","2012-04-01 13:39:09","Listen to hardware button click event in android","<android><broadcastreceiver>","2","0","1","",""
"1760383","1","1856960","","2009-11-19 01:40:08","2","3272","<p>I recently got some fade in stuff working so that my ""loading"" view is an ImageView that takes up the whole screen, and then I fade in the main view (a GridView in this case) over the top of it.  In the activity creation, I call:</p><pre><code>setContentView( R.layout.loading_foo );</code></pre><p>then when the loading AsyncTask is done, I call the following:</p><pre><code>LayoutInflater inflater = LayoutInflater.from( getApplicationContext() );GridView gridview = (GridView) inflater.inflate( R.layout.foo, null );//fade in the view as it's showngridview.setAnimation( AnimationUtils.loadAnimation( this, R.anim.fade_in ) );//populate the items adaptergridview.setAdapter( new FooGridAdapter( apps ) );//now overlay the gridview on top of the loading_springboard pageViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT );getWindow().addContentView( gridview, layoutParams );</code></pre><p>Do I need to do anything in particular to clean up the loading_foo view to reduce the amount of memory my app is using?  Any other issues with this approach?</p><p>(Long time reader, first time poster)</p>","214240","","","","","2009-12-06 23:11:29","Android: Cleanup of hidden view when using Window.addContentView?","<android>","1","0","1","",""
"1760433","1","","","2009-11-19 01:56:37","2","1392","<p>The camera button on the android emulator is disabled.I can't click on it and when I hover with the mouse the background is not blue like in the other buttons.I've tried to add ""camera support - true"" hardware but the button is still un-clickable.</p><p>How can I click on the button?What should happen when clicking on the button? I don't have an real android device so I might be able to click on the button without knowing it.</p><p>Thanks</p>","214251","","","","","2010-11-03 05:44:23","CLicking on the camera button in the android emulator","<android><camera><emulator>","1","0","1","",""
"1761107","1","","","2009-11-19 05:34:36","2","3030","<p>Is there any way to load PDF file from Asset/URL in Browser or WebView or any other way?</p>","214339","","","","","2013-02-22 10:41:31","Android : How to Load PDF?","<android><pdf>","2","0","2","",""
"1761246","1","","","2009-11-19 06:19:09","3","5118","<p>I would like to simulate a small cluster of Android devices either on one laptop (worst-case), or on several machines on a private network. This is for testing communications and process migration on Android.</p><p>Is there a safe way to identify and launch a particular emulator from a given application under Eclipse? I have a recent Eclipse/Java/ADT setup and I'm using the a variety of tutorials from Mark Murphy, Meier, and Abelson.</p><p>--Will</p>","214284","","1228","","2013-08-16 17:14:37","2013-08-16 17:14:37","Possible to safely run multiple Android emulators on the same machine and communcate using sockets?","<android><emulator><raw-sockets>","1","0","3","",""
"1763249","1","1763355","","2009-11-19 13:20:38","10","20476","<p>Currently a team of developers is working on Android application and during the development process testers already have to test the current state and report issues.</p><p>So far I have simply installed the application by connecting the tester's device on my pc and hit run in the IDE. This way we waste a lot of time if an application has to be installed on multiple devices multiple times daily.</p><p>What I would like is to send the testing team the .apk file and let them install and run the application by themselves.</p><p>Does anyone know what's the best way to do it?</p><p>Thank you!</p>","22996","","","","","2012-10-28 21:46:59","how to install unsigned android application on the device?","<android><testing><installation>","3","1","1","",""
"1765393","1","1765434","","2009-11-19 18:14:01","9","1116","<p>I have been looking over some of the android source, and the examples given in the Dev guide, and I notice that many of their classes begin with the letter m, as in the example below:</p><pre><code>    // Create an anonymous implementation of OnClickListenerprivate OnClickListener mCorkyListener = new OnClickListener() {    public void onClick(View v) {      // do something when the button is clicked    }};</code></pre><p>From this page: <a href=""http://developer.android.com/guide/topics/ui/ui-events.html"">http://developer.android.com/guide/topics/ui/ui-events.html</a></p><p>What does the m signify?</p>","980655","","","","","2013-02-12 21:48:14","Why do many android classes (examples and source) begin with ""m""?","<android>","2","2","","",""
"1765718","1","1793339","","2009-11-19 18:59:22","0","566","<p>I get this exception triggered by users occasionally that I cannot reproduce. Since it's issued from looper I suppose it is result of Handler-type callback. I found <a href=""http://code.google.com/p/android/issues/detail?id=3355"" rel=""nofollow"">similar bug</a> on Google code but putting the solution into code didn't solve it. The problem is at this line of <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/webkit/BrowserFrame.java;hb=cf4550c3198d6b3d92cdc52707fe70d7cc0caa9f"" rel=""nofollow"">code in BrowserFrame</a>: </p><pre><code>WebAddress uri = new WebAddress(    mCallbackProxy.getBackForwardList().getCurrentItem()   .getUrl());</code></pre><p>Which throws this Exception because I suppose mCallbackProxy is null</p><pre><code>java.lang.NullPointerExceptionat android.webkit.BrowserFrame.handleMessage(BrowserFrame.java:348)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:471)at java.lang.Thread.run(Thread.java:1060)</code></pre><p>And the questions are - will this forclose the app? And how do I work around this bug?</p>","135946","","540162","","2011-10-08 18:21:35","2011-10-08 18:21:35","Android - NPE in BrowserFrame","<android><nullpointerexception>","1","0","","",""
"1765892","1","","","2009-11-19 19:26:03","18","9069","<p>I'm using SeekBar as a slider because I can't find anything else, but I have to do so much hacky work because it doesn't allow me to set a minimum value or go in between ints.  So, any time I need a slider to start at a value other than 0 or return a floating point number, I have to set a max value that doesn't describe the true max value of the control and then divide and/or add/subtract the ""progress"" value when I read it.  Before I finish writing an entire class just to handle converting my slider values, is there a better way?  I'm using Android 1.6...is there a slider control in 2.0 or any other documented future release?</p>","53501","","","","","2011-05-12 07:32:12","Slider control in Android...is SeekBar really my best/only option?","<java><android><user-interface><slider><seekbar>","1","2","1","",""
"1765932","1","","","2009-11-19 19:31:20","1","1288","<p>I have a layout which has a button and follow by a ListView. The problem I have with this is when the button has focus (background is orange), and I press DOWN in my keyboard, the first  row of the ListView does not have a focus.</p><pre><code>     &lt;LinearLayout            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""&gt;            &lt;ImageButton android:id=""@+id/button"" style=""@android:style/Button""/&gt;    &lt;/LinearLayout&gt;    &lt;ListView android:id=""@+id/action_list""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""        /&gt;</code></pre><p>This is the layout of each row in the ListView:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:focusable=""true""&gt;&lt;TextView android:id=""@+id/text1""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>I have tried using the 'android:nextFocusDown' attribute, but that does not help my problem:       </p><pre><code>            &lt;ImageButton android:id=""@+id/button"" style=""@android:style/Button""/&gt;    &lt;/LinearLayout&gt;    &lt;ListView android:id=""@+id/action_list""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:nextFocusUp=""@id/button""        /&gt;</code></pre><p>Any idea how to fix this focus problem? I basically want to button move focus to the first row of the ListView when I press DOWN. and the first row of the ListView move focus to the button when I press UP.</p><p>Thank you.</p>","114970","","","","","2012-10-11 09:39:48","Problem in moving focus from a button to a ListView","<android>","2","0","1","",""
"1767531","1","1767632","","2009-11-20 00:13:14","1","1721","<p>The call to <code>System.currentTimeMillis()</code>  returns always 0 on Motorola Droid, Android 2.0.There is no mentioning in changes to System in the API differences between 2.0 and 1.5, so either it was missed somehow or this is a Droid dependency.Does anyone know how to get the currentTimeMillis in a way that satisfies Android 1.5, Android 2.0, and all hardware? Best regards!</p>","192863","","750613","","2012-07-10 05:45:34","2012-07-10 05:45:34","System.currentTimeMillis() returns always 0 on Motorola Droid","<android><motorola>","1","0","","",""
"1767551","1","","","2009-11-20 00:17:36","0","813","<p>Can you please tell me why the android Contacts application theme/style is using 'dark' theme? For example, the activity's background is Black instead of White.I have looked at their Android Manifest xml file and their layout xml file (e.g. call details.xml) file, but i don't see how they specified using a 'dark' theme?</p><p>Can you please tell me how do they do that? I have looked at <a href=""http://developer.android.com/guide/topics/ui/themes.html"" rel=""nofollow"">http://developer.android.com/guide/topics/ui/themes.html</a>, but I don't see Contacts app is doing that.</p><p>Thank you for any help.</p>","125440","","","","","2009-11-20 00:44:25","Android Contacts application theme/style","<android>","1","0","","",""
"1767811","1","1767926","","2009-11-20 01:42:51","1","307","<p>A user of my Android App reported that he was seeing tiny text. How is this possible? More importantly, how can I use the emulator to be sure that my changes will fix it?</p><p>Background:</p><p>This user has a Motorola DROID phone, which has a different screen resolution and maybe other slight differences.</p><p>I assume that the problem was I didn't test using the right screen size. However, I followed the instructions here and tested a larger screen and the text was fine. <a href=""http://developer.motorola.com/docstools/library/Support%5Ffor%5FMultiple%5FScreen%5FResolutions/"" rel=""nofollow"">http://developer.motorola.com/docstools/library/Support%5Ffor%5FMultiple%5FScreen%5FResolutions/</a></p><p>I know my app has fixed pixel heights like this: android:layout_height=""64px"" and I use text side parameters like: android:textSize=""14sp"" or android:textSize=""12pt""</p>","108495","","","","","2010-01-08 10:47:11","How come a user reported tiny text on a Motorola DROID android-based phone?","<android><motorola>","1","0","1","",""
"1768097","1","","","2009-11-20 03:13:27","5","15178","<p>would like to add a zoom control to the map. I also want to layout the position of the zoom Control instead of the default middle bottom position. I can do this by getZoomControl but it is deprecated.</p><p>Could anyone tell me how to do this with <code>setBuildtInZoomControls</code>?</p>","210235","","750613","","2012-07-10 05:45:09","2012-12-12 15:55:37","How to layout zoom Control with setBuiltInZoomControls(true)?","<android><android-mapview>","6","0","4","",""
"1768391","1","1800267","","2009-11-20 04:44:45","14","20661","<p>I'm trying to do something after scrolling stopped.So, I tried using <code>OnScrollListener#onScrollStateChanged(SCROLL_STATE_IDLE)</code> to detect when the scrolling stopped(either <code>TOUCH_SCROLL or FLING</code>)(at 1.5 it's runs as i expect).But when it runs on 2.0, onScrollStateChanged can't received the event after releasing the finger.Is there any callback or anyway to detect that event? </p>","111887","","750613","","2012-07-10 05:44:43","2012-07-10 05:44:43","how to detect Android ListView Scrolling stopped?","<android><listview><scrolling>","2","1","8","",""
"1769370","1","","","2009-11-20 09:37:08","2","1721","<p>I am working on theme-ing my android app. After I went through 'Styles and Themes' in Android SDK and this <a href=""http://brainflush.wordpress.com/2009/03/15/understanding-android-themes-and-styles/"" rel=""nofollow"">article</a>, I am still left with one question. </p><p>Simply put, how can I use android:textSize to be 14 dip for one TextView, while 18 dip for another TextView, inside a Theme?</p><p>I know how to do this with styles. I can define two different styles and make the two different TextViews to use those styles.</p><p>What I find difficult is how to do this with Theme. A theme lets me define let's say android:textSize, but then it's applicable to all the TextView s in all the layouts of the Activity. </p><p>Any idea how to do that?</p><p>Thanks.</p>","174527","","","","","2010-09-09 21:56:08","Android theme customization","<android><themes><styles>","1","3","1","",""
"1770263","1","1770783","","2009-11-20 12:53:34","1","525","<p>I'm working on an application that got an activity that is set to have intent filter </p><pre><code>&lt;intent-filter&gt;   &lt;action android:name=""android.intent.action.RINGTONE_PICKER""/&gt;   &lt;category android:name=""android.intent.category.DEFAULT""/&gt;&lt;/intent-filter&gt;</code></pre><p>This works fine when im testing with a HTC Magic phone, when I go to settings -> set ringtone, i get to choose from my app or the built in ringtone picker... But on Hero it goes directly to the build in picker...</p><p>Anyone got any idea on what the problem could be?</p>","133858","","1244610","","2014-01-19 11:50:23","2014-01-19 11:50:23","Android Intent-filter working for Magic, but no Hero, what could be the issue?","<android><android-intent><android-manifest>","1","1","2","",""
"1770772","1","1771252","","2009-11-20 14:27:24","2","6186","<p>Anyone knows how to change notification sound by code in android.I have managed to set the default ringtone, but cant find a way to set the notification tone...</p><p>I would be thankful for any response, as code example, psudo code or just name of a which part of the sdk i need to use...</p>","133858","","","","","2012-07-05 16:03:40","How to change notification sound by code in android?","<android><notifications>","4","0","1","",""
"1772172","1","","","2009-11-20 17:47:54","0","840","<p>I'm targeting Android 1.5 - I'd like to use the ScrollView widget, but there's a hard-coded value within the class which makes it kind of unusable for my purposes (it's the ""touch slop"" value - set to 16 - the amount of movement the user has to make with their finger before considering the gesture a scroll - I think this should ideally be cut in half!).</p><p>Anyway, I could grab the source of ScrollView, paste it into my project, and then tweak that one static field, then rename the class MyScrollView. But where is the 'official' source code for Android living, specifically for 1.5? I grabbed the ScrollView code from here as a test:</p><p><a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=core/java/android/view;h=398e94d99129fca8fa32145de2fbf8c348253bcf;hb=HEAD"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=core/java/android/view;h=398e94d99129fca8fa32145de2fbf8c348253bcf;hb=HEAD</a></p><p>but not sure if this is the right place to get it.</p><p>Thanks</p>","185329","","648313","","2011-07-18 21:58:17","2011-07-18 21:58:17","Where to get Android 1.5 source?","<android><android-source>","1","4","","",""
"1772584","1","2144007","","2009-11-20 18:59:51","1","2143","<p>Given ...  </p><ul><li>An Activity that extends from MapActivity</li><li>Uses ItemizedOverlay to show some balloons on the map</li><li>ZoomControls are enabled</li></ul><p>The ItemizeOverlay implements <code>onTap(...)</code> which works perfectly ok when tapping one of the overlay items.</p><p>The question is: How to identify a tap on another part of the map (with the intention of getting the location and center'ing on that point)</p>","208689","","102703","","2010-01-27 01:46:22","2010-01-27 01:46:22","How to capture location from MapActivity","<android><android-mapview>","1","0","","",""
"1772695","1","1773084","","2009-11-20 19:21:35","5","2451","<p>I tried this code which I found here:</p><pre><code>Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(""mailto"", ""testemail@gmail.com"", null)); startActivity(intent);</code></pre><p>But I get a message on the screen which reads ""Unsupported Action"". Any ideas of how to get this working?</p><p>Thanks!</p>","215723","","","","","2012-01-11 21:31:54","How do I launch the email app with the ""to"" field pre-filled?","<android><email><activity><android-intent>","2","0","2","",""
"1773717","1","","","2009-11-20 22:51:03","8","5475","<p>Is there a way through the android maps API, where I can detect the map center after pan animation has completed? I want to use this information to load markers from a server dynamically.ThanksBD</p>","203181","","","","","2011-09-19 17:07:58","android maps: how to determine map center after a drag has been completed","<android><maps><markers>","2","0","5","",""
"1774750","1","1780664","","2009-11-21 06:46:21","0","678","<p>and thanks for helping.In my previous question I asked if System.currentTimeMillis() was buggy in Droid, and the answer was no. </p><p>I assume the problem I'm having is somewhere else. While I wait for my Droid lone-user to report if a test app works on his phone, I would like to post some relevant code here. </p><p><em>Please keep in mind that I removed everything in the code I thought would be irrelevant (posting the code leading to the first suspicious line in the log). I might have removed the code where the problem is, but I doubt it. It smells like a layout, not code,  problem. I say this because (see last line, where the log is) the surface is 0.</em></p><p>Best regards, Ari.</p><p><strong>MANIFEST</strong></p><pre><code>&lt;uses-permission android:name=""android.permission.CAMERA"" /&gt;&lt;uses-permission android:name=""android.permission.RECORD_AUDIO"" /&gt;&lt;uses-feature android:name=""android.hardware.camera"" /&gt;&lt;uses-feature android:name=""android.hardware.camera.autofocus"" /&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;	&lt;activity android:name="".BeMeBB"" android:label=""@string/app_name""		android:screenOrientation=""landscape""&gt;		&lt;intent-filter&gt;			&lt;action android:name=""android.intent.action.MAIN"" /&gt;			&lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;		&lt;/intent-filter&gt;	&lt;/activity&gt;	&lt;activity android:name=""BeMeBBPref"" android:label=""@string/app_name""&gt;	&lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""5"" /&gt;&lt;supports-screens&gt;&lt;/supports-screens&gt;</code></pre><p><strong>LAYOUT</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""	android:paddingTop=""0pt"" android:orientation=""vertical""	android:layout_width=""fill_parent"" android:layout_height=""fill_parent""	android:gravity=""bottom"" android:background=""#00000001""&gt;	&lt;android.view.SurfaceView android:id=""@+id/preview_LAND""		android:layout_width=""fill_parent"" android:layout_height=""fill_parent""		android:keepScreenOn=""true"" android:layout_margin=""0pt""&gt;	&lt;/android.view.SurfaceView&gt;	&lt;LinearLayout android:orientation=""vertical""		android:layout_width=""fill_parent"" android:layout_height=""fill_parent""		android:layout_weight=""1""&gt;		&lt;TextView android:id=""@+id/ACCELERATION_LINE"" android:text=""0  2  4  6  8  10 12 14 16 18 20  ""			android:layout_width=""wrap_content"" android:layout_height=""wrap_content""			android:typeface=""monospace"" android:layout_weight=""0""			android:textSize=""20dp"" android:textStyle=""bold"" android:textColor=""@color/white""			android:layout_gravity=""center_horizontal"" android:paddingTop=""0dp""			android:paddingLeft=""0dp"" android:background=""#66000000"" /&gt;		&lt;TextView android:id=""@+id/ACCELERATION"" android:text=""@string/Accelerometers""			android:layout_width=""wrap_content"" android:layout_height=""wrap_content""			android:typeface=""monospace"" android:textStyle=""bold""			android:layout_weight=""0"" android:textSize=""20dp"" android:textColor=""@color/white""			android:layout_gravity=""center_horizontal|top"" android:paddingLeft=""0dp""			android:background=""#66000000"" /&gt;		&lt;LinearLayout android:orientation=""horizontal""			android:layout_width=""fill_parent"" android:layout_height=""wrap_content""			android:gravity=""bottom"" android:layout_weight=""1""&gt;			&lt;Button android:id=""@+id/SAVE_LAND"" android:text=""@string/Save""				android:layout_width=""wrap_content"" android:gravity=""left|bottom""				android:layout_height=""wrap_content"" android:layout_weight=""0""				android:textSize=""26dp"" android:textColor=""@color/black""				android:padding=""20dp"" /&gt;		&lt;/LinearLayout&gt;	&lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p><strong>CODE</strong></p><pre><code>public class BeMeBB extends Activity implements OnClickListener, android.content.DialogInterface.OnClickListener, SensorEventListener {	private SurfaceView preview=null;	private SurfaceHolder previewHolder=null;	SurfaceHolder.Callback surfaceCallback = new SurfaceHolder.Callback() {		public void surfaceCreated(SurfaceHolder holder) {			DoRecording();				}		}; // End SurfaceHolder.Callback surfaceCallback	@Override	public void onCreate(Bundle savedInstanceState) {		super.onCreate(savedInstanceState);		requestWindowFeature(Window.FEATURE_NO_TITLE);		setContentView(R.layout.main_land);		preview=(SurfaceView)findViewById(R.id.preview_LAND);		previewHolder=preview.getHolder();		previewHolder.addCallback(surfaceCallback);		previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);	} // End OnCreate	private void DoRecording() {		m_worker.setSurfaceHolder(previewHolder);	} // End DoRecording} // End class</code></pre><p><strong>IN ANOTHER CLASS</strong></p><pre><code>public void setSurfaceHolder(SurfaceHolder previewHolder) {		m_previewHolder = previewHolder;	m_surface = m_previewHolder.getSurface();		Log.d(""BeMeBB"", ""BeMeBBWorker m_surface=""  + m_surface);} //End  setSurfaceHolder</code></pre><p><strong>AND THE RESULT IN LOG (SURFACE IS NOT VALID):</strong></p><pre><code>11-19 17:58:13.171 D/BeMeBB  ( 1404): BeMeBBService m_surface=Surface(native-token=0)</code></pre>","192863","","76835","","2009-11-21 10:01:41","2009-11-23 01:14:55","Continuation of 'app not working in Droid' investigation: the code. Can anyone see any obvious error here?","<android><surface><motorola>","1","5","","",""
"1775660","1","7318637","","2009-11-21 14:45:27","1","158","<p>I have a free and a premium version of the same app (almost same code, same classes with ""if""s here and there, different packages in the manifest, same process name in the manifest). The main activity calls a service to execute some stuff, using an IMPLICIT intent. </p><p>When I install both apps on the phone, it turns out that the premium activity actually starts a ""free"" service sometimes and a ""premium"" service another.I have been playing around with categories and the packagemanager but it seems too complicated.</p><p>Questions :   </p><ol><li>how does Android handle multiple components responding to a same Intent?  </li><li>how would you do what I am trying to do: I have the same service in multiple apps and I only want one instance being called from all the apps?</li></ol>","1663292","","114066","","2010-08-02 07:45:20","2011-09-06 10:46:29","android : how does the OS chose a component implementation when multiple implementation respond to the same intent?","<android><android-intent><intentfilter>","1","0","","",""
"1776552","1","","","2009-11-21 19:49:30","4","19633","<p>Newbie question. I'm using a SimleCursorAdapter to populate a spinner from an SQLite table, as shown in the Android dev docs:</p><pre><code>Spinner list=(Spinner)findViewById(R.id.cboModel);        SimpleCursorAdapter ModelAdapter = new SimpleCursorAdapter(this,   android.R.layout.simple_spinner_item, model,   new String[] {""Drug""},          new int[] {android.R.id.text1});ModelAdapter.setDropDownViewResource(        android.R.layout.simple_spinner_dropdown_item);list.setAdapter(ModelAdapter);list.setOnItemSelectedListener(onModelSelect);</code></pre><p>I've set up a listener, but I can't figure out how to get the selected item text, it pulls up the SQLiteCursor, not the actual text in the spinner.</p><pre><code>private AdapterView.OnItemSelectedListener     onModelSelect= new AdapterView.OnItemSelectedListener() {        public void onItemSelected(AdapterView&lt;?&gt;             parent, View view, int position, long id) {            ModelName = parent.getSelectedItem().toString();             android.util.Log.w(""OnItemSelect.cboModel"", ModelName);             }        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {            // TODO Auto-generated method stub                  }       };</code></pre><p>Google turns up the question on several message boards, but no answers, so it appears to be a common newbie question. It may be painfully obvious to some, but if you could point me in the right direction I would appreciate it. Thank you.</p>","216195","","58880","","2010-07-03 02:51:25","2012-04-23 22:46:30","Android how to get selected item from data driven spinner","<android><sqlite><spinner>","2","0","","",""
"1776588","1","","","2009-11-21 20:00:31","2","1088","<p>I would like to launch an activity at the end of a phone call.Could not find any reference to that. How can I do it?</p>","216208","","488433","","2012-10-04 07:01:02","2012-10-04 07:01:02","Launch an activity at end of a phone call on Android","<android><activity>","2","0","2","",""
"1777499","1","1777652","","2009-11-22 01:44:39","0","982","<p>I am trying to create a small pop-up in my Android application to let the user choose from one of many items, ala a ListView.  I am hoping to make it show up as a translucent box that overlays on the screen, as opposed to completely occupying it like Activities usually do.</p><p>One technique for doing this that I've heard is possible is to launch an Activity in an AlertDialog box.  This would be perfect - it's the ideal size and has a lot of the mechanical properties I'm looking for, but I'm totally unable to find any more specifics of this technique.</p><p>Is this possible?  And if not, what is the preferred way of accomplishing something like this?</p>","216316","","","","","2010-12-02 01:58:07","Is it possible to launch an Android Activity from an AlertDialog?","<android><listview><activity>","2","0","","",""
"1777670","1","","","2009-11-22 02:51:14","1","508","<p>I'm writing a program for the Android Platform and I would like to implement the code of a preexisting application found here (<a href=""http://blogoscoped.com/archive/2008-12-15-n14.html"" rel=""nofollow"">http://blogoscoped.com/archive/2008-12-15-n14.html</a>) There is a button in my application menu that says ""Show Friends on Map"" so I want this program to start from the button press.</p><p>For greater detail I will give a small diagram. </p><p>User Starts My application > User Presses ""Menu"" Key > User Presses ""Show Friends on Map"" > WAMF.apk (the application in the link above) is launched </p><p>Is there any way I can do this?</p>","216339","","","","","2009-11-28 05:01:39","Use Application within Application on Android","<android><google-maps><include>","2","0","","",""
"1778485","1","1958482","","2009-11-22 11:39:57","7","27628","<p>I'm having a little difficulties while trying to get a certain layout to work: I want to have list. List does not have to be scrollable, but should be shown completely. But the page itself should be able to scroll (with the lists in it), if the total content ist higher than the screen. </p><pre><code>&lt;ScrollView     xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     &gt;     &lt;LinearLayout         xmlns:android=""http://schemas.android.com/apk/res/android""         android:id=""@+id/linear_layout""         android:orientation=""vertical""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:layout_weight=""1""         android:background=""#ff181818""         &gt;           &lt;Textview android:id=""@+id/my_text"" text=""header contents goes here"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;           &lt;Textview android:id=""@+id/headertext"" text=""header contents goes here"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;          &lt;ListView               android:id=""@+id/my_list1""               android:layout_height=""wrap_content""               android:layout_width=""fill_parent""          /&gt;      &lt;/LinearLayout&gt; &lt;/ScrollView&gt;</code></pre><p>it only uses a small part of the screen (about 2 lines per list), instead of filling the available height, and the lists themselves can be scrolled. How can I change the layout to always show the whole lists but have the screen be scrollalbe? </p>","216431","","216074","","2011-07-10 21:48:13","2012-04-28 06:30:04","android listview display all available items without scroll with static header","<android><listview>","3","2","5","",""
"1779565","1","4818316","","2009-11-22 18:45:48","4","8165","<p>Can I use android build-in browser download manager to download files in my application? </p><p>In case of audio files, opening remote file url using Intent.ACTION_VIEW with data type ""audio/*"" causes browser to start playback, but I'd like to force download of specified file.</p>","12123","","","","","2012-10-04 09:20:59","Android browser download manager","<android><browser><download>","3","1","","",""
"1779672","1","1779678","","2009-11-22 19:18:50","5","3900","<p>In <code>ListView</code> I can change the divider image using <code>android:divider=image</code> but I want to display different divider images for different items how can I do that ?</p>","216431","","1333975","","2013-05-21 21:32:17","2013-05-21 21:32:17","Android ListView different divider images","<android><listview>","2","0","3","",""
"1781078","1","1784282","","2009-11-23 04:23:10","4","777","<p>I was wondering how everyone re-uses android layouts and components?  Do you do the old copy/paste the existing code into the project, or is there a way to include the layouts and components into a jar file for re-use?</p><p>EDIT:For example if I have a list view, maybe I have another view that I am using for each list item in the listview, it could have an icon, and maybe a header row, and then a row with more details.  While it is not hard to create this, it would be nice to be able to create this once generically and re-use it in different projects.</p>","83354","","83354","","2009-11-23 16:21:50","2009-11-23 20:53:51","Re-usable android layouts","<java><android><code-reuse>","1","1","1","",""
"1781122","1","1781174","","2009-11-23 04:39:01","3","9143","<p>We can detect code using gps, i want to detect location via wifi ???</p><p>how can i do that ? i want two threads simulataniously running one detecting locaiton using GPS another detecting using WIFI.</p>","216431","","","","","2013-01-21 14:30:27","android detect locatoin using WIFI","<android><location><wifi>","2","0","2","",""
"1781371","1","1949654","","2009-11-23 06:09:38","2","1209","<p>I'm porting an OpenGL app from the iPhone to Android, and I need torender OpenGL content to a texture. Since framebuffers are notavailable in OpenGL 1.0 and the DROID is the only Android phone with the framebuffer OpenGL extension, I'm trying to draw using OpenGL andthen copy the result into a texture using glCopyTexImage2D. However,my initial findings are not good:</p><ol><li><p>glCopyTexImage2D works in the Android emulator (OS v. 1.5), butonly with GL10.GL_RGB, not GL_RGBA. If you try to copy the alpha datafrom the scene into the texture, you just get a completely whitetexture.</p></li><li><p>glCopyTexImage2D doesn't seem to work <em>at all</em> on the Android G1.glCopyTexImage2D does not throw an UnsupportedOperationException,but after calling it the texture is completely white.</p></li></ol><p>Has anyone successfully used glCopyTexImage2D in an Android app? Ifso, could you please post a bit of the code you're using, and the devices your app is limited to? I suspect it works only with specific parameters on specific devices, if at all. Right now, I'm calling it like this:</p><pre><code>gl.glCopyTexImage2D(GL10.GL_TEXTURE_2D, 0, GL11.GL_RGBA, 0,0, 256,256, 0);</code></pre>","100363","","","","","2009-12-22 22:35:23","Android glCopyTexImage2D - Any Success?","<android><opengl-es>","1","1","1","",""
"1782480","1","","","2009-11-23 11:12:48","-3","225","<p>my activity is::</p><pre><code>package com.soft;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class TestNdk extends Activity {     TextView txtHello;    private int m_cAddValue;    private TestNdk m_cTestNDK;    private int m_cObj;    public TestNdk(int i, int j) {    	 getSum();    }    public native int getSum();    	/** Called when the activity is first created. */         @Override          public void onCreate(Bundle savedInstanceState) {              super.onCreate(savedInstanceState);     	         setContentView(R.layout.main);              txtHello = (TextView) findViewById(R.id.txtHello);              txtHello.setText(""hai this is for test"");                //public TestNdk(int i, int j) ;              m_cTestNDK = new TestNdk(20 ,30);              txtHello.setText(m_cObj);          }         static{             System.loadLibrary(""TestNDK"");            initIDs();             }      }</code></pre><p>=============================================================</p><p>my header file is ::test.h</p><pre><code>#ifndef __TEST_H__#define __TEST_H__class MyClass{private:  int   m_cFirstNum;  int   m_cSecondNum;public:  MyClass(int pNum1, int pNum2);  int getSum();  int getMult();  int getSub();  int getDiv();};#endif  //__TEST_H__</code></pre><p>=============================================</p><p>my cpp file is:: test.cpp</p><pre><code>#include ""test.h""MyClass::MyClass(int pNum1, int pNum2){  m_cFirstNum = pNum1;  m_cSecondNum = pNum2;}int MyClass::getSum(){  return m_cFirstNum + m_cSecondNum;}int MyClass::getMult(){  return m_cFirstNum * m_cSecondNum;}int MyClass::getSub(){  return m_cFirstNum - m_cSecondNum;}int MyClass::getDiv(){  int lRetVal = 0;  if(0 != m_cSecondNum)  {    lRetVal = m_cFirstNum + m_cSecondNum;  }  return lRetVal;}</code></pre><p>plz guide me on this always i am getting the message like::newInstance failed: no ()</p>","211996","","211996","","2009-11-23 12:11:56","2011-01-31 08:41:16","can anyone tell me how to create the object of c++class in android through ndk","<c++><android>","1","6","","",""
"1782722","1","1782751","","2009-11-23 12:01:28","0","1482","<p>How can i create cookies or sessions in android platform?</p><p>i am using one application like preferences settings. when ever i change the theme of android application need to store somwhere(?) the last updated theme name.</p><p>is there any way to store values cookies in android platform?</p><p>Thanks,Jeyavel N</p>","212809","","","","","2009-11-23 12:07:19","How can i create cookies or sessions in android platform?","<android>","1","0","2","",""
"1782743","1","1782914","","2009-11-23 12:06:03","27","33443","<p>I would like to integrate Twitter into my Android application so that I can post messages to Twitter. </p>","152867","","321697","","2011-01-28 20:32:13","2013-12-23 07:41:56","twitter integration on android app","<android><twitter>","4","0","17","",""
"1783117","1","1785300","","2009-11-23 13:26:07","24","22590","<p>I want to check when the network of phone in Android goes off. Can I capture that event?I am not getting the proper API or any example which would explain the same. If anyone had done or any example links would be really helpful.Thanks in advance.</p>","95877","","56285","","2013-11-20 11:53:59","2013-11-20 11:53:59","Network listener Android","<java><android><networking><listener><android-networking>","3","0","30","",""
"1783229","1","1790109","","2009-11-23 13:47:49","0","1791","<p>on android i have big listview which has to support filtering. For now my implementation is the following.</p><p>EditText and TextWatcher to listen for text changes. All data is stored in db and when there is event for TextChange fetch a cursor and set new CursorAdapter to the listview. I use AsyncTask to query the db and to update the gui.</p><p>But there comes some problems with this approach:</p><ol><li><p>AsyncTask is started for every TextChange event.</p></li><li><p>The AsyncTask should be synchronized</p></li></ol><p>So what is the best way to implement search field for a listview which elements are stored in db.</p>","184601","","","","","2009-11-24 13:34:21","Implement Search Field android","<android><search>","2","0","3","",""
"1784786","1","1792641","","2009-11-23 17:45:20","19","9107","<p>I've been doing some research for a mathematical Android related project I'd like to embark upon and I stumbled across for the first time MathML. </p><p>Does anyone know of any Java libraries which can do any (preferably all) of the following things?</p><ol><li>Parse MathML</li><li>Output MathML by parsing standard mathematical notation</li><li>Render MathML (particularly important)</li><li>Do any other cool maths-ey things (like re-arrange equations in terms of different things)</li></ol><p>Number 3 is probably the most important, and number 4 the least.</p><p>Thanks in advance.</p>","209838","","","","","2013-11-15 16:05:21","MathML and Java","<java><android><math><libraries><mathml>","5","0","22","",""
"1784831","1","","","2009-11-23 17:51:50","3","1845","<p>In my application I would like to mark different spots on a map. What I'm now wondering is if there's a way to use a simple 9-patch image and add the spot's name as text to it or would I need to draw everything myself (including the text) in the <code>draw()</code> method of <code>ItemizedOverlay</code>?</p>","184367","","102703","","2010-01-27 02:00:34","2010-01-27 02:00:34","Android: using 9-patch and text for ItemizedOverlay on MapView","<android><google-maps><overlay><android-mapview>","1","0","","",""
"1785030","1","1794352","","2009-11-23 18:23:14","2","990","<p>Some of my application's users are on android 1.5, some on 1.6, and some 2.0.</p><p>So how do I release my app for all customers?  If I release a 1.5 version, then the 1.5 phone can use it - but not the newer phones with smaller screens (aka Tatoo), they require 1.6 or higher? correct?</p><p>Thanks</p>","6580","","","","","2009-11-25 17:13:57","Android how do I support different phone version and screen sizes?","<android>","4","0","1","",""
"1785240","1","","","2009-11-23 18:58:50","0","161","<p>I'm trying to guess why a user would report ""Force quits every time I load""</p><p>The problem does not occur for all users, especially not me.</p><p>The system constructs a database when it first loads. I suspect that user's phone does not have enough memory.</p><p>Questions: How can I verify that the system has enough memory to store a small database? What else might cause a user's particular system to force quit on startup?</p><p>Wrong answers or things I've tried thus far:</p><ul><li>The user's hardware is probably different than mine</li><li>The user's software and available memory is likely different as well</li><li>The data is already loading in its own thread, with a progress dialog showing</li></ul>","108495","","108495","","2009-11-27 16:19:25","2010-01-16 23:59:51","Why would an android user report ""Force quits every time I load""?","<android>","3","0","","",""
"1785406","1","","","2009-11-23 19:28:00","2","848","<p>Is there a way to expand the VM limit in Android 2.0 on an actual device?  Using <code>java.lang.Runtime.maxMem()</code> on a Droid reveals a limit of 24MB, and I've written some code that incrementally allocates memory until failure to verify that figure.  You can set the VM size in the emulator, but I haven't yet found a way to do that for a connected phone.  Is there some type of a properties file on the device itself that can be modified?</p>","217260","","179850","","2011-02-21 18:47:31","2011-02-21 18:47:31","VM Limit in Android 2.0","<android>","0","1","","",""
"1785473","1","2611483","","2009-11-23 19:41:21","1","280","<p>We've been developing an Android application which includes Google Adsense. However there seems to be a problem with the ads not showing on HTC Hero phones. It does show on HTC Magic. Have anyone else had the same problem? Are there any Hero-specific settings which is needed?</p>","217283","","","","","2010-04-09 22:54:40","Adsense not displaying on HTC Hero","<android><adsense><htc-hero>","1","2","1","",""
"1785571","1","1785614","","2009-11-23 20:01:12","2","1758","<p>I'm noticing a strange thing with Alarms on Android - they don't always wake up the device at the correct intervals. For example, if I set an alarm to start a service every 5 minutes (using RTC_WAKEUP, or similar), everything works fine until the device goes to sleep - after that, the alarm may not fire for minutes, or close to an hour. It usually does fire eventually - and it always fires if I wake the device by pressing Menu. Using repeating alarms (vs. re-setting them each time) has the same effect.</p><p>So my question is, are alarms guaranteed to fire at proper intervals when the device is asleep? I understand that I shouldn't expect millisecond or second precision, but tens of minutes?</p>","132628","","","","","2009-11-25 17:20:59","Alarms on the Google Android","<android><alarm>","2","0","2","",""
"1786114","1","1786139","","2009-11-23 21:28:20","0","765","<p>I'm thinking of doing some work in the Android space and was looking at the Verizon Motorola Droid.  My question is simple:  Can/How do I directly deploy applications I am developing and testing to my personal phone or I limited by some other third party as to how I can access my own phone?</p>","77538","","","","","2009-11-23 21:32:36","Motorola Droid by Verizon: Can I deploy Android Apps directly to the phone?","<android><motorola-droid>","1","0","","",""
"1787447","1","","","2009-11-24 02:39:11","2","328","<p>What operating system do you recommend. Currently I have Vista installed but it isn't developer friendly.I'm doing rails apps and learning Android development an Appcelerator.Oh, and haven't the budget for a Mac :(</p>","153409","","56338","","2009-11-24 05:52:24","2011-01-05 15:21:02","Best Rails / Android / Appcelearator development OS if have no money to buy a Mac","<ruby-on-rails><windows><android><linux>","5","4","","2012-07-25 12:27:19",""
"1788257","1","1788949","","2009-11-24 06:36:40","1","283","<p>How yto convert a value to exponential i mean</p><pre><code>1.522222 to 152.2222e-2 and   .1522222e+1 and 22. string s=123456789123</code></pre><p>my s.length is greater than 9 than i have to get a value 1.234567891e+11 and the same in case 0.0123466789, now i  need out put like 1.23456789e-2</p>","217065","","750613","","2012-07-10 09:20:57","2012-07-10 09:20:57","Exponential function in android","<java><android><double>","1","1","","",""
"1788434","1","","","2009-11-24 07:26:01","1","3800","<p>Has anybody tried bash scripting on android?I tried to write a simple script on Android's bash shell through adb.I tried the following script which works for me:</p><pre><code>#sh1x=""hello""echo ""$x""</code></pre><p>But when I do:</p><pre><code>#sh1x=""hello""if [ -n ""$X"" ]; then    echo ""hi""fi</code></pre><p>The error says <code>[ -n not found</code>!</p><p>Why do I get this error and is there a work around?</p>","212464","","56338","","2009-11-24 07:33:21","2012-02-20 12:55:15","Bash scripting on Android","<android><bash><scripting>","3","3","","2012-02-20 17:07:45",""
"1788767","1","1788780","","2009-11-24 08:56:08","0","225","<p>How do I apply clicking action on listview in android?</p>","217065","","651104","","2012-04-14 13:56:42","2012-04-14 13:56:42","clicking function in android","<android>","1","0","","",""
"1788800","1","1791539","","2009-11-24 09:03:21","2","959","<p>How would you go about to bind a <code>JSONArray</code> to an adapter, the adapter will be used to bind data to a spinner.</p><p>Of course I could iterate over the strings in the <code>JSONArray</code> and add 'em to a String array, but that seems cumbersome.</p>","452861","","750613","","2012-07-10 09:20:06","2012-07-10 09:20:06","Bind JSONArray to adapter","<android>","1","0","2","",""
"1788886","1","1788916","","2009-11-24 09:20:09","0","1627","<p>How do I connect to a <code>URL</code> when clicking on a <code>ListView</code>?</p>","217065","","750613","","2012-07-10 09:19:34","2012-12-12 14:32:04","How do I connect to a URL when clicking on an Android ListView?","<android><listview>","3","0","","",""
"1788966","1","","","2009-11-24 09:34:50","2","583","<p>I'm currently developing for Android using Eclipse. I have a lexicon viewer application (with package name ""com.mycompany.myviewer"") that I want to reuse multiple times, just changing specific resources such as app name and icons.<br>For example, I have a certain publisher ""Publisher1"", who publishes the lexicons ""Lexicon1"" and ""Lexicon2"". I would need to two applications: App1 with certain name and icon, and App2 with another name and icon.<br>What is the best way of doing this in Java? In visual Studio (and C++) I could create two projects based on the lexikon viewer app and use conditional resources to get the right name and icon. Is there some way of doing something similar in Java?</p>","177019","","","","","2009-11-24 10:18:20","Reusing java source in multiple projects","<java><android>","2","0","3","",""
"1789056","1","1789076","","2009-11-24 09:55:39","1","966","<p>My android app fetches a JSON structure from the net. It's somewhat large, maybe 2,000 characters in length. I need to store it away when my app gets killed so I can recover it quickly. I've tried saving it to an sqlite database, but that takes about 400ms, kind of long. I wonder if it's bad practice to just dump it into the save bundle:</p><pre><code>protected void onSaveInstanceState(Bundle outState) {    super.onSaveInstanceState(outState);    String jsonString = myObject.toString();    outState.put(""test"", jsonString);}</code></pre><p>or are we really only supposed to be putting the smallest of items in bundles?</p><p>Thanks</p>","217694","","","","","2009-11-26 02:37:50","Reasonable size of data to store in Bundle on onSaveInstanceState()?","<android>","2","1","1","",""
"1791340","1","","","2009-11-24 16:46:52","10","18147","<p>I am looking to add controls to adjust screen brightness locally in my app menu but can't seem to figure out how to do it. I have seen examples to max-out or dim brightness but I am looking to add controls so that the user can control and set the brightness level. Does anyone have any examples, tutorials, source code, or just a place to point me in the right direction?</p>","217950","","","","","2011-04-22 11:21:21","Adding screen brightness controls to android application","<java><android>","3","0","12","",""
"1791859","1","","","2009-11-24 18:04:02","1","1605","<p>I have an EditText that is to collect input for a basic calculator. I want to bring up the numeric keyboard, and thus I set android:inputType to numberDecimal|numberSigned. Problem is, the EditText filters out all characters that aren't numeric, such as ""("", "")"", ""/"", ""*"".</p><p>I have tried overriding this behaviour by setting a custom InputFilter which filters nothing out, but it seems to have no affect on the EditText. Is there any way for me to display the numeric soft keyboard without the filtering behaviour?</p>","196980","","","","","2009-11-24 23:29:06","Custom Android Keyboard Input Filtering","<android><keyboard><filter>","1","0","","",""
"1792604","1","4821151","","2009-11-24 20:08:24","12","9728","<p>Can any one help me out how to use Html.ImageGetter to dispaly images using html image src tag ? and example or good tutorial</p>","216431","","","","","2014-02-11 10:39:50","Html.ImageGetter","<html><android>","4","0","7","",""
"1793338","1","1793404","","2009-11-24 22:22:16","11","8173","<p>What would be the right way to turn a color Drawable into a grayscale one (to indicate disabled state)?</p><p>EDIT:<br>B/W => grayscale</p>","15187","","15187","","2009-11-24 22:30:22","2011-02-09 23:35:02","Drawable => grayscale","<android><drawable>","4","0","3","",""
"1793752","1","1793772","","2009-11-24 23:42:13","1","1683","<p>I'm using the following to initiate the sending of an email:</p><pre><code>Intent i = new Intent(Intent.ACTION_SEND);i.setType(""message/rfc882""); i.putExtra(Intent.EXTRA_EMAIL, new String[]{s});startActivity(Intent.createChooser(i, ""Send mail...""));</code></pre><p>The problem that I'm having is that (on my phone) it pulls up Gmail's Compose window instead of allowing me to choose which email client I'd like to send the message with. </p><p>Am I doing this wrong, or does the default email client just not respond to email send intents?</p>","76835","","","","","2013-03-01 09:11:21","Email Intent not showing the chooser","<android><email><android-intent>","2","0","1","",""
"1794455","1","1794511","","2009-11-25 03:35:38","1","132","<p>how to connect to email while clicking on button in android</p>","217065","","","","","2009-11-25 04:19:14","clicking function in android","<android>","2","2","","",""
"1794714","1","","","2009-11-25 04:53:10","1","262","<p>I've been trying to find a way to upload a video from an Android device to an API, but I haven't found a good way to do it.  It seems most of the information I've found online is fairly out of date (a lot of it being from last year).  Most of them are using a method like this: <a href=""http://getablogger.blogspot.com/2008/01/android-how-to-post-file-to-php-server.html"" rel=""nofollow"">http://getablogger.blogspot.com/2008/01/android-how-to-post-file-to-php-server.html</a></p><p>What's the easiest/preferred way to upload something to an API with a multipart POST?</p>","135180","","","","","2011-07-27 17:13:59","What is the preferred method for uploading to a server from Android?","<java><android><http>","2","1","0","",""
"1796181","1","3707781","","2009-11-25 10:59:48","7","3562","<p>In my activity there's some stuff going on in a background thread, which gets started in Activity_1. The processing of the background thread takes a while and I want to notify the user when it's completed via an <code>AlertDialog</code>. However, the user might have changed to Activity_2 or Activity_3 in the meantime and I would like to pop up the AlertDialog always in the current Activity.</p><p>Any idea how to realize this?</p>","184367","","","","","2010-09-14 09:50:27","Android: raise AlertDialog from background thread","<android><dialog><multithreading><background>","2","0","4","",""
"1796671","1","13737840","","2009-11-25 12:39:25","2","7357","<p>I am writing a simple calculator application(using absolute layout with 3 edit boxes and some buttons), which has two inputtext boxes and a output box.</p><pre><code>input1 = (EditText) findViewById(R.id.input1);input2 = (EditText) findViewById(R.id.input2);</code></pre><p>now once user enters some numerics into input1 and presses '+', now i want to shift the focus from input1 to input2. How can i do that?</p><p>I tried the below code on keypress of '+'</p><pre><code>onClick(View arg0){                operator.setText(""+"");                //Move focus from input1 to input2                input1.clearFocus();                input2.setNextFocusDownId(input2.getId());        }</code></pre><p>but this is not working.. can you please help me on this?</p>","177303","","","","","2014-01-13 23:45:43","Move focus from one Edit text box to another","<android><focus>","3","2","4","","2009-11-25 12:39:25"
"1798252","1","1799316","","2009-11-25 16:42:08","1","14662","<p>I have two activities in which I need to pass an object array between them.  From the main activity, I start the secondary activity with <code>startActivityForResult()</code>, and pass the array as a ParcelableArray in a Bundle.  This works fine to get the array to the secondary activity; I can pull the array out of the Bundle and manipulate it from there.</p><p>The problem I'm having is when I want to pass the array back to the calling activity.  I need it to occur when a user presses the back/return button on the device.  I've tried placing the array back into a Bundle, calling <code>setResult()</code> from within <code>onPause()</code> on the secondary activity, but I'm assuming this is the incorrect location to perform the task.  I've reached that conclusion as <code>getCallingActivity()</code> within <code>onPause()</code> returns null.</p><p>What's the proper way to return a Bundle to the calling activity in this situation?</p><p>Main Activity:</p><pre><code>    Bundle b = new Bundle();    b.putParcelableArray(""com.whatever.data"", items);    Intent folderView = new Intent(MainView.this, FolderView.class);    folderView.putExtras(b);    startActivityForResult(folderView, 1);</code></pre><p>Secondary Activity:</p><pre><code>protected void onPause () {    super.onPause();    Intent result = new Intent();    Bundle b = new Bundle();    b.putParcelableArray(""com.whatever.data"", items);    result.putExtras(b);    setResult(Activity.RESULT_OK, result);}</code></pre>","153341","","","","","2012-01-13 10:07:03","Android Activity Results","<android>","3","0","1","",""
"1798292","1","3684680","","2009-11-25 16:48:25","0","2889","<p>Hey guys. Here is my scenario: I've got a database, where 2 columns are interesting for me. I now created an autocompletetextview where the adapter gehts via SQL the entries of one column. </p><p>So far... so good, but what i actually want is, that if the user types sth. into the autocompletefield i notice this and fetch the text. Via SQL I now want to get everey Entry of <strong>column 2</strong> where the value of column 1 is contained in the entered text. And this List should be displayed in the adapter. In other words I filter the data by myself via sql but i want them to be shown in the adapter. <strong>The problem is</strong>, that the adapter only shows the entries which start with the text in the autocompletefield but I want to show the adapter anytime, as already saied: I filter the data by myself I just want the adapter to display them. Any ideo how to solve this? Is the AutocompleteTextView the right item to use?</p><p>I also thought about using a simple Spinner... but when using a spinner there are 2 main problems. first I would have to make him editable. and second I would need a dropdown instead of the ""popup"". ...</p><p>Another idea of mine to solve this issue is to write an own filter for the autocomplete field... but i've never down this so far and I also couldn't found any examples in the internet to do so. </p><p>thanks for your help</p>","209902","","209902","","2009-11-28 14:12:53","2012-07-10 11:45:27","Android Autocompletetextview and editable spinner","<android><sqlite><autocompletetextview>","2","0","3","",""
"1798435","1","1798548","","2009-11-25 17:11:20","6","1609","<p>How can I link my free android application to the ""paid"" version so a user of the free one can instantly click on the link and be taken to the android market page for the full version.</p>","93141","","4596","","2010-10-17 14:47:42","2010-10-17 14:47:42","Android - How can I link my free app to the Pro version","<android><google-play>","2","0","5","",""
"1799277","1","1799305","","2009-11-25 19:10:04","1","389","<p>what software do I need to create an android app?</p>","161781","","161781","","2009-11-28 20:22:54","2010-11-04 16:52:20","How do I create an android phone ap?","<android>","5","0","","",""
"1799484","1","","","2009-11-25 19:44:00","3","731","<p>In their developer articles for Android, Google states that you should usually declare public variables rather than private ones with getters and setters to enhance performance on embedded devices (I suppose function calls are more expensive than just writing to an address). </p><p>I was wondering - to what extent should performance be sacrificed to stick to the OOP paradigm? And in what other cases does optimisation mean a break-away from 'good' coding practices?</p>","209838","","164901","","2010-04-16 15:43:12","2010-04-16 15:43:12","When should and shouldn't you break away from OOP for speed/performance?","<java><android><performance><oop>","14","3","1","","2009-11-25 19:44:00"
"1800881","1","1800950","","2009-11-26 00:19:19","4","11388","<p>I'm currently working on an XMPP app' on Android and I'm pondering about the best way to throw a different type of Exception than a RemoteException to my activity from my service.</p><p>As it seems impossible to throw another thing than a RemoteException using IPC (you can't declare to throw anything in your .aidl), I just see two solutions:</p><ul><li><p>Create a listener for my activity to listen on my custom XMPP exception, which in fact will not be thrown but just sent as a usual object implementing the Parcelable protocol.</p></li><li><p>Catch my XMPPException and throw a RemoteException (with a content updated with my XMPPException) - But in that case, how could I know on my activity if it's an XMPP or a real RemoteException ? By tagging the name of the exception and parsing it on my activity ? It would be really gore.</p></li></ul><p>Do you have any idea ? Did I miss something from the SDK documentation ?</p><p>Thanks.</p>","150650","","","","","2009-12-16 18:53:44","Throw a custom exception from a service to an activity","<android><exception><service><ipc>","2","1","3","",""
"1801321","1","","","2009-11-26 03:02:05","5","631","<p>I have a mobile-optimized site that uses a pretty simple trick of serving a different page based on browser width. This worked great until the Droid came along, with its very high pixel density screen. </p><p>I understand that the default setting of the screen is 800 pixels wide (significantly wider than my width detect script, which is making its decision of which page to serve at 500 pixels). However, the Droid browser seems to arbitrarily decide to report a smaller width, and thusly serve the smaller-width page. But not in a predictable manor. </p><p>As a result, the experience for an end user is completely random: sometimes they see a wide page they have to zoom in on, sometimes they see a page that's scaled just right to their window.</p><p>I have written a small script that reports the screen width and, even when forcing the viewport to a specific pixel size, I have had some users still report an 800 pixel width (even in vert orientation) and others report the fixed width. </p><p>Is there a way of definitively setting the width for the Droid's browser? Is this a bug? Am I just simply not thinking something through? Frankly, it's starting to feel like designing in a dark cave with my hands tied behind my back.</p>","219083","","","","","2012-05-20 18:32:40","Droid browser causing havoc on my site","<android><webkit>","1","4","3","",""
"1801497","1","1801985","","2009-11-26 04:13:24","0","1351","<p>How to close screen while moving to next screen in android platform?</p><p>i have one working scenario like this. while moving from one screen to other screen need to close(i shouldn't show screen while press Esc key).</p><p>Please help me </p><p>Regards,Jeyavel N</p>","212809","","","","","2010-07-08 12:21:26","How to close screen while moving to next screen in android platform?","<android>","1","0","1","",""
"1801500","1","1801975","","2009-11-26 04:14:47","2","880","<p>My app is made of two activities, A and B. I'm considering this sequence of steps:</p><ul><li>Activity A is started.</li><li>A launches B [A is paused, B is running].</li><li>B launches a map intent [A and B are both paused now].</li></ul><p>Now the user is using the maps application and the system decides it needs more memory. Can the system kill <strong>only one</strong> of my activities for memory, or will it always kill <strong>all</strong> activities in a ""<strong>process</strong>"" in this situation? </p><p>Both activities share some static data like:</p><pre><code>class Data {    public static String mName;    public void save() {      // write to file: mName;    }    public void load() {      // mName = read from file;    }}ActivityA.mTextView.setText(Data.mName);ActivityB.mListView.addText(Data.mName);</code></pre><p>so when any activity in my app gets onSaveInstanceBundleSate() called, I call Data.save() to write it to disk. Now the question is, in an Activity's onCreate() method, should I simply check to see if Data.mName == null, and if so, assume the Activity is returning from a kill state, and try restoring from disk again? I'm unclear when this restoring should be done, considering Activity A may or may not still be alive etc. - and I don't want to corrupt state if Activity A is still alive but B is coming back from a kill state,</p><p>Thanks</p><p>Thanks</p>","185329","","750613","","2012-07-10 08:55:41","2012-07-10 08:55:41","Activity / process lifecycle - when to save/load data to/from disk","<android>","1","0","","",""
"1801687","1","1801951","","2009-11-26 05:24:25","4","2581","<p>there is an intent for “<code>send an email.</code>” In our applicationneeds to send mail, how can invoke that intent</p>","217065","","750613","","2012-07-10 08:54:59","2012-07-10 08:54:59","how to call email application in android platform","<android>","1","0","","",""
"1801731","1","","","2009-11-26 05:38:13","0","493","<p>I want to check whether the process is still alive or not through programmatically ,Can I do that I am trying to do it by process name in <code>onCreate</code> method but the issue is that the <code>onCreate</code> method is called always .When I check that in <code>onCreate</code> method I always get the process name and I can not kill the current app  and switch to previous one.Can anybody help me ?Thanks in advance. </p>","95877","","1553563","","2012-12-10 06:57:31","2012-12-10 06:57:31","android - How to check that the Process is alive or not?","<java><android>","3","0","","",""
"1801866","1","1801935","","2009-11-26 06:23:51","3","8148","<p>I am working on a Widget which will get the Current GPS location and pass this value to remote PHP page to get the Information and display it in the Widget. This is what I am trying to do.</p><p>I am facing problem while implementing Location Listener for appWidget. It is not updating with the Current Location and It is showing the initial widget i.e ""Loading Widget""(Here I put this text)</p><p><strong>Can we implement Location Listener for AppWidgetProvider?</strong><br>  Or<br>  <strong>Can you suggest me the possible solution for getting GPS location in App Widget?</strong></p><p>I placed all necessary permissions in Manifest file.<br>Here is my code snippet:<br><code></p><pre><code>public class test extends AppWidgetProvider {static LocationManager locMan;static Location curLocation;static Boolean locationChanged;@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds) {	// To prevent any ANR timeouts, we perform the update in a service	context.startService(new Intent(context, UpdateService.class));}public static class UpdateService extends Service {	// GPS Listener Class	LocationListener gpsListener = new LocationListener() {		public void onLocationChanged(Location location) {			// Log.w(""GPS"", ""Started"");			if (curLocation == null) {				curLocation = location;				locationChanged = true;			}			if (curLocation.getLatitude() == location.getLatitude()	&amp;&amp; curLocation.getLongitude() == location.getLongitude())				locationChanged = false;			else				locationChanged = true;			curLocation = location;			if (locationChanged) 				locMan.removeUpdates(gpsListener);		}		public void onProviderDisabled(String provider) {		}		public void onProviderEnabled(String provider) {			// Log.w(""GPS"", ""Location changed"", null);		}		public void onStatusChanged(String provider, int status,				Bundle extras) {			if (status == 0)// UnAvailable			{			} else if (status == 1)// Trying to Connect			{			} else if (status == 2) {// Available			}		}	};	// In service start method, I am registering for GPS Updates	@Override	public void onStart(Intent intent, int startId) {		locMan = (LocationManager) getSystemService(Context.LOCATION_SERVICE);		if (locMan.isProviderEnabled(LocationManager.GPS_PROVIDER)) {			locMan.requestLocationUpdates(LocationManager.GPS_PROVIDER,20000, 1, gpsListener);		} else {			this.startActivity(new Intent(""android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS""));		}		if (curLocation != null) {			double lat = curLocation.getLatitude();			double lng = curLocation.getLongitude();			Toast.makeText(getBaseContext(),""Lat : "" + String.valueOf(lat) + ""\n Long : ""+ String.valueOf(lng), Toast.LENGTH_LONG).show();		}		// Build the widget update for today		RemoteViews updateViews = buildUpdate(this);		// Push update for this widget to the home screen		ComponentName thisWidget = new ComponentName(this,InKakinadaWidget.class);		AppWidgetManager manager = AppWidgetManager.getInstance(this);		manager.updateAppWidget(thisWidget, updateViews);	}	public RemoteViews buildUpdate(Context context) {		// Here I am updating the remoteview		return updateViews;	}	@Override	public IBinder onBind(Intent intent) {		// We don't need to bind to this service		return null;	}}}</code></pre><p></code></p><p>Thanks in Advance...</p><p>With Regards,Raghavendra K.</p>","179043","","179043","","2009-11-26 06:41:59","2009-11-27 18:56:34","Problem while implement location listener in android appwidget","<android><gps><android-widget><listener>","2","0","4","",""
"1802298","1","","","2009-11-26 08:33:08","0","2702","<p>Roger,</p><p>I see that you've been tinkering with camera intents. I'm having real trouble just gettinga simple app to tell me when the camera button has been pressed. Do you have some code to help me on my way. </p><p>Thanks. </p><p>David </p>","219223","","750613","","2012-07-10 08:53:57","2012-07-10 08:53:57","Android camera intents","<android><camera><android-intent>","1","0","4","",""
"1803111","1","1804425","","2009-11-26 11:20:35","0","461","<p>I am having custom Listview. Every row in listview contains image and textview.</p><p>After finishing the page I want to execute a thread which will get the reference of all the rows then will extract imgeview and set resource image as lazy loading image.</p><p>I just want to know how to get every row's image view so that I can set image resource in it. Any idea ????</p>","216431","","153545","","2009-11-26 11:24:29","2009-11-26 15:46:32","android how to get every row's imageview","<android><listview>","1","0","","",""
"1803324","1","","","2009-11-26 12:09:32","5","3361","<p>I am having trouble applying an animation to a View. I am trying to load the animation from inside the constructor of a CursorAdapter, so I can set it later assign it to certain children in the list.</p><p>In the constructor I have :</p><pre><code>shineAnimation = AnimationUtils.loadAnimation(ctx, R.anim.news_list_item_shine);</code></pre><p>the animation is in my res/anim dir </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;animation-list xmlns:android=""http://schemas.android.com/apk/res/android"" android:oneshot=""true""&gt;    &lt;item android:drawable=""@drawable/shine1"" android:duration=""200"" /&gt;    &lt;item android:drawable=""@drawable/shine2"" android:duration=""200"" /&gt;    &lt;item android:drawable=""@drawable/shine3"" android:duration=""200"" /&gt;    &lt;item android:drawable=""@drawable/shine4"" android:duration=""200"" /&gt;    &lt;item android:drawable=""@drawable/shine5"" android:duration=""200"" /&gt;&lt;/animation-list&gt;</code></pre><p>I'm getting an exception :    Unknown animation name: animation-list</p><p>Help would be much appreciated</p><p>ThanksS</p>","219360","","","","","2013-04-09 20:44:06","Android Frame by Frame Animation problem on elements in a CursorAdapter","<java><android><animation>","1","0","1","",""
"1803365","1","1803492","","2009-11-26 12:17:12","7","5860","<p>I am developing an application that periodically sends information to an external server.  I make a local copy of the data being sent, for backup purposes.</p><p>What is the best option to store the data <strong>in terms of saving battery life</strong>?  Each data submission is a serialized object (the class has 5 fields, including a date, numbers and strings) of about 5K-10K.</p><p>Any other idea?</p>","12388","","12388","","2009-11-26 14:15:04","2009-11-27 18:28:39","Android data storage - File vs SQLite","<android><sqlite><battery>","3","0","3","",""
"1804156","1","1804271","","2009-11-26 14:57:31","3","867","<p>How to send an email from my application using email application?</p><p>I am having the one scenario like send email to particular mail id(<code>info@jeltech.com</code>). In my application while clicking the link it should call email application and then need to pass above mail id to in ""To"" box (after login) . </p><p>Is there any solution for this issue?</p><p>Regards,<br>Jeyavel N</p>","212809","","750613","","2012-07-10 08:52:28","2012-07-10 08:52:28","How to send an email from my application using email application?","<android><email><mobile>","2","0","1","",""
"1804691","1","","","2009-11-26 16:38:04","2","1287","<p>Can i use <code>Tagsoup</code> and <code>XOM</code> on android 1.6 without any performance problems ?</p>","166694","","750613","","2012-07-10 08:51:53","2012-07-10 08:51:53","Tagsoup and XOM on android","<java><android><xom>","1","1","","",""
"1805869","1","1811811","","2009-11-26 22:04:00","1","2680","<p>How to parse non well-formed HTML in android ?</p><p>I tried to use XOM and TagSoup, but i get the following error when creating the Builder:</p><pre><code>11-26 20:42:39.294: ERROR/dalvikvm(1298): Could not find method org.apache.xerces.impl.Version.getVersion, referenced from method nu.xom.Builder.</code></pre><p>Must i install Xerces to use XOM or can i use tagsoup without XOM ?</p>","166694","","750613","","2012-07-10 08:51:12","2012-07-10 08:51:12","How to parse (non well-formed) HTML in android?","<java><android><xerces><xom>","2","0","0","",""
"1805895","1","1805922","","2009-11-26 22:15:07","24","23907","<p>Is there a way to get battery information from the Android SDK? Such as battery life remaining and so on? I cannot find it through the docs.</p>","42005","","418613","","2012-06-08 12:29:27","2014-01-07 00:03:41","Android Battery in SDK","<android><power-management>","4","0","24","",""
"1806286","1","2605838","","2009-11-27 00:37:58","5","5952","<p>I'm trying to figure out how to get the size of an installed app.<br>What's already failed:<br>- <code>new File('/data/app/some.apk')</code> - reports incorrect size<br>- <code>PackageManager.getPackageSizeInfo(String packageName, IPackageStatsObserver observer)</code> - is <code>@hide</code> and relies on some obscure <code>IPackageStatsObserver</code> for result so I can't call it via reflection.</p>","15187","","","","","2014-04-04 11:25:36","Getting installed app size","<android>","2","2","7","",""
"1806850","1","1806908","","2009-11-27 05:03:42","3","2729","<p>I'm trying to get a byte array of an image saved locally on the phone. I'm using the code:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.upload);    // Look in the Device    startActivityForResult(new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI), 1);    // Look in the SD Card    // startActivityForResult(new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI), 1);}@Overridepublic void onActivityResult(int requestCode, int resultCode, Intent data) {  super.onActivityResult(requestCode, resultCode, data);  if (requestCode == 1)    if (resultCode == Activity.RESULT_OK) {      Uri selectedImage = data.getData();      Cursor Cur = Upload.this.managedQuery(selectedImage, null, null, null,null);      if (Cur.moveToFirst()) {          File Img = new File(selectedImage.getPath());          long Length = Cur.getLong(Cur.getColumnIndex(ImageColumns.SIZE));          byte[] B = new byte[(int)Length-1];          FileInputStream ImgIs;          try {            ImgIs = new FileInputStream(Img);            ImgIs.read(B);          } catch (FileNotFoundException e) {            // TODO Auto-generated catch block            e.printStackTrace();          } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        int i = B.length;      }    } }</code></pre><p>But it throws a <code>FileNotFound exception</code> on </p><pre><code>ImgIs = new FileInputStream(Img)</code></pre><p>How can I get the Bytes?</p>","108537","","750613","","2012-07-10 08:42:54","2012-07-10 08:42:54","Android Get Local File Bytes","<android><image>","2","1","1","",""
"1808456","1","1809621","","2009-11-27 12:22:01","0","289","<p>What I want to do is to scroll view after listening a button.Simply user taps button and view is scrolled to specific id below.</p><p>I tried to use scrollto and scrollby passing as an argument reference to object to which I want to scroll with no effect.</p><p>Anyone solved this problem yet?</p>","186268","","","","","2009-11-27 16:25:22","How to scroll views whithn view in android?","<android><layout>","1","0","","",""
"1808899","1","1828090","","2009-11-27 13:51:13","1","345","<p>Does Android have a similar method to the iPhone <code>AVAudioPlayer's</code> averagePowerForChannel?</p><p>I want to get an average reading of the amplitude of as a value. </p>","32320","","750613","","2012-07-10 08:42:15","2012-07-10 08:42:15","Android version of AVAudioPlayer's averagePowerForChannel","<android><iphone><audio>","1","0","","",""
"1809507","1","1809734","","2009-11-27 15:59:28","16","28864","<p>I am new to Android software development and new to this site.  I am hoping someone might have some experience with the problem I am having.</p><p>I've been following the <a href=""http://developer.android.com/guide/tutorials/views/hello-mapview.html"">Hello, MapView tutorial</a> in order to not only learn the Android framework, but also the Google Maps library.  I've tried my best to implement things exactly as the tutorial has instructed.  My problem is that the application does load in my emulator (or even on my phone for that matter), but the map tiles do not load.</p><p>Searching Google I found a post by someone else on another site having the same issue, but his/her problem was that the important elements added to the AndroidManifest.xml file were not in the right order.  I double-checked this in mine, but everything seems to be right.</p><p>So, I am not sure what the issue is and was hoping others have seen this before.  I can provide any snippets of code, if that would help.</p><p>Thank you.</p>","220101","","1228","","2013-08-16 17:14:38","2013-10-29 14:13:20","Android ""Hello, MapView"" Tutorial - Map Tiles Do Not Load","<android><google-maps><android-mapview>","10","1","1","",""
"1809586","1","1809793","","2009-11-27 16:16:18","0","565","<p>I want to detect when an uncaught exception has happened in my Android app. Once detected, I want to display a confirmation dialog</p><p>How do I get this confirmation dialog to display? When I tried various techniques, the UI is unresponsive and appears to be frozen.</p><p>My code responds to this:</p><p>//new CatchAllExceptionHandler(this) is my custom handlerThread.setDefaultUncaughtExceptionHandler(new CatchAllExceptionHandler(this));</p><p>I have tried these two implementations of CatchAllExceptionHandler:</p><ol><li>Display an Alert dialog </li><li>Start an activity that then displays an alert dialog after onCreate</li></ol><p>Both these methods failed. </p><p>So my question is: How to I get the confirmation dialog to properly display?</p>","108495","","","","","2009-11-27 17:06:52","How do I show a dialog after the Thread has encountered an uncaught exception?","<android><exception>","1","1","","",""
"1809774","1","2279509","","2009-11-27 16:59:05","36","56164","<p>Has anyone successfully compiled the android kernel and tested it in the Android emulator, and if so is there anything that special that needs to be done? </p><p>Documentation for the SDK is excellent, however documentation for compiling the kernel and setting up a custom machine in the emulator has been hard for me to find.</p>","220031","","648313","","2011-07-13 12:51:26","2013-04-02 15:06:45","Android kernel compile and test with Android Emulator","<android><android-emulator><emulator><android-source>","9","0","40","",""
"1809907","1","1810155","","2009-11-27 17:37:41","3","785","<p>Is there a way to get webkit running in the background , or even small enough for the user not to know that the webkit browser is running? Basically i want to use this to have java and javascript integration while using the android UI. </p>","117691","","","","","2009-11-27 18:38:45","Android Webkit in background","<android><webkit>","1","0","","",""
"1810768","1","1810983","","2009-11-27 22:03:18","4","1178","<p>I wrote an Android application. These are the permissions I requested:</p><ul><li>INTERNET</li><li>ACCESS-COARSE-LOCATION</li><li>ACCESS-FINE-LOCATION</li><li>ACCESS-NETWORK-STATE</li><li>CHANGE-NETWORK-STATE</li></ul><p>On 1.5 devices, it looks fine. I tried on a 2.0 device, and it also shows an additional permission when installing the app:</p><ul><li>SD CARD READ / WRITE</li></ul><p>Is that just coming up by default now on any 2.0 device we install apps on? I do use <code>Context.openFileOutput()</code> to write a file to disk, but only to the app sandbox location, never to SD card.</p><p>Thanks</p>","217694","","750613","","2012-07-10 08:40:12","2012-07-10 08:40:12","""SD Card"" permission appears on 2.0 devices?","<android>","2","0","1","",""
"1810973","1","1812646","","2009-11-27 23:21:04","2","1288","<p>I am looking for a way to find images on the SD card, or at least images taken by the camera.</p><p>The ideal solution would be getting a collection of file paths or URIs for the images. I guessing you can do this through the MediaStore I just can't figure out how. </p><p>Thanks</p>","317809","","317809","","2013-02-13 17:59:22","2013-02-13 17:59:22","Android: getting image locations","<android><image><mediastore>","1","0","1","",""
"1811680","1","","","2009-11-28 05:32:30","4","2555","<p>I'm trying to write a function for the Android Platform that will allow me to call 911 without any sort of prompt. I have already added the permission ""android.permission.CALL_PRIVILEGED"" I just need a function that will dial 911 at the press of a button in my options menu.</p>","220349","","104096","","2009-11-29 18:49:42","2009-11-29 18:49:42","Dial Number Without Prompt","<java><android><permissions><call>","1","3","1","",""
"1811721","1","","","2009-11-28 05:53:44","1","835","<p>I want to be able to plot every hospital within 10 miles of my current location on the map in Android. I've already started with this code as a base (http://android-er.blogspot.com/2009/11/androidlocation-with-zoom-level-control.html) I just need to plot the locations of hospitals without switching to another screen. </p><hr><p>Here is everything that I've done so far. <a href=""http://www.mediafire.com/file/c0mzxdmtvnh/LyfeLink.zip"" rel=""nofollow"">http://www.mediafire.com/file/c0mzxdmtvnh/LyfeLink.zip</a></p>","220463","","1288","","2012-04-28 14:00:01","2012-04-28 14:00:01","Locating local hospitals in android","<java><android><google-maps>","2","1","","",""
"1811852","1","6554007","","2009-11-28 07:16:38","13","19457","<p>This is what I would like to do :</p><p>=> IF WiFi is enabled AND active, launch an intent (in fact it's a WebView that gets its content=>the instructions of my app on the web)</p><p>=> IF NOT, then I would launch another intent so that I don't show a WebView with ""Web page not available ... The Web page at <a href=""http://www.mywebsite.com"">http://www.mywebsite.com</a> might be temporarily down or it may have moved ..."" </p><p>I tought initially to use </p><p>if(wifi.isWifiEnabled())</p><p>but that does not say if the Wifi connection is ACTIVE or not. It says only that the user has turned the switch on. The device may or may not be connected... Is this correct ?</p><p>Then I tried to use :</p><p>if (wifi.getConnectionInfo().getSSID()!= null)</p><p>but I noticed that it returns a string even if the connection has been lost or has been disabled ... ?</p><p>How should I do then ?</p><pre><code>wifi = (WifiManager)getSystemService(Context.WIFI_SERVICE);Intent intent_instructions;        	if (wifi.getConnectionInfo().getSSID()!= null){        		Log.i(""Hub"", ""WiFi is enabled AND active !"");        		Log.i(""Hub"", ""SSID = ""+wifi.getConnectionInfo().getSSID());        		intent_instructions = new Intent(this, Instructions.class);    		}else{    			Log.i(""Hub"", ""NO WiFi"");    			intent_instructions = new Intent(this, Instructions_No_WiFi.class);    		}    		this.startActivity(intent_instructions);</code></pre><p>Is there a more general way to test if the device has the connectivity to the internet just before launching an intent ? be it through Wifi, 3G, etc ...</p><p>Thanks in advance for your help.</p>","116573","","","","","2012-12-16 21:44:48","ANDROID: if WiFi is enabled AND active, launch an intent ","<android><wifi><internet-connection>","5","2","12","",""
"1812177","1","1812232","","2009-11-28 10:19:39","0","401","<p>I want to read image from web </p><p>ex. <a href=""http://www.abc.com/image1.jpg"" rel=""nofollow"">http://www.abc.com/image1.jpg</a></p><p>and dynamic set to imageview component. how can i do it? any good tutorial ??</p><p>Thanks in advance.</p>","216431","","","","","2011-04-20 16:55:57","imageview web imageresource","<android><image>","1","0","","",""
"1812818","1","16804532","","2009-11-28 15:38:11","0","3086","<p>I want to create an AnalogClock that can display a preset time, given as a parameter.</p><p>And I want to draw between the background and the hands. I want to paint the area between the minute-hand and location of the hour-hand at a preset future time. This is to let the user see how much time remains for the current activity.</p><p>I thought that I could take the AnalogClock object and extend that. However, when I create a new function that is essentially a copy of one of the old ones, I get errors on the com.android.internal.R.styleable.AnalogClock* objects: ""com.android.internal.R cannot be resolved""</p><p>How can I import these objects? I've read something about declare-styleable, but I cannot figure out how to apply that to my situation. (Sorry, I'm really a Java n00b)</p><p>For instance, the internal objects refer to several graphical things, such as dials, hour_hand and minute_hands.</p><p>Here's my code: <a href=""http://pastie.org/713276"" rel=""nofollow"">http://pastie.org/713276</a></p><p>Any help is very much appreciated, I am stuck after hours of Google.</p>","159814","","522374","","2013-05-29 08:22:28","2013-05-29 08:22:28","Overriding AnalogClock in Android","<java><android>","2","0","","",""
"1813398","1","","","2009-11-28 18:55:22","0","2458","<p>I am extending the IntentService class to run  a background service on Android. The service starts after bootup immediately. I want to pop-up a user input box from this service periodically. So, I tried calling an Activity from the service, but it doesn't help. The dreaded box of Force Close appears and the service dies.Can anybody suggest some methods to call activity from a background service?</p><p>Thanks!</p>","212464","","","","","2010-12-31 13:41:37","Android - Activity from a service?","<android><service><activity>","2","1","","",""
"1815457","1","","","2009-11-29 12:51:14","2","470","<p>I am trying to use a pre-existing native C library in my android project.. The library builds just fine with the NDK tools...</p><p>Now what I've come to understand is that I cannot just call into the library, but my library needs to include jni.h and add specific function declarations, like for example:</p><pre><code>JNIEXPORT jint JNICALL Java_com_MultPkg_Mult_mult(JNIEnv *, jobject, jint, jint);</code></pre><p>But since I'm using an existing library I that is also used on other platforms I don't like the idea of littering the whole code with these definitions that will only end up wrapping my real functions...</p><p>Is there a way around this? And if this really is the only way, is there any way to automatically generate these based on my existing C function declarations/definitions?</p><p>Much appreciated</p>","220830","","216063","","2009-12-14 18:10:28","2013-12-06 14:26:27","Android NDK: Autogenerate function declarations?","<java><android><jni><header><android-ndk>","2","0","","",""
"1815726","1","","","2009-11-29 14:55:32","4","1729","<p>When I run my app on my phone from eclipse, it always runs in debug. This has only recently started to happen. I guess I must have inadvertently changed a preference or something, but can't work out what. Does anyone know how I can switch it back so I can run without debugging?</p><p>Thanks in advance</p><p>TAO</p>","220864","","34088","","2009-12-01 08:30:04","2014-04-15 08:22:35","Run without debugging in eclipse","<android><eclipse><debugging>","4","0","","",""
"1816253","1","1816703","","2009-11-29 18:11:56","10","6697","<p>In an Android utility class, I want to get a system preference value in a class, but I don't have the context there, because the class that calls it doesn't have the context either. I've found that for Resources one can use the static <code>Resources.getSystem()</code> function. Is there any similar way for getting system preferences without context?</p><p>My class isn't an activity nor service. It's a utility class. Could give more info if needed.</p>","165293","","267542","","2010-03-04 17:33:33","2010-03-04 17:33:33","Getting Android's system preferences without having any context","<android><android-context>","3","1","3","",""
"1816371","1","","","2009-11-29 18:43:36","2","5548","<p>I need to call a web service using ksoap2, I have been doign this successfully up till the point where I need to pass a more complex type to the web service.</p><p>Does anybody have an example of passing a complex type to a webservice, preferably, only using SoapObject (the object in question is only Strings and dateTimes.</p><p>Thanksin advance</p>","219360","","","","","2012-05-10 14:01:05","ksoap2 complex parameter","<java><android><web-services><ksoap2>","4","0","","",""
"1816827","1","1816878","","2009-11-29 21:26:24","1","1492","<p>I am trying to move my code from Java to C, and I have encountered a problem while trying to find a function in C that can take an array of ints and create a bitmap from it for OpenGL.  In Java, I used </p><p><code>bitmap = Bitmap.createBitmap( {int array name} , w, h, Config.RGB_565);</code></p><p>Is there a similar function that I can use in C, or a workaround that I could use?</p><p>Also, if it matters, I am programming for Android.</p><p>Thanks!</p>","135135","","44729","","2010-06-18 18:03:39","2010-06-18 18:03:39","How to create bitmap from integer array in C / OpenGL","<java><c><android><opengl-es>","4","0","1","",""
"1817483","1","1817564","","2009-11-30 01:39:04","2","427","<p>I'm thinking about starting a crazy enough hobby project that would span across several years and would include disassembling &amp; OpenGL programming.<br>Having almost finished my 3rd Android app, I must say that I love the platform and will program for it.<br>Now, let's take the classic Carmageddon game as a porting candidate.  </p><p>The question boils down to:</p><ul><li>What tools have been used back then?</li><li>What specific knowledge would bevaluable for this kind of taks (math&amp; general gamedev knowledge aside)?</li></ul><p>EDIT:Legal questions aside.</p>","15187","","15187","","2009-11-30 01:46:53","2009-11-30 02:12:06","What does it take to port a classic game to a new platform?","<android><porting>","1","2","","",""
"1817742","1","","","2009-11-30 03:43:43","53","71224","<p>How can I capture a video recording on Android?</p>","","user221099","403455","","2012-08-30 19:14:32","2014-03-14 08:45:12","How can I capture a video recording on Android?","<android><video><recording><recorder>","5","1","40","",""
"1817828","1","","","2009-11-30 04:20:35","2","714","<p>I'm developing a google maps based application for android 1.6.</p><p>My problem is that in my application I have more than one layer that extends from ItemizedOverlay representing information in the map.</p><p>The problem is that all the layers implement the onTap method, but now only the last layer (on the top of the stack) detects the tap event, so If the user taps on an item that is in a deeper item the method onTap never fires.</p><p>Is there any way to propagate the event to deeper layers?</p>","185698","","114066","","2010-07-26 14:07:08","2010-07-26 14:07:08","Propagate events in several layers android google maps","<android><google-maps><android-mapview>","1","0","","",""
"1818008","1","","","2009-11-30 05:39:45","0","325","<p>I  want  to  add  a  Button    In   The  Progress  Bar.</p><p>Scenario  is :-</p><pre><code>           1) I want  To search   a contact through Application.            2) During the Search I will  show Progress Bar.             3)Can I add  cancel   button  in the Progresss Bar.</code></pre><p>Thanks in Advance.Raj.Android Developer.</p>","","raj","","","","2009-11-30 09:24:42","Regarding Progress Bar","<android>","1","0","1","",""
"1818214","1","","","2009-11-30 06:47:33","1","708","<p>I'm not sure if this is a bug or not with Android OS 1.5, but when I set an OnClickListener for an EditText, then try clicking it (using trackball), the IME keyboard no longer displays itself. With a click listener set, it displays when clicked.</p><p>Is there another way I can request the IME keyboard to come up in the click handler? Either that, or I can add an OnTouchListener (which works correctly with IME keypad + touch) and just do something like performMotionEvent() from the click listener to simulate a real touch?</p><p>Thanks</p>","137193","","","","","2009-11-30 06:47:33","IME keyboard does not show when OnClickListener set for EditText?","<android>","0","0","","",""
"1818613","1","","","2009-11-30 08:58:17","1","582","<p>Is there a way to register to receive notifications fired from Notification Manager from non-system apps?  For example, application A sends an notification through Notification Manager, application B could then receive the notification, but not interfere with,and then process information contained within the notification.</p><p>Typically I know this type of communication would typically be handled through broadcast intents, but the developers of application A have stated that given a lack of development resources they are unlikely to add these broadcasts in any releases in the near future. </p><p>Thanks</p>","","user221188","","","","2010-01-01 22:00:04","Receive Android NotificationManager Notifications from Non System Apps","<android>","1","0","","",""
"1818633","1","","","2009-11-30 09:01:50","3","3973","<p>I'm currently using a ListView that I fill with a custom adapter with RelativeLayout's. The problem is that the margins are not displayed for the RelativeLayout. </p><p>Here is my relative layout declaration : </p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/ArticleSnippet""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:padding=""6dip""     android:layout_marginTop=""10dip""     android:layout_marginLeft=""10dip""     android:layout_marginRight=""10dip""     android:background=""@drawable/background_snippet"" &gt;     ... &lt;/RelativeLayout&gt;</code></pre><p>The ListView declaration : </p><pre><code>&lt;ListView     android:id=""@+id/ArticleSnippets""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:divider=""#fff""     android:dividerHeight=""0sp""&gt; &lt;/ListView&gt;</code></pre><p>Is there anything special to do to make the margin active inside a ListView ? </p><p>Thanks in advance for any help,</p><p>Lint (Dusariez JF) </p>","221204","","221204","","2009-11-30 12:25:15","2011-07-20 16:38:23","RelativeLayout margins inside a ListView are not displayed","<android>","3","2","1","",""
"1819142","1","1819170","","2009-11-30 11:01:35","68","49148","<p>What's a good technique for validating an e-mail address (e.g. from a user input field) in Android? <a href=""http://commons.apache.org/validator/apidocs/org/apache/commons/validator/routines/EmailValidator.html"">org.apache.commons.validator.routines.EmailValidator</a> doesn't seem to be available. Are there any other libraries doing this which are included in Android already or would I have to use RegExp?</p>","184367","","811","","2011-12-07 22:57:39","2013-12-12 10:03:49","How should I validate an e-mail address on Android?","<java><android><email><validation>","19","1","40","",""
"1819508","1","1838326","","2009-11-30 12:24:10","3","5001","<p>Greetings, </p><p>I would like to place an image over a surfaceview. However I would like the image to be transparent so you can see the image and also the undlying surfaceview. Can anyone suggest how I could do this?</p>","84278","","","","","2010-04-15 06:32:33","Android : Make image opaque / transparent","<android>","1","2","1","",""
"1820546","1","1823332","","2009-11-30 15:39:05","1","1883","<p>I am a little bit new to developing for Android using Eclipse (Coming from a .NET/Visual Studio background). My biggest problem in developing Android app is ""debugging"" them. Every time the emulator throws an error, there is no message, no explanation of what caused the error. I basically have to keep doing trial/error until something works.</p><ul><li><p>My question is: Is there a better way to analyze the error messages that emulator shows (basically some stack trace about Dalvik)!</p></li><li><p>Also, is it possible in Eclipse [when debugging] to move the debugging cursor backwards to re-evaluate a variable or ""skip"" some lines of code?</p></li></ul>","61525","","85421","","2010-01-01 16:56:17","2010-11-25 02:27:07","Android - Having a hard time debuging Eclipse","<android><eclipse><debugging><android-emulator>","3","0","1","",""
"1821847","1","","","2009-11-30 19:23:59","2","859","<p>I have an issue with identifying return to application after it was left using Home click.</p><p>The main purpose of this is to define when do I have to display to user Type Password dialog.</p><p>So, let's imaging such workflow, User works in application and decides to see what's the weather tomorrow. The User clicks Home button and is transfered to desktop. Now he goes back to My application. At this point we have to verify that our User is still the right one User by proposing him to type password.</p><p>How can I identify this condition here? (returning after leaving by Home click)</p><p>Thanks</p>","139394","","17516","","2009-12-01 14:31:33","2011-12-13 12:23:56","Android. Catch application exit by Home click","<android><workflow>","1","0","1","",""
"1821871","1","","","2009-11-30 19:27:33","74","50651","<p>I have a simple ListActivity that uses a custom ListAdapter to generate the views in the list.  Normally the ListAdapter would just fill the views with TextViews, but now I want to put a button there as well.</p><p>It is my understanding and experience however that putting a focusable view in the list item prevents the firing of onListItemClick() in the ListActivity when the list item is clicked.  The button still functions normally within the list item, but when something besides the button is pressed, I want onListItemClick to be triggered.</p><p>How can I make this work?</p>","131871","","967945","","2013-03-30 12:52:34","2013-03-30 12:52:34","How to fire onListItemClick in Listactivity with buttons in list?","<android><android-widget><android-listview>","9","6","38","",""
"1822630","1","5709384","","2009-11-30 21:49:35","4","1000","<p>I want to build two Android apps from the same code base.  The difference between the apps is very small - app name, one or two resource files, and whether to show ads or not (basically, a free and a paid version of the same app).</p><p>This is pretty simple to do in XCode for an iPhone app, but I'm not sure how to approach it in Eclipse.  Is there a clean way to do it, or should I forget about Eclipse completely and dive into the Ant scripts?</p>","114874","","","","","2011-04-18 21:58:50","Two Android apps in the same Eclipse project?","<java><android><eclipse>","3","0","1","",""
"1822983","1","3300242","","2009-11-30 22:51:16","0","6191","<p>I'm trying to use android.media.MediaRecorder to record video, and no matter what I do the android runtime segmentation faults when I call prepare(). Here's an example:</p><pre><code>public void onCreate(Bundle savedInstanceState){    Log.i(""video test"", ""making recorder"");    MediaRecorder recorder = new MediaRecorder();    contentResolver = getContentResolver();    try {        super.onCreate(savedInstanceState);        Log.i(""video test"", ""--------------START----------------"");        SurfaceView target_view = new SurfaceView(this);        Log.i(""video test"", ""making surface"");        Surface target = target_view.getHolder().getSurface();        Log.i(""video test"", target.toString());        Log.i(""video test"", ""new recorder"");        recorder = new MediaRecorder();         Log.i(""video test"", ""set display"");        recorder.setPreviewDisplay(target);        Log.i(""video test"", ""pushing surface"");        setContentView(target_view);        Log.i(""video test"", ""set audio source"");        recorder.setAudioSource(MediaRecorder.AudioSource.MIC);        Log.i(""video test"", ""set video source"");        recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);        Log.i(""video test"", ""set output format"");        recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);        Log.i(""video test"", ""set audio encoder"");        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);        Log.i(""video test"", ""set video encoder"");        recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);        Log.i(""video test"", ""set max duration"");        recorder.setMaxDuration(3600);         Log.i(""video test"", ""set on info listener"");        recorder.setOnInfoListener(new listener());         Log.i(""video test"", ""set video size"");        recorder.setVideoSize(320, 240);         Log.i(""video test"", ""set video frame rate"");        recorder.setVideoFrameRate(15);         Log.i(""video test"", ""set output file"");        recorder.setOutputFile(get_path(this, ""foo.3gp""));        Log.i(""video test"", ""prepare"");        recorder.prepare();         Log.i(""video test"", ""start"");        recorder.start();        Log.i(""video test"", ""sleep"");        Thread.sleep(3600);        Log.i(""video test"", ""stop"");        recorder.stop();        Log.i(""video test"", ""release"");        recorder.release();        Log.i(""video test"", ""-----------------SUCCESS------------------"");        finish();    } catch (Exception e) {        Log.i(""video test"", e.toString());        recorder.reset();        recorder.release();        Log.i(""video tets"", ""-------------------FAIL-------------------"");        finish();    }}public static String get_path (Context context, String fname) {    String path = context.getFileStreamPath(""foo"").getParentFile().getAbsolutePath();    String res = path+""/""+fname;    Log.i(""video test"", ""path: ""+res);    return res;}class listener implements MediaRecorder.OnInfoListener {    public void onInfo(MediaRecorder recorder, int what, int extra) {        Log.i(""video test"", ""Video Info: ""+what+"", ""+extra);    }}</code></pre>","65846","","213269","","2011-08-12 09:09:32","2013-11-29 14:31:16","How do I use MediaRecorder to record video without causing a segmentation fault?","<android><video><camera><phone><mediarecorder>","2","1","","",""
"1823069","1","","","2009-11-30 23:14:22","1","1872","<p>HI,</p><p>I have 2 projects (each has its own apk). Can you please tell me how can I launch an activity which is in another apk that I created?I have this activity which I want to launch from another project:                             // what should I put in here so that I can launch this from another activity in another project?                    </p>","125440","","","","","2011-02-02 23:11:40","How can I launch an activity in another apk?","<android>","2","0","","",""
"1823432","1","1827930","","2009-12-01 01:09:21","1","1172","<p>Posted: Mon Nov 30, 2009 5:08 pm    Post subject: Simple Problem With Intent Extras Hello, </p><p>I'm working on an app widget for the home screen. I'm trying to make it so when a user taps on the widget it changes the data being displayed in the widget. However, I'm also allowing multiple instances of widgets open with different data. So in order to tell my method which widget to update, I'm adding an extra to the intent that is launched to change the data. </p><p>Here's the intent I have: Java:</p><pre><code>Intent changeData = new Intent(""com.tonycosentini.mintdroid.CHANGE_DATA""); changeData.putExtra(""widget_id"", currentWidgetId); PendingIntent changeDataPendingIntent = PendingIntent.getBroadcast(this, 0, changeData, 0); //This will return the correct value, but if I call it in my onreceive() method it won't.Log.v(TAG, ""stored id is: "" + changeData.getIntExtra(""widget"", 0);</code></pre><p>This correctly stores the widget id, but when the change data method is called, the widget id that is read from the intent is the first widget instance. That is, there is is a for loop that generates all of the widgets and no matter what widget you tap, the widget id that is recieved is always the first widget id in the first widget. </p><p>Anyone have an idea on how to solve this? Hopefully I didn't word it too poorly. </p><p>Thanks for reading, Tony</p>","215056","","215056","","2009-12-01 01:14:24","2011-02-18 13:38:33","Simple Problem With Intent Extras","<android><android-intent>","1","0","1","",""
"1823498","1","1824651","","2009-12-01 01:28:57","2","640","<p>I create a CursorAdapter to provide data for my ListView.</p><p>I implement the bindView() method to show data in a row of my Listview.But at the end of my bindView, I add an clickListener to it.  But when I run it on emulator, I don't see any print statement.</p><p>Can you please tell me how to add event handling in a row in ListView?</p><pre><code>view.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            System.out.println ("" getting an onclick event...."");     }});</code></pre>","125440","","60261","","2009-12-01 18:16:10","2009-12-01 18:16:10","How can I add event handling in each row in ListView","<android>","1","0","0","",""
"1823660","1","","","2009-12-01 02:37:24","1","1076","<p>Having a problem loading an array into a spinner that is located on a different view.  The array is defined properly in arrays.xml with a name of beerstyles.  The beerstylespinner is defined as the id of a spinner in <code>carbonationcalculator_view.xml</code>.  This works when the code is in the main java class but not the additional carbonationcalculator class.  Everything works with the exception of the spinner not being populated with the array.</p><p>Here is the code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.carbonationcalculator_view);    Spinner s = (Spinner) findViewById(R.id.beerstylespinner);    ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(            this, R.array.beerstyles, R.layout.carbonationcalculator_view);    adapter.setDropDownViewResource(R.layout.carbonationcalculator_view);    s.setAdapter(adapter);}</code></pre>","221776","","60261","","2009-12-01 18:08:42","2010-02-02 12:00:07","Using a spinner on another view with a different class defined (Android)","<android><views><spinner>","1","0","","",""
"1823724","1","1826062","","2009-12-01 03:01:53","5","5797","<p>i am currently have a hard time for calling to getApplicationContext().setTheme() in a activity,i just want to apply a theme resource in a application scope instead of activity scope in code style,but the trouble is that this does not work at all,can anybody explain to this,thanks a lot!</p><p>He is the code skeleton:</p><pre><code>public class StartUp extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {	/*	 * setTheme(android.R.style.Theme_Black_NoTitleBar_Fullscreen);	 * //that works!	 */	this.getApplicationContext().setTheme(			android.R.style.Theme_Black_NoTitleBar_Fullscreen);	super.onCreate(savedInstanceState);	setContentView(R.layout.main);}</code></pre><p>}</p>","221778","","221778","","2009-12-01 08:39:02","2012-03-27 16:47:22","Why getApplicationContext().setTheme() in a Activity does not work?","<android><themes>","5","0","1","",""
"1824127","1","1827170","","2009-12-01 05:14:15","1","610","<p>how to give background colour to textview in android?</p>","217065","","","","","2009-12-01 16:05:46","how to give background colour to textview in android?","<android>","1","0","","",""
"1824316","1","","","2009-12-01 06:16:09","0","424","<p>When  I   rotate   my Screen from horizontal   to  verticalAll  the  text  I have entered is cleared.How    to mainTain the state.</p>","","raj","","","","2009-12-01 07:07:26","Maintaining State","<android>","1","2","","",""
"1825067","1","","","2009-12-01 09:38:18","0","1334","<p>I try to add myLocationOverlay to the map. It was not there at first, then when I send the gps position from the ddms, then the blue shining dot appear.</p><p>However, after awhile, the blue dot disappear and no where to be found. why?</p><p>How can I keep the blue dot appearing in the map? thx!!!</p>","210235","","","","","2011-01-10 05:11:52","Android google map myLocationOverlay disappears?","<android><google-maps>","1","2","2","",""
"1826535","1","","","2009-12-01 14:29:10","5","2809","<pre><code>SSLContext context = SSLContext.getInstance(""SSL"");</code></pre><p>The above line results in the exception: </p><pre><code>java.security.NoSuchAlgorithmException: SSLContext SSL implementation not found</code></pre><p>I'm using <code>Android 2.0 SDK</code> and when specifying <code>""TLS""</code>, it is accepted.</p><p>How come I get the exception? Doesn't Android support SSL?</p>","221431","","750613","","2012-07-10 09:41:39","2012-07-10 09:41:39","Android NoSuchAlgorithmException: ""SSLContext SSL implementation not found""","<android><ssl><https><tls>","1","0","2","",""
"1826829","1","1826931","","2009-12-01 15:14:46","3","1066","<p>Is Android backwards compatible, in other words can an application developed in Android 1.6 run in Android 2.0?</p><p>I just published a 2.0 application and discovered that I can't find it in the market using my G1 (Android 1.6) phone. But apparently others are downloading it.</p><p>Should I downgrade the application to 1.6 or do I need to create separate applications for each Android version? </p>","61525","","","","","2010-01-28 03:48:53","Android - Can an app developed in Android 1.6 run in Android 2.0?","<android><android-version>","4","0","0","",""
"1827130","1","","","2009-12-01 15:59:28","7","10500","<p>Given that scripting is not natively supported in Android and wrapping libraries like  javax.script.ScriptEngine  into your app will make it too large, is it possible to send a javascript string to an invisible WebView and have it evaluate the string and return you the results (another string)?</p><p>I want to go this route because I want to save all my scripts to disk so my app can remain small.</p><p><strong>Edit</strong> </p><p>I need Java code to evaluate javascript strings not the other way around. <strong>addJavascriptInterface()</strong> doesn't help.</p>","61525","","61525","","2009-12-02 16:09:15","2009-12-02 16:54:06","Android - Use WebView to evaluate a javascript string and return the value","<android><webview><android-scripting>","1","1","2","",""
"1827751","1","2504840","","2009-12-01 17:40:44","62","33441","<p>I want to use the marquee effect on a TextView, but the text is only being scrolled when the TextView gets focus. That's a problem, because in my case, it can't.</p><p>I am using:</p><pre><code>  android:ellipsize=""marquee""  android:marqueeRepeatLimit=""marquee_forever""</code></pre><p>Is there a way to have the TextView always scroll its text? I've seen this being done in the Android Market app, where the app name will scroll in the title bar, even if it doesn't receive focus, but I couldn't find this being mentioned in the API docs.</p>","127013","","244296","","2010-10-26 06:09:33","2012-12-16 14:07:52","Is there a way to make ellipsize=""marquee"" always scroll?","<android><textview><marquee>","7","0","51","",""
"1828229","1","","","2009-12-01 19:12:58","1","1481","<p>I have a database that gets updated by a background thread. Is is possible for the UI ouput(using a listview) to change when a database entry is added/deleted? I've seen examples of using <code>SimpleCursorAdapter</code> and <code>listViewAdapters</code> and I'm not sure which to use and if it would even work.</p><p>I found an ""efficient"" listViewAdapter which would work great for me since it doesn't call findViewById often and I can change the data structure to hold exactly what I need, but I don't know how to hook it into my database adapter so it dynamically updates the output when there is a database change. Example: <a href=""http://www.androidsnippets.org/snippets/125/"" rel=""nofollow"">http://www.androidsnippets.org/snippets/125/</a></p><p>Thanks for any advice.</p>","222361","","750613","","2012-07-10 09:41:10","2012-07-10 09:41:10","Android: Can listviews dynamically update the UI output when the database it's binded to changes?","<database><android><listview>","1","0","","",""
"1828448","1","1831815","","2009-12-01 19:51:16","17","15837","<p>Is it possible to create a custom library in Android (having its own layout resources) for use across several Android applications?</p><ul><li><p>I created a regular *.jar file but when I tried to create/style my views dynamically most of the properties do not work. Even referencing simple styles from the android.jar file such as <em>android.attr.listSeparatorTextViewStyle</em> did not work.</p></li><li><p>I created an Android project without any Activity, having its own resource files and then referenced this project from another Android project to use in its build path. Everything seems to work fine but the emulator keeps crashing (with no meaningful error message in the <strong>LogCat</strong>) when I try to run the project.</p></li></ul><p>Am I missing something?</p>","61525","","102536","","2013-03-25 17:34:29","2013-05-03 18:39:54","Android - Is it possible to create a custom library to use across several applications?","<android><custom-view>","4","0","6","",""
"1830391","1","","","2009-12-02 02:56:13","15","10966","<p>I am writing an Android app where one of the features is that the map will rotate according to the compass (i.e. if the phone is pointing east, the map will be oriented so that the east side of the map is on top). Previous answers that I have found suggested over writing the onDraw() method in mapView, however, the api changed the method to final so it cannot be overwritten. As a result I have tried to overwrite the <code>dispatchDraw()</code> method like so:</p><p>Note:</p><p>-compass is a boolean that if true, rotate the view</p><p>-bearing is a float variable that has the degrees that the view should rotate</p><pre><code>protected void dispatchDraw(Canvas canvas) {    canvas.save();         if (compass) {             final float w = this.getWidth();             final float h = this.getHeight();             final float scaleFactor = (float)(Math.sqrt(h * h + w * w) / Math.min(w, h));             final float centerX = w / 2.0f;             final float centerY = h / 2.0f;             canvas.rotate(bearing, centerX, centerY);             canvas.scale(scaleFactor, scaleFactor, centerX, centerY);         }         super.dispatchDraw(canvas);         canvas.restore();}</code></pre>","222578","","750613","","2012-07-10 09:40:36","2012-10-28 04:59:44","Rotate MapView in Android","<android><google-maps><map><rotation><android-mapview>","4","2","14","",""
"1830567","1","1831081","","2009-12-02 03:58:35","0","1985","<p>how to <code>reduce</code> the size of listview width by using  xml in android?</p>","217065","","750613","","2012-07-10 09:40:13","2012-07-10 09:40:13","how to reduce the size of listview width using xml in android?","<android>","1","1","","",""
"1831162","1","1831196","","2009-12-02 07:15:46","0","628","<p>I want to open a screen when use click @ search button on the handset... how can i know that search button is pressed over the handset ?? </p>","216431","","","","","2011-06-02 08:16:05","Search button event on the handset","<android><search>","1","0","","",""
"1831440","1","5638861","","2009-12-02 08:30:07","12","14085","<p>I feel a bit blind developing on an emulator for Android and not being able to see the file system on the AVD (.img).</p><p>Is there a way to mount it in Windows or Linux, so that I could at least see the file listing and maybe contents?</p><p>Bonus if it's mounted with write permissions as well.</p><p>Thank you.</p>","47680","","","","","2013-01-15 11:39:57","Is there a way to mount Android .img to access the AVD (Android Virtual Device) contents?","<android><virtual><disk><mount><avd>","6","0","3","",""
"1831490","1","1836392","","2009-12-02 08:39:27","2","5655","<p>I just registered an OnLongClickListener on my my MapView on an Android app I'm currently writing. For some reason however the onLongClick event doesn't fire.</p><p>Here's what I've written so far:</p><pre><code>public class FriendMapActivity extends MapActivity implements OnLongClickListener {    private static final int CENTER_MAP = Menu.FIRST;    private MapView mapView;    private MapController mapController;    //...    private boolean doCenterMap = true;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.friendmapview);        this.mapView = (MapView) findViewById(R.id.map_view);        this.mapController = mapView.getController();        mapView.setBuiltInZoomControls(true);        mapView.displayZoomControls(true);        mapView.setLongClickable(true);        mapView.setOnLongClickListener(new OnLongClickListener() {            public boolean onLongClick(View v) {                //NEVER FIRES!!                return false;            }        });        //...    }    @Override    public boolean onKeyDown(int keyCode, KeyEvent event) {        switch (keyCode) {        case KeyEvent.KEYCODE_3:            mapController.zoomIn();            break;        case KeyEvent.KEYCODE_1:            mapController.zoomOut();            break;        }        return super.onKeyDown(keyCode, event);    }    @Override    public boolean dispatchTouchEvent(MotionEvent ev) {        int actionType = ev.getAction();        switch (actionType) {        case MotionEvent.ACTION_MOVE:            doCenterMap = false;            break;        }        return super.dispatchTouchEvent(ev);    }        ...}</code></pre><p>May overlays which I'm adding cause the problem?? Any suggestions?</p>","50109","","918414","","2013-03-16 03:14:47","2013-03-16 03:14:47","Android OnLongClickListener not firing on MapView","<java><android><google-maps><mobile>","4","0","3","",""
"1831952","1","1839375","","2009-12-02 10:17:12","1","2708","<p>I am doing a project where I have too develop an application that listens for incoming events by a service. The device that has to listen too events is an Android phone with Android SDK 1.5 on it. Currently the services that call events only implement communication trough UDP or TCP sockets. I can solve my problem by setting up a ServerSocket, but i doubt that's the most power efficient way. This application will be running most of the time, with Wi-Fi on, and I'd like too reach an long battery duration. I've been looking for options on the internet for my question for a while but i couldn't get a real answer. I've got the following questions:</p><ul><li>What is the most efficient way too listen to incoming events? Should I make an ServerSocket? or what are my options?</li><li>Are there any other implementations that are more power efficient?</li></ul><p>Ive been also thinking of implementing communication trough XMPP. Not sure if this is the best way. I'm not forced too an specific implementation. All suggestions are welcome!</p><p>Thanks for the help,</p><p>Antek</p>","218610","","164901","","2010-03-20 18:50:36","2010-03-20 18:50:36","Server socket programming in Android 1.5, most power efficient way?","<android><sockets><power-management>","1","0","1","",""
"1832006","1","5942457","","2009-12-02 10:27:13","0","140","<p>is there a way to render a string resource (from <code>strings.xml</code>) in an ImageView?</p><p>Thanks </p>","168954","","750613","","2012-07-10 09:39:49","2012-07-10 09:39:49","Android: Render a string in an imageview","<android>","1","2","","",""
"1832290","1","1833639","","2009-12-02 11:17:37","24","10080","<p>I'm currently programming an application for the Android. Now what I found out is that you cannot place resource objects, say, an image in the drawable folder and name it like ""myTestImage.jpg"". This will give you a compiler error since camel case syntax is not allowed, so you'd have to rename it like ""my_test_image.jpg"".</p><p>But what about ids you define in the XML file. Say you have the following definition</p><pre><code>&lt;TextView android:id=""@+id/myTextViewFirstname""              android:layout_width=""wrap_content""              android:layout_height=""wrap_content""              android:text=""Firstname"" /&gt;</code></pre><p>This is a valid definition, compiles and works just fine on my Android emulator although - as you see - I'm specifying the id in camel case syntax.</p><p>Now, the Android samples always use lower case and underscore. Is this just a naming convention to use lower case with underscore for the id's or may it cause problems on the real device?</p><p>Thx</p>","50109","","918414","","2013-03-16 03:14:18","2014-02-19 11:00:08","Android id naming convention: lower case with underscore vs. camel case","<android><mobile>","6","0","10","",""
"1832505","1","","","2009-12-02 12:03:16","3","445","<p>how to keep icons in listview in android?</p>","217065","","","","","2012-03-23 10:16:17","how to keep icons in listview in android?","<android>","3","0","1","",""
"1832759","1","","","2009-12-02 13:00:46","2","3039","<p>Is there any way to create triggers on different databases? my requirement is like:-</p><pre><code> database: a1.db consist table: t1 database:a2.db  consist table: t2</code></pre><p>now i have to use trigger on t1 (whenever any delete and update operation) happens on t1 a value has to be inserted into t2.</p><p>waiting for your feedback...</p>","117519","","750613","","2012-07-10 09:39:24","2012-07-10 09:39:24","creating trigger across different databases","<mysql><android><sqlite>","3","1","1","",""
"1834567","1","1835060","","2009-12-02 17:38:44","6","2928","<p>My application stores data locally in the native SQLite db, and I want to allow users to export this data by emailing themself a .csv file. In order to do this I'm generating the .csv from the database and writing it to the SD card, then attaching it to an email:</p><pre><code>StringBuilder csv = generateFile();writeFile(csv.toString(),""file.csv"");Intent email = new Intent(android.content.Intent.ACTION_SEND);email.setType(""application/octet-stream"");email.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse(""file://sdcard/file.csv""));</code></pre><p>Which all works great. What I'm wondering, though, is if it is possible to skip the step of writing to SD first, and directly attach the data.</p>","58164","","","","","2009-12-02 18:59:22","Android: possible to attach a file to email without writing to SD?","<android><email><uri>","1","3","1","",""
"1835006","1","","","2009-12-02 18:51:00","2","764","<p>Folks,</p><p>I have an imageView that I am moving around on top of another imageview. It's kind of circle selector. Its working fine, except that when I click a button elsewhere in the activity, the imageview is moving back to where it starts.</p><p>Here is the code for  when I move it.</p><pre>int upperLeftCornerX = (int)(mLastXTouchSetOval - mClipOvalWidth/2);    	int upperLeftCornerY = (int)(mLastYTouchSetOval - mClipOvalHeight/2);    	mImageOval.layout(upperLeftCornerX, upperLeftCornerY, upperLeftCornerX+mClipOvalWidth, upperLeftCornerY+mClipOvalHeight);</pre><p>The <code>mLastXTouchSetOval</code> and <code>mLastYTouchSetOval</code> are set by a touch event. This works, but as I said, as soon as I click a button on the activity, the mImageOval goes back to the top left corner where it started.</p><p>Any ideas?</p><p>Thanks,-Dave</p>","223141","","1431","","2009-12-02 19:02:18","2009-12-02 19:02:18","Moving an ImageView","<android>","0","0","","2011-09-02 06:02:48",""
"1835473","1","2031848","","2009-12-02 20:11:47","1","1262","<p>(<s>Code is for Android</s> Actually, I need code to be portable between Android and Java SE.)</p><p>I want to have a ""settings"" class with various game settings, like</p><pre><code>public int map_size;public String server_name;</code></pre><p>etc.</p><p>The data needs to be accessed fairly frequently (so members, not a key-value map), and from time to time de/serialized in some standard way (mainly to send it through network).</p><p>I want to be able to</p><ol><li><p>Serialize and deserialize the object into XML or JSON, without having to explicitly write the code for every member (but still having some degree of control over the format).</p></li><li><p>Define some (constant) meta-data about every member (default value, GUI name, XML identifier, ...), in a way that allows for easy modification in the source code (I want to be able to add a new meta-property, define a default value for it, and not have to specify it everywhere else).</p></li></ol><p>1 is achievable by using reflection. I thought Java annotations for class members would be perfect for 2:</p><pre><code>@Setting(id = ""server_name"", name = ""Server title"", default = ""Server0"")public String server_name;</code></pre><p>But it looks like (user-defined) annotations don't work in Android yet - code using them crashes the compiler...</p><p><b>What would be the easiest way to store the meta-data about the settings</b> (or another way to approach all this)?</p><ul><li><p>Store information about settings in some external XML file?</p></li><li><p>Store it in a Java data structure, with content defined in the code? Defining the data in this way somehow seems very unwieldy, especially compared to keyword arguments of annotations.</p></li><li><p>?</p></li></ul>","78145","","78145","","2009-12-02 21:31:51","2010-01-09 00:55:15","Java ""settings object"", serialization/deserialization","<java><android><reflection><annotations>","3","0","1","",""
"1835999","1","","","2009-12-02 21:38:58","0","793","<p>I have a simple ListView in my layout.xml file.</p><pre><code>&lt;ListView android:id=""@+id/action_list""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;</code></pre><p>And in my javacode, I add a setOnItemClickListener() to my listview:</p><pre><code>listView.setOnItemClickListener(new OnItemClickListener() {    public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {        System.out.println (""get onItem Click position= ""+position);    }});</code></pre><p>But when I run on G1. I don't see any print out when I click an item on the ListView on the phone.Or when I select an item using track ball and press CENTER.</p><p>Can you please tell me why to resolve my problem?</p><p>Thanks in advance.</p>","125440","","60261","","2009-12-02 21:50:13","2009-12-02 21:53:12","ListView not responding to Click or KeyPress","<android>","1","0","","",""
"1836155","1","1837859","","2009-12-02 22:03:10","4","2239","<p>Say, an app declared itself as</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p>Is there a way for a user (or another app) to revoke that permission (w/o iptables of course)?</p>","15187","","","","","2013-01-06 01:02:47","Revoking permissions for an android app?","<android>","3","2","","",""
"1836171","1","1949769","","2009-12-02 22:06:05","3","10677","<p>As a newbie to Android development, I'm trying to do the basics and build a media player. It works fine in one activity, but I'm now moving the MediaPlayer stuff to a remote service so it can carry on after the activity is destroy. I've moved the necessary code to the service, left comments in the activity where I'll need to call service methods, implemented my AIDL and it all builds with no errors (Eclipse).</p><p>However, I'm totally stumped as to how to call IPC methods. Are there any simple and minimal examples with no fat - just the bare essentials?</p><p>As I'm using IPC methods, I don't need to use onStart() at all - right? (I intend to use LoadFile(File path), and then have public void considerDeath() { if (!isPlaying()) { MyService.stopSelf(); } } method called from activity.onDestroy )</p><p>/guide/developing/tools/aidl.html has multiple binders, but when I use the mSecondaryConnection portion, I get ""<strong>MyService.Stub cannot be resolved</strong>""</p><p>I've tried <a href=""http://www.anddev.org/remote_service_tutorial-t8127.html"" rel=""nofollow"">http://www.anddev.org/remote_service_tutorial-t8127.html</a> which seems to confuse things by overloading methods.</p><p>I can't find anything by Mark Murphy either on the subject :(</p>","202807","","750613","","2012-07-10 09:36:08","2012-07-10 09:36:42","Android bindService / remote services - any basic examples?","<android><service>","1","5","2","",""
"1837512","1","","","2009-12-03 03:51:49","1","987","<p>I'm having trouble with my activities when they go in the background. I have two activities, A and B. Only A can launch B (manifest copied below). This is what I do:</p><ol><li>Launch the app from the app drawer (activity A)</li><li>There's a button on A to launch B, B now is displayed.</li><li>Hit the Home key, my app is now in the background.</li><li>Go to the app drawer again, hit my app icon.</li><li>Instead of resuming at ActivityB, Activity A is launched again. Why?</li><li>If I hit the Back key now, I get shown the old ActivityB. What?</li></ol><p>This is very confusing. It's like Android knows my app is running, and puts a new instance of A on top of the old B instance running. I'd just expect that the application gets paused in-place, and whenever the user hits the app icon again, it just picks up where it left off (in this case, just show B again!) Below is the manifest, and the activity classes for this test are completely empty (except A which has a button to launch B).</p><pre><code>&lt;activity android:name="".ActivityA""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".ActivityB""          android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;        &lt;!--             &lt;action android:name=""android.intent.action.VIEW"" /&gt;             --&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre>","137193","","","","","2012-04-28 07:49:09","Not understanding Activity stack?","<android>","4","1","2","",""
"1837993","1","","","2009-12-03 06:12:41","2","1263","<p>I have a requirement wherein I need a list of all the contacts that are edited/changed. </p><p>As per the <a href=""http://developer.android.com/reference/android/provider/Contacts.People.html#_SYNC_DIRTY"" rel=""nofollow"">Android documentation,</a></p><pre><code>_SYNC_DIRTY</code></pre><p>will be set every time a contact is edited. But, there seems to be a <a href=""http://code.google.com/p/android/issues/detail?id=4617"" rel=""nofollow"">bug</a> in this, which makes this always set to 1 (no matter what), even is we explicitly set it to 0.</p><p>So, I was wondering if I can create a SQLite TRIGGER on the contacts database. Such that, everytime a contact is edited, the edited contact id is populated into a different table which I can read later from my application.</p><p>I tried this...</p><pre><code>CREATE TRIGGER IF NOT EXISTS updated_contacts UPDATE ON 'contacts.db'.phones            BEGIN            INSERT INTO updated_table SET updated_id=old.person;            END;</code></pre><p>But a few problems here...</p><p>1) 'phones' is a table in the contacts database. but, I am not sure about the name of the contacts database (here I have assumed it to be 'contacts.db').</p><p>2) updated_table is a table on a different database '<code>mydatabase.db</code>' that I have created from my application. and, I am not sure if I can set <code>TRIGGERS</code> across different databases.</p><p>All this in Android 1.6</p><p>Also, I am not sure about the permission to access native contacts database on Android.</p><p>Is there any other way of achieving this.</p><p>Any info regarding this would be of great help.</p><p>Thanks.</p>","124205","","750613","","2012-07-10 09:35:27","2012-07-10 09:35:27","How to set trigger on contacts database in Android","<java><mysql><android><sqlite3>","1","0","1","",""
"1838055","1","","","2009-12-03 06:28:07","4","2644","<p>I am using <code>android.media.MediaPlayer</code> object to play audio files in my app. Everything works fine but when a phone call comes while a song is playing the app does not pause the media player and you can hear the song during the phone call. Please tell me how to pause media player on a phone call and again resume it after call is ended.</p>","152867","","76835","","2009-12-03 19:29:27","2012-10-26 07:49:23","Pause music player on a phone call and again resume it after phone call in android","<android>","3","0","","",""
"1838083","1","1846607","","2009-12-03 06:34:43","0","3082","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1843911/android-detect-when-another-activity-is-launched-or-your-activity-loses-focus"">Android: Detect when another Activity is launched (or your activity loses focus)</a>  </p></blockquote><p>I need be able to tell if Activity.onStop() was called because my application is moving to a new activity, or if it was closed because the user pressed the ""Home"" key or hit the back button from the bottom of the activity stack.</p><p>The reason is because I need to know when it is appropriate to shut off music that is playing in my application (A game). There is nothing more annoying than hitting home and having something playing music in the background.</p><p>However, Activity.OnStop() is called for each activity change, and I don't want to suspend music when moving between multiple activities in my app. I just can't find a way to differentiate between going home and going to a internal activity.</p><p>Am I perhaps hooking into the wrong events?</p><p>Any advice?</p>","1965","","1965","","2009-12-03 15:56:10","2009-12-04 12:19:20","Android: How do I know if Activity.onStop() is being called because the user is going back to Home?","<java><android>","3","0","","2012-07-25 12:24:27",""
"1838140","1","1838234","","2009-12-03 06:49:29","5","22102","<pre><code>public static final String readURL(String url)throws Throwable{		try {			InputStream in = (InputStream) fetch(url);			byte[] bArr = readBytes(in);			return new String(bArr);		} catch (Throwable e) {			throw e;			}}public static final Object fetch(String address) throws MalformedURLException,IOException {	URL url = new URL(address);	Object content = url.getContent();	return content;}</code></pre><p>I am behind a proxy and when I try </p><p>readURL(""http://abc.com"")</p><p>to access URL <a href=""http://abc.com"" rel=""nofollow"">http://abc.com</a> it throws java.net.UnknownHostException:I have:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p>in manifest file.</p><p>Any quick solutions?</p>","216431","","300311","","2011-12-13 16:19:32","2013-06-28 17:31:49","How do I fix this UnknownHostException?","<java><android><url>","4","2","","",""
"1838770","1","1880935","","2009-12-03 09:33:43","3","6785","<p>I am working on a XMPP client on Android, using the Smack library. The roster/messaging/presence stuff is running very well. However, I didn't find a way to store additional profile information (userpicture, the dogs name, ...).</p><p>The only way I see from googling is using VCards. But it simply did not work. I tried the following:</p><pre><code>		VCard vCard = new VCard();		vCard.load(connection);		vCard.setEmailHome(""meine_home@email.de"");		vCard.setLastName(""Scheller"");		vCard.setField(""blafasel"", ""asdf"");		vCard.save(connection);</code></pre><p>Then I was looking for a way to see that VCard information. It did neither show up in iChat nor in this System.out:</p><pre><code>		vCard.load(connection, user);		System.out.println(user + "" has this vCard: "" + vCard.toXML());</code></pre><p>So anything went wrong, but theres no indication what it was. I tried this with the google talk server and my own copy of openfire with the same result. Btw, I am using this version of Smack: <a href=""http://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp/"" rel=""nofollow"">http://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp/</a></p><p>What am I doing wrong here? What is the correct way of storing profile related information with Smack?</p>","81364","","","","","2010-07-04 02:55:16","How to set/get profile data with XMPP using Smack","<java><android><xmpp><smack>","3","0","2","",""
"1838820","1","1839557","","2009-12-03 09:42:48","2","5734","<p>I have a ListView powered by a custom adapter that dynamically changes the background color of each row based on its contents. The getView looks like this:</p><pre><code>    @Override    public View getView(int position, View convertView, ViewGroup parent)    {        View row = convertView;        Power power = powers.get(position);        if(row == null)        {            row = getLayoutInflater().inflate(android.R.layout.simple_list_item_2, parent, false);        }        TextView text1 = (TextView)row.findViewById(android.R.id.text1);        TextView text2 = (TextView)row.findViewById(android.R.id.text2);        text1.setText(power.name);        text2.setText(power.getAttackLine());        row.setBackgroundColor(0xFF0000FF);        return row;    }</code></pre><p>All that works peachy, except that whenever I select an item from the list, the standard <code>red/orange</code> highlight only shows up behind the row, only visible for a few pixels on each side of it. Is there a way to get the selection to show up on top of the background?</p>","223693","","750613","","2012-07-10 09:28:32","2012-07-10 09:28:32","Android: How do I make the background color of a ListView show up behind the selection?","<android><listview>","2","0","","",""
"1839273","1","1839454","","2009-12-03 11:11:12","11","33386","<p>i want to apply an onClickListener event to an imageView, how do I accomplish this? Can anyone provide me with some source code examples</p>","1746300","","1671933","","2012-12-27 01:02:43","2014-03-30 01:48:13","how to apply click event listener to image in android","<android>","2","0","5","",""
"1839625","1","1840927","","2009-12-03 12:35:27","25","9932","<p>What's the differences/ advantages / drawbacks between using <code>Activity.runOnUiThread</code> or <code>Handler.post(runnable action)</code> in android ?</p>","223795","","759866","","2013-12-18 17:03:15","2013-12-18 17:03:15","What's the difference between Activity.runOnUiThread(runnable action) and Handler.post()?","<android>","1","1","3","",""
"1839664","1","","","2009-12-03 12:45:22","3","4327","<p>How can we display a custom seek bar for a streaming video file in android?</p>","193545","","","","","2014-01-26 16:42:19","custom seek bar for a streaming video file in android","<android><video><streaming>","2","1","","",""
"1840091","1","","","2009-12-03 14:12:52","0","274","<p>I have a ListView. I populate it with 8 items, that's all that fits vertically on the G1. Some of my users are saying the Droid has a taller screen height, and so I can probably add one or two more items to the ListView to take up the additional space provided.</p><p>How could I measure the available height the screen offers at startup, before the UI is displayed? If I see the height can fit more than 8 items, I'd like to add one or two more rows,</p><p>Thanks</p>","137193","","","","","2010-03-26 00:00:03","Getting screen height before first display?","<android>","1","3","","",""
"1840231","1","1840811","","2009-12-03 14:33:42","59","57886","<p>Can you recommend open source android applications that can be valuable to analyze, and to learn android programming from?</p><p>Is any app from the Android open source project suitable for basic learning?</p><p>Thanx...</p>","35425","","60261","","2009-12-03 15:19:33","2014-02-09 22:43:17","Open-Source Examples of well-designed Android Applications?","<android><open-source>","10","0","68","2014-01-25 03:26:20",""
"1840627","1","","","2009-12-03 15:26:56","15","1526","<p>Does anybody have experiences from cross platform mobile app development framework <a href=""http://www.mosync.com/"" rel=""nofollow"">MoSync</a>?<br>It sounds very good and promises much. But does it deliver?</p>","221431","","514235","","2012-11-27 05:32:03","2012-11-27 05:32:03","MoSync experiences","<android><iphone><mobile><cross-platform><symbian>","2","1","3","",""
"1840676","1","2447384","","2009-12-03 15:32:49","1","2015","<p>I am now working on changing android theme style at runtime, when the user select a theme resource, not only the current application, but also all the applications installed on the phone should be changed. For example, just like you change the system language in setting activity,then all the applications' language changed. I just can not figure out how Android framework achieves this, anybody know anything about this?</p><p>While I tried to use PackageManager, just like this:</p><pre><code>    PackageManager manager = getPackageManager();    List&lt;ApplicationInfo&gt; apps = manager            .getInstalledApplications(PackageManager.GET_META_DATA);    for (ApplicationInfo app : apps) {        app.theme=android.R.style.Theme_Light_NoTitleBar_Fullscreen;    }</code></pre><p>It won't work. Is the attribure ""theme"" in ApplicationInfo read-only?</p>","221778","","84021","","2011-10-19 21:57:05","2011-10-19 21:57:05","Is there a way to change android theme at runtime?","<android><themes>","1","0","","",""
"1840721","1","2039543","","2009-12-03 15:38:29","1","2449","<p>I would like to capture long click events in a ListView, which was easily done using a OnItemLongClickListener. However, that lacks the fading animation of the selector transitioning to a long press that is seen when the long click is handled by onCreateContextMenu. How can I get that animation using <code>OnItemLongClickListener</code>?</p>","196980","","750613","","2012-07-10 10:12:29","2012-07-10 10:12:29","ListView Long Click Animation","<android><listview><animation><long-click>","1","0","","",""
"1841209","1","","","2009-12-03 16:44:40","2","7253","<p>I'm having trouble setting up an Android Layout.</p><p>What I would <em>like</em> is a scrollable ListView followed by a small bar of text (TextView) that doesn't scroll and always stays at the bottom of the screen.</p><p>it would look like this:</p><p>ListViewItem1</p><p>ListViewItem2</p><p>ListViewItem3</p><p>…</p><p>Bar of Text Here (always displayed irrespective of scroll state of the ListView)</p><p>I've tried a bunch of different variations on this, but none shows the static text</p><p>Any thoughts as to where I'm going wrong?</p><p>TKS!</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout android:orientation=""vertical""    	android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;    	&lt;ListView android:id=""@+id/list2"" android:layout_width=""fill_parent""    		android:layout_height=""fill_parent"" /&gt;    &lt;/LinearLayout&gt;    &lt;TextView android:layout_width=""fill_parent""    	android:layout_height=""50dip"" android:text=""Bar of text that always stays at the bottom of the screen"" /&gt;&lt;/LinearLayout&gt;</code></pre>","141146","","","","","2011-07-12 06:47:29","Android layout for ListView followed by non-scrolling bar of text at bottom of screen","<android><listview><layout><textview>","4","0","3","",""
"1841397","1","","","2009-12-03 17:09:33","1","2311","<p>Can anyone tell me if the Android MediaPlayer class is able to play a video stored in a remote URL?</p><p>Just for testing purposes, can I use the URL <code>http://localhost/video-name.3gp</code>.</p>","221529","","212218","","2012-09-18 18:13:33","2012-09-18 18:13:33","Use Android MediaPlayer class to play a video from a URL","<android><media-player>","2","0","","",""
"1842222","1","","","2009-12-03 19:14:25","1","1887","<p>I currently have a working Android program that programatically adds views to a LinearLayout.  I would like those views to be animated in and cannot find any good resources on figuring out how to do this.</p><p>Could someone point me in the right direction?</p><p>Thanks,</p><p>John</p>","105500","","","","","2010-10-31 08:40:32","Android: LinearLayout addView Animation","<android><animation><android-linearlayout>","1","0","","",""
"1842357","1","","","2009-12-03 19:36:45","19","8770","<p>Are there any good database abstraction layers/object relational mappers/ActiveRecord implementations/whatever they are called for Android? I'm aware that <a href=""http://www.db4o.com/Android/default.aspx""><em>db4o</em></a> is officially supported, but it has quite a large footprint and I'd rather use a more conventional database (<code>SQLite</code>).</p>","222469","","750613","","2012-07-10 09:24:12","2012-11-12 18:12:01","Higher level database layer for Android?","<android><orm><activerecord>","11","4","13","",""
"1843746","1","1843840","","2009-12-03 23:14:45","0","295","<p>Is it possible to make an <code>Activity</code> temporarily not rotatable (like, turning it on/off in code, not in the manifest)? </p><p>One of my old apps crashes if you rotate while it's doing an HTTP lookup as the views are no longer attached when it returns. One of these days I'll fix it proper, but in the mean time it'd be useful if I could just make the thing not-rotatable while it's doing the lookup.</p>","76835","","","","","2009-12-03 23:35:22","Temporarily non-rotatable Android Activities?","<android><activity><landscape><portrait>","1","0","","",""
"1843911","1","1846576","","2009-12-03 23:44:59","7","6708","<p>Like the title says, I need to detect when my app loses focus because another app is launched (Phone call comes in, or user hits Home etc).</p><p>Overriding Activity.OnStop does not work because that is called even when switching activities within my app.</p>","1965","","","","","2013-10-16 21:33:04","Android: Detect when another Activity is launched (or your activity loses focus)","<android>","4","0","3","",""
"1844560","1","1854101","","2009-12-04 02:54:01","0","1889","<p>So I've got to parse ugly files that contain nested tags like</p><pre><code>&lt;p&gt;blah&lt;strong&gt;lah&lt;/strong&gt;blah&lt;/p&gt;</code></pre><p>The nested tags are defined and I don't care about them. But they make XmlPullParser fail:</p><pre><code>XmlPullParser parser = XmlPullParserFactory.newInstance().newPullParser();parser.setInput(some_reader);while (parser.next() != XmlPullParser.END_DOCUMENT) {    if (XmlPullParser.START_TAG == event) {        String tag = parser.getName();        if (tag != null) {            tag = tag.toLowerCase();        } else {            continue;        }       if (""p"".equals(tag)) {           String text = parser.nextText();           // and here we go           // org.xmlpull.v1.XmlPullParserException: expected: /p read: strong        }    }}</code></pre><p>Question: any chance I could get away w/o preprocessing the file stripping all the unnecessary tags or using a third-party library?</p><p>EDIT:Updated the snippet to actually make sense.</p>","15187","","15187","","2009-12-05 01:09:19","2013-04-04 14:00:40","Parsing html-like document with xmlpullparser?","<android><xmlpullparser>","2","3","1","",""
"1844816","1","","","2009-12-04 04:17:17","14","5746","<p>Anyone know of a Subversion client for Android OS? Same goes for a syntax highlighting text editor on there.</p>","37526","","37526","","2009-12-04 06:30:18","2012-06-16 08:11:44","SVN and syntax highlighting on Android","<android>","10","6","4","",""
"1845285","1","1845307","","2009-12-04 06:52:39","8","13126","<p>How to block <code>virtual keyboard</code> while clicking on edittext  in android</p>","217065","","750613","","2012-07-10 09:22:49","2014-02-13 09:45:09","how to block virtual keyboard while clicking on edittext in android?","<android>","4","0","8","",""
"1845460","1","","","2009-12-04 07:46:31","6","459","<p><strong>Edit / Update:</strong></p><p>As an update to the below problem, I found the exact action which causes it to happen.</p><ol><li>Download an apk from a url through the android browser</li><li>Install the app.</li><li>After install, the app gives you two choices: ""Open"" or ""Done"".</li><li>If you choose ""Open"", the quirky behavior described below starts.</li><li>If you choose ""Done"", then launch the app from the app tray, it works fine.</li></ol><p>So it seems like this problem is caused by using the ""Open"" button the browser provides you after installing the APK.</p><p><hr></p><p>I'm experiencing an error in the history stack of applications upon first install. I made a test app to demonstrate this.</p><p>The test app is simply two activities, A and B. Activity A launches B. That's all it does. Rest is wizard generated template code from eclipse.</p><p>When the user installs the app (via web url apk), and runs it for the <em>first</em> time, I get an out-of-order activity stack:</p><p>-User starts the app, A is on top.<br>  -They make A launch B by clicking a button. B is on top of the stack.<br>  -User hits the home screen button.<br>  -User returns to the app, A is displayed, instead of B.<br>  -User hits the back key, B is shown!<br>  -User hits the back key again, A is shown!<br>  -User hits the back key again, home screen shown.<br>  -Now the stack is clean, and app behaves ""normally"" from now on!  </p><p>Is any one else seeing this? This is almost exactly like this known bug, however my users are not installing from eclipse:<a href=""http://code.google.com/p/android/issues/detail?id=2373&amp;q=first%20%20i"">http://code.google.com/p/android/issues/detail?id=2373&amp;q=first%20%20i</a>...</p><p>I can provide the test app/source if anyone wants to try. This is the manifest, which does not have any special customizations made to it.</p><pre><code>&lt;activity android:name="".ActivityA""          android:label=""ActivityA""  &gt;  &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.MAIN"" /&gt;    &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;  &lt;/intent-filter&gt;&lt;/activity&gt;&lt;activity android:name=""ActivityB""          android:label=""ActivityB""  &gt;  &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.VIEW"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;  &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>as far as I know, this should definitely not be happening, and works fine after you clear the history stack the first time.</p><p>Thanks</p>","185329","","185329","","2009-12-04 17:21:08","2010-10-08 12:22:40","Activity history stack wrong upon first install on device?","<android>","1","4","3","",""
"1845678","1","1845877","","2009-12-04 08:44:25","24","17368","<p>How can I know if the running code is executed in the main thread (UI thread). With Swing I use the <code>isEventDispatchThread</code> method...</p>","164460","","750613","","2012-07-10 09:21:53","2013-11-19 15:46:46","android UI thread","<android><multithreading>","6","0","11","",""
"1845990","1","","","2009-12-04 10:01:01","0","987","<p>I want to get the current speed of an Android device. I see the GPS location class provides the property, but I'm not sure whether it is available. How can I accomplish this?</p>","144864","","496830","","2011-11-08 12:46:07","2011-11-08 12:59:47","How can I determine the device's current speed?","<android><gps>","1","5","0","",""
"1847008","1","2552006","","2009-12-04 13:40:04","5","3783","<p>I want to programmatically measure the phone signal strength in a mobile phone. I don't actually care about the mobile phone or the programming environment: It can be based on android or windows mobile or even J2ME and can be from any manufacturer (please no iPhone). However, it needs to be a real, commercial mobile phone and not a special measurement device.</p><p>This problem is not as easy as it seems with a first look. I am aware that there already exist a number of methods that claim to return the phone signal strength. Some of theseare:</p><ul><li>SystemState.PhoneSignalStrength for WM6</li><li>RIL_GetCellTowerInfo for WinCe (dwRxLevel member of returned RILCELLTOWERINFO struct)</li><li>android.telephony.NeighboringCellInfo.getRssi() for android</li></ul><p>The problem with the above is that they only return a few (under 10) discrete values, meaning that, for instance, the return values of SystemState.PhoneSignalStrength can only be translated to (for instance) -100 dbm, -90 dbm, -80 dbm, -70 dbm and -60 dbm, something that is not useful for my application, since I'd like to have as much precision as possible.</p><p>It doesn't matter if there is an undocumented solution that only works on only one phone, if you can tell me a way I'd be grateful.</p><p>Thanks in advance </p>","119071","","309086","","2012-10-23 10:22:40","2012-10-23 10:22:40","Measuring ""real"" phone signal strength on a mobile phone","<android><java-me><windows-mobile><mobile-phones>","4","0","3","",""
"1847818","1","1847862","","2009-12-04 15:46:54","10","17368","<p>I have implement the following code in order to test playing a video from a remote web server through it´s URL.</p><pre><code>videoView = (VideoView)this.findViewById(R.id.videoView);        MediaController mc = new MediaController(this);        videoView.setMediaController(mc);        videoView.setVideoURI(Uri.parse(""http://sayedhashimi.com/downloads/android/movie.mp4""));        videoView.requestFocus();</code></pre><p>The code is working just fine, even in the Android emulator. I just would like to know if there's any listener (or handler) to detect the finish of the video that is being reproduced?</p><h3>Update:</h3><p>I have the following code now:</p><pre><code>   @Override        protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        this.setContentView(R.layout.player);        videoView = (VideoView)this.findViewById(R.id.videoView);        playVideo();        // video finish listener        videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {            @Override            public void onCompletion(MediaPlayer mp) {                // not playVideo                            // playVideo();                            mp.start();            }        });    }    public void playVideo() {            MediaController mc = new MediaController(this);            videoView.setMediaController(mc);            videoView.setVideoURI(Uri.parse(""http://sayedhashimi.com/downloads/android/movie.mp4""));            videoView.requestFocus();         }</code></pre><p>When the activity is just called, the video works fine but when the video finishes, I would like that it played again, which it's not occurring.</p>","221529","","212218","","2012-09-18 18:12:36","2013-10-01 16:06:50","Listener (or handler) for video finish","<android><media-player>","5","3","1","",""
"1848567","1","","","2009-12-04 17:48:42","5","20770","<p>Has anyone been successful with hooking up a Samsung Galaxy with ADB running on Win XP Pro SP3? Links to already existing threads or tutorials related to this would be much appreciated! Thanks!</p>","224956","","","","","2013-04-19 13:34:47","ADB + Samsung Galaxy","<android>","6","1","8","",""
"1848886","1","","","2009-12-04 18:42:23","3","7113","<p>I have an unsigned char* in my C library, and Im calling a JNI exported function that needs to set a java object with this data... preferably in a byte[].</p><p>But this function will be called very often, and it's quite a lot of data to be copied.. Is it possible to use a ByteBuffer and assign the pointer of that bytebuffer to my unsigned char*? Or does it only work the other way round</p><p>Can I even do this without copying the data? What would be the best way to access it? Thanks</p><p>edit:The size of the data in the unsigned char* is known.</p>","220830","","","","","2009-12-04 19:39:38","JNI / C library: passing byte ptr","<c><android><jni>","1","4","1","",""
"1850412","1","1852291","","2009-12-04 23:44:36","12","19486","<p>Is there any way to parse an XML string using Android SAX?</p>","221529","","212218","","2012-09-18 18:12:15","2012-09-18 18:12:15","Parse XML string using SAX","<xml><android><string><sax>","1","1","2","",""
"1850771","1","1852623","","2009-12-05 01:33:32","5","12677","<p>I have a ListView which uses a CursorAdatper as its adapter.I would like to have the list view to</p><ul><li>requery its data </li><li>refresh its view once the requery is done.</li></ul><p>I tried:</p><pre><code>CursorAdapter adapter = (CursorAdapter)listView.getAdapter();adapter.notifyDataSetChanged();</code></pre><p>And i tried:</p><pre><code>CursorAdapter adapter = (CursorAdapter)listView.getAdapter();adapter.getCursor().requery();</code></pre><p>but none worked.  I have set a break point in my <code>ContentProvider</code>'s query method, but I don't see the requery being called or my ListView getting refreshed with new data.</p><p>Can you please tell me what is the solution to my problem?</p><p>Thank you.</p>","128983","","380236","","2012-06-28 01:25:18","2013-09-30 16:10:35","How to refresh a ListView to requery its cursor to repopulate its data and its views","<android>","4","0","1","",""
"1851633","1","","","2009-12-05 08:57:03","45","60897","<p>how to add button dynamically in android?</p>","217065","","","","","2013-11-18 14:26:48","how to add button dynamically in android?","<android>","10","2","12","",""
"1851634","1","1854019","","2009-12-05 08:57:17","3","10116","<p>Good morning,</p><p>To sumup : in order to add easily unit tests for a SAX parser I would like to load XML from a file.</p><p>Now, I have my XML in a static string inside my unit test class, but it is not very convenient for large XML.This is why I would like to add some XML files to my project and load them in my unit test. How can I do ?</p><p>Regards,Quentin</p>","60292","","","","","2009-12-06 00:23:37","Load file from resource","<android>","2","0","1","",""
"1852248","1","","","2009-12-05 13:51:42","4","1557","<p>I need test my Android app on a Motorola Cliq but don't have one. Is there a testing service that will let me make a debug connection to that device so I can run some tests and find out where the code is failing. Video connections won't tell me that.</p>","225405","","","","","2013-10-11 18:29:55","Is there an Android Testing Service I can use to give me real debug information from a device?","<android>","1","1","1","2012-09-29 15:09:13",""
"1852374","1","","","2009-12-05 14:45:27","4","5878","<p>I feeling that the UIPickerView of iPhone is good idea and easy to use on touchable mobile phone. I am strange that why Android SDK do not provide the same effect widget ?</p><p>or maybe coder have to clone it on Android ?</p><p>any help ... thanks ...</p>","144864","","","","","2013-06-18 06:14:55","Does Android provide widget like the iPhone UIPickerView","<iphone><android><uipickerview>","2","1","3","",""
"1853220","1","1853245","","2009-12-05 19:42:25","30","35740","<p>I would like to retrieve the incoming call's phonenumber and do something with it like the doin <a href=""http://blog.whitepages.com/2009/02/27/caller-id-by-whitepages-a-new-android-app-that-puts-telemarketers-on-alert/"">http://blog.whitepages.com/2009/02/27/caller-id-by-whitepages-a-new-android-app-that-puts-telemarketers-on-alert/</a></p><p>Could you please help me because I can't find any information about this.Where do i start and how do i get hold of the phonenumber?</p><hr><p>Ok so currently my code looks like below. When I place the call the CustomBroadcastReceiver catches it and the log message is printed out. I can retrieve the telephone number from the bundle. But! I can't get hte CustomPhoneStateListener to work. As you can see I have registered my customPhoneState listener to the receiver but the log message never get's printed out from the CustomPhoneStateListener class. What am I my missing here?Is my thinking correct? </p><hr><pre><code>&lt;receiver android:name="".CustomBroadcastReceiver""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.PHONE_STATE"" /&gt;         &lt;/intent-filter&gt;&lt;/receiver&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""5"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_CONTACTS"" /&gt;&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE"" /&gt;</code></pre><hr><pre><code>public class CustomPhoneStateListener extends PhoneStateListener {private static final String TAG = ""CustomPhoneStateListener"";public void onCallStateChange(int state, String incomingNumber){    Log.v(TAG, ""WE ARE INSIDE!!!!!!!!!!!"");    Log.v(TAG, incomingNumber);    switch(state){        case TelephonyManager.CALL_STATE_RINGING:            Log.d(TAG, ""RINGING"");            break;    }   }</code></pre><hr><pre><code>public class CustomBroadcastReceiver extends BroadcastReceiver {private static final String TAG = ""CustomBroadcastReceiver"";@Overridepublic void onReceive(Context context, Intent intent) {    Log.v(TAG, ""WE ARE INSIDE!!!!!!!!!!!"");    TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);    CustomPhoneStateListener customPhoneListener = new CustomPhoneStateListener();    telephony.listen(customPhoneListener, PhoneStateListener.LISTEN_CALL_STATE);    Bundle bundle = intent.getExtras();    String phoneNr= bundle.getString(""incoming_number"");    Log.v(TAG, ""phoneNr: ""+phoneNr);}</code></pre>","247071","","1069068","","2013-03-19 14:42:12","2014-02-06 06:41:05","Retrieve incoming call's phone number in Android","<android>","3","0","23","",""
"1853422","1","1853495","","2009-12-05 20:53:31","1","545","<p>So I am super new to this, and am not really sure what I am doing.</p><p>I downloaded the Android SDK for Windows, but I am a little confused in setting it up/installing. So I read that I needed to set the System Variables Path to the tools/</p><p>but I it seems that I would be replacing the Windows\System32?!?!</p><p>I should not be replacing this should I?</p><p>Windows Vista; already have the Eclipse IDE download and set up (minus pointing at the SDK)</p><p>Can anyone help a begginer out with setting this thing up please?</p><p>apreciated; thanks!</p><p>also: i should metion exactly what I have done...</p><p>I downloaded that Android SDK and unzipped it.....that's about it!</p>","125953","","","","","2010-10-09 16:19:57","Trying to set up Android SDK - Please help! Beginner","<android><eclipse><installation><android-emulator>","5","0","1","",""
"1855076","1","","","2009-12-06 11:05:51","1","8231","<p>I have 2 questions regarding tabHost:I've created tabHost with 2 tabsand for the tab titles I use setIndicator(TextView) (I work with api level 4)my title background is white. I use selector for the title to choose between diff images for the title.</p><ol><li><p>I want to make the title text bold only when selected/pressed. I didn't succeed to do it using the selector I have. can I do it at all? the idea is that on cases I use drawable a I want the text bold. other cases not bold. same question regarding textColor.</p></li><li><p>it looks like a bug - when the tab first opens, the text on the selected tab (the one I used in tabHost.setCurrentTab(tabId)) is not seen at all. after first press/focus/focus any other item it looks well. any idea why or how to solve this?</p></li></ol><p>thanks in advance</p><p>on tabActivity - </p><pre><code>TextView title1 = new TextView(MainActivity.getInstnace(), null, android.graphics.Typeface.NORMAL);TextView title2 = new TextView(MainActivity.getInstnace(), null, android.graphics.Typeface.NORMAL);title1.setText(""teb11 title"");title1.setBackgroundResource(R.drawable.tabtitle);title1.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.tab1), null, null, null);title2.setText(""tab22 title"");title2.setBackgroundResource(R.drawable.tabtitle);title2.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.tab2), null, null, null);TabSpec tab1 = mTabHost.newTabSpec(""tab1"").setIndicator(title1).setContent(R.id.list1);TabSpec tab2 = mTabHost.newTabSpec(""tab2"").setIndicator(title2).setContent(R.id.list2);mTabHost.addTab(tab1);mTabHost.addTab(tab2);      mTabHost.setCurrentTab(0);</code></pre><p>the selector tab1.xml </p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;      &lt;item android:state_selected=""true""         android:drawable=""@drawable/iconselect""/&gt;       &lt;item android:state_pressed=""true""      android:drawable=""@drawable/iconselect""/&gt;       &lt;item android:drawable=""@drawable/icon""/&gt;        &lt;/selector&gt; </code></pre><p>the selector for tabTitle</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;      &lt;item android:state_pressed=""true""      android:drawable=""@drawable/tabselected""/&gt;     &lt;item android:state_selected=""true""         android:drawable=""@drawable/tab"" /&gt;      &lt;item android:state_focused=""true""      android:drawable=""@drawable/tab"" /&gt;  &lt;/selector&gt; </code></pre>","225735","","426794","","2011-04-06 23:20:55","2014-04-17 00:20:07","android tabHost","<android><tabs>","4","0","","",""
"1855246","1","1973723","","2009-12-06 12:17:29","2","8028","<p>I am using Videoview to playback mp4 file from local machine using android emulator.I hear the audio, but the screen is blank and no video is seen.Android SDK 2.0.1</p><p>Does anyone have an idea what is missing here:</p><blockquote>  <p>package com.hello;</p>    <p>import android.app.Activity; </p>    <p>import android.os.Bundle;</p>    <p>import android.widget.MediaController;</p>    <p>import android.widget.VideoView;</p>    <p>public class HelloAndroid extends  Activity {    </p><pre><code>VideoView vv;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    vv = (VideoView) findViewById(R.id.VideoView01);    MediaController nc = new MediaController(this);     vv.setMediaController(nc);     vv.setVideoPath(""/sdcard/yu.mp4"");   vv.requestFocus();   vv.start();}public void onPause (){ vv.stopPlayback();}</code></pre>    <p>}</p></blockquote><p>Main.xml </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;VideoView android:id=""@+id/VideoView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/VideoView&gt;&lt;/LinearLayout&gt;</code></pre>","106020","","21234","","2009-12-06 12:42:13","2011-11-17 07:56:43","Android Videoview video not seen","<java><android><android-emulator>","2","2","1","",""
"1855404","1","1855517","","2009-12-06 13:32:59","11","2463","<p>Is it possible to run some android tests for example: AndroidTestCase without using emulator?</p>","225778","","","","","2012-07-31 14:02:28","Android tests without emulator","<android><testing>","3","0","","",""
"1856270","1","1859549","","2009-12-06 19:11:13","1","14957","<p>I'm trying to retrieve the contact's name, phone number, and address from the android contact list. The name and phone are pretty straight forward but the address seems to not be accessible with the 1.6 api level.</p><p>Has someone figured out how to get a contact's address? Also there's a completely new api in 2.0. How can I take advantage of this and fallback to the old api by using 1 binary. If that's even possible.</p>","42005","","","","","2011-07-25 05:55:10","Get address in contacts using Android SDK","<android><addressbook><google-contacts><import-contacts>","4","0","4","",""
"1857071","1","1857097","","2009-12-06 23:54:11","1","2787","<p>Is it possible to play continuous audio stream (MP3 / AAC) in Android browser using <code>&lt;audio /&gt;</code> tag? </p><p>If you're not sure, could you at least recommend some good testing page containing and using <code>&lt;audio /&gt;</code> tag?</p>","97309","","18936","","2009-12-07 00:11:07","2011-06-16 15:47:08","Does Android Chrome supports <audio /> tag?","<android><audio><google-chrome><tags>","2","0","","",""
"1857795","1","1858129","","2009-12-07 04:23:51","2","961","<p>I'm trying to make some Android view classes (which are just wrappers around layouts defined in an XML file). Is this correct:</p><pre><code>public class MyViewWrapper extends LinearLayout {    private TextView mTextView;    public MyViewWrapper(Context context) {        super(context);    }    public constructUI() {        LayoutInflater inflater = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);        inflater.inflate(R.layout.myview, this);        mTextView = (TextView)findViewById(R.id.myview_textview);    }}</code></pre><p>so the idea is just that I can construct my views like that, and they have logic inside for modifying their child views etc. The layout looks like:</p><pre><code>&lt;LinearLayout&gt;   &lt;TextView /&gt;&lt;/LinearLayout&gt;</code></pre><p>It just looks like I'm going to get an extra unnecessary LinearLayout. The wrapper class is itself a LinearLayout, and then it will attach the inner LinearLayout from the xml file.</p><p>Is that ok?</p><p>Thanks</p>","137193","","","","","2009-12-07 06:09:30","Wrapping a LinearLayout from xml","<android>","1","0","1","",""
"1858410","1","1858423","","2009-12-07 07:33:41","1","4214","<p>I would like to ask you smart people if anyone has seen any documentation regarding web access to a database from within an Android application. I would like to create a (FREE) application where the users can share information (rants/complains) around the globe.Each user will be able to see a little globe in his phone with locations of other users and some specific information about them. </p><p>Architecturally, I am thinking ""database in my GoDaddy host, exposing a web service"", and the web service accessed from the Android application. But I see no documentation about accessing web services. I can also go XML, maybe, but I am not seeing what mechanisms exist in the Android for over-the-web XML access. </p><p>I have a feeling I am mis-understanding something big in the picture. Can someone point me to docs, or knows something about this topic?(the iPhone has a Lighter app where you can see people lighting around the globe. Mine is similar, but people would not be lighting, instead they will be ""complaining/ranting"").</p>","192863","","","","","2009-12-07 07:37:04","Android Web Access to Database?","<database><android>","1","0","","",""
"1858950","1","","","2009-12-07 09:50:00","20","18461","<p>i know that there is the possibility to set a special keyboard with <a href=""http://developer.android.com/intl/de/reference/android/widget/TextView.html#attr%5Fandroid%3AinputType"">these attributes</a>. But i need my own keyboard as default. How can i do that? How can my app change the settings?</p><p>As an example, let's say: i want the example SoftKeyboard as default for my app.</p><p>Is that even possible?</p><p>Thanks for your efforts :)</p>","220652","","","","","2012-10-24 10:43:39","Set custom keyboard for android application","<android><keyboard>","1","1","3","",""
"1859241","1","","","2009-12-07 10:45:49","20","19784","<p>The press release of Android 2.0 states that the new release supports sync adapters so that emails and calendars cannot only be synced with gmail and exchange. However, there is no information available online how to write such a sync adapter. Has anyone tried it and some example code available?</p>","226269","","489852","","2012-02-05 18:56:38","2014-02-23 18:36:41","Own sync adapter for Android?","<android><synchronization><android-syncadapter>","8","0","29","",""
"1859327","1","1859414","","2009-12-07 11:04:33","2","5523","<p>How can i get and change the stack size (even for the main thread) of my Android application.</p>","164460","","","","","2010-11-25 23:48:18","Android stack size","<android><stack>","2","0","2","",""
"1859961","1","","","2009-12-07 13:24:13","1","594","<p>How can i specify command-line parameter when I launch an android application ?1- With Eclipse2- Directly from the phone</p>","164460","","","","","2009-12-07 15:57:40","android command-line","<android><command-line>","1","0","1","",""
"1860026","1","1861643","","2009-12-07 13:36:52","0","1185","<p>I'm currently developping an application to manage my pictures on an Android phone.I developped an algorithm to classify the pictures based on the geographical coordinates (latitude, longitude) of each photo.</p><p>To test my application on the android emulator in Eclipse, I manually imported a bunch of photos from my computer to the SDCard folder of the emulator.</p><blockquote>  <blockquote>    <p>Now I would like to add manually lattitude and longitude data to each photo, so that I can test my algorithm. I've  been searching  a lot but could't find any way to go through it..</p>  </blockquote></blockquote><p>Can anybody help me on this ?</p><p>Thanks in advance.</p>","191792","","191792","","2009-12-07 21:45:19","2009-12-07 21:45:19","How to set geographical coordinates on pictures for Google Android?","<android><android-emulator><latitude-longitude><geographical-information>","1","0","","",""
"1860116","1","","","2009-12-07 13:52:40","5","13063","<p>I develop facebook application in androidi want to log in to facebook via HTTPClient , teh user give me username and password and then i connect to facebook.com/login</p><p>i want to make like this code </p><p><a href=""http://stackoverflow.com/questions/1409220/facebook-getting-incorrect-signature-104-when-getting-session-key/1795229#1795229"">http://stackoverflow.com/questions/1409220/facebook-getting-incorrect-signature-104-when-getting-session-key/1795229#1795229</a></p><p>but in android, i tried to do that but when i get the session, a XML contain invalid parameter returned</p><p>can any one help me?</p>","218376","","218376","","2009-12-07 14:22:17","2011-08-27 08:51:15","Login to facebook in android using REST API","<java><android><facebook><httpclient>","3","0","1","",""
"1860901","1","","","2009-12-07 15:58:34","4","1334","<p>When my application is uninstalled, a widget that is contained in this packages stays on the HOMEscreen and gives an error message ""problem loading widget"".</p><p>How do I remove the widget when my application is uninstalled?  Is there anattribute in the manifest that I am missing?</p><p>I thought this thing should be handled by the OS, but guess it is not.</p><p><strong>EDITED</strong>:  I am now catching the ""PACKAGE_ REMOVED"" intent, and checking the ""EXTRA_REPLACING"" to make sure it's not a reinstall, but I don't know the actual code to use to actually remove the widget.</p>","137825","","114066","","2011-01-03 13:54:42","2011-04-26 15:43:28","Removing Widget from Home Screen when Uninstalled","<android><widget>","1","2","","",""
"1860914","1","1861580","","2009-12-07 15:59:50","7","5491","<p>Let's say that I have two layouts for a widget:  Layout1 and Layout2.The default for the widget is Layout1, but I allow the user to choosewhich layout they want the widget to be.  So if the user changes toLayout2, how do I programmatically change the layout to Layout2?</p><p>There isn't a setContentView method for widgets like there is for Activities.</p><p>Thanks</p>","137825","","","","","2010-12-02 10:57:40","Changing Widget Layout Programmatically","<android><widget>","2","0","3","",""
"1861996","1","","","2009-12-07 18:36:29","2","2510","<p>I have a question related to choosing an application programmatically when shown the dialog ""Complete Action Using"" in Android.</p><p>An example would be as follow:In my code, I have this statement</p><pre><code>startActivity(new Intent(Intent.ACTION_VIEW,        Uri.parse(""http://www.youtube.com/watch?v=98yl260nMEA"")));</code></pre><p>I will then shown a dialog box with two options:to complete the action using the Browser or YouTube </p><p>Any idea how can I choose YouTube without being shown the dialog box?</p><p>Thanks!</p><p>Nicholas</p>","226582","","19750","","2009-12-29 04:55:36","2009-12-29 04:55:36","How do I bypass the ""Complete Action Using ...""","<android><action><android-intent><using><complete>","3","0","1","",""
"1863313","1","2114355","","2009-12-07 22:18:05","5","5571","<p>So I'm trying to allow the user to pick a particular piece of media with my Android Application using the method described here:<a href=""http://stackoverflow.com/questions/550905/access-pictures-from-pictures-app-in-my-android-app"">http://stackoverflow.com/questions/550905/access-pictures-from-pictures-app-in-my-android-app</a></p><p>It works great, except for the fact that I can seemingly only choose between either Video or Photo to present the user with, not both at the same time. Is there a good way to do this with:</p><blockquote>  <p>startActivityForResult(new  Intent(Intent.ACTION_PICK,  android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI),  SELECT_IMAGE);</p></blockquote><p>Thanks!</p>","226717","","","","","2013-10-30 04:45:06","Accessing Videos AND Photos on Android 1.5 +","<android><video><photo><mediastore>","4","1","5","",""
"1863818","1","1864195","","2009-12-08 00:32:02","0","1070","<p>Output of: javap -s SomeClass</p><pre><code>public org.someapp.SomeClass$_data data;  Signature: Lorg/someapp/SomeClass$_data;</code></pre><p>Definition of SomeClass in Java:</p><pre><code>class SomeClass{    private class _data {        byte[] something = new byte[1234];    }    public _data data;}</code></pre><p>Definition of native function in Java:</p><pre><code>public static native int NativeFunction(SomeClass something);</code></pre><p>Java implementation:</p><pre><code>SomeClass x = new SomeClass();NativeInterface.NativeFunction(x);</code></pre><p>However, when the following code is executed:</p><pre><code>JNIEXPORT jint JNICALL Java_org_someapp_NativeInterface_NativeFunction(JNIEnv* env, jobject obj, jobject someobject) {    jclass some_class = (*env)-&gt;GetObjectClass(env, someobject);    jfieldID data = (*env)-&gt;GetFieldID(env, some_class, ""data"", ""Lorg/someapp/SomeClass$_data""); }</code></pre><p>Java throws a ""NoSuchFieldError;: data"" exception on the GetFieldID call. I don't get it.. The signature is just fine (copied straight from javap).</p><p>Note that getting the field ID for a simpler variable, like an unsigned short (with signature ""S"") works just fine. </p>","220830","","25324","","2009-12-08 00:45:47","2009-12-08 02:18:43","JNI: NoSuchFieldError","<java><android><jni>","1","0","","",""
"1863953","1","","","2009-12-08 01:15:43","1","553","<p>I have created a TabHost and in 1 of the tab, I have added the content using </p><pre><code> mTabHost.addTab(mTabHost.newTabSpec(""tab1"")                .setIndicator(getString(R.string.dialerIconLabel),                        getResources().getDrawable(R.drawable.ic_tab_dialer))                .setContent(intent));</code></pre><p>Is it possible for me to switch the content's activity programatically after I called 'addTab of TabHost'?</p><p>Thank you.</p>","128983","","60261","","2009-12-08 06:32:20","2010-07-19 05:16:41","How can I switch the activity of the content of a tab in Tabhost","<android>","1","0","1","",""
"1864153","1","1864688","","2009-12-08 02:04:37","0","4132","<p>I'm not having much luck with updating an app widget with <code>AlarmManager</code> generated broadcasts. Here's what I do:</p><p>Initializing <code>AlarmManager</code> on <code>AppWidgetProvider#onEnabled</code></p><pre><code>AlarmManager alarms = (AlarmManager) context.getSystemService(        Context.ALARM_SERVICE);    alarms.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,     SystemClock.elapsedRealtime(), 60000, pendingIntent);</code></pre><p>I also define broadcast receiver that simply listens for the updates that fired by the <code>AlarmManager</code>. When update is fired code runs <code>AsyncTask</code> that makes a network call. When the <code>AsyncTask</code> is completed (<code>onPostExecute</code>) it uses previously obtained instance of <code>AppWidgetManager</code> to update the widget(s).It all actually runs well until in the logs I see message <code>""Process com.foo.myapp (pid 12345) has died""</code> after which the <code>AlarmManager</code> never fires another update.</p><p>Do I need to have some sort of check which will restart the alarms? For example when user access the parent app of the widget? How do I ensure that I can complete the long running task and come back to the widget if my app dies in the middle of the request?</p>","135946","","","","","2010-04-30 09:36:37","Android - AppWidgets, AlarmManager and AsyncTask","<android><android-asynctask><appwidget><alarmmanager>","1","0","3","",""
"1865791","1","1866599","","2009-12-08 09:31:18","0","1408","<p>I can override onTouchEvent, but there is no x and y coordinates to set in the EditText or usual View.</p>","227016","","","","","2009-12-08 12:16:57","Android: how to move standard elements (like EditText) by touch event?","<android><view><move><movement>","1","0","","",""
"1866203","1","","","2009-12-08 10:56:03","0","1463","<p>For the past two weeks, i am working to create an application ,which is used to communicate with all Messengers in android.I am using Smack api for that, and now i can able to connect to the GTalk.Now trying to connect it to the Yahoo messenger.But it is throwing some execption. I want to know whether we can create Yahoo IM client using smack api or not.Please any body knows it ,help me.and if possible please give the list os IM clients supported by Smack api.</p>","131062","","115145","","2009-12-08 12:17:45","2009-12-10 09:31:04","Can we create IM clients other than GTalk using Smack api in Android?","<android><smack>","1","0","","",""
"1868936","1","","","2009-12-08 18:30:44","2","2312","<p>How can I get the size of the title bar of an activity and the size of the system bar?</p>","164460","","63550","","2010-02-24 18:57:46","2012-02-07 14:34:20","Android title bar size","<android><titlebar>","1","0","","",""
"1869090","1","1869343","","2009-12-08 18:55:56","1","2138","<p>Is there a way to have the android.widget.AnalogClock display a preset time?</p><p>I don't want to create a custom AnalogClock, I just want the regular one to display a time to my liking. </p>","174868","","","","","2013-04-22 20:35:39","android.widget.AnalogClock set time","<android><clock><preset>","2","0","","",""
"1869176","1","1869493","","2009-12-08 19:10:01","4","6053","<p>How can you dynamically close the virtual keypad through code?All I want to do is close it when the user clicks an ""Ok"" button because it is not closing itself even though the button now has focus.</p>","61525","","","","","2013-04-13 09:07:53","Android: Dynamically close the virtual keypad though code?","<android><android-keypad>","2","3","","",""
"1869229","1","","","2009-12-08 19:20:44","1","3291","<p>I have the following working code:</p><pre><code>@Override        protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        this.setContentView(R.layout.player);        videoView = (VideoView)this.findViewById(R.id.videoView);        playVideo();        // video finish listener        videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {                @Override                public void onCompletion(MediaPlayer mp) {                        mp.start();                }        });    }    public void playVideo() {                MediaController mc = new MediaController(this);                videoView.setMediaController(mc);                videoView.setVideoURI(Uri.parse(""http://sayedhashimi.com/downloads/android/movie.mp4""));                videoView.requestFocus();         }</code></pre><p>I just want to change the MediaPlayer data source when the video finishes (setOnCompletionListener).</p>","221529","","212218","","2012-09-18 18:12:01","2012-09-18 18:12:01","Change MediaPlayer URI","<android><uri><media-player>","1","0","1","",""
"1869989","1","1872281","","2009-12-08 21:33:12","7","1485","<p>Thanks to <code>TasKiller</code> I have reliable way to shutdown updates coming to my <code>AppWidget</code> from the <code>AlarmManager</code>! Now, sarcasm aside, how do I recover from such event? So far I only see that the <code>Alerts</code> are resurrected only after rebooting the phone. I can stick recovery code into few places such as various <code>Activity#onCreate</code> that belong to my app and my widget but is there a better way? Also what if the alerts are OK - is there a way to detect that and not run AlarmManager#setRepeating? Or is there a harm to run it multiple times?</p>","135946","","135946","","2009-12-08 22:05:06","2009-12-09 07:52:16","Android - AlarmManager recovery","<android><recovery><alarmmanager>","1","0","1","",""
"1870796","1","1872062","","2009-12-09 00:12:35","1","7295","<p>In my android application, I start another activity using 'startActivity'.Is there anyway for me to kill that activity I started?</p><p>Thank you.</p>","128983","","","","","2011-12-08 21:31:35","A Way to kill an activity in Android","<android>","2","0","","",""
"1871515","1","1874933","","2009-12-09 04:03:35","20","23029","<p>I'd like my app to upload an image to a web server. That part works.</p><p>I'm wondering if it's possible to somehow show the progress of the upload by entering an entry in the ""notification bar"". I see the Facebook app does this.</p><p>When you take a picture and choose to upload, the app lets you continue on, and somehow puts the picture upload notifications in a progress bar in the notification bar. I think that's pretty slick. I guess they spawn a new service or something to handle the upload and update that progress bar in the notification bar every so often.</p><p>Thanks for any ideas</p>","137193","","","","","2013-09-30 15:53:50","Progress bar in notification bar when uploading image?","<android>","5","1","4","",""
"1871906","1","1873127","","2009-12-09 06:13:01","2","704","<p>I would like to start <code>MyActivity</code> class when the user clicks on the search button on the handset.</p><p>Are there any strategies you can suggest for this? Any code examples would be very useful.</p>","216431","","4737","","2009-12-09 11:05:16","2009-12-09 11:06:08","How to start an Activity on clicking the Search button on an Android handset","<android><search>","1","0","","",""
"1873020","1","","","2009-12-09 10:36:46","28","4292","<p>If I have a <code>ListView</code> with two different kinds of items, enabled and disabled ones (meaning selectable and non-selectable), Android draws a small divider correctly between the enabled items, but not between disabled items. Instead it draws a transparent divider, which causes really bad design issues. This has already been discussed <a href=""http://groups.google.com/group/android-developers/browse%5Ffrm/thread/ba8889a34763459f/4d494e2c37a94c3a"">here</a> (Google Groups), but without any solution.</p><p>What I'm looking for is a way to force Android to draw the same divider which is being used between <code>enabled</code> items also to being used between <code>disabled</code> items instead of just leaving a transparent space.</p>","184367","","","","","2013-01-26 23:07:44","Android: ListView non-enabled items draw invisible divider","<android><listview>","2","4","6","",""
"1873103","1","1873500","","2009-12-09 10:54:53","1","628","<p>I am a new developer for Android.I wanna know about View transitions.</p><p>For my application, it has 5 screens that can shift each other. </p><p>In order word, Screen1 -> Screen2 &lt;--> Screen3 &lt;--> Screen4 -> Screen5. </p><p>How to make this screen transition on Android ?</p><p>Please share the knowledge. </p><p>Thanks in advance.</p>","227889","","","","","2012-04-28 11:09:52","How to call a view from the view?","<android>","2","0","1","",""
"1873497","1","","","2009-12-09 12:08:00","1","523","<p>I am using JDOM to create XML and during parsing i am getting this exception ""Could not find class 'java.rmi.RemoteException', referenced from method org.jdom.JDOMException.getNestedException""  which cause a crash in program .This exception occurs  very frequently but not always Any body has faced same problem .Any help would be appreciatedThanks in advance.</p>","95877","","","","","2010-12-28 06:48:17","XML parsing Android","<java><android>","1","2","","",""
"1873552","1","","","2009-12-09 12:19:34","0","3880","<p>I'm having a problem in calling .net web services from androidusing ksoap2. The call is executed just fine without parameters, butwhen I pass paramters of any type, the web service just recieves anull value. I tried everything possible but no luck so far. I hopesomeone can help,The client side code is:</p><pre><code> public static boolean temp(){          try {            SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME_TEMP);           PopertyInfo p = new PropertyInfo();           p.type = PropertyInfo.INTEGER_CLASS;           p.setName(""num"");           p.setValue(5);           p.setNamespace(NAMESPACE);           request.addProperty(p)  ;           SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11 );           envelope.dotNet = true;           envelope.encodingStyle = SoapSerializationEnvelope.ENC;           envelope.setOutputSoapObject(request);           AndroidHttpTransport  androidHttpTransport = new AndroidHttpTransport (URL);           androidHttpTransport.call(SOAP_ACTION_TEMP, envelope);     .....             }     .....</code></pre>","227945","","841915","","2012-07-19 12:42:52","2013-01-15 06:07:59","passing paramters using ksoap2 to .net web service, always passes nulls (empty) values","<.net><android><service><ksoap2>","2","0","","",""
"1873685","1","1874320","","2009-12-09 12:50:26","0","697","<p>I've prepared custom component based on LinearLayout. Whole component is defined in XML. Currently to use it you have to write: </p><pre><code>&lt;com.xxx.android.components.TopMenu     android:layout_width=""fill_parent""    android:layout_height=""44dp""/&gt;</code></pre><p>Is it possible to set width and height in the java constructor? So it would be possible to write just: </p><pre><code>&lt;com.xxx.android.components.TopMenu /&gt;</code></pre><p>I've tried to modify and set LayoutParams, but it didn't work for me.</p>","58862","","","","","2009-12-09 14:36:26","How to change custom component height programatically","<android>","1","0","","",""
"1875086","1","","","2009-12-09 16:31:23","1","3235","<p>My scenario:<br>-I'm using a list view in multiple  choice mode to enable a user todelete several items he/she has checked, at once.<br>-When the user clicks the delete button, i do the following:<br><em>-get positions of checked items using: myList.getCheckedItemPositions();<br>-Get the items in this position and put them to a list - toDeleteList.<br>-(QUESTION BASED ON THIS STEP) use myList.setItemChecked(position,false) to uncheck the list item.<br>-Remove the items in the ""toDeleteList""</em></p><p>Now, i was ""forced"" to manually uncheck the list item because the result of myList.getCheckedItemPositions() does not change after deleting from mylist.. i.e    </p><p>-if, for example, I delete the 1st item (a) of list [a, b, c, d], <b>b</b>will appear checked after the delete ie. in list the list [b, c, d] - after deleting a.  </p><p>Question is why? Because the SparseBooleanArray returned bymyList.getCheckedItemPositions(); is the same before and <b>after</b>deleting from the list - using the adapter.</p><p>I thought (i could be wrong) that after removing an item from the listvia the adapter, the CheckedItemPositions array should also change toreflect the new state of the list </p><p>eg.- mylist = [a, b, c, d]<br>- then i check items at position 0 and 3 checked (a &amp; d)<br>- the checked item positions (mylist.getCheckedItemPositions()) array now has values true for positions 0 and 3<br>- If i remove a &amp; d from the list, therefore, mylist = [b,c],mylist.getCheckedItemPositions() is still the same as above ie. positions 0 and 3 are still checked after deleting items from the list (i think this is not normal - but again i could be wrong)<br>-I was expecting it not to be checked for positions 0 &amp; 3 because theitems that were previously at these positions are no longer in the list.</p><p>i'm i getting something wrong here (or having the wrongexpectations :) ) ? someone please clarify this..<br>Thanks in advance,</p>","228102","","","","","2012-04-09 04:54:48","Android list view clarification quest","<android><listview><checkbox>","3","0","","",""
"1875669","1","2046576","","2009-12-09 17:55:55","8","24833","<p>I'm thinking about using a hidden api to turn the screen off in my app. setScreenState from <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/os/Power.java"">http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/os/Power.java</a> does what I want, but its a hidden API. Does that mean I shouldn't use it? I would think its a fairly stable api.Currently, I'm setting the screen timeout to 1 millisecond, and then resetting the timeout once the screen turns off. However, android ignores the 1 millisecond and instead it takes about 3 seconds to turn off and sometimes it ignores it completely and doesn't turn off.Any suggestions?</p>","341390","","","","","2014-03-23 13:53:29","Calling hidden API in android to turn screen off","<android>","3","5","9","",""
"1875670","1","","","2009-12-09 17:56:30","7","7830","<p>I'm using an AsyncTask in my activity. Looks like:</p><pre><code>public class MyActivity {    private AsyncTask mTask;    private void doSomethingCool() {        mTask = new AsyncTask(...);        mTask.execute();    }    @Override    protected void onPause() {         super.onPause();        // How do I let the task keep running if just rotating?        if (isFinishing() == false) {            ...         }    }}</code></pre><p>So if the user is rotating the device, onPause() will get called, but I don't want to cancel the task just because of that. I know there's a way to tell the system to not actually destroy my activity on rotation, but is that recommended for this problem? Should I instead put the AsyncTask in a static global class that won't be bound to the Activity?</p><p>Thanks</p>","137193","","","","","2011-06-04 01:53:59","What to do with AsyncTask in onPause()?","<android>","4","0","6","",""
"1876576","1","1876646","","2009-12-09 20:16:17","2","357","<p>I have a project compiled with and targeting 1.5. I now want to support different screen sizes instead of letting android handle the scaling.</p><p>All I've done is modified my manifest to look like this:</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""4""/&gt;</code></pre><p>and I changed my project properties to build against the 1.6 (level 4) SDK.</p><p>That's all I need to do, right? All my layouts are using dip, so it should scale, and I don't want to mess with different size bitmaps just yet. Is it really necessary to add the:</p><pre><code>&lt;supports-screens&gt;</code></pre><p>tag to the manifest in my case? It's good to run on all screen sizes as-is, even QVGA.</p><p>Thanks</p>","137193","","991737","","2012-01-12 18:40:40","2012-01-12 18:40:40","Multiple screen support sanity check","<android><screen>","1","0","","",""
"1877343","1","1879054","","2009-12-09 22:22:04","0","593","<p>Not sure of the absolute utility of this but seems as though it should be possible and useful.  Can you extend ContentProvider to provide URIs representing new queries (i.e., joins across multiple tables not specified by existing URIs) for an existing system database? The alternative seems to be that I need to write a series of cursor queries then join them -- seems like a lot of unnecessary code duplication.</p><p>I have been trying this for the contacts database as an exercise, but no love so far.  The crux seems to be that I cannot open a database in another package during the setup phase.  Am I just completely out in left field here?  It's possible as I am new to both Java and Android.</p><p>Comments and/or pointers to relevant resources are appreciated.</p><p>Thanks,</p><p>Steve</p>","228344","","","","","2009-12-10 06:36:33","Possible to write custom content provider for existing system database?","<android><content><provider>","1","0","","",""
"1877417","1","1877909","","2009-12-09 22:35:52","70","166762","<p>What is the proper way to set a timer in android in order to kick off a task (a function that I create which does not change the UI)? Use this the Java way:<a href=""http://java.sun.com/j2se/1.4.2/docs/api/java/util/Timer.html"">http://java.sun.com/j2se/1.4.2/docs/api/java/util/Timer.html</a></p><p>Or there is a better way in android (android's handler)?</p>","125440","","73488","","2010-09-22 23:29:09","2014-03-10 07:25:37","How to set a timer in android","<android>","10","0","37","",""
"1878623","1","1878835","","2009-12-10 04:23:58","0","10905","<p>I have an <code>ListView</code> inside a <code>HorizontalScrollView</code> and it works perfectly fine, except for the initial load.  I'm loading the data for the list view from a web service so I created a thread to do that.  Once I have the data, I simply call <code>_myListAdapter.notifyDataSetChanged();</code> and the data becomes visible in the <code>ListView</code>.  But if the <code>ListView</code> is far off the screen, the containing <code>HorizontalScrollView</code> will automatically scroll to make this <code>ListView</code> visible.  How can I call <code>notifyDataSetChanged</code> without making the <code>ListView</code> scroll into the current view?  </p><p>Here's an idea of how I have my layout XML file:</p><pre><code>&lt;HorizontalScrollView 	android:id=""@+id/my_scrollview""	android:layout_width=""fill_parent""	android:layout_height=""fill_parent"" 	android:scrollbars=""none""&gt;	    &lt;LinearLayout android:id=""@+id/my_layout""		    android:layout_width=""wrap_content""		    android:layout_height=""fill_parent""		    android:orientation=""horizontal""&gt;	            &lt;ListView android:id=""@+id/my_list""		            android:layout_width=""fill_parent""    		        android:layout_height=""fill_parent""		            android:layout_weight=""1"" /&gt;        &lt;/LinearLayout&gt;&lt;/HorizontalScrollView&gt;</code></pre>","101280","","","","","2009-12-10 05:41:02","ListView in a HorizontalScrollView in Android","<android><listview><horizontalscrollview>","1","1","1","",""
"1878877","1","","","2009-12-10 05:54:02","0","1436","<p>Hi  I am trying to create Yahoo messenger client in Android, and i got Openymsg api to implement that.This is small snippet of my code</p><pre><code>        Session session=new Session();        session.login(""Email Id"", ""password"");</code></pre><p>But this code is throwing UnknownHost Exception in ""scs.msg.yahoo.com"".I dont know how to fix this.If any body knows it please help me.</p>","131062","","","","","2010-09-29 21:13:49","How to create Yahoo Messenger Client in Android?","<android>","4","0","","",""
"1879700","1","","","2009-12-10 09:10:53","2","7456","<pre><code>ArrayList&lt;String&gt; values=new ArrayList&lt;String&gt;();values.add(""s"");values.add(""n"");values.add(""a"");values.add(""s"");</code></pre><p>In this Array, I want to remove repeated values.</p>","227958","","683261","","2013-01-24 08:43:58","2013-01-24 08:43:58","How to remove Duplicate value from arraylist in Android","<java><android><arraylist>","4","2","2","",""
"1879900","1","","","2009-12-10 09:47:47","3","1574","<p>how to block characters in edittext in android?</p>","217065","","","","","2009-12-10 13:10:33","how to block characters in edittext in android?","<android>","1","1","","",""
"1879977","1","","","2009-12-10 10:02:14","1","17590","<p>I'm trying to install Android SDK on Ubuntu but fail when I try to use the SDK Manager and AVD Manager to install Android platforms.</p><p>I've downloaded: <code>android-sdk_r04-linux_86.tgz</code></p><p>The I start the SDK Manager and AVD Manager (UI) according to the README file:</p><pre><code>./tools/android</code></pre><p>And I get the following </p><pre><code>  Installed Packages:  - Install SDK Tools, revision 4  Available Packages:  - https://dl-ssl.google.com/android/repoisotry/repository.xml    - This repository requires a more recent version of the Tools. Please update-    - Android SDK Tools, revision 4       - Archive for Linux</code></pre><p>(comment: funny since rev 4 seems to be what's installed this is what seems to be installed)</p><p>Now doing an update of the <code>Android SDK Tools, revision 4</code> or <code>everything</code> results in 99% progress and then the application hangs.</p><p>Here's the console feedback:</p><pre><code>johanc@johan-desktop:~/android/android-sdk-linux_86$ tools/android Starting Android SDK and AVD ManagerNo command line parameters provided, launching UI.See 'android --help' for operations from the command line.Error: null</code></pre><p>In the app I choose to upgate the following package:</p><pre><code>Package DescriptionAndroid SDK Tools, revision 4Archive DescriptionArchive for LinuxSize: 15 MiBSHA1: 99380c9330c1c3728c836206947350cc00fa28c2Sitehttps://dl-ssl.google.com/android/repository/repository.xml</code></pre><p>The console output reads (and the app hangs at 99%):</p><pre><code>Exception in thread ""Installing Archives"" java.lang.AssertionError   at com.android.sdkuilib.internal.tasks.ProgressTask.incProgress(ProgressTask.java:97)   at com.android.sdkuilib.internal.repository.UpdaterData$2.run(UpdaterData.java:358)   at com.android.sdkuilib.internal.tasks.ProgressTask$1.run(ProgressTask.java:135)</code></pre>","100171","","102703","","2010-01-29 02:10:19","2011-08-26 06:48:10","Android SDK Manager and AVD Manager doesn't have the correct information and fails to update on Ubuntu","<android>","7","1","1","",""
"1880862","1","1880917","","2009-12-10 13:04:47","2","7822","<pre><code>public class MessageDisplayDialog extends Dialog implements OnClickListener{    public MessageDisplayDialog(Context context, String title, String message)    {        super(context);        setTitle(title);        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.color.default_text_color);        Log.v(getClass().getSimpleName(), ""MessageDisplayDialog"");        LinearLayout objLinearLayout = new LinearLayout(context);        LinearLayout objButtonLayout = new LinearLayout(context);        TextView objMesaageView = new TextView(context);        objMesaageView.setText(message);        objMesaageView.setTextColor(Color.WHITE);        objMesaageView.setGravity(Gravity.CENTER_HORIZONTAL);        objMesaageView.setPadding(0, 0, 0, 10);        Button okButton = new Button(context);        okButton.setText("" OK "");        okButton.setOnClickListener(this);        okButton.setWidth(100);        objButtonLayout.addView(okButton);        objButtonLayout.setGravity(Gravity.CENTER_HORIZONTAL);        objButtonLayout.setPadding(0, 5, 0, 0);        objButtonLayout.setBackgroundColor(Color.LTGRAY);        objLinearLayout.setOrientation(LinearLayout.VERTICAL);        objLinearLayout.addView(objMesaageView);        objLinearLayout.addView(objButtonLayout);        setContentView(objLinearLayout);        //LayoutParams param = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);        //this.addContentView(objLinearLayout, param);    }    public void onClick(View v)    {        this.dismiss();    }}</code></pre><p>But the Dialog is not showing bar below the Title, how to crack it.</p>","92039","","114066","","2010-04-15 09:30:02","2012-04-28 10:42:59","Android Custom Dialog Class Title Problems","<android>","4","0","0","",""
"1882156","1","1882954","","2009-12-10 16:19:10","16","8507","<p>I'm having an issue using a <code>MatrixCursor</code> to populate my <code>ListView</code>:</p><pre><code>private void fillData() {    String[] menuCols = new String[] { ""icon"", ""item"", ""price"" };    int[] to = new int[] { R.id.icon, R.id.item, R.id.price };    MatrixCursor menuCursor = new MatrixCursor(menuCols);    startManagingCursor(menuCursor);    menuCursor.addRow(new Object[] { R.drawable.chicken_sandwich, ""Chicken Sandwich"", ""$3.99"" });    SimpleCursorAdapter menuItems = new SimpleCursorAdapter(            this, R.layout.menu_row, menuCursor, menuCols, to);    setListAdapter(menuItems);}</code></pre><p>Constructing the <code>SimpleCursorAdapter</code> causes a crash. Even when I tried removing the icon the app still crashed. Here is my <code>menu_row.xml</code>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;ImageView         android:id=""@+id/icon""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt;    &lt;/ImageView&gt;    &lt;TextView         android:id=""@+id/item""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt;    &lt;/TextView&gt;    &lt;TextView         android:id=""@+id/price""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>Edit:</strong> Here is the call stack at the time of the crash:</p><pre><code>Thread [&lt;3&gt; main] (Suspended (exception RuntimeException))      ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2481      ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2497       ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 119     ActivityThread$H.handleMessage(Message) line: 1848      ActivityThread$H(Handler).dispatchMessage(Message) line: 99     Looper.loop() line: 123     ActivityThread.main(String[]) line: 4338        Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]      Method.invoke(Object, Object...) line: 521      ZygoteInit$MethodAndArgsCaller.run() line: 860      ZygoteInit.main(String[]) line: 618     NativeStart.main(String[]) line: not available [native method]  </code></pre><p><strong>SOLUTION:</strong></p><p>I found the problem and the solution is in my answer below.</p>","147333","","493939","","2012-04-16 08:52:33","2012-04-16 08:52:33","Using MatrixCursor and SimpleCursorAdapter in a ListView with text and images","<java><android><matrixcursor>","1","2","4","",""
"1882883","1","1883201","","2009-12-10 18:05:30","34","30985","<p>How can I get the current <code>Android SDK</code> version(1.5, 1.6, 2.0, etc.) programmatically?</p>","164460","","493939","","2012-05-12 16:09:06","2012-05-12 16:09:06","How to retrieve the android sdk version?","<android><sdk><version>","2","3","7","",""
"1883065","1","1883085","","2009-12-10 18:33:10","0","1693","<p>I have written a simple android app and it runs in the emulator.Now how do I actually copy it to my phone? I have HTC's Eris. When I attach it with USB it asks me If I want to mount it as a USB mass storage device. I then see it in my drive list.</p><p>the directories on the device are:</p><pre><code>albumthumbsamazonmp3com.google.android.apps.listenComicReaderdataDCIMdownloadmediamusicrosie_scroll</code></pre><p>Now what should I copy from my Project directory and where should I put it?And is there any other process I need to run to ""install"" my app?</p>","88905","","","","","2013-11-11 06:05:51","How do I copy an android app to an actual device?","<android>","5","0","1","",""
"1883425","1","1892367","","2009-12-10 19:37:50","21","24893","<p>I have created an AlertDialog using AlertDialog.Builder, but the Dialog border takes up too much space on the screen. How do I remove the border? I have tried using another Activity to emulate the dialog with a transparent background, but the dialog is used repeatedly, and creating a new Activity every time introduces a significant amount of lag.</p><p>The answer from <a href=""http://stackoverflow.com/questions/704295/android-show-an-indeterminate-progressbar-without-the-dialog"">here</a> mentions that it can be found in the ApiDemos, but i can't seem to find it.</p>","196980","","","","","2014-04-16 19:33:39","Android Borderless Dialog","<android><dialog>","8","0","10","",""
"1884699","1","1884924","","2009-12-10 22:59:35","5","3516","<p>I am trying to filter out the noise from the orientation/compass sensor in my magic phone.</p><p>Some of the readings seem to be 90-180 degrees off and there is a lot of jiggle. I have tried different things with limited success, so I was wondering if anyone could recommend an algorithm to filter this sort of noise to get a stable output.</p><p>BR, Mads</p>","19","","","","","2013-07-22 16:31:35","Android compass noise algorithm","<android>","6","0","5","",""
"1884972","1","1885022","","2009-12-10 23:56:00","10","3889","<p>I want to create an Android application that is not released to the Android Market for public consumption but only for private use of my company.  Is this possible?  If so can you post a link to where you can do this?</p><p>Thanks!Joe</p>","84885","","","","","2013-01-21 22:37:01","How to create Android Applications only for the Enterprise","<android><enterprise>","3","1","6","2013-01-22 14:13:15",""
"1885115","1","1981710","","2009-12-11 00:39:46","0","1556","<p>I want to provide a clickthrough on the list in a tab which opens another view.I need to open the new view within the same tab. I then need to provide a back button on the changed layout to change the view to original view.</p><p>I have tried this.</p><pre><code>Intent intentA = new Intent(this, AView.class);</code></pre><p>Now I am trying to access the tabSpec from main activity class[MainTabView] and set the intent as follows.</p><pre><code>MainTabView.tabSpec1.setContent(intentA);MainTabView.mTabHost.setCurrentTab(0);MainTabView.mTabHost.invalidate();</code></pre><p>But this does not change the view immediately but changes it when I go to another tab and come to the starting tab. How can I make it to refresh it as soon as the content has been changed to another intent?</p>","229266","","996493","","2012-04-28 10:29:06","2012-04-28 10:29:06","Android: How can we change the view in the tabs?","<android><tabs>","1","0","0","",""
"1886244","1","1886721","","2009-12-11 06:43:13","0","284","<p>I have a program that has a broadcast receiver that listens for Phone_State and then sends a user defined intent. Well, my problem is that the system also sends out an intent (the one that I am trying to replace with my program) So I am trying to find a way to CANCEL the systems intent. I have found that if i have a timer just wait for a little bit, then I can send mine after the systems, but that is not very good, and sometimes defeats the purpose of my program. Also, i cannot set my program as a default because it is not a full dialer program. Just one action of it. Someone please help me find how to listen for and cancel a system intent/activity....</p>","228601","","","","","2009-12-11 08:57:30","Problem with system intents","<android><activity><android-intent><calllog>","1","0","","",""
"1886654","1","1886683","","2009-12-11 08:39:09","2","1026","<p>Is it possible to style a single, say, TextView in Android with multiple alternating styles, colors, and sizes? Think inline HTML or CSS but in the Android world.</p><p>As an extreme, to demonstrate the point, let's say I wanted to have a word ""CIRCUS"" with each letter a being different color. Do I have to create 6 TextViews for this or can this be done in one?</p><p>Thanks.</p>","47680","","","","","2009-12-11 08:48:40","Android: how do you mix and match colors, styles, and sizes in a single view?","<android><design><coding-style>","1","0","1","",""
"1886681","1","1886822","","2009-12-11 08:47:56","4","3025","<p>How can I create a <code>RadioButton</code> with the option on the right side of the text?</p>","164460","","593709","","2013-01-24 11:09:13","2013-01-24 11:09:13","android RadioButton option on the right side of the text","<android><radio-button>","1","0","1","",""
"1886763","1","1886832","","2009-12-11 09:07:04","0","870","<p>I'm writing an application and need some help with consistently storing and loading preferences related to certain resources. Let me give an example.</p><p>Suppose I have 10 spinners. They all have the same functionality but different meaning. Because they have the same functionality, I can bind them to the same <code>onItemSelectedListener</code>, which will then deal with the selected value.</p><p>Well, what if I also want to store the preferences for each spinner? For example, when a spinner value is selected, I'd store a key ""spinner <strong>SOMETHING</strong>"" = SOME_DATA.</p><p>The problem is - what should this <strong>SOMETHING</strong> be? The listener has the following signature:</p><p><code>public void onItemSelected(AdapterView parent, View v, int position, long id)</code></p><p>The position and id are not helpful here as they're set relative to each spinner.</p><p>However, the parent, which in this case is the spinner itself, should have all the information I need. I tried using parent.getId() to get a resource ID of each spinner and store the preference using a key ""spinner ID"" but apparently these resource IDs change when you add more resources into your app, so my settings would get reset because the keys change.</p><p>What should I do here? I can't seem to find a simple parent.getName() function of some sort that would return me a consistent name of each spinner.</p><p>Thank you.</p>","47680","","","","","2009-12-11 09:24:13","Android and storing/loading preferences for resources - how to achieve consistency?","<android><listener><preferences><spinner>","1","0","1","",""
"1886874","1","","","2009-12-11 09:32:27","11","12987","<p>I start a service in an activity then I want the service to stop itself after awhile.</p><p>I called stopSelf() in the service but it doens't work.</p><p>how to make the service stop itself? thanks!!!</p>","210235","","","","","2014-04-05 01:45:51","How to stop service by itself?","<android>","4","3","6","",""
"1887242","1","","","2009-12-11 10:42:53","1","4353","<p>I am able to see Map in emulator but once I load app on device map does not show up.</p><p>Emulator have target as google api 1.6 and device have android 1.6 loaded.</p><p>Is this diffrence causing issue?</p><p>please help and thanks in advance.</p>","229545","","","","","2012-10-29 09:10:59","Android Map: Map does not show up on Device","<android><map>","4","0","0","",""
"1887377","1","","","2009-12-11 11:14:21","0","757","<p>I want to invoke my application once user creates / updates contact from his device.i.e once user hit ""<strong>Done</strong>"" button. is it possible ? If possible please provide sample code or link.</p><p>Please help and thanks in advance.</p>","229545","","750613","","2012-07-10 09:56:48","2012-07-10 09:56:48","Android: How to capture button press event for contact create app of device","<android><button><capture><pressed>","1","0","","",""
"1887413","1","","","2009-12-11 11:21:26","1","966","<p>How to convert numbers from exponential to normal form in <a href=""http://en.wikipedia.org/wiki/Android%5F%28operating%5Fsystem%29"" rel=""nofollow"">Android</a>?</p>","217065","","85326","","2011-06-23 18:03:08","2012-04-28 10:12:34","How to convert numbers from exponential to normal form in Android?","<java><android>","2","2","","",""
"1887510","1","","","2009-12-11 11:40:16","0","312","<p>I am creating a small application. In View Page I am performing update and delete operations from database and displaying data on the top (ex 10 records). At the bottom I have 2 buttons ,Edit and delete. If user clicks Edit button, it redirects to Edit page. In Edit page I am displaying content for editing also I have 2 buttons update and cancel. If user click update again I am redirecting(using start activity) to view page. It is not displaying new records. I went back to main page and then I clicked view page now it is updated How to solve this ??? Another problem is at the same if user clicks back button it is going all page which i went (through redirected page).</p><p>For example, first I click view page from main page. In view page am doing edit and delete operation.After completing this it goes to view page. Here I am clicking back button it is going previous page that is edit or delete page which I have performed last. I need to go main page from view (after performing edit or delete op) How to do this ?</p>","227958","","1288","","2012-06-07 13:29:55","2012-06-07 13:29:55","Back Button isssue","<android>","1","3","","",""
"1887719","1","1888847","","2009-12-11 12:19:22","3","550","<p>This is my ListActivity:</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.my_list);    mDbHelper = new MyDbAdapter(this);    mDbHelper.open();    fillData();    registerForContextMenu(getListView());}private void fillData() {    // Get all of the rows from the database and create the item list    Cursor c = mDbHelper.fetchAllTransactions();    startManagingCursor(c);    // Create an array to specify the fields we want to display in the list    String[] from = new String[]{MyDbAdapter.KEY_DATE, MyDbAdapter.KEY_NAME};    // and an array of the fields we want to bind those fields to    int[] to = new int[]{R.id.row_date, R.id.row_name};    // Now create a simple cursor adapter and set it to display    setListAdapter(new SimpleCursorAdapter(this, R.layout.my_list_row, c, from, to));}</code></pre><p>and this is my row layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView android:id=""@+id/row_date"" android:layout_width=""wrap_content"" android:layout_height=""fill_parent"" /&gt;    &lt;TextView android:id=""@+id/row_name"" android:layout_width=""wrap_content"" android:layout_height=""fill_parent"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>The date is actually stored as an int in the SQLLite database, and thus it displays as an integer.  </p><p>Does anyone know a way to create a date from the int so it doesn't display as <code>1216544611</code> (or whatever) but as <code>""12/11/2009 11:32""</code>?</p>","94870","","750613","","2012-07-10 09:56:29","2012-07-10 09:56:29","ListActivity: alter data from SQLite before putting it into the row","<android><listactivity>","2","1","1","",""
"1887758","1","","","2009-12-11 12:27:58","5","21160","<p>Does Android  support flash? If yes then i need an example code to play a flash file. Wonder if we can play a flash file in WebView? </p><p>Waiting for reply</p>","2355649","","24762","","2009-12-11 13:26:01","2011-03-15 10:18:30","Playing a Flash File in Android","<android><flash>","4","1","4","",""
"1889188","1","1889301","","2009-12-11 16:26:14","4","10067","<p>I try to create 'foo/bar.txt' in Android's /data/data/pkg/files directory.</p><p>It seems to be a contradiction in docs:</p><blockquote>  <p>To write to a file, call Context.openFileOutput() with the name and path. </p></blockquote><p><a href=""http://developer.android.com/guide/topics/data/data-storage.html#files"" rel=""nofollow"">http://developer.android.com/guide/topics/data/data-storage.html#files</a></p><blockquote>  <p>The name of the file to open; can not contain path separators.</p></blockquote><p><a href=""http://developer.android.com/reference/android/content/Context.html#openFileOutput%28java.lang.String,%20int%29"" rel=""nofollow"">http://developer.android.com/reference/android/content/Context.html#openFileOutput(java.lang.String,%20int)</a></p><p>And when I call</p><pre><code>this.openFileOutput(""foo/bar.txt"", Context.MODE_PRIVATE);</code></pre><p>exception is thrown:</p><pre><code>java.lang.IllegalArgumentException: File foo/bar.txt contains a path separator</code></pre><p>So how do I create file in subfolder?</p>","62192","","179850","","2013-07-16 16:16:16","2013-07-16 16:16:16","How to create files hierarchy in Androids '/data/data/pkg/files' directory?","<android><file>","4","0","1","",""
"1890844","1","1891519","","2009-12-11 21:01:10","5","12056","<p>I'm trying to write an array of objects that implement <a href=""http://developer.android.com/reference/android/os/Parcelable.html"">Parcelable</a> into a <a href=""http://developer.android.com/reference/android/os/Parcel.html"">Parcel</a> using   <a href=""http://developer.android.com/reference/android/os/Parcel.html#writeParcelableArray%28T%5B%5D,%20int%29"">writeParcelableArray</a>.</p><p>The objects I'm trying to write are defined (as you'd expect) as:</p><pre><code>public class Arrival implements Parcelable {    /* All the right stuff in here... this class compiles and acts fine. */}</code></pre><p>And I'm trying to write them into a `Parcel' with:</p><pre><code>@Overridepublic void writeToParcel(Parcel dest, int flags) {    Arrival[] a;    /* some stuff to populate ""a"" */    dest.writeParcelableArray(a, 0);}</code></pre><p>When Eclipse tries to compile this I get the error:</p><blockquote>  <p>Bound mismatch: The generic method  writeParcelableArray(T[], int) of type  Parcel is not applicable for the  arguments (Arrival[], int). The  inferred type Arrival is not a valid  substitute for the bounded parameter  &lt; T extends Parcelable ></p></blockquote><p>I completely don't understand this error message. <code>Parcelable</code> is an interface (not a class) so you can't extend it. Anyone have any ideas?</p><p><strong>UPDATE:</strong> I'm having basically the same problem when putting an <code>ArrayList</code> of <code>Parcelable</code>s into an <code>Intent</code>:</p><pre><code>Intent i = new Intent();i.putParcelableArrayListExtra(""locations"", (ArrayList&lt;Location&gt;) locations);</code></pre><p>yields:</p><blockquote>  <p>The method putParcelableArrayListExtra(String, ArrayList&lt; ? extends Parcelable >) in the type Intent is not applicable for the arguments (String, ArrayList&lt; Location >)</p></blockquote><p>This may be because <code>Location</code> was the class I was working on above (that wraps the <code>Arrival</code>s), but I don't think so.</p>","76835","","76835","","2009-12-11 21:15:58","2011-12-10 12:33:25","Writing arrays of Parcelables to a Parcel in Android","<java><android><parcelable><parcel>","3","0","1","",""
"1891072","1","1893974","","2009-12-11 21:45:32","7","531","<p>finally my old Nokia broke down just hard enough to justify buying a new proper phone, an Android!  </p><p>In a way I'm glad it's taken me this long to obtain a ""layman-hackable"" phone; I doubt I could have resisted developing funny bits of this&amp;thats on a smartphone with time needed spent elsewhere...(would have had mad skills in Windows Mobile 3.0 (if it exists)) though...   </p><p>Sorry, I digress; which is also at the the root of my question.<br>I am well versed in .NET, and after having some on-again off-again relationships with the regular assortment of open source languages, I've come to the conclusion that I need my Visual Studio, simple as that.  </p><p>So...if I want to develop for the Android, I obviously must make some sacrifices, but is Java really the only truly supported language for ""ordinary"" Dalvik (best.name.ever.by.the.way), or is there any other way?  </p><p>After having been forced Java at school, I would like to avoid it as much as is ""reasonably"" possible....the Python crowd always seem to be totally surfing around and above the curb, and Python I love! If not already, how long is it reasonable to wait before they get some Android capabilities in there ;-) ?  </p><p>Any recommandations anyone, I really can't stand being soooo close to being able to make my phone act the way I think is sensible....after all these years.....</p><h3>Update:</h3><p>Thank you all for your interest, even though you demoralized me to the point that my weekend was spent alternating between cursing, rebooting for path-updates et. al. (I have a terrible tendency to dabble in exactly the wrong place while waiting for long drawn installations...), and most of all re-discovering why I didn't really consummate my love for development until <i>after</i>  leaving school...(and started working as a developer ;-)  </p><p>Bah, more of an Uplate than an Update, been a long, frustrating weekend...not the joyous adventure I had planed for my little robot buddy....it just made my soul weep to learn that Sun's download pages still make not sense, just neck ache. Will sort this all out tomorrow, the mythical man month my a** ;-)<br>Again, thanks and cheers!</p><h2>Houston, we are ready for take off!</h2><p>A very real difference between your pet projects and those that pay the bills, is having the luxury of letting tech mature and just do some other cool stuff while you wait for the prereqs to get themselves into order.<br>Seems <a href=""http://en.wikipedia.org/wiki/MonoDroid#MonoTouch_and_Mono_for_Android/"" rel=""nofollow"">MonoTouch</a> has what it takes. I no longer have an Android, so I haven't tried it for myself, but if Wally McClure [says it's so], in an all round interesting interview, I felt I should put the links in. </p><p>Now...how to get C# to make my Symbian FaceTweeteer do some Linq to GPS...</p>","447694","","447694","","2011-08-21 21:00:30","2011-08-21 21:00:30","Recommendations for C#-ish developer regarding smooth transistion to Android?","<.net><android>","5","5","2","",""
"1891736","1","1892622","","2009-12-12 00:26:08","0","4781","<p>I'm working on my first Android project, and I created a menu via the XML method.  My activity is pretty basic, in that it loads the main layout (containing a ListView with my String array of options).  Here's the code inside my Activity:</p><pre><code>public void onCreate(Bundle savedInstanceState) {	super.onCreate(savedInstanceState);	setContentView(R.layout.main);	// allow stuff to happen when a list item is clicked	ListView ls = (ListView)findViewById(R.id.menu);	ls.setOnItemClickListener(new OnItemClickListener() {		@Override		public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {			// @todo		}	});}</code></pre><p>Within the onItemClick callback handler, I'd like to check which item was clicked, and load a new menu based upon that.</p><p>Question 1: How do I go about figuring out which item was clicked?  I can't find any straightforward examples on retrieving/testing the <code>id</code> value of the clicked item.</p><p>Question 2: Once I have the <code>id</code> value, I assume I can just call the <code>setContentView</code> method again to change to another layout containing my new menu.  Is that correct?</p>","107277","","","","","2011-02-25 06:00:59","Interpreting item click in ListView","<android><listview><callback><click><listener>","1","0","","",""
"1891809","1","1897315","","2009-12-12 00:58:14","4","7951","<p>In Android 1.6, upon tapping a spinner (drop-down menu), radio buttons appear next to the spinner options. How do I remove those radio buttons so that just the option text remains?</p>","204499","","","","","2013-08-22 15:48:02","Android Spinner - How to remove radio buttons?","<java><android><android-widget><spinner>","6","0","4","",""
"1892135","1","1896013","","2009-12-12 03:12:52","2","967","<p>I have a ListView that has some minor visual preferences that are set in a PreferenceScreen. These preferences are simple booleans to show or not to show some specific TextViews on each item in my ListView. Anyhow, when these preferences are changed, I need to notify my ArrayAdapter that the data has changed in order to get the list redrawn. However, doing this via an OnSharedPreferenceChangeListener wouldn't really be optimal because there are several preferences that you can change, that would cause an unnecessary amount of updates to the ArrayAdapter. So, to the question: How can I identify when my ListActivity has occurred on the screen after closing my PreferenceActivity, which I then could use to check for changes in the preferences, and only then notify the ArrayAdapter.</p><p><strong>Edit:</strong> The ArrayAdapter being an inner class of my ListActivity, which is set as a ListAdapter.</p>","230094","","750613","","2012-07-10 09:55:04","2013-10-25 22:04:57","Notifying an ArrayAdapter of changes when closing a PreferenceActivity","<android>","2","0","","",""
"1892646","1","","","2009-12-12 07:14:52","0","696","<p>how to get custom dialog activity while clicking on listview in android?</p>","217065","","","","","2009-12-19 06:53:36","how to get custom dialog activity while clicking on listview in android?","<android>","1","0","","",""
"1892753","1","1893558","","2009-12-12 08:19:20","4","11228","<p>I want to display one static HTML page in my android emulator.  Idon't know how to do this.  Please anybody help me.</p>","131062","","23897","","2009-12-12 08:21:18","2012-09-26 08:42:56","How to show static HTML page in android emulator?","<android>","3","0","3","",""
"1893072","1","2164906","","2009-12-12 11:09:04","24","26936","<p>I've implemented a simple application which shows the camera picture on the screen. What I like to do now is grab a single frame and process it as bitmap.From what I could find out to this point it is not an easy thing to do.</p><p>I've tried using the onPreviewFrame method with which you get the current frame as a byte array and tried to decode it with the BitmapFactory class but it returns null.The format of the frame is a headerless YUV which could be translated to bitmap but it takes too long on a phone. Also I've read that the onPreviewFrame method has contraints on the runtime, if it takes too long the application could crash.</p><p>So what is the right way to do this?  </p>","2450","","","","","2012-04-12 08:42:26","Getting frames from Video Image in Android","<java><android><camera>","2","2","26","",""
"1893164","1","1893184","","2009-12-12 11:50:57","0","709","<p>how to apply on click action on menu in android?</p>","217065","","","","","2009-12-12 11:58:42","how to apply on click action on menu in android?","<android>","2","0","","",""
"1893838","1","1895247","","2009-12-12 16:01:13","2","4473","<p>With Android, you can define different resources for different phone attribute by naming res directories appropriately.  I need to be able to support different layouts for <code>480x800</code> and <code>480x854</code>.  I figured I could have one set of resources stored in the layout-hdpi-v4 directory and another in layout-long-hdpi-v4.  However, both resolution seem to think that they are long (at least based on the emulator, which I understand may not reflect devices accurately).</p><p>Is there another way in which I can distinguish between the two resolutions/aspect ratios?</p>","230317","","750613","","2012-07-10 09:45:35","2012-07-10 09:45:35","How does Android define a screen resolution as long?","<android><screen-resolution>","2","0","","",""
"1894131","1","1894854","","2009-12-12 17:34:24","0","743","<p>I'm using SharedPreferences to store some app settings. If I push a new version to marketplace, and my users download, will all those SharedPreferences be removed on the upgrade? I know my sqlite databases will remain intact, wondering if the same is true for SharedPreferences.</p><p>Thanks</p>","137193","","","","","2009-12-12 22:07:56","SharedPreferences remain intact between app upgrades?","<android>","1","0","2","",""
"1894984","1","1895004","","2009-12-12 23:05:20","2","4455","<p>I've started Android programming recently so bear with me :)</p><p>I develop an app which has all of its content stored in database.sql file.I've implemented a subclass of SQLiteOpenHelper and added database.sql to my project assets.</p><pre><code>public class DBHelper extends SQLiteOpenHelper{public DBHelper (Context ctx){  super(ctx, ""database.sql"", null, 1);}}</code></pre><p>This thing doesn't work. I just get an exception every time I try to do smth with DB :(</p>","230466","","","","","2009-12-15 15:33:41","Use sqlite database from Android app resources","<database><android><sqlite><mobile><resources>","2","1","1","",""
"1895206","1","1895302","","2009-12-13 00:42:23","19","19249","<p>Can you please tell me how to launch the Add Contact' activity in android?Thank you.</p>","128983","","","","","2013-08-26 08:31:29","How can I launch the 'Add Contact' activity in android","<android>","7","0","12","",""
"1895303","1","1896130","","2009-12-13 01:36:08","10","4532","<p>I'm working on a layout where I use a ListView with RelativeLayout line items. The lineitems themselves are not displaying correctly. </p><p>The issue is that the txtVideoDuration TextView is drawn at the top of the line item instead of the bottom. Because of this the txtVideoTitle gets a height of 0. As you can see in the XML the txtVideoDuration is supposed to be clamped to the bottom of the ListView.</p><p>My goal is to have the layout resemble the tutorial that google gave me. Example: <a href=""http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html"">http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html</a></p><p>I'm using Android 2.0.1. I've even plugged in the example layout with out modification into the ListView and the same behavior happens.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""?android:attr/listPreferredItemHeight""android:padding=""6dip""&gt;&lt;ImageView	android:layout_width=""wrap_content""	android:layout_height=""fill_parent""	android:id=""@+id/imgVideoThumbnail""	android:layout_alignParentTop=""true""	android:layout_alignParentBottom=""true""	android:minHeight=""64dip""	android:layout_marginRight=""6dip""	android:src=""@drawable/icon"" /&gt;&lt;TextView 	android:id=""@+id/txtVideoDuration""	android:layout_width=""fill_parent""    android:layout_height=""26dip""     android:layout_toRightOf=""@+id/imgVideoThumbnail""    android:layout_alignParentBottom=""true""    android:layout_alignParentRight=""true""    android:singleLine=""true""    android:ellipsize=""marquee""	android:text=""0:00:00"" /&gt;&lt;TextView	android:id=""@+id/txtVideoTitle""	android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_toRightOf=""@+id/imgVideoThumbnail""    android:layout_alignParentRight=""true""    android:layout_alignParentTop=""true""    android:layout_above=""@+id/txtVideoDuration""    android:layout_alignWithParentIfMissing=""true""    android:gravity=""center_vertical""	android:text=""[Title]""	android:textColor=""#FFFFFF"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>This simple case works. This is the root XML layout for the activity. The buggy code at the top is the line items in the list view. It seems that the ListView itself is breaking it.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;merge xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;ListView	android:id=""@+id/listVideoCatalog""	android:layout_width=""fill_parent""	android:layout_height=""fill_parent"" /&gt;&lt;TextView	android:id=""@+id/txtName""	android:layout_width=""fill_parent""	android:layout_height=""wrap_content""	android:layout_alignParentBottom=""true""	android:text=""Hello World"" /&gt;&lt;/RelativeLayout&gt;&lt;/merge&gt;</code></pre><p>This is the getView Code that inflates the line item into the ListView.</p><pre><code>    static class ViewHolder{	TextView txtTitle;	ImageView imgThumbnail;	TextView txtDuration;	Uri videoLocation;}@Overridepublic View getView(int position, View convertView, ViewGroup parent){	ViewHolder holder;	if(convertView == null)	{		LayoutInflater li = (LayoutInflater) this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);		convertView = li.inflate(R.layout.listitem_videolineitem, null);		holder = new ViewHolder();		holder.txtDuration = (TextView) convertView.findViewById(R.id.txtVideoDuration);		holder.txtTitle = (TextView) convertView.findViewById(R.id.txtVideoTitle);		holder.imgThumbnail = (ImageView) convertView.findViewById(R.id.imgVideoThumbnail);		convertView.setTag(holder);	}	else	{		holder = (ViewHolder) convertView.getTag();	}	VideoFile video = this.videos.get(position);	holder.txtDuration.setText(millisToTimestamp(video.videoDuration));	holder.txtTitle.setText(video.videoTitle);            // Some debugger visual code.	holder.txtDuration.setBackgroundColor(Color.GREEN);	holder.txtTitle.setBackgroundColor(Color.CYAN);	return convertView;}</code></pre>","42005","","42005","","2009-12-13 20:12:33","2010-02-05 11:19:33","Android's RelativeLayout seems broken","<listview><android><relativelayout>","2","0","2","",""
"1896939","1","1947370","","2009-12-13 16:19:47","12","15484","<p>Is there a way to create an app specific soft keyboard on Android? After reading about InputMethodService docs and checking out alternative keyboard apps out there, I figure the alternate keyboard can only be configured for system wide usage (through Settings -> Locale and Text).</p><p>If the answer to above question is no, then is there at least a way to load a custom dictionary and override the default dictionary of the system keyboard (only when my app is in use)? That will help in giving very relevant suggestions to the user when he has only tapped couple of keys.</p>","174527","","76465","","2012-10-03 09:19:25","2013-08-28 04:42:08","android app specific soft keyboard","<android><keyboard>","4","0","13","",""
"1897286","1","","","2009-12-13 18:36:04","6","10757","<p>Can anyone shed a light on how to get contact list from android?. </p><p>I just want to get the same list as in the dialer app. But im getting a lots of contacts that are not on the dialer list with the code below. </p><pre><code>ContentResolver cr = getContentResolver();Cursor cursor = cr.query(Contacts.People.CONTENT_URI, null, null, null, Contacts.ContactMethods.DEFAULT_SORT_ORDER);startManagingCursor(cursor);</code></pre><p>Thanks in advance.</p>","230774","","60261","","2009-12-14 03:43:20","2013-12-30 07:33:07","Android Contact List","<android><list><contact>","5","0","","",""
"1898886","1","1913025","","2009-12-14 04:15:45","144","64850","<p>My app shows a signup activity the first time the user runs the app, looks like:</p><ol><li>ActivitySplashScreen (welcome to game, sign up for an account?)</li><li>ActivitySplashScreenSignUp (great, fill in this info)</li><li>ActivityGameMain (main game screen)</li></ol><p>so the activities launch each other in exactly that order, when the user clicks through a button on each screen.</p><p>When the user goes from activity #2 to #3, is it possible to wipe #1 and #2 off the history stack completely? I'd like it so that if the user is at #3, and hits the back button, they just go to the homescreen, instead of back to the splash screen.</p><p>I think I can accomplish this with tasks (ie. start a new task on #3) but wanted to see if there was simpler method,</p><p>Thanks</p>","137193","","","","","2013-03-22 11:43:22","Removing an activity from the history stack","<android>","8","0","56","",""
"1899548","1","1941417","","2009-12-14 07:56:30","1","252","<p>I am displaying search results from a webservice.</p><p>What I do is OnCreate I hit the webservice display records, as android supports multitasking. If user opens another screen and after some time comes back to the search results page, the application starts acting crazy....</p><p>OnCreate method I load data some thing like :</p><pre><code>private void loadData() throws Throwable{    	try {    		jsonArray = JSONService.getJsonArray(getResources().getString(R.string.catJson));    	} catch (Throwable e) {    		Log.e(TAG, e.getMessage());    		throw e;    	}    }</code></pre><p>and then I iterate through json array and change labels value to display result on the screen.</p><p>Any ideas how to fix this?</p>","216431","","11410","","2009-12-14 10:05:03","2009-12-21 17:42:00","Android application acting crazy after coming from background","<android><multitasking>","2","1","0","",""
"1899576","1","1899786","","2009-12-14 08:08:24","1","1135","<p>I know it's considered taboo to place a ListView inside a scrolling container, so is there any ""proper"" way to accomplish scrolling of a container that has a ListView child in it?  An example layout would look something like:</p><pre><code>Header---""Sub"" header---ListView with list items---Footer</code></pre><p>Header and Footer need to remain static on the screen, and the middle content (Subheader and ListView) should scroll between them.  I can't have just the ListView scrollable, because the subheader takes up too much space.  As it is currently, the Header comes from an &lt;include /&gt;, the Subheader contains several views including an Image and some text, and the ListView (actually part of a ViewFlipper) would contain an indeterminate number of items.  The Footer has a couple buttons/tabs that are used to control the ViewFlipper (only one of the views in the flipper is a ListView).</p><p>The only way I can think of to accomplish this efficiently would be to place the Subheader inside the ListView as the first item -- is there any better way?</p>","231078","","","","","2009-12-14 09:04:48","Scrollable parent with ListView child","<android><listview><scrolling>","1","0","","",""
"1900101","1","1900566","","2009-12-14 10:26:19","0","141","<p>I am suing Listview and customize listview to display image inside a list item.I want display image with every search result.</p><p>to display complext listeim i am following the following example</p><p><a href=""http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/List4.html"" rel=""nofollow"">http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/List4.html</a></p><p>inside wrapper class i am initiating new thread for every new list item's image so that i won't dealy the displaying image.</p><p>my code is below</p><pre><code>new Handler().post(new Runnable(){    	           @Override             	   public void run() {    			Drawable dImage = Util.getImageFromURL(imageURL);     			getImageIcon().setImageDrawable(dImage);    			}});</code></pre><p>mean 10 images initiates 10 different image loading threads other static data is not inside thread.</p><p>problem arises when during image loading page application getting hang it should not hang.... any idea what to do ?</p><p><img src=""http://img509.imageshack.us/img509/7519/thumbnailx.jpg"" alt=""alt text""></p>","216431","","","","","2009-12-14 12:08:32","complex listeviewitem image load hang application problem","<android><listviewitem>","1","0","","",""
"1901020","1","","","2009-12-14 13:46:25","1","7817","<p>android is new for me.I am trying to develop a program on 1.5 platform but still in progress, plz guide me.</p><p>I have some information in following format</p><pre><code>""item1"",""description1""""item2"",""description2""""item3"",""description3""""item4"",""description4""....</code></pre><p>I want to show them on screen, I dont know which is recommended way to do this.  After google I found 2 method. but I failed to successfully implement any of one.</p><p><strong>Method 1</strong></p><p>I break both columns data into 2 different arrays, then populatelistactivity with array of column 1, enable filter &amp; on clicked event I want to raise alert which should show Text clicked in tilte &amp; desc from 2nd array as msg body based on position.But here is problem if using filter index becomes reinitialize :-(, and there didnot find another way to get text of that row.</p><p><hr></p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //setContentView(R.layout.main);   setListAdapter(new ArrayAdapter&lt;String&gt;(this,                                android.R.layout.simple_list_item_1, Names));       getListView().setTextFilterEnabled(true);}</code></pre><p><hr></p><pre><code>public void onListItemClick(ListView parent, View v, int position, long id) {    Builder builder = new AlertDialog.Builder(this);    builder.setTitle(Names[position]);     builder.setMessage(description[position] + "" -&gt; "" + position );    builder.setPositiveButton(""ok"", null);    builder.show();}</code></pre><p><hr></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""@string/hello""    /&gt;&lt;/LinearLayout&gt;</code></pre><p><hr></p><p>its not picking right item from position if filter used :-(, plz guideCan you share source code of this</p><p><strong>Method B</strong></p><p>Here I tried to generate list row from XML , but giving error that 1.5 jar file didnot allow modification :-(</p><p><hr></p><pre><code>    public View getView(int position, View convertView, ViewGroup parent) {            /*                   ViewInflate inflater=context.getViewInflate();            View row=inflater.inflate(R.layout.row, null, null);            */            View row = (View) convertView;            if (row==null) {                LayoutInflater  inflater=context.getLayoutInflater();            //    LayoutInflater inflater = (LayoutInflater)  context.getSystemService(context.LAYOUT_INFLATER_SERVICE);                  row = inflater.inflate(R.layout.row,null);            }            TextView label=(TextView)row.findViewById(R.id.label);            label.setText(items[position]);            TextView description=(TextView)row.findViewById(R.id.description);            description.setText(items[position]);            //    ImageView icon=(ImageView)row.findViewById(R.id.icon);            //    icon.setImageResource(R.drawable.delete);            return(row);        }</code></pre><p><hr></p><p>Plz suggest what is a right way to acconplish this, so app can show desc of item , has filter too. Plz share If you have any shouce code for this</p>","184143","","133802","","2009-12-14 13:55:15","2011-01-25 02:31:42","android Xml-List view with filter","<android>","1","0","4","",""
"1901310","1","1901452","","2009-12-14 14:45:50","-4","894","<p>In my application 4 screens r there.when i switch to from one screen to anther screen 2 or 3 times at that time i want to go to 1st screen but previous screens r coming.how to close previous screen</p>","217065","","18505","","2009-12-14 14:48:33","2009-12-14 15:12:06","How to close previous screen in android?","<android>","1","4","","",""
"1903020","1","1903607","","2009-12-14 19:44:04","4","3906","<p>I want do set size (in px) of dialog based on screen resolution, so I have to set dialog size programatically during runtime.</p><p>Dialog layout is defined in xml with all standard views, so it would be nice to have better way to set dialog size than override-in top view's onMeasure(...).</p><p>(Android 1.5 SDK)</p><p>Thanks</p>","35425","","750613","","2012-07-10 09:43:48","2012-07-10 09:43:48","Android: How to programatically set dialog size?","<android><gui>","1","4","0","",""
"1903590","1","1906034","","2009-12-14 21:21:34","8","10097","<p>Any idea why this doesn't create an activity that looks like a popup instead of an activity that completely fills the screen?</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;     &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:orientation=""vertical""              android:layout_width=""300dip""              android:layout_height=""120dip""               android:layout_marginTop=""100dip""&gt;          &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""			              android:orientation=""vertical""			              android:layout_height=""120dip""                           android:layout_width=""300dip""&gt;	         &lt;TextView android:layout_width=""fill_parent"" 	    	           android:layout_height=""wrap_content"" 	    	           android:text=""@string/hello"" /&gt;          &lt;/RelativeLayout&gt;     &lt;/LinearLayout&gt;</code></pre><p>I assumed that I only needed to set the layout height and layout width to something other than ""fill_parent"", but it still shows up as a black screen that completely fills the screen.</p><p>Ultimately, I simply want to create a popup, but I do not want to use an AlertDialog.  Is this possible?</p>","137825","","","","","2009-12-15 08:48:13","Android - Activity that does not fill the parent screen","<android><gui>","2","0","4","",""
"1903683","1","1909610","","2009-12-14 21:39:17","1","5559","<p>I'm using <code>ExpandableListView</code> in my app and one of the complaints I get from the users isthat when the <code>List</code> item is expanded it's hard to visually distinguish where the childitem ends and next group item begins.</p><p>So I would like to change the background of the child <code>List</code> item to the different shade.</p><p>Brutal attempts that I've made so far were based on directly changing background color and text of the elements inside the child <code>View</code> item but that leads to loss of hovers and highlights. So my question is - what is a good strategy to achieve the above?</p><p>I tried <code>styles</code> and <code>selectors</code> but what really bums me is if I change background for child item then I need to add <code>selectors</code> for all combinations of focus/enabled etc. When all I'm trying to do it to overwrite a single thing. </p><p>Is there a way to inherit parent <code>style</code> and set <code>background</code> only for non-focused, enabled child item with other <code>styles</code> retained? </p>","135946","","427763","","2012-07-27 13:38:02","2014-03-13 12:52:23","Android - ExpandableListView change background for child items","<android><background><customization><expandablelistview>","3","0","","",""
"1905128","1","1907611","","2009-12-15 04:16:00","11","9438","<p>Android framework has variety of icons and images - accessible as R.drawable.* - that can be used by applications for common tasks. Their names give some hint about what they are, but in many cases that's not sufficient. One has to use trial-n-error to find the right icon that fits one's purpose.</p><p>My question: Is there a way where I can preview all these images in one place, so that I can quickly decide which ones to use?</p><p>I have looked inside android source code, but couldn't locate the root of these drawables. </p><p>Let me know if any of you have any tips.Thanks.</p>","174527","","","","","2011-03-10 22:20:48","How to preview R.drawable.* images","<android><icons>","3","1","8","",""
"1905399","1","1905990","","2009-12-15 05:44:40","0","829","<p>I am using listview to display data, inside listview i am using image in every listeitem.</p><p>I am following this tutorial<a href=""http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/List4.html"" rel=""nofollow"">http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/List4.html</a></p><pre><code>new Handler().post(new Runnable(){    			@Override     			public void run() {    				//Need to subclass to use Asynctask    				class DownloadImage extends AsyncTask&lt;Void, Void, Void&gt;{    					@Override    					protected Void doInBackground(Void... params) {    							Drawable dImage = Util.getImageFromURL(imageURL);     								getImageIcon().setImageDrawable(dImage);    						return null;    					}    				}    				new DownloadImage().execute();    			}    		});</code></pre><p>this looks good for lazzy loading image, but there is one problem it won't display any image until user touch screen or try to scroll results or any interaction by the user to handset device keys.</p><p>If i try to scroll results it dispaly all list item images.... what may go wrong ???</p>","216431","","216431","","2009-12-15 05:58:45","2011-04-30 10:48:09","ListItem lazyload AsyncTask image display problem","<android><listitem>","1","0","","",""
"1905452","1","1905481","","2009-12-15 06:04:37","3","6080","<p>So my problem is that I've written a function that takes two Doubles, two Int, and a Calendar object on Android (Java). I believe the class provided to allow it to run in a separate thread, AsyncTask, accepts only one type of Object (but allows multiple) as an argument so I figured I might be able to put it in a List or a LinkedList or something.</p><p>Is there such a type that allows multiple data types like that (<code>Double, Double, Int, Int, Calendar</code>), or would I have to create my own object class?  I'm a novice programmer so less complicated is probably better, but I'm interested in the best solution as well.</p><p>What the function does is take a location (<code>double latitude, double longitude</code>), a couple options as integers, and a Calendar Object. It takes the location, options, and date then returns a Time object of the sunrise (or sunset, depending on the options) for that location. Thanks for the tips, and I understand it would probably be best to create a special object class and just pass that, or override the background thread class, but I'm pretty new to object-oriented programming so the less overhead the better (for now).</p><p>(Update) After a lot of work, it ended up being easier making a data-type class and just using that. The right way turned out to be easier in the end. Who'd a thought.</p>","231850","","750613","","2012-07-10 09:43:23","2012-07-10 09:43:23","Type of List to Store Multipe Data Types","<java><android><list>","3","0","1","",""
"1905496","1","1906142","","2009-12-15 06:15:20","2","2182","<p>I'm trying to create a TabActivity for my android application.  When my layout XML appears as follows with dummy TextView content for my 2 tabs, everything appears fine.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/tabhost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:paddingTop=""3px""&gt;    &lt;LinearLayout    	android:layout_width=""fill_parent""    	android:layout_height=""fill_parent""    	android:orientation=""vertical""&gt;    	&lt;TabWidget    		android:id=""@android:id/tabs""    		android:layout_width=""fill_parent""    		android:layout_height=""wrap_content"" /&gt;    	&lt;FrameLayout    		android:id=""@android:id/tabcontent""    		android:layout_width=""fill_parent""    		android:layout_height=""wrap_content""    		android:padding=""10px""&gt;    		&lt;TextView android:id=""@+id/login_form"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""DUMMY LOGIN FORM"" /&gt;    		&lt;TextView android:id=""@+id/register_form"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""DUMMY REGISTER FORM"" /&gt;    	&lt;/FrameLayout&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>I'd like to replace each TextView with a LinearLayout that contains multiple View elements.  Howevever, if I try to replace the TextView lines with something like the following, then I immediately get a Force Close window.</p><pre><code>&lt;LinearLayout android:id=""@+id/login_form"" android:layout_width=""fill_parent"" layout_height=""fill_parent"" android:orientation=""vertical""&gt;    &lt;TextView android:id=""@+id/username_label"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""@string/username"" /&gt;&lt;/LinearLayout&gt;&lt;LinearLayout android:id=""@+id/register_form"" android:layout_width=""fill_parent"" layout_height=""fill_parent"" android:orientation=""vertical""&gt;    &lt;TextView android:id=""@+id/username_desired_label"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""@string/username_desired"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Why would this cause me to get a Force Close?  Should I be using a different View other than LinearLayout to group my tab contents together?</p><p><strong>Edit:</strong> In case it is relevant to my issue, I am extending the <code>TabActivity</code> class, and my <code>onCreate</code> method looks like the following:</p><pre><code>protected void onCreate(Bundle savedInstanceState) {	// display the login/register view	super.onCreate(savedInstanceState);	setContentView(R.layout.login_register);	// associate the tab content with each tab, and specify the tab headers	setDefaultTab(0);	TabHost tabs = getTabHost();	tabs.addTab(tabs.newTabSpec(""login"").setIndicator(getResources().getText(R.string.login)).setContent(R.id.login_form));	tabs.addTab(tabs.newTabSpec(""register"").setIndicator(getResources().getText(R.string.register)).setContent(R.id.register_form));}</code></pre><p><strong>Edit:</strong> As requested, here's the stack-trace, along with an error message reading only ""Source not found."":</p><blockquote>  <p>Thread [&lt;3> main] (Suspended  (exception RuntimeException))    ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,  Intent) line: 2401    ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord,  Intent) line: 2417    ActivityThread.access$2100(ActivityThread,  ActivityThread$ActivityRecord, Intent)  line: 116    ActivityThread$H.handleMessage(Message)  line: 1794    ActivityThread$H(Handler).dispatchMessage(Message)  line: 99  Looper.loop() line: 123    ActivityThread.main(String[]) line:  4203  Method.invokeNative(Object,  Object[], Class, Class[], Class, int,  boolean) line: not available [native  method]   Method.invoke(Object,  Object...) line: 521    ZygoteInit$MethodAndArgsCaller.run()  line: 791     ZygoteInit.main(String[])  line: 549     NativeStart.main(String[])  line: not available [native method]</p></blockquote>","107277","","107277","","2009-12-15 08:58:26","2009-12-15 09:08:19","Android error with TabActivity / TabWidget","<android><layout><views><tabs>","1","1","1","",""
"1905652","1","","","2009-12-15 07:00:48","0","1410","<p>I was trying to do a memory game on android, but i can't figure out the code that matching 2 button with the same image..</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;import android.widget.Button;import android.widget.TextView;public class Memory extends Activity {TextView tv;int count = 0;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {	super.onCreate(savedInstanceState);	setContentView(R.layout.main);        Button btn1 = (Button) findViewById(R.id.one);	btn1.setBackgroundResource(R.drawable.background);	Button btn2 = (Button) findViewById(R.id.two);	btn2.setBackgroundResource(R.drawable.background);	btn1.setOnTouchListener(btn1OnTouchListener);	btn2.setOnTouchListener(btn2OnTouchListener);String match1 = ""btn1=btn2"";String ans1a = match1.substring(0, match1.indexOf(""=""));String ans1b = match1.substring(match1.indexOf(""="") + 1, match1.length());}OnTouchListener btn1OnTouchListener = new OnTouchListener() {	public boolean onTouch(View v, MotionEvent event) {		if (event.getAction() == MotionEvent.ACTION_DOWN) {			v.setBackgroundResource(R.drawable.puppy2);			if (count &lt; 2)			count = count + 1;	//matching code?		}		else if (event.getAction() == MotionEvent.ACTION_UP) {			while (count==2) {				count = 0;}                         //matching code?		}		return false;	}};OnTouchListener btn2OnTouchListener = new OnTouchListener() {	public boolean onTouch(View v, MotionEvent event) {		if (event.getAction() == MotionEvent.ACTION_DOWN) {			v.setBackgroundResource(R.drawable.puppy8);			if (count &lt; 2)				count = count + 1;		}		else if (event.getAction() == MotionEvent.ACTION_UP) {		}		return false;	}};</code></pre>","231872","","41981","","2009-12-15 16:53:07","2012-07-10 09:42:52","Android memory game","<android>","1","1","","",""
"1905846","1","1907531","","2009-12-15 07:58:08","9","7071","<p>I have a todo list type application that stores all of the note data in a sqlite3 database.  Each activity in the application needs access to the database to edit different parts of the data in real time.</p><p>Currently, I have each activity open its own DBManager object (the helper class I created to manage the database).  This is causing problems though and I would like a slightly more global access solution so I don't have to keep opening/closing/creating a database.</p><p>I'm considering several options, and would like to hear pros and cons of each as well as other suggestions.</p><ol><li><p>Singleton style.  Have a wrapper class that returns a reference to the only database manager so any activity that needs it can use it.</p></li><li><p>Static Manager.  Have the manager class be entirely static members and have it open the database on load.  Easily accessible by anyone that needs it (which is everyone).</p></li><li><p>Merger between 1 and 2. I could make a database manager class that initializes the member singleton instance of the database and all of the data manipulation methods were static.  Then I wouldn't even need a reference to the singleton to access the database.  I like this solution best, please point out downsides.</p></li></ol><p>Suggestions?</p>","131871","","131871","","2009-12-15 20:16:00","2009-12-15 20:16:00","Android: Accessing single database from multiple activities in application?","<java><android><sqlite><singleton><sqlite3>","3","0","1","",""
"1906038","1","1906125","","2009-12-15 08:48:49","1","1810","<p>How to apply background color to listview dynamically in <a href=""http://en.wikipedia.org/wiki/Android%5F%28operating%5Fsystem%29"" rel=""nofollow"">Android</a>?</p>","217065","","63550","","2009-12-15 10:10:46","2009-12-15 10:10:46","How to apply background color to listview dynamically in Android?","<android>","1","0","1","",""
"1906132","1","1906494","","2009-12-15 09:06:53","1","1165","<p>I am using listview to display data, inside listview i am using image in every listeitem.</p><p>following method is called from wrapper class </p><pre><code>public View getView(int position, View convertView,    ViewGroup parent) { // implementation }</code></pre><p>I am following this tutorial<a href=""http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/List4.html"" rel=""nofollow"">http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/List4.html</a></p><pre><code>class DownloadImage extends AsyncTask&lt;Void, Void, Drawable&gt;{        @Override        protected Drawable doInBackground(Void... params) {            return Util.getImageFromURL(imageURL);         }        @Override        protected void onPostExecute( Drawable d ) {            getImageIcon().setImageDrawable(d);        }}new DownloadImage().execute();</code></pre><p>Above code performs lazy image upload for every listItem.</p><p>Problem is after loading first image images are getting overlapped on each other.... any idea why this happening ?</p>","216431","","","","","2009-12-15 10:26:43","Android listvitem AsyncTask images overlapping","<android><listitem>","1","2","1","",""
"1906252","1","","","2009-12-15 09:37:03","0","642","<p>I want to set a specific image when my button is not clickable. This button image is already selected according focused and pressed state thanks to this xml:</p><pre><code>  &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:clickable=""false""    	android:drawable=""@drawable/cmb_bouton_acces_inactive"" /&gt;    &lt;item android:state_focused=""true"" android:state_pressed=""true""    	android:drawable=""@drawable/cmb_bouton_acces_hover"" /&gt;    &lt;item android:state_focused=""false"" android:state_pressed=""true""    	android:drawable=""@drawable/cmb_bouton_acces_hover"" /&gt;    &lt;item android:drawable=""@drawable/cmb_bouton_acces"" /&gt;&lt;/selector&gt;</code></pre><p>But I do not know how to define a new image for the button when it is not clickable.</p><p>Any idea ?</p><p>Regards,Quentin</p>","60292","","","","","2009-12-15 10:50:23","How to set an image for an inactive button","<android>","1","0","","",""
"1906278","1","","","2009-12-15 09:42:18","1","1355","<p>I've an Android application which use a lot of librairies (in jar files). When I compile my application in dex file with the dex.bat tool, it's take a very long time because of the conversion of the jar libraries into dex format. So, my question is : how can I link librairies in dex format to my application instead of linking jar librairies ?</p>","164460","","","","","2012-11-17 21:56:10","android dex library","<android><compilation>","2","0","3","",""
"1906314","1","1932286","","2009-12-15 09:52:31","6","16372","<p>I have an application that targets the 1.5 framework and uses the default light theme. When using a tab widget with this theme, the tab images are barely visible, and the tab captions are quite impossible to discern, except for the currently active tab.</p><p>In the default dark theme these tabs come through quite clearly, but this is not a solution I'd be very happy with. Is there a simple setting I can set, that sets up the tab widget for better visibility in light themes, or would I have to tamper with images and text styles manually?</p>","133802","","","","","2011-05-06 20:43:01","Android TabWidget in Light theme","<android><themes><tabwidget>","4","0","4","",""
"1906375","1","1909910","","2009-12-15 10:06:26","1","1025","<p>I am using listview to display data, inside listview i am using image in every listeitem.</p><p>following method is called from wrapper class</p><pre><code>public View getView(int position, View convertView,    ViewGroup parent) {  /*implementation*/ }</code></pre><p>I am following this tutorial <a href=""http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/List4.html"" rel=""nofollow"">http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/List4.html</a></p><pre><code>class DownloadImage extends AsyncTask&lt;ImageView, Void, Drawable&gt;{        private ImageView iv;        @Override        protected Drawable doInBackground(ImageView... params) {            iv = params[0];            return Util.getImageFromURL(imageURL);         }        @Override        protected void onPostExecute( Drawable d ) {            iv.setImageDrawable(d);        }}new DownloadImage().execute(getImageIcon());</code></pre><p>getImageIcon contains the reference of the inflater layout's imageview.</p><p>Now problem is first when 2nd listeitem image gets loaded it also resplaces the first listeitem image and so on...</p><p>i think it is listitem's referencing issue but above code should work b/c i am passing imageview reference inside. </p>","216431","","","","","2012-08-17 18:00:30","Android listvitem AsyncTask listitem image dereference","<android><listitem>","1","0","","",""
"1906964","1","1909656","","2009-12-15 11:59:37","3","2841","<p>I have an activity handling search (<strong>ACTIVITY_1</strong>), which works perfectly when I use the search (via SEARCH button on the phone) within/from this activity.</p><p>However, when I use search from another activity (<strong>ACTIVITY_2..x</strong>) by implementing <code>onNewIntent</code> and forward the query string to my Search_Activity.class (<strong>ACTIVITY_1</strong>)</p><pre><code>@Overrideprotected void onNewIntent(Intent intent) {    Log.i(TAG, ""onNewIntent()"");    if (Intent.ACTION_SEARCH.equals(intent.getAction())) {    	Log.i(TAG, ""===== Intent: ACTION_SEARCH ====="");    	Intent myIntent = new Intent(getBaseContext(), Search_Activity.class);    	myIntent.setAction(Intent.ACTION_SEARCH);    	myIntent.putExtra(SearchManager.QUERY, intent.getStringExtra(SearchManager.QUERY));    	startActivity(myIntent);    }}</code></pre><p>it always pauses <strong>ACTIVITY_2</strong> first and then goes to onCreate() of <strong>ACTIVITY_2</strong>.</p><ul><li>Why does it recreate my <strong>ACTIVITY_2</strong> when it is already there and doesn't go to onNewIntent directly?</li><li>Is there another way I can forward search queries directly to <strong>ACTIVITY_1</strong>? For example via a setting in the Manifest.xml</li><li>Is it possible to generally forward all search queries automatically to <strong>ACTIVITY_1</strong> without even implementing <code>onNewIntent</code> in all the other activities?</li></ul><p>Currently I have to put an <code>&lt;intent-filter&gt;</code> in every single activity to ""activate"" my custom search there and forward the query then to the activity that handles search via the <code>onNewIntent</code> (as shown above).</p><pre><code>&lt;activity android:name="".Another_Activity""    android:theme=""@style/MyTheme""&gt;    &lt;intent-filter&gt;    	&lt;action android:name=""android.intent.action.SEARCH"" /&gt;    	&lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;/intent-filter&gt;    &lt;meta-data android:name=""android.app.searchable""    	android:resource=""@xml/searchable"" /&gt;&lt;/activity&gt;</code></pre>","184367","","184367","","2009-12-15 12:11:08","2010-03-31 11:51:28","Android: forward search queries to one single activity that handles search","<android><search><activity>","1","0","3","",""
"1908017","1","","","2009-12-15 14:59:53","2","2515","<p>my app have a spinner and also have reset button. how to update the values while clicking on button?</p>","217065","","","","","2012-03-25 10:46:04","how to update the spinner values while clicking on button in android?","<android>","2","2","","",""
"1908050","1","1915821","","2009-12-15 15:03:56","4","8095","<p>I'm looking at developing an app that could benefit from having a image recognition system. I've seen this sort of thing in iPhone and Android apps. Take a picture of a book and the app takes you to Amazon where you can find that book. I'm not looking for general image recognition, but more the ability to pick a single image out of a library of about 10k images.</p><p>Any ideas of what services are available for this sort of thing?</p>","209878","","114066","","2012-01-27 12:24:49","2012-01-27 12:24:49","Image Recognition for Android/iPhone","<android><iphone><objective-c>","2","2","5","",""
"1908094","1","1908126","","2009-12-15 15:10:49","0","1508","<pre><code>int minMagIndex = prefs.getInt(Preferences.PREF_MIN_MAG, 0);if (minMagIndex &lt; 0)minMagIndex = 0;int freqIndex = prefs.getInt(Preferences.PREF_UPDATE_FREQ, 0);if (freqIndex &lt; 0)freqIndex = 0;</code></pre><p>What is the second parameter in prefs.getInt ?</p><p>why is this if condition check done ?</p>","132347","","","","","2009-12-15 15:15:12","second parameter in preferences.getInt in android","<android>","1","0","","",""
"1908532","1","1908641","","2009-12-15 16:12:57","0","750","<p>I get the following error</p><blockquote>  <p>12-15 16:54:37.125: ERROR/MediaPlayer(6032): error (-2147483648, 0)</p></blockquote><p>when trying to execute this code in a service:</p><pre><code>MediaPlayer mp = null;@Overridepublic void onCreate() {	if (mp == null) {		mp = new MediaPlayer();	}}@Overridepublic void onStart(Intent intent, int startId) {	if (!mp.isPlaying()) {		Log.d(DEBUG_TAG, ""Not playing, starting stream..."");		try {			mp.setDataSource(getString(R.string.address_p3));			mp.prepare(); 		} catch (IOException e) {}		mp.start();	} else { 		Log.d(DEBUG_TAG, ""Playing, pausing stream..."");		try { mp.pause(); } 		catch (Exception e) {} 	}}</code></pre><p>When the service is first called and no MediaPlayer-object exists, the stream is started correctly. But when the onStart()-method is called again (with the player streaming) I get the above error code. I can't find any information about this error code, so I turn to you for help. Replacing mp.pause() with mp.stop() makes it work. Could it be that the stream does not support pausing? It's an online radio stream (RTSP) in the SDP format.</p><p>Thanks,</p><p>Linus</p>","91098","","13295","","2009-12-15 20:47:08","2009-12-15 20:47:08","Unknown error on pause()","<java><android><media-player><rtsp>","1","2","","",""
"1909812","1","1910032","","2009-12-15 19:33:35","2","2263","<p>I need to be able to handle/catch Intents while my Activity is closed.  So I am looking at either a Service or a BroadcastReceiver.  </p><p>Is it possible to ""receive"" intents to a service itself?  I tried to search, but could not find anything helpful.</p><p>With a BroadcastReceiver, I am not exactly sure how that works outside of an Activity.  Does it depend on the Activity being open/running?  Can it run by itself?  Let's say that my Activity is killed by Android(or a task killer app), does the BroadcastReceiver still receive intents and process them?</p><p>I have used a BroadcastReceiver as a widget, but I do not want to use a widget this time.</p><p>My goal is to have the user open the Activity to set some options.  From there, they would be able to close the Activity, but I would still be able to process Intents that were sent out by the system.</p><p>I am still fairly new to Android development, so I could be so far away from where I need to be.</p><p>Am I going about it wrong?</p>","137825","","137825","","2009-12-15 20:52:44","2009-12-15 20:52:44","How to use Intents from a Service or Broadcast Receiver?","<android>","1","0","1","",""
"1910074","1","","","2009-12-15 20:12:49","1","365","<p>In my application, I have created a ContentProvider. Is there a way for me to instantiate this ContentProvider when my apk is started?RIght now, the ContentProvider only instantiates when someone does a query.</p><p>Thank you.</p>","125440","","","","","2009-12-15 22:02:20","How to instantiate my Content Provider upfront","<android>","1","0","1","",""
"1910339","1","1910599","","2009-12-15 20:53:15","1","2946","<p>So now I have my BroastcastReceiver declared in the manifest file...</p><pre><code>   &lt;receiver android:name="".MyReceiver""&gt;    &lt;intent-filter&gt;    	&lt;action android:name=""android.intent.action.CALL_BUTTON"" /&gt;    &lt;/intent-filter&gt;   &lt;/receiver&gt;</code></pre><p>I want to catch the intent when the Call button is pressed.</p><p>Here is my code...</p><pre><code> public class MyReceiver extends BroadcastReceiver {     @Override     public void onReceive(Context context, Intent intent) {	     Toast.makeText(context, ""intent received"", Toast.LENGTH_LONG);	     if(intent.getAction().equals(""android.intent.action.CALL_BUTTON"")) {		     Toast.makeText(context, ""call button pressed"", Toast.LENGTH_LONG);	     }     } }</code></pre><p>However, I don't see the toast when I hit the call button.  Did I miss something?</p><p>This is a continuation using an answer from this question...</p><p><a href=""http://stackoverflow.com/questions/1909812/how-to-use-intents-from-a-service-or-broadcast-receiver"">http://stackoverflow.com/questions/1909812/how-to-use-intents-from-a-service-or-broadcast-receiver</a></p>","137825","","137825","","2009-12-15 21:01:22","2009-12-15 21:40:26","BroadcastReceiver not receiving intent","<android><android-intent><broadcastreceiver>","2","0","","",""
"1910601","1","","","2009-12-15 21:40:36","11","12988","<p>In my app I try to capture a fling event on a view (a ScrollView to be exact, but tried with LinearLayout as well). By setting breakpoints I can see the that the MotionEvents happen correctly up to the point where the onFling() should fire. The event flow is as follows:</p><ol><li>The view's onTouchEvent</li><li>The OnGestureListener's onDown</li><li>The OnGestureListener's onShowPress</li><li>The OnGestureListener's onLongPress</li></ol><p>I'm at a loss on how to go on trying to debug something like that and Google search does not turn up much. Any pointers ?</p><p>I also attach the relevant view that should handle the gestures:</p><pre><code>import android.content.Context;import android.content.Intent;import android.view.GestureDetector;import android.view.MotionEvent;import android.widget.ScrollView;public class GestureScrollView extends ScrollView {    private static int MAJOR_MOVE = 60;    private GestureDetector gd;    public GestureScrollView(final Context context) {    	super(context);    	gd = new GestureDetector(context,    			new GestureDetector.OnGestureListener() {    				@Override    				public boolean onSingleTapUp(MotionEvent e) {    					// TODO Auto-generated method stub    					return false;    				}    				@Override    				public void onShowPress(MotionEvent e) {    					// TODO Auto-generated method stub    				}    				@Override    				public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,    						float distanceY) {    					// TODO Auto-generated method stub    					return false;    				}    				@Override    				public void onLongPress(MotionEvent e) {    					// TODO Auto-generated method stub    				}    				@Override    				public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,    						float velocityY) {    					int dx = (int) (e2.getX() - e1.getX());    					if (Math.abs(dx) &gt; MAJOR_MOVE    							&amp;&amp; Math.abs(velocityX) &gt; Math.abs(velocityY)) {    						if (velocityX &lt; 0) {    							Intent intent = new Intent(context, Main.class);    							context.startActivity(intent);    						}    					}    					return false;    				}    				@Override    				public boolean onDown(MotionEvent e) {    					// TODO Auto-generated method stub    					return false;    				}    			});    }    @Override    public boolean onTouchEvent(MotionEvent event) {    	return gd.onTouchEvent(event);    }}</code></pre>","56663","","","","","2009-12-16 14:25:09","Android: detecting fling gestures","<android><gesture>","1","0","2","",""
"1910608","1","","","2009-12-15 21:41:29","79","86549","<p>We are trying to use the native camera app to let the user take a new picture. It works just fine if we leave out the <code>EXTRA_OUTPUT extra</code> and returns the small Bitmap image. However, if we <code>putExtra(EXTRA_OUTPUT,...)</code> on the intent before starting it, everything works until you try to hit the ""Ok"" button in the camera app. The ""Ok"" button just does nothing. The camera app stays open and nothing locks up. We can cancel out of it, but the file never gets written. What exactly do we have to do to get <code>ACTION_IMAGE_CAPTURE</code> to write the picture taken to a file?</p><p>Edit: This is done via the <code>MediaStore.ACTION_IMAGE_CAPTURE</code> intent, just to be clear</p>","232468","","55093","","2011-11-03 10:14:16","2013-06-12 02:24:05","Android ACTION_IMAGE_CAPTURE Intent","<android><camera><return-value><android-intent>","10","0","97","",""
"1910668","1","","","2009-12-15 21:53:23","0","2038","<p>Im using ksoap2 to call web .net services. The call works just fine except when I pass paramaters. The passed paramaters are always recieved as null values by the web service. I dont know what the problem is, I hope someone can help.Thanks,</p>","227945","","","","","2010-09-22 16:16:19","Passing parameters from android to .net web service","<.net><android><web-services><ksoap2>","1","4","1","",""
"1910895","1","","","2009-12-15 22:30:40","1","982","<p>I have an NoContentViewActivity which has no Content View (i.e. I did not call setContentView() in the onCreate of my Activity).My question is how can I keep the content view of the launching activity on the screen? Right now, I am getting a blank screen whenever I launch NoContentViewActivity? I want the content view of the launching activity (the activity which start the NoContentViewActivity) to show on the screen.</p><p>Thank you for any help.</p>","128983","","","","","2013-02-05 14:06:24","How can I keep current screen (contentView) when l Iaunch a new Activity","<android>","3","0","1","",""
"1912093","1","1912124","","2009-12-16 03:33:12","6","4879","<p>Quick questions here:What are the necessary tools/APIs to post something from Android to Facebook?I looked at this URL<a href=""http://wiki.developers.facebook.com/index.php/User%3AAndroid"" rel=""nofollow"">http://wiki.developers.facebook.com/index.php/User%3AAndroid</a></p><p>and it mentioned a few suggestions.Have anyone tried fbrocket?What is Facebook Connect anyway?</p><p>Thanks!</p><p>Nicholas</p>","226582","","","","","2011-08-09 21:07:56","How to post something to Facebook from Android?","<android><facebook>","2","0","","",""
"1912215","1","1913425","","2009-12-16 04:09:24","2","516","<p>Does Android keep the connection between the server/socket when it moves from EDGE to WIFI and vice versa?</p>","117691","","","","","2011-11-29 22:34:20","Android Connection Presistence","<android>","2","0","1","",""
"1912478","1","1914600","","2009-12-16 05:20:45","1","1202","<p>I want to display search result on the screen, i have implemented in such a way that.</p><p>From the search form user fill the 'search field' and 'search location' i set values into bean and that bean is static so that i can access it from every where.</p><p>Then i start search result screen intent using </p><pre><code>Intent mainIntent = new Intent(SearchVenueResults.this, SearchResults.class);startActivity(mainIntent);</code></pre><p>on the 'SearchResults' activity 'oncreate' method i load data on the behalf of static bean which values filled from search form and then display data.</p><pre><code>@Override    public void onCreate(Bundle savedInstanceState) {    	loadDataAndSetupUI();    	super.onCreate(savedInstanceState);    }</code></pre><p>My question is is it the correct approach to use it or in Android there is another preferable approach ?</p><p>any quick idea or quick code is appreciated.</p>","216431","","","","","2009-12-16 13:15:16","Android display search results approach","<android><load><results>","1","0","","",""
"1912725","1","","","2009-12-16 06:31:43","15","18117","<p>So I'm working out my first multi-threaded application using Android with the AsyncTask class. I'm trying to use it to fire off a Geocoder in a second thread, then update the UI with onPostExecute, but I keep running into an issue with the proper Context.</p><p>I kind of hobbled my way through using Contexts on the main thread, but I'm not exactly sure what the Context is or how to use it on background threads, and I haven't found any good examples on it. Any help? Here is an excerpt of what I'm trying to do:</p><pre><code>public class GeoCode extends AsyncTask&lt;GeoThread, Void, GeoThread&gt; {  @Override  protected GeoThread doInBackground(GeoThread... i) {    List&lt;Address&gt; addresses = null;    Geocoder geoCode = null;     geoCode = new Geocoder(null); //Expects at minimum Geocoder(Context context);    addresses = geoCode.getFromLocation(GoldenHour.lat, GoldenHour.lng, 1);  }}</code></pre><p>It keeps failing at the sixth line there, because of the improper Context.</p>","231850","","267542","","2010-03-04 17:37:22","2012-06-12 12:00:53","AsyncTask and Contexts","<java><android><android-asynctask><android-context>","4","0","5","",""
"1912898","1","","","2009-12-16 07:16:56","10","7026","<p>I have a database containing a userId and a note. The user doesn't know if there already is a note in the DB so they write one and click the 'Submit' button. I want to insert this note if there is no note for the userId or update that userId's already existing note:</p><pre><code>notesDb.open();boolean updateResult = notesDb.updateMessage(        userId,        details_notes_input.getText().toString());if(updateResult == true) {    Log.d(""databaseTester"", ""Updated entry into table"");} else {    Log.d(""databaseTester"", ""FAILED to update entry into table"");    long insertResult = notesDb.insertMessage(            userId,            details_notes_input.getText().toString());    if(insertResult == -1){        Log.d(""databaseTester"", ""Failed to insert entry into table"");    } else {        Log.d(""databaseTester"", ""Inserted entry into table"");    }   }notesDb.close();</code></pre><p>So, I'm pretty much attempting to 'update' an entry and if I fail then I attempt to 'insert' it. I don't know SQL very well, but I would think there would be a better way. Thanks.</p>","222361","","515205","","2013-04-30 17:15:42","2013-07-04 20:16:49","Android:Is there a better way to insert and/or update a database entry?","<database><android><insert>","3","0","3","",""
"1912947","1","1912976","","2009-12-16 07:29:20","23","12197","<p>I am using following code to start activity when user pressing search button on the handset</p><pre><code>@Overridepublic boolean onKeyUp(int keyCode, KeyEvent event) {    if(keyCode == KeyEvent.KEYCODE_SEARCH){        Util.startActivity(ReviewsDetail.this, KeywordSearch.class);        return false;    }else{        return super.onKeyUp(keyCode, event);     }}</code></pre><p>But here are few issues with it please look at the following image.</p><p>When press search button it first show google search box at the top of activity then start activity which i want to start</p><p><img src=""http://i.imgur.com/QuhTf.jpg"" alt=""alt text""></p><p>When click on the back button displays empty actiivty<img src=""http://i.imgur.com/zvCwc.jpg"" alt=""alt text""></p>","216431","","133802","","2012-12-22 17:58:07","2013-01-30 19:13:51","android start user defined activity on search button pressed @ handset","<android><search><button>","2","1","4","",""
"1912948","1","1912966","","2009-12-16 07:30:08","1","3544","<p>In android, I create my menu item like this?</p><pre><code>public boolean onCreateOptionsMenu(Menu menu) {        menu.add(0, 0, 0, ""Menu1"");        menu.add(0, 1, 0, ""Menu2"");        return true;}</code></pre><p>How can I set all the menu item disabled programmically (in another part of the code in my activity, not in onCreateOptionsMenu() method itself)? </p><p>Thank you.</p>","128983","","","","","2013-03-01 11:46:09","How can I programmically disable all menu item in my activity","<android>","3","0","1","",""
"1913086","1","1913964","","2009-12-16 08:10:45","2","895","<p>Does anyone have a recommendation on how to visually show progress of uploading a large file to a web server? My app needs to upload one photo at a time, as directed by the user. Images are about 200kb.</p><p>I don't want to put up a progress dialog and block the user from further interaction while the upload is in progress. Looks like I can:</p><ol><li>Have a service upload the photo, and post status updates to the notification bar.</li><li>Upload through service (or bg thread), but post status updates to some in-app notification indicator.</li></ol><p>I'm wondering if #1 is more standard, I like the idea of putting off updates to the notifcation bar so it's separated from my main app. I don't really want to build some global upload widget that has to be displayed on each activity my user navigates to.</p><p>Thanks</p>","137193","","","","","2009-12-16 11:09:11","Suggestions - showing file upload progress to user?","<android>","1","0","0","",""
"1913493","1","1914214","","2009-12-16 09:42:08","1","455","<p>how to store previous activity value in android</p>","217065","","","","","2009-12-16 18:30:31","how to store previous activity value in android?","<android>","2","1","","",""
"1914456","1","","","2009-12-16 12:45:46","6","15836","<p>Does anyone know how to programmatically send a MMS via the Android SDK? Any version of the SDK will do, just need to know where to get started.  I know how to send / receive SMS, I now need to add a picture to the message before sending. </p>","160231","","","","","2013-03-08 09:33:41","Android SDK MMS","<android><mms>","4","2","9","",""
"1914477","1","","","2009-12-16 12:49:33","102","31540","<p>i used two listviews like this if my problem is one back line is coming inbetween two listviews.But i dont want that that balck line in betweem  them.</p>","217065","","","","","2013-12-30 12:31:15","how to remove line inbetween two listviews in android?","<android>","5","2","22","",""
"1916053","1","1917775","","2009-12-16 16:56:13","5","7082","<p>I would like to know about Android application signing. </p><p>IFAIK, blackberry and iphone application must be signed to work on the real device. For the Android, does application need to sign ?</p><p>If so, how to sign the application ?</p><p>Please advice. guys.</p><p>Thanks in advance.</p>","227889","","1371853","","2013-11-21 12:47:11","2013-11-21 12:47:11","Android Application APK signing?","<android>","2","0","2","",""
"1916253","1","1916653","","2009-12-16 17:28:10","31","43598","<p>I'm trying to write a simple media player that plays streaming audio using RTSP. I have a GUI-activity and a service that performs the playback. My question is how to best communicate between the activity and the service (e.g. updating the gui based on the player state).</p><p>I know that I can bind the service to the activity using onBind(), but if I understand correctly this will stop the service if the activity is killed. I want to continue the playback even if the user exits the activity. Is there any standard or preferred way of dealing with this problem?</p>","91098","","552792","","2011-06-16 23:03:19","2012-12-31 05:32:08","Bind service to activity in Android","<android><service>","4","0","22","",""
"1916568","1","1916986","","2009-12-16 18:12:28","4","14749","<p>I have a problem related to the Location API.</p><p>I tried the following code:</p><pre><code>LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);Location loc = getLastKnownLocation(LocationManager.GPS_PROVIDER);</code></pre><p><code>loc</code> is always <code>null</code>, when <code>getLastKnownLocation()</code> is called.</p><p>What is wrong?</p>","227889","","63550","","2012-10-11 21:57:31","2014-02-20 21:12:29","Getting null from 'getLastKnownLocation' on SDK","<android>","6","0","3","",""
"1916660","1","3551095","","2009-12-16 18:28:04","14","4585","<p><strong>Issue:-</strong></p><ol><li>I am developing a application whichneeds a new acceleration datum every 5millisecond.</li></ol><p><strong>My Approach:-</strong></p><ol><li>I have created a remote servicewhich only reads the accelerationdata from SensorManager.</li><li>I had also set the read rate to""DELAY FASTEST"" while initialize theSensorManager.</li><li>Then i use IPC to communicate too mymain application to get thesereading.</li></ol><p><strong>Problem:-</strong></p><ol><li>If i put a log insideonSensorChange() event i receive anew sensor data every 20 ms time. But i need data every 5 ms.</li></ol><p><strong>Question ?</strong></p><ol><li><p>Is there any better method to readthe senor data faster.</p></li><li><p>Is there any way i can poll thesenor data rather that waiting forthe event handler to trigger theevent?</p></li></ol><p>Please help me to find a better solution to read the data in 5 ms time or poll the acceleration data.</p>","233192","","71394","","2010-11-04 10:29:57","2012-01-25 10:53:12","Need to read android sensors really fast","<android>","4","4","3","",""
"1916665","1","1917134","","2009-12-16 18:28:56","2","1644","<p>Greetings, </p><p>I have the following layout in Android. I'm trying to make it so the seekbar is displayed ontop of the image (I have some code that makes it visible and invisible(Or rather GONE). </p><p>I was wondering if anyone could tell me how to position it so that the seekbar goes over the imageview, therefore allowing the imageview to take up the entire screen. </p><p>Thanks</p><pre><code>&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;.imageOverlay android:id=""@+id/surface""android:layout_width=""wrap_content"" android:layout_height=""wrap_content""android:layout_gravity=""center"" /&gt;&lt;RelativeLayout android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;SeekBar android:id=""@+id/seekbar"" android:layout_width=""100px"" android:layout_height=""wrap_content"" android:layout_gravity=""center_horizontal"" android:max=""255""/&gt;&lt;ImageView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/surfaceimage"" android:scaleType=""fitXY""  /&gt;</code></pre><p></p>","84278","","","","","2009-12-16 19:39:50","Place SeekBar over Imageview in Android?","<android>","1","2","2","",""
"1916930","1","2249994","","2009-12-16 19:10:30","1","1847","<p>I have a project in Android and I want to add MapView to it.I did the following:</p><ol><li>Downloaded the Google APIs revision 3.</li><li>Added the maps.jar library to my project</li><li>Added the MapView to an activity</li><li>Created new Virtual Device with target the Google APIs (not the normal target Android 1.5)</li><li>Started the project</li></ol><p>When I try to reach the activity with the map view, I get</p><blockquote>  <p>....................</p>    <p>12-16 20:57:44.620:  ERROR/AndroidRuntime(792): Caused by:  java.lang.IllegalAccessError:  cross-loader access from pre-verified  class </p>    <p>12-16 20:57:44.620:  ERROR/AndroidRuntime(792):     at  dalvik.system.DexFile.defineClass(Native  Method) </p>    <p>12-16 20:57:44.620:  ERROR/AndroidRuntime(792):     at  dalvik.system.DexFile.loadClass(DexFile.java:193)</p>    <p>............</p></blockquote><p>What am I doing wrong?</p>","232798","","","","","2011-09-20 19:47:58","When adding MapView to Android application, get cross-loader exception","<android><google-maps>","3","0","1","",""
"1917773","1","1917861","","2009-12-16 21:11:48","29","56584","<p>Is there a working example out there that demonstrates how to append additional rows in ListView dynamically?For example:</p><ol><li>you are pulling RSS feeds fromdifferent domains</li><li>you then display the first 10 itemsin the ListView (while you haveother threads running in thebackground continue pulling feeds)</li><li>you scroll and reach the bottom ofthe List and click at a button toview more items</li><li>the ListView will then get appendedwith additional 10 items, whichmakes 20 items now in total.</li></ol><p>Any advice how to accomplish this?</p><p>Nicholas</p>","226582","","","","","2012-05-21 09:35:48","Dynamic ListView in Android app","<java><android><listview><dynamic>","1","0","36","",""
"1918089","1","","","2009-12-16 21:59:28","0","1620","<p>This time my question is rather short: Is it possible to add to the Softkeyboard an OnTouchListener? Like u can do it for an ordinary EditText field. Or is there any other way to implement an OnTouchListener above the Softkeyboard?</p><p>Thanks in advanceRipei</p>","209902","","","","","2011-06-16 19:45:12","Android Softkeyboard OnTouchListener","<android><keyboard><touch><listener>","1","2","","",""
"1918468","1","1918655","","2009-12-16 23:08:20","8","18726","<p>I have a custom spinner dropdown xml file in /res/layout/:</p><pre><code>spinner_view_dropdown.xml:&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/spinner_item_dropdown""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""@android:color/transparent""style=""@style/spinner_item_dropdown"" /&gt;</code></pre><p>I'm setting the spinner dropdown via java:</p><pre><code>// ""Spinner"", aka breadcrumbs	Spinner spin = (Spinner) findViewById(R.id.breadcrumb_dropdown);	ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.breadcrumb, R.layout.spinner_view);	adapter.setDropDownViewResource(R.layout.spinner_view_dropdown);	spin.setAdapter(adapter);	// /""Spinner""</code></pre><p>Unfortunately, a white background still exists on the spinner popup regardless if I set the background to transparent.</p><p>How do I fix this?</p>","204499","","204499","","2009-12-16 23:17:36","2012-05-28 16:30:19","Android Spinner - How to make dropdown view transparent?","<java><android><android-widget><spinner>","6","1","3","",""
"1919169","1","1919465","","2009-12-17 02:45:32","8","29744","<p>I'm stuck on a simple problem which is driving me nuts. Basically I have 2 ImageViews, I'm trying to have the first show for a second, then fade out to show the second. I've been looking into using ViewFlipper, example code below, but the animation is non-existent.  </p><pre><code>ViewFlipper mFlipper = new ViewFlipper(this);ImageView i = new ImageView(this);i.setBackgroundDrawable(getResources().getDrawable(R.drawable.c1));ImageView i2 = new ImageView(this);i2.setBackgroundDrawable(getResources().getDrawable(R.drawable.c2));mFlipper.setInAnimation(AnimationUtils.loadAnimation(this,        R.anim.fade));mFlipper.setOutAnimation(AnimationUtils.loadAnimation(this,        R.anim.fade));mFlipper.addView(i);mFlipper.addView(i2);mFlipper.startFlipping();setContentView(mFlipper);</code></pre><p>I'm not sure if I'm even on the right track using a viewFlipper so any help would be greatly appreciated!</p><p>Cheers</p>","173892","","2218452","","2013-05-30 08:46:02","2013-05-30 08:46:02","Android ViewFlipper Animation","<android>","2","0","1","",""
"1919340","1","1965855","","2009-12-17 03:50:28","39","102332","<p>The short version of my issue at hand, </p><ul><li>Windows 7 Professional x64</li><li>Java JDK 1.6.0_17 x64</li><li>Eclipse Galileo w\ADT Plugin installed</li><li>Android SDKtools r04</li></ul><p>Since the Android SDK download now only includes the tools, you have to run the included SDK Manager application (SDK Setup) through which you can download the platforms, additional tools, docs,etc.</p><p>Under my current configuration SDK Setup bombs on launch, so, I can't do anything since I do not have a single platform to start writing against...I've read a few places that the fix is ""just install the 32 bit JDK and all will be well"" that seems surprising and disappointing option for a work around(downloading it now to try).</p><p>My question is this, anyone else run into this same issue and how did you get past it? Is there a place I can ""download by hand"" the components I need that I missed on the <a href=""http://developer.android.com/sdk/index.html"">Android SDK site</a>? </p><p>Odds are pretty good that the 32 bit ""fix"" will work, but that seems wrong that I'll have to install a secondary version of the same SDK/JRE just to run this tool and to download the actual Android SDK components</p><p>Thanks!</p><p><strong>UPDATE:</strong> Well, the work around that requires you to also install 32 bit java and referencing that as your JAVA_HOME worked, either by calling the SDK setup manually or through eclipse. I'm not particularly happy with that, so I'll leave this one open for the time being in case there are other ways to get this done that people may know about.</p><p><strong>UPDATE 2:</strong> Not directly related since it is Linux centric, but there are <a href=""http://developer.android.com/sdk/installing.html#troublehooting"">troubleshooting steps if trying to run the SDK/Eclipse under Linux 64bit</a> where they reference the need to be able to run 32 bit, but nothing similar under windows x64</p><p><strong>FINAL UPDATE (?)</strong> Taking the info Seth's answer gave me, and running the bat manually(once I knew what file SDK Setup was running) the answer for me was simply adding ANDROID_SWT path variable that pointed to a valid location with the x86_64 swt.jar....the android sdk directory had one, seemingly in the right place, but it couldn't find it until I added that to my path.</p><p>Thanks All!</p>","17651","","17651","","2009-12-28 05:25:23","2013-09-02 17:36:23","Android SDK Setup under Windows 7 Pro 64 bit","<android><eclipse>","15","5","18","",""
"1919679","1","1920115","","2009-12-17 05:37:37","0","606","<p>I am using complex list item as following to lazy upload image i am loading every list item's image in separate asyntask so that it won't hang the application while loading image.</p><p>problem comes when i scroll down the list new lisitems image had replace image effect when i drill down i found that</p><p>for example if by default 5 listitems fit onto the screen when i scroll down next displayed listem is actually the recycle of the previous listitem which was displaying thats why also containing the image of the previous listitem untill new image loaded, after new image loaded from web image get replaced and user found replace image effect when doing scroll up or scroll down every time images are getting replaced due to recycling...</p><p>Is there a way i can ask android to do not recycle the listitem when i scroll down or up so that it will not have replace image effect.</p><p>any good suggestion is appriciated</p><p><img src=""http://www.freeimagehosting.net/uploads/8237cbd584.jpg"" alt=""alt text""></p>","216431","","","","","2009-12-17 07:53:40","android listiem recycle while scroll up or down","<android><listitem>","1","1","","",""
"1919742","1","1919779","","2009-12-17 05:56:35","22","20290","<p>When user click at the <code>EditView</code> android opens the keyboard so that user can write in the <code>EditView</code>.</p><p>The problem is when the user is done with writing, there is no way to hide the keyboard and the user has to press the back button to hide the keyboard.</p><p>Is there a way to display the done button over the keyboard when user is done with writing text done button will hide the keyboard.<img src=""http://www.freeimagehosting.net/uploads/b346687619.jpg"" alt=""alt text""></p>","216431","","592025","","2011-11-30 07:17:01","2014-03-27 21:39:24","Android editview done button","<android><keyboard>","6","1","5","",""
"1920275","1","1920358","","2009-12-17 08:41:41","2","3027","<p>I am trying to use a managed dialog. I noticed that after the first time I display it, subsequent creations don't actually make a new instance of the dialog, they just seem to reuse the first one.</p><p>If I want to stop that, and get a brand new instance on every call, is this the right way to do it?:</p><pre><code>@Overrideprotected Dialog onCreateDialog(int id) {    switch (id) {        case MY_DIALOG_ID:            MyDlg dlg = new MyDlg(this);            dlg.setOnDismissListener(new OnDismissListener() {                public void onDismiss(DialogInterface dialog) {                    removeDialog(MY_DIALOG_ID);                }            });            return dlg;    }    return null;}</code></pre><p>so I guess the removeDialog() call does the trick, but my onDismiss() handler should be called in every instance of the dialog being killed, right (like Dialog.cancel(), Dialog.dismiss(), hitting the back key)?</p><p>Thanks</p>","137193","","","","","2009-12-17 09:00:06","Right way to dismiss a Dialog","<android>","1","0","1","",""
"1920324","1","1920458","","2009-12-17 08:52:17","0","1406","<p>I am trying to create a list of strings from my arrays.xml file, as found in the android docs too. This is what they use:</p><pre><code>ArrayAdapter adapter = ArrayAdapter.createFromResource(context, R.array.colors, android.R.layout.simple_spinner_item);</code></pre><p>eclipse is warning that the ArrayAdapter instance is a raw type. Should it really be:</p><pre><code>ArrayAdapter&lt;CharSequence&gt; adapter = ...;</code></pre><p>?</p><p>Thanks</p>","137193","","","","","2009-12-17 09:39:59","ArrayAdapter type cast from android docs example","<android>","1","0","","",""
"1920327","1","5942750","","2009-12-17 08:53:13","1","1185","<p>I'm stuck on a simple problem which is driving me nuts.   In the standard Android MapView  overlay images have a shadow drawn for them automatically when you call the drawAt method. I want to recreate the same shadow effect, but I'm not sure how to make the shadow version of the image (which is drawn separately from the main image) align properly with the main image.  </p><pre><code>private static class SampleView extends View {    private Drawable mDrawable;    private int mMarkerXOffset;    private int mMarkerYOffset;    public SampleView(Context context) {        super(context);        mDrawable = context.getResources().getDrawable(R.drawable.icon);         mDrawable.setBounds(0, 0, mDrawable.getIntrinsicWidth(), mDrawable.getIntrinsicHeight());         mMarkerXOffset = (mDrawable.getIntrinsicWidth() / 2);        mMarkerYOffset = mDrawable.getIntrinsicHeight();    }    private void DrawNormalImg(Canvas canvas, int nX, int nY)  {           canvas.save(Canvas.MATRIX_SAVE_FLAG);           canvas.translate(nX, nY);           mDrawable.draw(canvas);           canvas.restore();       }       private void DrawShadowImg(Canvas canvas, int nX, int nY)  {         canvas.save(Canvas.MATRIX_SAVE_FLAG);        mDrawable.setColorFilter(0x7f000000, PorterDuff.Mode.SRC_IN);           canvas.translate(nX,nY);           canvas.skew(-0.9F, 0.0F);           canvas.scale(1.0F, 0.5F);           mDrawable.draw(canvas);           mDrawable.clearColorFilter();           canvas.restore();       }      @Override protected void onDraw(Canvas canvas) {        int nX = 100;           int nY = 50;           canvas.drawColor(Color.WHITE);        DrawShadowImg(canvas, nX, nY);           DrawNormalImg(canvas, nX, nY);    }</code></pre>","233618","","287185","","2011-05-09 22:30:27","2011-05-09 22:30:27","How can I draw a 'shadow' version of an image?","<android><shadow><translate>","1","2","1","",""
"1921514","1","1921759","","2009-12-17 12:42:03","78","191014","<p>I developed one small application to display some text at defined intervals in the android emulator screen.I am using Handler class, small snippet from my code</p><pre><code>handler=new Handler();Runnable r=new Runnable(){    public void run()     {        tv.append(""Hello World"");   			    }};handler.postDelayed(r, 1000);</code></pre><p>When i run this appication the text is displayed only one time.Please any one knows how to run a thread using Handler help me.</p>","131062","","1341526","","2013-05-03 12:05:03","2013-10-21 06:37:14","How to run a Runnable thread in Android?","<android><multithreading>","5","0","36","",""
"1922224","1","1922281","","2009-12-17 14:43:02","2","3986","<p>I'm coming from <code>.NET</code> world, and unfortunately looking Java source with <code>.NET</code>'s eyes.</p><p>Following code is from Android Apps (though not Android specific at all):</p><pre><code>    private class Worker implements Runnable {        private final Object mLock = new Object();        private Looper mLooper;        Worker(String name) {            Thread t = new Thread(null, this, name);            t.start();            synchronized (mLock) {                while (mLooper == null) {                    try {                        mLock.wait();                    } catch (InterruptedException ex) {                    }                }            }        }        public Looper getLooper() {            return mLooper;        }        public void run() {            synchronized (mLock) {                Looper.prepare();                mLooper = Looper.myLooper();                mLock.notifyAll();            }            Looper.loop();        }        public void quit() {            mLooper.quit();        }    }</code></pre><p>I'm not precisely clear with how <code>synchronized</code> works.First I thought that synchronized is locking mLock object, but then if after <code>t.start()</code> constructor thread enters sync block first, it would block it at <code>mLock.wait()</code>, and implicitly block thread ""t"" by blocking it from entering synchronized block. </p><p>This is obviously wrong, because my phone rings as supposed :)</p><p>Next thought is that synchronize synchronizes ""code block"" (in which case, there two synchronized block are independent => threads can enter two different sync block at same time without restriction), and that fitted perfectly...</p><p>... until my colleague told me that <code>mLock.wait()</code> releases lock on mLock and enables other thread to enter critical section on mLock in same time.</p><p>I'm not sure if I was clear enough, so will gladly answer any further questions on this.</p>","35425","","368379","","2014-02-24 18:08:38","2014-02-24 18:08:38","Java sync games: synchronized && wait && notify","<java><android><multithreading><synchronization>","4","2","","",""
"1922292","1","","","2009-12-17 14:58:08","1","1220","<p>I've altered the contact app so that in Dialer the soft keypad always stays and it hides when other tab activity resumes, We've given different look for the contacts app, but when using the same, a crash occurs when we rapidly change from dialer to call log. And the App crashes without the standard crash dialog.</p><p>I have copied the log and the error seems to be happening in a deeper section..</p><pre><code> 01-01 06:25:37.401: DEBUG/(1350): The Saved Contact is checked here 01-01 06:25:37.464: DEBUG/(1350): The Saved Contact is checked here 01-01 06:25:37.472: DEBUG/(1350): The Saved Contact is checked here 01-01 06:25:39.081: DEBUG/(1350): The INPUT TYPE OF MDIGITS onPause 1 01-01 06:25:39.097: WARN/InputManagerService(1082): Ignoring hideInputMethod of token: null 01-01 06:25:39.222: DEBUG/dalvikvm(1404): GC freed 70 objects / 5424 bytes in 143ms 01-01 06:25:39.573: DEBUG/dalvikvm(1350): GC freed 41355 objects / 1657488 bytes in 214ms 01-01 06:25:39.589: DEBUG/(1350): The Saved Contact is checked here 01-01 06:25:39.589: INFO/dalvikvm(1350): Uncaught exception thrown by finalizer (will be discarded): 01-01 06:25:39.589: INFO/dalvikvm(1350): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@45c8b2b0 on calls that has not been deactivated or closed 01-01 06:25:39.589: INFO/dalvikvm(1350):     at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596) 01-01 06:25:39.589: INFO/dalvikvm(1350):     at dalvik.system.NativeStart.run(Native Method) 01-01 06:25:39.620: WARN/IInputConnectionWrapper(1350): finishComposingText on inactive InputConnection 01-01 06:25:39.698: INFO/DEBUG(1008): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 01-01 06:25:39.698: INFO/DEBUG(1008): Build fingerprint: 'zoom/ldp1/ldp1/ldp1:Donut/Donut/eng.vishal.20091203.130315:eng/test-keys' 01-01 06:25:39.698: INFO/DEBUG(1008): pid: 1350, tid: 1355  &gt;&gt;&gt; android.process.acore &lt;&lt;&lt; 01-01 06:25:39.698: INFO/DEBUG(1008): signal 11 (SIGSEGV), fault addr 00000004 01-01 06:25:39.698: INFO/DEBUG(1008):  r0 00000004  r1 40023778  r2 00000004  r3 ad32d629 01-01 06:25:39.698: INFO/DEBUG(1008):  r4 00000000  r5 00000000  r6 ad34e495  r7 4203afb8 01-01 06:25:39.698: INFO/DEBUG(1008):  r8 100ffd00  r9 4203afb0  10 4203afa0  fp 00000001 01-01 06:25:39.698: INFO/DEBUG(1008):  ip ad372c80  sp 100ffce8  lr ad32d633  pc afb04408  cpsr 00000010 01-01 06:25:39.776: INFO/DEBUG(1008):          #00  pc 00004408  /system/lib/libcutils.so 01-01 06:25:39.784: INFO/DEBUG(1008):          #01  lr ad32d633  /system/lib/libandroid_runtime.so 01-01 06:25:39.784: INFO/DEBUG(1008): stack: 01-01 06:25:39.784: INFO/DEBUG(1008):     100ffca8  45ba1410  /dev/ashmem/mspace/dalvik-heap/2 (deleted) 01-01 06:25:39.784: INFO/DEBUG(1008):     100ffcac  ad371820  /system/lib/libandroid_runtime.so 01-01 06:25:39.784: INFO/DEBUG(1008):     100ffcb0  45ba1410  /dev/ashmem/mspace/dalvik-heap/2 (deleted) 01-01 06:25:39.784: INFO/DEBUG(1008):     100ffcb4  afd00949  /system/lib/libstdc++.so 01-01 06:25:39.784: INFO/DEBUG(1008):     100ffcb8  0028c820  [heap] 01-01 06:25:39.784: INFO/DEBUG(1008):     100ffcbc  43079f5c  /data/dalvik-cache/system@framework@framework.jar@classes.dex 01-01 06:25:39.784: INFO/DEBUG(1008):     100ffcc0  00000001   01-01 06:25:39.784: INFO/DEBUG(1008):     100ffcc4  43079f5c  /data/dalvik-cache/system@framework@framework.jar@classes.dex 01-01 06:25:39.784: INFO/DEBUG(1008):     100ffcc8  00000001   01-01 06:25:39.784: INFO/DEBUG(1008):     100ffccc  a9d222bf  /system/lib/libutils.so 01-01 06:25:39.784: INFO/DEBUG(1008):     100ffcd0  0000a000  [heap] 01-01 06:25:39.784: INFO/DEBUG(1008):     100ffcd4  420f30b8  /dev/ashmem/dalvik-LinearAlloc (deleted) 01-01 06:25:39.784: INFO/DEBUG(1008):     100ffcd8  100ffd30   01-01 06:25:39.784: INFO/DEBUG(1008):     100ffcdc  0000000d   01-01 06:25:39.792: INFO/DEBUG(1008):     100ffce0  df002777   01-01 06:25:39.792: INFO/DEBUG(1008):     100ffce4  e3a070ad   01-01 06:25:39.800: INFO/DEBUG(1008): #00 100ffce8  00000000   01-01 06:25:39.800: INFO/DEBUG(1008):     100ffcec  ad32d633  /system/lib/libandroid_runtime.so 01-01 06:25:39.800: INFO/DEBUG(1008):     100ffcf0  100ffd20   01-01 06:25:39.800: INFO/DEBUG(1008):     100ffcf4  ad34e4a5  /system/lib/libandroid_runtime.so 01-01 06:25:39.800: INFO/DEBUG(1008):     100ffcf8  40023778  /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted) 01-01 06:25:39.800: INFO/DEBUG(1008):     100ffcfc  ad00e438  /system/lib/libdvm.so 01-01 06:25:39.800: INFO/DEBUG(1008):     100ffd00  420f30b8  /dev/ashmem/dalvik-LinearAlloc (deleted) 01-01 06:25:39.800: INFO/DEBUG(1008):     100ffd04  0010e8a0  [heap] 01-01 06:25:39.800: INFO/DEBUG(1008):     100ffd08  ad34e495  /system/lib/libandroid_runtime.so 01-01 06:25:39.808: INFO/DEBUG(1008):     100ffd0c  40023778  /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted) 01-01 06:25:39.808: INFO/DEBUG(1008):     100ffd10  00001071   01-01 06:25:39.808: INFO/DEBUG(1008):     100ffd14  0010e8a0  [heap] 01-01 06:25:39.808: INFO/DEBUG(1008):     100ffd18  100ffd20   01-01 06:25:39.808: INFO/DEBUG(1008):     100ffd1c  ad040b11  /system/lib/libdvm.so 01-01 06:25:39.808: INFO/DEBUG(1008):     100ffd20  4203afb0   01-01 06:25:39.808: INFO/DEBUG(1008):     100ffd24  43108546  /data/dalvik-cache/system@framework@framework.jar@classes.dex 01-01 06:25:39.808: INFO/DEBUG(1008):     100ffd28  ad34e495  /system/lib/libandroid_runtime.so 01-01 06:25:39.808: INFO/DEBUG(1008):     100ffd2c  100ffd98   01-01 06:25:39.823: DEBUG/(1350): The Saved Contact is checked here 01-01 06:25:39.855: DEBUG/(1350): The Saved Contact is checked here 01-01 06:25:40.667: INFO/DEBUG(1008): debuggerd committing suicide to free the zombie! 01-01 06:25:40.667: INFO/DEBUG(1505): debuggerd: Dec  3 2009 13:23:48 01-01 06:25:40.675: DEBUG/Zygote(1010): Process 1350 terminated by signal (11) 01-01 06:25:40.683: INFO/ActivityManager(1082): Process android.process.acore (pid 1350) has died. 01-01 06:25:40.698: INFO/WindowManager(1082): WIN DEATH: Window{45afa370 com.android.launcher/com.android.launcher.Launcher paused=false} 01-01 06:25:40.698: INFO/WindowManager(1082): WIN DEATH: Window{45b93050 com.android.contacts/com.android.contacts.DialtactsActivity paused=false} 01-01 06:25:40.698: INFO/WindowManager(1082): WINDOW DIED during motion dispatch: Window{45b93050 com.android.contacts/com.android.contacts.DialtactsActivity paused=false} 01-01 06:25:40.714: WARN/WindowManager(1082): Requested window android.os.BinderProxy@45a64c98 does not exist 01-01 06:25:40.714: WARN/WindowManager(1082): java.lang.RuntimeException 01-01 06:25:40.714: WARN/WindowManager(1082):     at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:7756) 01-01 06:25:40.714: WARN/WindowManager(1082):     at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:7748) 01-01 06:25:40.714: WARN/WindowManager(1082):     at com.android.server.WindowManagerService.removeWindow(WindowManagerService.java:1348) 01-01 06:25:40.714: WARN/WindowManager(1082):     at com.android.server.WindowManagerService.dispatchPointer(WindowManagerService.java:4067) 01-01 06:25:40.714: WARN/WindowManager(1082):     at com.android.server.WindowManagerService.access$1200(WindowManagerService.java:127) 01-01 06:25:40.714: WARN/WindowManager(1082):     at com.android.server.WindowManagerService$InputDispatcherThread.process(WindowManagerService.java:5345) 01-01 06:25:40.714: WARN/WindowManager(1082):     at com.android.server.WindowManagerService$InputDispatcherThread.run(WindowManagerService.java:5253) 01-01 06:25:40.800: INFO/jdwp(1506): received file descriptor 13 from ADB 01-01 06:25:40.800: INFO/jdwp(1506): Ignoring second debugger -- accepting and dropping 01-01 06:25:40.800: INFO/jdwp(1506): Ignoring second debugger -- accepting and dropping 01-01 06:25:40.808: INFO/ActivityManager(1082): Start proc android.process.acore for activity com.android.launcher/.Launcher: pid=1506 uid=10001 gids={3003, 1015} 01-01 06:25:40.816: DEBUG/ddm-heap(1506): Got feature list request 01-01 06:25:40.862: WARN/Process(1082): Unable to open /proc/1350/status 01-01 06:25:40.940: WARN/UsageStats(1082): Unexpected resume of com.android.launcher while already resumed in com.android.contacts 01-01 06:25:40.972: INFO/ActivityThread(1506): Publishing provider user_dictionary: com.android.providers.userdictionary.UserDictionaryProvider 01-01 06:25:41.003: INFO/ActivityThread(1506): Publishing provider applications: com.android.providers.applications.ApplicationsProvider 01-01 06:25:41.050: INFO/ActivityThread(1506): Publishing provider com.android.globalsearch.SuggestionProvider: com.android.globalsearch.SuggestionProvider 01-01 06:25:41.120: INFO/ActivityThread(1506): Publishing provider com.android.googlesearch.SuggestionProvider: com.android.googlesearch.SuggestionProvider 01-01 06:25:41.144: INFO/ActivityThread(1506): Publishing provider com.android.websearch.Suggest: com.android.websearch.SuggestionProvider 01-01 06:25:41.159: INFO/ActivityThread(1506): Publishing provider com.android.globalsearch.stats: com.android.globalsearch.StatsProvider 01-01 06:25:41.159: INFO/ActivityThread(1506): Publishing provider contacts;call_log: com.android.providers.contacts.ContactsProvider 01-01 06:25:41.253: DEBUG/dalvikvm(1506): GC freed 3627 objects / 260784 bytes in 57ms 01-01 06:25:41.253: WARN/ActivityManager(1082): Unable to start service Intent { act=android.accounts.IAccountsService cmp=com.google.android.googleapps/.GoogleLoginService }: not found 01-01 06:25:41.261: WARN/AccountMonitor(1506): Couldn't connect to Intent { act=android.accounts.IAccountsService cmp=com.google.android.googleapps/.GoogleLoginService } (Missing service?) 01-01 06:25:41.261: INFO/ActivityThread(1506): Publishing provider com.android.launcher.settings: com.android.launcher.LauncherProvider</code></pre><p>IF any one has any idea let me know :(</p>","233739","","","","","2010-03-12 19:00:14","Contacts App crashes when switching between Dialer to Call log","<android><crash><runtime><contact>","1","0","","",""
"1922697","1","","","2009-12-17 15:52:02","3","4443","<p>I'm trying to understand how the res/drawables images should work with different screen densities. Right now I've got a 1.5 app, and for example I have an image that is 100x100 pixels. When used on the Droid, it scales this image so it appears to be the same size relatively on that device (all other layout scaling is handled by me, using dip units).</p><p>So now I need to update my project and add three folders, right?:</p><ol><li>drawable-ldpi</li><li>drawable-mdpi</li><li>drawable-hdpi</li></ol><p>so I'm going to put my 100x100 image in the -mdpi folder. If I want to make a version for the -hdpi folder - how do I know how much larger to scale it by? I mean it looks like by default it should be 1.5x bigger. But what happens if I make it 2.0x bigger, or the device I'm running on doesn't happen to have a density 1.5x that of the baseline G1? Won't my layouts start looking different on those devices?</p><p>Thanks</p>","137193","","","","","2009-12-23 09:44:46","Not understanding how to use different density images for 1.6+","<android>","3","0","5","",""
"1923480","1","1931599","","2009-12-17 17:53:26","11","31179","<p>I have followed the example in for the gradient dividers:<a href=""http://www.connorgarvey.com/blog/?p=34"">http://www.connorgarvey.com/blog/?p=34</a></p><p>I have tried to draw a horizontal line at the BOTTOM of my linear layout.</p><p>Here is my linear layout file:</p><pre><code>        &lt;LinearLayout android:id=""@+id/test"" android:layout_width=""fill_parent""            android:layout_height=""wrap_content&gt;&lt;ImageView android:id=""@+id/icon1""    android:layout_width=""32dip""    android:layout_height=""32dip""/&gt;</code></pre><p></p><p>And I did add </p><pre><code>&lt;Viewandroid:background=""@drawable/black_white_gradient""android:layout_width=""fill_parent""android:layout_height=""1dp""android:layout_above=""@id/test""/&gt;</code></pre><p>But i don't see any line at the top of the LinearLayout. And when I go to Hierarchy View and see he View (for the hort separator), the getWidth() is 0 while getHeight() is 1.</p><p>Can you please tell me what am I missing?</p><p>Thank you.</p>","125440","","125440","","2009-12-17 18:44:42","2011-09-08 09:06:36","How to draw a border at top of the linear layout","<android>","4","1","","",""
"1923526","1","1926380","","2009-12-17 18:01:49","11","16211","<p>On a relatively new emulator image (AVD) I have about 40mb of free space. How can I expand this?</p><p><strong>UPDATE:</strong>Just to be clear... I'm talking about the ""Internal phone storage"" size, not the SD Card size. </p>","76835","","76835","","2009-12-18 16:10:25","2012-11-29 10:07:29","Expanding the size of an Android Virtual Device (emulator) instance?","<android><emulator><avd>","2","2","6","",""
"1923874","1","1924359","","2009-12-17 19:03:20","6","4534","<p>I have a string defined in my String.xml file that uses format arguments, i.e.:</p><pre><code>&lt;string name=""myString""&gt;Hello %1$s.&lt;/string&gt;</code></pre><p>Is there a way to assign a value to the format argument in a layout xml file?  I have something like:</p><pre><code>&lt;TextView android:text=""@string/myString""/&gt;</code></pre><p>I know I can do it in java, but is there a way to do it here?</p><p>Thanks!</p>","234039","","","","","2010-06-22 10:43:26","Use string format arguments in Android layout xml file","<android>","2","0","1","",""
"1924842","1","1971005","","2009-12-17 21:50:57","2","3069","<p>Achieving a true ""dropdown"" effect (as seen in Adobe's Photoshop Mobile app for Android, image below) has proven challenging using Androids built-in methods.</p><p>As others on Stackoverflow have told me, editing the style of a dropdown list view of an Android spinner is limiting.</p><p></p><p>How is this dropdown effect done?</p><p>(I can't seem to get an image to show, so here's a link: <a href=""http://img94.imageshack.us/i/screenshot20091217at142.png/"" rel=""nofollow"">Adobe Photoshop Mobile for Android</a></p>","204499","","204499","","2009-12-17 21:57:28","2012-11-11 14:24:30","Android Dropdown Effect - Spinner or not?","<java><android><android-widget><spinner>","2","0","","",""
"1924920","1","1925124","","2009-12-17 22:05:10","19","26730","<p>I'm trying to get started with Android development.  </p><p>I'm using eclipse on Linux and using a Pentium IV @3.2Gh with 1GB of ram.I've just followed the ""hello android"" howto, with just one sad result: the virtualization is too slow.  </p><p>It seems that launching the virtual machine <em>has</em> to be slow, and it will be slow even if I'll use a better computer.  </p><p>With slow I mean it takes almost 10 minutes to see ""hello android"" and if I change it to ""hello world"" it takes an other 10 minutes... </p><p>How can I solve it? Is it possible to make eclipse load again my app in the <em>current and running</em> virtual machine without opening a new one?  </p>","21384","","30316","","2009-12-20 11:18:31","2012-12-14 12:21:49","How to speed up Android Emulation?","<android><performance><android-emulator>","4","1","4","",""
"1925428","1","1925577","","2009-12-17 23:57:08","2","9712","<p>In my layout, there is a TextView at the bottom of the screen. The problem is that when I click inside the text box to type something, the keyboard covers the text box as a result of which I am not able to see what's happening... Is there any solution for this? Here's my layout...</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/mainLayout""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/layout_bg""    &gt;    &lt;ImageView     			android:id=""@+id/headerimg""    		    	android:layout_width=""wrap_content""    		    	android:layout_height=""wrap_content""    		    	android:layout_gravity=""left""    		    	android:paddingTop=""5dp""    		    	android:paddingBottom=""5dp""    		    	android:paddingLeft=""5dp""    		    	android:src=""@drawable/header_image""    		    /&gt;    &lt;LinearLayout     android:id=""@+id/secondaryLayout""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""320dip""    android:layout_marginTop = ""5dip""    android:layout_marginLeft=""8dip""    android:layout_marginRight=""8dip""    android:cacheColorHint=""#00000000""    &gt;    &lt;!-- A ListView appears here --&gt;    &lt;/LinearLayout&gt;    &lt;RelativeLayout     android:id=""@+id/message""    android:orientation=""horizontal""    android:layout_width=""300dip""    android:layout_height=""80dip""    android:layout_gravity=""center""    &gt;    	&lt;EditText    		android:id=""@+id/MessageText""    		android:layout_height=""wrap_content""    		android:layout_width=""230dip""    		android:layout_marginLeft=""8dip""    		android:layout_marginTop = ""8dip""    		android:paddingBottom = ""8dip""    		android:paddingLeft=""15px""    		android:hint=""Type something here...""&gt;    	&lt;/EditText&gt;    	&lt;Button    		android:id=""@+id/MsgButton""    		android:layout_margin=""0dip""    		android:layout_width=""48dip""    		android:layout_toRightOf=""@id/MessageText""    		android:layout_height=""48dip""&gt;    	&lt;/Button&gt;    &lt;/RelativeLayout&gt;    	&lt;/LinearLayout&gt;</code></pre>","184046","","","","","2009-12-18 00:39:30","Android: When the keyboard pops up, the layout is invisible. How do I solve this?","<android><layout><overlap>","1","1","4","",""
"1925486","1","1925534","","2009-12-18 00:11:49","67","57929","<p>If I want to store the username and password to be used inside an Android application, what is the best way to do it? Is it through the preferences screen (but what if the user misses this?), or pop up a dialog box and ask the user for the credentials? If so, I do have to maintain state for the application. How would I do this?</p>","184046","","","","","2013-06-18 10:44:47","Android: Storing username and password?","<android><authentication><storage><credentials>","7","1","20","",""
"1925502","1","","","2009-12-18 00:15:37","2","8783","<p>Currently we have a Gallery view to which we need to add thumbnails for images/video. How do we get the already generated thumbnails (the ones that the native Gallery app shows) if we already have the image's/video's content:// URI?</p><p>(We are using Android 1.6, Video.Thumbnails does not exist)</p>","232468","","232468","","2009-12-18 00:42:17","2010-09-27 07:18:46","Android Gallery (view) video (also thumbnail issues)","<android><image><video><thumbnails><gallery>","4","0","3","",""
"1926284","1","1926318","","2009-12-18 04:32:01","2","8556","<p>For some reason, when I use the call, the result is always returned as 0. All I am doing is popup the selection box and then once the selection is made, the user hits the back button. Does anyone know what mistake I could be doing?</p><p>CALLING ACTIVITY:</p><pre><code>Intent i = new Intent(this, Selection.class);Log.d(""Front-End"", ""Launching Activity"");startActivityForResult(i, SELECTION);</code></pre><p>INVOKED ACTIVITY:</p><pre><code>bundle.putStringArray(""selections"", selected_array);Intent resultIntent = new Intent();resultIntent.putExtras(bundle);setResult(RESULT_OK, resultIntent);finish();</code></pre><p>Any suggestions? If I include the finish() call, it gives me the following:</p><pre><code>W/ActivityManager( 1030): Duplicate finish request for HistoryRecord{44802c90 com.android.TVitter/.Selection}</code></pre>","184046","","184046","","2009-12-18 04:37:32","2009-12-18 04:50:39","Android: startActivityForResult always gets a resultCode of 0?","<android><android-intent>","2","0","1","2012-02-14 04:36:46",""
"1926388","1","1931410","","2009-12-18 05:07:37","8","11598","<p>I want to start an activity inside a pop-up screen. Are there any suggestions for a quick change?</p><pre><code>new AlertDialog.Builder(SearchResults.this)        .setTitle(""Refine"")         .setItems(/*catNames*/, new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int which) {                /* User clicked so do some stuff */                String catName = catNames[which];                String categoryIds = subCats.get(catName);            })            .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int whichButton) {                //do nothing just dispose            }        })        .create().show();</code></pre>","216431","","490829","","2013-09-05 19:48:22","2013-09-05 19:48:22","Android activity inside dialog","<android><dialog><activity>","2","0","1","",""
"1926626","1","","","2009-12-18 06:15:39","1","1041","<p>I have a camera preview activity, which is forced to stay in landscape mode.</p><p>Is there a way I can tell the current orientation of the phone (not the screen orientation).</p><p>Basically I want to know if the user is holding the phone in portrait mode, or in landscape mode, so I can rotate the output captured bitmap correctly (right now it just always outputs in landscape mode).</p><p>Thanks</p>","137193","","","","","2011-02-28 09:48:20","Getting orientation of the device?","<android>","2","2","1","",""
"1926666","1","1927011","","2009-12-18 06:24:33","0","2962","<p>I am using table layout to display data, but i want it to behave like list items(ability to select, when select change background, when click, having hover effect, click able) for that purpose i am using following listeners</p><ul><li>OnClickListener(to perform action)</li><li>OnFocusChangeListener(To change background color)</li><li>OnTouchListener(to focus specific row)</li></ul><p>Now problem is when user touch any item it get focus first and then have to touch again to fire onclick event, to fix this i made a change and ontouch i fire action on specific to row.</p><pre><code>@Overridepublic boolean onTouch(View v, MotionEvent event) {	if (event.getAction() != MotionEvent.ACTION_UP){		v.requestFocus();		int viewId= v.getId();		handleEvent(viewId);//Switch cases to perform row specific actions.	}	return false;}</code></pre><p>now if user touch the row event get fired that works perfect, But one more problem rises here when even user want to scroll down the data via dragging finger onto the screen ontouch event get fired.... and action automatically performed although user think it will scroll down the screen.</p>","216431","","","","","2009-12-18 08:29:42","Android tableview behaving as a listview","<android><tableview>","1","0","","",""
"1926713","1","","","2009-12-18 06:44:57","1","539","<p>If I want to upload a text file containing some game stats to a web server for testing purpose, which approach is the best? Do I write a service along with my application and then upload the log file once it reaches a specific size? Or do I embed the logic into my application and then do it during idle times?</p>","184046","","","","","2009-12-18 16:09:15","Android: Uploading a text file periodically?","<android><logging>","3","1","","",""
"1926744","1","1927013","","2009-12-18 06:55:01","0","245","<p>I just upgraded to the Android 2 SDK. (I was at v1.5)  I believe I followed all the instructions correctly, I installed the new SDK and then went into Eclipse and ran a software update from dl-ssl.google.com/android/eclipse.  But when I then went to create a new project (after restarting Eclipse) all I had to choose from were 1.5 Android projects.  </p><p>To be honest, the steps for upgrading the SDK could be a little easier so it's entirely possible I missed something.  I'm glad Google has an auto-update feature starting with Android 1.6 but unfortunately I'm out of luck since I'm on 1.5.</p>","172617","","","","","2009-12-18 11:24:49","How to get Android 2 project types available in Eclipse?","<android>","3","0","","",""
"1926825","1","","","2009-12-18 07:23:00","3","1552","<p>I am writing an android program and I need to connect to the Drupal service to fretch the data or submit data. How can I do that?</p><p>Thank you very much!!!</p>","210235","","","","","2013-02-17 08:31:33","How can Android connect to Drupal service?","<android><drupal>","3","0","","",""
"1927406","1","1927424","","2009-12-18 10:22:58","10","13886","<p>Can anyone point me to a explanation for or explain to me how I can easily parse the XML and get values of a w3c.Document on Android using only Android OS Libs?</p><p>I tried to use a implementation of dom4j, but it is very slow :-(</p>","174868","","","","","2012-08-06 04:15:27","Way to parse XML (org.w3c.Document) on Android","<xml><android>","3","0","10","",""
"1927792","1","1927966","","2009-12-18 11:54:22","1","1575","<p>I want to animate imageviews using the scale animation the problem is that after animating on imageview how to make sure that the next one is required to start Please help me fixing this</p>","92039","","","","","2009-12-18 12:34:28","Android Scale Animation","<android>","1","0","2","",""
"1928176","1","1928405","","2009-12-18 13:23:25","0","5433","<p>i have used below steps for setup the my emulator </p><p>1.C:\Program Files\android-sdk-windows\tools>adb shell2. # sqlite3 /data/data/com.google.android.providers.settings/databases/settings.db3. sqlite> INSERT INTO system VALUES(99,’http_proxy', '10.10.8.1:8080');</p><p>after that i closed adb shell command prompt and my emulator. and then opened my emulator but webbrowser is not opening any page(web page not available messaage) .</p><p>Please any one tell me the solution for this problem.is any other way to connect net in android emulator?</p><p>Regards,Jeyavel N</p>","212809","","","","","2009-12-18 14:09:53","How to access internet from android emulator?","<android>","2","0","1","",""
"1928891","1","1928927","","2009-12-18 15:32:04","1","309","<p>Does anyone know if Flash will be able to run independent from the browser? I mean native apps in Flash, not just the player in a browser. The Symbian OS can do that, however I have yet to find an article which explicitly states what will become available in the case of the iPhone and the Android platform. I am not asking about dates, as those are the most fluctuation prone variables. I am part of a web/mobile apps development company which is eager to use flash to make applications even richer in content and user experience.</p>","234634","","","","","2009-12-18 15:52:54","Native Flash on mobile platforms?","<iphone><android><flash><native>","2","0","","",""
"1929556","1","","","2009-12-18 17:09:42","7","8363","<p>In my activity, I'd like to show simple info dialogs, stuff like:</p><pre><code>new AlertDialog.Builder(context).setMessage(message).show();</code></pre><p>if I do that, the dialog will leak when I rotate that phone (not to mention it will disappear as well, so the user may miss it). I can use the managed dialogs, but I'm not sure how you use it sensibly for these types of short messages? Looks like you have to do this:</p><pre><code>showDialog(SOME_DLG_ID);...@OverrideonCreateDialog(int id) {    if (id == SOME_DLG_ID) {        new AlertDialog.Builder(context).setMessage(message).show();    }}</code></pre><p>there's no way to pass what the message should be into onCreateDialog since its an override method. I'd hate to make a member variable of the parent activity that just stores whatever the current message should be. How do you all do it?</p><p>Thanks</p>","137193","","","","","2013-07-24 16:27:17","Showing simple message dialogs","<android>","3","3","1","",""
"1929773","1","1929869","","2009-12-18 17:58:24","3","5971","<p>How can I have a layout where there is a view occupying most of the top of the screen and a bottom bar below it in the bottom of the screen without setting size for top view directly?</p>","6533","","","","","2009-12-18 18:17:49","Bottom bar on Android","<android><layout>","1","0","1","",""
"1929791","1","1929843","","2009-12-18 18:01:43","9","4583","<p>You know what I'm talking about: for example when you get multiple new emails the notification icon in the status bar is augmented with a little red circle that contains number of unread mails. Twitroid has the same icon. Any idea how it's done? I don't think (or so I hope) there are 10000 similar icons. Is this red circle generated and overlaid the notification icon? If so - any code snippets will be much appreciated.</p>","135946","","","","","2010-06-02 05:32:29","Android - incremental status bar notification icon","<android><notifications><statusbar>","2","0","5","",""
"1930177","1","1931371","","2009-12-18 19:19:13","1","671","<p>I have an android app that wants to initiate an email. The following code works in an api level 5 emulator, but not on a level 2 emulator or device:</p><pre><code>Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""Email from MyApp"");emailIntent.setType(""text/plain"");emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,   ""This email was autogenerated by MyApp."");try {    startActivity(emailIntent);} catch (Exception e) {    Log.e(TAG,e.getMessage());    showDialog(DIALOG_CANTSENDMAIL);}</code></pre><p>The exception thrown says: </p><pre><code>No Activity found to handle Intent { action=android.intent.action.SEND (has extras) }</code></pre><p>I can manually send email from all devices (emulated and real) tested, and this works in Level 5 api. The documentation on Intent.ACTION_SEND says it has been active since API level 1.</p>","58164","","","","","2009-12-18 23:58:46","Android: difference in ACTION_SEND between api level 2 and 5?","<android><android-emulator>","1","1","","",""
"1930895","1","1943768","","2009-12-18 21:54:59","9","8201","<p>Android supports an event onLongPress.  The question I have is 'how long' (in milliseconds) is the 'press' to trigger the event?</p>","157804","","","","","2009-12-27 04:22:51","How long is the event onLongPress in the Android?","<android><events><gesture>","4","0","1","",""
"1930963","1","","","2009-12-18 22:09:46","19","34577","<p>Hello i have a button i want to put on a 45 degree angle. For some reason i cant get this to work. Can someone please provide code to accomplish this?</p>","234866","","65387","","2009-12-20 23:36:40","2014-03-26 11:23:10","Rotating a view in android","<android><view><rotation>","8","0","18","",""
"1931170","1","1931418","","2009-12-18 23:01:30","1","788","<p>What is the easiest way to create some kind of test harness for Android apps and to be able to visualize (even on the emulator) what is going into the db?  I want to test things like constraints, look at the data, unit test methods, etc.</p><p>Is there any kind of GUI tool that I can hook up to the emulator to be able to look at the db of a particular app while I'm developing/testing, or are my only options the adb shell and creating test Activities within my app?</p>","53501","","","","","2009-12-19 00:13:14","Unit testing Android apps and specifically related to db's","<android><eclipse><unit-testing><sqlite><adb>","1","0","","",""
"1932042","1","1932097","","2009-12-19 05:18:45","0","1325","<p>When i started learning android i learned that R.java files goes to /gen folder</p><p>recently i saw it on /src file</p><p>( in WROX-Professional Android App Dev- sample code downloads ).</p><p>How does this work.</p><p>and also in some code i saw ( xml layout )</p><p>android:id=""@+id/R.id.someName"" ( i don't remember in which web page i saw this code , sorry ).</p><p>I don't understand this, can somebody help me with this.</p><p>Thanks in advance.</p>","132347","","9951","","2009-12-19 05:54:10","2011-03-08 22:47:06","Why Android R.java file can be in src/ or gen/?","<xml><android>","1","0","","",""
"1932150","1","1932171","","2009-12-19 06:17:06","75","100920","<p>Is it possible to set up Android in ad-hoc peer-to-peer wifi mode?  For example, I would like to have one phone broadcast a message, and have all peers in the network receive the broadcast, without having a server. I would like to use wifi since bluetooth range is more limited.</p>","234933","","-1","","2012-04-11 23:49:52","2014-03-15 19:22:33","Can Android do peer-to-peer ad-hoc networking?","<android><networking><wifi><p2p><adhoc>","11","1","37","",""
"1932421","1","1932667","","2009-12-19 09:07:26","2","528","<p>My project layout is</p><pre><code>/ServerModule  /commonClasses/AndroidClient  /needsToIncludeSomeCommonClasses</code></pre><p>but as soon as i want to compile and build my AndroidClient IntelliJ adds the server libs to the compile classpath of my android project and I get a UNEXPECTED TOP-LEVEL EXCEPTION because of multiple classes that are present in android and normal java.</p><p>My question is how can i set up my project without duplicating the server code?</p><p>It seems to be a problem with the android-plugin. It includes all the serverside libs in the build.</p>","193385","","193385","","2009-12-19 10:55:01","2009-12-19 11:25:10","How can I instruct IntelliJ Idea to not include certatin dependencies (android)","<java><android><intellij-idea>","2","0","","",""
"1932620","1","1935690","","2009-12-19 11:05:25","2","12710","<p>im currently working on a app for a podcast (katg.com) which will let you listen live etc... however, i have not found any open source code available to stream shoutcast. I know there are some ways of doing it, but I find it hard to find any available code on the net that explains it for a java/android beginner like myself. Anyone know of any libs/tutorial/examples/code that shows how to do this on android?</p><p>Thanks</p><p>JN</p>","","user235085","","","","2012-08-29 18:27:27","Shoutcast streaming","<java><android><streaming><shoutcast>","4","1","3","",""
"1933015","1","8502231","","2009-12-19 14:18:44","5","23080","<p>I have a .gif file inside the assets folder like this assets/Files/android.gif. when I try to open the file it throws an exception at the second line </p><pre><code>AssetManager mngr=getAssets();InputStream is2=mngr.open(""Files/android.gif"");</code></pre><p>so Is it that I'm trying to open an image file despite that the same code works if I try to open a text file ?what can be the problem here.</p>","235123","","683261","","2013-05-18 08:10:57","2013-05-18 08:10:57","Opening a File from assets folder in android","<android><android-assets>","5","0","4","",""
"1933428","1","","","2009-12-19 16:52:06","1","1588","<p>Is multitouch available to Android app developers? I've heard its on the new 2.0 version but only seen it accomplished on the internet browser.</p>","235189","","","","","2009-12-19 17:09:57","Multitouch on an Android app","<android><multi-touch>","2","1","1","",""
"1933730","1","","","2009-12-19 18:22:19","1","4529","<p>Due to performance issues, I have had to transfer my android opengl code from Java to C.  I believe I transfered all of the OpenGL code, but I now have many errors with the section of my code that draws a bitmap as a texture to the screen.</p><p>When I run the project in an emulator, the current code does not display anything and appears to have a memory leak because it slowly takes up all the memory and forces other apps to close.</p><p>Here is the code that controls this part:</p><p>In the header file:</p><pre><code>extern unsigned char colors[1024*512*3];   // 3 bytes per pixel</code></pre><p>In the c file:</p><pre><code>void appRender(int width, int height, unsigned char colors){    unsigned int textureID;    float vertices[] =     {        0.0f, 0.0f,        512.0f, 0.0f,        0.0f, 1024.0f,        512.0f, 1024.0f    };    float texture[] =    {        0.0f, 0.0f,       1.0f, 0.0f,       0.0f, 1.0f,       1.0f, 1.0f    };    unsigned char indices[] =     {       0, 1, 3,       0, 3, 2    };    UpdateView();    //onDraw     glMatrixMode(GL_PROJECTION);    glLoadIdentity();    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);    glOrthof(0.0f, 320.0f, 430.0f, 0.0f, 1.0f, -1.0f);    //texture stuff    glGenTextures(1,&amp;textureID);    glBindTexture(GL_TEXTURE_2D, textureID);    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);    //Different possible texture parameters, e.g    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);    glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, 512, 1024, 0, GL_RGB ,GL_UNSIGNED_BYTE, colors);    glEnableClientState(GL_VERTEX_ARRAY);    glEnableClientState(GL_TEXTURE_COORD_ARRAY);    glVertexPointer(2, GL_FLOAT, 0, vertices);    glTexCoordPointer(2, GL_FLOAT, 0, texture);    glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices);    glDisableClientState(GL_VERTEX_ARRAY);    glDisableClientState(GL_TEXTURE_COORD_ARRAY);}</code></pre><p>Any help would be greatly appreciated. </p>","135135","","44729","","2010-06-18 15:09:15","2010-06-18 15:09:15","OpenGL ES drawing issues in Android NDK","<android><opengl-es><textures>","1","3","1","",""
"1934187","1","1934234","","2009-12-19 21:24:08","66","11202","<p>When using the OAuth protocol, you need a secret string obtained from the service you want to delegate to. If you are doing this in a web app, you can simply store the secret in your data base or on the file system, but what is the best way to handle it in a mobile app (or a desktop app for that matter)?</p><p>Storing the string in the app is obviously not good, as someone could easily find it and abuse it.</p><p>Another approach would be to store it on your server, and have the app fetch it on every run, never storing it on the phone. This is almost as bad, because you have to include the URL in the app. I don't believe using https is any help.</p><p>The only workable solution I can come up with is to first obtain the Access Token as normal (preferably using a web view inside the app), and then route all further communication through our server, where a script would append the secret to the request data and communicates with the provider. Then again, I'm a security noob, so I'd really like to hear some knowledgeable peoples' opinions on this. It doesn't seem to me that most apps are going to these lengths to guarantee security (for example, Facebook Connect seems to assume that you put the secret into a string right in your app).</p><p>Another thing: I don't believe the secret is involved in initially requesting the Access Token, so that could be done without involving our own server. Am I correct?</p>","96531","","1236396","","2013-12-02 21:58:23","2013-12-02 21:58:23","OAuth secrets in mobile apps","<iphone><android><security><mobile><oauth>","9","5","38","",""
"1934215","1","","","2009-12-19 21:36:23","0","825","<p>I have a ListView in my extended ListActivity class.</p><p>And then I have the following code to detect my click on the list</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id){   Log.i("""", """"+l.getSelectedItem().toString());}</code></pre><p>I want to get the data string associated to my click. </p><ol><li><p>When I run the code, I get an error with getSelectedItem(). </p></li></ol><p><a href=""http://developer.android.com/reference/android/widget/ListView.html"" rel=""nofollow"">http://developer.android.com/reference/android/widget/ListView.html</a>. getSelectedItem() is not method of ListView but it is defined in the superclass AdapterView.How is that possible? Rolling Eyes</p><p>2. Also , I'm not sure I understand this line:android.widget.AdapterViewwhen it also inherits from   android.view.ViewGroupisn't that multiple inheritance?</p>","138260","","","","","2009-12-19 21:55:20","android 101 - listview inheritance question","<android><inheritance><listview>","2","0","","",""
"1934216","1","1938619","","2009-12-19 21:36:27","0","1262","<p>How to create an <a href=""http://en.wikipedia.org/wiki/Android%5F%28operating%5Fsystem%29"" rel=""nofollow"">Android</a> application with  WS-* services connections? </p><p>Where to get information for beginners - it should contain video tutorials and explanation what types of bindings are not supported.</p>","434051","","63550","","2009-12-20 00:07:06","2009-12-21 07:13:02","Android + WS-* services?","<java><android><web-services>","3","0","","",""
"1934241","1","1934354","","2009-12-19 21:49:10","1","701","<p>i wrote a View class based on ViewSwitcher and now I want to write helper classes for the view like known form the ListView: ListAdapter, ListActivity and so on..</p><p>Regarding the activity class I ran into a problem. The ListActivity forces you to add a ListView to your activity with a fixed id: @id/android:list. In my base activity class i want to archive the same, forcing a special id so that my helper classes can access the view object.</p><p>As I'm writing a general lib that could be used in various projects I can't use R.id.foobar to get the view as there's no R class. The specific project will an own R.java.</p><p>So I peeked at the source code of ListActivity and found:</p><pre><code>View emptyView = findViewById(com.android.internal.R.id.empty);mList = (ListView)findViewById(com.android.internal.R.id.list);if (mList == null) {    throw new RuntimeException(        ""Your content must have a ListView whose id attribute is "" +        ""'android.R.id.list'"");}</code></pre><p>Ok, I could write my on R class, put it directly into my package and try to access it in the same way but I've no clue what value the id should have or need?</p><p>Also I couldn't find any R class at android_frameworks_base/core/java/com/android/internal</p><p>And even if this problem is solved: How can the user of my lib access ""my id"" from his layout XML?</p><p>Thanks for your help! :)</p>","234908","","","","","2010-12-04 09:09:52","Using some kind of ""external ID"" for a View","<android>","3","0","","",""
"1934378","1","1935723","","2009-12-19 22:59:54","1","5856","<p>Posted this on the android dev forum, wondering if anyone here has seen this.</p><p>I'm using this camera code to ask the camera to rotate the captured image data:</p><pre><code>Camera.Parameters params = camera.getParameters();params.set(""rotation"", 90);camera.setParameters(params);</code></pre><p>this seems to work on all phones, except the Droid. Has anyone else seen this? The image data is always landscape, however, the native camera app on the Droid produces portrait images ok. </p><p>I wonder if the Droid will only respect the new Camera.Parameters.setRotation() method, but this seems to only be available in sdk level 5?</p><p>Thanks</p>","137193","","","","","2010-02-14 03:31:42","Droid - won't rotate image captured from camera? (Camera.Parameters)","<android>","3","0","1","",""
"1934402","1","1941838","","2009-12-19 23:07:15","0","596","<p>I've been trying to create my own android keyboard following <a href=""http://android-developers.blogspot.com/2009/04/creating-input-method.html"" rel=""nofollow"">this guide</a> and looking at the <a href=""http://android.git.kernel.org/?p=platform/packages/inputmethods/LatinIME.git;a=blob;f=res/xml/kbd%5Fqwerty.xml;h=0493b99328d394a873476caf10725addd226a5f8;hb=HEAD"" rel=""nofollow"">latinIME souce code</a>.</p><p>While reading the kbd_qwerty.xml file I noticed the different tags used and explained <a href=""http://developer.android.com/intl/de/reference/android/inputmethodservice/Keyboard.Key.html"" rel=""nofollow"">here</a>. I was expecting to see certain tag to reproduce what BetterKeyboard application does. They draw more than one key on each button. <a href=""http://betterandroid.files.wordpress.com/2009/05/11.png"" rel=""nofollow"">Example</a>.</p><p>Are they adding images or this is somehow possible from the xml?</p><p>Thanks for reading!</p>","119895","","","","","2009-12-21 18:39:48","How to add two possible keys in one keyboard button","<android>","1","0","1","",""
"1934562","1","1934866","","2009-12-20 00:27:22","0","116","<p>I'm not sure if I'm simply something obvious (probably), but the API tools icon in the ""manage applications"" section of the phone isn't there.  </p><p>I do see a Dev Tools icon on the main page, but that doesn't appear to have the same stuff in it.  Anyone know where I can find this section in Android 2.0?</p>","172617","","","","","2009-12-20 04:35:08","API Tools location on Android 2.0 emulator?","<android>","1","0","","",""
"1934865","1","1935742","","2009-12-20 04:34:38","2","1505","<p>I want to know how to pass data from the current Activity to a paused Activity.</p><p>Please advise.</p>","227889","","496830","","2011-08-02 17:00:27","2011-08-02 17:00:27","How can I pass data from the current Activity to a paused Activity?","<android>","2","0","","",""
"1935056","1","1935260","","2009-12-20 06:36:27","6","2832","<p>I would like to write a client application for Android that uses the Google App Engine as a database backend.  My Android client would connect to the App Engine to save information, then it would connect later for reports.  Is it possible to use the App Engine as a backend like this?</p>","234933","","","","","2011-02-11 21:30:49","Is it possible to use the Google App Engine as a backend database for Android applications?","<database><android><google-app-engine><backend>","5","0","0","",""
"1935115","1","","","2009-12-20 07:25:46","0","111","<p>I'm developing a media file app that is meant to play sounds stored inmy raw folder. There are about 32 sounds in all. And this is what i'mdoing on the click of each button:</p><pre><code>Button btnGrowUp = (Button) this.findViewById(R.id.GrowUp);btnGrowUp.setOnClickListener(btnGrowUpListener);private OnClickListener btnGrowUpListener = new OnClickListener(){    public void onClick(View v)    {        //Toast.makeText(getBaseContext(), ""Grow Up audio file is being played"", Toast.LENGTH_SHORT).show();        MediaPlayer mp = MediaPlayer.create(MainScreen.this, R.raw.growup);        mp.start();    }};</code></pre><p>I get a runtime exception saying ""app stops unexpectedly"" with thefollow messages in my logcat window:</p><pre>12-19 12:33:05.420: WARN/dalvikvm(699): threadid=3: thread exitingwith uncaught exception (group=0x4000fe70)12-19 12:33:05.441: ERROR/AndroidRuntime(699): Uncaught handler:thread main exiting due to uncaught exception12-19 12:33:05.460: ERROR/AndroidRuntime(699):java.lang.NullPointerException12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atcom.myapps.media.MainScreen$8.onClick(MainScreen.java:244)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.view.View.performClick(View.java:2179)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.view.View.onTouchEvent(View.java:3828)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.widget.TextView.onTouchEvent(TextView.java:6291)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.view.View.dispatchTouchEvent(View.java:3368)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atcom.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1707)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atcom.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1197)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.app.Activity.dispatchTouchEvent(Activity.java:1993)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atcom.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1691)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.view.ViewRoot.handleMessage(ViewRoot.java:1525)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.os.Handler.dispatchMessage(Handler.java:99)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.os.Looper.loop(Looper.java:123)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atandroid.app.ActivityThread.main(ActivityThread.java:3948)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atjava.lang.reflect.Method.invokeNative(Native Method)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atjava.lang.reflect.Method.invoke(Method.java:521)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atcom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atcom.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)12-19 12:33:05.460: ERROR/AndroidRuntime(699):     atdalvik.system.NativeStart.main(Native Method)12-19 12:33:05.520: INFO/Process(563): Sending signal. PID: 699 SIG: 312-19 12:33:05.520: INFO/dalvikvm(699): threadid=7: reacting to signal312-19 12:33:05.601: INFO/dalvikvm(699): Wrote stack trace to '/data/anr/traces.txt'12-19 12:33:05.982: INFO/ARMAssembler(563): generatedscanline__00000077:03515104_00000000_00000000 [ 27 ipp] (41 ins) at[0x27c718:0x27c7bc] in 982527 ns12-19 12:33:06.011: INFO/ARMAssembler(563): generatedscanline__00000077:03515104_00001001_00000000 [ 64 ipp] (84 ins) at[0x27c7c0:0x27c910] in 1804978 ns</pre><p>How to resolve this issue? Thank you</p><p>Maqsood</p>","2355649","","234938","","2009-12-30 02:30:23","2009-12-30 02:32:42","Handling Exception in a MediaFile app","<android><nullpointerexception>","1","3","","","2009-12-20 07:25:46"
"1935257","1","1936408","","2009-12-20 08:35:31","3","1659","<p>In android, is it possible to customize the header layout (the icon + a text) layout of a dialog? Or I can just set the string value of the title text?</p><p>Thank you.</p>","125440","","","","","2009-12-20 17:24:21","How can I customize the header layout of a dialog","<android>","2","0","1","",""
"1935659","1","1935708","","2009-12-20 12:13:08","1","259","<p>I installed android eclipse galileo, and also downloaded android SDK. while installing ADT, I chose</p><p>Help->install new software->Add</p><p>I enter android and the location as <a href=""https://dl-ssl.google.com/android/eclipse/"" rel=""nofollow"">https://dl-ssl.google.com/android/eclipse/</a> but I don't see any package names etc in the available software dialog (I am supposed to see 'developer tools', correct?). I tried with http instead of https, still the box is empty. What am I missing?</p>","61734","","","","","2009-12-21 06:00:53","Installing Android SDK","<android><eclipse-plugin>","2","0","","",""
"1935849","1","1935899","","2009-12-20 13:37:49","0","1478","<p>I want to add Czech dictionary to LatinIME (it is only missing part, UI and keyboard are already here).I found source of LatinIME in source of android itself. There is a sample.xml file which show correct structure for creating dictionaries, but there is a point I got stuck. What do I have to do next? </p>","","user235486","","","","2011-08-26 06:48:35","LatinIME dictionary","<android>","2","0","0","",""
"1935854","1","1935893","","2009-12-20 13:39:37","0","9221","<p>I am trying to create an application which reads data from digital compass. I tried to reuse the code from the book Professional Android Application Development but the IDE displayed a note</p><blockquote>  <p>The type SensorListener is deprecated</p></blockquote><p>I guess it is because the code from the book is written for the earlier SDK version so I tried to use SensorEventListener instead.</p><p>Then when I tried to register the listener</p><pre><code>sensorManager.registerListener(sensorListener, SensorManager.SENSOR_ORIENTATION, SensorManager.SENSOR_DELAY_FASTEST);</code></pre><p>an error appeared:</p><blockquote>  <p>The method registerListener(SensorListener, int, int) in the type SensorManager is not applicable for the arguments (SensorEventListener, int, int)</p></blockquote><p>so I tried to cast SensorEventListener to SensorListener, but the application doesn't work.</p><p>Does anyone know how to use sensor in newer SDK versions?</p><p>Thank you.</p>","22996","","","","","2013-11-28 00:13:03","android SensorEventListener problem","<android><sensor>","4","0","2","",""
"1935896","1","","","2009-12-20 13:57:04","0","241","<p>I am trying to collect information about Android apps.  I am trying to build my program and I need to have a web access to price and category of android applications.  Any idea about the API, how I can access the information?</p>","235495","","60261","","2009-12-20 17:48:09","2011-02-20 06:36:58","Web access to android application - price and category","<android>","1","2","","",""
"1936742","1","1937033","","2009-12-20 19:37:36","1","1443","<p>There's an open source battery indicator that I greatly prefer to the default one. I was wanting to modify it to replace the default battery indicator. Is this even possible without building a whole custom ROM?</p><p><img src=""http://imgur.com/8e1cO.png"" alt=""battery indicator screenshot""></p>","76835","","76835","","2009-12-20 20:11:04","2010-07-16 17:57:22","Replacing the battery indicator (Android)","<android><battery>","2","1","","",""
"1937071","1","1937096","","2009-12-20 21:16:29","1","322","<p>I'm making a messaging app and I want to be able to extend it by using plugins. The plugin might, for example, replace :) with a smiley image. I've written some test code which uses intent filters to find the plugins, but I can't find a way to create an instance of the that plugin class. Is it possible to do this, and if not, what would be the best approach/best alternative to this?</p><p>Thanks.</p>","235642","","","","","2009-12-20 21:22:10","Making a pluggable Android messaging app","<java><android><plugins>","1","0","","",""
"1937236","1","2032105","","2009-12-20 22:05:26","30","27979","<p>I'm trying to do something which really ought to be quite easy, but it's driving me crazy. I'm trying to launch an activity when a home screen widget is pressed, such as a configuration activity for the widget. I think I've followed word for word the tutorial on the Android Developers website, and even a few unofficial tutorials as well, but I must be missing something important as it doesn't work.</p><p>Here is the code:</p><pre><code>public class VolumeChangerWidget extends AppWidgetProvider {public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds){	final int N = appWidgetIds.length;	for (int i=0; i &lt; N; i++) {		int appWidgetId = appWidgetIds[i];		Log.d(""Steve"", ""Running for appWidgetId "" + appWidgetId);		Toast.makeText(context, ""Hello from onUpdate"", Toast.LENGTH_SHORT);		Log.d(""Steve"", ""After the toast line"");		Intent intent = new Intent(context, WidgetTest.class);		PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);		RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);		views.setOnClickPendingIntent(R.id.button, pendingIntent);		appWidgetManager.updateAppWidget(appWidgetId, views);	}}</code></pre><p>}</p><p>When adding the widget to the homescreen, Logcat shows the two debugging lines, though not the Toast. (Any ideas why not?) However, more vexing is that when I then click on the button with the PendingIntent associated with it, nothing happens at all. I know the ""WidgetTest"" activity can run because if I set up an Intent from within the main activity, it launches fine.</p><p>In case it matters, here is the Android Manifest file:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""package=""com.steve""android:versionCode=""1""android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".Volume_Change_Program""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;	&lt;activity android:name="".WidgetTest""			  android:label=""@string/hello""&gt;		&lt;intent_filter&gt;			&lt;action android:name=""android.intent.action.MAIN""/&gt;			&lt;category android:name=""android.intent.category.LAUNCHER""/&gt;		&lt;/intent_filter&gt;	&lt;/activity&gt;    &lt;receiver android:name="".VolumeChangerWidget"" &gt;    	&lt;intent-filter&gt;    		&lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;    	&lt;/intent-filter&gt;    	&lt;meta-data 	android:name=""android.appwidget.provider""    				android:resource=""@xml/volume_changer_info"" /&gt;    &lt;/receiver&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""3"" /&gt;</code></pre><p> </p><p>Is there a way to test where the fault is? I.e. is the fault that the button isn't linked properly to the PendingIntent, or that the PendingIntent or Intent isn't finding WidgetTest.class, etc?</p><p>Thanks very much for your help!</p><p>Steve</p>","235654","","","","","2013-02-07 11:11:16","Launching activity from widget","<android><android-widget>","10","0","17","",""
"1937484","1","1939659","","2009-12-20 23:33:54","5","7546","<p>How to draw line on <code>MapView</code> given coordinates?</p><p>AFAIK, on iPhone it is possible.</p><p>Please advise. </p><p>Thanks in advance.</p>","227889","","76835","","2009-12-22 22:00:37","2013-02-01 08:56:07","How to draw line on Map View given coordinates?","<android><android-mapview>","1","1","3","",""
"1937791","1","","","2009-12-21 01:45:27","2","1437","<p>I'm trying to figure out a refresh rate to use for my GPS location listener to get around a bug on the HTC Hero where the GPS icon won't remove itself off the notification bar.</p><p><a href=""http://groups.google.com/group/android-developers/browse%5Fthread/thread/e687b3bfa9146f31/7fa59b0108bbdf89?lnk=gst&amp;q=gps#7fa59b0108bbdf89"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse%5Fthread/thread/e687b3bfa9146f31/7fa59b0108bbdf89?lnk=gst&amp;q=gps#7fa59b0108bbdf89</a></p><p>Does anyone here have any suggestions? For my app, I'd normally run with a refresh rate of 5 minutes. But when I close the app, and de-register my listeners, the GPS icon sometimes still stays on the notification bar. Does anyone have an HTC Hero and can confirm this?</p><p>The link above suggests that using a refresh rate of under 35 seconds fixes the problem, but not sure if that's true.</p><p>Thanks</p>","137193","","","","","2009-12-21 09:14:30","Refresh rate for GPS - what's acceptable?","<android>","2","0","2","",""
"1938238","1","1938958","","2009-12-21 04:44:42","2","1330","<p>I'm working on a widget that will change the data it is displaying when a user taps on it. This would normally be easy to deal with, but my app widget provider is handling multiple widget instances that have different sets of data. With that being said, when a user taps on the widget, a PendingIntent is launched that calls the changeData() method. Inside the intent that is launched is where I store the widget ID so changeData() knows which data set to use. At first I was storing widget IDs in the intent's extras, but I found out that there is a bug in how Android widgets handled widget intent extras so now I am trying to store the widget by passing a URL using the setData() method(formatted like content:widgetId I.E. content:24, etc.).</p><p>This is how I am setting the data for the PendingIntent:</p><pre><code>Intent changeData = new Intent(""com.tonycosentini.mintdroid.CHANGE_DATA"");changeData.setData(Uri.parse(""content:"" + currentWidgetId));PendingIntent changeDataPendingIntent = PendingIntent.getBroadcast(this, 0, changeData, 0);</code></pre><p>However once I try to test this, the onRecieve() method that is usually called when a widget is tapped is no longer called. Is there something I need to setup in my Android Manifest file for this work properly or is there something I'm doing completely wrong?</p><p>Thanks for taking the time to read this,Tony</p>","215056","","","","","2009-12-21 09:03:01","Trying to Send Data To App Widget","<android><widget><android-intent>","1","0","","",""
"1938743","1","1939155","","2009-12-21 07:46:44","2","909","<p>I am facing with problem related Http Connection. MY code : </p><pre><code>URL url = null;try {    url = new URL(_url);} catch (MalformedURLException e) {}if (url != null) {    HttpURLConnection urlConn = null;    InputStreamReader isr = null;    try {        urlConn = (HttpURLConnection)url.openConnection();        urlConn.setRequestMethod(""GET"");        urlConn.setConnectTimeout(45000);        if(response == HttpURLConnection.HTTP_OK) {            StringBuffer readData = new StringBuffer("""");            int size = 1024;            char[] buffer = new char[size];            int len;            isr = new InputStreamReader(urlConn.getInputStream());            while ((len = isr.read(buffer, 0, size)) &gt; 0) {                readData.append(buffer, 0, len);            }        }    }     catch(Exception e) {    }     finally {        if(urlConn != null) {        try {            urlConn.disconnect();        } catch(Exception e) {                    }    }    if(isr != null) {        try {           isr.close();        } catch(Exception e) {                        }                }}</code></pre><p>This code can't download data completely.For example :Total size to read       : 13901 bytes Above code can read size : 12937 bytes</p><p>What is wrong here ?</p><p>Please advice guys.</p>","227889","","3171","","2009-12-21 08:45:54","2010-10-19 16:26:37","Http URL connection can't read completely","<android>","2","3","2","",""
"1938930","1","1939066","","2009-12-21 08:45:33","6","3788","<p>I have an application that is driven by a configuration XML: variousapp properties are loaded at the app start-time by parsing the XML andinitializing static variables of some class. The data read from thisXML drives different Activities of the application. Presently, I havecalled the ""parsing and the properties-initialization"" from theonCreate() of my Main Activity.</p><p>I have a few questions as regards this case/approach:</p><ol><li><p>Should I invoke the app initialization method from the ApplicationObject or is the current approach correct? What advantages/disadvantages do/would we get/have if I choose to invoke it from theApplication object?</p></li><li><p>Do we really need a static class to store app properties? Or can we have all the properties as a static Collection variable in the application object?</p></li><li><p>Parsing a XML(~200 nodes) at app load time might take some time(notsure how long tho); How can I avoid the dreaded ANRs? I am using aPull Parser.</p></li></ol><p>Please help me find answers to these questions.</p><p>Thank you. </p>","235881","","","","","2009-12-21 09:27:16","Android Application Initialization","<android>","2","0","1","",""
"1938971","1","","","2009-12-21 08:58:55","0","599","<p>I am pretty new to programming and just to try Andorid.I am trying to create an simple app that ask after a string from the user and after that I want my program to go out on the internet with the web-browser.</p><p>But I get 2 things wrong, one thing is my way to go on the internet but that I know I chose the wrong method, but the other thing is that findViewById(R.id. ) don't work, and I cant understand why..</p><p>My code (from <a href=""http://pastebay.com/77559"" rel=""nofollow"">http://pastebay.com/77559</a>):</p><pre><code>package team.ice.kth;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.webkit.WebView;import android.widget.Button;import android.widget.EditText;public class KTH extends Activity {	private Button mButton;	private EditText mClassInfo;	@Override	public void onCreate(Bundle savedInstanceState) {		super.onCreate(savedInstanceState);		setContentView(R.layout.main);		mClassInfo = (EditText) findViewById(R.id.ClassInfo);		final Button mButton = (Button) this.findViewById(R.id.OK_Button);		mButton.setOnClickListener(new View.OnClickListener() {			public void onClick(View v) {				onGoTo();			}			private void onGoTo() {				createUrl();			}			protected void createUrl() {				String Class = mClassInfo.getText().toString();				WebView webview = new WebView(this);				setContentView(webview);				webview.loadUrl(""http://schema.sys.kth.se/4DACTION/WebShowSearch/2/1-0?wv_type=5&amp;wv_category=0&amp;wv_ts=20091220T015342X7921&amp;wv_search="" + Class + ""&amp;wv_startWeek=935&amp;wv_stopWeek=951&amp;wv_first=0&amp;wv_addObj=&amp;wv_delObj=&amp;wv_obj1=19498000&amp;wv_graphic=Grafiskt+format"");			}		});	}}</code></pre><p>and my XML (from <a href=""http://pastebay.com/77560"" rel=""nofollow"">http://pastebay.com/77560</a>):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout xmlns:android=""http://schemas.android.com/apk/res/android""	android:id=""@+id/widget0""	android:layout_width=""fill_parent""	android:layout_height=""fill_parent"" &gt;	&lt;EditText		android:id=""@+id/class""		android:layout_width=""96px""		android:layout_height=""wrap_content""		android:textSize=""18sp""		android:layout_x=""120px""		android:layout_y=""43px"" /&gt;	&lt;TextView		android:id=""@+id/ClassInfo""		android:layout_width=""wrap_content""		android:layout_height=""wrap_content""		android:text=""Class:""		android:layout_x=""62px""		android:layout_y=""58px"" /&gt;	&lt;Button		android:id=""@+id/OK_Button""		android:layout_width=""47px""		android:layout_height=""39px""		android:text=""Sök""		android:layout_x=""237px""		android:layout_y=""52px"" /&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>Would appreciate so I cant get this ghost out of my head, my knowledge cant get me any further.</p>","232890","","76835","","2009-12-21 20:34:49","2009-12-21 20:34:49","Beginners problem","<android><internet>","3","2","","",""
"1939096","1","","","2009-12-21 09:27:24","0","1227","<p>i am very new in android development as well as in java. i had developed an application that gets an image url from a site and wanted to download it into the device and later on i would like to enable users to set it as wallpapers. however, i am met a problem when assigning onclick event to a button. Once i uncomment the line in red, it will pop up a box stating that the application was stopped unexpectedly. Can someone please help me with this?</p><pre><code>private ImageView imView = null;public void onCreate(Bundle icicle) {super.onCreate(icicle);setContentView(R.layout.main);try {/* Create a URL we want to load some xml-data from. */URL url = new URL(xmlURL);/* Get a SAXParser from the SAXPArserFactory. */SAXParserFactory spf = SAXParserFactory.newInstance();SAXParser sp = spf.newSAXParser();/* Get the XMLReader of the SAXParser we created. */XMLReader xr = sp.getXMLReader();/* Create a new ContentHandler and apply it to the XML-Reader */ExampleHandler myExampleHandler = new ExampleHandler();xr.setContentHandler(myExampleHandler);/* Parse the xml-data from our URL. */xr.parse(new InputSource(url.openStream()));/* Parsing has finished. *//* Our ExampleHandler now provides the parsed data to us. */ParsedExampleDataSet parsedExampleDataSet = myExampleHandler.getParsedData();/* Set the result to be displayed in our GUI. */if (myExampleHandler.filenames != null) {a = a + ""\n"" + myExampleHandler.filenames + "", by ""+ myExampleHandler.authors + ""\nhits: ""+ myExampleHandler.hits + "" downloads"";this.ed = myExampleHandler.thumbs;this.imageURL = myExampleHandler.mediafiles;}} catch (Exception e) {a = e.getMessage();}// get thumbnailContext context = this.getBaseContext();if (ed.length() != 0) {Drawable image = ImageOperations(context, this.ed, ""image.jpg"");ImageView imgView = new ImageView(context);imgView = (ImageView) findViewById(R.id.image1);imgView.setImageDrawable(image);}TextView tv = (TextView) findViewById(R.id.txt_name);tv.setText(a);Button bt3 = (Button) findViewById(R.id.get_imagebt);//bt3.setOnClickListener(getImageBtnOnClick);}OnClickListener getImageBtnOnClick = new OnClickListener() {public void onClick(View view) {downloadFile(imageURL);}};void downloadFile(String fileUrl) {    	URL myFileUrl = null;    	try {    		myFileUrl = new URL(fileUrl);    	} catch (MalformedURLException e) {    		// TODO Auto-generated catch block    		e.printStackTrace();    	}    	try {    		HttpURLConnection conn = (HttpURLConnection) myFileUrl    				.openConnection();    		conn.setDoInput(true);    		conn.connect();    		int length = conn.getContentLength();    		InputStream is = conn.getInputStream();    		bmImg = BitmapFactory.decodeStream(is);    		// this.imView.setImageBitmap(bmImg);    	} catch (IOException e) {    		// TODO Auto-generated catch block    		e.printStackTrace();    	}    }private Drawable ImageOperations(Context ctx, String url,    		String saveFilename) {    	try {    		InputStream is = (InputStream) this.fetch(url);    		Drawable d = Drawable.createFromStream(is, ""src"");    		return d;    	} catch (MalformedURLException e) {    		e.printStackTrace();    		return null;    	} catch (IOException e) {    		e.printStackTrace();    		return null;    	}    }public Object fetch(String address) throws MalformedURLException,		IOException {	URL url = new URL(address);	Object content = url.getContent();	return content;}</code></pre><p>Main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:id=""@+id/viewgroup""&gt;    &lt;ImageView android:id=""@+id/image1""    	android:layout_width=""wrap_content""    	android:layout_height=""wrap_content""    	android:layout_gravity=""center"" /&gt;    &lt;ImageView android:id=""@+id/image2""    	android:layout_width=""wrap_content""    	android:layout_height=""wrap_content""    	android:layout_gravity=""center"" /&gt;    &lt;TextView android:id=""@+id/txt_name""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:layout_gravity=""center_horizontal"" /&gt;    &lt;Button id=""@+id/get_imagebt""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""xxx Get an image""        android:layout_gravity=""center"" /&gt;      &lt;ImageView id=""@+id/imview""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""center"" /&gt; &lt;/LinearLayout&gt;</code></pre>","679696","","679696","","2009-12-28 05:56:36","2010-06-07 01:00:04","force close when assign onclick to button","<android><buttonclick>","2","6","","",""
"1939103","1","3138176","","2009-12-21 09:29:16","3","17947","<p>Can anyone help on how to use the matrix scaletype to zoom an imageview and also how to use the translate method so that it can be focused at the center? I have tried using webview to be able to use the zooming and scrolling functionalities i needed but it is not nice to look at.</p>","235885","","114066","","2010-03-29 10:29:43","2012-10-03 06:36:58","How to make my ImageView zoomable?","<android><zoom><imageview>","2","0","8","",""
"1939282","1","1941695","","2009-12-21 10:15:50","18","40138","<p>This question <a href=""http://stackoverflow.com/questions/1840231/open-source-examples-of-well-designed-android-applications"">here</a> lists some good links to general Android applications (that I'm already looking over) but I'm interested at the moment in specifically games (board-type, intelligent games rather than action - in other words, I don't need real-time).</p><p>What are the best sources for applications like that? I want to look over the source code to get myself up to speed quickly.</p><p>(Please don't just Google for results, I've already done that and the pickings are a little scarce. I'm interested in anyone who's actually taken time to find and evaluate good sites for this - so ideally, you'd already be an Android developer interested in developing games).</p>","14860","","","","","2011-08-29 16:20:52","Where can I find some good open source Android games to accelerate the learning process?","<android>","5","1","18","2011-08-29 22:11:47",""
"1939318","1","1940783","","2009-12-21 10:23:43","76","42057","<p>I am planning to develop an augmented reality application for Android phone. Does anyone know if there is any existing framework for augmented reality which could be used for such applications?</p>","22996","","322020","","2013-05-03 22:28:59","2013-12-17 15:35:42","augmented reality framework","<android><augmented-reality>","24","1","88","2014-03-31 12:42:51",""
"1939439","1","","","2009-12-21 10:54:34","1","1210","<p>i am able to save the source image but not able save the image with colorfilter<code>paint.setColorFilter(new ColorMatrixColorFilter(cm));</code></p><p>if this image is converted into bitmap it can be saved easily.but dunno how to do this. Is there anyone to give solution</p><p>thanks in advance</p>","203369","","89391","","2009-12-21 10:56:13","2010-02-06 18:00:14","how to convert a paint image to bitmap","<android><bitmapimage>","1","0","","",""
"1939554","1","1939598","","2009-12-21 11:23:59","0","1076","<p>I want to use mouse listener for table row, wants to use mouse button up and mouse button down button implementation.</p>","216431","","","","","2009-12-21 11:34:05","android table row mouse listener","<android><tablerow>","1","0","","",""
"1939671","1","","","2009-12-21 11:47:44","10","10316","<p>I am searching for a way to position my text around my imageview (solike the css float left/right).How can I do this in Android? I have usedandroid:layout_alignParentLeft=""true"" (to position my imageview left)and android:layout_alignParentRight=""true"" for my textview but thetextview comes next to the imageView and doesn't continue underneaththe ImageView when I have a long text..</p><p>Anyone an idea?</p><p>Wouter </p>","188119","","44390","","2012-05-10 18:53:23","2012-05-10 18:53:23","ImageView and TextView float (left/right) Android","<android><image><text><alignment>","4","0","","",""
"1939786","1","1940134","","2009-12-21 12:14:09","5","8319","<p>below is the peace of Code which is used to get view for the list item.I want to use different view for every row of listview how can i do it any good tutorial ???</p><pre><code>public View getView(int position, View convertView,    			ViewGroup parent) {     		View row=convertView;    		ResultWrapper wrapper;    		if (row==null) {		    			LayoutInflater inflater=getLayoutInflater();    			row=inflater.inflate(R.layout.result_row, null);    			wrapper=new ResultWrapper(row);    			row.setTag(wrapper);    		}    		else {    			wrapper=(ResultWrapper)row.getTag();    		}     		wrapper.populateFrom(model.get(position));    		wraperList.add(wrapper);    		return(row);    	}    }</code></pre>","216431","","","","","2014-04-17 06:09:56","android listview different views for every item","<android><listview>","2","0","8","",""
"1939850","1","1940257","","2009-12-21 12:30:13","0","227","<p>For instance, let's take <code>android.permission.GET_PACKAGE_SIZE</code>.<br>Searching for this string in Android 1.6 *.xml source files only points to a single application that uses it, <code>frameworks\base\tests\AndroidTests</code>.<br>So the next step is to search through the .java files in a hope that I'll eventually find the code that might look like it queries for a package size.  </p><p>Is this the supposed way of discovering permission use?</p>","15187","","","","","2009-12-21 22:18:21","How do I figure out what code will user a given permission?","<android>","3","0","","",""
"1940117","1","1941210","","2009-12-21 13:32:27","20","23102","<p>How can I create a list where I can rearrange list items with dragginglist rows to another row and so on (to change to order)?</p><p>Just like on the HTC Hero in the clocks app where you can rearrangethe order of clocks?</p><p>Wouter </p>","188119","","168225","","2010-05-16 22:29:18","2012-07-10 10:45:14","Android - drag and drop - list rearrange","<android><multithreading><list><drag-and-drop>","5","0","25","",""
"1940872","1","1941399","","2009-12-21 15:51:16","0","4726","<p>Hello all I am a new android developer and I am currently making an application to communicate with <a href=""http://en.wikipedia.org/wiki/Session%5FInitiation%5FProtocol"" rel=""nofollow"">SIP</a>. I would like to set a background task to do all the SIP related tasks and, if possible, let it begin when the phone is started. My current thoughts are creating a <code>Service</code> and letting it start on the device boot, the problem is that there are two kind of <code>Services</code> one that uses <a href=""http://developer.android.com/guide/developing/tools/aidl.html"" rel=""nofollow"">AIDL</a> and one that is started with an <code>Intent</code>. </p><p>I would like to pass some arguments to my service and let it run independently of my main <code>Activity</code> and be able to notify my main <code>Activity</code> of incoming messages. Can anybody tell me how to do that and point me to any good tutorial where I can understand the difference between the two <code>Service</code>s? I have read a book about and some tutorials including Android Developers, but they confused me even more. </p><p>Thanks in advanced, maxsap.</p>","234898","","76835","","2009-12-21 20:05:34","2009-12-21 20:05:34","android Service explanation","<android><service>","2","0","2","",""
"1941645","1","","","2009-12-21 18:02:23","1","554","<p>My Android application has to, at some point, switch to landscape mode with no enunciator bar to display a screen that takes up the full display hight and width.  I do this by calling setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)and by calling ""setFlags"" on the Window object passing in ""WindowManager.LayoutParams.FLAG_FULLSCREEN""</p><p>When I return to portrait mode and recover the enunciator bar using setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) and setting the flag ""WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN"" and ""WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR"" my layout object's origin (0,0) is now <em>under</em> the enunciator.  So the first 15 or so pixels of my application view are covered over by the enunciator/cell signal/battery bar.</p><p>Has anyone else seen this problem?  Is there a flag that I'm missing that will recover portrat/non-fullscreen without pushing my application up into the top bar?</p>","62516","","62516","","2010-04-15 17:16:27","2011-02-08 17:03:44","enunciator/notification bar conflicting with a custom view?","<android>","1","2","","",""
"1941653","1","","","2009-12-21 18:03:52","1","1643","<p>Is it possible to create an application with a transparent backgroundon the root task such that you can see the task running beneath itwhen it is part of a separate stack? Alternatively, is it possible torun an application so the window of the root task is only a portion ofthe screen instead of the whole screen?</p><p>I understand how the transparency and window sizing is done withactivities that are not the root task and this works fine. However,the root task of an activity seems to always fill the whole screen andbe black even when a transparent theme is applied to the applicationobject in the manifest file.</p><p>ApplicationManifest.xml:</p><p><code>&lt;application android:icon=""@drawable/icon""                       android:label=""@string/app_name""                       android:debuggable=""true""                       android:theme=""@style/Theme.Transparent""&gt;</code>   </p><p>Styles.xml</p><p><code>    &lt;resources&gt; &lt;style name=""Theme.Transparent""&gt;       &lt;item name=""android:windowIsTranslucent""&gt;true&lt;/item&gt;       &lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;       &lt;item name=""android:windowBackground""&gt;@drawable/transparent_background&lt;/item&gt;       &lt;item name=""android:windowAnimationStyle""&gt;@android:style/Animation.Translucent&lt;/item&gt;       &lt;item name=""android:colorForeground""&gt;#fff&lt;/item&gt;       &lt;item name=""android:windowIsFloating""&gt;true&lt;/item&gt;               &lt;item name=""android:gravity""&gt;bottom&lt;/item&gt; &lt;/style&gt;&lt;/resources&gt;</code></p><p>Colors.xml</p><p><code>&lt;resources&gt;  &lt;drawable name=""transparent_background""&gt;#00000000&lt;/drawable&gt;&lt;/resources&gt;</code></p>","236236","","236236","","2009-12-21 18:08:28","2010-04-30 19:00:04","Android application transparency and window sizing at root level","<java><android>","1","0","","",""
"1942101","1","1942356","","2009-12-21 19:29:35","2","6366","<p>I was interested in developing a clock widget for the homescreen and upon reading <a href=""http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html"" rel=""nofollow"">Home Screen Widgets tutorial</a>, I wondered if there is a pre-existing <code>Service</code> I could reference for updating the current time rather than re-inventing the wheel?</p><p>I download the <em>Retro Clock</em> application on my android phone and noticed that when I click it, it pops up the Alarm Clock settings, but with the default Google <em>Analog Clock</em> widget, upon click does nothing.</p><p>Is that because the <em>Retro Clock</em> widget implements the Alarm Clock service? If so, how can I go about referencing that service? Or do I have this all wrong and misunderstood?</p><p>Any help is appreciated.</p><h3>EDIT:</h3><p>I believe implementing the service to update the clock would drain the battery life tremendously, any ideas on a work around or help shed some light on any performance issues with using <code>Service</code>? </p>","166712","","166712","","2010-06-13 15:14:43","2013-04-22 20:43:02","Android: Custom Clock widget Service work-around?","<android><widget><code-reuse>","3","0","2","",""
"1942104","1","","","2009-12-21 19:30:04","9","3477","<p>I am currently working on a project which requires me to use an XML document to render a form on an Android device. The form must be fetched and displayed at run-time. I am wondering if there is a way to tag the form XML, transform it using XSLT into an Android layout XML, and then have the device render it.</p>","127189","","","","","2012-03-22 17:38:15","Building/using runtime generated layout XML in Android","<xml><android><layout>","3","1","4","",""
"1942195","1","1942202","","2009-12-21 19:47:41","1","611","<p>Do i need to install the Android SDK before installing Eclipse?</p><p>Or must i install Eclipse before installing the Android SDK?</p><p>i'm worried that one has knowledge of the other, the order of installs is important, and installing the two out of order could lead to problems.</p><p>Does the Android SDK installer know about Eclipse, and registers itself with Eclipse?</p>","12597","","","","","2012-12-18 08:20:21","Do i need to install the Android SDK before installing Eclipse?","<android>","4","1","","",""
"1942236","1","","","2009-12-21 19:55:29","0","873","<p>I am trying to create a Helper class to display Toasts in my android app, as follows.</p><p>public class ToastHelper{</p><pre><code>final static Toast toastAlert(String msg) {	LayoutInflater inflater = LayoutInflater.from(Main.self.getApplicationContext());	View layout = inflater.inflate(R.layout.toast_layout, (ViewGroup) findViewById(R.id.toast_layout_root));	TextView tv = (TextView)layout.findViewById(R.id.toast_text);	tv.setText(msg);	Toast toast = new Toast(Main.self.getApplicationContext());	toast.setDuration(Toast.LENGTH_SHORT);	toast.setView(layout);	return toast;}</code></pre><p>}</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""          android:id=""@+id/toast_layout_root""          android:orientation=""horizontal""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          android:padding=""10dip""          android:background=""#FFF""          &gt;&lt;TextView android:id=""@+id/toast_text""          android:layout_width=""wrap_content""          android:layout_height=""fill_parent""          android:textColor=""#000""          /&gt;</code></pre><p></p><p>My code is based on the example at: <a href=""http://developer.android.com/guide/topics/ui/notifiers/toasts.html"" rel=""nofollow"">http://developer.android.com/guide/topics/ui/notifiers/toasts.html</a></p><p>My problem is, when I try to inflate the view, I can't call findViewById without the View from the activity I am calling toastAlert in. Is there a way I can access that view?</p>","236300","","","","","2012-11-22 13:47:48","android Toast and View help","<java><android>","2","0","","",""
"1942421","1","1942525","","2009-12-21 20:28:06","14","8948","<p>What does the <strong>setTextFilterEnabled()</strong> method do?</p>","226582","","114066","","2010-03-04 08:57:26","2012-03-14 13:31:58","Android: what does ""setTextFilterEnabled"" method do?","<java><android><listview>","3","2","6","",""
"1942600","1","2926081","","2009-12-21 21:00:29","3","10144","<p>I open my context menu like this:</p><pre><code> private OnClickListener optionsClickListener = new OnClickListener() {  public void onClick( View v )  {    registerForContextMenu( v );    openContextMenu( v );  } };</code></pre><p>How can I call</p><pre><code>registerForContextMenu( v );openContextMenu( v );</code></pre><p>from inside my regular menu handler here:</p><pre><code> public boolean onOptionsItemSelected( MenuItem item ) {  switch( item.getItemId() )  {    case OPTIONS:      registerForContextMenu( v );      openContextMenu( v );      return true;</code></pre><p>where I have no View to pass?</p>","236353","","","","","2012-03-28 11:50:53","how to call context menu","<android>","3","4","1","",""
"1942730","1","1943014","","2009-12-21 21:28:56","1","406","<p>I have an application that needs to send messages, repeatedly to the server. I'm currently using AJAX from the phone's browser and it works fairly reliably, but, as with all things cell-phone, not 100%.  I'm curious if using Android and opening a socket to the server would give me any additional reliability, or if it would suffer from the same communication troubles that hinder the AJAX transmission. </p><p>all thoughts appreciated.</p>","59947","","","","","2009-12-21 22:20:48","Is Android more reliable than AJAX for phone/server communication?","<android><ajax>","2","0","","",""
"1942806","1","","","2009-12-21 21:41:06","0","739","<p>Can you please tell me where I can find the Android.mk file for Executable: accRuntimeTest?</p><p>I am getting the following error when I compile android source on ubuntu 9.10. I think it misses a linker flag to link a library 'dlsym', I just don't know where is the Android.mk file I should go and fix it?</p><pre><code>Install: out/target/product/generic/system/usr/keychars/qwerty.kcm.binInstall: out/target/product/generic/system/usr/keychars/qwerty2.kcm.binInstall: out/target/product/generic/system/usr/keychars/tuttle2.kcm.binCopy: out/target/product/generic/system/etc/apns-conf.xmlhost Executable: accRuntimeTest (out/host/linux-x86/obj/EXECUTABLES/accRuntimeTest_intermediates/accRuntimeTest)host Executable: acc (out/host/linux-x86/obj/EXECUTABLES/acc_intermediates/acc)/usr/bin/ld: out/host/linux-x86/obj/EXECUTABLES/accRuntimeTest_intermediates/runtimeTest.o: in function symbolLookup(void*, char const*):system/core/libacc/tests/runtimeTest.cpp:66: error: undefined reference to 'dlsym'collect2: ld returned 1 exit statusmake: *** [out/host/linux-x86/obj/EXECUTABLES/accRuntimeTest_intermediates/accRuntimeTest] Error 1make: *** Waiting for unfinished jobs....</code></pre>","128983","","","","","2011-02-18 08:28:51","Android.mk file for Executable: accRuntimeTest","<android>","1","0","","",""
"1943035","1","","","2009-12-21 22:25:15","0","141","<p>I need to use various words but it seems that Android plays nanny and says that they are misspelled in XML.  </p><pre><code>&lt;string name=""oiseau""&gt;oiseau&lt;/string&gt;</code></pre><p>How do I override this function?  TIA.</p>","236414","","33708","","2009-12-21 22:28:27","2009-12-22 00:35:00","Android claims that I have mispelled something in XML","<xml><android>","1","1","","",""
"1943146","1","1943267","","2009-12-21 22:48:21","0","193","<p>this is the scenario: 1 user has a main activity used for ui. 2 programm needs to communicate with peers and keep connection and wait for messages 3 when a message comes it is shown in the main acivity.</p><p>so the question is should I use a service for the communication and what type of service?and also should I use AsyncTask in the service in order to keep my ui responcive and why?thanks maxsap</p>","234898","","","","","2009-12-21 23:20:04","Android backround work scenario","<android><service>","1","0","","",""
"1943533","1","","","2009-12-22 00:36:50","2","811","<p>I'm using the UI test monkey tool provided with android. This is a consistent error I see and wonder how I can avoid it.</p><p>Somehow the test app will rotate the orientation of my app such that the emulator window is still in portrait orientation, but the screen surface is in a landscape orientation. When in this configuration, any time you click on an EditText, a system exception gets thrown:</p><blockquote>  <p>""The application OpenWnn (process jp.co.omronsoft.openwnn) has stopped unexpectedly. Please try again.""</p></blockquote><p>so this OpenWnn process is not mine, it looks like it handles display of the virtual keyboard. When in this odd orientation mode, and you try to click in an EditText, I can see the virtual keyboard try to slide in from the left side of the screen, then that exception gets thrown.</p><p>I'm not sure what orientation this is, because it's not the normal landscape orientation you get by hitting ctrl + F11. In fact, the virtual keyboard shouldn't even be trying to display itself in landscape mode? Much less from the left side of the emulator? Anyone else experience this?</p><p>ThanksC</p>","185329","","","","","2011-05-25 15:15:22","Consistent system bug while using UI test monkey app","<android>","2","0","","",""
"1943679","1","5418681","","2009-12-22 01:26:24","4","3539","<pre><code>ComponentName componentName = new ComponentName(""com.android.calendar"",        ""com.android.calendar.LaunchActivity"");if (componentName != null) {    Intent intent = new Intent(android.content.Intent.ACTION_VIEW);    // com.android.providers.calendar.CalendarProvider    intent.setFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);    intent.setComponent(componentName);    startActivity(intent);} else {    Log.i("""", ""98979"");}</code></pre><p>LogCat returns the following error:</p><blockquote>  <p>ERROR/AndroidRuntime(601): Caused by: android.content.ActivityNotFoundException:<br>  Unable to find explicit activity class <code>{com.android.calendar/com.android.calendar.LaunchActivity}</code>;<br>  have you declared this activity in your AndroidManifest.xml?</p></blockquote><p>What is the new calendar address or package?</p>","233618","","154306","","2010-08-12 14:08:29","2014-02-18 16:51:26","android calendar","<android><calendar>","3","1","1","","2009-12-22 01:27:45"
"1943746","1","1943786","","2009-12-22 01:46:45","8","7266","<p>I just installed the latest galileo eclipse release.  I added thelatest adt plugin and configured it to use my android sdk (r4).Unfortunately, the eclipse plugin is wiggin out.  for some reason, itcan't find(execute?) the android tools.  I get this error on theeclipse project:</p><blockquote>  <p>Error executing aapt. Please check aapt is present at   ~/android-sdk-linux_86/platforms/android-1.6/tools/aapt</p></blockquote><p>but here is the output of ls:</p><pre><code>ls -al ~/android-sdk-linux_86/platforms/android-1.6/tools/aapt-rwxrwxrwx 1 solid solid 3416259 2009-12-18 21:02 /home/solid/android-sdk-linux_86/platforms/android-1.6/tools/aapt</code></pre><p>When I try running the program directly, I see the following:</p><pre><code>~/android-sdk-linux_86/platforms/android-1.6/tools/aaptbash: /home/solid/android-sdk-linux_86/platforms/android-1.6/tools/aapt: No such file or directory</code></pre><p>I just unzipped the sdk and installed the platforms and <code>ls</code>'d it so I know it is there.</p><p>I have tried recreating the project from the command line (whichworks) but when I import it into eclipse I get the same error.</p><p>BTW this is linux amd 64 </p>","236502","","2117389","","2013-04-29 04:18:27","2013-04-29 04:18:27","android eclipse plugin can't find valid paths","<android>","1","0","3","",""
"1944102","1","1950116","","2009-12-22 04:04:25","11","16296","<p>I'm trying to write a simple application that attempts to receive SMS messages and handle them. I've followed several tutorials but I'm getting nowhere, when I send a SMS to the emulator, the Intent never seems to get fired.</p><p>Here is my intent:</p><pre><code>package com.neocodenetworks.smsfwd;import android.content.*;import android.os.Bundle;import android.telephony.*;import android.util.Log;public class SmsReciever extends BroadcastReceiver {    private static final String SMS_RECEIVED = ""android.provider.Telephony.SMS_RECEIVED"";    private static final String TAG = ""smsfwd"";    @Override    public void onReceive(Context context, Intent intent) {        Log.i(TAG, ""Intent recieved: "" + intent.getAction());        if (intent.getAction() == SMS_RECEIVED) {            Bundle bundle = intent.getExtras();            if (bundle != null) {                Object[] pdus = (Object[])bundle.get(""pdus"");                final SmsMessage[] messages = new SmsMessage[pdus.length];                for (int i = 0; i &lt; pdus.length; i++) {                    messages[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                }                if (messages.length &gt; -1) {                    Log.i(TAG, ""Message recieved: "" + messages[0].getMessageBody());                    NetComm.SendMessage(""me"", messages[0].getOriginatingAddress(), messages[0].getMessageBody());                }            }        }    }}</code></pre><p>and here is my AndroidManifest.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""        package=""com.neocodenetworks.smsfwd""        android:versionCode=""1""        android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;        &lt;receiver android:name="".SmsReciever""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.provider.telephony.SMS_RECIEVED""&gt;&lt;/action&gt;            &lt;/intent-filter&gt;        &lt;/receiver&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""6"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.RECEIVE_SMS""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt;</code></pre><p>I'd really appreciate some guidance with what's going wrong. I'm just getting into Android development but I think I have my head wrapped around (most of) it. While monitoring the emulator's logcat, the log events never come up, and debugging breakpoints are never hit, so I have a feeling it's somewhere in my intent filter.</p><p>I'm running this on Android 2.0.1.</p>","151495","","","","","2012-03-28 15:07:05","Android SMS receiver not working","<android><sms><broadcastreceiver><intentfilter>","5","2","7","2012-03-28 15:07:28",""
"1944117","1","1946034","","2009-12-22 04:09:02","35","15081","<p>In my app, I'd like to use the camera, if the device has one. Are there any devices running android that <em>do not</em> have a camera? By including the following into my manifest:</p><pre><code>&lt;uses-feature android:name=""android.hardware.camera"" android:required=""false""/&gt;</code></pre><p>then it's basically saying ""I'll use a camera if one exists, but don't need one to run the app"". </p><p>How could I check if a camera exists on the device, before attempting to use the Camera class?</p>","185329","","41688","","2012-12-20 23:00:26","2012-12-20 23:00:26","Check if device has a camera?","<android><android-camera>","4","2","10","",""
"1944288","1","1949818","","2009-12-22 05:15:56","1","2640","<p>I want to create the following layout:</p><ol><li>Section '1' is a <code>LinearLayout</code> which contains an <code>ImageView</code> and a <code>TextView</code></li><li>Section '2' is a <code>ListView</code> with customized row layouts.</li></ol><p>I want to place both components under a single vertical <code>ScrollBar</code>, meaning I don't want the <code>ScrollBar</code> only for the <code>ListView</code>. Currently I'm achieving the following layout through placing things in a <code>TableView</code> but I want functionality like <code>ListView</code> items.</p><p><img src=""http://img8.imageshack.us/img8/5386/detaili.jpg"" alt=""alt text""></p>","216431","","493939","","2012-05-17 13:00:28","2012-05-17 13:00:28","ListView and LineraLayout under one ScrollBar","<android><android-layout><android-listview>","2","0","","",""
"1944318","1","1960749","","2009-12-22 05:25:44","0","806","<p>I have a need to create a control similar to UITabBar in iPhone, which is to be present on every activity of my application. UITabBar essentially is a battery of buttons exhibiting a TAB like behavior: every button maps to an activity. I have two solutions for this:<br>1. In the layout XML for every activity, I insert a <code>&lt;LinearLayout&gt;&lt;Button/&gt;&lt;Button/&gt;&lt;Button/&gt;&lt;/LinearLayout&gt;</code> element. And then have a common listener class that will handle the button clicks. So, every activity will have an instance of this listener.<br>2. To create a custom Widget extending LinearLayout class, put all the buttons as its static members and let it handle the button clicks. Include this custom control in every screen.</p><p><strong>I am not sure which approach to follow. Please advice. Alternatives also appreciated</strong> </p><p><strong>Following is what I think about this:<br>The problem with first approach:</strong><br>1. it will generate a lot of boiler plate code(findViewByIds, setOnClickListener etc.)<br>2. Assuming that there are 5 activities and 3 tab buttons, total number of Button objects created at Runtime will be 5 x 3 = 15</p><p><strong>I'd like to take the 2nd approach because:</strong><br>1. All the code(state and behavior) will be encapsulated by the widget class. Less Boilerplate code.<br>2. Since, the buttons will be static members, the total number of Button objects created at Runtime will be only three. Though, the static members will remain in memory for a longer time(until JVM unloads the class), since the control is present on every screen I think this can be excused.</p><p>Thanks.</p>","236128","","","","","2009-12-25 08:05:22","Creating a custom control or making buttons inline","<android>","2","0","","",""
"1944369","1","1944564","","2009-12-22 05:44:12","31","10068","<p>I am creating event search application, we set search criteria from one screen populate in another screen then user can edit search criteria from 3rd screen and goes to 4th screen.</p><p>To achieve above task i am using static object which remember the values around the application and i don't need to do any thing extra.</p><p>But i am afraid if about static object life cycle in android if low memory found android delete static objects ???</p><p>As android supports multi tasking, if user switches to another application and when user comes back application start acting crazy, does static object get removed when it multi task ??? any idea ?? and also suggest holding static object via singleton method is better approach ???</p>","216431","","","","","2009-12-22 10:24:06","Android static object lifecycle (Application act crazy)","<android><static>","2","0","24","",""
"1944539","1","1944585","","2009-12-22 06:39:32","0","596","<p>When I are using Java we put System.out.println() for identifying errors, where it went wrong.</p><p>A very naive method.</p><p>With android, I cannot even use this method to isolate why the app crashed.</p><p>With Rails we would read the log file.</p><p>But as I am new to Java and android, I don't know which is the best practice.I believe there is a best practice, but I don't know what it is, and I couldn't formulate a good query to google around.</p><p>Pls help me, error check android.</p>","132347","","","","","2009-12-22 20:08:24","How to identify why android app crashed","<java><android><error-handling>","4","0","","",""
"1944656","1","1945297","","2009-12-22 07:12:25","79","63578","<p>How can I create global variable keep remain values around the life cycle of the application regardless which activity running..</p>","216431","","5555","","2009-12-22 07:59:11","2014-01-23 06:25:30","Android global variable","<android><global-variables>","8","0","32","",""
"1944961","1","5227385","","2009-12-22 08:36:37","12","17761","<p>There are no controls in Android that provide Tree-like View. There is an ExpandableList View which I suspect could be used to creating one.</p><p>Have you tried imlpementing such a control?How would one implement such a control in Android?</p>","236128","","","","","2014-01-06 08:00:19","How to create a tree view in Android?","<android>","3","2","4","",""
"1944966","1","","","2009-12-22 08:37:38","0","3929","<p>At the moment I am using two intents. One for voice-recording, another for the camera:</p><pre><code>Intent photoIntent = new Intent(""android.media.action.IMAGE_CAPTURE"");startActivityForResult(photoIntent, ACTIVITY_TAKE_PHOTO);Intent voiceIntent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);startActivityForResult(voiceIntent, ACTIVITY_RECORD_SOUND);</code></pre><p>My aim is to put an Extra to each of those which contains the path where to store the picture / the recorded Voice. Is there an option to do so?</p>","209902","","","","","2009-12-22 21:47:21","Android Intent Save Path","<android><camera><android-intent><recorder>","3","0","","",""
"1945002","1","","","2009-12-22 08:45:01","5","7612","<p>In my application, when I click on an EditText view, the virtual keyboard obscures the view, so I can't see my edits. How can I resolve this programatically?</p>","164460","","13121","","2011-04-03 12:58:15","2012-07-26 10:46:30","Android keyboard obscures EditText","<android><scrollbar><edittext>","3","0","1","",""
"1945142","1","1948583","","2009-12-22 09:20:10","27","22038","<p>I have a few questions regarding Bitmap objects and memory and their general taxonomy.</p><ol><li>What is an in-memory or native bitmap?</li><li>How is Bitmap memory different from Heap memory?</li></ol>","236128","","","","","2013-12-18 10:39:34","Bitmaps in Android","<android><bitmap>","4","0","24","",""
"1945183","1","1946624","","2009-12-22 09:28:19","1","607","<p>I am creating an augmented reality application and I noticed that the stored locations don't appear appear on the correct direction if I try to use the camera view (using layar or wikitude API).The problem is that the digital compass doesn't show north correctly when you try to look at the known objects through the camera view. If align the phone with the ground (look at my shoes) the locations appear at the screen according to heading rotation.</p><p>So I guess the compass should be aligned with roll when used in portrait mode or with pitch in landscape mode.</p><p>Anyway I would be thankful if anyone of you could share the possible solution for the described issue.</p>","22996","","","","","2009-12-22 14:17:22","digital compass problem","<android><augmented-reality>","1","0","","",""
"1945201","1","","","2009-12-22 09:32:12","94","62732","<p>How can I cache images after they are downloaded from web?</p>","216431","","3381","","2011-09-20 17:09:18","2014-01-01 19:10:44","Android image caching","<android><image><caching>","16","1","91","",""
"1945336","1","1949572","","2009-12-22 09:57:42","18","35724","<p>Do you know how to set <code>Content-Type</code> on <a href=""http://developer.android.com/reference/java/net/HttpURLConnection.html"">HttpURLConnection</a>?</p><p>Following code is on Blackberry and I want the Android equivalent:</p><pre><code>connection.setRequestProperty(""content-type"", ""text/plain; charset=utf-8"");connection.setRequestProperty(""Host"", ""192.168.1.36""); connection.setRequestProperty(""Expect"", ""100-continue"");</code></pre><p>Is it right for android?</p><p>Please advise.</p>","227889","","76835","","2009-12-22 22:07:59","2009-12-22 22:25:59","How to set Content Type on HttpURLConnection?","<android><httpurlconnection>","2","1","7","",""
"1945477","1","1950517","","2009-12-22 10:24:51","6","3270","<p>I have a TextView inside a ScrollView. Let's say the ScrollView is named <code>s</code> and the TextView is named <code>t</code>.</p><p>I have many lines to be displayed in the TextView and at the same time I want to scroll the view to a specific line. </p><p>So I did this:</p><pre><code>t.setText(aVeryLongString);int y = t.getLayout().getLineTop(40); // e.g. I want to scroll to line 40s.scrollTo(0, y);</code></pre><p>But it won't scroll, <strong>except</strong> the second time. It seems that on the first time the code finishes, the ScrollView knows how much the total height of the TextView is. </p><p>So I think there must be something to force calculating the needed height before the scrollTo call. How to do that (or otherwise)?</p>","11238","","","","","2011-01-10 17:06:03","Scrolling a TextView to a specific line","<android><scrolling><textview>","1","2","2","",""
"1946480","1","1946969","","2009-12-22 13:50:12","0","1250","<p>Accoding to emulator Resolution how to change the activity(Screen) controls size according to screen Resolution in android ?</p><p>i have screen design like below</p><p>      </p><p>    </p><p>it is working in HVGA(320x480) resolution progressbar is coming bottom of screen  but if i run in other resolution emulator VM (WQVGA432 - 240x432) i am getting the progressbar middle of the screen .</p><p>i am not able to fix the in permenent(fixed) position</p><p>i am using below code in manifest file but no output</p><p>                    android:normalScreens=""true""                     android:largeScreens=""true""<br>                    android:anyDensity=""true"" /></p><p>i am not getting the solution so please give some idea for resolve the issue.</p><p>Regards,Jeyavel N</p>","212809","","","","","2010-01-25 01:00:05","Accoding to emulator Resolution how to change the activity(Screen) controls size according to screen Resolution in android?","<android>","3","0","","",""
"1947334","1","","","2009-12-22 16:07:05","0","245","<p>I'm still learning how to use the dev tools.  Using MotoDev which is Eclipse, I wrote a basic ""hello world"" app.  When I run the program, the emulator starts up.  It took a few restarts of the emulator and Eclipse until my Hello World icon appear in the emulator.  I noticed at one point that a status message said it was sending over the .apl file, which is when my app finally appeared in the emulator.  I made changes to my code (Hello to Goodbye) and now..I can't figure out how to ""send"" to changed app to the emulator.  The original app is not being replaced with the changes. What do I need to be doing to reload the changed application on to the Android emulator?  Thanks</p>","236978","","234938","","2009-12-30 02:23:52","2009-12-30 02:23:52","Emulator - Loading App","<android><emulator>","1","0","","",""
"1947933","1","1948187","","2009-12-22 17:30:08","50","81974","<p>Is it be possible in the Android <a href=""http://developer.android.com/resources/tutorials/views/hello-spinner.html"">Hello, Spinner</a> example to get the selected Spinner value with a listener, like for the other examples -- or do you need to subclass Spinner?</p>","51593","","","","","2013-12-18 21:36:55","How to get Spinner value?","<android><spinner>","4","0","10","",""
"1948222","1","1948448","","2009-12-22 18:20:40","6","4152","<p>I'm a newbie Android developer. I would like to know if there exists a way to listen for a custom exception in Android and display its text using an alert. Thank you.</p>","237076","","","","","2011-05-05 14:44:02","Is there a way to display a custom exception in an alert under Android?","<android><gui><exception><alert>","2","0","2","",""
"1948706","1","1948762","","2009-12-22 19:50:18","0","2007","<p>I am having issue with memory after running many times my app. </p><p><b>java.lang.OutOfMemoryError: bitmap size exceeds VM budget</b></p><p>I figure I was leaking memory somehow so I did a DUMP HPROF file and used the MAT tool to figure out what was wrong.It turns out that after running like 5 times the app and quiting, I find 5 instances of my Activity and 5 instances of PhoneStateListener.</p><p>If I remove the call to PhoneStateListener, I don't have that issue anymore and I see just 1 instance of my Activity.</p><p>The question is, how do I resolve this?</p><p>Thanks</p><p>Daniel</p><hr><p>Here is my code:</p><p>OnCreate method: </p><pre><code>telephonyManager.listen(mPhoneListener,                PhoneStateListener.LISTEN_SERVICE_STATE                | PhoneStateListener.LISTEN_SIGNAL_STRENGTH                | PhoneStateListener.LISTEN_CALL_STATE                | PhoneStateListener.LISTEN_DATA_CONNECTION_STATE                | PhoneStateListener.LISTEN_DATA_ACTIVITY); </code></pre><p>on the Activity class:</p><pre><code>PhoneStateListener mPhoneListener = new PhoneStateListener() {        public void onCallStateChanged(int state,                java.lang.String incomingNumber) {        //do something    }}</code></pre><p>on onDestroy method:</p><pre><code>telephonyManager.listen(mPhoneListener, PhoneStateListener.LISTEN_NONE);        mPhoneListener = null;</code></pre>","237115","","857361","","2012-07-26 10:09:46","2012-07-26 10:09:46","PhoneStateListener memory leak - android","<android><memory><phone-state-listener>","3","0","1","",""
"1949066","1","1949449","","2009-12-22 20:51:31","116","94212","<p>I developed an application that uses lots of images on Android.</p><p>The app runs once, fills the information on the screen (<code>Layouts</code>, <code>Listviews</code>, <code>Textviews</code>, <code>ImageViews</code>, etc) and user reads the information.</p><p>There is no animation, no special effects or anything that can fill the memory.Sometimes the drawables can change. Some are android resources and some are files saved in a folder in the SDCARD.</p><p>Then the user quits (the <code>onDestroy</code> method is executed and app stays in memory by the VM ) and then at some point the user enters again. </p><p>Each time the user enters to the app, I can see the memory growing more and more until user gets the <code>java.lang.OutOfMemoryError</code>.</p><p>So what is the best/correct way to handle many images?</p><p>Should I put them in static methods so they are not loaded all the time?Do I have to clean the layout or the images used in the layout in a special way?</p>","237115","","1288","","2011-06-13 11:05:58","2014-01-22 12:09:27","java.lang.OutOfMemoryError: bitmap size exceeds VM budget - Android","<android><memory><memory-leaks><leak>","13","1","69","",""
"1949116","1","1949146","","2009-12-22 21:01:28","1","283","<p>I can see keys on the device fire for a particular View with onKey, but this doesn't fire when keys on the software keyboard are pressed.</p><p>I am trying to build a dynamic UI that recalculates a value as the input changes, while it's changing. Is there a way to capture either that the value of the EditText has changed?</p>","164980","","","","","2009-12-22 21:14:30","Is there a way to fire an event when the contents of an EditText view have changed?","<android><gui><user-interface>","2","0","","",""
"1949467","1","1949496","","2009-12-22 21:59:07","14","4529","<p>Is anyone aware of any projects out there to port a version of the .NET framework to the Android platform, kind of like <a href=""http://monotouch.net/"" rel=""nofollow"">Mono.Touch</a>?</p>","91671","","13531","","2009-12-24 15:43:41","2010-06-22 17:12:58",".NET Framework on Android","<c#><.net><android><mobile><cross-compiling>","4","0","9","",""
"1949690","1","","","2009-12-22 22:41:35","3","965","<p>We are running into some odd issues with streaming certain files in our app. After lots and lots of testing we've narrowed it down to what seems like some sort of issue between lighttpd and Droid, and it's not just our app but the built in player as well.</p><p>If you point the Droid browser to <a href=""http://stream29l.grooveshark.com/collinSong.mp3"" rel=""nofollow"">http://stream29l.grooveshark.com/collinSong.mp3</a> it does not work. The same file hosted on Apache at <a href=""http://staging.api.grooveshark.com/collinSong.mp3"" rel=""nofollow"">http://staging.api.grooveshark.com/collinSong.mp3</a> streams perfectly. The files are identical. Both URLs work on other phones running 1.5 and 1.6, and on the emulator running 2.0.1.</p><p>The lighttpd URL fails whether playing over wifi or over 3G.</p><p>My guess is that there's something funky going on at the network level that Droid is not tolerant of, but I'm at the end of what I can debug. Any ideas?</p><p><strong>UPDATE:</strong> I installed lighttpd on my laptop running CentOS and set it up to serve those same files (sorry, not accessible to the outside world) and the Droid can serve them fine. It's got to be a specific configuration issue with our server, or a difference in lighttpd versions. Right now my laptop is running 1.4.22 and our production server is running 1.5.0. Our production server also has the following configs set that gave me problems setting on my laptop (note: I may be missing modules, etc):</p><pre><code>server.max-fds = 7000server.network-backend = ""gthread-aio""server.stat-cache-engine = ""fam""</code></pre><p>the server also has these additional modules installed:</p><pre><code>                            ""mod_proxy_core"",                            ""mod_proxy_backend_http"",                            ""mod_proxy_backend_fastcgi"",</code></pre><p>I'm going to try getting modules and configs to match 100% and see if that reproduces the problem tomorrow. If not, I'll try upgrading my laptop to 1.5.0 and see if that does it.</p><p>In the meantime, does anyone <em>know</em> of issues related to the above configs?</p><p><strong>UPDATE 2:</strong>I upgraded to 1.5.0 on my laptop, streaming collinSong.mp3 still worked.Adding:    server.network-backend = ""gthread-aio""did not break streaming.However this line did:    server.stat-cache-engine = ""fam""</p><p>Commenting out the above line makes streaming work from my laptop, and having it enabled makes it not work. I actually got our admin to remove that line from the config and restart lighty (he said we didn't need that setting anyway), but the problem persists.</p><p>So next I tried leaving stat-cache-engine commented out on my laptop and adding these lines:                                ""mod_proxy_core"",                                ""mod_proxy_backend_http"",                                ""mod_proxy_backend_fastcgi""Once again streaming on my laptop broke after enabling these, and works when I turn them off. Unfortunately, these are apparently needed for the threading model we are using on the server, so I can't experiment with turning them off in production. I don't know if this gives any sort of clues to anyone else, but it's all I have.</p><p>I'd love to get in touch with a developer at Motorola because it seems to be a bug with the platform; works fine on other android devices, PCs, iPhones, Blackberries, and Nokia phones, but not Droid.</p>","160709","","160709","","2010-01-13 05:32:50","2010-01-17 09:55:19","Some files won't stream from lighttpd to Droid","<android><networking><lighttpd>","4","3","1","",""
"1949814","1","1954253","","2009-12-22 23:10:23","4","8289","<p>I am trying to connect to a .NET WCF service in Android using kSOAP2 (v 2.1.2), but I keep getting a fatal exception whenever I try to make the service call. I'm having a bit of difficulty tracking down the error and can't seem to figure out why it's happening. The code I am using is below:</p><pre><code>package org.example.android;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.PropertyInfo;import org.ksoap2.serialization.SoapObject;import org.ksoap2.serialization.SoapSerializationEnvelope;import org.ksoap2.transport.HttpTransport;import android.app.Activity;import android.app.AlertDialog;import android.content.DialogInterface;import android.content.Intent;import android.os.Bundle;public class ValidateUser extends Activity {    private static final String SOAP_ACTION = ""http://tempuri.org/mobile/ValidateUser"";    private static final String METHOD_NAME = ""ValidateUser"";    private static final String NAMESPACE = ""http://tempuri.org/mobile/"";        private static final String URL = ""http://192.168.1.2:8002/WebService.Mobile.svc"";      /** Called when the activity is first created. */	    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);             setContentView(R.layout.validate_user);        Intent intent = getIntent();        Bundle extras = intent.getExtras();        if (extras == null) {        	this.finish();        }        String username = extras.getString(""username"");        String password = extras.getString(""password"");    	                                  Boolean validUser = false;        try {        	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);            PropertyInfo uName = new PropertyInfo();            uName.name = ""userName"";            PropertyInfo pWord = new PropertyInfo();            pWord.name = ""passWord"";            request.addProperty(uName, username);            request.addProperty(pWord, password);            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);            envelope.dotNet = true;            envelope.setOutputSoapObject(request);            HttpTransport androidHttpTransport = new HttpTransport(URL);            androidHttpTransport.call(SOAP_ACTION, envelope); // error occurs here        	Integer userId = (Integer)envelope.getResponse();        	validUser = (userId != 0);        } catch (Exception ex) {        }        	  	    }    private void exit () {        this.finish();    }}</code></pre><p>EDIT: Remove the old stack traces. In summary, the first problem was the program being unable to open a connection due to missing methods or libraries due to using vanilla kSOAP2 rather than a modified library for Android (kSOAP2-Android). The second issue was a settings issue. In the Manifest I did not add the following setting:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p>I am now having an issue with the XMLPullParser which I need to figure out.</p><blockquote>  <p>12-23 10:58:06.480:  ERROR/SOCKETLOG(210): add_recv_stats  recv 0</p>    <p>12-23 10:58:06.710:  WARN/System.err(210):  org.xmlpull.v1.XmlPullParserException:  unexpected type (position:END_DOCUMENT  null@1:0 in  java.io.InputStreamReader@433fb070) </p>    <p>12-23 10:58:06.710:  WARN/System.err(210):     at  org.kxml2.io.KXmlParser.exception(KXmlParser.java:243)</p>    <p>12-23 10:58:06.720:  WARN/System.err(210):     at  org.kxml2.io.KXmlParser.nextTag(KXmlParser.java:1363)</p>    <p>12-23 10:58:06.720:  WARN/System.err(210):     at  org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:126)</p>    <p>12-23 10:58:06.720:  WARN/System.err(210):     at  org.ksoap2.transport.Transport.parseResponse(Transport.java:63)</p>    <p>12-23 10:58:06.720:  WARN/System.err(210):     at  org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:100)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  org.example.android.ValidateUser.onCreate(ValidateUser.java:68)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1122)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2104)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2157)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  android.app.ActivityThread.access$1800(ActivityThread.java:112)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1581)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  android.os.Handler.dispatchMessage(Handler.java:88)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  android.os.Looper.loop(Looper.java:123)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  android.app.ActivityThread.main(ActivityThread.java:3739)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  java.lang.reflect.Method.invokeNative(Native  Method)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  java.lang.reflect.Method.invoke(Method.java:515)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)</p>    <p>12-23 10:58:06.730:  WARN/System.err(210):     at  dalvik.system.NativeStart.main(Native  Method)</p></blockquote>","127189","","127189","","2009-12-23 16:03:08","2011-10-06 13:14:09","Can't connect to WCF service on Android","<android><wcf><soap>","2","4","6","",""
"1949952","1","","","2009-12-22 23:51:40","1","106","<p>I wrote an app android sdk version 1.5 using it's built in emulator in eclipse. I created a database outside of eclipse populated it with data and push it to the emulator folder data/data/project name/database and could access it fine from the my app, everything was working great. My final step was to test the apk file on an actual phone. When I did that the program would not work. After looking into it I found that the database file was not being uploaded into the phone. Is there a special way to install the apk file on the actual phone to get the embedded database to work? Or can I assume that since everything worked fine on the sdk 1.5 emulator that everything will work when I upload it to the market. Thanks in advance.</p>","237259","","234938","","2009-12-30 02:18:12","2010-03-19 13:00:15","Getting my app to work on my phone","<database><android><android-emulator>","1","0","1","",""
"1950097","1","1950136","","2009-12-23 00:41:29","9","2243","<p>I have some information generated in the Android Emulator, and the only way I can see to get it out is using the Log class.</p><p>However, you cannot copy-and-paste from the DDMS log window. This is really annoying as I cannot use the information in another application, for example, without retyping it.</p><p>Is there a better way to get debug information out of the emulator? What happens when you write more complex applications? What do you do when you need to verify it is writing correct information to URLs, databases, files etc?</p><p>Thanks!</p>","237287","","105971","","2011-12-19 18:50:16","2013-05-06 15:15:06","Is there a way to get copy-and-pastable debug output in the Android SDK Emulator?","<android><sdk>","4","0","1","",""
"1950607","1","1950637","","2009-12-23 03:50:04","1","3089","<p>I am trying to make a button with background image. </p><pre><code>&lt;Button android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:layout_marginLeft=""5px""  android:layout_gravity=""center_vertical""  android:id=""@+id/button1""  android:background=""@drawable/imagename""&gt;&lt;/Button&gt;</code></pre><p>I wanna make it would be different (shadow, brightness etc...) when user click or touches on the button.</p><p>You know standard buttons are changed color when focused or clicked. I am trying to make like this.</p><p>How to make it ?</p><p>Thanks in advance.</p>","227889","","","","","2009-12-23 04:05:13","Change button appearance when focus or click?","<android>","1","0","","",""
"1950814","1","1950848","","2009-12-23 05:13:42","5","1494","<p>I wanted to know the gui elements we have in android?Can anyone show me a picture as well like how do these elements look like?</p>","199525","","","","","2009-12-23 05:25:58","What all basic android gui elements are available?","<android><gui>","1","0","","",""
"1950918","1","","","2009-12-23 05:56:07","0","1678","<p>I dropped the following into the drawable directory in my Android 1.5 project:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/gradient""&gt;    &lt;gradient android:startColor=""#FFFF00"" android:endColor=""#FFFFFF"" android:angle=""270""/&gt;    &lt;corners android:radius=""0dp"" /&gt;&lt;/shape&gt;</code></pre><p>I get </p><pre><code>java.lang.ClassNotFoundException    at com.android.ide.eclipse.adt.internal.resources.manager.ProjectClassLoader.findClass(Unknown Source)    at java.lang.ClassLoader.loadClass(Unknown Source)    at java.lang.ClassLoader.loadClass(Unknown Source)    at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(Unknown Source)    at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:198)    at android.view.BridgeInflater.onCreateView(BridgeInflater.java:99)    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:122)    at android.view.LayoutInflater.inflate(LayoutInflater.java:385)</code></pre><p>etc etc etc in my Eclipse console.  </p><p>I also get the same ClassCastError in my logcat when I try to run the thing in my emulator, setting that drawable to be the background on a linear layout.</p><p>Any ideas?</p>","","user237384","918472","","2012-01-12 11:05:22","2012-01-12 11:05:22","defining a shape xml element in drawable?","<java><android>","1","0","","",""
"1951053","1","1951183","","2009-12-23 06:43:35","1","386","<p>If you have downloaded any android source code, you would see a test folder present for almost all applications and base framework.</p><p>I wanted to know whether we build the test code too while building the sdk from source code, or is it just for our reference.</p><p>If it is for the latter, what is the best way to use it? Please post me the exact use of tests present in android source code.</p>","237388","","81398","","2012-10-31 12:19:31","2013-10-17 04:00:22","what is the use of tests present in android source code?","<android><android-source>","2","0","","",""
"1951066","1","1951098","","2009-12-23 06:46:43","1","3455","<p>Can anyone explain me about gestures? What are their use? Can u tell me any practical ideas where we can implement them?</p>","199525","","","","","2010-05-26 22:13:21","What are gestures in android?","<android><gesture-recognition>","2","0","1","",""
"1951159","1","","","2009-12-23 07:11:56","0","2983","<p>I created contacts with the emulator for v 2.0. However, I am unable to see these contacts. One of the errors I get even before my code that executes read contacts is:</p><blockquote>  <p>Cannot determine the default account for contacts compatibility</p></blockquote><p>See below for full stack:</p><pre><code>E/ContactsProvider(  109): Cannot determine the default account for contacts compatibilityE/ContactsProvider(  109): android.accounts.AuthenticatorException: bind failureE/ContactsProvider(  109):      at android.accounts.AccountManager.convertErrorToException(AccountManager.java:659)E/ContactsProvider(  109):      at android.accounts.AccountManager.access$500(AccountManager.java:53)E/ContactsProvider(  109):      at android.accounts.AccountManager$BaseFutureTask$Response.onError(AccountManager.java:566)E/ContactsProvider(  109):      at android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerResponse.java:69)E/ContactsProvider(  109):      at android.os.Binder.execTransact(Binder.java:287)E/ContactsProvider(  109):      at dalvik.system.NativeStart.run(Native Method)</code></pre>","237415","","85950","","2012-03-28 02:48:49","2012-07-09 09:22:33","Contacts created with Android emulator (2.0) not being seen","<android><android-emulator><contacts>","2","1","","",""
"1951165","1","1951236","","2009-12-23 07:15:48","4","2177","<p>For the current Android application I'm working on, I'm looking to create a tcp connection between the user device, and another Android device based on the phone number instead of the IP address. IE the user would open your contacts list, and be able to create a tcp connection to a contact using the same application as you.</p><p>I seem to remember seeing a socket that would take a phone number instead of an IP a while ago in the Android API, but now I can't find it. Am I just missing something, or was I mistaken in what I saw in the first place? If I am mistaken, does anyone know of way to create a tcp connection to a user based solely on their phone number?</p>","149795","","","","","2009-12-23 07:42:35","Tcp connection another android device, based on phone # instead of IP?","<java><android><networking><sockets><tcp>","1","0","2","",""
"1951213","1","1951233","","2009-12-23 07:35:42","0","3314","<p>Do you know how to draw line on the <code>LinearLayout</code>? To create a <code>LinearLayout</code>, I am using a xml resource: </p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main_layout);    LinearLayout linear = (LinearLayout)findViewById(R.id.linearlayout);    //I wanna draw line on ""linear""}</code></pre><p>Is it possible ?</p>","227889","","493939","","2012-05-17 13:03:07","2012-05-17 13:03:07","How to draw a line on the LinearLayout?","<android><line><android-linearlayout>","2","0","","",""
"1951381","1","1951455","","2009-12-23 08:23:54","53","34799","<p>iPhone web apps have four <a href=""http://developer.apple.com/iphone/library/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html"">configuration features</a> available (not including the HTML5 application cache) to configure how web pages behave when you save the web page to the home screen as a bookmark.</p><ol><li>You can specify the home page icon.</li><li>You can specify a startup image that displays while the web page is loading.</li><li>You can hide the browser UI.</li><li>You can change the status bar color.</li></ol><p>The four features work by adding tags to the &lt;head&gt; like this:</p><pre><code>&lt;link rel=""apple-touch-icon"" href=""/custom_icon.png""/&gt;&lt;link rel=""apple-touch-startup-image"" href=""/startup.png""&gt;&lt;meta name=""apple-mobile-web-app-capable"" content=""yes"" /&gt;&lt;meta name=""apple-mobile-web-app-status-bar-style"" content=""black"" /&gt;</code></pre><p>Naturally, none of these ""apple-"" specific tags do anything in Android.  But is there any way to do something equivalent?  [At a minimum, I want users to be able to add my web page to their Android home screen (e.g. in Android 2.0) and have a pretty hi-res icon.]</p>","54829","","","","","2013-11-27 22:33:42","Configuring Android Web Applications","<html><android><bookmarks>","4","0","45","",""
"1951492","1","1951719","","2009-12-23 08:54:03","10","10890","<p>I have a webview with a banner and when I click on the banner there should open a second webview that follows the link. How can I do that? I have created the first WebView and it shows my banner but when I click on it, it opens the link in the same WebView.</p><p>How can I catch any events in the WebView when I click on a link that it should do something (with that link)? Just like <a href=""http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebViewDelegate%5FProtocol/Reference/Reference.html#//apple%5Fref/occ/intfm/UIWebViewDelegate/webView%3AshouldStartLoadWithRequest%3AnavigationType%3A""><code>shouldStartLoadWithRequest</code> in iPhone</a>.</p><p>Thank you,</p><p>Wouter </p>","188119","","3171","","2009-12-23 09:51:07","2013-03-19 06:16:50","Android WebView touch event link","<android><click><webview><touch>","2","0","4","",""
"1951629","1","","","2009-12-23 09:29:07","3","4326","<p>How can we resize our application for different screens on different Android devices?</p>","217065","","3171","","2009-12-23 09:33:17","2011-04-19 06:01:56","How to make Android applications compatible with different screen resolutions?","<android>","3","1","1","",""
"1951631","1","1951745","","2009-12-23 09:29:21","0","594","<p>What exactly are mock tests...I need to know the mock and performance tests available in android for testing android apps..what is the best tool for testing android apps and how..</p>","237388","","","","","2011-02-23 16:58:43","Testing android apps","<android>","1","1","","",""
"1951636","1","1951675","","2009-12-23 09:30:52","4","3528","<p>Is it possible to develop an android application aimed at mobile devices and also use the same code to execute on windows, linux or osx as a standalone java desktop application without using an emulator? I.e. to have the look and feel of a conventional java application running standalone?</p>","128800","","","","","2009-12-30 11:42:54","Can I run run an android application as a standalone desktop application without an emulator?","<java><android><desktop-application>","4","2","2","",""
"1951766","1","1951816","","2009-12-23 09:53:46","1","2030","<p>I want that on each key press I require to change the Counter some what similar to Tweeter Thing but the issue is that <code>OnEditorActionListener</code> only calls for the change while the user presses <kbd>Enter</kbd> or <kbd>Done</kbd> key, Please Can I Find a Resolution for this</p>","92039","","1369235","","2012-08-01 11:07:54","2012-08-01 11:07:54","Android Virtual Keyboard KeyListener for getting Virtual Keyboard key presses","<android>","1","0","","",""
"1951805","1","1951949","","2009-12-23 10:00:29","17","30797","<p>So far we have developed apps in android that create database on runtime. We like to know how can we access a pre-built or existing database/sqlite file in our android app? Please provide detail</p>","2355649","","265167","","2011-12-17 20:20:01","2013-01-13 08:35:26","How to access an existing sqlite database in Android?","<android><sqlite>","3","1","10","",""
"1951858","1","1951961","","2009-12-23 10:08:25","0","1013","<p>what is mock testing..How can we do mock testing..how to create mocks..when to use it</p>","237388","","","","","2012-05-16 12:00:04","mock tests in android","<android>","1","2","","2012-11-19 04:04:40",""
"1952340","1","","","2009-12-23 11:51:18","2","2162","<p>This is a newbie Droid question, but how do I deploy an application to the HTC Eris?  I have the Eclipse ADT plugin and I am able to run the emulator, but now I want to push it out and try it for real.</p><p>Can someone point me to documentation that shows how to do this?</p>","","user237549","","","","2009-12-23 12:08:05","How do I deploy HelloWorld app to HTC Eris Droid?","<android><deployment><htc>","1","0","","",""
"1952345","1","1952358","","2009-12-23 11:52:48","3","2947","<p>Can I simulate an sdcard presence in the android emulator?</p>","199525","","","","","2009-12-23 12:05:54","How do I simulate that the emulator has as an SD Card?","<android><emulator>","3","0","1","",""
"1952414","1","","","2009-12-23 12:05:01","0","4398","<p>I would like to create my own chat client for facebook IM in Android. I created xmpp jabber protocol in java but i dont know the host name and port number of Facebook IM server. Can any one let me know the Facebook's IM server host name and port number to communicate.</p>","132724","","14343","","2010-07-14 23:41:48","2014-02-11 00:33:02","How to create IM chat client for Facebook in android?","<android><facebook><xmpp><instant-messaging>","4","2","1","",""
"1952630","1","1957389","","2009-12-23 12:49:55","7","9495","<p>I am using Listview, i want to scroll down to list's 10 item when view get loaded, how can do that ????</p>","216431","","","","","2011-11-02 09:16:54","android listview scroll to number of listitems","<android><listview>","2","0","1","",""
"1952915","1","1952965","","2009-12-23 13:49:20","0","291","<p>how to build sdk from source code</p>","237388","","","","","2011-11-20 02:08:46","buiding android sdk","<android>","3","0","","",""
"1953209","1","1953279","","2009-12-23 14:48:06","0","1316","<p>I've been racking my head with this...</p><p>I've got a localized strings.xml file in a values-en folder with this example string:@string/my_string</p><p>The string has the following text stored in English: ""My String""</p><p>When accessing the localized string via a layout, it works fine.</p><p>When I try to change it in code, that's where I get problems.</p><p>I store the string into an array of strings for later use.  The 'context' is passed from my activity to a data class and used with this line of code:</p><p>dataStrings = new String[] { (String) context.getResources().getString(R.string.my_string) };</p><p>Later, I try to display this string, like so:</p><p>buttons[0].setText(dataStrings[0]);</p><p>It displays:</p><p>@string/my_string</p><p>How do I get it to display the string without '@string/', the proper localized string?</p>","237648","","","","","2009-12-23 15:01:46","Can't get localized strings from xml files correctly","<java><android><string><localization>","1","0","","",""
"1953308","1","1953491","","2009-12-23 15:06:08","1","870","<p>Since the latest android update came out, I haven't been very active with the new sdk. In fact, I don't know much about it. What I'm particularly interested in is of the changes that occurred, if any, regarding opengl. Did the implementation change? How would i go about writing a game in opengl for android with sdk 2.0? </p><p>Thanks</p>","137100","","","","","2012-07-25 23:56:42","OpenGL in Android","<android><opengl-es>","2","0","1","",""
"1953356","1","1953414","","2009-12-23 15:14:44","1","872","<p>I have am wrighting an android app and as a part of the app I would like the user to be able to see, select,and modify the user contacts. My main activity extends the TabActivity for usability reasons(from the users side). So in a tab i would like to show user contacts i have done that with this code: <code>mTabHost.addTab(mTabHost.newTabSpec(""tab_test2"").setIndicator(""Contacts"").setContent(new Intent(Intent.ACTION_PICK, People.CONTENT_URI)));</code>that uses the default phone contact activity. my android manifest is: `</p><pre><code>&lt;uses-permission android:name=""android.permission.READ_CONTACTS""/&gt;&lt;uses-permission android:name=""android.permission.READ_OWNER_DATA""/&gt;&lt;application android:icon=""@drawable/icon"" android:theme=""@android:style/Theme.NoTitleBar""&gt;    &lt;activity android:name="".WaveCally""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".streamer""              android:label=""@string/stream""&gt;    &lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""4"" /&gt;</code></pre><p> ` but i keep getting a security exception in my log and the activity crashes. any ideas?Also as I mentioned I would like to modify the contacts (mostly add some extra fields), to do that I have to get the contantprovider and in every contact add the extra fields? would those extra fields be available if i then pick a contact from the above mentioned activity?thanks in advanced maxsap</p>","234898","","","","","2010-10-09 21:42:55","Android securityException and user contacts question","<android><user><contacts><securityexception>","1","0","0","",""
"1953586","1","","","2009-12-23 15:53:53","4","7068","<p>How do I have a new file type launch my app?</p><p>For example if I have a new file type 'file.mjl' and I receive this file as an email, I want Android to associate this file type with my app and allow me to open / save it.</p>","237700","","","","","2012-03-03 03:05:02","Android File Association","<java><android>","2","0","1","",""
"1953693","1","","","2009-12-23 16:09:46","0","434","<p>I am a beginner on developing Android's application. I have some problems about using regular expressions in Android.</p><p>In my application, I had write some code for get back the source code of a html page which I had turn it in String datatype. And now I want to use regular expressions to retrieve some details in the html tags of this page. So, what should I do for it?</p><p>for example, in the html code,</p><pre><code>&lt;HTML&gt;.......&lt;TABLE class=tb_info cellSpacing=0 cellPadding=0 border=0&gt;&lt;TR&gt;&lt;TD class=pro_name vAlign=center colSpan=5&gt;Abby Poon&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class=pro_name vAlign=center colSpan=5&gt;Peter Pan&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;.........&lt;/HTML&gt;</code></pre><p>And now I want to get back the value ""Abby Poon"" and ""Peter Pan"" which is in a table called ""tb_info"" and in a  called ""pro_name"" for both two values.Can anyone teach me how I can do it? Or you may give me some reference page for it with Android.Thank you very much.</p>","237713","","13531","","2009-12-23 16:15:01","2009-12-24 00:20:59","Ask the help for regular expressions in Android","<java><html><android>","2","0","","",""
"1953823","1","1953871","","2009-12-23 16:28:43","6","2233","<p>The database of my application need to be filled with a lot of data,so during <code>onCreate()</code>, it's not only some create table sqlinstructions, there is a lot of inserts. The solution I chose is tostore all this instructions in a sql file located in res/raw and whichis loaded with <code>Resources.openRawResource(id)</code>.</p><p>It works well but I face to encoding issue, I have some accentuatedcaharacters in the sql file which appears bad in my application. Thismy code to do this:</p><pre><code>public String getFileContent(Resources resources, int rawId) throwsIOException  {    InputStream is = resources.openRawResource(rawId);    int size = is.available();    // Read the entire asset into a local byte buffer.    byte[] buffer = new byte[size];    is.read(buffer);    is.close();    // Convert the buffer into a string.    return new String(buffer);  }public void onCreate(SQLiteDatabase db) {   try {        // get file content        String sqlCode = getFileContent(mCtx.getResources(), R.raw.db_create);        // execute code        for (String sqlStatements : sqlCode.split("";""))        {            db.execSQL(sqlStatements);        }        Log.v(""Creating database done."");        } catch (IOException e) {            // Should never happen!            Log.e(""Error reading sql file "" + e.getMessage(), e);            throw new RuntimeException(e);        } catch (SQLException e) {            Log.e(""Error executing sql code "" + e.getMessage(), e);            throw new RuntimeException(e);        }</code></pre><p>The solution I found to avoid this is to load the sql instructionsfrom a huge <code>static final String</code> instead of a file, and allaccentuated characters appear well.</p><p>But isn't there a more elegant way to load sql instructions than a big<code>static final String</code> attribute with all sql instructions?</p>","231417","","681588","","2011-11-21 14:29:05","2012-03-19 00:55:31","Creating android app Database with big amount of data","<java><database><android>","4","0","2","",""
"1953888","1","2058836","","2009-12-23 16:39:25","17","46692","<p>I am trying to use the Bluetooth Chat sample API app that google provides to connect to a bluetooth RS232 adapter hooked up to another device. Here is the app for reference:</p><p><a href=""http://developer.android.com/resources/samples/BluetoothChat/index.html"">http://developer.android.com/resources/samples/BluetoothChat/index.html</a></p><p>And here is the spec sheet for the RS232 connector just for reference:</p><p><a href=""http://serialio.com/download/Docs/BlueSnap-guide-4.77_Commands.pdf"">http://serialio.com/download/Docs/BlueSnap-guide-4.77_Commands.pdf</a></p><p>Well the problem is that when I go to connect to the device with:</p><pre><code>mmSocket.connect(); (BluetoothSocket::connect())</code></pre><p>I always get an <code>IOException</code> error thrown by the <code>connect()</code> method. When I do a <code>toString</code> on the exception I get ""Service discovery failed"". My question is mostly what are the cases that would cause an <code>IOException</code> to get thrown in the connect method? I know those are in the source somewhere but I don't know exactly how the java layer that you write apps in and the C/C++ layer that contains the actual stacks interface. I know that it uses the bluez bluetooth stack which is written in C/C++ but not sure how that ties into the java layer which is what I would think is throwing the exception. Any help on pointing me to where I can try to dissect this issue would be incredible.</p><p>Also just to note I am able to pair with the RS232 adapter just fine but I am never able to actually connect. Here is the logcat output for more reference:</p><pre>I/ActivityManager( 1018): Displayed activity com.example.android.BluetoothChat/.DeviceListActivity: 326 ms (total 326 ms)E/BluetoothService.cpp( 1018): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)D/BluetoothChat( 1729): onActivityResult -1D/BluetoothChatService( 1729): connect to: 00:06:66:03:0C:51D/BluetoothChatService( 1729): setState() STATE_LISTEN -> STATE_CONNECTINGE/BluetoothChat( 1729): + ON RESUME +I/BluetoothChat( 1729): MESSAGE_STATE_CHANGE: STATE_CONNECTINGI/BluetoothChatService( 1729): BEGIN mConnectThreadE/BluetoothService.cpp( 1018): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)E/BluetoothEventLoop.cpp( 1018): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/1498/hci0/dev_00_06_66_03_0C_51I/BluetoothChatService( 1729): CONNECTION FAIL TOSTRING: java.io.IOException: Service discovery failedD/BluetoothChatService( 1729): setState() STATE_CONNECTING -> STATE_LISTEND/BluetoothChatService( 1729): startD/BluetoothChatService( 1729): setState() STATE_LISTEN -> STATE_LISTENI/BluetoothChat( 1729): MESSAGE_STATE_CHANGE: STATE_LISTENV/BluetoothEventRedirector( 1080): Received android.bleutooth.device.action.UUIDI/NotificationService( 1018): enqueueToast pkg=com.example.android.BluetoothChat callback=android.app.ITransientNotification$Stub$Proxy@446327c8 duration=0I/BluetoothChat( 1729): MESSAGE_STATE_CHANGE: STATE_LISTENE/BluetoothEventLoop.cpp( 1018): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/1498/hci0/dev_00_06_66_03_0C_51V/BluetoothEventRedirector( 1080): Received android.bleutooth.device.action.UUID</pre><p>The device I'm trying to connect to is the <code>00:06:66:03:0C:51</code> which I can scan for and apparently pair with just fine.</p><hr><p>The below is merged from a similar question which was successfully resolved by the selected answer here:</p><h2><A HREF=""http://stackoverflow.com/questions/2443572/how-can-one-connect-to-an-rfcomm-device-other-than-another-phone-in-android"">How can one connect to an rfcomm device other than another phone in Android?</A></h2><p>The Android API provides examples of using <A HREF=""http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#listenUsingRfcommWithServiceRecord(java.lang.String,%20java.util.UUID)"">listenUsingRfcommWithServiceRecord()</A> to set up a socket and <A HREF=""http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#createRfcommSocketToServiceRecord(java.util.UUID)"">createRfcommSocketToServiceRecord()</A> to connect to that socket.</p><p>I'm trying to connect to an embedded device with a <A HREF=""http://www.sparkfun.com/commerce/product_info.php?products_id=582"">BlueSMiRF Gold</A> chip. My working Python code (using the <A HREF=""http://code.google.com/p/pybluez/"">PyBluez</A> library), which I'd like to port to Android, is as follows:</p><pre><code>sock = bluetooth.BluetoothSocket(proto=bluetooth.RFCOMM)sock.connect((device_addr, 1))return sock.makefile()</code></pre><p>...so the service to connect to is simply defined as channel 1, without any SDP lookup.</p><p>As the only documented mechanism I see in the Android API does SDP lookup of a UUID, I'm slightly at a loss. Using ""sdptool browse"" from my Linux host comes up empty, so I surmise that the chip in question simply lacks SDP support.</p>","67455","","14122","","2010-03-14 20:44:18","2012-12-12 02:16:30","Bluetooth RFCOMM / SDP connection to a RS232 adapter in android","<android><bluetooth><rfcomm>","5","0","19","",""
"1953980","1","1958581","","2009-12-23 16:53:41","3","7760","<p>I'm trying to run the Android Hello Map View tutorial app on the Android emulator. The Google Map view displays, but the tiles are blank.</p><p>Judging by the errors below (taken from LogCat) the app is unable to connect to the internet. The web browser on the emulator connects without problems. I've also double-checked the API key.</p><p>I'm using the 1.5 Google APIs SDK, from Eclipse Galileo, on Windows XP SP3, behind a corporate firewall.</p><p>I've tried two methods to add proxy information:</p><ol><li><p>Add -http-proxy <a href=""http://www.foo.co.uk:80"" rel=""nofollow"">http://www.foo.co.uk:80</a> to Additional Emulator Command Line Options in the Target Page in Debug Configurations.</p></li><li><p>Remove settings in 1. and add proxy information at Home > Menu > Settings > Wireless Controls > Mobile Networks > Access Point Names.</p></li></ol><p>Neither seems to help.</p><p>Any other ideas? Should I be adding proxy information within the app? If so, how?</p><p>Sam Dutton</p><p><hr></p><p>AMENDMENT: internet permission has been added to the manifest application element: </p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p><hr></p><pre><code>12-23 16:43:31.624: INFO/System.out(717): waiting for debugger to settle...12-23 16:43:31.828: INFO/System.out(717): debugger has settled (1480)12-23 16:43:32.299: ERROR/ActivityThread(717): Failed to find provider info for com.google.settings12-23 16:43:33.738: INFO/MapActivity(717): Handling network change notification:CONNECTED12-23 16:43:33.738: ERROR/MapActivity(717): Couldn't get connection factory client12-23 16:43:34.879: DEBUG/dalvikvm(717): GC freed 4012 objects / 232976 bytes in 97ms12-23 16:43:37.818: INFO/ActivityManager(565): Displayed activity com.bbc.HelloMapView/.HelloMapView: 8939 ms12-23 16:43:38.408: DEBUG/dalvikvm(717): GC freed 8198 objects / 604808 bytes in 90ms12-23 16:43:38.888: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException12-23 16:43:40.488: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException12-23 16:43:42.097: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException12-23 16:43:43.307: DEBUG/dalvikvm(612): GC freed 4040 objects / 229536 bytes in 123ms12-23 16:43:43.789: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException12-23 16:43:45.387: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException12-23 16:43:46.978: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException12-23 16:43:48.428: DEBUG/dalvikvm(656): GC freed 2771 objects / 170824 bytes in 234ms12-23 16:43:48.708: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException12-23 16:43:50.298: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException12-23 16:43:51.898: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException12-23 16:43:53.277: DEBUG/dalvikvm(717): GC freed 5333 objects / 338584 bytes in 140ms12-23 16:43:53.408: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException12-23 16:43:53.447: DEBUG/dalvikvm(636): GC freed 2913 objects / 165264 bytes in 244ms12-23 16:43:56.527: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException12-23 16:43:58.329: DEBUG/dalvikvm(610): GC freed 3249 objects / 193992 bytes in 122ms12-23 16:43:59.169: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException12-23 16:44:02.518: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException</code></pre>","51593","","495906","","2011-10-05 07:19:50","2011-10-05 07:19:50","Android Hello Map View problems on the emulator","<android><android-emulator><android-mapview>","4","4","4","",""
"1954434","1","2018621","","2009-12-23 18:12:55","14","11858","<p>I am developing a sort of media player for android. The question is how can i get the cover art of audio file on android. For example the default android media player shows album covers when listing albums, how can i get this artworks.</p>","184601","","184601","","2010-01-05 16:32:23","2012-01-17 16:01:12","cover art on android","<android>","4","2","11","",""
"1954495","1","1955949","","2009-12-23 18:25:22","0","1356","<p>I am using kind of results search engine, problem is to remember the searching criteria i made singleton static class which keeps only one instance.</p><p>In my application there are lots of class level private variables, lots of public static  variables, a big util class which contains only static final methods.</p><p>problem is my application get crash any time any where any spot and interesting thing is crash code always surrounded by try{} catch(Throwable e){} block but never catch, i think it may be memory full issue.</p><p>I want to discuss one sample case, on the result page i also display result related image, i download image from web and using drawable i place image in the imageview, i created static hashmap to reuse images, some time after downlaod 5 images application crash some times click on a result get user to new detail screen get crash and all code surrounded by try catch block, i am new to mobile program this thing has become night mare to me.</p><p>Last thing, On emulator hardly application crash but when i try to test the application on device, i am using samsung glaxy android supported to test the application it goes smoth and suddenly it start getting crashed, and after crash android relaunch the activity that throws null pointer exception on every click and caught by try{}catch{} block i think after crashing android dealocate all objects only keep the UI objects thats why when after crash i auto launch the activity clicking causes null pointer exception.</p><p>how can i stop relaunching crashed activity ????</p>","216431","","13663","","2009-12-23 23:46:36","2012-09-19 06:53:37","android application memory leaks","<android><memory-leaks>","1","1","1","",""
"1954629","1","1954662","","2009-12-23 18:47:52","0","162","<ol><li>i am using json to to receive data from the webservice, creating text to json object is resource hungry operation.</li><li>i have to load images from web, i am lazy loadig images in async process how can i compress and make the cache ??</li><li>after crash how can i stop re-launching activity ?</li><li>how can i know how much memory remaining and andoird OS will kill my object.</li></ol>","216431","","","","","2009-12-23 18:55:27","Android resource hungry operations","<android>","1","0","","",""
"1954650","1","","","2009-12-23 18:52:15","2","4659","<p>I'm trying to write an application where a user can enter his name, phone number, Facebook ID/ Twitter ID etc...which will then be added to the existing contacts application.</p><p>Name, phone number - by default exists in the contacts app. How can I go about adding the Facebook ID or Twitter ID? I mean custom fields in the contacts application from my application.</p>","203376","","659918","","2011-03-29 09:26:54","2011-03-29 09:26:54","How to add custom data/field in contacts in android 2.0?","<android>","2","2","5","",""
"1954689","1","1955026","","2009-12-23 19:01:15","-1","3936","<p>Please guide in the following class what i should save in</p><p>please remember i am using only one string which is i am retriving from getextra method and there is nothing which i think i should store in the following overridden method.</p><pre><code>protected void onSaveInstanceState(Bundle outState) {    // TODO Auto-generated method stub    super.onSaveInstanceState(outState);}</code></pre><p>can you guide me what to store in onsave instance method and what not to ???</p><pre><code>package com.wozzon.activity;import java.util.ArrayList;import org.json.JSONArray;import org.json.JSONObject;import android.app.Activity;import android.app.AlertDialog;import android.app.ProgressDialog;import android.content.Intent;import android.graphics.Typeface;import android.os.Bundle;import android.text.Html;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.view.View.OnClickListener;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ImageView;import android.widget.ListView;import android.widget.TextView;import android.widget.AdapterView.OnItemClickListener;import com.wozzon.json.JSONService;import com.wozzon.model.SearchCriteria;import com.wozzon.pl.UIFactory;import com.wozzon.util.Util;import com.wozzon.util.WLConstants;public class HomeBrowse extends Activity implements OnItemClickListener{    private final static String TAG = HomeBrowse.class.getSimpleName();    private ArrayList&lt;BrowseRow&gt; model=new ArrayList&lt;BrowseRow&gt;();    private BrowseAdapter adapter;    private ListView list;    private TextView browseTitle;    private TextView changeLink;    private SearchCriteria sc =SearchCriteria.getInstance();    private JSONArray jsonArray;    private ProgressDialog m_ProgressDialog = null;     private Runnable progressRunnable;    @Override    public void onCreate(Bundle savedInstanceState) {        try {            super.onCreate(savedInstanceState);            setContentView(R.layout.browse);            String errorMsg =Util.getExtraValue(getIntent().getExtras(), WLConstants.ERROR_MSG);             list =(ListView)findViewById(R.id.browse_cats);            if(errorMsg!= null){            	UIFactory.displayAlert(new AlertDialog.Builder(HomeBrowse.this), ""Status"", errorMsg);            }            progressRunnable = new Runnable(){                @Override                public void run() {                 try {                	loadData();    				} catch (Throwable e) {    					Log.e(TAG, e.getMessage());    					}    				 runOnUiThread(returnRes);                }            };            m_ProgressDialog = ProgressDialog.show(HomeBrowse.this,        		          ""Please wait..."", ""Loading ..."", true);            Thread thread = new Thread(progressRunnable);            thread.start();    	} catch (Throwable e) {    		Log.e(TAG, e.getMessage());    		Util.handleError(HomeBrowse.this, HomeBrowse.class, e.getMessage());    		//UIFactory.displayAlert(new AlertDialog.Builder(HomeBrowse.this), ""Error Loading categories"", e.getMessage());    	}    }    private void loadData()throws Throwable{//loading object    	jsonArray = JSONService.getJsonArray(getResources().getString(R.string.catJson));    }    private void fillResultRows(JSONArray jsonArray, BrowseAdapter adapter)throws Throwable{    	BrowseRow br = null;    	try {    		for(int a=0; a&lt;jsonArray.length(); a++){    			JSONObject jsonObj = jsonArray.getJSONObject(a);    			br = new BrowseRow();    			br.name=jsonObj.getString(""title"");    			br.image=jsonObj.getString(""image"");    			br.searchType = jsonObj.getInt(""searchType"");    			if(jsonObj.has(""categoryIds"")){    				br.categoryIds = jsonObj.getString(""categoryIds"").replaceAll(""-"", "","");    			}    			if(jsonObj.has(""subCategoryIds"")){    				br.subCategoryIds = jsonObj.getString(""subCategoryIds"").replaceAll(""-"", "","");    			}    			adapter.add(br);    		}    	} catch (Throwable e) {    		throw e;    	}    	}    class BrowseAdapter extends ArrayAdapter&lt;BrowseRow&gt; {    	BrowseAdapter() {    		super(HomeBrowse.this, android.R.layout.simple_list_item_1, model);    	}    	public View getView(int position, View convertView,    											ViewGroup parent) {    		View row=convertView;    		ResultWrapper wrapper=null;    		if (row==null) {													    			LayoutInflater inflater=getLayoutInflater();    			row=inflater.inflate(R.layout.browse_row, null);    			wrapper=new ResultWrapper(row);    			row.setTag(wrapper);    		}    		else {    			wrapper=(ResultWrapper)row.getTag();    		}    		wrapper.populateFrom(model.get(position));    		return(row);    	}    }    class ResultWrapper {    	private TextView name;    	private String catIds=""0"";    	private String subCatIds=""0"";    	private ImageView image;    	private int searchType;    	private View row=null;    	ResultWrapper(View row) {    		this.row=row;    	}    	void populateFrom(BrowseRow r) {    		getName().setText(r.name);    		getIcon().setImageResource(getImageIcon(Integer.parseInt(r.image)));    		catIds =r.categoryIds;    		subCatIds = r.subCategoryIds;    		searchType =r.searchType;    	}    	TextView getName() {    		if (name==null) {    			name=(TextView)row.findViewById(R.id.browse_row_name);    		}    		return name;    	}    	ImageView getIcon() {    		if (image==null) {    			image=(ImageView)row.findViewById(R.id.browse_row_icon);    		}    		return image;    	}    }    private int getImageIcon(int catId){    	int imageSource=R.drawable.all_cats;    	switch(catId){    	case WLConstants.CATEGORY_FILM: imageSource =R.drawable.film; break;      	case WLConstants.CATEGORY_MUSIC: imageSource =R.drawable.music; break;    	case WLConstants.CATEGORY_ARTS: imageSource =R.drawable.art; break;    	case WLConstants.CATEGORY_KIDS: imageSource =R.drawable.museum; break;    	case WLConstants.CATEGORY_GALLERY_MUSEUM: imageSource =R.drawable.kids; break;    	case WLConstants.CATEGORY_COMEDY: imageSource =R.drawable.comedy; break;    	case WLConstants.CATEGORY_NIGHT_CLUBS: imageSource =R.drawable.clubs; break;    	case WLConstants.CATEGORY_ATTRACTION: imageSource =R.drawable.touristattractions; break;    	case WLConstants.CATEGORY_VARIOUS_EVENTS: imageSource =R.drawable.all_cats; break;    	case WLConstants.CATEGORY_ALL_FOOD_DRINK: imageSource =R.drawable.restaurants; break;    	}    	return imageSource;    }    @Override    public void onItemClick(AdapterView&lt;?&gt; adp, View view, int item, long arg3) {    	try {    		if("""".equals(sc.getSearchLocation()) &amp;&amp; (!(Util.locationFound(sc.getGeoLocation()) &amp;&amp; sc.isUK()))){    			UIFactory.displayAlert(new AlertDialog.Builder(HomeBrowse.this), ""Error"", ""Please provide location"");    			return;    		}    			ResultWrapper wrap = (ResultWrapper)view.getTag();    			sc.setCategoryIds(wrap.catIds);    			sc.setSubCategoryIds(wrap.subCatIds);    			sc.setSearchType(wrap.searchType);    			goSearch();    	} catch (Throwable e) {    		Log.e(TAG, e.getMessage());    		Util.handleError(HomeBrowse.this, HomeBrowse.class, e.getMessage());    		//UIFactory.displayAlert(new AlertDialog.Builder(this), ""Error"", e.getMessage());    	}    }    private void applyListener(){        list.setOnItemClickListener(this);        changeLink.setOnClickListener(onclickListener);    }    private final void goSearch(){    	  try {    		  sc.setSearchString("""");    		  Intent mainIntent = new Intent(HomeBrowse.this,SearchResults.class);     		  startActivity(mainIntent);     	} catch (Throwable e) {    		Log.e(TAG, e.getMessage());    		Util.handleError(HomeBrowse.this, HomeBrowse.class, e.getMessage());    	}      }    public OnClickListener onclickListener = new OnClickListener(){         // @Override         public void onClick(View aView) {             try {    			int componentId =aView.getId();    			 switch(componentId){    			 case R.id.tv_changeDateType:     				 Intent intent = new Intent(HomeBrowse.this,TimeLocationSettings.class);    				 startActivity(intent);    				 break;    			 }    		} catch (Exception e) {    			Log.e(TAG, e.getMessage());    			Util.handleError(HomeBrowse.this, HomeBrowse.class, e.getMessage());    		}        }  };   private void configComponents(){      String titleStr,location = """";      String dateCrtStr = Util.getDateCritieraStr(sc.getDateCriteria());      titleStr= dateCrtStr;      if(!"""".equals(sc.getSearchLocation())){    	  location = sc.getSearchLocation();      }else if(sc.isNearMe()){    	  location=""Near me"";      }else{    	  location = ""Postcode or town"";      }      titleStr = titleStr + "" - ""+ location;      browseTitle.setText(titleStr);      changeLink.setTypeface(Typeface.DEFAULT, Typeface.BOLD);      }  public class BrowseRow {    	private String name = """";    	private String image = """";    	private String categoryIds=""0"";    	private String subCategoryIds=""0"";    	private int searchType=1;    }  private Runnable returnRes = new Runnable() {        @Override        public void run() {        	try {            	browseTitle = (TextView)findViewById(R.id.browsePageTite);            	changeLink = (TextView)findViewById(R.id.tv_changeDateType);            	changeLink.setText(Html.fromHtml(""&lt;a href='#'&gt;Change&lt;/a&gt;""));            	adapter=new BrowseAdapter();        		applyListener();            	configComponents();    			fillResultRows(jsonArray, adapter);    			if(jsonArray == null){    				UIFactory.displayAlert(new AlertDialog.Builder(HomeBrowse.this), ""Error"", ""Error Loading categories"");    				return;    			}    			list.setAdapter(adapter);    		} catch (Throwable e) {    			e.printStackTrace();    		}             m_ProgressDialog.dismiss();        }      };}</code></pre>","216431","","","","","2011-10-29 19:42:49","android onSaveInstanceState usage","<android><savechanges>","2","1","","",""
"1954728","1","1954777","","2009-12-23 19:07:22","2","3638","<p>I am using SAX to parse an XML file I'm pulling from the web. I've extended <a href=""http://developer.android.com/reference/org/xml/sax/helpers/DefaultHandler.html"" rel=""nofollow"">DefaultHandler</a> with code similar to:</p><pre><code>public class ArrivalHandler extends DefaultHandler {        @Override    public void startElement(String namespaceUri, String localName, String qualifiedName, Attributes attributes) throws SAXException {        if (qualifiedName.equalsIgnoreCase(""resultSet"")) {            System.out.println(""got a resultset"");        } else if (qualifiedName.equalsIgnoreCase(""location"")) {            System.out.println(""got a location"");        } else if (qualifiedName.equalsIgnoreCase(""arrival"")) {            System.out.println(""got an arrival"");        } else {            System.out.println(""There was an unknown XML element encountered: '"" + qualifiedName + ""'"");        }            }    @Override    public void endElement(String namespaceUri, String localName, String qualifiedName) throws SAXException {        // we'll just ignore this for now    }    @Override    public void characters(char[] chars, int startIndex, int length) throws SAXException {        // ignore this too    }}</code></pre><p>The problem I'm having is that I'm just getting a series of empty elements. The log reads:</p><pre><code>There was an unknown XML element encountered: ''There was an unknown XML element encountered: ''There was an unknown XML element encountered: ''etc</code></pre><p>This worked fine when I was just passing <code>parser.parse</code> a local file, but now I'm pulling it from the web with:</p><pre><code>HttpClient httpClient = new DefaultHttpClient();resp = httpClient.execute(""http://example.com/whatever"");SAXParserFactory saxFactory = SAXParserFactory.newInstance();ArrivalHandler handler = new ArrivalHandler();SAXParser parser = saxFactory.newSAXParser();parser.parse(resp.getEntity().getContent(), handler);</code></pre><p>and I get the (apparently) empty results described above.</p><p>What I've looked into so far:</p><ol><li>I converted the <code>InputStream</code> from <code>resp.getEntity().getContent()</code> to a string and dumped it out and it looks like I'm getting the XML from the server correctly.</li><li>There are no exceptions thrown but there is a warning that reads ""<code>W/ExpatReader(232): DTD handlers aren't supported.</code>"". </li></ol><p>Any other ideas for what I'm doing incorrectly or how to debug this?</p>","76835","","","","","2013-01-18 02:34:16","SAX parsing problem in Android... empty elements?","<java><xml><android><sax>","1","0","","",""
"1954862","1","1954876","","2009-12-23 19:31:56","1","249","<p>Is it somehow possible that instead of:</p><p><code>Button btnNextWord = (Button) this.findViewById(R.id.btnNextWord);</code></p><p>Eclipse automatically generates for me something like:</p><p><code>Button btnNextWord = this.btnNextWord;</code><br />or<br /><code>Button btnNextWord = R.id.getBtnNextWord(this);</code></p><p>??</p>","237858","","","","","2009-12-23 19:35:30","Android typed controls instead of findViewById","<android>","1","0","","",""
"1955043","1","1955270","","2009-12-23 20:11:53","1","3181","<p>does anyone know whether is it possible to display a dialog with html code on android device? I would be more than thankful for any tip about it.</p><p>What I want to di is design a html layout and display it in a dialog inside the custom application.</p><p>Thanks!</p>","22996","","","","","2010-06-30 16:56:33","android html container","<html><android><containers>","3","0","1","",""
"1955188","1","1958503","","2009-12-23 20:38:45","3","10438","<p>I am developing an android app and as I read all around and learned for myself, I cant have a lot of images on the screen at the same time or I will get an exception.</p><p>The question is how many images or how many KB in images or how many layouts/images can I have at the same time in the screen.</p><p>I know this is not the only thing that has influence on memory, but I am looking for a number so I can plan around it. </p><p>Thanks</p><p>Daniel</p><p><hr></p><p>Edit:</p><p>I just found this on the android dev site (<a href=""http://developer.android.com/resources/articles/future-proofing.html"" rel=""nofollow"">http://developer.android.com/resources/articles/future-proofing.html</a>)</p><p>Technique to Avoid, #3: Going Overboard with Layouts</p><p>Due to changes in the View rendering infrastructure, unreasonably deep (more than 10 or so) or broad (more than 30 total) View hierarchies in layouts are now likely to cause crashes. This was always a risk for excessively complex layouts, but you can think of Android 1.5 as being better than 1.1 at exposing this problem. Most developers won't need to worry about this, but if your app has very complicated layouts, you'll need to put it on a diet. You can simplify your layouts using the more advanced layout classes like FrameLayout and TableLayout.</p><p>I guess this can be my problem.</p><p>When it says 'broad' , is it saying on the last level ?</p><p>Thanks</p><p>Daniel</p>","237115","","237115","","2009-12-23 21:30:35","2012-09-06 03:55:50","java.lang.OutOfMemoryError: bitmap size exceeds VM budget - android - how many images?","<android><memory><image><layout><memory-allocation>","5","2","1","",""
"1955335","1","","","2009-12-23 21:12:18","7","3045","<p>Does android have any support for viewing SVG files or are there any 3rd party SVG viewers for the Android platform?</p>","61525","","","","","2013-08-06 07:18:57","Is there any lite SVG viewer for Android?","<android><svg>","3","0","1","",""
"1955410","1","","","2009-12-23 21:27:19","26","18835","<p>I've been doing a lot of searching and I know a lot of other peopleare experiencing the same OOM memory problems with <code>BitmapFactory</code>.  Myapp only shows a total memory available of 4MB using <code>Runtime.getRuntime().totalMemory()</code>.  If the limit is 16MB, then why doesn't the totalmemory grow to make room for the bitmap?  Instead it throws an error.</p><p>I also don't understand that if I have 1.6MB of free memory accordingto <code>Runtime.getRuntime().freeMemory()</code> why do I get an error saying ""VMwon't let us allocate 614400 bytes""?  Seems to me I have plentyavailable memory.</p><p>My app is complete except for this problem, which goes away when Ireboot the phone so that my app is the only thing running.  I'm usingan HTC Hero for device testing (Android 1.5).</p><p>At this point I'm thinking the only way around this is to somehowavoid using <code>BitmapFactory</code>.</p><p>Anyone have any ideas on this or an explanation as to why VM won'tallocate 614KB when there's 1.6MB of free memory?</p>","237912","","881229","","2014-02-01 20:23:05","2014-02-01 20:23:05","BitmapFactory OOM driving me nuts","<android><out-of-memory>","5","1","36","",""
"1955876","1","2089962","","2009-12-23 23:21:11","6","7169","<p>I'm in the middle of writing an Android app, and would like to give my users the ability to share the document files it creates.</p><p>What I'd ideally like to see would be files hosted on a HTTP server somewhere, so a user can simply fire up their browser on the Android phone, surf to the relevant page, and then download the file to their phone. I'd then like for my app to be able to open that downloaded file.</p><p>I'm not sure if that's possible at all, but would certainly be interested in hearing from anyone that knows anything about such things. Unfortunately I seem to be having difficulty coming up with the answers myself - like much of the rest of the Android SDK, there is a severe shortage of relevant documentation.</p>","214149","","","","","2010-01-18 23:24:14","Downloading files on Android","<android><file-download>","4","0","1","",""
"1956345","1","1956373","","2009-12-24 02:15:13","0","2457","<p>I am confirming about creating activity. </p><p>My Manifest.xml is like this :</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;&lt;activity android:name="".FirstActivity""          android:label=""@string/app_name""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.MAIN"" /&gt;        &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;&lt;activity android:name="".SecondActivity""          android:label=""@string/app_name""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.MAIN"" /&gt;        &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt; &lt;activity android:name="".ThirdActivity""          android:label=""@string/app_name""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.MAIN"" /&gt;        &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p></p><p>You can see property <code>action android:name=</code> property is <code>""android.intent.action.MAIN""</code> and <code>category android:name=</code> is <code>""android.intent.category.LAUNCHER""</code> for all activities.</p><p>When application starts up, it calls FirstActivity.</p><p>Then calls useless Activity such as ThirdActivity or SecondActivity.</p><p>In this case, is my <code>manifest.xml</code> correct?</p><p>Or, do I need to set another property to Second and Third activity?If so, what is that?</p><p>I wonder <code>manifest.xml</code> file is right for my case.</p><p>Please advise.</p><p>Thanks in advance.</p>","227889","","3171","","2009-12-24 09:18:01","2009-12-24 11:35:08","Too many Activities being started when launching an Android Application","<android>","3","0","","",""
"1956458","1","","","2009-12-24 03:06:36","0","644","<p>I am searching about draw line on the background of LinearLayout.</p><p>I've add sub views to my LinearLayout. Now I am trying to draw line on the background.</p><p>Is is possible ?</p><p>If so, How can I do ?</p><p>Please help guys.</p><p>Thanks.</p>","227889","","","","","2011-05-09 21:12:13","Draw line on the background","<android>","1","3","","",""
"1956634","1","1956653","","2009-12-24 04:13:07","1","556","<p>I have made apps for the iPhone, but want to also code for the Android but want to know if it is first worth my time, second worth my having to learn another language, and third worth the effort in the sense that am I going to make a profit from this. Also if in any way Android code is similar, then will it be hard to bring the iPhone (Xcode) files, or copy and paste my iPhone code into the Android code.</p>","225020","","","","","2009-12-24 04:35:06","Is programming for Android completely different fron programming for iPhone?","<iphone><android>","2","0","","",""
"1956838","1","1956878","","2009-12-24 05:29:20","1","2541","<p>I am facing a problem when gets height/width of TextView.</p><p>My code : </p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {	super.onCreate(savedInstanceState);	setContentView(R.layout.main);    TextView tv1 = (TextView)findViewById(R.id.textview1);    int h1 = tv1.getHeight();    TextView tv2 = (TextView)findViewById(R.id.textview2);    int h2 = tv2.getHeight();}</code></pre><p>h1 is height of textview1h2 is height of textview2</p><p>These h1 and h2 are always equal to 0. </p><p>What is wrong here ?</p><p>Please advice.</p><p>Thanks.</p>","227889","","","","","2009-12-24 14:12:43","Can't get height of Widgets","<android>","1","0","","",""
"1956964","1","1957768","","2009-12-24 06:09:32","0","720","<p>Hi all u geeks out there... i'm a novice in Android programming though had tried my hand on blackberry... </p><p>currently i was asked 4 the possibility of making an application which can control access to other applications on Android... I mean something like asking password everytime some selected apps are opened... My question is.. ""is it possible to make an application which does something like this""... Any feedback will be appreciated.. Thanx in advance guys...</p>","238071","","","","","2009-12-24 10:33:03","Android Programming - locking application","<android><locking>","2","1","","",""
"1957135","1","1957450","","2009-12-24 06:59:20","44","19582","<p>How can I test an application for performance in Android?  What is the support provided in Android and how do I use it?</p>","237388","","237388","","2010-01-20 05:41:29","2013-11-25 01:58:00","How to test the performance of an Android application?","<android><performance><testing>","4","0","33","",""
"1957252","1","1957610","","2009-12-24 07:42:02","1","1409","<p>Is there a way to link inherit class to xml file. </p><p>I am trying to connect extended class to widget in the xml file.</p><p>Is it possible ?</p><p>Thanks in advance.</p>","227889","","","","","2009-12-24 09:49:55","Connection between View in the xml file and extened View class","<android>","1","0","1","",""
"1957484","1","","","2009-12-24 09:03:18","1","1719","<p>Full exception is below</p><pre><code>12-24 08:59:24.800: WARN/dalvikvm(743): JNI WARNING: threadid=5 using env from threadid=312-24 08:59:24.800: WARN/dalvikvm(743):              in Ldalvik/system/NativeStart;.run ()V (GetObjectClass)12-24 08:59:24.800: INFO/dalvikvm(743): ""HeapWorker"" daemon prio=5 tid=5 VMWAIT12-24 08:59:24.800: INFO/dalvikvm(743):   | group=""system"" sCount=1 dsCount=0 s=N obj=0x42998b90 self=0x156ad012-24 08:59:24.800: INFO/dalvikvm(743):   | sysTid=744 nice=0 sched=0/0 handle=140353612-24 08:59:24.800: INFO/dalvikvm(743):   at dalvik.system.NativeStart.run(Native Method)12-24 08:59:24.800: ERROR/dalvikvm(743): VM aborting12-24 08:59:24.810: INFO/DEBUG(551): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***12-24 08:59:24.810: INFO/DEBUG(551): Build fingerprint: 'generic/sdk/generic/:1.6/DRC76/13852:eng/test-keys'12-24 08:59:24.810: INFO/DEBUG(551): pid: 743, tid: 744  &gt;&gt;&gt; com.gamevil.testjni &lt;&lt;&lt;12-24 08:59:24.810: INFO/DEBUG(551): signal 11 (SIGSEGV), fault addr deadd00d12-24 08:59:24.810: INFO/DEBUG(551):  r0 0000032c  r1 0000000c  r2 0000000c  r3 0000002612-24 08:59:24.810: INFO/DEBUG(551):  r4 deadd00d  r5 00000000  r6 ad083e1c  r7 0000000012-24 08:59:24.810: INFO/DEBUG(551):  r8 80601da0  r9 afe39dd4  10 100ffad0  fp 0000000112-24 08:59:24.810: INFO/DEBUG(551):  ip ad083ef8  sp 100ffa48  lr afe13f0d  pc ad03b7fa  cpsr 2000003012-24 08:59:24.849: INFO/Hollo-Jni(743): Caught signal with itimespec ..  171812-24 08:59:24.849: WARN/dalvikvm(743): JNI WARNING: threadid=7 using env from threadid=312-24 08:59:24.849: WARN/dalvikvm(743):              in Ldalvik/system/NativeStart;.run ()V (GetObjectClass)12-24 08:59:24.849: INFO/dalvikvm(743): ""Signal Catcher"" daemon prio=5 tid=7 VMWAIT12-24 08:59:24.849: INFO/dalvikvm(743):   | group=""system"" sCount=1 dsCount=0 s=N obj=0x437541e8 self=0x15752012-24 08:59:24.849: INFO/dalvikvm(743):   | sysTid=746 nice=0 sched=0/0 handle=140617612-24 08:59:24.849: INFO/dalvikvm(743):   at dalvik.system.NativeStart.run(Native Method)12-24 08:59:24.849: ERROR/dalvikvm(743): VM aborting12-24 08:59:24.861: INFO/ActivityManager(575): Process com.gamevil.testjni (pid 743) has died.</code></pre>","235687","","101318","","2011-03-04 02:44:15","2011-03-04 02:44:15","Need clarification of ""JNI WARNING: threadid=5 using env from threadid=3""","<android><jni><android-ndk>","1","0","1","",""
"1957560","1","","","2009-12-24 09:30:30","4","1765","<p>I would like to have a <code>ListView</code> that scrolls in a carousel way, so when you scroll to the bottom and continue scolling, it should get back to the top element.</p><p>I do not want to use <code>ViewSwitcher</code>, nor <code>ViewFlipper</code>.</p><p>How can I achieve that?</p>","237919","","3205","","2011-11-28 12:44:57","2013-03-03 12:50:13","How to get the ListView with carousel scrolling on Android?","<android><listview><scrolling>","1","2","1","",""
"1957831","1","1957910","","2009-12-24 10:46:44","104","90237","<p>I am using a linear layout to display a pretty light initial screen.  It has 1 button that is supposed to centre in the screen both horizontally and vertically.  However no matter what I try to do the button will top align centre.  I have included the XML below, can some one point me in the right direction?</p><p>Thanks</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;ImageButton android:id=""@+id/btnFindMe""     	android:layout_width=""wrap_content""     	android:layout_height=""wrap_content""    	android:layout_gravity=""center_vertical|center_horizontal""    	android:background=""@drawable/findme""&gt;&lt;/ImageButton&gt;&lt;/LinearLayout&gt;</code></pre>","238174","","","","","2014-03-24 17:33:56","Centre a button in a Linear layout","<xml><android><layout>","9","1","22","",""
"1958110","1","1958126","","2009-12-24 12:07:30","0","2189","<p>I was tryin to find any class to define a password field?How can we do that?Do we have a class for that or some method to edittext?</p>","199525","","","","","2009-12-24 12:36:25","Is there any widget for password entry?","<android><passwords><field>","3","0","","",""
"1958288","1","1958340","","2009-12-24 13:18:28","1","165","<p>I am trying to make HTTP get &amp; post connections.Which package is recommended for that?Is it java.net or org.apache.http?Does java.net comes included in the sdk?Any reference/code to connection makin would be appreciable as well.</p>","199525","","4203","","2009-12-24 14:07:37","2009-12-24 14:07:37","Which package do we use to make HTTP connections?","<android><http>","1","1","1","",""
"1958333","1","1958599","","2009-12-24 13:33:06","3","6440","<p>I am creating a new settings screen for my app and want to keep the look and feel similar to that of the standard applications.  I have seen many 3rd party apps also follow this style (Twidroid for example) and would like to know how best to go about creating this look?</p><p>Is there a ""template"" or Activity I can use or is it a case of constructing it from a table layout or similar?</p><p>Thanks.</p>","238174","","","","","2012-10-03 07:41:28","Settings screen layout style","<android><layout>","1","0","1","",""
"1958388","1","1958603","","2009-12-24 13:48:27","6","5567","<p>I'm sure I am missing something simple...</p><p><strong>Background:</strong></p><p>I am new to android and UI design, and I just wanted to play around with layouts. Right now I want to stack a checkbox on top of text label. I am using the following xml layout which <em>works fine</em>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;    &lt;CheckBox android:id=""@+id/check_box""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/check_box_text"" /&gt;    &lt;TextView android:id=""@+id/dummy_display""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/dummy_label"" /&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>My Tests (just to get a feel for how things works):</strong></p><ul><li><p>Scenario 1) When I set the <code>CheckBox</code>'s <code>layout_height</code> to <code>""fill_parent""</code>, the <code>CheckBox</code> takes up the whole screen and is aligned center (i.e. - the <code>TextView</code> disappears).</p></li><li><p>Scenario 2) If I  <em>instead</em> set the <code>TextView</code>'s <code>layout_height</code> to <code>""fill_parent""</code>, the <code>CheckBox</code> does <strong>NOT</strong> disappear. In fact, nothing disappears, and the layout looks the same as the above xml where everything is pushed to the top-left.</p></li></ul><p><strong>The Question (and comments):</strong></p><p>How come Scenario 1 works the way it works?</p><p>This behavior seems inconsistent to me. I thought that <code>fill_parent</code> is only supposed to let the element fill up whatever space is available in the parent. So to me, it seems that the <code>TextView</code> should get whatever space it <em>needs</em> (since it is <code>wrap_content</code>), but the <code>CheckBox</code> should take up the rest of the space (so the <code>TextView</code> would be forced to the bottom of the screen, but not invisible). In other words... Scenario 2 makes sense to me, but scenario 1 does not.</p><p>Please explain :-).</p><p>Thanks,</p><p>Tom</p>","87979","","","","","2010-05-27 22:53:03","android: simple LinearLayout and fill_parent question","<xml><android><layout><user-interface>","1","1","1","",""
"1958650","1","","","2009-12-24 15:09:19","0","1064","<p>I'm new to Android. I have a list of items and trying to associate single context menus to each list item. Have set setListAdapter and onListItemClick but when i click on any list item i get always the same context menu. Ideally, list item A should trigger menu A when cliccked and list item B should get menu B. Can't figure out how to do it. Could anybody help me find an example code i could use to learn how to do it?</p><p>Many thanks and happy xmas,</p><p>Stefano </p>","238267","","","","","2009-12-26 08:21:40","android - list items open context menus","<android>","2","0","1","",""
"1959012","1","1959437","","2009-12-24 16:56:03","20","21649","<p>I am working on a remote automated test framework for Android based on JUnit (tests run outside android, interacting with code inside it). It's all working fairly well, but one issue I have is that when I automatically start a fresh emulator, the screen starts out locked. This appears to affect my tests being able to run, plus, I want to watch the tests run (buttons clicked, text typed, etc.). If I manually start an emulator and unlock its screen, all works well.</p><p>Is there a way to programmatically unlock the screen in Android? A Java API, a command line or shell command, etc. would all be fine. Barring that, perhaps there is a way to start an emulator unlocked?</p>","168212","","","","","2012-08-06 18:05:33","How can I unlock the screen programmatically in Android?","<android><automation>","5","0","9","",""
"1959106","1","","","2009-12-24 17:24:52","4","3824","<p>Can i create the same kind of navigation that I have on the main screens?That is, I want different screens that I can navigate between using the touch-and-drag?I haven't seen anything about it, so it was time to ask :)</p><p>Oh, Im talking about apps for android :)</p>","238315","","","","","2010-10-02 14:28:03","android: how to create different ""screens"" and nav between them using touch-and-drag?","<android>","2","0","5","",""
"1959141","1","1959174","","2009-12-24 17:34:38","3","6317","<p>Visiting <a href=""http://www.google.com"" rel=""nofollow"">www.google.com</a> on the Android browser (or even with an android spoofed user-agent), presents the option to <strong>""Share Location""</strong>. When clicked, it uses the GPS/Cell phone towers to figure out the location. I tried the <em>google.loader.clientLocation</em> but that only works using the IP address. </p><p>Is there a method to tap into the Android OS and access GPS data from a regular web application (and not an Android application) similar to the way Google does? </p><p><em>[Perhaps Google uses the Google Gears app on Android to access this data.]</em> </p><p>Thanks!</p>","58106","","","","","2010-10-24 18:51:11","How do I detect user's location from a webpage opened in the Android browser?","<javascript><android><geolocation><gps>","3","0","2","",""
"1959496","1","","","2009-12-24 19:35:19","1","423","<p>I <a href=""http://groups.google.com/group/android-developers/browse%5Fthread/thread/9524f3f24c4f21a7?hl=en"" rel=""nofollow"">asked this question on the android-developers group</a> but didn't get any response, so I thought I'd try here.</p><p>The ADT eclipse plugin seems to have a pretty rigid idea of how an Android project should be structured - per <a href=""http://developer.android.com/guide/developing/eclipse-adt.html"" rel=""nofollow"">http://developer.android.com/guide/developing/eclipse-adt.html</a>, it needs to have the <code>AndroidManifest.xml</code> file at the root level of the project, plus <code>res</code>, <code>assets</code>, <code>gen</code> and <code>src</code> folders at the top level, and so on.</p><p>I'm wondering if it's possible to get the plugin to be a little more flexible with the layout it recognizes.  In particular, I've been using a build plugin for the (scala-based) <a href=""http://code.google.com/p/simple-build-tool/"" rel=""nofollow"">simple-build-tool</a>, which expects projects to be laid out in a more Maven-like fashion, like so:</p><pre><code>src/  main/    AndroidManifest.xml    assets/    res/    scala/    java/  test/    resources       &lt;files to include in test jar here&gt;    scala/       &lt;test Scala sources&gt;    java/       &lt;test Java sources&gt;</code></pre><p>(see the <a href=""http://code.google.com/p/simple-build-tool/wiki/Setup"" rel=""nofollow"">simple-build-tool docs</a>).</p><p>This is a layout I'm used to from maven-based java development.  When I load a project like it up in ADT, though, I get a lot of complaints about a missing <code>AndroidManifest.xml</code>, a missing <code>res</code> directory, and so on.  These things are all present, they just aren't where ADT expects them to be.</p><p>I don't necessarily need to use ADT to build my project, but I'd like to use it (and Eclipse) for editing.  Can anybody tell me whether it's possible to make it more flexible in the directories it uses to find various Android-related resources?  </p><p>Also, can anyone tell me whether the ADT plugin is open-source?  I can't seem to find a link to its source code anywhere. </p><p>(As a note, I've also been trying to wrangle <code>sbt</code> to just do things in a way that ADT likes, and it's probably possible to do but it seems very tedious.)</p>","87990","","67022","","2013-04-14 03:21:10","2013-04-14 03:21:10","Is there any way to make ADT project directory layout more flexible?","<android><sbt><adt><project-structure>","3","0","","",""
"1959522","1","1959570","","2009-12-24 19:44:41","0","676","<p>What class can we use to send a text message? I tried this on the emulator, 2.0:</p><pre><code>import android.telephony.SmsManager;SmsManager sms = SmsManager.getDefault();sms.sendTextMessage(...);</code></pre><p>and that works ok. On my G1 running 1.5, I get a verify error, guessing because SmsManager is not available in 1.5. Maybe for 1.5 we need to use the deprecated class?:</p><pre><code>android.telephony.gsm.SmsManager</code></pre><p>is that correct, or is there some other class we're supposed to use for sending text messages?</p><p>Thanks</p>","137193","","","","","2011-01-17 16:08:49","Which class should we use for sending sms/text messages?","<android>","1","0","","",""
"1959576","1","1992201","","2009-12-24 20:01:53","28","14263","<p>Is there a way to programmatically turn off that autosuggest list which pops up as you type in EditText?</p>","237858","","","","","2013-07-01 12:44:01","Turn off autosuggest for EditText?","<android>","7","0","4","",""
"1959676","1","1959849","","2009-12-24 20:31:36","0","1279","<p>I'm quite new to android and try to implement http client to communicate to a REST server. I'm starting with the Get method but I have some problems using android 2.0 on the emulator. </p><pre><code>String url = ""http://www.google.fr/search?q=android""HttpClient client = new DefaultHttpClient(new BasicHttpParams());HttpGet getMethod = new HttpGet((url));HttpResponse httpResponse = client.execute(getMethod);HttpEntity = httpResponse.getEntity());int length = (int) httpEntity.getContentLength();=&gt; length is -1 :-(</code></pre><p>A look into the logs gives me the UnresolvedHostException. </p><p>I searched on google and found several guys having the same problem but who didn't find any answer. Is there a particuliar way to configure the android emulator to have this working ?Just to precise, I have added the Internet access in the android manifest.</p><p>Thanks a lot for your help.Luc</p>","231957","","231957","","2009-12-28 10:04:29","2010-01-07 07:03:43","HttpGet in android, UnresolvedHostException","<android><http><emulator>","3","1","","",""
"1960249","1","","","2009-12-25 01:42:08","0","8243","<p>I test the intent-filter <code>android:priority=""0""</code> and intent-filter <code>android:priority=""20""</code> by <code>android.intent.category.HOME</code>. I list the information below,</p><pre><code>    &lt;activity android:name="".TestHomeActivity""              android:label=""@string/app_name""&gt;        &lt;intent-filter android:priority=""0""&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.HOME"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>When finishing system booting, it always pops up a dialog (ResolveActiivty) for choose preferred activity for this intent...</p><p>Can anyone can help this? is it error usage for <code>android:priority</code>?</p><p>Thanks!</p>","238439","","978112","","2011-10-06 05:12:17","2011-10-06 05:12:17","intent-filter with android:priority setting","<android><android-manifest>","3","0","2","",""
"1960436","1","","","2009-12-25 03:58:33","1","3179","<p>I'm trying to create a custom view and then using that custom view in my layout. </p><p>My custom view is called <code>NodePickup</code> and I have two files for that:</p><ul><li>res/layout/nodepickup.xml</li><li>src/com.codeshogun.android.swipesample/NodePickup.java</li></ul><p>nodepickup.xml:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/LinearLayout01""    android:layout_width=""fill_parent""    android:layout_height=""48dip""    android:background=""#aa0000""    android:orientation=""horizontal"" &gt;    &lt;ImageView        android:id=""@+id/ImageView01""        android:layout_width=""48dip""        android:layout_height=""48dip""        android:background=""#FFFFFF""        android:src=""@drawable/arrow_up_green"" &gt;    &lt;/ImageView&gt;    &lt;LinearLayout        xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/LinearLayout01""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:background=""#FFFFFF""        android:orientation=""vertical"" &gt;        &lt;TextView            android:id=""@+id/time""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""14:46 (15 min), 1 res""            android:textColor=""#000000""            android:textSize=""12dip"" &gt;        &lt;/TextView&gt;        &lt;TextView            android:id=""@+id/road""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""Karl XII gatan 6""            android:textColor=""#000000""            android:textSize=""12dip"" &gt;        &lt;/TextView&gt;        &lt;TextView            android:id=""@+id/name""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""Bertil Hĺkansson""            android:textColor=""#000000""            android:textSize=""12dip"" &gt;        &lt;/TextView&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>NodePickup.java:</p><pre><code>package com.codeshogun.android.swipesample.CustomViews;import com.codeshogun.android.swipesample.R;import android.content.Context;import android.util.AttributeSet;import android.view.LayoutInflater;import android.widget.LinearLayout;public class NodePickup extends LinearLayout {    public NodePickup(Context context, AttributeSet attributeSet) {        super(context, attributeSet);        LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        inflater.inflate(R.layout.nodepickup, this);    }}</code></pre><p>I am trying to add this view/widget to a layout file, main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ViewFlipper     xmlns:android=""http://schemas.android.com/apk/res/android""     xmlns:app=""http://schemas.android.com/apk/res/com.codeshogun.android.swipesample.CustomViews""    android:id=""@+id/flipper""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:background=""#FF0000"" /&gt;        &lt;!-- If I try to add it here, it wont work --&gt;        &lt;com.   &lt;!-- &lt;-- will not give me the widget...? --&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:background=""#00FF00"" /&gt;    &lt;/LinearLayout&gt;&lt;/ViewFlipper&gt;</code></pre><p>What am I doing wrong?</p>","178143","","356895","","2012-08-05 22:03:24","2012-08-05 22:03:24","Can't use/find my custom view when defining layout","<android><android-layout><android-linearlayout><android-xml>","0","5","","",""
"1960551","1","","","2009-12-25 05:25:59","3","5923","<p>I am a java neophyte.  I followed the tutorial at <a href=""http://developer.android.com/resources/tutorials/views/hello-formstuff.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-formstuff.html</a> to add a button and OnClick handler by copying the tutorial code into mine:</p><pre><code>public class FormStuff extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final ImageButton button = (ImageButton) findViewById(R.id.android_button);        button.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                // Perform action on clicks                Toast.makeText(FormStuff.this, ""Beep Bop"", Toast.LENGTH_SHORT).show();            }        });        }}</code></pre><p>In Eclipse this produces two errors</p><pre><code>Description Resource	Path	Location	TypeThe method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (new DialogInterface.OnClickListener(){})  FormStuff.java	/FormStuffExample/src/com/example/formstuffexample	line 17	Java ProblemThe type new DialogInterface.OnClickListener(){} must implement the inherited abstract method DialogInterface.OnClickListener.onClick(DialogInterface, int) FormStuff.java	/FormStuffExample/src/com/example/formstuffexample	line 17	Java Problem</code></pre><p>What am I doing wrong?  Thanks!</p>","238489","","1228","","2013-08-16 17:16:54","2013-08-16 17:16:54","Java error with the Google Android ""HelloFormStuff"" tutorial","<android>","2","0","1","",""
"1960731","1","","","2009-12-25 07:46:14","2","505","<p>I have a large text view that I am styling with a SpannableStringBuilder. I want to be able to assign custom click event handlers to certain spans of text. For example, if I click a superscript character I want it to pop up a toast with some information about what the superscript references. So far I have found linkify which helps to make regular expression type of things like emails and phone numbers launch appropriate activities. What I want to be able to do is define a span and its styling and assign a click handler to it. I haven't found anything built in that supports this kind of functionality and so I'm asking for anyone with a fresh idea of how to do this. Thanks.</p>","238515","","","","","2013-04-23 18:36:11","Can I add a click event to a text span?","<android><android-widget>","2","0","1","",""
"1960979","1","","","2009-12-25 10:59:08","15","12994","<p>I installed new fonts on my Android emulator.  The instructions say I have to reboot my device.  I tried using the ""Power Off"" button but it just displays ""Shutting Down"" and does nothing.  Even when I go to the adb shell and run ""reboot"" it hangs.  </p><p>Any ideas how to restart the emulator so that the new settings appear?</p><p>Thanks.</p>","56355","","","","","2014-03-16 15:03:57","Reboot/Power Off Android Emulator","<android><fonts><android-emulator>","5","0","3","",""
"1961277","1","1961280","","2009-12-25 14:52:19","3","684","<p>I have been looking for a easy way to add borders to custom made Views (Compounds or whatever), and the only answer I found was that there is no built-in support for that. Instead there are suggestions that you should add Views on top/below the View you want borders on and a bunch of others really messy ways to get borders.</p><p>Coming from the .NET-environment that is pretty brutal to have to do ugly workaround and ""hacks"" to get something as simple as borders.</p><p>Thus, I want to suggest that feature to the Android team. Im not sure how they can have missed it, but it is surely missed =)</p><p>So, is there any official way to suggest a feature in the SDK/framework? I have looked around a bit, but cant comment on their blogs, no e-mail addresses as far as I can see.</p>","178143","","1069068","","2013-03-19 14:42:34","2013-03-19 14:42:34","How can I suggest a feature to the Google Android team?","<android>","2","0","","",""
"1961701","1","1962116","","2009-12-25 18:53:03","8","1918","<p>I'm currently implementing a software keyboard ( using some sophisticated prediction ), and drawing it using canvas is insufficient in terms of perfomance. I'm getting frame drawing times well above 100ms, which is clearly unacceptable.</p><p>The keyboard itself consists of about 33 keys, each of them drawn using drawRoundRect and a simple Text above that. No widgets whatsoever are used, so it's the plain perfomance. Also, almost all of Googles perfomance tips are in use, so thats not the reason for the speed either.</p><p>I've now reached a point where switching to opengl actually would make sense, but I'm still sceptical considering the impact an opengl-based keyboard might have on battery life.</p><p>As I've found no sufficient documentation on that topic, I hope someone here can point me to the right direction.</p>","228358","","44729","","2011-05-26 15:46:27","2011-05-26 15:46:27","Is OpenGL on Android a battery killer?","<android><opengl-es><surfaceview><battery>","3","0","1","",""
"1962266","1","1962490","","2009-12-25 23:53:29","2","1259","<p>As a goal for my first Android application to learn the Android SDK, I am trying to create a simple RSS viewer for a specific url. Disregarding the networking side of the goal, I am having trouble with getting a listView to display a custom layout. </p><p>What I'd like to do is have each row of a list view show one of two images(read or unread), followed by some text. I'm not really having a problem, it's more that there aren't any examples that I could find (I might be looking in the wrong place) that covered custom layouts depending on conditions in code.</p><p>Any help?</p>","118241","","","","","2009-12-26 02:41:15","Custom Updatable ListView - Android Development","<android><listview>","1","0","","",""
"1962274","1","","","2009-12-25 23:57:00","0","1556","<p>im working on a simple Android app, it is much like any other simple Database app. I have 4 EditText fields where the user inputs 4 different small pieces of text. I want this text to be inserted in to my Database table in the corrects rows for my columns. I am not really sure how to go about doing this. I know onClickListener needs to be used but not sure how to use it.</p>","238708","","","","","2009-12-26 10:30:07","How to insert rows/info into Android SQL DB with EditText and Buttons?","<android><android-widget>","3","0","","",""
"1962363","1","1962427","","2009-12-26 01:13:16","0","558","<p><strong>Duplicate:</strong> <a href=""http://stackoverflow.com/questions/167179/java-tutorial"">Question 167179: Java Tutorial</a></p><p>I want to learn Java because I want to program for the Android but don't know the best place to look. Where did you go.</p>","225020","","3171","","2009-12-26 10:26:37","2013-11-01 12:00:46","Where can I go to learn Java","<java><android>","7","0","4","",""
"1962400","1","","","2009-12-26 01:29:30","1","2036","<p>I'm making a game for android where I need to draw a lot of points that change position every frame.  I use the ndk to get faster processing performance of the math/physics section of the game, so I need to use OpenGL to get the fastest performance.</p><p>Right now, I make a texture every frame out of an array that holds the colors of every pixel.  I am only able to get ~10 frames per second with this method.  Is there anyway I could speed this up? </p>","135135","","44729","","2010-06-18 15:07:01","2010-06-18 15:07:01","What is the fastest way to draw a lot of Points in OpenGL ES?","<android><opengl-es><textures><android-ndk>","2","1","1","",""
"1962856","1","","","2009-12-26 07:55:27","0","363","<p>How to properly save a numeric values into SQLite3. I've used Real type for storing numeric value. For example: when I store 233333.00 is fine. But when i store 23333333.00 it becomes 23333300.00. Why is it saved as 2.3333333E7 and retrieved as 2.33333e+07. Is there a way to overcome this?</p>","238770","","5555","","2009-12-26 08:49:26","2009-12-26 10:28:31","Saving and retrieeving numeric values from Sqlite3","<android><sqlite3>","2","0","","",""
"1962865","1","1962915","","2009-12-26 08:02:26","5","4174","<p>Do you know about how to detect two touches/taps on a <code>ListView</code>?</p><p>I am trying to have the following method called when double touched:</p><pre><code>@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {}</code></pre><p>Thanks in advance.</p>","227889","","3171","","2009-12-26 10:24:13","2012-03-19 21:12:19","How to detect a double touch/taps on an Android ListView?","<android>","4","0","3","",""
"1963105","1","1963301","","2009-12-26 10:52:08","9","21336","<p>Hey,since quite some time I'm trying to listen to .pls files (shoutcasts). I have to say that I failed horrible. Since StreamFurious can do it it must be possible. First I tried to connect to the shoutcast via sockets (TCP and UDP) --> failed. I couldn't even receive one byte from the server.</p><p>I'm at the verge of tears. I don't even have a clue what's the best way to establish a connection and afterwards continually download/receive the data stream. </p><p>I really hope someone can point me to the right direction and give me a short code snippet if available.</p><p>RgdsLayne</p>","238801","","","","","2013-04-19 23:03:12","Listen to a shoutcast with Android","<java><android><sockets><stream><radio>","3","1","13","",""
"1963674","1","","","2009-12-26 16:08:55","0","974","<p>I think I must be missing something really basic here, but if my program dies, DDMS doesn't tell me which line it died on - all the stack references are inside the Android source code giving ""source not found"" errors.</p><p>If anyone can help, I would really appreciate it, as Anroid is driving me crazy.</p><p>Thanks!</p>","237287","","","","","2009-12-26 18:39:19","Can Android DDMS show the line the program failed?","<android><ddms>","2","0","","",""
"1963686","1","1963717","","2009-12-26 16:15:58","18","12199","<p>I've searched about sets line's width and no succeed. </p><p>How to set Line width ? What method is used for it ?</p><p>Please help guys.</p><p>Thanks. </p>","227889","","75170","","2009-12-26 17:34:14","2009-12-26 17:34:14","How do you set a line's width when drawing in Android?","<android>","1","0","","",""
"1963932","1","1963957","","2009-12-26 18:03:18","4","3233","<p>New Android developer here - I'm hoping this is simple.I want to create a ""row-based"" prefs dialog, like you see in most standard apps.  You know, black background, fading-line separators, bigger/bold label text for each entry, smaller description text, perhaps a checkbox/down arrow.  </p><p>Is there a standard object in the Android API for this?  If not, how do people usually create these?</p>","238906","","","","","2009-12-26 18:18:44","Creating a standard Android preferences dialog","<android><user-interface>","1","0","2","",""
"1964077","1","","","2009-12-26 19:06:04","8","13963","<p>I've read the answer to a question as to how to access the contents of the databases, however I cannot seem to get it to work on my machine. Here is the shell log:</p><pre><code>C:\android-sdk-windows\tools&gt;adb -s emulator-5554 shell# sqlite3 /data/data/com.android.demo.notepad2/databases/notessqlite3 /data/data/com.android.demo.notepad2/databases/notesSQLite version 3.5.9Enter "".help"" for instructionssqlite&gt; .tables.tablessqlite&gt; ^CC:\android-sdk-windows\tools&gt;</code></pre><p>SQLite simply echos my commands back to me, even although the Eclipse file browser tells me it exists. If I use the sqlite3 tool and use "".tables"" the commands are accepted.</p><p>Is the SQLite syntax different through the emulator is am I missing something?</p><p>(Sorry for so many questions, there doesn't seem to be much coherent documentation on Anroid!)</p><p>Thanks!</p>","237287","","237287","","2009-12-26 19:59:41","2011-11-04 17:57:09","How can you access the contents of Android Emulator databases?","<android><sqlite><adb>","3","2","4","",""
"1964193","1","1964207","","2009-12-26 19:49:48","17","15573","<p>Is it possible to set the android wallpaper image programatically? I'd like to create a service that downloads an image from the web and updates the home screen wallpaper periodically.</p>","82017","","","","","2012-10-18 10:06:55","Android - how to set the wallpaper image","<android><image><wallpaper>","4","1","7","",""
"1964559","1","1964645","","2009-12-26 22:48:51","0","4138","<p>I have a custom layout that I have written that basically just displays a bunch of ImageViews.  I am handing onTouch events for all the ImageViews in my layout.  However, if a user touches one imageView and then drags over another ImageView, I would like to be able to handle that as well.</p><p>How would I go about capturing this behavior?</p>","208501","","","","","2009-12-26 23:37:14","Android ""hover"" event in custom layout","<android><layout><touch>","1","0","","",""
"1964620","1","1964696","","2009-12-26 23:28:02","5","12219","<p>HI all,</p><p>I know I can access android source code from <a href=""http://android.git.kernel.org/"" rel=""nofollow"">http://android.git.kernel.org/</a>, but it's hard to select the right git repo if I only know the package and the name of an android class. </p><p>Isn't there a way to locate a file in <a href=""http://android.git.kernel.org/"" rel=""nofollow"">http://android.git.kernel.org/</a> ?</p><p>Thanks in advance</p>","231417","","648313","","2011-07-13 20:59:40","2014-02-04 10:08:16","How to find easily the source of an android class","<android><android-source>","5","1","3","",""
"1964708","1","1964759","","2009-12-27 00:03:55","3","654","<p>I'm considering opening up a project to create an i-phone virtual machine for android 2.0 (read motorola droid) before i do so i have some questions:</p><ol><li><p>Does one already exist that i just missed?</p></li><li><p>Can the the Droid's Arm Cortex A8 down-clocked to 550MHz (thanks wikipedia) handle an I-Phone abstraction layer?</p></li><li><p>Performance wise the best thing to do is write the app in C++, but for the health of the system, would it be better to put the iphone vm on top of the dalvik vm? Which approach would be better and why.</p></li></ol>","213884","","213884","","2009-12-27 04:56:44","2009-12-27 04:56:44","I-Phone VM for Android","<java><c++><iphone><android><virtualization>","2","0","1","",""
"1964770","1","","","2009-12-27 00:30:37","0","1166","<p>What I'd like to do is change the state (really, the background) of an EditText to reflect validity of its contents. E.g. if the user enters 999 where 999 is contextually invalid, the EditText should have a red border in place of the default orange border, likewise once the text is valid it should have a green border. </p><p>Methods I've explored:</p><ol><li>Changing the style of the EditText programmatically via something like editor.setStyle(R.styles.SomeID). Seems to be impossible within android.  </li><li>Adding custom states (state_valid, state_invalid) in R.attr, associating them with red/ green 9-patches, then calling drawable.setState() with one of these states. This worked in the sense that the state could be read back via getState(), but the border did not change colour.</li><li>Setting the background resource directly upon detection of (in)validity. This works ok, causing the correct visual effect, but seems a little hokey, and allows only one state (e.g. I have to manually check for whether the EditText is pressed, enabled etc).</li></ol><p>Given limited UI real-estate I am hesitant to introduce a separate UI element to visually feedback the text's validity to the user, hence my desire to display it in the EditText itself.</p><p>So.. is this something that's even feasible? It seems like a fairly common use case, so has anyone achieved what I'm trying to do in a straightforward and elegant manner? </p>","239006","","","","","2010-02-21 02:10:19","Android: view/ drawable custom styles possible?","<android><coding-style><drawable>","3","0","1","",""
"1964788","1","1964901","","2009-12-27 00:39:50","16","3519","<p>I've been intrigued by all the android world since I first learned about it and would like to get my hands dirty developing for it. The question that comes to mind is if it's worth buying the unlocked phones that Android sells directly or not.</p><p>Those phones (<a href=""http://android.brightstarcorp.com/index.htm"">link</a>) quoting the Android page:</p><blockquote>  <p>Run and debug your Android™  applications directly on a device.  Modify and rebuild the Android  operating system, and flash it onto a  phone. The Android Dev Phone 1 is  carrier independent, and available for  purchase by any developer registered  with Android Market™.</p>    <p>Please note that this device is  intended for development purposes, and  may not include certain features found  on consumer Android devices.</p></blockquote><p>So will it be worth it to purchase one of those as a tool for app testing as opposed to developing and testing just on Eclipse or one of the other IDEs and emulators.</p><p>-Have you tried it, do you own one?I'm assuming they have the same specs as the HTC Dream and the HTC Magic, since they look exactly the same although they have a 'developers edition' custom black design not that I really care about the design for this particular item.</p><p>All comments are welcomed,Thanks in advance.</p><p><strong>Update</strong>:</p><p>I'll leave it open until tomorrow to see if there are any more answers, then I'll just pick the most voted since it's really a subjective question with no good or bad answer.</p>","229208","","21234","","2010-12-01 11:58:57","2014-03-03 17:11:48","Is it worth purchasing Google Android Dev phone?","<android><phone>","9","4","5","",""
"1964789","1","1964928","","2009-12-27 00:40:30","16","15042","<p>I have a few elements in a RelativeView with the align bottom attribute set, when the soft keyboard comes up the elements are hidden by the soft keyboard.</p><p>I would like them to move up so that if there is enough screen space they are shown above the keyboard, or to make the section above the keyboard scrollable so the user can still see the elements.</p><p>Any ideas on how to approach this?</p>","164980","","","","","2013-10-16 15:00:57","Move layouts up when soft keyboard is shown?","<android><gui><user-interface>","3","1","7","",""
"1964819","1","1964910","","2009-12-27 00:57:19","5","5731","<p>I'm developing a lite version for an app on the Android. How can I start an Intent to open the Android Market, preferably with the full version of my app displayed? This is difficult to test on an emulator (which is the closest thing to a device I have), as there seems to be no legal way of installing the Market on it.</p>","209838","","209838","","2009-12-27 01:36:08","2011-08-28 07:33:17","Start Android Market from App","<java><android>","2","0","6","",""
"1964969","1","1964974","","2009-12-27 02:23:35","22","16035","<p>I'm starting a service with an intent where I put extra information.</p><p>How can I get the intent in the code of my service?</p><p>There isn't a function like <code>getIntent().getExtras()</code> in service like in activity.</p>","239033","","476747","","2012-04-24 08:56:50","2012-12-17 09:12:16","Android: how to get the intent received by a service?","<android><service><android-intent>","2","0","4","",""
"1965158","1","","","2009-12-27 04:27:22","2","1142","<p>Have you seen this exception :I am trying to make Satellite Map view for my application. But no succeed, when start activity that calls Satellite Map Activity following exception throws : </p><p><hr /></p><pre><code>12-27 12:08:34.895: INFO/ActivityManager(591): Starting activity: Intent { comp={com.mydomain.ca/com.mydomain.ca.SecondActivity} (has extras) }12-27 12:08:35.233: WARN/dalvikvm(2845): Unable to resolve superclass of Lcom/mydomain/ca/SatelliteMapActivity; (61)12-27 12:08:35.245: WARN/dalvikvm(2845): Link of class 'Lcom/mydomain/ca/SatelliteMapActivity;' failed12-27 12:08:35.297: ERROR/dalvikvm(2845): Could not find class 'com.mydomain.ca.SatelliteMapActivity', referenced from method com.mydomain.ca.SecondActivity.startMapActivity12-27 12:08:35.317: WARN/dalvikvm(2845): VFY: unable to resolve const-class 172 (Lcom/mydomain/ca/SatelliteMapActivity;) in Lcom/mydomain/ca/SecondActivity;12-27 12:08:35.317: WARN/dalvikvm(2845): VFY:  rejecting opcode 0x1c at 0x000512-27 12:08:35.344: WARN/dalvikvm(2845): VFY:  rejected Lcom/mydomain/ca/SecondActivity;.startMapActivity ()V12-27 12:08:35.344: WARN/dalvikvm(2845): Verifier rejected class Lcom/mydomain/ca/SecondActivity;12-27 12:08:35.344: WARN/dalvikvm(2845): Class init failed in newInstance call (Lcom/mydomain/ca/SecondActivity;)12-27 12:08:35.355: DEBUG/AndroidRuntime(2845): Shutting down VM12-27 12:08:35.355: WARN/dalvikvm(2845): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)12-27 12:08:35.355: ERROR/AndroidRuntime(2845): Uncaught handler: thread main exiting due to uncaught exception12-27 12:08:35.417: ERROR/AndroidRuntime(2845): java.lang.VerifyError: com.mydomain.ca.SecondActivity12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at java.lang.Class.newInstanceImpl(Native Method)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at java.lang.Class.newInstance(Class.java:1472)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at android.app.Instrumentation.newActivity(Instrumentation.java:1097)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2186)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at android.os.Handler.dispatchMessage(Handler.java:99)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at android.os.Looper.loop(Looper.java:123)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at android.app.ActivityThread.main(ActivityThread.java:3948)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at java.lang.reflect.Method.invokeNative(Native Method)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at java.lang.reflect.Method.invoke(Method.java:521)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)12-27 12:08:35.417: ERROR/AndroidRuntime(2845):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p><hr /></p><p>What is wrong here ? </p>","227889","","2469","","2009-12-27 04:29:37","2011-05-11 21:09:58","Google MapActivity Exception?","<android>","1","0","","",""
"1965242","1","2080808","","2009-12-27 05:16:56","7","12749","<p>I am using a TableLayout in my application. It contains four TableRows each containing four ImageViews. The behavior I want is to scale the layout to fit the shortest dimension.</p><p>It works fine in portrait mode but fails miserably in landscape mode.</p><p>From the <a href=""http://developer.android.com/reference/android/widget/TableLayout.html"">documentation</a> it looks like this is because the TableRow layout_height is always set to WRAP_CONTENT. While I can set the dimensions of the individual Views, the TableLayout won't render at all if I set the View layout_height to FILL_PARENT.</p><p>I feel like there is something simple I am missing. Is there a way to get the TableLayout with TableRows to scale to fit the height in landscape mode?</p><p>XML Layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/table""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:shrinkColumns=""*""&gt;&lt;/TableLayout&gt;</code></pre><p>Java:</p><pre><code>public class Example extends Activity {private TableLayout mTable;private int[] mDrawableIds = {  R.drawable.draw01, R.drawable.draw02, R.drawable.draw03, R.drawable.draw04, R.drawable.draw05, R.drawable.draw06,   R.drawable.draw07, R.drawable.draw08, R.drawable.draw09, R.drawable.draw10, R.drawable.draw11, R.drawable.draw12, R.drawable.draw13, R.drawable.draw14, R.drawable.draw15, R.drawable.draw16 };@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mTable = (TableLayout)findViewById(R.id.table);    for (int j=0; j&lt;4; j++) {        TableRow tr = new TableRow(this);        tr.setLayoutParams(new ViewGroup.LayoutParams(  LayoutParams.FILL_PARENT,                LayoutParams.WRAP_CONTENT));           for (int i=0; i&lt;4; i++) {               ImageView iv = new ImageView(this);               iv.setImageResource(mDrawableIds[j*4+i]);               iv.setScaleType(ImageView.ScaleType.FIT_CENTER);               iv.setAdjustViewBounds(true);               tr.addView(iv);           }        mTable.addView(tr);    }}}</code></pre>","239074","","239074","","2009-12-29 21:02:06","2010-01-17 11:29:27","How can I get an Android TableLayout to fill the parent in landscape mode?","<android><tablelayout>","2","2","3","",""
"1965306","1","1966042","","2009-12-27 05:55:08","2","493","<p>How to zoom in by giving 2 coordinates(2 Locations) ?</p><p>Is there API method for android ?</p><p>Thanks in advance.</p>","227889","","","","","2009-12-27 14:15:28","How to zoom in by giving coordinates?","<android>","1","0","","",""
"1965362","1","1971951","","2009-12-27 06:33:23","0","681","<p>I am trying to make mapView can be moved when navigation movement (when user click device arrow key left, right, up, down). </p><p>How to make it ?</p>","227889","","683261","","2013-04-20 07:34:22","2013-04-20 07:34:22","MapView navigation movement?","<android>","1","0","","",""
"1965568","1","4348783","","2009-12-27 09:19:03","8","4150","<p>I'm trying to use OAuth in an Android app. I have it working correctly but have sometimes run into a problem during the authentication phase. In Android, I launch the browser for the user to login and authenticate. Then the callback url will redirect back to my application.</p><p>Here is the problem. My application has a OAuth consumer and provider as members of my main class. When the browser is launched for authentication, sometimes my main Activity is discarded to save memory. When the callback url relaunches my main Activity, the provider and consumer are new instances and therefor don't work when I try to make a request to the api. If the main Activiy was not freed during the authentication phase, then everything works correctly because I'm still working with the original consumer and provider. </p><p>I tried using onSaveInstanceState() and onRestoreInstanceState(), but haven't been successful. It seems the onRestoreInstanceState() is not called when my callback url is handled. Seems to go straight to the onResume().</p><p>What is the correct method for persisting the consumer and provider in this case?</p>","118999","","","","","2011-07-15 13:56:11","OAuth instance state in Android","<android><oauth>","6","0","9","",""
"1965784","1","","","2009-12-27 11:40:32","45","86583","<p>I've been trying to stream mp3's over http using Android's built in MediaPlayer class. The documentation would suggest to me that this should be as easy as :</p><pre><code>MediaPlayer mp = new MediaPlayer();mp.setDataSource(URL_OF_FILE);mp.prepare();mp.start();</code></pre><p>However I am getting the following repeatedly. I have tried different URLs as well. Please don't tell me that streaming doesn't work on mp3's.</p><pre><code>E/PlayerDriver(   31): Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupportedW/PlayerDriver(   31): PVMFInfoErrorHandlingCompleteE/MediaPlayer(  198): error (1, -4)E/MediaPlayer(  198): start called in state 0E/MediaPlayer(  198): error (-38, 0)E/MediaPlayer(  198): Error (1,-4)E/MediaPlayer(  198): Error (-38,0)</code></pre><p>Any help much appreciated, thanksS</p>","219360","","56285","","2014-01-27 22:15:47","2014-01-27 22:15:47","Streaming Audio from A URL in Android using MediaPlayer?","<android><mp3><android-mediaplayer><audio-streaming>","5","8","39","",""
"1965987","1","","","2009-12-27 13:51:19","1","635","<p>I have begun learning OpenGL ES under Android 1.5 (I use the emulator and an HTC Magic device). However, even for the simplest of their samples, the one that only renders a blank screen, if you switch the orientation several times (switching like ~5 times between portrait and landscape is usually enough), the app freezes and I need to force close it.</p><p>Does anyone know what the problem is? Can anyone else reproduce it? You should be able to, it's the same in the emulator too.</p><p>Thanks in advance,Cosmin</p><p>Update: The LogCat output differs when running with the debugger attached.</p><pre><code>DEBUG/SurfaceFlinger(61): pid 3598 requesting gpu core (owner = -1)</code></pre><p>versus</p><pre><code>WARN/SurfaceFlinger(61): timeout expired mFreezeDisplay=1, mFreezeCount=1WARN/WindowManager(61): App freeze timeout expired.WARN/WindowManager(61): Force clearing freeze: AppWindowToken{43c7adb0 token=HistoryRecord{43c7a900 {ro.brite.android.nehe01/ro.brite.android.nehe01.GlApp}}}WARN/SurfaceComposerClient(3598): lock_layer timed out (is the CPU pegged?) layer=1, lcblk=0x424340a0, state=00000042 (was 00000042)</code></pre>","532021","","44729","","2010-06-18 15:06:46","2010-06-18 15:06:46","The basic OpenGL sample always freezes in Android 1.5 when changing orientation","<android><opengl-es>","0","4","","",""
"1966019","1","1966036","","2009-12-27 14:05:23","2","3255","<p>I'm developing an Android application that might be used at night. Therefor, I need to turn off the  buttons' backlight. How can I do this? On my own phone the backlight turns off after a while, but on the Motorola Droid I don't think this happens. </p><p>I'm using a wakelock to keep the screen on. Should I use another flag or how can I do this?</p><pre><code>PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, WAKE_LOCK_TAG);mWakeLock.acquire();</code></pre><p>Thank you very much!</p><p>//Kaloer</p>","236130","","236130","","2012-05-05 08:42:04","2012-05-05 08:42:04","Turn off backlight of the buttons","<android>","3","2","","",""
"1966139","1","","","2009-12-27 15:02:27","0","264","<p>I would like to know how to run a HelloWorld application directly on my <a href=""http://en.wikipedia.org/wiki/Archos%5FGeneration%5F5"" rel=""nofollow"">Archos5IT</a> and not on the emulator. It doesn't work at all !!! I developed an application and I would like to try it on my Archos, but doesn't work, so I went down to the HelloWorld but nothing works...</p><p>Any ideas?</p>","239190","","63550","","2009-12-27 17:01:37","2010-08-07 10:49:45","Cannot run my APK in archos5IT","<android>","3","1","1","",""
"1966156","1","","","2009-12-27 15:09:57","12","13385","<p>How do I write code which layouts UI elements (Buttons, etc) over camera preview on Android ?</p>","2425000","","","","","2011-05-28 04:41:28","Camera preview UI overlay on Android?","<android><user-interface><camera><overlay><preview>","1","0","7","",""
"1966393","1","1966513","","2009-12-27 16:57:03","5","8125","<p>I'm completely new to Android development, but I just got a HTC Hero and would like to develop a few applications for it. However, I've use a laptop as my dev machine and the emulator is extremely slow. It took around 10-15 mins to boot up and although I could leave it on, it generally slows down the system when using other applications (like a web browser/Eclipse IDE etc..) What is the best way to develop for an Android phone? I could simply plug in the HTC and constantly load the new APK, but that just seems too long a process to test minor changes. Are there any other methods available for debugging applications, or will I have to brave the emulator until I can get a new system?Thanks</p>","187697","","","","","2013-08-16 06:40:52","Android emulator alternative","<android><performance><android-emulator>","4","0","1","",""
"1966665","1","1967317","","2009-12-27 18:36:10","1","2974","<p>Currently I'm working on a dialog which consists of title, description, tags and footer. The title can be long and in this case the text should automatically be displayed in multiple lines. The description is also longer and should fill multiple lines.At the bottom of the dialog has to be the footer (also if the title and description don't fill whole screen).I tried to do create the layout described about but had a problem with long text - if the content is long it doesn't display multiple lines but extends main view (LinearView) so the content extends over the visible area.</p><p>Here I'm pasting the print screen of the current state and the mockup of the desired layout:<img src=""http://img52.imageshack.us/img52/9697/androidscreenshot.png"" alt=""alt text""><img src=""http://img69.imageshack.us/img69/3609/screenshot20091227at716.png"" alt=""alt text""></p><p>TextView ""Footer"" and buttons OK and Cancel should appear at the bottom of the screen and the title (""Title Title Title...) and description text should automatically appear in multiple lines instead of extending the parent view.</p><p>I would really appreciate if anyone of you could give a tip about solving these layout issues.</p><p>Thanks!</p>","22996","","","","","2012-04-10 05:39:50","android layout question","<android><design><layout>","1","0","1","",""
"1966694","1","","","2009-12-27 18:47:17","0","200","<p>I'm new to Android. As a learning case, I'd likr to build a software which divide the homepage screen to two screens. The upper screen will displays an updated whether data of a pre selected city, actually, airport. and the lower screen will display the regular homepage screen. How it can be done? Thanks, Eyal. </p>","239253","","","","","2009-12-27 20:28:52","Splitting the homepage screen to two screens","<android>","2","0","","",""
"1966775","1","1967971","","2009-12-27 19:28:19","7","6890","<p>Is there something for the Android OS with which you can implement scroll pagination?</p><p>*<strong>Edit<br /></strong>With scroll pagination I mean pagination like on the homescreen, you can swipe right and left and go to the next or previous page.</p>","174868","","174868","","2010-01-05 11:07:32","2010-01-05 11:07:32","Android Scroll Pagination","<android><scrolling><pagination>","2","1","8","",""
"1966802","1","1967010","","2009-12-27 19:39:57","27","37139","<p>How do you make those standard header labels in the ListView Control?</p><p>An example would be in the contacts application you see the first letter of the grouped contacts for each letter in the alphabet.</p><p>If possible please provide some code snippets on how to construct the grouped data and the display of the ListView.</p>","42005","","","","","2012-06-12 09:46:45","Android ListView Headers","<android><listview>","2","1","28","",""
"1967039","1","","","2009-12-27 21:03:33","11","10671","<p>I have a custom view derived from View. I'd like to be notified when the view is clicked, and the x,y location of where the click happened. Same for long-clicks. </p><p>Looks like to do this, I need to override onTouchEvent(). Is there no way to get the x,y location of the event from an OnClickListener instead though?</p><p>If not, what's a good way of telling if a motion event is a 'real' click vs a long-click etc? The onTouchEvent generates many events in rapid succession etc.</p><p>Thanks</p>","137193","","","","","2012-01-23 14:31:35","OnClickListener - x,y location of event?","<android>","2","0","2","",""
"1967065","1","1967284","","2009-12-27 21:15:53","2","1195","<p>I've seen several examples of this but they seem to be for older versions of the SDK. I'm trying to setup basic audio recording and the following code is giving me a <code>NullPointerException</code> when targeting version 2.0 of the SDK.</p><pre><code>ContentValues values = new ContentValues(2);values.put(MediaStore.MediaColumns.TITLE, ""somename"");values.put(MediaStore.MediaColumns.DATE_MODIFIED, System.currentTimeMillis());ContentResolver resolver = getContentResolver();Uri base = MediaStore.Audio.Media.INTERNAL_CONTENT_URI;Uri newUri = resolver.insert(base, values);</code></pre><p>I've narrowed it down to the last line as being what is throwing the exception. I've tested with the Log class and have found that the <code>base</code> and <code>values</code> variables are being set correctly.</p><p>Here is the exception output.</p><pre><code>12-27 11:08:18.608: ERROR/DatabaseUtils(197): Writing exception to parcel12-27 11:08:18.608: ERROR/DatabaseUtils(197): java.lang.NullPointerException12-27 11:08:18.608: ERROR/DatabaseUtils(197):     at com.android.providers.media.MediaProvider.insertInternal(MediaProvider.java:1478)12-27 11:08:18.608: ERROR/DatabaseUtils(197):     at com.android.providers.media.MediaProvider.insert(MediaProvider.java:1370)12-27 11:08:18.608: ERROR/DatabaseUtils(197):     at android.content.ContentProvider$Transport.insert(ContentProvider.java:150)12-27 11:08:18.608: ERROR/DatabaseUtils(197):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:140)12-27 11:08:18.608: ERROR/DatabaseUtils(197):     at android.os.Binder.execTransact(Binder.java:287)12-27 11:08:18.608: ERROR/DatabaseUtils(197):     at dalvik.system.NativeStart.run(Native Method)</code></pre><p>Also, in a lot of the examples I have seen, they add the mime type to the <code>ContentValues</code> object using something like</p><pre><code>values.put(MediaStore.MediaColumns.MIME_TYPE, recorder.getMimeContentType());</code></pre><p>where the recorder variable is a MediaRecorder object. It appears however that the <code>getMimeContentType()</code> method no longer exists. Could the insert be throwing the exception because I am not setting the mime type column? If so, How can I get the mime type in the new version of the sdk?</p><p>Thanks in advance!</p><p>EDIT:</p><p>I Think I found how to set the content mime type for the insert call.the line I came up with looks like </p><pre><code>values.put(MediaStore.MediaColumns.MIME_TYPE, MediaStore.Audio.Media.CONTENT_TYPE);</code></pre><p>I do however still get a NullPointerException</p>","176192","","176192","","2009-12-27 21:57:51","2010-09-11 14:07:14","Audio recording NullPointerException","<android>","2","0","","",""
"1967085","1","1967230","","2009-12-27 21:20:25","1","7523","<p>I would like to create a dialog-style form which would fill the bigger screen area (left, right, top, bottom padding 10px).</p><p>I defined the style ""CupCakeDialog"" the following way:</p><pre><code>&lt;style name=""CupcakeDialog"" parent=""android:Theme.Dialog""&gt;    &lt;item name=""android:windowAnimationStyle""&gt;@null&lt;/item&gt;&lt;/style&gt;</code></pre><p>and by running the activity:</p><pre><code>getWindow().requestFeature(Window.FEATURE_PROGRESS);getWindow().requestFeature(Window.FEATURE_NO_TITLE);setContentView(R.layout.ad_popup);</code></pre><p>The dialog is displayed the following way:</p><p><img src=""http://img199.imageshack.us/img199/1299/popupstackoverflow.png"" alt=""alt text""></p><p>Does anyone know how to make the dialog bigger (extend height)?</p><p>Thank you!</p>","22996","","","","","2013-01-18 16:04:12","android: how to resize dialog","<android><layout><dialog>","2","0","","",""
"1967136","1","1967160","","2009-12-27 21:48:22","17","30690","<p>I am trying to write a very simple Android application that checks the signal strength of the current cell.  So far, I have only found something called <code>getNeighboringCellInfo()</code>, but I'm not really sure if that includes the current cell.</p><p>How do I get the CURRENT cell signal strength in Android?</p><p>Does <code>getNeighborCellInfo()</code> get the current cell? It doesn't seem like it based on the results that I have been able to get with it.  Here's my current code:</p><pre><code>List&lt;NeighboringCellInfo&gt; n = tm.getNeighboringCellInfo();//Construct the stringString s = """";int rss = 0;int cid = 0;for (NeighboringCellInfo nci : n){    cid = nci.getCid();    rss = -113 + 2*nci.getRssi();    s += ""Cell ID: "" + Integer.toString(cid) + ""     Signal Power (dBm): "" +             Integer.toString(rss) + ""\n"";}mainText.setText(s);</code></pre>","234933","","281545","","2013-07-08 13:16:48","2013-07-08 13:16:48","How to get cell service signal strength in Android?","<android><signals><rssi>","2","1","6","",""
"1967315","1","1967357","","2009-12-27 23:02:20","0","767","<p>I have android application with ListView, where each row has own ""refresh"" button. Refreshing content is based on asynchronous http call, so until it completes (or timeout) I'd like to display some kind of graphical ""busy"" marker in each affected (clicked) row. What is best practice to do it? I see animated gifs - i.e. ones with rotating circle - does not animate on Android. So far I tried RotateAnimation on static image, it looks OK but it's not what people are accustomed to.</p><p>Is there any better way to mark individual row in ListView as being updated? Target SDK is so far 1.5.</p>","7162","","","","","2009-12-28 15:48:46","Android - what busy marker for individual rows in ListView","<android><list><listview><busy-cursor>","3","2","","",""
"1967589","1","","","2009-12-28 00:56:57","2","929","<p>I'm using a <code>Gallery</code> widget. I'd like to automate scrolling. Not sure if this is possible?</p><p>Gallery has a <code>scrollTo()</code> and <code>scrollBy()</code> set of methods, which I can call from a <strong>timer</strong> etc, but that ends up scrolling the entire gallery widget itself, not its children view content.</p><p>There must be some way to automate scrolling?</p><p>Thanks</p>","137193","","603744","","2011-06-22 06:08:40","2011-11-10 11:44:03","Scroll a Gallery widget?","<android>","2","0","","",""
"1967740","1","","","2009-12-28 02:30:10","13","10843","<p>I am using onKeyListener to get the onKey events. It works fine with the normal keyboard. But it does not work with soft keyboard. I am only able to get onKey events for numerics and not alphabets. Is there any workaround to solve this? Any kind of help will be greatly appreciated. </p>","","user238974","234938","","2009-12-30 02:10:40","2013-04-17 04:15:46","onKeyListener not working with soft keyboard (Android)","<android><listener><onkeydown>","5","4","3","",""
"1967814","1","1973152","","2009-12-28 03:09:19","4","13524","<p>I have an Activity with an AutoComplete box on it. Whenever the text changes, I want to call a web service and populate the ArrayAdapter with the new String[] returned. This part all works great, except the list in the UI isn't being refreshed when there are all new values in String[] schools. The original list populated in my onCreate always remains. </p><p>I read somewhere I needed to update it on the same thread the UI is running on, so I tried the Runnable listed in my code below. But that, as well as just updating my class variable schools does not work alongside notifyOnDataSetChange()</p><p>Where am I going wrong?</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    schools = SchoolProxy.search(""Co"");    autoCompleteAdapter = new ArrayAdapter(this,android.R.layout.simple_dropdown_item_1line, schools);    autoComplete = (AutoCompleteTextView)  findViewById(R.id.edit);    autoComplete.addTextChangedListener(textChecker);    autoComplete.setAdapter(autoCompleteAdapter);}    ...    ....    ...final TextWatcher textChecker = new TextWatcher() {    public void afterTextChanged(Editable s) {}    public void beforeTextChanged(CharSequence s, int start, int count, int after) {}    public void onTextChanged(CharSequence s, int start, int before, int count)     {     schools = SchoolProxy.search(s.toString());     runOnUiThread(updateAdapter);    }};private Runnable updateAdapter = new Runnable() {  public void run() {         autoCompleteAdapter.notifyDataSetChanged();        }};</code></pre><p>As a less important side note, if each item in schools has a name \n city,state. Is it possible to have the city &amp; state on a second line within the auto drop down box? Just for formatting purposes. Would look cleaner if I could. </p><p>Thank you!</p>","239375","","239375","","2009-12-29 02:45:22","2013-02-13 06:33:15","Refresh ArrayAdapter dynamically","<android><autocomplete>","2","0","3","",""
"1967863","1","1967886","","2009-12-28 03:37:29","40","66914","<p>I looked online and was not able to find a working example of the PopupWindow class.  The code examples I found online either compile but do not work, or are using methods which have since been removed (such as <code>Activity.getViewInflate())</code>.</p><p>Is there a simple <em>working</em> example that displays a PopupWindow?</p>","53036","","1841194","","2014-02-04 07:53:06","2014-04-19 10:22:15","Is there a simple example of the PopupWindow class using Android v2.0?","<android><android-popupwindow>","3","0","21","",""
"1968006","1","1968076","","2009-12-28 04:46:43","1","1002","<p>I've got my own implementation of this wrapped up in a function that takes a URL argument but I can't help thinking there must be a nice function that does this already within the Android API. </p><p>Does such a function exist?</p><p><strong>EDIT: Oops. I would just like the text - not the HTML.</strong></p>","58657","","","","","2009-12-28 05:16:12","get text from web page as String","<java><android><http>","1","0","","",""
"1968107","1","1970105","","2009-12-28 05:30:49","0","1750","<p>I am new to open gl, and have been trying to do some basic 2d openGL in android.  I am able to set up my 2D view, and draw squares and triangles.  I am trying to draw a circle and am not exactly sure how to do it.  I have found several techniques while searching, one using triangles rotated around the center w/ the given radius, this will not work as I do not want a filled circle.  I also found other suggestions to do this with lines moving around the outer edge of the circle.</p><p>I have chosen to implement the latter.  The issue I am having is with the IndexBuffer that is passed into glDrawElements, if my circle(lines) buffer has too many points, I am unable to create the byte array to create the IndexBuffer, as the maximum value for a byte is 127, any help or direction on how to do this would be appreciated.</p>","83354","","","","","2009-12-28 15:55:04","Android 2D opengl line circle","<android><opengl-es><circle>","1","0","","",""
"1968170","1","1968181","","2009-12-28 06:03:14","49","60675","<p>I am using the android emulator to run my programs.But its really slow. It takes around 90 seconds to startup and show the home screen.Can I tweak it so that I can reduce this time considerably?Thanks</p>","199525","","","","","2014-02-08 13:38:37","Can I tweak my android emulator to make it fast?","<android><emulator><tweak>","13","1","29","",""
"1968194","1","1968488","","2009-12-28 06:15:14","0","1439","<p>Hey guys i have a ListActivity... a very simple at that... and it keeps throwing NullPointer Exception though i have done it exactly as the Sample List7 except that i have used the Layout inflater... below is the code... Can u plz comment the error i have done here??</p><pre><code>import java.util.Vector;import android.app.Activity;import android.app.ListActivity;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.BaseAdapter;import android.widget.ImageView;import android.widget.ListView;import android.widget.TextView;import android.widget.AdapterView.OnItemSelectedListener;public class CustomList extends ListActivity implements OnItemSelectedListener{    Vector&lt;String&gt; VTitle;    Vector&lt;String&gt; VDescription;    TextView display;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        VTitle.addElement(""First Title"");        VTitle.addElement(""Second Title"");        VTitle.addElement(""Third Title"");        VTitle.addElement(""Fourth Title"");        VDescription.addElement(""1 Description"");        VDescription.addElement(""2 Description"");        VDescription.addElement(""3 Description"");        VDescription.addElement(""4 Description"");        display = (TextView)findViewById(R.id.display);        setListAdapter(new CustomAdapter(this));    }         @Override    protected void onListItemClick(ListView l, View v, int position, long id) {        // TODO Auto-generated method stub        display.setText(VTitle.elementAt(position));    }    class CustomAdapter extends BaseAdapter {        protected Activity mContext;        public CustomAdapter(Activity context) {            mContext = context;            // TODO Auto-generated constructor stub        }        @Override        public int getCount() {            // TODO Auto-generated method stub            return VTitle.size();        }        @Override        public Object getItem(int position) {            // TODO Auto-generated method stub            return position;        }        @Override        public long getItemId(int position) {            // TODO Auto-generated method stub            return position;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            // TODO Auto-generated method stub            View row = convertView;            if(row==null) {                LayoutInflater inflater = mContext.getLayoutInflater();                row = inflater.inflate(R.layout.row,null);            }            TextView title = (TextView)row.findViewById(R.id.title);            title.setText(VTitle.elementAt(position));            TextView description = (TextView)row.findViewById(R.id.description);            description.setText(VDescription.elementAt(position));            ImageView image = (ImageView)row.findViewById(R.id.image);            switch(position){                case 0:                    image.setImageResource(R.drawable.check);                    break;                case 1:                    image.setImageResource(R.drawable.dos);                    break;                case 2:                    image.setImageResource(R.drawable.smily);                    break;                case 3:                    image.setImageResource(R.drawable.wrong);                    break;            }            return(row);        }    }    @Override    public void onItemSelected(AdapterView parent, View v, int position, long id) {        // TODO Auto-generated method stub        display.setText(VTitle.elementAt(position));    }    @Override    public void onNothingSelected(AdapterView&lt;?&gt; arg0) {        // TODO Auto-generated method stub    }}</code></pre><p>And the xmls are like this....</p><p>""main.xml""</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;TextView          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:id = ""@+id/display""        android:text=""something""        /&gt;    &lt;ListView          android:id=""@android:id/list""          android:layout_width=""fill_parent""          android:drawSelectorOnTop=""false""         android:layout_height=""0px""&gt;    &lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>""row.xml""</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;    &lt;ImageView         android:id=""@+id/image""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt;        &lt;/ImageView&gt;    &lt;TextView         android:text=""Title""         android:id=""@+id/title""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt;    &lt;/TextView&gt;    &lt;TextView         android:text=""description""         android:id=""@+id/description""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre>","238071","","76835","","2009-12-28 06:36:37","2009-12-28 08:00:50","ListActivity throws NullPointerException","<android><listactivity>","1","7","","",""
"1968258","1","1968340","","2009-12-28 06:36:47","0","3705","<pre><code>TextUtils.StringSplitter splitter = new TextUtils.SimpleStringSplitter('\n');	splitter.setString(tweetMessage);	tweetMessage = """";	for (String s : splitter) 	{		Log.v(getClass().getSimpleName(), ""Spliter :: ""+ s);		tweetMessage +=s;	}</code></pre><p>But this shows up the newline characters as Squares how do I get Rid of that</p>","92039","","","","","2012-09-12 08:40:45","Android removing newline characters","<android>","2","0","1","",""
"1968416","1","1968873","","2009-12-28 07:39:28","38","49199","<p>I am checking out the class org.apache.http.auth.Any more reference or example if anyone has?</p>","199525","","","","","2012-09-11 09:36:34","How to do HTTP authentication in android?","<android><http-authentication>","5","2","24","",""
"1968843","1","","","2009-12-28 10:27:34","0","81","<p>i am new to android domain . Can u please let me know . is it possible to access or display comments left by users about the application using the api given in the sdk if 'yes' please fwd link where i can study further.</p>","143434","","1069068","","2013-03-19 14:42:49","2013-03-19 14:42:49","Access or Display comments left by users abt the application","<android><comments>","1","0","","",""
"1969389","1","1969571","","2009-12-28 13:08:00","4","1841","<p>So we know how to do http get and post connections.<a href=""http://exampledepot.com/egs/java.net/pkg.html"" rel=""nofollow"">http://exampledepot.com/egs/java.net/pkg.html</a>And we want to pass credentials(uname,passwd) to any web server to access the url or get the response.And we can't pass it as post parameters. So have a look @ this very simple code which does it all.</p>","199525","","199525","","2009-12-28 13:55:03","2009-12-28 13:55:03","Complete guide to pass credentials to a server via HTTP auth and getting response back","<android><http-authentication>","1","2","4","",""
"1969611","1","1969961","","2009-12-28 14:03:01","2","6188","<p>this is the current state/situation: I have an Activity which binds a Service which creates AsyncTasks which downloads various web resources. That works well, but of course the ProgressBar shows nothing.</p><p>Previously i had an Activity which created an AsyncTask which downloaded some stuff. The AsyncTask got the View which holds the ProgressBar. So i could update the progress using onProgressUpdate and publishProgress. Obviously this doesn't work any longer because I have no reference to the ProgressBar.</p><p>So, do you have any idea on how to update the progress?</p><p>Thanks in advance.</p>","220652","","","","","2011-04-12 15:20:55","Activity with ProgressBar -> Service -> AsyncTask for downloading - but how to update the progress?","<android><service><progress-bar>","2","0","6","",""
"1969772","1","1969788","","2009-12-28 14:40:48","0","376","<p>i am looking for some sample code or tutorial that sets up the most basic opengl es application.</p><p>for example, just do glClear() in the renderloop.</p><p>i have already been searching the web but all i found was either out of date or too much and too complicated.</p><p>thanks!</p>","97688","","84118","","2010-01-08 11:05:47","2011-03-30 12:22:40","android: set up simplest opengl es app","<java><android><opengl-es>","1","0","0","",""
"1969975","1","1970039","","2009-12-28 15:25:31","2","1836","<p>I am currently developing my first Android application by reading Dev Documentation at Android official website. What I am trying to accomplish is to play some ring sounds. A section from my code is:</p><pre><code>import android.app.Activity;import android.media.MediaPlayer;import android.os.Bundle;import android.view.View;public class PlayRingSounds extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);}public void PlayRingFile(View view) {         switch (view.getId()) {    case R.id.Button01:      MediaPlayer mp1 = MediaPlayer.create(this.getApplicationContext(), R.raw.aaa);      mp1.start();      break;    case R.id.Button02:      MediaPlayer mp2 = MediaPlayer.create(this.getApplicationContext(), R.raw.bbb);      mp2.start();      break;          }}   }</code></pre><p>The problem is when I click the 2nd button while ""aaa"" (sound file from 1st button) is playing, ""bbb"" also starts playing at the same time. Is there a way to stop ""aaa"" before ""bbb"" plays, or is there a way to stop all media players?</p><p>Update 12/30/2009 - New code is:</p><pre><code>   case R.id.Button01:       if (mp2.isPlaying())       {           mp2.stop();           mp2.release();       }       mp1.reset();       mp1.prepare();       mp1.start();       break;   case R.id.Button02:       if (mp1.isPlaying())       {           mp1.stop();           mp1.release();       }       mp2.reset();       mp2.prepare();       mp2.start();       break;</code></pre><p>mp1.prepare() and mp2.prepare() give IOException error.</p>","239626","","239626","","2009-12-30 13:06:36","2009-12-31 05:30:03","Is there a way to stop all MediaPlayers?","<android><media-player>","1","1","1","",""
"1970187","1","1970583","","2009-12-28 16:13:20","3","5559","<p>My Problem is that I need to send messages with a delay of 1 second. The handler then initiates some action, you're getting the picture. </p><p>There are nevertheless some conditions in which the already sent message should be deleted ( before the second elapsed ) to prevent the handler from doing anything. I couldn't figure out how to do this ( or if it's even possible ), so If anyone of you has a clue, please let me know.. </p>","228358","","","","","2011-08-02 09:08:22","How to delete delayed messages before they arrive at a Handler?","<android><handler><messages>","3","0","2","",""
"1970241","1","1970300","","2009-12-28 16:25:59","0","966","<p>Android APK-Files are not binaries but byte-code-files. So is it possible to install the same APK-File on both - on x86-Android-Devices and ARM-Android-Devices?There are some x86-Netbooks with Android installed planned and I wonder if it is possible to run the APK-Files on both kinds of devices?</p><p>Best regards,</p><p>Tom</p>","85099","","","","","2011-03-07 21:58:04","Is a signed Android APK-File running on x86- and ARM-Android devices?","<java><android><x86><arm>","2","0","","",""
"1970573","1","1970651","","2009-12-28 17:35:21","0","565","<p>Is there an Android equivalent of .NET's application.config? I am currently using a values XML file for a similar effect, but this doesn't seem to be the right approach. I looked into using SharedPreferences, but I need to access some settings outside of activities. </p>","127189","","","","","2009-12-28 17:50:30","Android equivilent of application.config?","<android><settings>","2","0","2","",""
"1970636","1","","","2009-12-28 17:47:55","2","6721","<p>I have an application with a ListActivity that uses a CursorAdapter as its adapter.  The ListActivity opens the database and does the querying for the CursorAdapter, which is all well and good, but I am having issues with figuring out when to close both the Cursor and the SQLiteDatabase.</p><p>The way things are handled right now, if the user finishes the activity, I close the database and the cursor.  However, this still ends up with the DalvikVM warning me that I've left a database open - for example, if the user hits the ""home"" button (leaving the activity in the task's stack), rather than the ""back"" button.</p><p>If I close them during pause and then re-query during resume, then I don't get any errors, but then a user cannot return to the list without it requerying (and thus losing the user's place in the list).  By this I mean, the user can click on any item in the list and open a new activity based on it, but will often want to hit ""back"" afterwards and return to the same place on the list.  If I requery, then I cannot return the user back to the correct spot.</p><p>What is the proper way to handle this issue?  I want the list to remain scrolled properly, but I don't want the VM to keep complaining about unclosed databases.</p><p>Edit: Here's a general outline of how I handle the code at the moment:</p><pre><code>public class MyListActivity extends ListActivity {    private Cursor mCursor;    private CursorAdapter mAdapter;    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mAdapter = new MyCursorAdapter(this);        setListAdapter(mAdapter);    }    protected void onPause() {        super.onPause();        if (isFinishing()) {            mCursor.close();        }    }    protected void onDestroy() {        super.onDestroy();        mCursor.close();    }    private void updateQuery() {        // If we had a cursor open before, close it.        if (mCursor != null) {            mCursor.close();        }        MyDbHelper dbHelper = new MyDbHelper(this);        SQLiteDatabase db = dbHelper.getReadableDatabase();        mCursor = db.query(...);        mAdapter.changeCursor(mCursor);        db.close();    }}</code></pre><p><code>updateQuery()</code> can be called multiple times because the user can filter the results via menu items (I left this part out of the code, as the problem still occurs even if the user does no filtering).</p><p>Again, the issue is that when I hit home I get leak errors.  Yet, after going home, I can go back to the app and find my list again - cursor fully intact.</p>","60261","","60261","","2009-12-29 16:33:46","2012-07-28 12:07:56","Managing database connections in an Android Activity","<android><sqlite>","5","2","5","",""
"1970672","1","","","2009-12-28 17:54:18","1","534","<p>On my web server I will be creating a bespoke XML file for a client app to access.  This means I must authenticate the client and then give the client the XML file.</p><p>I believe the client application will need to post data (login, password) to the server and once a connection is established, it will receive the XML file from the server (most likely PHP).</p><p>If you have any advise it would be most welcomed.  Particular classes to look at and any potential dangers.</p><p>I have found something relevant in C Sharp, however I am limited to Java as the app will be for Android.</p>","239708","","44523","","2009-12-28 20:41:55","2009-12-29 14:12:41","Post information to server and receive XML","<java><android><post>","1","0","","",""
"1971463","1","1971522","","2009-12-28 20:44:07","2","1192","<p>I am creating an android app that basically records an applies an ""Effect"" on the audio track then plays it back.  I got my app to record an play back but I am stuck an not sure where do go from here.  I have been Googling for days now trying to find a open source audio library or some way to change the audio after I record it.  I currently have it setup to play back using SoundPool an I't lets me speed up an slow down the audio.  I would like to do things like change pitch an add echo etc.  I will appreciate any responses because I am totally stumped right now.</p><p>ThanksAdam</p>","239783","","","","","2013-09-02 10:37:01","Sound Effects/Manipulation?","<java><android>","1","0","3","2013-09-02 16:51:23",""
"1971932","1","1972166","","2009-12-28 22:39:42","1","1886","<p>I'm new to Android development, so I might be missing something obvious. I want to launch an activity when the user's phone clock hits a specified time (similar to an alarm). However, I'm not sure how I would go about doing this as constant polling of the clock seems inefficient and a waste of resources. Do I need to capture broadcast events from the lclock, or use PendingIntents? If someone could point out some SDK methods/services I should read about, it would be much appreciated.Thanks.</p>","187697","","","","","2009-12-28 23:44:08","Launch activity at certain time","<android><activity><android-intent><broadcast>","1","2","0","",""
"1972027","1","1977221","","2009-12-28 23:09:51","16","26703","<p>I have my mp3 in byte[] (downloaded from service) and I would like to play it on my device similar to how you play files:</p><pre> MediaPlayer mp = new MediaPlayer(); mp.setDataSource(PATH_TO_FILE); mp.prepare(); mp.start();</pre><p>But I can't seem to find a way to do it... I wouldn't mind saving file to phone and than playing it, I am just hoping there is better way to do it.</p>","237858","","117069","","2009-12-29 00:26:39","2013-04-18 23:53:23","Android - Playing mp3 from byte[]","<android><mp3><bytearray><player>","4","1","19","",""
"1972381","1","1972404","","2009-12-29 00:52:24","98","120684","<p>I'm developing a little program which syncs some of the users data from my app on the cloud (just a load of strings, but that's not the point).</p><p>To help identify each device uniquely I would like to use the IMEI (or ESN number for CDMA devices) ...so here is the question, does anyone know how to access this programmatically?</p><p>Thanks,Tom.</p>","122547","","","","","2014-04-07 12:10:20","How to programmatically get the devices IMEI/ESN in Android","<android><imei>","8","1","55","",""
"1972579","1","1973034","","2009-12-29 02:12:50","8","7891","<p>Most samples that I see appear to use an anonymous method in a call like button.setOnClickListener().  Instead, I'd like to pass in a method defined on the Activity class that I'm working in.  What's the Java/Android equivalent of the following event handler wiring in C#?</p><pre><code>Button myButton = new Button();myButton.Click += this.OnMyButtonClick;</code></pre><p>Where:</p><pre><code>private void OnMyButtonClick(object sender, EventArgs ea){}</code></pre><p>Essentially, I'd like to reuse a non-anonymous method to handle the click event of multiple buttons.</p>","82017","","","","","2010-08-23 05:43:34","Android - How to set a named method in button.setOnClickListener()","<java><android><event-handling>","3","0","","",""
"1972594","1","1972598","","2009-12-29 02:18:49","2","331","<p>I'm working from a simple ""hello world"" tutorial and then modify it into the app I want. I started out with a hello world app added a button and now I'm tryin to respond to button events, etc.</p><p>But when I compile I'm getting the error: ""package andriod.widget does not exist \n import andriod.widget.Button;""</p><p>The code is </p><pre><code>package com.luke.bowls;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import andriod.widget.Button;public class Bowls extends Activity{    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                final Button button = (Button)findViewById(R.id.android_button);                button.setOnClickListener(new OnClickListener() {                    public void onClick(View v) {                        // Perform action on clicks                    }                });    }}</code></pre><p>It looks like a library reference problem but most of build code is hidden from me so I have no idea what to do to fix it.</p>","407256","","12183","","2009-12-29 02:23:40","2009-12-29 04:56:45","Compiling Hello World","<java><android>","3","0","","",""
"1972895","1","1974488","","2009-12-29 04:22:46","15","16979","<p>How do you test GPS applications in <a href=""http://en.wikipedia.org/wiki/Android_%28operating_system%29"" rel=""nofollow"">Android</a>? Can we test it using the <a href=""http://en.wikipedia.org/wiki/Android_%28operating_system%29#Software_development_kit"" rel=""nofollow"">Android emulator</a>?</p>","237388","","477415","","2012-03-25 11:26:53","2014-01-07 22:19:47","Testing GPS in Android","<android><testing><gps><android-testing>","4","0","13","",""
"1973071","1","1973931","","2009-12-29 05:28:02","13","26455","<p>I'd like my app to catch incoming SMS messages. There are a few examples of this around. Looks like we just need to do this:</p><pre><code>// AndroidManifest.xml&lt;receiver android:name="".SMSReceiver""&gt;   &lt;intent-filter&gt;     &lt;action android:name=""android.provider.Telephony.SMS_RECEIVED"" /&gt;   &lt;/intent-filter&gt; &lt;/receiver&gt;        // SMSReceiver.javapublic class SMSReceiver extends BroadcastReceiver {     @Override     public void onReceive(Context context, Intent intent) {         Log.i(TAG, ""SMS received."");        ....    }}</code></pre><p>is this correct? I'm sending my phone some sms messages, but the log statement never gets printed. I do have some other SMS applications installed on the phone, which display a popup when the sms is received - are they somehow blocking the intent from getting passed down to my app, they are just consuming it completely?</p><p>Thanks</p>","137193","","","","","2014-01-15 19:49:15","BroadcastReceiver + SMS_RECEIVED","<android>","5","3","15","",""
"1973158","1","","","2009-12-29 06:08:10","0","1118","<p>I just want to ask you if you anyone knows how to change the Settingavailable in: Settings->Wireless Settings->Mobile Network from code orSetting: Settings->Wireless Settings->Mobile Network Settings->Networkoperators->Select Automatically?</p><p>I had been unable to find a property that match this setting in theSettings.System / Settings.Secure classes.</p><p>Is there any alternative way to ""turn on/off"" the MOBILEconnectivity ? The reason I need to solve this is to workaround thebug occur during transitioning from WIFI to MOBILE that do not enableCELL data automatically.</p><p>Thanks in advance,</p><p>Pablo</p>","239998","","","","","2009-12-29 16:10:04","Settings management from code","<android>","1","0","","",""
"1973183","1","1973230","","2009-12-29 06:15:18","1","1840","<p>we start activity and do not calling finish() on existing activity it keeps existing activity in stack and move to new activity if we press back button we return to previous activity.</p><p>Its mean all previous activities not beeing called finish() keep remain into the memory(Stack)</p><p>Now problem is i do not want to call finish for every activity is there any centralize place where i can define that keep only last 3 activities in stack and remove rest of them ?</p>","216431","","491044","","2011-03-11 12:56:02","2011-03-11 12:56:02","Android startactivity and stacks keep in memory","<android><activity>","3","0","1","",""
"1973233","1","1973854","","2009-12-29 06:29:11","0","417","<p>I am using ViewFlipper for my application. I trying to make it :when user pressed on escape (back) button, it would be back to parent Layout.</p><p>In other words, just like this :</p><pre><code>             Activity                | Layout1 -&gt; Layout2 -&gt; Layout3  if user pressed on escape, go back to parent: Layout1 &lt;- Layout2 &lt;- Layout3</code></pre><p>How to make it ?</p><p>Please advice.</p><p>Thanks.</p>","227889","","","","","2009-12-29 10:08:15","Back to parent view when press on escape","<android>","3","0","","",""
"1973359","1","","","2009-12-29 07:21:24","15","31985","<p>I'm trying to crop an image after taking it, and my code is as follows:</p><pre><code>   private void doTakePhotoAction() {        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);        intent.putExtra(MediaStore.EXTRA_OUTPUT, MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString());        intent.putExtra(""crop"", ""true"");        intent.putExtra(""aspectX"", 1);        intent.putExtra(""aspectY"", 1);        intent.putExtra(""outputX"", 96);        intent.putExtra(""outputY"", 96);        try {            intent.putExtra(""return-data"", true);            startActivityForResult(intent, PICK_FROM_CAMERA);        } catch (ActivityNotFoundException e) {            //Do nothing for now        }    }</code></pre><p>With the above code, I'm able to go to crop mode, and crop the picture. However, the 1:1 aspect ratio is not enforced, and neither is the outputX and outputY. I believe this is because the intent was for taking a picture, not for cropping. I've also written another method to getData() from the Intent, and after that use the following:</p><pre><code>Intent intent = new Intent(""com.android.camera.action.CROP"");intent.setClassName(""com.android.camera"", ""com.android.camera.CropImage"");</code></pre><p>However, when I do that, I get the following runtime error:</p><pre><code>E/AndroidRuntime(14648): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.camera/com.android.camera.CropImage}: java.lang.NullPointerException</code></pre><p>Thanks for the help! :)</p>","240028","","","","","2013-06-10 11:36:04","Android: Crop an Image after Taking it With Camera with a Fixed Aspect Ratio","<android>","3","0","20","",""
"1973439","1","1981558","","2009-12-29 07:47:31","2","1484","<p>I want to display a 480x320 JPEG file stored in the SD card in Android 2.0.1 with WVGA854 skin and 240 lcd density (Motorola Droid). </p><p>However, when I create a BitmapDrawable through Drawable.createFromPath(), the resulting BitmapDrawable has the following values:</p><p>mBitmapWidth = 320</p><p>mBitmapHeight = 213</p><p>mTargetDensity = 160</p><p>The manifest includes the following configuration:</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""4"" /&gt;&lt;supports-screens     android:largeScreens=""true""    android:normalScreens=""true""    android:smallScreens=""true"" anyDensity=""true""/&gt;</code></pre><p>Apparently Android is resizing the bitmap. What could be the cause of this behavior? How can I avoid it?</p><p>Thank you in advance.</p>","143378","","1140748","","2012-05-06 16:59:38","2012-05-06 16:59:38","BitmapDrawable with unexpected size in Android 2.0.1 WVGA854","<android><drawable>","1","1","1","",""
"1973454","1","1973518","","2009-12-29 07:51:46","2","9038","<p>I didn'y manage to query a web service from android emulator (previously I had a UnresolvedHostException but this is ok). Now that I can go any further, I do not have anything returned in the HttpResponse's Entity (length is -1).</p><pre><code>String url = serverUrl + resource;Log.d(TAG, ""GET: "" + url);HttpClient client = new DefaultHttpClient();HttpGet getMethod = new HttpGet((url));getMethod.setHeader(""User-Agent"", USER_AGENT);getMethod.addHeader(""Authorization"", ""Basic "" + getCredentials());   HttpResponse httpResponse = client.execute(getMethod);Log.e(TAG, ""RESPONSE:"" + httpResponse);Log.i(TAG,httpResponse.getStatusLine().toString());Log.i(TAG + ""1"",httpResponse.getLocale().toString());Log.i(TAG + ""2"",httpResponse.getHeaders(USER_AGENT).toString());Log.i(TAG + ""3"",httpResponse.getEntity().toString());Log.i(TAG + ""4"",httpResponse.getEntity().getContent().toString()); int length = (int) httpResponse.getEntity().getContentLength();Log.e(TAG + ""5"", ""LENGTH:"" + length);</code></pre><p>The logs:</p><pre><code>D/HttpServices(  275): GET: http://www.google.com/search?q=androidD/dalvikvm(  275): GC freed 2992 objects / 217016 bytes in 103msE/HttpServices(  275): RESPONSE:org.apache.http.message.BasicHttpResponse@43ca4920I/HttpServices(  275): HTTP/1.1 200 OKI/HttpServices1(  275): en_USI/HttpServices2(  275): [Lorg.apache.http.Header;@43c44e10I/HttpServices3(  275): org.apache.http.conn.BasicManagedEntity@43c40be8I/HttpServices4(  275): org.apache.http.conn.EofSensorInputStream@43c51c60E/HttpServices5(  275): LENGTH:-1</code></pre><p>I'm not behind a proxy and have added the INTERNET permission in the manifest.What can be the reason for not retrieving the content of the get query (http://www.google.com/search?q=android).Thanks a lot for your help,Luc</p>","231957","","","","","2010-11-12 09:07:00","Cannot get httpResponse content","<android><http>","1","0","4","",""
"1973483","1","1973491","","2009-12-29 08:02:33","0","2211","<p>The problem again is that though i have succesfully implemented a SAX parser in my code... It is behaving wierdly. It jus skips the enteries after the &amp; and goes to the next entry. Just wanted to know whether this is the typical working of SAX parser or m i implementing it wrongly???</p><p>I have implemented org.xml.sax.ContentHandler and have provided the following coding inside...</p><p>` </p><pre><code>public void characters(char[] ch, int start, int length)         {             if(lastName.equals(""id""))             {                 String id = String.copyValueOf(ch, start, length);                 CustomList.idvector.add(id);             }             else if(lastName.equals(""subcategory""))             {                String subcategory = String.copyValueOf(ch, start, length);                 CustomList.subcategoryvector.add(subcategory);             }             else if(lastName.equals(""photo""))             {                 String photo = String.copyValueOf(ch, start, length);                 CustomList.photovector.add(photo);             }             else if(lastName.equals(""name""))             {                 String name = String.copyValueOf(ch, start, length);                 CustomList.namevector.add(name);             }         }</code></pre><p>`</p><p>There are elements with tags ,,,... and m taking those info into a vector... is this correct???</p><p>Now again problem is that i cant parse special character like ""$"" and such... is there any way we can catch these characters??</p>","238071","","238071","","2010-01-07 13:07:19","2010-01-07 13:07:19","Android XML Parsing omitting ""&amp;""","<xml><android><parsing><sax>","2","0","","",""
"1973565","1","","","2009-12-29 08:34:02","8","9742","<p>In a layout (linear, vertical) hierarchy I've got several view and one of them is a WebView.They all have same parameters:</p><pre><code>android:layout_width=""fill_parent""android:layout_height=""wrap_content""</code></pre><p>For all views the spacing between element is correctly handled but for the Webview there is a lot of spaces after the displayed text inside.</p><p>I set the (html) text of the webview in the ""onCreate"" method of the activity using the layout.</p><p>Is there a way to let the webview resize itself, to match it's content size? </p><p>By the way the space left vary from one device to another (emulator vs Milestone vs Hero)</p><p>Any idea ? Thanks</p>","","user240051","","","","2013-11-21 07:12:30","How to resize a android webview after adding data in it","<android><layout><webview>","7","1","8","",""
"1973780","1","1974272","","2009-12-29 09:48:05","0","786","<p>I am trying to make only satellite view without label. </p><p>How to do it ?</p><p>Thanks.</p>","227889","","","","","2009-12-29 18:09:06","How to remove label from MapView?","<android>","2","0","","",""
"1974193","1","1974266","","2009-12-29 11:35:18","20","11007","<p>I want my preference menu to have something to change the duration of a vibration.</p><p>There is not a slider tag for prefs.xml, so what is the best way to do this?</p><p>Thanks for reading.</p>","119895","","1230475","","2012-08-21 06:21:46","2014-02-22 12:00:41","Slider on my PreferenceScreen","<android>","3","2","4","",""
"1974398","1","1974657","","2009-12-29 12:29:28","0","1457","<p>I have a list Activity 4 which i have extended the BaseAdapter and the getview looks like this...</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {            View row=null;            for(int i=0;i&lt;10;)            {               row = convertView;            if(row==null)            {                LayoutInflater inflater = mContext.getLayoutInflater();                row = inflater.inflate(R.layout.parsed,null);            }            TextView id = (TextView)row.findViewById(R.id.id);            id.setText(idvector.elementAt(position));            TextView photo = (TextView)row.findViewById(R.id.photo);            photo.setText(photovector.elementAt(position));            TextView subcategory = (TextView)row.findViewById(R.id.subcategory);            subcategory.setText(subcategoryvector.elementAt(position));            TextView name = (TextView)row.findViewById(R.id.name);            name.setText(namevector.elementAt(position));            }            return(row);        }    }</code></pre><p>now my problem is that the list is not giving all the values of the vector and nor is it scrolling.. how to make my list Scrollable???</p>","238071","","","","","2009-12-29 13:34:49","ListActivity not scrolling","<android><scroll><listactivity>","4","0","1","",""
"1974489","1","1974506","","2009-12-29 12:49:25","13","23581","<p>The question is quite simple.But I want to know where exactly do we make our references to the gui elements?As in which is the best place to define:</p><pre><code>final EditText edit =  (EditText) findViewById(R.id.text_xyz); edit.getText.tostring();</code></pre><p>When I try it doing inside the default oncreate() I get null values.So for best practice, do u recommend a separate class for referring these already defined gui elements in main.xml. From here we can call various methods of these elements like gettext or settext?</p>","199525","","","","","2012-12-05 01:47:11","How to get text from EditText?","<android><gui>","4","0","","",""
"1974887","1","1975508","","2009-12-29 14:30:00","13","23918","<p>I want to make a custom <code>Dialog</code>. Because I don't like its style, I want to have rounded rectangle rather than sharp corners. I know how to implement it by theme in <code>AndroidManifest.xml</code>, for example, I use:</p><pre><code>android:theme=""@style/Theme.CustomDialog""</code></pre><p>And <code>Theme.CustomDialog.xml</code>:</p><pre><code>&lt;style name=""Theme.CustomDialog"" parent=""android:style/Theme.Dialog""&gt;        &lt;item name=""android:windowBackground""&gt;@drawable/filled_box&lt;/item&gt;        &lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;filled_box.xml&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;solid android:color=""#ffffffff""/&gt;    &lt;stroke android:width=""3dp"" color=""#ffff8080""/&gt;    &lt;corners android:radius=""30dp"" /&gt;    &lt;padding android:left=""10dp"" android:top=""10dp""        android:right=""10dp"" android:bottom=""10dp"" /&gt;&lt;/shape&gt;</code></pre><p>How can I implement a similar result by extending the <code>Dialog</code> or <code>AlertDialog</code>?</p>","233618","","","user1521536","2012-08-10 08:18:11","2012-08-10 08:18:11","Customizing dialog by extending Dialog or AlertDialog","<android><customization><android-dialog><android-theme>","1","0","8","",""
"1975018","1","","","2009-12-29 14:49:06","2","986","<p>Currently I'm using a HashMap to map the strings to int and the int values need to be frequently accessed. I'm looking for a better way to do this if possible with minimal object creation, and preferable being able to store the values as primitive ints without wrapping them with the Integer class. (Basically, the reverse of the SparseArray's int->object mapping.) </p>","240251","","","","","2009-12-29 17:01:01","Efficient mapping of Strings to ints in Android","<java><android><performance>","4","1","","",""
"1975210","1","1975224","","2009-12-29 15:32:25","8","2371","<p>I'd like to create a service for Android that performs an operation once a day at a given time.  What's an efficient way to accomplish this - I want to make sure I'm not draining the device battery since this service is idle 99% of the time.</p>","82017","","82017","","2009-12-29 15:42:17","2009-12-29 15:42:17","Android - create a service that runs once a day","<java><android><service>","1","0","5","",""
"1975521","1","1975563","","2009-12-29 16:32:53","7","3626","<p>I know how to autostart after boot with the <code>BOOT_COMPLETED</code> intent action, but I didn't find how to autostart an application just after it has been installed on the device.</p><p>For my application I would like to set an alarm after the install, I looked at the <a href=""http://developer.android.com/reference/android/content/Intent.html#ACTION%5FPACKAGE%5FADDED"" rel=""nofollow""><code>PACKAGE_ADDED</code></a> intent action but it says that the newly installed package does not receive this broadcast. </p><p>Any advice ?</p><p>Thanks in advance</p>","231417","","","","","2009-12-29 16:40:54","Autostart Android application after installation complete","<android>","1","0","8","",""
"1975655","1","1975717","","2009-12-29 16:57:03","11","12867","<p>I am trying to get my Activity to enable Bluetooth with the Android 2.0.1 SDK, I am using some code straight from the documentation here: <a href=""http://developer.android.com/guide/topics/wireless/bluetooth.html"">http://developer.android.com/guide/topics/wireless/bluetooth.html</a></p><p>Which is:</p><pre><code>if (!mBluetoothAdapter.isEnabled()) {    Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);    startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);}</code></pre><p>I get an error at the REQUEST_ENABLE_BT part where Eclipse says it cannot be resolved. What am I doing wrong?</p>","134482","","662025","","2011-03-22 07:44:02","2011-06-15 06:03:28","Enable Android bluetooth from documentation","<android><bluetooth>","1","0","2","",""
"1975986","1","1976733","","2009-12-29 18:07:57","1","4248","<p><br>I'm trying to animate object. I use keyframe animation: I have two vertex buffers (two frames) with vertices of my object - first buffer is for object start state and second for end state. To transform the object I simply use linear interpolation.<br> To make it more clear, please take a look at the code snippet: </p><pre><code>FloatBuffer vertexBuffer_motion;FloatBuffer  vertexBuffer_source, vertexBuffer_destination;...int indicesCount = mSphereFrame1.getVertexBuffer().capacity()...public void onDrawFrame(GL10 gl) {   float percentDone = (float)timeSinceStartKeyFrame / (float)animationDuration;      //Calculate the new position of each vertex - this is done for each frame   for (int i = 0; i &lt; indicesCount; i++) {      float diffIndice = vertexBuffer_destination.get(i) - vertexBuffer_source.get(i);                vertexBuffer_motion.put( vertexBuffer_source.get(i) + (percentDone * diffIndice) );              }   ...   //draw the object   gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer_motion);   gl.glDrawElements(GL10.GL_TRIANGLES, mSphereFrame1.getElementsCount(),                     GL10.GL_UNSIGNED_SHORT, mSphereFrame1.getIndexBuffer());}</code></pre><p>As you can see I actually use one more buffer. vertexBuffer_motion is the one I use to draw my object in intermediate state.<p>Time for my question.<br> What is the best approach for such keyframe animation on android? Can I somehow avoid (quite time consuming) operations of calculating and copying  new state of all vertices to vertexBuffer_motion?<br> I know I could use VBO but still, I would have to prepare this vertexBuffer_motion and use glBufferData to set data to this VBO (or not?).Could someone provide me with some code example showing the best approach for keyframe animation on android? <p>Thanks for reading.</p>","229697","","","","","2009-12-29 20:20:02","OpenGL key frame animation - the best approach","<android><opengl-es>","1","0","3","",""
"1976036","1","1976399","","2009-12-29 18:16:32","5","3510","<p>I would like to further annotate the custom markers I have placed on a MapView (using ItemizedOverlay) by displaying a simple text label that appears for a particular item when the onTap event is fired. </p><p>This is a trivial exercise in the Google Maps JavaScript API and in MapKit on iPhone, but it is not obvious to me what the best or easiest way to do this is on Android. </p>","235945","","","","","2011-03-09 16:39:36","Display a simple text label / descrption bubble when user taps on a OverlayItem in MapView","<android><android-mapview>","1","1","2","",""
"1976225","1","","","2009-12-29 18:49:27","0","431","<p>First, im new to developing for android and this forum.  my question is this:  i was looking at the ""Hello world view: gridview"" example and was wondering, how do i load all my images dynamically.  for example in the <code>ImageAdapter.java</code> file, at the end there is:</p><pre><code>private Integer[] mThumbIds = {        R.drawable.sample_2, R.drawable.sample_3,        R.drawable.sample_4, R.drawable.sample_5,        R.drawable.sample_6, R.drawable.sample_7,        R.drawable.sample_0, R.drawable.sample_1,        R.drawable.sample_2, R.drawable.sample_3,        R.drawable.sample_4, R.drawable.sample_5,        R.drawable.sample_6, R.drawable.sample_7,        R.drawable.sample_0, R.drawable.sample_1,        R.drawable.sample_2, R.drawable.sample_3,        R.drawable.sample_4, R.drawable.sample_5,        R.drawable.sample_6, R.drawable.sample_7};</code></pre><p>but what if i dont know the images name (as the user will add new images).  what i would like to do is grab the image name from an xml file and then load it into an array.  how do i accomplish this?</p>","240385","","21234","","2009-12-29 18:59:02","2009-12-29 19:37:15","Question about gridview and using array","<java><android>","1","4","","",""
"1976252","1","","","2009-12-29 18:54:35","21","17092","<p>I'd like to be able to read the system's SMS content provider. Basically I wanted to make an SMS messaging app, but it would only be useful if I could see past threads etc.</p><p>It seems like there's a content provider for this, but I can't find documentation for it - anyone know where that is?</p><p>Thanks</p><p>-------- edit -----------</p><p>Ok I found a way to get the sms inbox provider, and I just dumped all the column names in that provider, looks like this:</p><pre><code>Uri uriSms = Uri.parse(""content://sms/inbox"");Cursor c = context.getContentResolver().query(uriSms, null,null,null,null); // column names for above provider:0: _id1: thread_id2: address3: person4: date5: protocol6: read   7: status8: type9: reply_path_present10: subject11: body12: service_center13: locked</code></pre><p>I'm just piecing this together from random threads I find around the net, I'm really wondering where this is all documented (if at all)?</p><p>Thanks again</p>","137193","","186035","","2009-12-29 21:47:07","2012-12-04 18:10:06","How to use SMS content provider? Where are the docs?","<android><sms><android-contentprovider>","5","2","15","",""
"1976269","1","1976397","","2009-12-29 18:58:57","0","4897","<p>I currently have widget for my app <a href=""http://hireadroid.com"" rel=""nofollow"">Hire*A*Droid</a> bundled with the main application. I would like to unbundle the widget and release it as a separate offering. However - the widget is relying on <code>Activities</code> from the main app so I need to navigate between these two mainly calling particular <code>Activity</code> of the main app from the widget. So the basic idea - app can work without widget and the widget becomes the ""add-on"" option.</p><p>What is the ""right"" way to call app activities from the stand-alone widget? Do I convert the main app into a content provider? Can you point me to any code samples perhaps?</p><p>Happy New Year!</p><p>P.S. I'm not asking how to call Activities from the widget that is bundled in the same APK. The question specifically states that widget is distributed separately from the app it's calling</p>","135946","","135946","","2009-12-29 20:56:03","2009-12-29 20:56:03","Android - Calling Activity from widget","<android><widget><android-contentprovider>","1","2","","",""
"1976320","1","2934606","","2009-12-29 19:08:14","5","6943","<p>Does Android come with a way to do <a href=""http://en.wikipedia.org/wiki/Full_text_search"">Full Text Search</a>?</p><p>I know <a href=""http://code.google.com/p/android/issues/detail?id=3732"">is it not even possible to search contacts by the notes field</a>, being Google the search company, but I would be disappointed if there is no API for that.</p>","229414","","229414","","2010-05-29 10:08:56","2013-06-12 08:54:59","Android Full Text Search","<android><full-text-search>","2","0","2","",""
"1976890","1","","","2009-12-29 20:56:41","1","1248","<p>This is truly a beginner's question. I installed and successfully ran the notepadtutorials Notepadv1,2,3 and typed in a few notes. Can i import data (manually )from anexternal  text file into the sq lite dbs? I looked in my Notepadv workspace folders but no dbs seem to have been created? I looked for anything with .db extension ornamed 'data' as specified in the code.  Many thanks.</p><hr><p>Thanks so much. I just need to figure out how to access /data/data/{PACKAGE_NAME}/databases/{DB_NAMEI don;t have the Android device, only the emulator. Do I need CYGWIN with root access or is that thewrong question to ask.</p>","240451","","208809","","2013-06-26 06:11:42","2013-06-26 06:11:42","Notepad tutorial","<android><sqlite><notepad>","2","0","2","2013-03-26 12:23:18",""
"1977017","1","6762285","","2009-12-29 21:19:17","1","5333","<p>I have a widget that is meant to change its icon every time it receives the Update broadcast. However, the widget never manages to display its icon properly, displaying the text ""Problem loading widget"". The Logcat message is:</p><pre><code>WARN/AppWidgetHostView(612): updateAppWidget couldn't find any view, using error viewWARN/AppWidgetHostView(612): android.widget.RemoteViews$ActionException: can't find view: 0x7f060003</code></pre><p>The code for my onUpdate is:</p><pre><code>public class ImageWidgetProvider extends AppWidgetProvider{private  static final String TAG = ""Steve"";public static final int[] IMAGES = { R.drawable.ic_launcher_alarmclock,    /*and many more*/};@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds){    for (int appWidgetId : appWidgetIds) {        Log.d(TAG, ""onUpdate:"");        int imageNum = (new java.util.Random().nextInt(IMAGES.length));        Log.d(TAG, Integer.toString(IMAGES[imageNum]));        RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.widget);        remoteView.setImageViewResource(R.id.image_in_widget, IMAGES[imageNum]);        appWidgetManager.updateAppWidget(appWidgetId, remoteView);    }}}</code></pre><p>Now when I hover the mouse over ""R.id.image_in_widget"" it brings up that its value is equal to 0x7f060003 - the view that it can't find according to Logcat. Using the second Log statement, I verified that IMAGES[imageNum] does indeed refer to a random image from the IMAGES array. (In case it matters, it comes out as a decimal value rather than a hexadecimal one.) Any ideas what I'm doing wrong? Thanks a lot!</p><p>--</p><p>Edit: Here is the layout file for the widget, where the image_in_widget ImageView is declared.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;ImageView android:name=""@+id/image_in_widget""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre>","235654","","235654","","2009-12-30 13:17:42","2011-07-20 12:56:08","Changing a widget's icon from onUpdate","<android><android-widget>","4","2","","",""
"1977110","1","1981765","","2009-12-29 21:37:04","1","671","<p>I have an app with 2 tabs, the first is a listview, and the second I'm trying to make a TextView. The problem is I have no idea on how to get the TextView to show up. The listview is working, but I can't get anything on the TextView at all. I tried using the Hello, World to try to work with the text into the tab, but I can't figure it out.</p><p>My main.xml section with the TabWidget looks like this:</p><pre><code>    &lt;TabWidget            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;            &lt;ListView                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:id=""@+id/itemlist"" /&gt;            &lt;TextView                 android:id=""@+id/HelloAndroid""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""/&gt;        &lt;/FrameLayout&gt;</code></pre><p>ListView is being used on the java file with the mTabHost code,</p><pre><code>        TabHost mTabHost = getTabHost();    mTabHost.addTab(mTabHost.newTabSpec(""tab_test1"").setIndicator(""Answer"").setContent(R.id.itemlist));    mTabHost.addTab(mTabHost.newTabSpec(""tab_test2"").setIndicator(""Ask"").setContent(R.id.HelloAndroid));    mTabHost.setCurrentTab(0);}</code></pre><p>The TextView is on a different file called HelloAndroid.java, and the code looks like:</p><pre><code>public class HelloAndroid extends Activity {   /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       TextView tv = new TextView(this);       tv.setText(""Hello, Android"");       setContentView(tv);   }}</code></pre><p>How can I fix it so that the 2nd tab brings up the example text?Thanks!</p>","240487","","240487","","2009-12-30 16:46:14","2009-12-30 18:47:54","Can't get different views in Tabs","<android><textview><tabwidget>","1","0","","",""
"1977243","1","1977360","","2009-12-29 22:09:57","4","10400","<p>I would like to launch an app the user selects from within my application. However, I'm not sure how I'd go about doing this. I've tried this:</p><pre><code>Intent intent = new Intent();intent.setAction(Contacts.Intents.SHOW_OR_CREATE_CONTACT);startActivity(intent);</code></pre><p>But this seems to throw an error and force close my application. I also tried adding:</p><pre><code>&lt;action android:name=""Contacts.Intents.SHOW_OR_CREATE_CONTACT""/&gt;</code></pre><p>in the AndroidManifest file, but to no avail.</p><p>A look at Logcat shows that it's an ""IOexception - no such file or directory"". A couple of questions arise from this. I read through the Android docs and noticed that the Contact.Intents class is deprecated. However, it's successor, ContactContracts is aimed at API level 5 whereas I'm targeting API level 3. Could this be the problem? Also, I've hardcoded this application into the code. Is there a way to retrieve the intents of any application the user selects so that they can be launched?</p>","187697","","244296","","2011-02-02 19:53:52","2011-05-27 09:07:44","Launching external application from my app","<android><android-intent><launching-application>","5","0","3","",""
"1977246","1","1982992","","2009-12-29 22:10:19","11","24017","<p>I have an activity and I call the finish() method and the activity is not cleared from memory.</p><p>After calling finish() , I see that the method onDestroy() is executed successfully (and I clear all my variables and stuff in there).</p><p>Should it be cleared from memory or its how android works? As I understand the LifeCycle of the Activity is finished.</p><p>And if it keeps the app in memory so it runs faster the 2nd time the user uses it, what kind of objects can I leave in memory to reuse? If I understand correctly, I am suppose to clear everything on onDestroy.</p><p>Thanks</p><p>Daniel</p>","237115","","186035","","2009-12-29 23:31:58","2012-09-27 13:07:19","android finish() method doesnt clear app from memory","<android><memory><process><activity><lifecycle>","7","2","6","",""
"1977777","1","1977877","","2009-12-30 00:24:31","3","2541","<p>I'd like to have some code be notified of any incoming and outgoing voice calls.  I need to grab all the following:</p><ul><li>If it was an incoming or outgoing call</li><li>Number dialed, or incoming caller-id phone number</li><li>Duration of call, or if it was a missed call</li></ul><p>It would also be really slick if I could get more contact info, specifically the contact name, if the phone number matches up to someone in the phone's contacts list, but that part is optional.</p><p>I need my code to get this information pretty much as soon as a call has ended.  Maybe I'm just not searching for the correct terms but I'm having a real hard time finding any examples of how I would accomplish this.</p><p>If someone could provide a code example that accomplishes this, along with the permissions and any sort of broadcast receiver type of setup I would need in the manifest file, that would be great.</p>","13070","","","","","2009-12-30 01:09:35","Android voice call logging","<java><android><android-manifest>","2","0","4","",""
"1978014","1","1986958","","2009-12-30 01:54:26","2","1070","<p>I've come across a few suggestions of ""develop-once, deploy anywhere"" mobile frameworks from other SO questions:</p><p><a href=""http://www.mosync.com"" rel=""nofollow"">http://www.mosync.com</a><br /><a href=""http://rhomobile.com"" rel=""nofollow"">http://rhomobile.com</a><br /><a href=""http://phonegap.com"" rel=""nofollow"">http://phonegap.com</a></p><p>I was wondering if there are other alternatives to these mobile frameworks. None of them have the ability to access call logs or hook into a phone's call events (I realize those aren't possible on iPhone).</p>","45767","","","","","2010-01-11 11:40:25","Cross-platform mobile framework that can access call logs","<android><blackberry><mobile><frameworks><cross-platform>","3","1","1","",""
"1978143","1","","","2009-12-30 02:45:14","1","630","<p>I am trying to figure out some way to determine the current background on a phone and then set that background as my own in my application to create a seamless transition between my application and the phone. However I haven't been able to find any functions for this at Androids SDK site. </p><p>Setting android:theme=""@style/Theme.NoBackground"" inside my Manifest almost does what I want, but it still has the icons in the background.</p><p>Thanks in advance</p>","240598","","","","","2012-09-08 22:03:50","How to set an applications background the same as the current background?","<android>","4","0","","",""
"1978228","1","1979133","","2009-12-30 03:16:44","3","3095","<p>Hey,  I am trying to change the pitch of an audio file in an android application.</p><p>I have found an open source library online ""SoundTouch"" (http://www.surina.net/soundtouch), do you think I can use this library in an android app?</p><p>I have been Googling ""SoundTouch in Java"" an have found this data (http://www.aplu.ch/classdoc/jaw/ch/aplu/jaw/SoundTouch.html).  </p><p>Possible this library I can use or any ideas about any other libraries or process I can use to alter the pitch of an audio file on android?  I have also looked into the Java Sound API an android does not support them. :/</p><p>ThanksAdam</p>","239783","","","","","2012-12-03 04:55:12","SoundTouch on Android?","<java><android><audio>","2","0","4","",""
"1978251","1","","","2009-12-30 03:24:40","0","1827","<p>Does the android listveiw has the method to achive this goal?</p><p>I woluld like to implement the function like listview in C# or vb,The users can adjust the column width by themselves.</p>","240038","","240038","","2009-12-30 05:57:08","2009-12-30 05:57:08","android :how adjust listview column width at runtime?","<android><listview>","1","0","","",""
"1978256","1","1978487","","2009-12-30 03:27:01","0","4299","<p>This is one of those cases where I had the code working, tried to add something else, and then found that my previous code has stopped working. It crashes when the program starts. The error seems to lie with the definition of the ArrayAdapter custom class, as if I try using a built in adapter, it works fine. Any help?</p><pre><code>public class MainEntry extends ListActivity{    private String[] items = {""yay"",""yay2"",""asdfa"",""nlah"",""lipsum"",""orum"",""rawr""};/** Called when the activity is first created. */@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setListAdapter(new IconicAdapter());}class IconicAdapter extends ArrayAdapter {    IconicAdapter(){        super(MainEntry.this, R.layout.post_obj, items);    }    public View getView(int pos, View convertView, ViewGroup parent){        LayoutInflater inf = getLayoutInflater();        View row = null;        if(convertView==null){            inf.inflate(R.layout.post_obj, parent, false);        }else{            row = convertView;        }        inf.inflate(R.layout.post_obj, parent, false);        TextView label = (TextView) row.findViewById(R.id.label);        label.setText(items[pos]);        ImageView image = (ImageView) row.findViewById(R.id.icon);        image.setImageResource(((Math.random()&gt;.5)?R.drawable.wolfire:R.drawable.android)); //temp        return row;    }}</code></pre><p>}</p><p>Here's the LogCat log if it helps:</p><pre><code>12-29 23:43:49.968: INFO/ActivityManager(564): Start proc com.test.TestApp for activity com.test.TestApp/.MainEntry: pid=783 uid=10023 gids={1015}12-29 23:43:50.118: INFO/jdwp(783): received file descriptor 10 from ADB12-29 23:43:50.188: DEBUG/ddm-heap(783): Got feature list request12-29 23:43:50.318: WARN/ActivityThread(783): Application com.test.TestApp is waiting for the debugger on port 8100...12-29 23:43:50.348: INFO/System.out(783): Sending WAIT chunk12-29 23:43:50.348: INFO/dalvikvm(783): Debugger is active12-29 23:43:50.577: INFO/System.out(783): Debugger has connected12-29 23:43:50.577: INFO/System.out(783): waiting for debugger to settle...12-29 23:43:50.638: INFO/ARMAssembler(564): generated scanline__00000077:03515104_00001001_00000000 [ 64 ipp] (84 ins) at [0x2c2900:0x2c2a50] in 1189200 ns12-29 23:43:50.778: INFO/System.out(783): waiting for debugger to settle...12-29 23:43:50.987: INFO/System.out(783): waiting for debugger to settle...12-29 23:43:51.187: INFO/System.out(783): waiting for debugger to settle...12-29 23:43:51.387: INFO/System.out(783): waiting for debugger to settle...12-29 23:43:51.597: INFO/System.out(783): waiting for debugger to settle...12-29 23:43:51.800: INFO/System.out(783): waiting for debugger to settle...12-29 23:43:52.003: INFO/System.out(783): waiting for debugger to settle...12-29 23:43:52.206: INFO/System.out(783): waiting for debugger to settle...12-29 23:43:52.218: INFO/ActivityManager(564): Killing process com.test.TestApp (pid=783) at user's request12-29 23:43:52.228: INFO/Process(564): Sending signal. PID: 783 SIG: 912-29 23:43:52.238: INFO/ActivityManager(564): Process com.test.TestApp (pid 783) has died.12-29 23:43:52.298: WARN/UsageStats(564): Unexpected resume of com.android.launcher while already resumed in com.test.TestApp12-29 23:43:52.348: WARN/InputManagerService(564): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4394434012-29 23:43:57.517: DEBUG/dalvikvm(719): GC freed 726 objects / 64112 bytes in 83ms</code></pre>","118241","","118241","","2009-12-30 04:50:26","2012-07-10 19:28:01","Custom ArrayAdapter not Working?","<java><android>","2","3","","",""
"1978379","1","","","2009-12-30 04:10:02","8","9989","<p>On my brand new Windows 7 machine, I downloaded Eclipse (Galileo) and several Eclipse plugins (Android's ADT plugin, Subclipse, etc.)</p><p>After rebooting, neither of these plugins are showing up in the IDE (nothing in the preferences, menus, etc.) but if I click ""Installation Details"" in the 'About Eclipse' popup, I see all of the plugins listed as Installed Software. (ex. Android DDMS 0.9.5, Subclipse 1.6.5, etc.)</p><p>How do I get my plugins to work?</p>","152781","","","","","2013-02-20 13:45:55","Plugins not working in Eclipse on Windows 7 64-bit","<java><android><eclipse><eclipse-plugin>","8","2","1","",""
"1978385","1","1978494","","2009-12-30 04:12:07","1","775","<p>Using two 2.0 emulators and the native messaging application -</p><p>if I send a text message which exceeds 160 characters in length, the receiving emulator gets the message, but the text is all scrambled. Does anyone else see this? Is this a bug with the emulator, or a real problem with the 2.0 devices as well?</p><p>Thanks</p>","137193","","","","","2009-12-30 09:23:21","SMS between 2.0 emulators - text bad when message more than 160 chars in length?","<android>","3","2","","",""
"1978444","1","1979813","","2009-12-30 04:36:00","1","573","<p>Is there any way to any way to allow the user to only view a certain &lt;div&gt; with WebView?</p><p>Thanks!</p>","58657","","","","","2011-05-19 08:10:19","view only specific div from a web page with web view","<android><webview>","2","0","","",""
"1978609","1","1978660","","2009-12-30 05:52:13","0","189","<p>My problem is that i have placed an ImageView and 6 TextViews as below in a relative layout...</p><pre><code>-------------  ----------  ---------|           |  |txtview1|  |txtview2|| ImageView |  ----------  ---------|           |  |txtview3|  |txtview4||           |  ----------  ---------|           |  |txtview5|  |txtview6||           |  ----------  ----------------------</code></pre><p>but the problem is that i have set the imageview as wrap_content... and unless i set a size for it... it doesnt show up... is there any special specification needed 4 setting image style?</p>","238071","","238071","","2010-07-19 09:19:58","2010-07-19 09:19:58","Imageview - a small problem","<android><layout><size>","1","1","","",""
"1978902","1","","","2009-12-30 07:27:02","1","519","<p>My app has a 1*4 icon size widget.When a user tries to add a widget I provide with a configuration screen. and some data is collected - it is verified by the server - it is added to the local DB with appWidgetID as the key - all is good.</p><p>when user hits save, if there is not enough space, he is given a polite toast - ""No more room on this home screen"".</p><p>Now my problem is that the application is not informed of this. Application still assumes the widget was created and sits back and wait for the broadcast to update the widget after certain amount of time.</p><p>Can anyone tell me if i can find out via a broadcast or a call back or any method possible to determine if the widget was not successfully created, so that i can mark that record in my DB as deleted.</p><p>Or better if i can know the space available beforehand via some magic ninja code.</p><p>my whole application design is disturbed because of this problem.please help.</p>","240694","","","","","2009-12-30 23:09:05","is AppWidgetProvider informed if adding a widget fails due to not enough space on homescreen","<android><android-widget>","3","0","0","",""
"1979138","1","1979151","","2009-12-30 08:51:21","1","1581","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1957135/how-to-test-the-performance-of-an-android-application"">How to test the performance of an Android application?</a>  </p></blockquote><p>How can i test the performance of an android application ? Is there any tool that i can make use of ?</p>","237577","","","","","2009-12-30 09:07:33","Testing performance of an Android application","<android>","1","1","1","2012-09-27 12:31:53",""
"1979356","1","","","2009-12-30 09:59:03","0","930","<p>I would like to write a standalone screen locked AP of Android to replace the default one(android\frameworks\policies\base\phone\com\android\internal\policy\impl\LockScreen.java)</p><p>Does anyone know how to replace the default AP of framework?   Is it possible to replace framework AP without modify any framework code?</p><p>Thanks for any advice.</p>","240779","","101280","","2010-01-02 03:54:52","2010-01-02 03:54:52","How to replace framework's AP of Android","<android><frameworks><screen><locked>","1","0","","",""
"1979369","1","1979631","","2009-12-30 10:03:11","90","64178","<p>I have an Activity named <code>whereActity</code> which has child dialogs as well. Now, I want to display this activity as a dialog for another activity.</p><p>How can I do that?</p><p><img src=""http://i.stack.imgur.com/uXAyL.jpg"" alt=""enter image description here""></p>","216431","","490829","","2013-09-05 19:47:18","2014-03-06 06:37:57","Android Activity as a dialog","<android><android-activity><android-dialog>","4","2","44","",""
"1979414","1","","","2009-12-30 10:15:30","2","1431","<p>how can i forcefully send data packets over gprs n/w eventhough wifi is on ?</p><p>how to create socket for gprs n/w in android and to know gprs ip ?</p>","236732","","212218","","2011-11-17 16:12:08","2011-11-17 16:12:08","How to switch from wifi n/w to gprs programmaticaly in android?","<android><networking><sockets><wifi><gprs>","0","1","1","",""
"1979506","1","1979518","","2009-12-30 10:38:36","1","2427","<p>In one of my androids activities, I have several widget in a vertical linearlayout. The length of this layout is bigger than the screen and thus I cannot see the widget at the bottom.In the Emulator, is there a special scroller to implement or a particular action to do to be able to scroll up and down ?Thanks a lot,Luc</p>","231957","","148423","","2009-12-30 11:19:55","2009-12-30 11:19:55","android how to scroll to see all the widget of the view","<android><android-widget>","1","0","2","",""
"1979524","1","1982002","","2009-12-30 10:43:13","59","61620","<p>I'm developing an application which basically downloads a lot of data at the start of the application itself and displays it in the ListActivity. What I'm planning to do is show a Splash Screen till the data is loaded.</p><p>Till now all my attempts have been futile. I tried anddev.org mentioned methods, but my problem is that the main Activity should start but The Splash Screen should be visible till I populate my ListActivity. So in short I have to go through the following steps:</p><ol><li>Start my main activity.</li><li>Show the Splash Screen.</li><li>Keep running the process in background.</li><li>Exit the Splashscreen when processing completed and show the main List.</li></ol><p>Hope you understand what it is like....</p>","238071","","529508","","2012-02-14 00:39:10","2014-01-23 14:46:37","Android SplashScreen","<android><splash-screen>","3","2","54","",""
"1979679","1","1982405","","2009-12-30 11:23:57","1","429","<p>I've been trying to figure out how to make some sense of a dumped XML layout, and it's progressing 'pretty good'. The only thing I'm currently unsure about is the following:</p><p>When I use the command:</p><pre><code>aapt dump xmltree &lt;pathofapk&gt; &lt;pathofxmlfile&gt;</code></pre><p>I get the following result:</p><pre><code>   N: android=http://schemas.android.com/apk/res/android  E: LinearLayout (line=2)    A: android:orientation(0x010100c4)=(type 0x10)0x1    A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff    A: android:layout_height(0x010100f5)=(type 0x10)0xffffffff    E: LinearLayout (line=7)      A: android:orientation(0x010100c4)=(type 0x10)0x0      A: android:background(0x010100d4)=@0x7f020004      A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff      A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe      E: ImageView (line=12)        A: android:gravity(0x010100af)=(type 0x11)0x3        A: android:layout_gravity(0x010100b3)=(type 0x11)0x13        A: android:id(0x010100d0)=@0x7f090021        A: android:paddingLeft(0x010100d6)=(type 0x5)0xa01        A: android:paddingTop(0x010100d7)=(type 0x5)0x401        A: android:layout_width(0x010100f4)=(type 0x10)0xfffffffe        A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe        A: android:src(0x01010119)=@0x7f020006    E: ScrollView (line=21)      A: android:orientation(0x010100c4)=(type 0x10)0x1      A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff      A: android:layout_height(0x010100f5)=(type 0x10)0xffffffff      A: android:layout_weight(0x01010181)=(type 0x4)0x3f800000      E: LinearLayout (line=25)        A: android:orientation(0x010100c4)=(type 0x10)0x1        A: android:id(0x010100d0)=@0x7f09002d        A: android:padding(0x010100d5)=(type 0x5)0xa01        A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff        A: android:layout_height(0x010100f5)=(type 0x10)0xffffffff        E: EditText (line=29)          A: android:layout_gravity(0x010100b3)=(type 0x11)0x51          A: android:id(0x010100d0)=@0x7f09002e          A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff          A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe          A: android:text(0x0101014f)="""" (Raw: """")          A: android:hint(0x01010150)=@0x7f070050        E: EditText (line=36)          A: android:layout_gravity(0x010100b3)=(type 0x11)0x51          A: android:id(0x010100d0)=@0x7f09002f          A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff          A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe          A: android:text(0x0101014f)="""" (Raw: """")          A: android:hint(0x01010150)=@0x7f070051          A: android:password(0x0101015c)=(type 0x12)0xffffffff        E: LinearLayout (line=44)          A: android:orientation(0x010100c4)=(type 0x10)0x0          A: android:padding(0x010100d5)=(type 0x5)0xa01          A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff          A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe          E: Button (line=48)            A: android:id(0x010100d0)=@0x7f090030            A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff            A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe            A: android:text(0x0101014f)=@0x7f07000a            A: android:layout_weight(0x01010181)=(type 0x4)0x3f800000          E: Button (line=54)            A: android:id(0x010100d0)=@0x7f090031            A: android:layout_width(0x010100f4)=(type 0x10)0xffffffff            A: android:layout_height(0x010100f5)=(type 0x10)0xfffffffe            A: android:text(0x0101014f)=@0x7f070003            A: android:layout_weight(0x01010181)=(type 0x4)0x3f800000</code></pre><p>That's all good, but what I'm trying to figure out is how to convert the following code into the XML layout file:</p><pre><code>    A: android:paddingLeft(0x010100d6)=(type 0x5)0xa01    A: android:paddingTop(0x010100d7)=(type 0x5)0x401</code></pre><p>Converting those values to decimal would result in:</p><pre><code>paddingLeft:2561paddingTop:1025</code></pre><p>All good, but I've been trying to figure out what the (type 0x5 means). With all other types, the result is defined in the Android.util.TypedValue.class file</p><p>Decompiling that, gives the following result for 0x5:</p><pre><code>      // Field descriptor #8 I  public static final int TYPE_DIMENSION = 5;</code></pre><p>Makes sense, in a way. But, I need to know what kind of value it is, so looking down, I find the following value:</p><pre><code>  // Field descriptor #8 I  public static final int COMPLEX_UNIT_MM = 5;</code></pre><p>But, when I try to use 2561mm and 1025mm (It's a tad much anyway, 25cm is.. larger than my screen), The whole screen is filled with the 'parent LinearLayout'. </p><p>I have no clue what's wrong.. can anyone enlighten me on this subject?</p><p>Greetings,</p><p>Mats</p>","1511491","","","","","2009-12-30 20:46:28","Dumped XML Layout File padding positions not behaving correctly","<android>","3","2","","",""
"1979731","1","1981075","","2009-12-30 11:36:58","1","421","<p>I am fetching a lot of thumbnails in my application from a remote server and lazy loading these in a list View. The image fetches run in a background AsynTask and when completed the fetched images are stored in a HashMap using SoftReferences. This works just fine but when the images in the cache gets GC'd the fetches have to be rerun.</p><p>I could have stored them on the SDcard that way there would be no re-fetching. But I did not take this approach because of the clutter it would create on the SD card. Maybe there are alternatives to these sorta like temporary folders that can be cleared when Activity/app finishes/exits?</p><p>What is the ""ideal place"" to cache images? Any advice,example projects or pointers appreciated.</p><p>Thanks!</p>","236128","","","","","2009-12-30 21:48:06","What is the ideal place to cache images?","<android><lazy-loading><performance>","2","0","3","",""
"1979955","1","","","2009-12-30 12:29:25","0","3747","<p>I need do draw on Android's Canvas using Blur effect, it is a very simple feature, I need to draw a circular area, which is blurred (the foreground) and the background transparent, I can do everything with manipulating the colour alpha to do it with custom transparency but I need it to be blurred instead of transparent.. any ideas?</p>","240864","","82118","","2010-06-05 16:12:52","2014-02-09 13:53:09","Android draw with blur","<android><canvas><draw><blur>","3","0","1","",""
"1980758","1","1980774","","2009-12-30 15:30:42","0","1083","<p>on methods like these kind, onItemClick(AdapterView parent, View view, int position, long id), what's the difference between position and id.</p>","240410","","","","","2009-12-30 15:34:38","General question about AdapterView.OnItemClickListener","<android>","2","0","","",""
"1981156","1","1981181","","2009-12-30 16:48:58","10","16068","<p>Is there a standard ""Loading, please wait"" dialog I can use in Android development, when I invoke some AsyncTask (downloading some data from remote service for example)?</p>","237858","","","","","2013-05-24 18:49:52","Android - Loading, please wait","<android><multithreading>","3","0","8","",""
"1981376","1","1981518","","2009-12-30 17:33:17","0","1946","<p>This is the servlet code in java ME.</p><pre><code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {    PrintWriter out = response.getWriter();    ArrayList&lt;String&gt; listName = new ArrayList&lt;String&gt;();    ArrayList&lt;Integer&gt; listLongitude = new ArrayList&lt;Integer&gt;();    ArrayList&lt;Integer&gt; listLatitude = new ArrayList&lt;Integer&gt;();    String sLongitude = (String) request.getParameter(""x"");    String sLatitude = (String) request.getParameter(""y"");    String path, list, scount;    Integer numLong = null;    Integer numLati = null;    Connection con = null;    String slanje = """";    int limitLeft, limitRight, limitUp, limitDown, icount = 0;    if (sLongitude != null &amp;&amp; sLatitude != null) {        try {            numLong = Integer.valueOf(sLongitude);            numLati = Integer.valueOf(sLatitude);        } catch(Exception ex) {}    }    try{        Class.forName(""org.apache.derby.jdbc.ClientDriver"");        con = DriverManager.getConnection(""jdbc:derby://localhost:1527/bazaprojekt"", ""projekt2009"", ""midlet"");        limitLeft = numLong - 8;        limitRight = numLong + 8;        limitUp = numLati + 8;        ...</code></pre><p>How do I send x and y to servlet and receive some string in Android?</p>","241058","","157882","","2009-12-30 17:56:30","2010-01-01 18:28:37","Send data to HTTPservlet in android","<java><android><http><servlets><client-server>","2","0","","",""
"1981430","1","1981481","","2009-12-30 17:45:23","8","11311","<p>I've got an app that lets users send sms messages. Works great when the message &lt; 160 characters. After that, things work less-perfectly. Seems like there are a few options here:</p><ol><li>Manually break the message up into multiple SMSs, send each part as a separate SMS.</li><li>Use the multi-part send SMS function (sendMultipartTextMessage()).</li><li>Send the message as an MMS message (sendDataMessage()?).</li></ol><p>Here's my novice take on it:</p><p>1)most well supported across carriers. Users may get mad that you just cost them N separate messages though, instead of converting to MMS or something.</p><p>2)not sure if this is supported by different carriers, and read that once the message is greater than 3 * 160 chars in length, gets converted to MMS anyway by different SMS apps - maybe stay away from this altogether.</p><p>3)not sure how to do this, and older phones might not support MMS. To send an MMS using the android SDK, do we just use the SmsManager.sendDataMessage() method?</p><p>Thanks </p>","137193","","","","","2012-02-14 11:19:47","Sending long sms messages","<android>","3","1","6","",""
"1981507","1","","","2009-12-30 17:57:02","2","7237","<p>I've been banging my head against a wall this afternoon trying to get a WebView to work. Below is the code in the main class:</p><pre><code>public class fkyougoogle extends Activity {    /** Called when the activity is first created. */ WebView webview;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        webview = (WebView) findViewById(R.id.webview);        webview.getSettings().setJavaScriptEnabled(true);        // WORKS        //webview.loadUrl(""http://www.google.com"");        // DOESN'T WORK        //webview.loadUrl(""http://www.theregister.co.uk"");        //webview.loadData(""&lt;html&gt;&lt;body&gt;hello&lt;/body&gt;&lt;/html&gt;"", ""text/html"", ""utf-8"");        //webview.loadDataWithBaseURL(""fake://"", ""&lt;html&gt;&lt;body&gt;hello&lt;/body&gt;&lt;/html&gt;"", ""text/html"", ""utf-8"", ""http://www.theregister.co.uk/"");    }}</code></pre><p>This is Google's ""Hello, Webview"" example. If I use a WebView and try to access www.google.com then it works fine. If I try to access any other site then it fails including loadData and it just displays a black screen in the emulator. In the end I would like to read from a local file.</p><p> is included under the manifest tag and the XML schema is the same as the Hello Webview example.</p><p>Am I missing something obvious here? :(</p>","241075","","","","","2012-05-10 07:10:39","Why does Android WebView display a black screen?","<android><webview>","3","3","","",""
"1982452","1","","","2009-12-30 20:58:11","3","2828","<p>I'd like to send an sms message. If the text is too long, I split it into multiple messages. I'm trying to put some extra info into the ""sent"" intent to know which part has been sent, and when all the parts are complete:</p><pre><code>ArrayList&lt;String&gt; messageParts = ...;for (int i = 0; i &lt; messageParts.size(); i++) {    sms.sendTextMessage(      address,       null,       messageParts.get(i),       generateIntent(context, messageParts.size(), i),       null));}PendingIntent generateIntent(Context context, int partCount, int partIndex){    Intent intent = new Intent(""SMS_SENT"");    intent.putExtra(""partCount"", partCount);    intent.putExtra(""partIndex"", partIndex);    return PendingIntent.getBroadcast(context, 0, intent, 0);}</code></pre><p>The message is sent, and I catch the intent when each part is sent - but the intent always has the same data in it. For example, ""partIndex"" is always zero, even though for the second message, it should be one. Seems like the same intent just keeps getting thrown to my broadcast receiver. What's the right way to do this?</p><p>Thanks</p>","137193","","","","","2013-09-20 18:37:21","Putting data in the SMS sent intent?","<android>","2","0","0","",""
"1982491","1","1982769","","2009-12-30 21:05:51","2","279","<p>I am new to android programming.I have installed the eclipse and android SDK. After doing all the settings. I have executed the HelloWorld program. The program, after execution is generating the correct strings.xml file also. But on execution of the code i am not getting anything on the emulator screen.</p><p>Is there any additional settings required for the code to execute..</p><p>Also in the line:<strong>setContentView(R.layout.main);</strong> that we use in most of our code what is <strong>R</strong>? We don't initialize it. then how do we use it??is there any initialization for R? if yes then can any one tell me what it is??</p><p>Thanks in advance..</p>","1150236","","","","","2009-12-30 22:15:53","Problem in executing program in android","<android><android-emulator>","5","0","","",""
"1982529","1","1983028","","2009-12-30 21:13:26","1","1814","<p>I have two classes, one is a standard activity, the other a service. I would like the service to update a TextView (via <code>.setText</code>) of the Activity on certain events that happen within the service. </p><p>I've tried to achieve this by programming something like a setter-method inside the Activity-Class, but TextViews don't accept a <code>static</code>-reference, and when I try invoking an instance of the Activity-class instead (via <code>MyActivityClassName aVariable = new MyActivityClassName();</code>), I get a NullPointer Exception, even though the View in questions is visible at the time of the call.</p><p>Could anyone tell me what I'm doing wrong :-)? It is probably more of a basic Java question than an Android-one, but since it might have to do with the nature of Android-services, I've still added the android-tag.</p><p>Thanks for your help!</p>","241189","","","","","2009-12-30 23:16:08","Changing a TextView in another class from a Service","<android>","1","1","","",""
"1982649","1","1982697","","2009-12-30 21:40:05","0","669","<p>What is the point of the synchronization here?Why not just use: mConnectedThread.write(out); ?</p><p>The code snippet is from the BluetoothChat sample for Android (found here)<a href=""http://developer.android.com/resources/samples/BluetoothChat/index.html"" rel=""nofollow"">http://developer.android.com/resources/samples/BluetoothChat/index.html</a></p><pre><code>    /** * Write to the ConnectedThread in an unsynchronized manner * @param out The bytes to write * @see ConnectedThread#write(byte[]) */public void write(byte[] out) {    // Create temporary object    ConnectedThread r;    // Synchronize a copy of the ConnectedThread    synchronized (this) {        if (mState != STATE_CONNECTED) return;        r = mConnectedThread;    }    // Perform the write unsynchronized    r.write(out);}</code></pre>","21297","","","","","2009-12-30 22:12:21","What's the point of this synchronization?","<java><android><synchronization>","3","0","1","",""
"1982700","1","1983228","","2009-12-30 21:50:33","6","5340","<p>So I have this JSON, which then my activity retrieves to a string:</p><pre><code>    {""popular"":        {""authors_last_month"": [         {            ""url"":""http://activeden.net/user/OXYLUS"",            ""item"":""OXYLUS"",            ""sales"":""1148"",            ""image"":""http://s3.envato.com/files/15599.jpg""         },         {            ""url"":""http://activeden.net/user/digitalscience"",            ""item"":""digitalscience"",            ""sales"":""681"",            ""image"":""http://s3.envato.com/files/232005.jpg""         }         {            ...         }        ],        ""items_last_week"": [         {            ""cost"":""4.00"",            ""thumbnail"":""http://s3.envato.com/files/227943.jpg"",            ""url"":""http://activeden.net/item/christmas-decoration-balls/75682"",            ""sales"":""43"",            ""item"":""Christmas Decoration Balls"",            ""rating"":""3"",            ""id"":""75682""         },         {            ""cost"":""30.00"",            ""thumbnail"":""http://s3.envato.com/files/226221.jpg"",            ""url"":""http://activeden.net/item/xml-flip-book-as3/63869"",            ""sales"":""27"",            ""item"":""XML Flip Book / AS3"",            ""rating"":""5"",            ""id"":""63869""         },         {            ...         }],        ""items_last_three_months"": [         {            ""cost"":""5.00"",            ""thumbnail"":""http://s3.envato.com/files/195638.jpg"",            ""url"":""http://activeden.net/item/image-logo-shiner-effect/55085"",            ""sales"":""641"",            ""item"":""image logo shiner effect"",            ""rating"":""5"",            ""id"":""55085""         },         {            ""cost"":""15.00"",            ""thumbnail"":""http://s3.envato.com/files/180749.png"",            ""url"":""http://activeden.net/item/banner-rotator-with-auto-delay-time/22243"",            ""sales"":""533"",            ""item"":""BANNER ROTATOR with Auto Delay Time"",            ""rating"":""5"",            ""id"":""22243""},         {            ...         }]    }}</code></pre><p>It can be accessed <a href=""http://marketplace.envato.com/api/edge/popular:activeden.json"">here</a> as well, although it because it's quite a long string, I've trimmed the above down to display what is needed.</p><p>Basically, I want to be able to access the items from ""items_last_week"" and create a list of them - originally my plan was to have the 'thumbnail' on the left with the 'item' next to it, but from playing around with the SDK today it appears too difficult or impossible to achieve this, so I would be more than happy with just having the 'item' data from 'items_last_week' in the list.</p><p>Coming from php I'm struggling to use any of the JSON libraries which are available to Java, as it appears to be much more than a line of code which I will need to deserialize (I think that's the right word) the JSON, and they all appear to require some form of additional class, apart from the JSONArray/JSONObject script I have which doesn't like the fact that items_last_week is nested (again, I think that's the JSON terminology) and takes an awful long time to run on the Android emulator.</p><p>So, in effect, I need a (preferably simple) way to pass the items_last_week data to a ListView. I understand I will need a custom adapter which I can probably get my head around but I cannot understand, no matter how much of the day I've just spent trying to figure it out, how to access certain parts of a JSON string..</p>","241212","","6329","","2010-04-10 10:03:55","2011-11-14 01:32:37","Parse JSON into a ListView friendly output","<android><json>","2","2","3","",""
"1982832","1","","","2009-12-30 22:16:14","2","1238","<p>As the title implies, I am looking for the typeface for the clock when you enter in the pattern. Does anyone know of it offhand or know where I can find it in the source code?</p>","241221","","","","","2011-12-14 09:30:37","Typeface for the clock on Android pattern lock screen","<android>","2","2","","",""
"1982877","1","","","2009-12-30 22:29:57","0","140","<p>I have a custom view and a button in a linear layout. If I press the button I get an onDraw request in my view code and if a release the button I do get another onDraw(). Does anyone know how to avoid this?</p><p>Screenshot of the app can be seen on:<a href=""http://home-5.worldonline.nl/~jdekeij/android.html"" rel=""nofollow"">http://home-5.worldonline.nl/~jdekeij/android.html</a></p>","241217","","","","","2009-12-31 00:33:03","View invalidation","<android>","1","0","","",""
"1983018","1","","","2009-12-30 23:13:27","1","130","<p>I am using ""Hello, Android"" 1.5&amp; 1.6 with the 2.1 android Java build. I type </p><pre><code>import android.os.Bundle;   </code></pre><p>It disappears as soon as I finish typing!!  Help, please.?</p>","236414","","153545","","2009-12-30 23:42:13","2009-12-31 13:59:22","Disappearing Android code","<android>","1","4","","",""
"1983271","1","","","2009-12-31 00:19:21","0","1057","<p>I've noticed a strange thing with a TableRow.</p><pre><code>        &lt;TableLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:stretchColumns=""0""&gt;        &lt;TableRow            android:background=""#9932cc""            android:minHeight=""40px""            android:orientation=""horizontal""&gt;            &lt;LinearLayout                android:paddingLeft=""10px""                android:paddingRight=""10px""                android:gravity=""center_vertical""                android:layout_gravity=""center_vertical""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:orientation=""horizontal""&gt;                &lt;ImageView                    android:background=""@drawable/circle_checkmark""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_gravity=""center_vertical"" /&gt;                &lt;TextView                    android:id=""@+id/text1""                    android:background=""#ffffff""                    android:textColor=""#161616""                    android:text=""11111 11111 11111 11111 11111 11111 11111 11111 11111 ""                    android:layout_gravity=""center_vertical""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content"" /&gt;            &lt;/LinearLayout&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;</code></pre><p>This code doesn't work properly as TextView text1 doesn't wrap it just stretches beyond the screen. I've managed to get it working by embedding this LinearLayout into RelativeLayout but it seems to be the least elegant solution plus I don't understand what's wrong with the code above...</p>","230466","","","","","2010-11-20 16:11:04","Strange behaviour of TableRow as a LinearLayout","<java><xml><android>","2","0","","",""
"1983329","1","1983386","","2009-12-31 00:36:11","0","2760","<p>I'm starting an Android app which will have multiple Activities. It will be using a REST api with OAuth. I have tested the OAuth and have successfully parsed the returned xml.</p><p>My question has to do with the architecture of designing a client like this. I have a HttpClient and OAuthConsumer objects which will be used from the various Activities. I started designing a DaoFactory pattern which would provide DAOs for the various API calls. But I don't know how to make this pattern work in the Android framework. Each Activity can come and go and the user moves through the screens. Where should I store these objects? Should I make them members of the Application class and access them with getApplication()? Should I put the network calls and xml parsing code in a Service for each of the Activities to use? </p><p>I guess I'm trying to make this like a 3 tier webapp, but was looking for examples of other rich Android clients. I appreciate any help or advice.</p>","118999","","","","","2011-07-11 18:24:44","Design of Android app to use web api","<android><web-services>","1","0","","",""
"1983420","1","1983483","","2009-12-31 01:00:37","3","4452","<p>Do you know how to rename existing menu ?</p><p>I can rename when press menu item. But I don't know how to access to menu item when press the button.</p><p>Please advice.</p>","227889","","","","","2010-06-26 05:36:54","how to rename existing menu item?","<android>","3","1","1","",""
"1983548","1","1983566","","2009-12-31 01:42:47","21","14135","<p>I thought I'd be classy and use the string.xml file to define some constant strings for things like exception messages.  In strings.xml I hit Add, chose the ""String"" option (not 'String Array'), then gave it a name and value.  I was surprised to see that this code doesn't work:</p><pre><code>throw new Exception(R.string.MyExceptionMessage);</code></pre><p>And that fails because R.string.MyExceptionMessage is actually of type int.  I can verify that type by looking in R.java.  What am I missing?</p>","82017","","234938","","2009-12-31 01:50:00","2013-02-10 19:09:44","Eclipse/Java - Values in R.string.* return int?","<java><android><string><resources>","3","0","1","",""
"1983617","1","2881998","","2009-12-31 02:17:51","53","56535","<p>How do you setup a project that can result in a jar library file that can be used for android?I want to create a custom library across all projects.</p><p>Few other questions:</p><ol><li>Does it need to be compiled against a specific version of android sdk?</li><li>When an android package is compiled against a jar library does the classes necessary to work with the code get compiled with main code into the apk or does the entire jar get included?</li><li>Any notable optimizations or pitfalls I need to know about with using a jar instead of integrating the code directly?</li><li>Does the jar have to be signed like the apk needs to?</li></ol>","42005","","","","","2013-04-17 23:49:55","Android Jar libraries","<android><jar>","7","1","16","",""
"1983881","1","","","2009-12-31 04:09:58","0","1622","<p>On an Android layout, I'd like to have a set of rows, each with two TextViews. The leftmost column of TextViews should be right-aligned, just left of an imaginary centerline down the screen. The rightmost column should be left-aligned. </p><p>Examples of this can be seen at <a href=""http://stuff.greenberg.org/ScopeCalc.htm"" rel=""nofollow"">http://stuff.greenberg.org/ScopeCalc.htm</a></p><p>What's the best layout to use? </p>","226493","","","","","2012-01-05 08:16:17","Best android layout for a set of columns","<android><layout><choice>","3","0","","",""
"1984041","1","1984060","","2009-12-31 05:22:10","6","5133","<p>I need to write an application that sends data to the Google App Engine from Android.  The data that I would like to send can be described by a typical database record.  Each record has some integers, strings, dates, etc.  I would like to keep the connection details hidden/secured so that someone can't create false data in the datastore, if it it's not too involved.</p><p>My question is: what is a good way to get this data from Android devices into the GAE datastore?  If you could post a link to the appropriate Android libraries, or a link to how this has been done in the past, that would be really helpful.</p>","234933","","164602","","2010-07-21 20:37:54","2010-11-24 21:37:18","How to send data from Android mobile devices to the Google App Engine datastore?","<android><google-app-engine><gae-datastore>","2","0","5","",""
"1984233","1","1985694","","2009-12-31 06:35:39","15","35934","<p>I am facing with a problem related startActivityForResult()</p><p>To start SecondActivity from FirstActivity :</p><pre><code>Intent intent = new Intent();intent.setClass(FirstActivity.this, SecondActivity.class);intent.putExtra(""key1"", ""12345"");startActivityForResult(intent, 0);</code></pre><p>And handles result :</p><pre><code>@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    super.onActivityResult(requestCode, resultCode, data);    //TODO handle here. }</code></pre><p>To send the message to FirstActivity from SecondActivity :</p><p>in SecondActivity :</p><pre><code>setResult(0);</code></pre><p>I can't handle the result on onActivityResult in FirstActivity.It never works for my application. </p><p>My OS is : 1.5 </p><p>What is wrong here ?</p><p>Please advice. </p><p>Thanks in advance &amp; Happy new year!</p>","227889","","55093","","2011-06-21 14:50:26","2013-08-20 15:14:14","onActivityResult doesn't work?","<android>","4","2","","",""
"1984648","1","1984840","","2009-12-31 09:22:18","3","2157","<p>Is there any reason not to use the Application class to share variables across Activities? For instance a handle to the DB or a single HttpClient.</p>","118999","","","","","2009-12-31 13:15:14","Use Application class for global variables","<android>","2","0","2","",""
"1984682","1","1984739","","2009-12-31 09:35:59","0","305","<p>i have a wierd problem... As i have asked in previous posts... i have a lot of data coming from NET in my app... The problem is that a lot of text and images r there... so though i can make the user wait wen he clicks on a list item, but i dont want to make him wait wen he clicks the back button... </p><p>In the sense that i dont want to re-download all data... data 1ce downloaded should remain...</p><pre><code>Which 1 is the rite method??1. using a special class which stores all data... and using the variables each time i go back..or-2. Is there any specific save instance method for saving such data in the class itself... if it is then do inform me how to call the saved instance Activity wen back is clicked...</code></pre><p>Thanx in advance guys... U already have been a great help...</p>","238071","","","","","2009-12-31 14:37:19","Android content saving","<android><activity><savestate>","2","0","","",""
"1984711","1","","","2009-12-31 09:47:31","0","393","<p>I have developed an application using Android SDK 1.5, application works well on Android Simulator.Now, I am trying to install application on actual device. I don't have the Android device. So, I am going by OTA way.</p><p>For this, I have generated the self sign keystore using keytool utility.And, using Eclipse's ""Eclipse Signed Application package.."" option I have generated the signed .apk file and moved it to my web server.Also, i added MIME type on web server for .apk.</p><p>But, when I am trying to download and install the same application on device, application get downloaded and it also prompts for permission. After thag when I click on ""Install"", it fails with error Application Install Unsuccefull.</p><p>Interestingly, I test this url on simulator browser, and it worked perfectly well and application get installed successfully.</p><p>Even, I checked that, SDCard is there on device. Settings -> Applications and ""Unknown sources"" option is alos checked.</p><p>Am I clear to you all?Any Idea what may be going wrong here?</p><p>Thanks and appreciate your response,S.Satheesh</p>","629838","","","","","2009-12-31 13:11:15","Application Install Unsuccessful-while installing app viaOTA","<android>","1","1","","",""
"1984791","1","1984813","","2009-12-31 10:09:57","4","13929","<p>There are 4 Tabs in a TabHost, let them be A, B, C, and D. Now each one is just an index page and clicking on any of them shows a different activity.</p><p>The problem is that I need to start another activity when the user selects something from the content displayed in the tab. The other activity should also be displayed in the parent tab itself. Is it possible? Or will I have to try something else?</p>","238071","","589259","","2013-05-16 17:26:28","2013-05-16 17:26:28","android tabs - starting a new activity","<android><tabs><activity>","5","1","1","",""
"1984965","1","1985584","","2009-12-31 11:03:18","1","7116","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1957135/how-to-test-the-performance-of-an-android-application"">How to test the performance of an Android application?</a>  </p></blockquote><p>The test cases on launch performance in android source code are extending android.test.LaunchPerformanceBase but i can not able to make use of that class in my application test cases... Do anybody knows how to make use of that class?</p><p>These performance test cases are present in development/apps/launchperf, please look into these test cases and give me the idea.</p>","237577","","","","","2009-12-31 14:19:00","Android performance testing","<android>","1","0","1","2012-09-27 20:29:21",""
"1985534","1","1985645","","2009-12-31 14:04:00","1","721","<p>I want to create a custom field on which I can place more than one line of text as well as images.And the field can be used like a button(onclick event etc.)</p>","199525","","","","","2009-12-31 15:07:51","How do I create a custom button field?","<android><custom-controls>","2","0","1","",""
"1985955","1","1986071","","2009-12-31 16:06:07","26","19397","<p>I have an Android <code>ListActivity</code> that is backed by a database <code>Cursor</code> through a <code>SimpleCursorAdapter</code>.</p><p>When the items are clicked, a flag field in the coresponding row in the database is toggled and the view in the list needs to be updated.  </p><p>The problem is, when the view that's updated goes off screen and is recycled, the old value is displayed on the view when it returns into view.  The same thing happens whenever thr list is redrawb (orientation changes, etc).  </p><p>I use <code>notifydatasetchanged()</code> to refresh the cursor adapter but it seems ineffective.</p><p>How should I be updating the database so the cursor is updated as well?</p>","131871","","421372","","2013-12-17 15:33:50","2013-12-17 15:33:50","Android SimpleCursorAdapter doesn't update when database changes","<database><android><sqlite><cursor><listactivity>","4","0","14","",""
"1986008","1","1986109","","2009-12-31 16:26:35","0","158","<p>sorry for asking this question again but i didnt get much help on the last one (maybe due to the holidays or because my question was a bit confusing).  im trying to load images from the ""drawable folder"" into a gridview.  unlike the ""hello android gridview"" tutorial i dont know the name of the images being loaded into the gridview (as the images will be added by the user at runtime).  so, this array: </p><pre><code>private Integer[] mThumbIds = {    R.drawable.sample_2, R.drawable.sample_3,    R.drawable.sample_4, R.drawable.sample_5,    R.drawable.sample_6, R.drawable.sample_7,    R.drawable.sample_0, R.drawable.sample_1,    R.drawable.sample_2, R.drawable.sample_3,    R.drawable.sample_4, R.drawable.sample_5,    R.drawable.sample_6, R.drawable.sample_7,    R.drawable.sample_0, R.drawable.sample_1,    R.drawable.sample_2, R.drawable.sample_3,    R.drawable.sample_4, R.drawable.sample_5,    R.drawable.sample_6, R.drawable.sample_7</code></pre><p>};</p><p>wont work, as i wont know the name of the images.  im guessing ill need to use a for...each statement but im lost after that.  thanks again for the help.  happy holidays</p><p>jason</p>","240385","","153498","","2009-12-31 16:27:48","2009-12-31 16:47:27","gridview problem...part two","<xml><android><arrays><gridview>","1","0","","",""
"1986564","1","1986629","","2009-12-31 18:34:40","0","5014","<p>I am trying to use ListActivity and a SimpleCursorAdapter to check boxes based on a query from a database. The cursor is a list of questions and answers. If the user has already answered a question the checkbox should be checked but they aren't checked. The code looks like this:</p><pre><code>protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);            setContentView(R.layout.questions);    Cursor c;    testDbAdapter db = new testDbAdapter(this);    c = db.getQuestions(Long.toString(mRowId), Integer.toString(mSection));            startManagingCursor(c);            String[] from = new String[]{testDbAdapter.QUESTIONS_Q, testDbAdapter.QUESTIONS_A};            int[] to = new int[]{R.id.question, R.id.answer};            SimpleCursorAdapter results = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_multiple_choice, c, from, to);            setListAdapter(results);  }</code></pre>","12098","","","","","2009-12-31 18:51:02","ListActivity with checkbox in Android","<java><android><checkbox><listadapter>","1","0","","",""
"1986756","1","","","2009-12-31 19:20:17","7","19956","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1271777/how-to-set-ringtone-in-android-from-my-activity"">How to set ringtone in Android from my activity?</a>  </p></blockquote><p>I have sounds files in my res/raw folder and i want to select a sound to set as a ringtone on the click of a button. Wonder how can i do that?  </p>","2355649","","3609","","2010-01-13 04:18:52","2014-03-06 02:00:07","Setting Ringtone in Android","<android><ringtone>","4","2","17","2012-01-01 22:03:41",""
"1987372","1","","","2009-12-31 22:46:52","2","1143","<p>Before describing my problem, let me go into the configuration.</p><p>I bought an Android phone and thought that it would be a great idea to access my personal files at home on my Windows 7 Professional 64 bit computer from anywhere.</p><p>I setup IIS 7.5 to create an FTP site for my user directory (C:\Users\MyUser). Permissions are set to read-only for security reasons, since many of my personal files are publicly available (although password protected).</p><p>For several months now, it's worked wonderfully, allowing me to access photos, music, and even videos from my Android phone, over Wifi or through port forwarding, over 3G.</p><p>I've been working recently to organize my music better and consolidate it into one directory, so I've created/moved some directories around.</p><p>The organization scheme I have is Music\Band or Artist\Year - Album Title\Track Number - Song Title.mp3. It works well for organizing music on various flash-based MP3 players and phones.</p><p>Here is where the problem begins. This too, has worked wonderfully for the same amount of time until I got a few albums from a new band.</p><p>So, I create a few directories in the same organization scheme, but when I attempt to download them to my phone (and in other FTP programs) the last 7 (of 10) directories are listed, but cannot be downloaded, or files downloaded from. I get a 550 error that the file cannot be found, even though the server is able to list them. This occurs in two Android FTP programs, and two Windows based FTP programs connecting to localhost on the FTP server.</p><p>I checked the directories in the IIS Management snap-in, and they show as read-only access from my FTP user (which is the way I want it, as I mentioned). I've tried deleting, moving, and recreating them as well. I've restarted the computer and server, to no change in effect.</p><p>Did I miss something? Do changes in permissions need to be applied some other way?</p>","","user241747","","","","2009-12-31 22:46:52","IIS 7.5 FTP 550 Error for No Reason","<android><iis-7><ftp>","0","3","","",""
"1987693","1","4925618","","2010-01-01 01:51:24","8","4900","<p>In my app I need to query both the SMS and the MMS log to get the history of all incoming and outgoing messages.  This code has worked wonderfully for SMS:</p><pre><code>Cursor c = cr.query(Uri.parse(""content://sms""), null, null, null, null);</code></pre><p>But when I try the following I get completely different results:</p><pre><code>Cursor c = cr.query(Uri.parse(""content://mms""), null, null, null, null);</code></pre><p>The SMS query returns data that includes the message address (phone number), contact name, message subject, message body, etc...  The same query for MMS returns a bunch of nulls or numeric value fields that I can't make any sense of.  I really need a list of all MMS messages currently on the phone with the phone number or contact ID associated with it, and if the message was an incoming or outgoing message.  In the SMS query results I can get the phone number from the <code>address</code> field, and the incoming/outgoing type from the <code>type</code> field but neither of these exist when I query for MMS.</p><p>Is there a different content Uri that I need to query for this sort of MMS data?  Any help would be greatly appreciated.</p><p>Edit: Just to clarify, I'm completely aware that this is an unsupported content provider.  However since there is no supported way of doing this I'm fully willing to test and support this on a per phone/per OS version basis. Just to keep the discussion on track lets say this question is specific to Android 1.6 on an HTC Dream (G1) or HTC Magic (MyTouch).  How would you accomplish this task on that specific phone and OS version?  Or if it's not possible on those, but it is possible on Android 2.0 on a Motorola Droid, then I would find that information very helpful as well.  But regardless, lets stick to the discussion of how to accomplish this task in a supported or unsupported manner and not let it devolve into a discussion of how we should all stay away from things that aren't supported by the API, which is something I find the Android discussion groups to be riddled with and which I feel provides little to no help whatsoever. If I'm using an unsupported method, that's fine, show me the supported method of accomplishing that task.  If there is no supported method, then why does the API support allowing me to request permission to read SMS via android.permission.READ_SMS?</p>","13070","","13070","","2010-01-01 18:02:17","2011-02-07 19:32:43","How to query the MMS Log in Android","<android><sms><mms><android-contentprovider>","1","3","5","",""
"1987797","1","","","2010-01-01 03:39:17","3","5542","<p>I have been attempting to make an Android application, built against 2.0, that requires getting all of the user's contacts and displaying them in a formatted way.</p><p>I have been able to get a list using a <code>Cursor</code> and the <code>ContactsContract.Contacts</code> class. However, the list I get from that provider only gives me the contacts that are either from the user's Google account, or contacts that have two or more sources (e.g. Google + Facebook, Two Facebook accounts, etc). It does not give me the entire list.</p><p>Those that seem left out are primarily those that come only from the user's Facebook account, and have no other source.</p><p>This is the query call I'm using:</p><pre><code>Cursor contactsCursor = getContentResolver()    .query(android.provider.ContactsContract.Contacts.CONTENT_URI,         null, null, null, null);</code></pre><p>My question is is it possible to get all the contacts from every single source (Google, Facebook, etc) in the user's phonebook?</p><p>Thanks!</p>","153498","","67407","","2010-01-01 14:48:56","2012-10-02 23:36:14","Android - Get All Contacts from All Sources","<android><contacts><android-2.0-eclair>","1","0","1","",""
"1988033","1","1988056","","2010-01-01 06:31:06","2","262","<p>Inside my app, I was wondering if it was possible to make a certain URL in a WebView, when clicked, to redirect to a new activity view outside of the WebView?</p><p>Thanks!</p>","240487","","","","","2010-01-01 15:07:55","Use URL to show new activity?","<android><views><activity><webview>","2","0","","",""
"1988078","1","","","2010-01-01 07:03:29","10","24286","<p>im trying to implement MapView example which is defined on Android Hello Views example but now im facing Failed to find provider info for com.google.settings error...</p><p>Any idea why this is happening??? </p>","241841","","67407","","2010-01-01 14:42:32","2012-11-20 14:02:56","Android - Failed to find provider info for com.google.settings in MapView Example","<android><android-mapview>","5","2","3","",""
"1988913","1","1988933","","2010-01-01 15:52:10","-7","417","<p>I am developing an app that needs to retrieve information from my web site when a user pushes a button, but I have no idea how can I do that!</p>","241969","","648313","","2011-12-04 20:12:26","2011-12-04 20:12:26","How to make app retrieve information from a web site?","<android>","1","1","","2011-12-05 20:32:59",""
"1988916","1","","","2010-01-01 15:54:12","17","11783","<p>Is there a way that I can makle sure a given item in an android listview is entirely visible?</p><p>I'd like to be able to programmatically scroll to a specific item, like when I press a button for example.</p>","131871","","","","","2013-05-16 03:34:11","ensure visible on android listview?","<android><listview><listactivity>","5","0","0","",""
"1988951","1","1989085","","2010-01-01 16:10:22","7","1926","<p>I'm trying to load the parsed html data from an rss feed using aWebView, but the webview claims that the page:</p><p>""data:text/html;utf-8,[The html I'm trying to display]""</p><p>is not available.</p><p><img src=""http://img94.imageshack.us/img94/7680/ss20100101180437.png"" alt=""alt text""></p><p>I find it strange that it seems to be putting the html data into theurl, when I just want it to display it.</p><p>Here's my code right now for the webview:</p><pre><code>Bundle data = getIntent().getExtras();WebView webview = new WebView(this);setContentView(webview);webview.loadData(data.getString(""DEFAULTTEXT""), ""text/html"", ""utf-8"");</code></pre><p>Where the HTML has been passed in a string in the Bundle with theidentifier: DEFAULTTEXT. I've tested the class and the HTML is passedfine, it just isn't displayed correctly.</p><p>It works fine on some of the webpages I've tried, but not others. I'll try to post the code of one that works and one that doesn't.</p><p>Thanks. </p>","118241","","118241","","2010-01-01 23:05:30","2012-12-06 10:17:52","WebView not Loading Data?","<java><android><webview>","4","6","1","",""
"1989314","1","","","2010-01-01 19:02:49","0","2931","<p>One of my android apps performs the following specific SQLite query:</p><pre><code>SELECT _id, hourMin, actions FROM profilesWHERE type=2 AND hourMin &gt; -1 AND days &amp; 8 != 0 AND prof_id &gt;&gt; 16 IN (256)ORDER BY hourMin ASC LIMIT 1</code></pre><p>Now that works on some Android phones, but on a few of them it crashes with the following error:</p><pre><code>android.database.sqlite.SQLiteException: no such column: -1: , whilecompiling: SELECT _id, hourMin, actions FROM profiles WHERE type=2 ANDhourMin &gt; -1 AND days &amp; 8 != 0 AND prof_id &gt;&gt; 16 IN (256) ORDER BY hourMinASC LIMIT 1</code></pre><p>For some reason, ""-1"" is interpreted as a column rather than a number... that doesn't make much sense and when I read the SQLite query language I see no need to escape this number in parentheses. Could it be an issue of a different version of SQLite? Would adding parentheses this help any? Instead, I'll probably rewrite it using >= 0 but still I'd like to understand what's going on.</p>","218258","","","","","2013-01-14 10:30:45","Android SQLiteException: no such column: -1","<android><sqlite>","1","4","","",""
"1989364","1","1989493","","2010-01-01 19:23:29","2","6391","<p>I would like to create a list objects called Product (Listproducts) where Product includes the following members:</p><pre><code>public class Product {private Double price;private String title;private String description;private List&lt;Point&gt;points;...}</code></pre><p>Point is another object which includes latitude and longitude:</p><pre><code>public class Point{Double lat;Double lng;...}</code></pre><p>In the application I first have to create the list List products from XML file and then display the products on the map. One product can be located at several locations.Does anyone know what is the most appropriate way to create the structure (a list or linked list) which is the easiest to iterate through and enables to link the lists?</p><p>The logic should work the following way:1. Read each point from the list2. Check which product belongs to the point3. Display the product informations on the map</p><p>Thank you!</p>","22996","","203907","","2011-04-19 07:15:41","2011-04-19 07:15:41","Java: How to create an array of objects which include arrays?","<java><android><arrays><list><collections>","5","1","3","",""
"1989595","1","","","2010-01-01 20:49:34","3","7304","<p>I am looking for a view or some sort of information regarding the bottom bar in default applications of Android such as Email, or Unlock pattern as shown in the picture below. I have not been able find anything about this on Androids site nor from Google searches. </p><p>Image: <a href=""http://img11.imageshack.us/i/viewdn.jpg/"" rel=""nofollow"">http://img11.imageshack.us/i/viewdn.jpg/</a></p>","240598","","","","","2010-02-10 13:37:21","Is there a view for a button bar? (Image link describing the view)","<android>","3","1","3","",""
"1989609","1","1989664","","2010-01-01 20:53:07","7","11051","<p>I have a ListView and it is possible to use the hardware keyboard to filter out items. However what should I do for phones that don't have a hardware keyboard and only a virtual one? Is there a way to add a button that when pressed, the virtual keyboard shows up?</p>","240487","","73488","","2010-09-21 11:51:29","2011-11-22 12:30:01","Button to show virtual keyboard?","<android><listview><keyboard><virtual>","4","0","4","",""
"1989639","1","1989734","","2010-01-01 21:02:45","0","2925","<p>I would like to sample my GPS location periodically, say, every 10 minutes.  I'm assuming that the best way to do this would be to use the LocationManager class with the method: </p><pre><code>public void requestLocationUpdates (String provider, long minTime, float minDistance, PendingIntent intent)</code></pre><p>That would broadcast the specified intent that I could then receive in a broadcast receiver in my application.  My question is, if I call this method from an activity, will the broadcasts stop when the process that called the requestLocationUpdate() is killed, or will this registration remain active so that I can continue to get location updates?  Do I need to leave a service running to be able to keep the location updates coming when a user moves to different applications?  Thanks!</p>","234933","","","","","2012-08-25 17:41:45","Android: Can I use a Broadcast Receiver for periodic GPS location sampling without running a service?","<android><geolocation>","1","0","1","",""
"1989880","1","","","2010-01-01 22:31:45","0","395","<p>Is it possible to add a option to the sms and email app of android?</p><p>I want to add a option who call my activity and send me the sms text or email text.<br>Is it possible?</p>","242070","","","","","2013-09-20 18:55:34","Android intentoptions for SMS standard app and EMail standard app","<android><email><sms><android-intent>","1","2","","",""
"1989931","1","1989980","","2010-01-01 22:47:43","2","2640","<p>It'd be convenient if an application I'm writing stored some files to external storage permanently (so they persist after the application has been exited[destroyed]), but on an uninstall I'd like to do the decent thing and have these files removed to free up the storage.</p><p>Is there any way I can have these files removed on an uninstall?</p><p>If there isn't (and I'm skeptical), then I'll have to create these files each time. I'm trying to save start-up time and also occupy required space by having them exist permanently.</p><p>Note: I need to use external storage, so both internal storage or a DB would be inappropriate.</p>","172749","","","","","2014-03-07 21:11:26","Android: Delete app associated files from external storage on Uninstall?","<android><storage><external><uninstall>","3","0","1","",""
"1990331","1","","","2010-01-02 01:49:51","3","1799","<p>How do I use the ResourceCursorTreeAdapter with the following constructor?</p><pre><code>ResourceCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, int expandedGroupLayout, int childLayout)</code></pre><p>I'm trying to use a it as follows:</p><pre><code>_resultsCursorTreeAdapter = new ResourceCursorTreeAdapter(_resultsList.getContext(), _dbAdapter.getAllGroups(),         R.layout.timing_group_view_collapsed, R.layout.timing_group_view_expanded, R.layout.timing_result_view) { @Override protected Cursor getChildrenCursor(Cursor groupCursor) {  // Given the group, we return a cursor for all the children within that group   int groupId = groupCursor.getInt(0);  Cursor childCursor = _dbAdapter.getContractionsForGroup(groupId);  return childCursor; } @Override protected void bindGroupView(View groupView, Context context, Cursor cursor,     boolean isExpanded) {  TimingGroupView timingGroupItem =  null;  if(groupView instanceof LinearLayout){   Log.i(""TimingGroupView"", ""Has Header"");   LinearLayout layout = (LinearLayout)groupView;   timingGroupItem = (TimingGroupView) layout.getChildAt(0);  } else{   Log.i(""TimingGroupView"", ""No Header"");   timingGroupItem = (TimingGroupView) groupView;  }  ...</code></pre><p>If the group node is expanded, I want the group node to include the header for a table which each row is held in a child node.  timing_group_view_expanded.xml and timing_group_view_collapsed.xml are shown at the bottom of this question.  For some reason, the group_view_expanded is never used whether the group nodes are expanded or collapsed.  Am I using this wrong?  Has anyone else been able to get ResourceCursorTreeAdapter with this constructor to work?  </p><p>timing_group_view_expanded.xml is as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/timing_group_view"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" xmlns:android=""http://schemas.android.com/apk/res/android"" android:background=""@color/header_timing_color""&gt; &lt;com.contractiontracker.TimingGroupView  android:id=""@+id/timing_group_item"" xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent"" android:layout_height=""wrap_content""  android:layout_marginLeft=""30px"" android:padding=""10dp""  android:scrollbars=""vertical""   android:fadingEdge=""vertical""   android:background=""@color/header_timing_color""  android:textColor=""@color/text_color""/&gt; &lt;com.contractiontracker.RowLayout android:id=""@+id/timing_group_view""  android:orientation=""horizontal"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" xmlns:android=""http://schemas.android.com/apk/res/android""  android:background=""@color/header_color"" android:textColor=""@color/text_color""&gt;  &lt;TextView android:id=""@+id/interval_header""   android:layout_width=""fill_parent"" android:layout_height=""wrap_content""   android:text=""Interval"" android:layout_weight=""1""   android:layout_gravity=""left|bottom"" android:gravity=""center""    android:textColor=""@color/text_color""&gt;  &lt;/TextView&gt;  &lt;TextView android:id=""@+id/duration_header""   android:layout_width=""fill_parent"" android:layout_height=""wrap_content""   android:text=""Duration"" android:layout_weight=""1""   android:layout_gravity=""center_horizontal|bottom"" android:gravity=""center""   android:textColor=""@color/text_color""   &gt;  &lt;/TextView&gt;  &lt;TextView android:id=""@+id/intensity_header""   android:layout_width=""fill_parent"" android:layout_height=""wrap_content""   android:text=""Intensity"" android:layout_weight=""1""   android:layout_gravity=""right|bottom"" android:gravity=""center""   android:textColor=""@color/text_color""   &gt;  &lt;/TextView&gt;&lt;/com.contractiontracker.RowLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>timing_group_view_collapsed.xml looks like the following:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.contractiontracker.TimingGroupView   android:id=""@+id/timing_group_item"" xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:layout_marginLeft=""50px""  android:padding=""10dp"" android:scrollbars=""vertical"" android:textColor=""@color/text_color"" android:fadingEdge=""vertical""/&gt;</code></pre>","240566","","240566","","2010-01-05 03:29:40","2012-09-04 23:56:43","How do I use ResourceCursorTreeAdapter with expanded and collapsed group views in Android?","<android><expandablelistview>","2","0","2","",""
"1990769","1","","","2010-01-02 06:21:48","0","417","<p>I'm trying to display an AlertDialog inside of another AlertDialog. When the user clicks on the any item within the initial AlertDialog another AlertDialog is created and shown. </p><p>I'm following the correct pattern for creating and displaying AlertDialogs, the problem is as soon as the code reaches the point where the innerDialog.show() method is encountered the application fails. The logcat prints an uncaught runtime exception: </p><pre><code>android.view.WindowManager$BadTokenException : Unable to add window -- token null is not for an applicaion </code></pre><p>I'm wondering if i'm allowed to call the show() method on the innerAlertDialog manually. The outer AlertDialog is working because i'm using the callback onCreateDialog() method. </p>","240410","","","","","2011-10-19 00:43:46","nested AlertDialogs in android","<android>","1","2","","",""
"1990855","1","1990921","","2010-01-02 07:12:36","13","11322","<p>I am trying to use Android's LocationManager requestLocationUpdates.  Everything is working until I try to extract the actual location object that in my broadcast receiver.  Do I need to specifically define the ""extras"" to my custom intent so that the Android LocationManager before I pass it to requestLocationUpdates so it knows how to add it into the intent, or will it create the extras-bundle regardless when it passes the fired intent to the broadcast receiver?</p><p>My code looks like this:</p><pre><code>Intent intent = new Intent(""com.myapp.swarm.LOCATION_READY"");PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(),    0, intent, 0);//Register for broadcast intentsint minTime = 5000;int minDistance = 0;lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, minTime,    minDistance, pendingIntent);</code></pre><p>I have a broadcast receiver that is defined in the manifesto as:</p><pre><code>&lt;receiver android:name="".LocationReceiver""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""com.myapp.swarm.LOCATION_READY"" /&gt;        &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>And the broadcast receiver class as:</p><pre><code>public class LocationReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {    //Do this when the system sends the intent    Bundle b = intent.getExtras();    Location loc = (Location)b.get(""KEY_LOCATION_CHANGED"");    Toast.makeText(context, loc.toString(), Toast.LENGTH_SHORT).show();     }}</code></pre><p>My ""loc"" object is coming up null.</p>","234933","","","","","2010-12-04 14:39:42","Android: How to get location information from intent bundle extras when using LocationManager.requestLocationUpdates()","<android><geolocation><intentfilter><android-intent>","2","1","10","",""
"1991043","1","1991064","","2010-01-02 09:03:35","0","3103","<p>I created an application which reads an xml document from url address. Lately the logic has been modified and now instead of receiving the url address of the XML document I receive the document content itself so I have to modify the following method:</p><pre><code>public List&lt;Product&gt; getProducts(String content){    List&lt;Product&gt; products = new ArrayList&lt;Product&gt;();    XMLReader xr;    try {        xr = sp.getXMLReader();        ProductsXMLHandler productsXmlHandler = new ProductsXMLHandler();        xr.setContentHandler(productsXmlHandler);        xr.parse(content);        products = productsXmlHandler.getProducts();    } catch (SAXException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    }    return products;}</code></pre><p>}</p><p>As mentioned the variable String content is not an url but an XML document so I have to pass this content to XMLReader.</p><p>Currently the line <code>xr.parse(content);</code></p><p>doesn't work correctly as the value 'content' is not an url anymore.</p><p>Does anyone know how should the method be modified in order to parse the XML content instead of trying to parse the content from the given url?</p><p>Thank you!</p>","22996","","","","","2010-01-02 09:12:51","How to pass XML document to XMLReader?","<java><android><xmlreader>","1","0","1","",""
"1991219","1","2424272","","2010-01-02 10:39:08","19","25924","<p>Is it possible to load a URL in a WebView and resize it to fit the screen? I mean I want to make the WebPage small so that the user doesn't need to scroll. Is this possible?</p>","238071","","47351","","2012-11-20 12:36:51","2012-11-20 12:36:51","WebView wrap-content","<android><webview>","10","0","10","",""
"1991221","1","1991229","","2010-01-02 10:41:11","1","420","<p>Is android registration necessery for development of android application?</p><p>I am planning to develop application for android phones but dont know registration benefits &amp; scopes for selling your application.</p>","201521","","","","","2010-01-02 10:44:09","Is android registration necessery for development of android application?","<android>","1","0","","",""
"1991318","1","1991414","","2010-01-02 11:24:04","167","51015","<p>How do we change emulator screen orientation to landscape or portrait?</p>","115385","","1647538","","2014-02-21 22:54:46","2014-04-09 22:51:39","How to change screen orientation in android emulator?","<android><emulator><screen-orientation>","14","1","30","",""
"1991431","1","1992955","","2010-01-02 12:06:56","3","6718","<p>how can we html.fromhtml to load image from web and set into imageview ?</p>","216431","","","","","2011-04-20 18:23:19","android html.fromhtml to load image from web","<html><android><uiimageview>","1","2","8","",""
"1991854","1","","","2010-01-02 15:12:17","1","339","<p>How do I consume Android Application Framework objects in my client-side JavaScript?</p><p>In the Google I/O 2009 Presentation ""How Do I Code Thee"" <a href=""http://developer.android.com/videos/index.html#v=GARMe7Km_gk"" rel=""nofollow"">http://developer.android.com/videos/index.html#v=GARMe7Km_gk</a>The speaker discusses this pattern (which he calls augmented JavaScript).</p><p>On the Android developer site, I can't seem to find any more information on this pattern or from a search.  Any developers have links they can send on this topic/dev pattern?</p><p>Thanks</p>","242327","","","","","2010-01-03 00:08:39","using android application framework classes in client-side javascript","<javascript><android>","2","1","0","",""
"1991863","1","1991913","","2010-01-02 15:14:47","0","756","<p>When a user logs in to my online android application, I want to store a cookie on the user's phone so that he doesn't have to log in to the application on subsequent visits from the same phone.</p><p>How do I do this on android?</p>","230262","","16587","","2010-01-02 15:28:03","2010-01-19 05:34:54","How do I keep a user logged in to an application on Android?","<android><cookies>","1","1","","",""
"1992161","1","","","2010-01-02 17:16:16","10","2862","<p>Are there any audio fingerprinting systems (<a href=""http://en.wikipedia.org/wiki/Portable_Unique_IDentifier"">PUID</a>, etc) that are implemented in <strong>pure Java</strong> (for running on Android)?</p>","764272","","","","","2010-01-03 17:48:13","Audio fingerprinting system in Java","<java><android><audio-fingerprinting><puid>","1","2","2","",""
"1992164","1","1995633","","2010-01-02 17:17:01","0","589","<p>I want to add home screen shortcuts to individual chat rooms, in my app.  Here's my code to do so:</p><pre><code>Intent roomIntent = roomIntent(room).putExtra(""shortcut"", true);Intent intent = new Intent();intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, roomIntent);intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, room.name);Parcelable resource = Intent.ShortcutIconResource.fromContext(this, R.drawable.icon);intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, resource);setResult(RESULT_OK, intent);       finish();</code></pre><p>When I go to add the shortcut to my home screen, I get a Force Close, not on my own process, but on com.android.acore(!).  I've run the debugger and verified that my code gets executed all the way to the call to finish().</p><p>If I do this instead for the EXTRA_SHORTCUT_ICON:</p><pre><code>intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, R.drawable.icon);</code></pre><p>It works fine and places the shortcut, and the shortcut behaves correctly -- but of course the shortcut has the stock Android icon, not mine, since this isn't the proper way to specify the icon.</p><p>When I look at the source code of other apps that have done this, and at <a href=""http://dev.android.com/guide/samples/ApiDemos/src/com/example/android/apis/app/LauncherShortcuts.html"" rel=""nofollow"">the one example</a> of it in the official Android reference area, my code looks identical.  My icon's a standard 48x48 png that I use for the app's main icon, without problems.  I've verified this problem on an emulator running stock 1.6, haven't tested other versions.</p><p>I have no idea what I'm doing wrong.  Any ideas?</p>","16075","","","","","2010-01-03 17:35:46","Strange force close on acore when adding a home screen shortcut","<android>","1","2","","",""
"1992287","1","","","2010-01-02 18:11:11","2","4226","<p>I have three classes one main-activity(named MainMap), one non-activity class(named MyItemizedOverlay), and one activity class(named AudioStream).I want to start AudioStream activity from non-activity class but i don't know how to.i tried           this is in third class(called MyItemizedOverlay):</p><pre><code>            Intent myIntentA = new Intent(MainMap.this, AudioStream.class);            myIntentA.putExtra(AUDIO_STREAM,AUDIO_STREAM_URL);            MojProg.this.startActivity(myIntentA);</code></pre><p>but it doesn't work, says: No enclosing instance of the type MainMap is accessible in scope</p><p>What should i do? What shoul i write instead of MainMap.this?</p>","241058","","","","","2012-12-11 15:20:34","Using Intent from non-activity class","<android><class><activity><package><android-intent>","2","0","1","",""
"1992676","1","","","2010-01-02 20:09:34","39","37869","<p>I'm working on my first Android app, so I apologize if this is extremely obvious.  I've got three activities in my app, and the user switches back and forth pretty frequently.  I've also got a remote service, which handles a telnet connection.  The apps need to bind to this service in order to send/receive telnet messages.</p><p><em><strong>Edit</em></strong>Thank you BDLS for your informative answer.  I have re-written my code in light of your clarification on the difference between using bindService() as a stand-alone function or after startService(), and I now only get the leak error message intermittently when using the back button to cycle between activities.</p><p>My connection activity has the following onCreate() and onDestroy():</p><pre><code>    /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    /*     * Initialize the ServiceConnection.  Note that this is the only place startService() is run.     * It is also the only time bindService is run without dependency on connectStatus.     */    conn = new TelnetServiceConnection();    //start the service which handles telnet    Intent i = new Intent();    i.setClassName( ""com.wingedvictorydesign.LightfactoryRemote"", ""com.wingedvictorydesign.LightfactoryRemote.TelnetService"" );    startService(i);    //bind to the service    bindService(i, conn, 0);    setContentView(R.layout.connect);    setupConnectUI();}//end OnCreate()@Overrideprotected void onDestroy() {    super.onDestroy();    //unbind the service and null it out    if (conn != null) {        unbindService(conn);        conn = null;        }    if(connectStatus == 0) {        //stop the service        Intent i = new Intent();        i.setClassName( ""com.wingedvictorydesign.LightfactoryRemote"", ""com.wingedvictorydesign.LightfactoryRemote.TelnetService"" );        stopService(i);        Log.d(""LightfactoryRemote"", ""Connect onDestroy() attempted to stop service"");        }    Log.d(""LightfactoryRemote"", ""Connect onDestroy()"");    }//end onDestroy()</code></pre><p>So the service is started when the activity is started, and stopped when the activity is destroyed if no successful telnet connection was made (connectStatus == 0).  The other activities bind to the service only if a successful connection was made (connectStatus == 1, saved to a shared preferences).  Here is their onResume() and onDestroy():</p><pre><code>@Overrideprotected void onResume() {    super.onResume();    //retrieve the shared preferences file, and grab the connectionStatus out of it.    SharedPreferences settings = getSharedPreferences(PREFS_NAME, MODE_WORLD_WRITEABLE);    connectStatus = settings.getInt(""connectStatus"", 0);    Log.d(""LightfactoryRemote"", ""Focus onResume with "" + connectStatus);    //if a telnet connection is active, start the service and bind to it    if (connectStatus == 1) {        conn = new TelnetServiceConnection();        Intent i = new Intent();        i.setClassName(""com.wingedvictorydesign.LightfactoryRemote"", ""com.wingedvictorydesign.LightfactoryRemote.TelnetService"");        bindService(i, conn, 0);        //TODO write restore texview code        }//end if    }//end onResume@Overrideprotected void onDestroy() {    super.onDestroy();    //unbind the service and null it out.    if (conn != null) {        Log.d(""LightfactoryRemote"", ""Focus onDestroy() attempted to unbind service"");        unbindService(conn);        conn = null;        }    Log.d(""LightfactoryRemote"", ""Focus onDestroy()"");    }//end onDestroy()</code></pre><p>So the binding happens in onResume() so that it will pick up the changed state from the connection activity, and in the onDestroy() function it is unbound, if necessary.</p><p><em><strong>End Edit</em></strong>  </p><p>But I still get the memory leak error message ""Activity  has leaked ServiceConnection @438030a8 that was originally bound here"" intermittently when switching activities.   What am I doing wrong?</p><p>Thanks in advance for any tips or pointers!!!</p><p>Full error message follows (from the revised code):</p><pre><code>01-02 22:04:26.642: DEBUG/LightfactoryRemote(2024): Focus onStop()01-02 22:04:26.642: DEBUG/LightfactoryRemote(2024): Focus onDestroy() attempted to unbind service01-02 22:04:26.642: DEBUG/LightfactoryRemote(2024): Focus onDestroy()01-02 22:04:26.672: ERROR/ActivityThread(2024): Activity com.wingedvictorydesign.LightfactoryRemote.LightfactoryRemote has leaked ServiceConnection com.wingedvictorydesign.LightfactoryRemote.LightfactoryRemote$TelnetServiceConnection@439e51e8 that was originally bound here01-02 22:04:26.672: ERROR/ActivityThread(2024): android.app.ServiceConnectionLeaked: Activity com.wingedvictorydesign.LightfactoryRemote.LightfactoryRemote has leaked ServiceConnection com.wingedvictorydesign.LightfactoryRemote.LightfactoryRemote$TelnetServiceConnection@439e51e8 that was originally bound here01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.app.ActivityThread$PackageInfo$ServiceDispatcher.&lt;init&gt;(ActivityThread.java:927)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.app.ActivityThread$PackageInfo.getServiceDispatcher(ActivityThread.java:822)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.app.ApplicationContext.bindService(ApplicationContext.java:842)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.content.ContextWrapper.bindService(ContextWrapper.java:319)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at com.wingedvictorydesign.LightfactoryRemote.LightfactoryRemote.onResume(LightfactoryRemote.java:102)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1225)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.app.Activity.performResume(Activity.java:3559)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2838)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2866)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.os.Handler.dispatchMessage(Handler.java:99)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.os.Looper.loop(Looper.java:123)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at android.app.ActivityThread.main(ActivityThread.java:4203)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at java.lang.reflect.Method.invokeNative(Native Method)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at java.lang.reflect.Method.invoke(Method.java:521)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)01-02 22:04:26.672: ERROR/ActivityThread(2024):     at dalvik.system.NativeStart.main(Native Method)01-02 22:04:26.692: WARN/ActivityManager(558): Unbind failed: could not find connection for android.os.BinderProxy@43c509a8</code></pre><p><em><strong>Edit the 2nd</em></strong><br>Thanks once again bdls for your suggestions.  I did as you suggested and added an onUnBind() override to the service.  onUnBind() is actually only triggered when all clients disconnect from the service, but when I hit the home button, it executed, then the error message popped up!  This makes no sense to me, as all the clients have been unbound from the service, so how could the one destroyed leak a serviceConnection?  Check it out:</p><pre><code>01-03 19:38:30.837: DEBUG/LightfactoryRemote(1118): Focus onPause()101-03 19:38:31.577: WARN/IInputConnectionWrapper(1118): showStatusIcon on inactive InputConnection01-03 19:38:31.587: DEBUG/LightfactoryRemote(1118): Focus onStop()01-03 19:38:31.600: DEBUG/LightfactoryRemote(1118): Focus onDestroy() attempted to unbind service01-03 19:38:31.607: DEBUG/LightfactoryRemote(1118): Focus onDestroy()01-03 19:38:31.677: DEBUG/LightfactoryRemote(1125): TelnetService onUnBind()01-03 19:38:31.727: ERROR/ActivityThread(1118): Activity com.wingedvictorydesign.LightfactoryRemote.LightfactoryRemote has leaked ServiceConnection com.wingedvictorydesign.LightfactoryRemote.LightfactoryRemote$TelnetServiceConnection@435baeb0 that was originally bound here01-03 19:38:31.727: ERROR/ActivityThread(1118): android.app.ServiceConnectionLeaked: Activity com.wingedvictorydesign.LightfactoryRemote.LightfactoryRemote has leaked ServiceConnection com.wingedvictorydesign.LightfactoryRemote.LightfactoryRemote$TelnetServiceConnection@435baeb0 that was originally bound here01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.app.ActivityThread$PackageInfo$ServiceDispatcher.&lt;init&gt;(ActivityThread.java:886)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.app.ActivityThread$PackageInfo.getServiceDispatcher(ActivityThread.java:781)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.app.ApplicationContext.bindService(ApplicationContext.java:820)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.content.ContextWrapper.bindService(ContextWrapper.java:307)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at com.wingedvictorydesign.LightfactoryRemote.LightfactoryRemote.onResume(LightfactoryRemote.java:102)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1225)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.app.Activity.performResume(Activity.java:3530)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2619)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2647)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2287)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.os.Handler.dispatchMessage(Handler.java:99)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.os.Looper.loop(Looper.java:123)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at android.app.ActivityThread.main(ActivityThread.java:3948)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at java.lang.reflect.Method.invokeNative(Native Method)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at java.lang.reflect.Method.invoke(Method.java:521)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)01-03 19:38:31.727: ERROR/ActivityThread(1118):     at dalvik.system.NativeStart.main(Native Method)01-03 19:38:31.777: WARN/ActivityManager(564): Unbind failed: could not find connection for android.os.BinderProxy@4370f8a8</code></pre><p>I thought it might be something like you said, where the binding to the service is not complete when unbindService() is called, however I tried calling a method on the service as I backed through each activity to verify that the binding is complete, and they all went through fine.</p><p>In general, this behavior doesn't seem related to how long I stay in each activity.  Once the first activity leaks its serviceConnection, however, they all do as I back through them after that.</p><p>One other thing, if I turn on ""Immediately destroy activities"" in Dev Tools, it prevents this error.</p><p>I'm stumped, any ideas?</p><p>Thanks!</p>","242390","","242390","","2010-01-04 04:03:43","2014-03-27 17:32:55","I can't get rid of this error message: Activity <App Name> has leaked ServiceConnection <ServiceConnection Name>@438030a8 that was originally bound here","<android><serviceconnection>","6","1","12","",""
"1993016","1","2080547","","2010-01-02 21:58:14","5","6517","<p>I am using the location manager's requestLocationUpdates() method to receive an intent to my broadcast receiver periodically.  The system is correctly firing the intent to my receiver, and I have been able to use it correctly.  The only problem is that the GPS location provider only stays active for a few seconds after the initial location acquisition, and I need it to stay on a little longer so that the location estimates are more accurate.</p><p>My question is how to make the GPS location provider stay active for each periodic request that comes from the <a href=""http://developer.android.com/reference/android/location/LocationManager.html"">LocationManager</a> requestLocationUpdates. Does anyone know how to do this?</p>","234933","","234933","","2010-01-02 22:22:57","2014-02-25 06:00:36","Android: How to keep GPS active until more accurate location is provided?","<android><geolocation><gps>","4","0","4","",""
"1993471","1","1995799","","2010-01-03 00:33:59","8","13390","<p>Hi I'm new to this.  My self-teaching project is a small application which plays an audio news stream.  To be effective, the application really needs to interrupt any currently playing media players (eg: Last FM, Imeem, music player, Spotify etc).  </p><p>I don't know what will be playing or what application will be playing it, but I want to ask them all to pause until I've done.  Sounds rather bold, I know, but it must be possible, because when there's an incoming call, that's basically what happens.  </p><p>Can I send a message to all audio players asking them to pause for a moment?  Could I spoof an incoming call, just for the time it takes?</p><p>Thanks.</p>","","user235900","491044","","2012-01-30 10:38:34","2013-03-08 02:51:07","Android - can I mute currently playing audio applications?","<android><audio><android-audiomanager>","4","0","8","",""
"1993991","1","1994085","","2010-01-03 04:29:02","6","2444","<p>I'm using amazing FPS and I have to store the secret key in the java code. However I am afraid that someone would decompile my apk and find the key. I have decompiled the apk myself and could not find the key, but I am not a VM expert. Any help?</p>","117691","","1777090","","2013-01-07 07:34:28","2013-01-07 07:34:28","Android storing key, decompiling fear","<android><dalvik><decompiler>","2","3","3","",""
"1994247","1","","","2010-01-03 07:40:31","0","1813","<p>I am creating a Lock Replacement application which obviously requires it to have an activity that starts the ACTION_SCREEN_ON is called. These are the portions of my code relevant to it:</p><pre><code>public class StartupBroadcastReceiver extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent intent) {    Intent startupIntent = new Intent(context, Lockdown.class); // substitute with your launcher class    startupIntent.addCategory(Intent.CATEGORY_HOME);    startupIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    context.startActivity(startupIntent);}</code></pre><p>}</p><p>Since ACTION_SCREEN_ON cannot be called from the Manifest I registered it dynamically in my main activity.</p><p>This is in my onCreate function of my main class (Lockdown)</p><pre><code>IntentFilter filter = new IntentFilter (Intent.ACTION_SCREEN_ON);BroadcastReceiver mReceiver = new StartupBroadcastReceiver();    registerReceiver(mReceiver, filter);</code></pre><p>Any help is highly appreciated.</p>","240598","","759866","","2014-02-16 14:26:21","2014-02-16 14:26:21","Activity will not start after ACTION_SCREEN_ON is received","<android>","1","5","1","",""
"1994380","1","1994608","","2010-01-03 09:03:46","45","7468","<p>Has anyone had success developing a substantial Android app in Scala? Is it a viable option yet? Are there any mature development environments? Given the state of the Scala Eclipse plug-in, it looks as if there is no good IDE support at all other than possibly IntelliJ Ultimate.</p><p>A few people have posted tutorials describing how to <a href=""http://www.scala-lang.org/node/160"" rel=""nofollow"">fudge Eclipse ADT</a> to sort-of support Scala, and how to to <a href=""http://stackoverflow.com/questions/476111/scala-programming-for-android"">slim the Scala libraries</a> using Proguard, but beyond that there has been worryingly little discussion about this topic.</p><p><strong>Update 2011-08-01:</strong> An interesting article on Android+Scala from the developers behind the Bump app: <a href=""http://devblog.bu.mp/post/40786235557/how-we-use-scala-in-bump-for-android"" rel=""nofollow"">Bump Dev Blog - How we use Scala in Bump for Android</a></p>","6022","","317518","","2013-12-15 22:21:41","2013-12-15 22:21:41","Substantial Android development in Scala","<android><scala><intellij-idea><adt>","3","1","25","2012-10-12 01:34:52",""
"1994497","1","","","2010-01-03 10:09:50","2","1683","<p>Any good tutorial shows how to use Droid-fu library's WebGalleryAdapter with gallery widget ???here you can found info about  <a href=""http://www.freeimagehosting.net/uploads/8954c5a8a9.jpg"" rel=""nofollow"">droid-fu libaray</a></p><hr><pre><code>public class ImageSwitcherGallery extends Activity{    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        WebGalleryAdapter webAdapter = new WebGalleryAdapter(ImageGallery.this);        try {            requestWindowFeature(Window.FEATURE_NO_TITLE);            setContentView(R.layout.image_switcher_1);            webAdapter.setImageUrls(loadImages());            webAdapter.setProgressDrawable(getResources().getDrawable(R.drawable.ajax_loader));            Gallery gallery = (Gallery)findViewById(R.id.gallery);            gallery.setAdapter(webAdapter);        } catch (Exception e) {            Log.e(TAG, Util.getExceptionMsg(e));        }    }    private LinkedList&lt;String&gt; loadImages(){            //loading images from another static object        LinkedList&lt;ImageURL&gt; urlList = ResultSetHandler.getImagesGalleryUrls();        LinkedList&lt;String&gt; list = new LinkedList&lt;String&gt;();        for(ImageURL imageUrl: urlList){            list.add(imageUrl.getImagePath());        }        return list;    }    //Retriving loaded image urls}</code></pre><p>i am only using gallery thats why it is only displaying section 2, how can i switcher object with droid-fu libaray ?</p><p><img src=""http://www.freeimagehosting.net/uploads/8954c5a8a9.jpg"" alt=""alt text""></p>","216431","","250260","","2012-05-12 00:48:48","2012-05-12 00:48:48","Droid-fu library's WebGalleryAdapter with gallery example","<android><image-gallery><droid-fu>","1","0","1","",""
"1994518","1","1994700","","2010-01-03 10:20:38","0","1506","<p>I used webView to show javaScript,one image was included in the javaScrip,but the webView  not run the image on the contrary appear a ""?""image. Idonot why?my code:</p><p>demo.html</p><pre><code>&lt;html&gt;      &lt;script language=""javascript""&gt;          /* This function is invoked by the activity */           function wave() {               document.getElementById(""droid"").src=""android_waving.png"";               alert(""2"");           }       &lt;/script&gt;      &lt;body&gt;          &lt;!-- Calls into the javascript interface for the activity --&gt;          &lt;a onClick=""window.demo.clickOnAndroid()""&gt;&lt;div style=""width:80px;               margin:0px auto;               padding:10px;               text-align:center;               border:2px solid #202020;"" &gt;                  &lt;img id=""droid"" src=""android_normal.png""/&gt;&lt;br&gt;                  Click me!           &lt;/div&gt;&lt;/a&gt;      &lt;/body&gt;  &lt;/html&gt;  public class webJsDemo extends Activity {    /** Called when the activity is first created. */    private WebView mWebView;     private Handler mHandler = new Handler();       @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mWebView = (WebView) findViewById(R.id.wv1);           WebSettings webSettings = mWebView.getSettings();           webSettings.setSavePassword(false);           webSettings.setSaveFormData(false);           webSettings.setJavaScriptEnabled(true);           webSettings.setSupportZoom(false);           mWebView.setWebChromeClient(new MyWebChromeClient());           mWebView.addJavascriptInterface(new DemoJavaScriptInterface(), ""demo"");           mWebView.loadUrl(""file:///android_asset/demo.html"");       }       final class DemoJavaScriptInterface {           DemoJavaScriptInterface() {           }           /**           * This is not called on the UI thread. Post a runnable to invoke           * loadUrl on the UI thread.           */          public void clickOnAndroid() {              mHandler.post(new Runnable() {                   public void run() {                       mWebView.loadUrl(""javascript:wave()"");                   }               });           }       }       /**       * Provides a hook for calling ""alert"" from javascript. Useful for       * debugging your javascript.       */      final class MyWebChromeClient extends WebChromeClient {           @Override        public boolean onJsAlert(WebView view, String url, String message,                JsResult result) {            // TODO Auto-generated method stub            Log.d(""aa"", message);              Log.d(""url"", url);            Log.d(""result"", """"+result);            result.confirm();         return super.onJsAlert(view, url, message, result);        }    }   }  </code></pre><p>i put android_normal.png and android_waving.png in the assets and drawable folder</p><p><a href=""http://p13.freep.cn/p.aspx?u=v20_p13_p_1001031837029282_0.jpg"" rel=""nofollow"">the result</a></p>","233618","","18936","","2010-01-03 12:53:23","2010-01-03 12:53:23","image included javascript not appear in the webView","<javascript><android><webview>","1","4","","",""
"1994703","1","3323834","","2010-01-03 11:35:32","45","13081","<p>In theory, Dalvik executes any virtual machine byte code, created for example with the compilers of </p><ul><li>AspectJ</li><li>ColdFusion</li><li>Clojure</li><li>Groovy</li><li>JavaFX Script</li><li>JRuby</li><li>Jython</li><li>Rhino</li><li>Scala</li></ul><p>Are there already working versions of bytecode compilers for Dalvik available for other languages than Java?</p>","80901","","379693","","2010-07-24 08:24:35","2013-06-20 16:33:47","Which programming languages can I use on Android Dalvik?","<java><python><android><scala><dalvik>","7","1","28","",""
"1994732","1","","","2010-01-03 11:45:37","4","3413","<p>I don't want to show the virtual keyboard.</p><p>I tried the below method but it doesn't make any difference.</p><pre><code>InputMethodManager imm =     InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);imm.hideSoftInputFromWindow(enter_count.getWindowToken(), 0);</code></pre><p>enter_count is my edit textI have tried reading up on the InputMethod Manager but can't follow it. </p><p>I can set the input type of my edit text called enter_count as follows</p><pre><code>enter_count.setInputType( InputType.TYPE_NULL );</code></pre><p>but then I can't specify to only accept numeric input</p><p>Can you please give me a reasonable solution to simply not show the virtual keyboard without losing the ability to only accept numeric input on the physical keyboard.</p>","242657","","113834","","2010-01-03 11:46:50","2014-02-22 11:00:48","how to hide the virtual keyboard","<android><keyboard><virtual><hide>","5","0","2","",""
"1994752","1","1994794","","2010-01-03 11:54:14","2","124","<p>Can Android applications see OS wide context in terms of network? For example,</p><ul><li>what applications are using the network</li><li>what IP addresses is the OS connected to</li><li>etc.</li></ul><p>I'm asking because I know each application runs in it's own <a href=""http://en.wikipedia.org/wiki/Dalvik_virtual_machine"" rel=""nofollow"">Dalvik virtual machine</a>.</p>","19868","","63550","","2010-05-05 14:13:52","2010-05-05 14:13:52","Can Android applications examine OS wide context, for example network related?","<android>","1","0","","",""
"1994947","1","","","2010-01-03 13:28:32","1","1253","<p>I need to make an activity that will draw on the home screen, actually I simulate that part by making the background transparent to make that effect, but the problem is that I need to blur a geometric area around the touch coordinates, id needs to be a blurry circle with normal text over the blur, I know how to make what I need with semi transparent area but it needs to be made with custom blur (gaussian), but not just a screenshot with blurred part, but an active desktop, so the blur is like, just a mask over the transparent background of the activity</p>","240864","","","","","2010-01-03 13:28:32","android transparent blur","<android><transparent><blur>","0","0","1","",""
"1994994","1","1995001","","2010-01-03 13:42:19","0","509","<p>I am creating a request string which hast bo be formatted the following way:</p><p><a href=""http://staging.myproject.com?tags=tag1,tag2,tag3"" rel=""nofollow"">http://staging.myproject.com?tags=tag1,tag2,tag3</a></p><p>There is an EditText dialog on the form where the user writes the tags. The user however can write the tags in the EditText whatever way he wants, for example using commas: tag1, tag2, tag3 or tag1,tag2,tag3 (without spaces) or tag1 tag2 tag3 or for example someone could make multiple spaces between two tags: tag1  tag, tag3...</p><p>I have to make a logic to reshape the content of the EditText the way it matches format </p><blockquote>  <p>""tag1,tag2,tag3""</p></blockquote><p>(remove spaces, add commas if necessary...).</p><p>Does anyone know what is the easiest way to do it in Java?</p><p>Thank you.</p>","22996","","","","","2010-01-04 18:25:53","string manipulation","<java><android><string>","1","0","","",""
"1995004","1","1995076","","2010-01-03 13:45:09","25","13127","<p>I am working on some reusable Android code that I would like to distribute to other developers for use within their own applications. The code has some resource dependencies (layouts, xml &amp; png drawables) that I would like to be able to include and reference within a single package (Jar file).</p><p>Is this possible, and if so what is the best method to do this?</p>","235945","","1503078","","2013-11-17 22:50:27","2014-03-04 23:27:43","Packaging Android resource files within a distributable Jar file","<android><android-resources>","6","1","30","",""
"1995292","1","1997158","","2010-01-03 15:36:36","0","2177","<p>I'm just writing a SQLite powered android applications however I keep getting a NullPointerException when I call my DatabaseHelper class. The code which appears to be causing the error is below:</p><pre><code>public Cursor GetAllRows() {        try {            return db.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_PHRASE},                    null, null, null, null, null);        } catch (SQLException e) {            Log.e(""Exception on query"", e.toString());            return null;        }}</code></pre><p>I have gone over and over the code and see no error, although I normally miss the easy stuff!</p><p>Can anyone see something wrong? If you think the error exists outside this I can post more code however im fairly certain this is the block causing the error...</p><p>UPDATE: Full source of the DB-adapter. (this is based from the notepad example If I remember correctly).</p><p>package com.trapp.tts;</p><p>import android.content.ContentValues;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;</p><p>public class DbAdapter {</p><pre><code>public static final String KEY_PHRASE = ""phrase"";public static final String KEY_ROWID = ""_id"";private static final String TAG = ""DbAdapter"";private DatabaseHelper mDbHelper;private SQLiteDatabase mDb;/** * Database creation sql statement */private static final String DATABASE_CREATE =        ""create table  phrases (_id integer primary key autoincrement, ""                + ""phrase text not null);"";private static final String DATABASE_NAME = ""db"";private static final String DATABASE_TABLE = "" phrases"";private static final int DATABASE_VERSION = 1;private final Context mCtx;private static class DatabaseHelper extends SQLiteOpenHelper {    DatabaseHelper(Context context) {        super(context, DATABASE_NAME, null, DATABASE_VERSION);    }    @Override    public void onCreate(SQLiteDatabase db) {        db.execSQL(DATABASE_CREATE);        ContentValues cv=new ContentValues();        cv.put(KEY_PHRASE, ""1"");        db.insert(""phrases"", KEY_PHRASE, cv);        cv.put(KEY_PHRASE, ""2"");        db.insert(""phrases"", KEY_PHRASE, cv);        cv.put(KEY_PHRASE, ""3"");        db.insert(""phrases"", KEY_PHRASE, cv);        cv.put(KEY_PHRASE, ""4"");        db.insert(""phrases"", KEY_PHRASE, cv);        cv.put(KEY_PHRASE, ""5"");        db.insert(""phrases"", KEY_PHRASE, cv);        cv.put(KEY_PHRASE, ""6"");        db.insert(""phrases"", KEY_PHRASE, cv);        cv.put(KEY_PHRASE, ""7"");        db.insert(""phrases"", KEY_PHRASE, cv);        cv.put(KEY_PHRASE, ""8"");        db.insert(""phrases"", KEY_PHRASE, cv);        cv.put(KEY_PHRASE, ""9"");        db.insert(""phrases"", KEY_PHRASE, cv);    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        Log.w(TAG, ""Upgrading database from version "" + oldVersion + "" to ""                + newVersion + "", which will destroy all old data"");        db.execSQL(""DROP TABLE IF EXISTS notes"");        onCreate(db);    }}/** * Constructor - takes the context to allow the database to be * opened/created *  * @param ctx the Context within which to work */public DbAdapter(Context ctx) {    this.mCtx = ctx;}/** * Open the notes database. If it cannot be opened, try to create a new * instance of the database. If it cannot be created, throw an exception to * signal the failure *  * @return this (self reference, allowing this to be chained in an *         initialization call) * @throws SQLException if the database could be neither opened or created */public DbAdapter open() throws SQLException {    mDbHelper = new DatabaseHelper(mCtx);    mDb = mDbHelper.getWritableDatabase();    return this;}public void close() {    mDbHelper.close();}/** * Create a new note using the title and body provided. If the note is * successfully created return the new rowId for that note, otherwise return * a -1 to indicate failure. *  * @param title the title of the note * @param body the body of the note * @return rowId or -1 if failed */public long createPhrase(String title, String body) {    ContentValues initialValues = new ContentValues();    initialValues.put(KEY_PHRASE, title);    return mDb.insert(DATABASE_TABLE, null, initialValues);}/** * Delete the note with the given rowId *  * @param rowId id of note to delete * @return true if deleted, false otherwise */public boolean deletePhrase(long rowId) {    return mDb.delete(DATABASE_TABLE, KEY_ROWID + ""="" + rowId, null) &gt; 0;}/** * Return a Cursor over the list of all notes in the database *  * @return Cursor over all notes */public Cursor fetchAllPhrases() {    return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_PHRASE},                    null, null, null, null, null);}/** * Return a Cursor positioned at the note that matches the given rowId *  * @param rowId id of note to retrieve * @return Cursor positioned to matching note, if found * @throws SQLException if note could not be found/retrieved */public Cursor fetchPhrase(long rowId) throws SQLException {    Cursor mCursor =            mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID,                    KEY_PHRASE}, KEY_ROWID + ""="" + rowId, null,                    null, null, null, null);    if (mCursor != null) {        mCursor.moveToFirst();    }    return mCursor;}/** * Update the note using the details provided. The note to be updated is * specified using the rowId, and it is altered to use the title and body * values passed in *  * @param rowId id of note to update * @param title value to set note title to * @param body value to set note body to * @return true if the note was successfully updated, false otherwise */public boolean updatePhrase(long rowId, String title, String body) {    ContentValues args = new ContentValues();    args.put(KEY_PHRASE, title);    return mDb.update(DATABASE_TABLE, args, KEY_ROWID + ""="" + rowId, null) &gt; 0;}</code></pre><p>}</p><p>Calling code:</p><pre><code>private void fillData() {    mCursor = dbHelper.fetchAllPhrases();    startManagingCursor(mCursor);    ListAdapter adapter = new SimpleCursorAdapter(            this,             android.R.layout.simple_list_item_1,            mCursor,            new String[] {""phrase""},            new int[] {}            );    setListAdapter(adapter);}</code></pre><p>It seems to crash on the call for .fetchAllPhrases()</p><p>mCursor = dbHelper.fetchAllPhrases();</p>","122547","","492624","","2011-12-28 14:36:22","2011-12-28 14:36:22","Android database crashes NullPointerException","<database><android><sqlite>","2","1","0","",""
"1995320","1","1995593","","2010-01-03 15:45:55","33","37596","<p>I'd like to add a feature to my android app that automatically backs up the sqlite database to the sd card.</p><p>What's the best way to go about this?Any examples/tutorials available?</p>","131871","","","","","2013-07-29 11:48:55","How to backup database file to sdcard on android?","<database><android><backup><sd-card>","8","2","22","",""
"1995439","1","12707479","","2010-01-03 16:19:10","97","46453","<p>I would like to know if there is a way for reading the Phone Model Programmatically in android.</p><p>I would like to get a string like HTC Dream, Milestone, Sapphire or whatever...</p><p>Thanks :)</p>","314407","","2535973","","2014-02-27 08:26:59","2014-02-27 08:26:59","Get Android Phone Model Programmatically","<android><android-hardware>","4","0","31","",""
"1995614","1","1995788","","2010-01-03 17:30:42","0","3757","<p>I am writing a screen scraping app that reads out various pages and extracts the data. I'm using the <code>SAXParserFactory</code> go get a <code>SAXParser</code> which in turn gets me an <code>XMLReader</code>. I have configured the Factory like this:</p><pre><code>spf = SAXParserFactory.newInstance();spf.setValidating(false);spf.setFeature(""http://xml.org/sax/features/validation"", false);spf.setFeature(""http://apache.org/xml/features/disallow-doctype-decl"", true);spf.setFeature(""http://xml.org/sax/features/use-entity-resolver2"", false);</code></pre><p>However, whenever I parse a document that contains the <code>&amp;nbsp</code> entity I get an</p><pre><code>SEVERE: null    org.xml.sax.SAXParseException: The    entity ""nbsp"" was referenced, butnot declared.            at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)            at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)</code></pre><p>I can understand that it can't find the entity, since I told the factory to not read the DTD, but how do I disable entity checking alltogther?</p><p>EDIT: This is for an Android app, which is why I am reluctant to use an API/library that isn't in the standard environment.</p>","99022","","21234","","2010-01-05 22:47:19","2010-01-05 22:47:19","How to configure Java's SaxParserFactory to disable entity checking?","<java><android><sax>","4","0","1","",""
"1995998","1","1995999","","2010-01-03 19:30:26","16","20758","<p><br>Do you know some quick and sufficient way to get altitude (elevation) by longitude and latitude, that would be easy to use on Android platform?</p><p><em>While this is a self-learning question, my approach is still time-consuming ('coz it's web-service etc), so I would like to receive any alternatives or possible improvement suggestions!</em></p><p>Thank you!</p>","67407","","67407","","2010-01-03 20:05:07","2012-11-12 04:38:43","Android - Get Altitude By Longitude and Latitude?","<android><geolocation><gis><android-mapview>","5","0","25","",""
"1996137","1","1996338","","2010-01-03 20:14:42","0","213","<p>I just got my Milestone (aka Droid in the US) and want to write a simple app to ulock the screen touching one of the soft buttons, ala Hero. I looked into the Android API and could not find a helpful one, could someone enlighten me?</p>","162414","","114066","","2010-09-27 07:59:47","2010-09-27 07:59:47","How do I write a Hero like unlocking app for the Milestone (Droid)?","<android><api><unlock>","1","1","","",""
"1996173","1","1996182","","2010-01-03 20:24:36","10","20778","<p>new to Android.  Checked the FAQs on the SDK site but didn't find anything that was helpful.</p><p>I'm learning via a few books w/downloadable code.  One of the examples I'd like to get running won't even compile because the IDE can't find/import the <strong>com.google.android.maps</strong> library/package, which I found odd since I have everything possible installed that the SDK offers.  The book info on the publisher site was not helpful either.  Any ideas?</p><p>I'm using Eclipse (build 20090920-1017) with the ADT 0.9.5 plugin.  SDK is fully updated (all available packages installed, including android 1.1 api 2 rev. 1 through android 2.0.1 api6 rev 1, and google apis 3 rev 3 through 6 rev 1.)</p><p>Any advice is appreciated.. thanks in advance.</p>","242810","","","","","2013-10-30 11:09:17","com.google.android.maps missing?","<android>","6","0","7","",""
"1996294","1","1996416","","2010-01-03 21:02:08","38","22427","<p>I've got a few classes that implement <a href=""http://developer.android.com/reference/android/os/Parcelable.html"">Parcelable</a> and some of these classes contain each other as properties. I'm marshalling the classes into a <a href=""http://developer.android.com/reference/android/os/Parcel.html"">Parcel</a> to pass them between activities. Marshalling them TO the Parcel works fine, but when I try to unmarshall them I get the following error:</p><pre><code>...AndroidRuntime  E  Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: schemas.Arrivals.LocationTypeAndroidRuntime  E   at android.os.Parcel.readParcelable(Parcel.java:1822)AndroidRuntime  E   at schemas.Arrivals.LayoverType.&lt;init&gt;(LayoverType.java:121)AndroidRuntime  E   at schemas.Arrivals.LayoverType.&lt;init&gt;(LayoverType.java:120)AndroidRuntime  E   at schemas.Arrivals.LayoverType$1.createFromParcel(LayoverType.java:112)AndroidRuntime  E   at schemas.Arrivals.LayoverType$1.createFromParcel(LayoverType.java:1)AndroidRuntime  E   at android.os.Parcel.readTypedList(Parcel.java:1509)AndroidRuntime  E   at schemas.Arrivals.BlockPositionType.&lt;init&gt;(BlockPositionType.java:244)AndroidRuntime  E   at schemas.Arrivals.BlockPositionType.&lt;init&gt;(BlockPositionType.java:242)AndroidRuntime  E   at schemas.Arrivals.BlockPositionType$1.createFromParcel(BlockPositionType.java:234)AndroidRuntime  E   at schemas.Arrivals.BlockPositionType$1.createFromParcel(BlockPositionType.java:1)...</code></pre><p>The <code>LayoverType</code> class (where it's failing):</p><pre><code>public class LayoverType implements Parcelable {        protected LocationType location;    protected long start;    protected long end;    public LayoverType() {}    public LocationType getLocation() {        return location;    }    public void setLocation(LocationType value) {        this.location = value;    }    public long getStart() {        return start;    }    public void setStart(long value) {        this.start = value;    }    public long getEnd() {        return end;    }    public void setEnd(long value) {        this.end = value;    }    // **********************************************    //  for implementing Parcelable    // **********************************************    @Override    public int describeContents() {        return 0;    }    @Override    public void writeToParcel(Parcel dest, int flags) {        dest.writeParcelable(location, flags);        dest.writeLong(start);        dest.writeLong(end  );    }    public static final Parcelable.Creator&lt;LayoverType&gt; CREATOR = new Parcelable.Creator&lt;LayoverType&gt;() {        public LayoverType createFromParcel(Parcel in) {            return new LayoverType(in);        }        public LayoverType[] newArray(int size) {            return new LayoverType[size];        }    };    private LayoverType(Parcel dest) {        location = (LocationType) dest.readParcelable(null);    // it's failing here        start = dest.readLong();        end   = dest.readLong();    }}</code></pre><p>Here's the <code>LocationType</code> class:</p><pre><code>public class LocationType implements Parcelable {    protected int locid;    protected String desc;    protected String dir;    protected double lat;    protected double lng;    public LocationType() {}    public int getLocid() {        return locid;    }    public void setLocid(int value) {        this.locid = value;    }    public String getDesc() {        return desc;    }    public void setDesc(String value) {        this.desc = value;    }    public String getDir() {        return dir;    }    public void setDir(String value) {        this.dir = value;    }    public double getLat() {        return lat;    }    public void setLat(double value) {        this.lat = value;    }    public double getLng() {        return lng;    }    public void setLng(double value) {        this.lng = value;    }    // **********************************************    //  for implementing Parcelable    // **********************************************    @Override    public int describeContents() {        return 0;    }    @Override    public void writeToParcel(Parcel dest, int flags) {        dest.writeInt   (locid);        dest.writeString(desc );        dest.writeString(dir  );        dest.writeDouble(lat  );        dest.writeDouble(lng  );    }    public static final Parcelable.Creator&lt;LocationType&gt; CREATOR = new Parcelable.Creator&lt;LocationType&gt;() {        public LocationType createFromParcel(Parcel in) {            return new LocationType(in);        }        public LocationType[] newArray(int size) {            return new LocationType[size];        }    };    private LocationType(Parcel dest) {        locid = dest.readInt   ();        desc  = dest.readString();        dir   = dest.readString();        lat   = dest.readDouble();        lng   = dest.readDouble();    }}</code></pre><p><strong>Update 2</strong>: As far as I can tell it's failing at the following bit of code (from <a href=""http://www.netmite.com/android/mydroid/frameworks/base/core/java/android/os/Parcel.java"">Parcel's source</a>):</p><pre><code>Class c = loader == null ? Class.forName(name) : Class.forName(name, true, loader);</code></pre><p>Why is it not able to find the class? It both exists and implements <code>Parcelable</code>.</p>","76835","","76835","","2010-01-04 07:56:00","2013-11-21 21:59:28","Problem unmarshalling parcelables","<java><android><marshalling><parcelable>","8","6","6","",""
"1996505","1","","","2010-01-03 22:03:52","1","1662","<p>When I first ran across <a href=""http://phonegap.com/"" rel=""nofollow"">PhoneGap</a>, I was excited because I envisioned simply dropping in the URL of a mobile site and simply updating the mobile site to use the devices capabilities when available. </p><p>Alas, it seems it is not that easy. </p><p>From what I understand (and I could be incorrect), any <strong>HTML/JS access to the device's hardware is limited to local 'pages'</strong>. So essentially create a HTML/JS local 'web' app to access the 'real' mobile web app by AJAX like calls. It seems a little redundant (at least to me) when the point is to simply extend the interface an existing mobile site. </p><p>Not trying to knock PhoneGap here, just wondering if there's a similar framework that <strong>allows a remote site to access the phone's hardware directly</strong>. Or if I've missed how that can be done with PhoneGap.</p><p><em>(Sure, I know ""allows a remote site to access the phone's hardware directly"" sounds scary - but the URL is hard-coded in the app, and HTTPS could provide authenticity. Of course, security is probably why this isn't supported by PhoneGap.)</em></p>","45531","","45531","","2010-01-04 21:26:44","2010-11-26 19:11:17","Is there a Mobile 'Web Wrapper' Framework allowing Device Access to a Remote Site?","<iphone><android><blackberry><mobile><phonegap>","2","2","","",""
"1996686","1","2021337","","2010-01-03 23:01:22","34","14278","<p>I'm pretty exasperated. I'm attempting to build a turn-based multiplayer online game for Android using Google App Engine in Java as the server.</p><p>They seem like a perfect fit. Android requires a Google account, and GAE uses a Google account for authentication, while being free and scalable.</p><p>So before the holidays I was able to get authentication to my GAE app from my Android client using the new AccountManager API in Android 2.0. The following code allows you to access the AuthToken of the user's Google account and then use it for authentication, so that the user does not have to manually enter their account username and password:  </p><pre><code>   AccountManager mgr = AccountManager.get(this);    Account[] accts = mgr.getAccountsByType(""com.google"");    Account acct = accts[0];   AccountManagerFuture&lt;Bundle&gt; accountManagerFuture = mgr.getAuthToken(acct, ""ah"", null, this, null, null);   Bundle authTokenBundle = accountManagerFuture.getResult();    String authToken = authTokenBundle.get(AccountManager.KEY_AUTHTOKEN).toString();</code></pre><p>I was then able to append the resulting AuthToken string to the appropriate URL and get a valid cookie which I could then use for all further requests. Only thing is, sometime last week it just stopped working for me. Now when I try to use the AuthToken from the above code, I don't get a cookie returned and my code throws a NullPointerException for the missing cookie.</p><p>When I go back to the old way, when the user was manually entering in their Google username and password and I get the AuthToken from ""https://www.google.com/accounts/ClientLogin"", it works just fine.</p><p>Please tell me someone out there has built an Android client for a Google App Engine app using the AuthToken from the Google account on the user's phone, and give me some clue as to why this is no longer working. </p><p>I'd really like to make this work. My alternatives are to require the user to enter their credentials (which is clunky, and which they shouldn't have to do), or going with another solution for the server.</p><p>Thanks in advance.</p>","242869","","110707","","2010-01-04 14:21:38","2012-10-23 21:33:53","AuthToken from AccountManager in Android Client No Longer Working","<android><google-app-engine><authentication>","2","2","31","",""
"1997328","1","2000784","","2010-01-04 03:09:32","54","31185","<p>What I am trying to accomplish is to have clickable hyperlinks in the message text displayed by an AlertDialog. While the AlertDialog implementation happily underlines and colors any hyperlinks (defined using &lt;a href=""...""&gt; in the string resource passed to Builder.setMessage) supplied the links do not become clickable.</p><p>The code I am currently using looks like this:</p><pre><code>new AlertDialog.Builder(MainActivity.this).setTitle(        R.string.Title_About).setMessage(        getResources().getText(R.string.about))        .setPositiveButton(android.R.string.ok, null)        .setIcon(R.drawable.icon).show();</code></pre><p>I'd like to avoid using a WebView to just display a text snippet, so any advice how to get this working is much appreciated!</p>","43575","","194894","","2013-11-24 22:46:40","2013-11-24 22:54:35","How can I get clickable hyperlinks in AlertDialog from a string resource?","<android><user-interface><hyperlink><custom-controls>","10","2","34","",""
"1997474","1","2004000","","2010-01-04 04:15:03","10","19901","<p>I'm trying to work through their notepad tutorial and it describes how the Eclipse project should automagically build and re-generate the auto-generated code when a file is saved.  That wasn't happening, and looking at their debugging, they suggest the ""reset adb"" link in the DDMS perspective in the Devices panel.  When I try to do that, I get the following output which I assume is bad:</p><pre><code>[2010-01-03 23:09:51 - DeviceMonitor]Adb connection Error:EOF[2010-01-03 23:09:51 - DeviceMonitor]Connection attempts: 1</code></pre><p>a quick Google didn't reveal anything particular useful.  What are the next debugging steps and/or what might be the issue?</p><p>UPDATE: So this actually isn't a problem like I thought it was, but I'd still be curious what this message means if anyone knows.</p>","2484","","2484","","2010-01-04 04:21:46","2010-01-05 03:29:53","Android Eclipse Plugin ""reset adb"" gives ""Adb connection Error:EOF"" error, not blocking, but what is it?","<android><eclipse>","1","0","2","",""
"1997703","1","","","2010-01-04 05:46:59","1","1366","<p>How can I create a navigation based app using the android sdk? Not navigating as in using maps, but like how the settings app works. You click on item, and it goes to a new page of items to click.</p><p>I can't find any good samples or documentation. Yes, I've looked through the Android developers website.</p>","242991","","","","","2010-01-04 06:07:34","Android listview/navigation based app","<java><android><eclipse><sdk>","1","0","","",""
"1997804","1","","","2010-01-04 06:24:09","3","888","<p>I am going to develop a handheld device which has an Atom processor. I am thinking of using Android embedded OS for running telecom applications on this device. I have heard from my friends that Android is good for wireless applications. But my device does not need any wireless application. I will need only data (ping, traceroute...), IPTV and VoIP applications to run on this device. So is it advisable to use Android for my device?</p>","218284","","60075","","2010-01-04 08:39:30","2010-01-04 14:16:58","Is Android recommended for Atom processor platform?","<android><embedded><voip><handheld><iptv>","2","4","1","",""
"1997904","1","1998646","","2010-01-04 06:53:04","15","9218","<p>Since we are using logcat as a console for android.There are cases when the the output text/msg is kinda big and I can't see the complete output.The log cat shows only the starting part of it.Is there a way to expand it so that I can see the full msg?</p>","199525","","","","","2012-04-20 19:37:54","How can I see long texts/msg in logcat?","<android><console><logcat>","5","5","5","",""
"1998278","1","1998370","","2010-01-04 08:46:00","0","8131","<p>If you ever tried to write a locker app on Android sure you meet this problem:  </p><pre><code>boolean mBackPressed = false;@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if (event.getAction() == KeyEvent.ACTION_DOWN) {        switch (keyCode) {        case KeyEvent.KEYCODE_BACK:            mBackPressed = true;            break;        case KeyEvent.KEYCODE_MENU:            if (mBackPressed)                unLock();            break;        default:            mBackPressed = false;            showMessage();            break;        }    }    return true;}private void showMessage() {    Toast.makeText(getBaseContext(), ""Back + Menu"", Toast.LENGTH_SHORT)            .show();}private void unLock() {    this.setResult(Activity.RESULT_OK);    this.finish();}</code></pre><p>Seems like onKeyDown is filtering out all keys but ""Back"" and ""Menu""...<br><em>Well, it's not true!</em> Home button will still bring you Home screen and End Call button will run native Locker application!  </p><p>Fellow's out there also claim it as a problem:<br><a href=""http://groups.google.com/group/android-framework/browse_thread/thread/ddc9b724f0aa4fce"" rel=""nofollow"">How to listen from ENDCALL button</a><br><a href=""http://groups.google.co.jp/group/android-developers/msg/e5b3167d0c2768a5"" rel=""nofollow"">problem With Home Back screen button</a><br><a href=""http://groups.google.com/group/android-developers/browse_frm/thread/7500657bd508170"" rel=""nofollow"">Supressing Key presses in Activity, especially in Options Menu</a><br><a href=""http://code.google.com/p/android/issues/detail?id=4202"" rel=""nofollow"">Issue 4202: Feature Suggestion: permission for intercepting KEYCODE_CALL</a>  </p><p>Do you know any workaround to block two those buttons?<br>Is the only way (as often) - <em><a href=""http://www.cs.bgu.ac.il/~omri/Humor/write_in_c.html"" rel=""nofollow"">write in C</a></em> ?</p>","67407","","67407","","2010-01-04 15:51:14","2010-08-05 13:32:01","Android - capture/suppress Home and EndCall buttons events?","<android><key><keydown>","1","0","","",""
"1998375","1","","","2010-01-04 09:13:46","2","4384","<p>I've developed a <code>GPS</code> app in which i record the user roots and show iton the map.......butPanning around on the map when reviewing my route is painfully slow,it takes at least 4 or 5 seconds for the map to respond the fingerswipes......</p><p>I've overridden the <code>onDraw()</code>  method and drawing the lines to show theroutes......is there any better way to do this so that panning becomesfaster as in <code>""MyTracks""</code>...........</p><p>Thank you all.....Pratap S. </p>","243075","","760489","","2012-01-04 05:02:54","2012-07-02 01:53:11","Android Mapview panning and zooming too slow","<android><android-mapview>","4","0","5","",""
"1998400","1","1998541","","2010-01-04 09:22:35","12","33849","<p>I m using Android 1.5 my data directory doesn't have the read/write permissions </p><pre><code>System.out.println(""DAta can write??---&gt;""+Environment.getDataDirectory().canWrite());System.out.println(""DAta can read??---&gt;""+Environment.getDataDirectory().canRead());</code></pre><p>So please suggest me how to provide permissions for the data directory.</p><p>What I'm trying to do is to create a file and add some content to it in the Data storage of the emulator like as below</p><pre><code>private void writeToSDCard() {        try {            File lroot = Environment.getDataDirectory();            if (lroot.canWrite()){                File lfile = new File(lroot, ""samplefile.txt"");                FileWriter lfilewriter = new FileWriter(lfile);                BufferedWriter lout = new BufferedWriter(lfilewriter);                lout.write(""XXXXXXXXXXXXXXXXXX"");                lout.close();            }        } catch (IOException e) {            Log.e(m_cTAG, ""Could not write file "" + e.getMessage());        }    }</code></pre>","28557","","864358","","2013-12-26 17:45:56","2013-12-26 17:45:56","Data directory has no read/write permission in Android","<android><android-emulator><android-manifest>","1","0","9","",""
"1998483","1","10296747","","2010-01-04 09:43:38","12","35709","<p>I used <code>ListView</code> to dynamic add item,but there is a problem about not Smooth add.there are textView and button in my listActivity,Iwant to Press button ,then <code>TextView</code>'s text can auto add to <code>ListView</code>,but i Pressed button, it donot work,unless after i enter content , press ""OK""Key ,then Pressed button, <code>TextView's</code> text can auto add to <code>ListView</code>. I donot know why. If I continuous Pressed button, as 3 times, then press ""Ok"" key, the content</p><p>auto add list</p><p>View but 3 times.</p><pre><code> public class DynamicListItems extends ListActivity {   private static final String   ITEM_KEY   = ""key"";   ArrayList&lt;HashMap&lt;String, String&gt;&gt;   list= new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();private SimpleAdapter   adapter;private EditText    newValue;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.dynamic_list);    newValue = (EditText) findViewById(R.id.new_value_field);    setListAdapter(new SimpleAdapter(this, list, R.layout.row, new String[] { ITEM_KEY }, new int[] { R.id.list_value }));    ((ImageButton) findViewById(R.id.button)).setOnClickListener(getBtnClickListener());}private OnClickListener getBtnClickListener() {    return new OnClickListener() {        public void onClick(View view) {            try {                HashMap&lt;String, String&gt; item = new HashMap&lt;String, String&gt;();                item.put(ITEM_KEY, newValue.getText().toString());                list.add(item);                adapter.notifyDataSetChanged();            } catch (NullPointerException e) {                Log.i(""[Dynamic Items]"", ""Tried to add null value"");            }        }    };   }}</code></pre><p>How to dynamic delete the item ?</p><ul><li>dynamic_list.xml only contains listView ,button,textView</li><li>row.xml contains <code>TextView</code></li></ul>","233618","","548526","","2013-04-09 11:08:53","2013-04-09 11:08:53","listView dynamic add item","<android><listview>","3","0","2","","2010-01-05 05:01:43"
"1998636","1","1998654","","2010-01-04 10:19:57","6","1113","<p>I am starting to develop Android applications and I would like to know if there are any tips for creating lightweight applications. This is my first attempt to write applications on a mobile platform but I hope that my experience in programming will help.</p><p>I have in mind the ""Better, Faster, Lighter Java"" book, but will this be ""the"" answer to my question? Are there any tips specific for the Android Platform that will allow me to build lightweight applications?</p>","80836","","1228","","2013-07-18 19:49:26","2013-07-18 19:49:26","Tips for lightweight Android Applications","<android><lightweight>","2","1","5","",""
"1998916","1","1999016","","2010-01-04 11:14:03","8","1018","<p>I'm looking to create a mobile version of our website/web app. What's a good way to provide the best, most fully featured version.</p><p>Part of the reason for creating it is instead of an iPhone app, so I'd like to offer an iPhone web app that takes full advantage of the iPhone's version of WebKit (so CSS animations, being able to rely on good javascript support etc). However, I'd also like the site to work well on other smart phones as well as more basic mobile phones as well.</p><p>Do I create two sites (Mobile WebKit and basic mobile web) and redirect based on User Agent? Can I create one site that degrades well? What are the possibilities, and how do other people handle it? </p><p>Also: are mobile web simulators worth a damn? I have an iPhone, so can test easily on that. If I want to test on Blackberry/Palm Pre do I really need a device or are there reliable simulators?</p>","180235","","","","","2010-09-10 06:45:55","Creating a mobile version of a website","<iphone><android><mobile-phones><mobile-safari>","1","0","4","",""
"1999107","1","","","2010-01-04 11:57:09","1","449","<p>How I can create apk application from two different dex file ?I did'nt find any way to link many dex files with the android tools.</p>","164460","","","","","2012-04-17 23:43:57","android link dex files","<android>","2","0","1","",""
"1999577","1","1999712","","2010-01-04 13:36:56","0","196","<p>I have a GridView, in my activity, that displays about 30 thumbnails fetched from a remote server. I am doing 2-level caching for the images:  </p><ol><li>there is an in-memory cache(HashMap using softReferences)</li><li>Secondly, all the images fetched are written to Sdcard(so as to avoid refetches when in-memory bitmaps are GC'd).</li></ol><p>From the getView of the GridView-Adapter, I call getCachedImage function of the Cache class, which will either return a default image or an image from one of the caches. When a default image is returned, the Cache class starts a AsyncTask to fetch the image from the remote server. This image is then also written to both the caches.</p><p><strong>The problem is:</strong> When the AsyncTask finishes, I want it to also update the UI alongwith the caches. I tried passing the instance of the GridView child(ImageView) to the AsyncTask and then setting the image of this child view, in the postExecute of the AsyncTask but due to View recycling, this approach results in incorrect images in incorrect views, if the fetches take long time.</p><p>What are the ways in which i can make my AsyncTask more proactive meaning it should let the UI know that image download has finished?<br>Thanks! </p>","236128","","","","","2010-01-04 17:43:18","What are the ways to get a handle on the view amidst recycling?","<android><listview><caching><performance>","2","0","","",""
"2000053","1","","","2010-01-04 15:01:44","2","9652","<p>I have an ubuntu 8.04 x86_64 system. I installed the ia32 libraries and manually installed(i.e. untarred) Eclipse Galileo Java EE. I then installed android's ADT-0.9.5 by downloading the zip file and pointing the software source as archive.</p><p>Now I need to add the android SDK in Windows->preferences->android. However, when I select the SDK directory there and select Apply/OK, nothing happens. The next time I open preferences, the directory is there in the selection dialog, but eclipse just won't load/do anything on clicking Apply.</p><p>Could someone help me out...it is driving me crazy.</p>","","user243260","472792","","2013-05-15 22:00:02","2014-04-17 06:48:33","Eclipse not loading android SDK","<eclipse><android><installation>","3","2","1","",""
"2000102","1","2000319","","2010-01-04 15:09:28","140","196595","<p>On pressing the back button, I'd like my application to go into the stopped state, rather than the destroyed state.</p><p>In the Android <a href=""http://developer.android.com/intl/fr/guide/practices/ui_guidelines/activity_task_design.html"">docs</a> it states:</p><blockquote>  <p>...not all activities have the behavior that they are destroyed when BACK is pressed. When the user starts playing music in the Music application and then presses BACK, the application overrides the normal back behavior, preventing the player activity from being destroyed, and continues playing music, even though its activity is no longer visible</p></blockquote><p><strong>How do I replicate this functionality in my own application?</strong></p><p>I think there must be three possibilities...</p><ol><li><p>Capture the back button press (as below) and then call whatever method(s) the home button calls.  </p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if ((keyCode == KeyEvent.KEYCODE_BACK)) {        Log.d(this.getClass().getName(), ""back button pressed"");    }    return super.onKeyDown(keyCode, event);}</code></pre></li><li><p>Capture the back button press and then spoof a home button press.  </p></li><li><p>Capture the back button press, then start an Activity of the home screen, effectively putting my application's Activity into the stopped state.</p></li></ol><p>Thanks in advance for any pointers.</p><p><strong>Edit:</strong>I know about services and am using one in the application to which this problem is related. This question is specifically about putting the Activity into the stopped state rather than the destroyed state on pressing the back button.</p>","172749","","1433971","","2014-03-13 21:58:00","2014-03-13 21:58:00","Override back button to act like home button","<android><button><override><back>","7","0","72","",""
"2000892","1","2001072","","2010-01-04 17:24:57","10","18369","<p>I used the layout editor in eclipse to mock up my ui layout and then I created the code to populate it dynamically and things are showing up as different sizes.  The XML I use to add the star images looks like this:</p><pre><code>&lt;ImageViewandroid:src=""@drawable/star_gold""android:layout_height=""22sp""android:layout_width=""22sp""android:adjustViewBounds=""true""android:layout_marginLeft=""2sp""android:layout_marginRight=""2sp"" /&gt;</code></pre><p>and the Java code I use to do the same thing looks like this:</p><pre><code>ViewGroup.MarginLayoutParams layout = new ViewGroup.MarginLayoutParams(22, 22);layout.setMargins(2, 0, 2, 0);ImageView star = new ImageView(mContext);star.setImageResource(R.drawable.star_gold);star.setLayoutParams(layout);star.setAdjustViewBounds(true);holder.Stars.addView(star);</code></pre><p>When I run my app on the G1 everything lines up and looks fine, but when I run it on the Droid the stars that I add via Java are about half the size of the ones I add in my XML.  What do I need to do to make sure everything scales appropriately?</p><p>Edit:These are great responses, but I need to know how to do it from code.  When I set the size it's in raw pixels, is there any way to set the size in dip's?</p>","236136","","236136","","2010-01-04 17:43:31","2012-04-30 03:45:35","What's the relationship between pixels and scaled pixels","<android><user-interface>","5","2","5","",""
"2001126","1","","","2010-01-04 18:07:59","0","313","<p>Vista 64; Eclipse 3-5-1.</p><p>I'm getting this error when I work on main.xml:</p><p>ERROR Error: No resource found that matches the given name (at 'text' with value '@string/get_text').</p><p>To eliminate variables I've created a new Android Project</p><ol><li><p>Opened main.xml and pasted this in</p></li><li><p>When I hit save I get the above error in a red X next to the </li></ol><p>This is related to a problem mentioned on this site. It's question # is <a href=""http://stackoverflow.com/questions/885009/"">885009</a>.</p><p>My project is set to automatically build.</p>","470635","","15168","","2010-01-04 18:10:36","2011-11-06 16:09:28","Eclipse Android error","<android><eclipse>","1","2","","",""
"2001146","1","","","2010-01-04 18:10:42","14","11631","<p>I am trying to use reflection to access some unpublished features of the telephony API.  Currently I am having trouble instantiating a <code>serviceManager</code> object that is needed to get the ""phone"" service as a binder which I can then use to instantiate a telephony object which is needed to make a call, end call, etc...</p><p>currently when I make the call </p><pre><code>serviceManagerObject = tempInterfaceMethod.invoke(null, new Object[] { new Binder() });</code></pre><p>it returns a nullPointerException.  I believe this has to do with creating a new Binder instead of sending the appropriate binder (which I am unsure of which one is appropriate)</p><pre><code>public void placeReflectedCall() throws ClassNotFoundException,        SecurityException, NoSuchMethodException, IllegalArgumentException,        IllegalAccessException, InvocationTargetException,        InstantiationException {    String serviceManagerName = ""android.os.IServiceManager"";    String serviceManagerNativeName = ""android.os.ServiceManagerNative"";    String telephonyName = ""com.android.internal.telephony.ITelephony"";    Class telephonyClass;    Class telephonyStubClass;    Class serviceManagerClass;    Class serviceManagerStubClass;    Class serviceManagerNativeClass;    Class serviceManagerNativeStubClass;    Method telephonyCall;    Method telephonyEndCall;    Method telephonyAnswerCall;    Method getDefault;    Method[] temps;    Constructor[] serviceManagerConstructor;    // Method getService;    Object telephonyObject;    Object serviceManagerObject;    String number = ""1111111111"";    telephonyClass = Class.forName(telephonyName);    telephonyStubClass = telephonyClass.getClasses()[0];    serviceManagerClass = Class.forName(serviceManagerName);    serviceManagerNativeClass = Class.forName(serviceManagerNativeName);    Method getService = // getDefaults[29];    serviceManagerClass.getMethod(""getService"", String.class);    Method tempInterfaceMethod = serviceManagerNativeClass.getMethod(            ""asInterface"", IBinder.class);    // this does not work    serviceManagerObject = tempInterfaceMethod.invoke(null,            new Object[] { new Binder() });    IBinder retbinder = (IBinder) getService.invoke(serviceManagerObject,            ""phone"");    Method serviceMethod = telephonyStubClass.getMethod(""asInterface"",            IBinder.class);    telephonyObject = serviceMethod            .invoke(null, new Object[] { retbinder });    telephonyCall = telephonyClass.getMethod(""call"", String.class);    telephonyEndCall = telephonyClass.getMethod(""endCall"");    telephonyAnswerCall = telephonyClass.getMethod(""answerRingingCall"");    telephonyCall.invoke(telephonyObject, number);}</code></pre>","198523","","1204143","","2013-03-29 18:40:41","2013-03-29 18:40:52","Reflection to access advanced telephony features","<java><android>","3","1","26","",""
"2001236","1","","","2010-01-04 18:24:37","4","11704","<p>How can I make certain pixels of an DrawableBitmap transparent?</p>","164460","","63550","","2010-01-04 20:02:16","2013-09-25 16:47:40","Android image transparency","<android><image><transparency>","4","1","1","",""
"2001247","1","","","2010-01-04 18:26:52","1","622","<p>The problem is this:</p><p>I make an internet connection to some urland receive an HttpResponse with an app_example.apk.</p><p>Then I want to create a file (an .apk) in the sdcard with this dataso that this downloaded application can be installed later.</p><p>How can I convert the HttpResponse to an .apk file?</p><p>Thank you all</p>","243376","","","","","2010-01-04 19:14:22","Create an .apk progamatically","<android>","2","3","","",""
"2001254","1","2080152","","2010-01-04 18:27:58","7","2184","<p>I am doing an <a href=""http://en.wikipedia.org/wiki/Android_%28operating_system%29"" rel=""nofollow"">Android</a> application and I want to get the last 25 sent mails from a certain email account.</p><p>For Gmail I might use <a href=""http://g4j.sourceforge.net/"" rel=""nofollow"">http://g4j.sourceforge.net/</a> and there is Mail Web Service API for Yahoo at <a href=""http://developer.yahoo.com/mail/"" rel=""nofollow"">http://developer.yahoo.com/mail/</a>.</p><p>But I couldn't find something to do it with Hotmail.</p><p>Do you know if it is possible?</p><p>Also I am worried of having so many dependencies. I don't know if I should do something like <a href=""https://sourceforge.net/projects/mrpostman/"" rel=""nofollow"">https://sourceforge.net/projects/mrpostman/</a> and do <a href=""http://en.wikipedia.org/wiki/Web_scraping"" rel=""nofollow"">web scraping</a>.</p>","119895","","63550","","2010-01-04 19:22:39","2011-05-20 10:41:22","Downloading sent mails from Yahoo, Gmail and Hotmail","<java><android>","4","0","3","",""
"2001590","1","2001769","","2010-01-04 19:29:45","14","9700","<p>Is there a way to programmatically list all available <a href=""http://developer.android.com/guide/topics/providers/content-providers.html"">content providers</a> on a device?  No real use case, I just thought it might be neat to see what apps I have installed on my phone that have exposed content providers.</p>","13070","","","","","2013-05-29 00:18:40","Get a list of available Content Providers","<android>","4","2","10","",""
"2001636","1","2002328","","2010-01-04 19:36:08","1","1104","<p>The problem is this:</p><p>I make an internet connection to some url and receive an HttpResponse with an app_example.apk.</p><p>Then I want to create a file (an .apk)in the sdcard with this data so that this downloaded applicationcan be installed later.</p><p>How can I convert the HttpResponse to an .apk file?</p><p>Let's clear some details:</p><ul><li>I have to get this apk file through an internet connection to my server</li><li>I don't want to install this applications I receive on the sdcard</li><li>All of this has to be done in my code, I cannot use android market</li></ul><p>I am currently writing to that file.</p><p>What I'm doing is converting the HttpResponse to a byte[ ],</p><p>then that byte[ ] is written to a file (an .apk) using an ObjectOutputStream.</p><p>Like this:</p><pre><code>    // byte[] appByteArray - already has the internet response converted in bytes    try {    file = new File(Environment.getExternalStorageDirectory()+""/""+appName+"".apk"");    file.createNewFile();    FileOutputStream stream = null;    stream = new FileOutputStream(file, false);    ObjectOutputStream objectOut =        new ObjectOutputStream(new BufferedOutputStream(stream));    objectOut.writeObject(appByteArray);    objectOut.close();    } catch (Exception e) {        e.printStackTrace();    }</code></pre><p>In the end, the file is createdand has the received content.</p><p>When I try to install it, through a VIEW intent (using the default installer)I get a parse error saying that it could not find the AndroidManifest.xml.</p><p>I think that in some step along the way, the received data is being corrupted.</p><p>Do you have another method to solve this?</p><p>Many thanks</p>","243376","","","","","2010-01-05 03:25:25","Convert HttpResponse to an .apk file","<android>","3","2","1","",""
"2001760","1","2002413","","2010-01-04 19:52:51","19","31382","<p>I have an Android <code>ListView</code> created with a <code>SimpleAdapter</code> that has more items in it than fit in the screen.  After the list has been scrolled, I need to get the position in the data model of the first visible item in the list.  </p><p>Basically I want a function like: <code>listView.getChildAt(0).getPositionInDataModel()</code>.</p><p><code>Adapter</code> has a few functions in it, like <code>getItemId(position)</code> that looked useful; however, the <code>SimpleAdapter</code> implementation just returns the passed in position, not a row id like I'd hoped.  </p><p>A brute force solution would be to get the View at index 0, and compare it to the view for each item in the adapter.  However, there doesn't seem to be an easy way to get the view for a particular position from the adapter.</p><p>Anyone have any thoughts?</p>","234039","","119895","","2013-08-31 12:56:14","2013-08-31 12:57:46","Android ListView: get data index of visible item","<android><listview>","3","0","6","",""
"2002166","1","2002455","","2010-01-04 20:54:11","5","6074","<p>after I found out (sadly) that there is no easy way to create a simple border around a View, I was forced to use the 9-patch-image approach to get a border around my View.</p><p>So I read the short thing there is on the 9-patch and its easy enough to understand. I started the ""Draw 9-patch"" application that came with the Android SDK, opened up a very simple image I created in Paint and then... I got stuck.</p><p>According to the page (<a href=""http://developer.android.com/guide/developing/tools/draw9patch.html"" rel=""nofollow"">http://developer.android.com/guide/developing/tools/draw9patch.html</a>) I should be able to define those areas where the image can be expanded and so on, just by clicking on the edges (""Click within the 1-pixel perimeter to draw the lines that define the stretchable patches..."").</p><p>So I try to do just that and absolutely nothing happens. I try to hold down SHIFT when clicking and also do the rigth-mouse-click, and nothing happens. When I move the mouse away from the 1-pixel perimiter I get a grey-and-red ""marquee"" (stripes).</p><p>Bottom line is: nothing happens no matter what I do.</p>","178143","","1069068","","2013-03-19 14:43:03","2013-03-19 14:43:03","Draw 9-patch not working - cannot edit image","<android>","3","0","2","",""
"2002288","1","5114361","","2010-01-04 21:15:00","261","220824","<p>Is there a way  to get the current Context instance by using a static method? </p><p>I'm looking for that way because i hate saving the context instance each time it changes.</p>","314407","","385478","","2013-05-09 13:09:47","2014-04-14 00:16:45","Static Way to get Context on android?","<android>","9","2","110","",""
"2002307","1","","","2010-01-04 21:18:17","1","903","<p><br>I have local HTML files with hebrew text that I'm trying to display on a webview in the android emulator but I only get squares and not the actual text.<br>I guess it's got to do with fonts not being supported.<br>Is there any way to display non latin text on the emulator?</p><p>Thanks!</p>","108242","","","","","2011-11-17 14:11:42","Showing html file with hebrew text on android emulator","<android><hebrew>","2","0","","",""
"2002607","1","2004105","","2010-01-04 22:06:26","10","21463","<p>I have a ListView that is backed by a SimpleCursorAdapter.</p><p>I'd like to be able to filter the list like you would a contacts list, just by typing, and I came across the textFilterEnabled()</p><p>Problem is, I couldn't see how to get it to work with a SimpleCursorAdapter.</p><p>Is this even possible?<br>If so, how is it done?</p>","131871","","85950","","2014-03-28 20:56:00","2014-03-28 20:56:00","How to text filter an Android ListView backed by a SimpleCursorAdapter?","<database><android><listview><filter><cursor>","3","0","5","",""
"2002920","1","2003426","","2010-01-04 23:02:43","8","16835","<p>How do I go about creating the following layout in Android?</p><p>I want a ""header"", that is, a header that stays the same at all times. The only thing that should change is the area below the header.</p><p>Think of it as a webpage, where the content-area is where its all happening =)</p><pre><code>+--------------------+| H E A D E R        |+--------------------+|                    ||                    ||                    ||  C O N T E N T     ||                    ||                    ||                    |+--------------------+</code></pre><p>Sure, its easy enough to create a LinearLayot, add a View on the top and then another view below that - tada! But what Im after is how you ""set up"" or design the project so its easy to just change whats in the Content.</p><p>What I <b>really</b> would like is to be able to ""swipe"" (see <a href=""http://stackoverflow.com/questions/1959106/android-how-to-create-different-screens-and-nav-between-them-using-touch-and-d"">here</a>) the area and then just ""roll in"" a new View/thing in the Content-area, but keep the same header.</p><p>What I really miss is a comprehensive library of layoyt-examples...</p><p>regards</p>","178143","","","","","2010-02-11 19:58:21","Android / layout: how to create a header-content layout","<android>","2","0","8","",""
"2003449","1","2004022","","2010-01-05 00:53:32","6","2029","<p>My application has a custom view which contains other custom views of a different type. The subviews have their own click listeners (which I can't change, as these are in 3rd party libraries). How can I intercept a user's click at the level of my view to do some processing, and then pass the click on to the proper subview?</p>","149992","","149992","","2010-01-05 01:17:37","2010-03-30 12:25:38","Intercepting clicks from subview in Android","<java><android><onclick>","2","0","3","",""
"2003503","1","2003579","","2010-01-05 01:11:19","4","1109","<p>I have an application that uses a Service to fetch data in the background both while the application is running and when it's not.When it is not running i would like to show a notification when there is new data, but not when the app is running.</p><p>How do i determine in my service whether the app is running or not?</p>","212651","","","","","2011-04-13 11:16:16","How can i determine when my application is running?","<android>","7","0","","",""
"2004040","1","2004495","","2010-01-05 03:41:39","13","14378","<p>I have an <code>ArrayList</code> of custom, simple <code>Serializable</code> objects I would like to cache to disk and read on re-launch.  My data is very small, about 25 objects and at most 5 lists so I think SQLite would be overkill.  In the iPhone world I would use <code>NSKeyedArchiver</code> and <code>NSKeyedUnarchiver</code> which works great.  On Android I've attempted to do this with with a <code>FileOutputStream</code> and <code>ObjectOutputStream</code> and while the result is the same, the performance is terrible.  Is there a better (read faster) way to cache small objects to the file system in Android?</p>","50808","","1162233","","2014-02-09 04:42:54","2014-02-09 04:42:54","Best Way to Cache Data in Android","<android>","4","1","10","",""
"2004344","1","","","2010-01-05 05:31:04","41","43677","<p>I am having an edittext field where I am setting the following property so that I can display the done button on the keyboard when user click on the textfield.</p><pre><code>editText.setImeOptions(EditorInfo.IME_ACTION_DONE);</code></pre><p>When user clicks the done button on the screen keyboard(finish typing) I want to change a radio button state, how can I track done button when it is hit from screen keyboard ?</p><p><img src=""http://i.stack.imgur.com/PMl69.jpg"" alt=""enter image description here""></p>","216431","","91687","","2012-12-18 19:42:01","2013-09-12 07:10:48","Android EditText ImeOptions ""Done"" track finish typing","<android><edittext>","3","1","13","",""
"2004828","1","2004857","","2010-01-05 08:37:23","1","1105","<p>I have installed Eclipse on Debian Lenny after having installed java (apt-get install sun-java6-jre sun-java6-plugin sun-java6-jdk).</p><p>When I run Eclipse, I have the following message when it comes to selet the folder that will be used as the workspace:</p><pre><code>GCJ has been detected as the current Java virtual machine.Use of GCJ is untested and unsupported.Please consult the documentation for more</code></pre><p>I just ignored this message and go into ""help"" -> ""software updates"" to install android development tools. When I add ""https://dl-ssl.google.com/android/eclipse/"" to download the Developer tools, I got an error (see below) and the installation cannot go any further.Is that due to the Garbage Collector message I got above ? </p><p>Below are the error I got on the console from which I run eclipse:</p><pre><code>lj:/home/luc# eclipse/eclipseGC Warning: Out of Memory!  Returning NIL!GC Warning: Out of Memory!  Returning NIL!GC Warning: Out of Memory!  Returning NIL!GC Warning: Out of Memory!  Returning NIL!GC Warning: Out of Memory!  Returning NIL!Error while logging event loop exception:java.lang.OutOfMemoryError&lt;&lt;No stacktrace available&gt;&gt;Logging exception:java.lang.OutOfMemoryError&lt;&lt;No stacktrace available&gt;&gt;GC Warning: Out of Memory!  Returning NIL!....</code></pre><p>Thanks a lot for your help,Luc</p>","231957","","","","","2010-01-05 08:43:18","Eclipse for android on Debian Lenny","<android><eclipse><debian>","1","0","","",""
"2005166","1","2005179","","2010-01-05 09:48:38","2","883","<p>I am new to Android, and I need some advices for start up.<br>I want to build an application, which will show up, when the user gets into some hot situation.</p><p>By hot situation I mean:  </p><ul><li>the GPS/cell coordinates are in known zone;  </li><li>known Bluetooth device detected;  </li><li>known Wi-Fi network detected;  </li><li>weather info has change;  </li></ul><p>I see something running in background and when one of the clauses hit, it will trigger and open the app.   </p><ul><li>How to get started?   </li><li>How do I make sure my app won't be shut down?   </li></ul><p>As I read somewhere that Android OS will terminate apps if memory out occurs or consumes too much, and my app would consume a lot, making repeated measures/checks to see if situation changed.</p><p>Regards,<br>Pentium10</p>","243782","","243782","","2010-01-05 10:12:22","2010-01-05 18:04:52","how to structure my app to run in background","<android>","2","0","2","",""
"2005331","1","2005354","","2010-01-05 10:20:14","1","1214","<p>I would like create a service to do something when some ""hot situation"" occurs, and by ""hot situation"" I mean the following:</p><ul><li>the GPS/cell coordinates are in a known zone</li><li>a known Bluetooth device is detected</li><li>a known Wi-Fi network is detected</li><li>weather info has changed</li><li>considerable change in acceleration of device detected: eg. from walking to travel by car.</li></ul><p>As one can see, these tasks are ""heavy"" and will be run frequently – say, 15 minutes, but sometimes even more – when I have to detect the acceleration of the device.</p><p>The question I have is this: will this service drain the battery heavily?  </p><p>If so, what recommendations do you have to minimize battery drain from the tasks described above?</p>","243782","","418613","","2012-06-07 03:02:22","2012-06-07 03:02:22","how to minimize battery drain in a heavy service","<android><power-management>","2","0","1","",""
"2005656","1","2005672","","2010-01-05 11:24:41","1","784","<p>I need to create a Timer to update the UI at regular intervals. But the Swing Timer class is not available on Android. How can I work around this problem ?(I would avoid creating threads and then use the Timer class from java.util package)</p>","164460","","","","","2010-01-05 11:57:55","android timer swing","<android><timer>","2","0","","",""
"2005916","1","2006400","","2010-01-05 12:20:01","1","843","<p>I have an application that draws a lot of graphics and change them.Since I have many graphics, I thought of having the images outside the APK, downloaded from the internet as needed, and saved on the files application folder.</p><p>But I started to get outOfMemory exceptions.</p><p>The question is:  Does android handle memory different if I load a graphic from APK than if I load it from 'disk'?</p><p>code using APK:</p><blockquote>  <blockquote>    <p>topView.setBackgroundResource(R.drawable.bg);</p>  </blockquote></blockquote><p>code if image is outside APK:</p><blockquote>  <blockquote>    <p>Drawable d = Drawable.createFromPath(pathName);    topView.setBackgroundDrawable(d);</p>  </blockquote></blockquote><p>Thanks</p><p>Daniel</p>","237115","","82118","","2010-06-09 16:40:47","2010-06-09 16:40:47","memory of drawables, is it better to have resources inside APK, outside APK or is it the same for memory?","<android><memory><drawable>","2","0","1","",""
"2006056","1","2006185","","2010-01-05 12:47:49","2","1657","<p>I am trying to test performance of an android application using ""android.test.PerformanceTestCase"" interface , can anyone tell me how to make use of it...</p><p>I know i can use Traceview tool to test performance but i want learn to use ""android.test.PerformanceTestCase"" interface provided by android.</p><p>If i get any example code it will be very much helpful</p>","237577","","1069068","","2013-03-19 14:43:23","2013-03-19 14:43:23","Android performance testing using ""android.test.PerformanceTestCase"" interface","<android>","1","0","2","",""
"2006094","1","","","2010-01-05 12:53:34","3","4561","<p>how to play video using opengl es in android?</p>","243914","","44729","","2011-05-26 15:46:14","2012-03-08 09:06:58","play video using opengles, android","<android><opengl-es>","2","0","1","",""
"2006362","1","2006441","","2010-01-05 13:47:58","7","5972","<p>I have to access a web page from within my application and, in order to have access to it, I need to set some custom HTTP headers. I want to use the <code>WebView</code>class in my activity but, as far as I can tell, it's not possible to set custom HTTP headers. </p><p>So is there a way of using the existing web browser (or <code>WebView</code>) with custom HTTP headers? My application targets Android 1.6. </p><p>Any idea how to solve this is greatly appreciated.</p><p>Thanks!</p>","104287","","","","","2011-07-08 03:22:42","Is it possible to set custom HTTP headers in the WebView","<android>","2","0","","",""
"2006457","1","2006541","","2010-01-05 14:04:18","5","6129","<p>I know that Android provides some useful methods to be overridden in order to define a menu:</p><pre><code>    @Override public boolean onCreateOptionsMenu(Menu menu) {  menu.add(0, AIS, 0, ""Activity Inventory Sheet"").setIcon(android.R.drawable.ic_menu_upload);                // ...  return true; } public boolean onOptionsItemSelected(MenuItem item) {  Intent i;     switch (item.getItemId()) {     case AIS: i = new Intent(this, ActivityInventorySheet.class);      startActivity(i);               return true;     // ...     }     return false; }</code></pre><p>I would like to have this menu shared by each Activity and ListActivity of my Android application. This is for having a standard menu in each (List) Activity that lets the user jump to every part of the application within a click.</p><p>Right now, the easiest way to achieve this is to copy-and-paste both methods in every (List)  Activity of the application. I don't like this redundancy of code written :)</p><p>Is sub-classing a reasonable choice? I've already seen that sub-classing one of my ListActivity does not work very well (threads that retrieve objects from a database are giving problems).Are there other ways to share a menu though Activities?</p><p>Thanks</p>","237076","","","","","2011-08-16 11:36:34","Android: How to have a shared menu in each (List) Activity without re-writing the overridden methods?","<android><menu><activity><listactivity>","3","0","2","",""
"2007024","1","2007190","","2010-01-05 15:33:06","9","41766","<p>How can I push my application packageto Android emulator ""/system/app"" folder?</p><p>I've already tried to use:<br>""adb push myApk.apk   /system/app""<br>and it gives me this:  </p><pre><code>""failed to copy: ... No space left on device""</code></pre><p>Although from settings -> sdCard &amp; Phone Storage,I get 37Mb of internal free space.</p><p>The whole point of this need is<br>related to permissions.  </p><p>I need to have INSTALL_PACKAGES permission<br>and I know that by puting my application there,<br>in /system/app, I get that permission.</p>","243376","","","","","2013-12-14 10:10:45","Push my apk to /system/app","<android>","11","0","9","",""
"2007169","1","2007394","","2010-01-05 15:53:30","1","330","<p>I'm interested in inspecting an <a href=""http://developer.android.com/reference/android/content/Intent.html"" rel=""nofollow""><code>Intent</code></a> (namely it's extras) that gets logged like this:</p><pre><code>01-05 13:00:29.192: INFO/ActivityManager(74): Starting activity: Intent { dat=content://media/external/images/media/29 cmp=com.android.camera/.ViewImage (has extras) }</code></pre><p>Is there any standard way to do it?<br>The only option I can think so far is writing a custom <code>IntentFilter</code> to catch it.</p>","15187","","90527","","2010-01-05 15:55:00","2010-01-05 17:45:31","Inspect intents at runtime?","<android>","2","0","2","",""
"2007540","1","2745702","","2010-01-05 16:44:15","17","18142","<p>i found a way to send plain text email using intent:</p><pre><code>final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);emailIntent.setType(""text/plain""); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new     String[]{""example@mail.com""}); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""Subject""); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""Test"");</code></pre><p>But I need to send HTML formatted text.<br>Trying to setType(""text/html"") doesn't work.</p>","238123","","56285","","2014-01-17 22:33:26","2014-01-17 22:33:26","How to send HTML email","<android><email><android-intent><html-email>","4","2","5","",""
"2007679","1","","","2010-01-05 17:03:59","0","1037","<p>At first,I have a database created by using Ruby on rails.I just already implement insert function(HTTPPost) in my Android Application and it's work.But I don't know how to retrieve specific record from my databases and insert it back to specific record in Android (Like edit function in RoR)</p><p>This is my insert code :</p><p>private void insertComment() {        DefaultHttpClient client = new DefaultHttpClient();</p><pre><code>    HttpPost post = new HttpPost(""http://10.10.3.87:3000/comments"");    // Configure the form parameters    List&lt;NameValuePair&gt; nvps = new ArrayList&lt;NameValuePair&gt;();    nvps.add(new BasicNameValuePair(""comment[content]"", t_comment.getText().toString()));    nvps.add(new BasicNameValuePair(""comment[id_account]"", ""1""));    nvps.add(new BasicNameValuePair(""comment[id_place]"", Integer.toString(position)));    try {        post.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));    } catch (UnsupportedEncodingException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    HttpResponse response = null;    try {        response = client.execute(post);    } catch (ClientProtocolException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    HttpEntity entity = response.getEntity();    if (entity != null) {        try {            entity.consumeContent();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }    Toast.makeText(this, ""Your post is successfully uploaded"",            Toast.LENGTH_SHORT).show();    t_comment.setText("""");}</code></pre><p>I really try many ways out but it doesn't work and it takes very long time to fight with this piece of code. Actually, I really don't know how to specify RowID to HTTPPost.</p><p>Can anyone help me please?Thanks in advance</p>","244117","","","","","2010-01-06 04:39:16","Android: How to edit specific record from database in Android Programming (Using Ruby on rails)","<ruby-on-rails><android><records>","2","0","","",""
"2007734","1","2009193","","2010-01-05 17:11:24","5","2382","<p>I want to make an app which (amongst other things) can parse feeds loaded via the network. Given that the standard Anrdoid + Core Java libraries do not provide a feed parser service and I dont want to write a one myself, can you nominate a Java feed parser which will work on a low-spec Android device. </p><p>I'm just starting out learning Android, having completed the Hello World examples I'd like to move onto my first app. I want to make something which prarses some ATOM or RSS feeds and displays some content in a GridView. </p><p>The UI stuff seems to be very well documented in Android, and Sun have plenty of examples of how to retrieve a URL, however I'm not so how to do the feed parsing. </p><p>Previously when I've done this sort of thing in Pythion I use a general purpose feed parser which can parse pretty much anything (e.g. RSS, ATOM). There are plenty of good Python implementations of this sort of thing, however I've not found anything like this as part of the standard Android library.  </p><p>At work I've done (light) maintenance on corporate java apps. The general practice seems to be to take whatever classes you like (e.g. the Jakarta Commons feed-parser) and simply bundle them into the CLASSPATH. Desktop apps do not care how big the dependancies are, however I'm sure that's a big issue when compiling an APK bundle for use on a device with limited meory. Surely I have to be very picky about what kind of Jars I depend on, right? Can I just go ahead and use the same classes that I'd use for desktop apps?</p><p>Notes: </p><ul><li>My background is in Python (with only light Java experience) </li><li>Ideally I'd like to use something popular (not neccecarily the best) so I can get support on it. </li><li>Even better, I'd like to use built in library functionality so I dont have to add any 3rd party Jars to bloat my app.</li><li>Currently targeting Android 1.5 (because that's what my device runs)</li></ul>","46411","","","","","2012-08-08 04:48:24","What is the most widely used feed-parsing library for Android","<java><android>","4","0","0","",""
"2008002","1","2008046","","2010-01-05 17:53:00","0","350","<p>Is there a way to configure how the header of an alert dialog looks?It nows has an icon (on the left) with text as title. Is there a way to add view on the same line?</p><p>Thank you.</p>","128983","","","","","2010-01-05 17:59:36","How can I configure how the header of an alert dialog","<android>","1","0","","",""
"2008122","1","","","2010-01-05 18:17:27","0","1022","<p>I’m new to development, specifically Android. Through tutorials, I’ve managed to display a map with a marker for a building that displays a “toast” box with text identifying that building, when tapped (I fashioned it after the “Noo Yawk” example). I need to display a new full screen with a photo of that building and text describing it, and use the back button to return to the map. I need to do this for at least 30 buildings.</p><p>Do I need to start a new activity for each building? It would seem complicated and resource intensive. If so, where will the photo and text reside? Do I need to have a button in the layout to call the map again? Or is there a simpler way to do this? Given the number of buildings, will content management or a database be required?</p><p>Thanks in advance and forgive my ignorance. I’ve parsed so many articles and tutorials that I’m becoming confused.</p>","244154","","","","","2013-01-16 07:03:04","Android Map Marker-New Screen","<android><maps>","2","0","","",""
"2008528","1","2008676","","2010-01-05 19:28:38","1","1370","<p>I am new to Android, and I haven't developed any app regarding databases on Android yet. So I have a few basic questions.   I am after a good database class sample, that will let me to run the CRUD operations. I would like to use it as a static class  like:</p><pre><code>clsDB-&gt;Select(""select * from clients"");</code></pre><p>or</p><pre><code>objClient-&gt;Delete(clientid);</code></pre><p>I am wondering if someone, can share his database classes, if more people share the best.Also I have in mind to reuse this class in multiple ways, I will have services, activities etc...</p><p>Regards,<br>Pentium10</p>","243782","","179850","","2011-02-16 17:00:44","2013-11-18 16:00:33","static database class to use with any activity","<android><sqlite>","5","0","","",""
"2008558","1","2008863","","2010-01-05 19:32:43","2","3922","<p>How would I display the current date in the text of a EditText widget dynamically at runtime?</p><p>Thankspatrick</p>","244190","","","","","2010-01-05 20:31:22","Displaying a default date in a EditText widget","<android>","1","2","1","",""
"2008668","1","","","2010-01-05 19:56:46","5","1216","<p>My chat application connects to a server and information is sent/received by the user. When the connection changes, such as 3g->wifi, wifi->3g, losing a data connection, etc, the <a href=""http://developer.android.com/reference/java/net/Socket.html"" rel=""nofollow"">socket</a> sometimes stays connected for ages before disconnecting. During this time, it's impossible to tell if the connection is still active, it seems as if messages are being sent just fine. Other times, when sending a message, it will throw an IO error and disconnect.</p><p>Apart from implementing code to detect connection changes and reconnecting appropriately, is it possible to have the socket immediately throw an IO exception when connectivity changes?</p><p>Edit: I'm connecting using the following code:</p><pre><code>Socket sock = new Socket();sock.connect(new InetSocketAddress(getAddress(), getPort())), getTimeout());//get bufferedReader and read until BufferedReader#readLine() returns null</code></pre><p>I'm not using setSoTimeout as data may not be transferred for long periods of time depending on the remote server's configuration.</p>","244202","","244202","","2010-01-05 21:59:41","2014-01-15 15:16:44","Socket not disconnecting when connectivity changes","<java><android><exception><sockets>","3","1","2","",""
"2008735","1","2008757","","2010-01-05 20:09:44","5","5315","<p>Is it possible to run Java applets in the Android WebKit Browser?  If not does anyone know when java applets will be supported?</p>","244204","","203907","","2010-04-09 07:20:49","2010-04-09 07:20:49","Is it possible to run Java applets in the Android WebKit Browser?","<java><android><applet>","1","1","","",""
"2008756","1","2008829","","2010-01-05 20:14:06","6","813","<p>The Nexus android phone went on sale today with 2.1 Os on them.  My friend just ordered two with overnight shipping. I assume that means it will be in his hands tomorrow or the next day.</p><p>How is it even remotely acceptable that people will have 2.1 in their hands before developers even get to touch the SDK?  I already have users using the Nexis-Droid 2.1 rom saying that my highly used widget doesn't work.  How am I supposed to test this out in advance without hacking our phone all up? </p><p>All this does is frustrate users when apps don't work and further degrades the market with 1 stars because developers don't have a chance to update their code. </p><p>Thanks google.... </p>","242904","","23528","","2010-01-05 20:23:26","2010-01-15 21:44:38","Nexus One - Android 2.1 release, WHERE is the SDK for 2.1?","<android>","4","7","2","",""
"2009013","1","","","2010-01-05 20:52:30","3","711","<p>If you long press on your homescreen and pick to add an application shortcut, you will be greeted with a listview showing all of your instal applications.  I needed this same functionality in my application so I copied the intent from the launcher source:</p><pre><code>        Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);        mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);                    Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY);        pickIntent.putExtra(Intent.EXTRA_INTENT, mainIntent);        this.startActivityForResult(pickIntent, MoreIconsConstants.REQUEST_PICK_APPLICATION)</code></pre><p>When this executes on the launcher it is pretty speedy.  When I execute this in my activity it takes maybe 15 seconds instead of 3.  It seems like the launcher must be caching this data for some amount of time?  Is there any way I can cache the data too?</p><p>Thanks!</p>","242904","","","","","2011-12-03 21:24:44","Intent to pick an installed application slow in my activity, why?","<android>","1","3","1","",""
"2009095","1","2009132","","2010-01-05 21:05:59","0","3043","<p>hey!The following code will make the View clickable, but I am wondering if this is the correct approach to make a custom view clickable?</p><p><b>Code:</b></p><pre><code>public class NodePickup extends LinearLayout{ public NodePickup(Context context, AttributeSet attributeSet) {  super(context, attributeSet);  LayoutInflater inflater = (LayoutInflater)     context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        inflater.inflate(R.layout.nodepickup, this);        this.setOnClickListener(new OnClickListener()         {         @Override   public void onClick(View v)   {          AlertDialog.Builder builder = new AlertDialog.Builder(getContext());          builder.setMessage(""Ajabaja!"")          .setCancelable(true)          .setPositiveButton(""JA!"", new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int id)                     {                     dialog.cancel();                    }                });          builder.show();   }  }); }}</code></pre>","178143","","178143","","2010-01-05 21:15:28","2010-01-05 21:54:03","Clickable view / onclick: Correct approach to make View clickable?","<android>","2","3","","",""
"2009121","1","2009850","","2010-01-05 21:10:20","1","5625","<p>I am a newbie Android guy. </p><p>I have a ListView displaying images on every element of the ListView, It works fine... but when I start to scrolling I have realized my image is downloaded again if it is displayed in the screen of my phone device! </p><p>How could I stop reloading the images or all the content of the in ListView again?Or how could I avoid reading the getView() function again If I have already downloaded all its content?</p>","","Alexi","17651","","2010-01-06 02:09:42","2010-01-06 02:09:42","Android, how to stop reading getView() function again, if the content is already downloaded in the ListView","<android><listview>","3","1","4","",""
"2009456","1","","","2010-01-05 22:05:03","1","1584","<p>Samsung Galaxy, Android 1.5.I'm trying to detect when the user releases the camera button. I have a receiver that gets the ACTION_CAMERA_BUTTON intent and examines the EXTRA_KEY_EVENT that comes with it,using the following code (in the onReceive() in the receiver)</p><pre><code>@Overridepublic void onReceive(Context context, Intent intent) {    String intent_action = intent.getAction();      if (intent_action.equals(Intent.ACTION_CAMERA_BUTTON) ) {                abortBroadcast();                KeyEvent key = (KeyEvent) intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);            if ( key.getAction() == KeyEvent.ACTION_DOWN )                Toast.makeText(context, ""press"", Toast.LENGTH_SHORT).show();            else if ( key.getAction() == KeyEvent.ACTION_UP )                Toast.makeText(context, ""release"", Toast.LENGTH_SHORT).show();            else if ( key.getAction() == KeyEvent.ACTION_MULTIPLE )                Toast.makeText(context, ""multi"", Toast.LENGTH_SHORT).show();    }}</code></pre><p>When I press the button, I only get the ""press"" popup. </p><p>Is this a limitation in the phone or in Android? Is there another way to detect the release of the camera key?</p>","189815","","","","","2010-01-05 22:05:03","Broadcast receiver for ACTION_UP of the camera button in android","<android><camera><broadcastreceiver>","0","0","","",""
"2009477","1","2009668","","2010-01-05 22:10:07","3","5397","<p>Hey,I have, for the time being, a custom view with a 9-patch image as a border.</p><p>That custom view is placed three times in a LinearLayout, so it looks like this:</p><pre><code>+------------------------+|  CustomView            |+------------------------+|  CustomView            |+------------------------+|  CustomView            |+------------------------+</code></pre><p>I have attached a click event listener to the View, so it is clickable. But then I click it, I cant see that I am clicking it - there is no change in color.</p><p>So, Im thought that I'd attach a ""onPress"" listener, and then change the background of the view but I couldnt find such a listener.</p><p>So, the question is - how do I create the behaviour on the View so I can see that it is being pressed? this is normally done in Android with a green background to indicate that it is now being pressed.</p><p>Regards</p>","178143","","","","","2012-02-12 18:16:06","view on press onpress: Change background color on press? How do I show that the View is being pressed?","<android>","1","0","2","",""
"2009698","1","","","2010-01-05 22:42:15","1","648","<p>I have a location with latitude and longitude and want to get a new location that has a distance of x meters from that location at an angle of d degrees. This would be the reverse of Location.distanceBetween(). Is there any Android API to do that. I know that I could program such a function myself, but I wonder if there is an API for it already.</p>","67350","","234938","","2010-01-06 00:06:41","2010-01-06 00:06:41","Reverse Location.distanceBetween()","<android><geospatial>","3","3","1","",""
"2009707","1","2011532","","2010-01-05 22:43:33","4","3426","<p>I have tried to create a android application that sends a serialzed object from the phone to a servlet the contents of the object is the input from the user which i will store in a database using hibernate. I believe the problem is around the serializing and deserializing of the object the code is below. If anyone could help i would very greatful.</p><p>p.s the class User implements the serializable interface</p><p>client</p><pre><code>    public class Adduser extends Activity implements OnClickListener { EditText uname; EditText password; EditText rating; EditText date; Button add; User user;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        uname = (EditText) findViewById(R.id.Usernamei);        password = (EditText) findViewById(R.id.passwordi);        rating = (EditText) findViewById(R.id.ratingi);        date = (EditText) findViewById(R.id.datei);        add = (Button) findViewById(R.id.Adduser);        user = new User();        add.setOnClickListener(this);    } @Override public void onClick(View v) {  user.setusername(uname.getText().toString());        user.setpassword(password.getText().toString());        user.setdate(date.getText().toString());        user.setrating(rating.getText().toString());  HttpClient httpClient = new DefaultHttpClient();  ObjectOutput out;  try{    String url = ""MY URL goes here"";    HttpPost post = new HttpPost(url);    //Serialisation of object    ByteArrayOutputStream bos = new ByteArrayOutputStream() ;       out = new ObjectOutputStream(bos) ;       out.writeObject(user);       //puts bytes into object which is the body of the http request       post.setHeader(new BasicHeader(""Content-Length"", """" + bos.toByteArray().length));       ByteArrayEntity barr = new ByteArrayEntity(bos.toByteArray());        //sets the body of the request        post.setEntity(barr);       out.close();       //executes request and returns a response       HttpResponse response = httpClient.execute(post);   } catch (IOException e) {        Log.e( ""ouch"", ""!!! IOException "" + e.getMessage() );     }  uname.setText(String.valueOf(""""));  password.setText(String.valueOf(""""));  rating.setText(String.valueOf(""""));  date.setText(String.valueOf("""")); }}Server side    public class Adduser extends HttpServlet { //logger for properties file //private static Logger logger = Logger.getLogger(Adduser.class); public void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException {  //test  //logger.warn(""this is a sample log message."");  String usern = null;  String password = null;  String rating = null;  String date = null;  InputStream in;  try {   //gets http content body byte array should be on the stream   in = request.getInputStream();   //int bytesToRead;   //bytesToRead =  Integer.parseInt(request.getHeader(""Content-Length""));   //reads inputream contents into bytearray   int bytesRead=0;   int bytesToRead=1024;   byte[] input = new byte[bytesToRead];   while (bytesRead &lt; bytesToRead) {     int result = in.read(input, bytesRead, bytesToRead - bytesRead);     if (result == -1) break;     bytesRead += result;   }   //passes byte array is passed into objectinput stream    ObjectInputStream inn = new ObjectInputStream(new ByteArrayInputStream(input));   User users = null;   try {    //object is read into user object and cast    users = (User)inn.readObject();   } catch (ClassNotFoundException e1) {    // TODO Auto-generated catch block    System.out.println(e1.getMessage());   }   in.close();   inn.close();   //contents of object is put into variables to be passed into database   usern = users.getusername();   password = users.getpassword();   rating = users.getrating();   date = users.getdate();  } catch (IOException e2) {   // TODO Auto-generated catch block   System.out.println(e2.getMessage());  }  Session session = null;  try{   SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();    session = sessionFactory.openSession();          //Create new instance of Contact and set    Transaction tx = session.beginTransaction();      Userr user = new Userr();      user.setusername(usern);      user.setpassword(password);      user.setrating(rating);      user.setdate(date);      session.save(user);      tx.commit();  }catch(Exception e){        System.out.println(e.getMessage());      }finally{        // Actual contact insertion will happen at this step        session.flush();        session.close();        } } }</code></pre>","244305","","133802","","2010-01-05 22:44:54","2010-01-08 12:22:51","Sending a serialized object from Android to a servlet using HTTP client","<java><android><serialization><httpclient>","3","0","1","",""
"2009710","1","","","2010-01-05 22:44:01","1","4605","<p>Im trying to figure out how to line up items in each row of a table (TableLayout) - ideally I want the center of each cell to line up horizontally. The documentation isn't very clear on what's possible with TableLayout. Each cell has a different view widget so I thought a tabular layout would work well but they are all different sizes and default to top-left alignment inside each cell.</p><p>If I can't line them up then Ill need to use a different layout manager</p>","244320","","","","","2010-11-10 22:51:11","Alignment of items in row when using TableLayout","<android><layout><tablelayout>","2","0","2","",""
"2009943","1","2010221","","2010-01-05 23:29:24","0","1235","<p>HI,</p><p>I am able to get the contact cursor using the following:</p><pre><code>Cursor cursor = context.getContentResolver().query(People.CONTENT_URI,                new String[] {People._ID, People.PRIMARY_EMAIL_ID},                selection, null, null);</code></pre><p>And then I try to get the actual email address using:</p><pre><code> String emailID = cursor.getString(PEOPLE_PRIMARY_EMAIL_ID_INDEX); if (Integer.parseInt(emailID) != -1) {      Cursor cursor2 = context.getContentResolver().query(Uri.withAppendedPath(ContactMethods.CONTENT_URI, emailID), new String[] {ContactMethods.DATA}, null, null, null);  // cursor2 count is always 0}}</code></pre><p>Anyone has any idea?</p>","128983","","23199","","2010-01-05 23:30:54","2010-01-06 00:37:11","How can I get primary email address of a contact","<android>","1","1","1","",""
"2009970","1","","","2010-01-05 23:35:30","1","1411","<p>When creating a stateful drawable, I cannot find the other drawables (9-patch images) that are there - i get no ""suggestions"" (""intelliSense"").</p><p>But if I try to find drawables in another XML-file there is no problem.</p><p>this is my stateful drawable</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item    android:state_focused=""true""    android:state_pressed=""true""    android:drawable=""@drawable/view_background_pressed"" /&gt;&lt;item    android:state_focused=""true""    android:state_pressed=""false""    android:drawable=""@drawable/view_background_normal"" /&gt;&lt;item    android:state_focused=""false""    android:state_pressed=""true""    android:drawable=""@drawable/view_background_pressed"" /&gt;&lt;item    android:drawable=""@drawable/view_background_normal"" /&gt;&lt;/selector&gt;</code></pre><p>the ""view_background_pressed"" etc are all there, and they can be found in other XML-files but not in the statefule drawable.</p><p>Any ideas?</p>","178143","","","","","2013-08-29 08:28:15","stateful drawable not finding other drawables","<android>","2","0","","",""
"2010399","1","2011399","","2010-01-06 01:26:02","10","19959","<p>Which are the default dimension of the Home wallpaper/background for the various Android screen configurations (small, normal and large screens with low, medium and high density)?</p><p>Are 9-patch PNG files supported for the wallpaper? Should I be using these instead?</p><p>I found a method in API level 5 that gives you the minimum size of the wallpaper, but I would like to support previous versions of Android as well.</p><p>Thanks!</p>","143378","","143378","","2010-01-06 01:33:38","2010-08-03 18:50:33","Android wallpaper/background dimensions","<android><background><wallpaper>","2","0","9","",""
"2010440","1","2010449","","2010-01-06 01:37:07","3","1938","<p>Is it just Java?</p>","151438","","23528","","2010-01-06 02:41:22","2010-01-06 05:46:54","What Programming Language is Google's Nexus One Using?","<android><nexus-one>","5","4","3","2012-07-26 12:56:41",""
"2010547","1","2011337","","2010-01-06 02:06:42","0","535","<p>I am developing an application that needs to retrieve some data from a web server. But I have no idea how can this be possible?</p>","241969","","1777090","","2013-01-07 09:02:21","2013-01-07 09:02:21","Retrieve data from a web server for android application","<android><webserver>","1","4","","",""
"2010620","1","","","2010-01-06 02:33:53","1","28087","<p>When I try to install the android SDK it fails to install.</p><p>My OS is Windows XPI just downloaded and installed Java JDK 1.6<br>Java -version from the command line returns:<a href=""http://stackoverflow.com/questions/ask"">http://stackoverflow.com/questions/ask</a>java version ""1.6.0_17""Java(TM) SE Runtime Environment (build 1.6.0_17-b04)Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)</p><p>My environment vars have:JAVA_HOME=c:\progra~1\java\jdk1.6.0_11</p><p>I downloaded android-sdk-r04-windows.zip</p><p>I unziped it in V:\AndroidInstall\</p><p>When I go to the </p><p>V:\androindinstall\android-sdk-windows>and type ""SDK Install.exe""  nothing happens...If I go this from graph</p><p>When I do this from a graphical file viewer I get a quick flash that looks like a command line window and nothing....</p><p>When I try to run android list targets</p><p>from the tool directory I get:</p><p>Error: Error parsing the sdk.Error: V:\androindinstall\android-sdk-windows\platforms is missing.Error: Unable to parse SDK content.</p><p>So the basic install setup is not happening.</p><p>Additional clues:</p><p>I have a G1 and Android 1.0 was running on this machine. (Almost a year ago)</p><p>I've updated my G1 to 1.6 so I thought I'd update my SDK before starting new development.</p><p>When I tried to upgrade it tried and then died as the ""directory was in use"" So I cleaned out all the android directories, rebooted and redownloaded everythign from scratch.Now it won't run at all.</p><p>I've clearly got something in an unhappy state, but I've cleaned up all the directories and no remanants seem to be running I've rebooted....</p><p>I've missed somethign I just can't figure out what.</p><p>Paul</p>","244408","","","","","2013-11-02 13:54:19","Android SDK fails to install","<android><sdk>","5","2","1","",""
"2010662","1","2010670","","2010-01-06 02:50:20","0","327","<p>So, I have a simple ListView and on that ListView I have placed a number of custom defined Views. The CustomView has ImageView and two TextViews.</p><p>The CustomView also has a ""stateful drawable"" as background, so that the background image (a 9-patch) changes if you press the Row in the ListView. When pressing the Row, the background image changes to a Red-ish thing. </p><p><b>The problem</b> is that when the background changes from the default greyish, all the Views in the CustomView (ImageView and TextViews) still have their greyish background and thus creates very ugly greay boxes on top of the now redish background.</p><p>What is the best way to solve that problem? I hoped that such things were handled automatically (as it is done in for example .NET), but I was wrong it seems.</p><p>Any ideas is appreciated =)</p>","178143","","","","","2010-01-06 02:57:53","Views and their child views: how to avoid the ugly ""boxes"" when child views in a View has another color than the background (stateful drawables for example)","<android>","1","0","1","",""
"2010701","1","2011360","","2010-01-06 03:06:39","1","7635","<p>I cant seem to open a new view from an options menu item. The program keeps crashing as it applies the intent and listener to the item. I am just beginning, so please be nice.</p><p>The current view is mnfsms, and the view I am trying to open is mnfsms_settings. I am developing for 1.5.</p><p>Could someone please help me get the menu working.</p><p>The menu (called options_menu.xml):</p><pre><code>&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:id=""@+id/settings_button""          android:title=""Settings""          android:icon=""@android:drawable/ic_menu_preferences"" /&gt;    &lt;item android:id=""@+id/about_button""          android:title=""About""          android:icon=""@android:drawable/ic_menu_myplaces"" /&gt;&lt;/menu&gt;</code></pre><p>The main view (called mnfsms.java):</p><pre><code>package com.example.mnfsms;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;public class mnfsms extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    /*        OnClickListener myocl = new View.OnClickListener() { public void onClick(View v){  Intent myi = new Intent(mnfsms.this, mnfsms_settings.class);  startActivity(myi); }};*/    }public boolean onCreateOptionsMenu(Menu menu) {    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.options_menu, menu);    MenuItem mi_settings = (MenuItem)findViewById(R.id.settings_button);    mi_settings.setIntent(new Intent(this, mnfsms_settings.class));    return true;}}</code></pre><p>The manifest:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""          package=""com.example.mnfsms""          android:versionCode=""1""          android:versionName=""1.0""&gt;        &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;            &lt;activity android:name="".mnfsms"" android:label=""@string/main_window_name""&gt;                &lt;intent-filter&gt;                    &lt;action android:name=""android.intent.action.MAIN"" /&gt;                    &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;                &lt;/intent-filter&gt;            &lt;/activity&gt;      &lt;activity android:name="".mnfsms_settings"" android:label=""string/main_window_name""&gt;            &lt;/activity&gt;        &lt;/application&gt;        &lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;/manifest&gt;</code></pre><p>The stacktrace:</p><pre><code>01-06 15:07:58.045: ERROR/AndroidRuntime(2123): Uncaught handler: thread main exiting due to uncaught exception01-06 15:07:58.055: ERROR/AndroidRuntime(2123): java.lang.NullPointerException01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at com.example.mnfsms.mnfsms.onCreateOptionsMenu(mnfsms.java:30)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at android.app.Activity.onCreatePanelMenu(Activity.java:2038)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:421)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at com.android.internal.policy.impl.PhoneWindow.onKeyDownPanel(PhoneWindow.java:664)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at com.android.internal.policy.impl.PhoneWindow.onKeyDown(PhoneWindow.java:1278)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1735)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2188)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2158)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1490)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at android.os.Handler.dispatchMessage(Handler.java:99)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at android.os.Looper.loop(Looper.java:123)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at android.app.ActivityThread.main(ActivityThread.java:3948)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at java.lang.reflect.Method.invokeNative(Native Method)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at java.lang.reflect.Method.invoke(Method.java:521)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)01-06 15:07:58.055: ERROR/AndroidRuntime(2123):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","244418","","93306","","2010-01-06 07:03:19","2012-04-30 04:24:41","How to open new view (call an activity) from options menu defined in XML? (android)","<android><activity>","3","3","","",""
"2010800","1","","","2010-01-06 03:35:46","2","1095","<p>I have a media recorder, and want to record a media from mic and getit's amplitude sample.I want to try to get the correct and current amplitude instantaneouslywhen calling some API.But there is just one API in MediaRecorde for getting amplitude:getMaxAmplitude, and it is used to get the maximum absolute amplitudemeasured since the last call.Is that possible to get the current sample amplitude instantaneouslyby MediaRecorder or other class from mic?</p><p>Thanks,Best regards,Chen</p>","244430","","","","","2010-01-08 02:45:34","Is that possible to get the current sample amplitude by MediaRecorder or other class","<android><audio-recording>","1","0","","",""
"2011403","1","2062144","","2010-01-06 07:01:55","12","11204","<p>I have some Android market feedback for my app <code>Hire*A*Droid</code> where users complain that they are unable to uninstall the application. Here's two I have so far (about 10 days apart): </p><pre><code>janelle: I uninstalled this app, but its still showing that its          installed under my downloads. What can i do ?valerie: It's frozen I can't open or delete it.          anyone can help n tell me how..thanks</code></pre><p>The app has nothing really special or tricky about it and I never experienced anything of the sort so I'm really lost at what this may be, how real it is and how to reproduce and deal with it? Any ideas, suggestions? If you have any questions that you think may help with this problem I'll be happy to provide more details</p><p>P.S. Worth nothing to mention - both complaints cost me a single star rating and no additional info was provided</p><p>P.P.S. After comment from PHP Jedi I noticed similar comments for other apps while browsing Android Market. I think this is quite common and it looks like Market bug. I will try to open a bug on Android Market support site</p><p><a href=""http://www.google.com/support/forum/p/Android+Market/thread?tid=026b76b7c8f3d90a&amp;hl=en"">Cross-referenced</a> to Android Market forum</p>","135946","","135946","","2010-01-08 18:24:04","2012-03-29 17:08:24","Android - unable to uninstall application","<android><uninstall>","3","4","1","",""
"2011432","1","2058660","","2010-01-06 07:14:26","2","14640","<p>Am really wondering how to set a proxy server in android phone like [tattoo] in order to gain access in some private networks </p><p>any suggestion would be appreciated ...</p><p>thanks </p>","109217","","","","","2012-09-12 15:57:04","How do I set a proxy in Android phones?","<android>","5","0","7","",""
"2011510","1","","","2010-01-06 07:35:04","0","10424","<p>I need to stream videos from an URL and then i want to save the video to SDcard. </p>","244540","","646382","","2011-08-24 15:42:00","2011-08-24 15:42:00","How to save streaming videos in Android by saving to SDcard?","<android><android-sdcard>","2","0","2","",""
"2011543","1","3720676","","2010-01-06 07:45:15","5","3138","<p>I'm writing an android application that collects cell signal strengths.  I am having trouble getting the ""current"" cell signal strength, but I don't have any problem getting the ""neighboring"" cell signal strengths.</p><p>To get the current cell signal strength, I created a PhoneStateListener and implemented the onSignalStrengthChanged callback.  It works, but not very well.  It seems like the signal strength hardly ever changes, and resolution jumps to only a few numbers.  I would accept the answer that the resolution of the signal strength hardware is coarse, but when I use the TelephonyManager's getNeighboringCellInfo() method, it works much better.  The signal strength readings from neighboring cells change frequently, and they have much better resolution.</p><p>So, how can I get the current cell signal strength in the same way that I am getting the neighboring cell strengths?  It seems odd to me that the functionality of the neighboring cells is better than the current cell.  Am I missing something here?</p><p>I would also like to directly call a method from the telephony manager to get current cell strength, as opposed to a listener, if possible.  If anyone knows how, please let me know.  Thanks.</p>","234933","","","","","2013-06-13 23:14:25","Android: Why are methods for getting neighboring cell signal strengths better than those for current cell signal strength?","<android><rssi>","2","0","0","",""
"2012002","1","2027545","","2010-01-06 09:39:10","0","8984","<p>A strange problem has cropped up... I checked several websites but couldn't find anything wrong with the code... But it returns <code>NullPointerException</code>...</p><pre><code>try {     SAXParserFactory f = SAXParserFactory.newInstance();    SAXParser parser = f.newSAXParser();    XMLReader reader = parser.getXMLReader();    reader.setContentHandler(handler);    System.out.println(uri_this);    reader.parse(new InputSource(url_this.openStream())); // i get nullpointerexception here } catch (NullPointerException e) {    System.out.println(e);}</code></pre><p>In the catch statement I have caught <code>NullPointerException</code> and made it print the error.</p><p>The <code>ContentHandler</code> is fine because I have got parsed files for small files but for larger files, it doesn't seem to work. What is the problem? Or do I need some buffering for larger files? I'm clueless and have tried all possibilities except buffering because I don't know the coding for that.</p><p>I figured out 1 thing: the object of the input source is freed before the <code>reader.parse</code> can finish. I don't understand why it's happening.</p><p>The <code>LogCat</code> gives the following (only the erroneous part):</p><pre><code>01-06 15:12:27.145: INFO/System.out(319): http://mywebsite.com/products_xml.php?cPath=4301-06 15:12:31.094: DEBUG/dalvikvm(319): GC freed 4031 objects / 203424 bytes in 189ms01-06 15:12:31.505: DEBUG/dalvikvm(100): GC freed 3326 objects / 190192 bytes in 283ms01-06 15:12:34.274: DEBUG/dalvikvm(319): GC freed 1153 objects / 80432 bytes in 146ms01-06 15:12:34.646: INFO/System.out(319): java.lang.NullPointerException</code></pre><p>I'm getting the url ""url_this"" 4m the constructor as arguments.</p>","238071","","1578604","","2013-05-31 10:49:27","2013-05-31 10:49:27","Android XML parsing","<xml><android><parsing><nullpointerexception>","5","6","","",""
"2012113","1","2012443","","2010-01-06 10:04:43","3","3133","<p>I would like to show a custom input field (specifically, one containing only 9-0 and two extra buttons containing decimal separator (, or .) and a delete button).</p><p>I could create a custom IME, but (as far as I know) that would have to be set by the user as the system-wide input method. Is there a way to implement an input method and bind it to a specific input field?</p><p>Thanks for the help!</p>","235910","","49246","","2010-11-13 10:13:43","2011-01-14 18:21:00","Input Field With Custom Input Method","<android><android-input-method>","2","0","2","",""
"2012127","1","","","2010-01-06 10:08:34","1","2567","<p>I am following the book ""Professional Android Application Development"" and trying to implement some examples. In chapter 5 page 151, the following code throws a <code>SAXParseException</code>. Does anyone know why?</p><pre><code>Document dom = db.parse(in);</code></pre><p>I tried other XML files, same exception was thrown.</p><hr><p>Stack trace is like:</p><blockquote>  <p>01-07 00:23:58.875: WARN/System.err(221): org.xml.sax.SAXParseException: expected: /meta read: head (position:END_TAG @1:87 in java.io.InputStreamReader@43d0c720)   01-07 00:23:58.895: WARN/System.err(221):     at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:151)  01-07 00:23:58.906: WARN/System.err(221):     at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:157)  01-07 00:23:58.915: WARN/System.err(221):     at com.paad.earthquake.Earthquake.refreshEarthquakes(Earthquake.java:82)  01-07 00:23:58.925: WARN/System.err(221):     at com.paad.earthquake.Earthquake.onCreate(Earthquake.java:60)  01-07 00:23:58.936: WARN/System.err(221):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)  01-07 00:23:58.936: WARN/System.err(221):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2444)  01-07 00:23:58.946: WARN/System.err(221):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2497)  01-07 00:23:58.955: WARN/System.err(221):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)  01-07 00:23:58.966: WARN/System.err(221):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1848)  01-07 00:23:58.976: WARN/System.err(221):     at android.os.Handler.dispatchMessage(Handler.java:99)  01-07 00:23:58.987: WARN/System.err(221):     at android.os.Looper.loop(Looper.java:123)  01-07 00:23:58.996: WARN/System.err(221):     at android.app.ActivityThread.main(ActivityThread.java:4338)  01-07 00:23:58.996: WARN/System.err(221):     at java.lang.reflect.Method.invokeNative(Native Method)  01-07 00:23:59.026: WARN/System.err(221):     at java.lang.reflect.Method.invoke(Method.java:521)  01-07 00:23:59.040: WARN/System.err(221):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)  01-07 00:23:59.046: WARN/System.err(221):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)  01-07 00:23:59.056: WARN/System.err(221):     at dalvik.system.NativeStart.main(Native Method)</p></blockquote>","244604","","1288","","2012-04-12 17:52:56","2014-02-12 14:28:22","SAXParseException in android","<xml><android>","1","1","","",""
"2012332","1","2012407","","2010-01-06 10:51:51","0","930","<p>I have done my application in portrait configuration. When I load my application in device its coming portraint configuration. But in landscape mode i keep missing some controls. How can I  fix the screen for both configurations?</p>","217065","","1777090","","2013-01-07 08:55:59","2013-01-07 08:55:59","How to fit the application for both config like portrait,landscape in android?","<android><landscape-portrait>","3","0","","",""
"2012497","1","3904473","","2010-01-06 11:20:21","72","110260","<p>I'm trying to make Https connections on the Android phones, using HttpClient. Trouble is that since the certificate isn't signed I keep getting ""javax.net.ssl.SSLException: Not trusted server certificate"".</p><p>Now I've seen a bunch of solutions where you simply accept all certificates, but what if I want to ask the user? I want to get a dialog similar to that of the browser, letting the user decide to continue or not.</p><p>Preferably I'd like to use the same certificatestore as the browser. Any ideas?</p>","169544","","213269","","2011-05-14 15:40:34","2013-09-09 07:06:34","Accepting a certificate for HTTPs on Android","<android><ssl><https><httpclient>","5","0","82","",""
"2012532","1","","","2010-01-06 11:27:25","0","912","<p>I am trying to make screen with Google Map. </p><p>This screen has 2 parts. First part includes Button TextView and ListView and places on the top of Screen. Second part includes MapView (Google map) and places on the bottom of Screen. </p><p>How to make it ?</p><p>I've done it. But no luck. It throws this exception :</p><pre><code>01-07 11:53:12.813: ERROR/AndroidRuntime(725): Uncaught handler: thread main exiting due to uncaught exception01-07 11:53:12.833: ERROR/AndroidRuntime(725): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mypackagename.uk/com.mypackagename.uk.MyCustomActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class java.lang.reflect.Constructor01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.os.Handler.dispatchMessage(Handler.java:99)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.os.Looper.loop(Looper.java:123)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.app.ActivityThread.main(ActivityThread.java:3948)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at java.lang.reflect.Method.invokeNative(Native Method)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at java.lang.reflect.Method.invoke(Method.java:521)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at dalvik.system.NativeStart.main(Native Method)01-07 11:53:12.833: ERROR/AndroidRuntime(725): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class java.lang.reflect.Constructor01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.view.LayoutInflater.createView(LayoutInflater.java:512)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:564)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.view.LayoutInflater.parseInclude(LayoutInflater.java:701)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:613)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:309)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.app.Activity.setContentView(Activity.java:1626)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at com.mypackagename.uk.MyCustomActivity.onCreate(*MyCustomActivity.java:457*)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     ... 11 more01-07 11:53:12.833: ERROR/AndroidRuntime(725): Caused by: java.lang.reflect.InvocationTargetException01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:237)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at java.lang.reflect.Constructor.constructNative(Native Method)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at android.view.LayoutInflater.createView(LayoutInflater.java:499)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     ... 23 more01-07 11:53:12.833: ERROR/AndroidRuntime(725): Caused by: java.lang.IllegalStateException: You are only allowed to have a single MapView in a MapActivity01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at com.google.android.maps.MapActivity.setupMapView(MapActivity.java:180)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:279)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:254)01-07 11:53:12.833: ERROR/AndroidRuntime(725):     ... 27 more</code></pre><p>I've the line of code that throws exception: MyCustomActivity.java:457</p><p>This line is: setContentView(R.layout.my_layout);</p><p>My XML is : </p><pre><code>&lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:layout_gravity=""top|center_vertical""&gt;&lt;com.mypackagename.uk.MyLayout&lt;TableLayout android:layout_width=""fill_parent""     android:layout_height=""wrap_content""&gt;    &lt;TableRow android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:id=""@+id/my_row1""&gt;        &lt;TableLayout android:layout_width=""fill_parent""             android:layout_height=""wrap_content"" android:layout_weight=""1""&gt;                 &lt;TableRow android:layout_marginTop=""5dip"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;                &lt;TextView android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;                &lt;ImageView android:layout_width=""wrap_content""&gt;&lt;/ImageView&gt;                &lt;TextView android:layout_width=""wrap_content""&gt;&lt;/TextView&gt;                &lt;TextView android:layout_height=""wrap_content"" android:layout_width=""15px""&gt;&lt;/TextView&gt;                &lt;ImageView android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;            &lt;/TableRow&gt;        &lt;/TableLayout&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;com.google.android.maps.MapView    android:id=""@+id/map_view_on_yardage""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:enabled=""true""    android:clickable=""true""    android:apiKey=""my-api-code""&gt;&lt;/com.google.android.maps.MapView&gt;&lt;/com.mypackagename.uk.MyLayout&gt;</code></pre><p></p>","227889","","1382141","","2013-05-07 17:25:36","2013-11-19 09:55:52","How to make 2 parted screen with MapView?","<android><google-maps>","1","3","","",""
"2012771","1","2012826","","2010-01-06 12:09:55","0","1060","<p>Is there a cross device hard button in android that a background service can listen to and act when it is pressed/released?</p><p>Thanks</p>","189815","","168868","","2011-04-29 21:06:43","2011-04-29 21:06:43","Broadcast receiver that listens to hard button in android","<android><button><broadcastreceiver>","1","0","","",""
"2012870","1","2013056","","2010-01-06 12:31:24","4","16081","<p>After launching listener by the following code is working fine.</p><pre><code>LocationManager locationManager =(LocationManager) getSystemService(Context.LOCATION_SERVICE);locationManager.requestLocationUpdates(                    LocationManager.GPS_PROVIDER, WLConstants.DELAY_HOUR, gpsl                            .getMinDistance(), gpsl);</code></pre><p>After some time i stop the listener by the following code</p><pre><code>locationManager.removeUpdates(this);</code></pre><p>but problem is it still searching my gps any solution ??? how to stop gps ?</p>","216431","","","","","2012-12-03 16:59:36","android how to stop gps","<android><gps>","4","1","1","",""
"2013201","1","","","2010-01-06 13:29:50","5","14806","<p>Is it possible out of the box or via a library?</p>","221204","","436641","","2011-09-18 04:31:42","2013-04-07 05:27:46","Is there a way to play .flv video files in android app?","<android>","3","1","4","2013-04-07 08:01:49",""
"2013433","1","2013470","","2010-01-06 14:08:31","3","450","<p>Since I am new to Android, I am now thinking on what is the correct way of doing things.</p><p>As it stands, the application Im writing has 4 different screens:</p><ul><li>Screen 1 - list of nodes (main screen)</li><li>Screen 2 - options menu, tableLayout with buttons</li><li>Screen 3 - navigation</li><li>Screen 4 - text details on version etc</li></ul><p>These screens can be navigated to/from using a ""header"" View that is placed on top. The header then has 4 different buttons:</p><pre><code>+--------------------+| menu with buttons  |+--------------------+|                    ||                    ||                    ||  C O N T E N T     ||                    ||                    ||                    |+--------------------+</code></pre><p><b>main.xml</b> is really just a LinearLayout that INCLUDES the header.xml and then the content, in that case the list of nodes in a ListView</p><p><b>options.xml</b> is the same thing almost, it includes the headerxml and then a bunch of buttons...</p><p>...and so on with the two other screens.</p><p>So, when I press one of the buttons in the header/menu on top the content should be switched to that screen. <b>My question is:</b></p><ul><li><p>Should I create one Activity for each screen? I read on Google that:<br><i>An activity presents a visual user interface for one focused endeavor the user can undertake.</i><br>So that can be interpretet that I shoukd use one Activity for each of these screens.</p></li><li><p>Should I <b>not</b> create more Activities than the startup, and then just run the <i>setContentView(R.layout.whatever)</i> when I want to change the ""content"" above?</p></li></ul><p>Regards</p>","178143","","1777090","","2013-01-07 08:46:51","2013-01-07 08:46:51","What's the right choice? Create new Activities or just create a different Layout and replace the existing layout?","<android>","3","1","1","",""
"2013443","1","15046761","","2010-01-06 14:11:30","26","17350","<p>We're building an application which is using the google maps api for android.</p><p>I have my MapController and MapView, and I enable the built-in zoom controls using:</p><pre><code>mapView.setBuiltInZoomControls(true);</code></pre><p>I would now like to get an event when the user actually zooms on the map, how do I go about that? I can find no such event or any general event where I could detect a change in zoom level.</p><p><strong>Update</strong></p><p><a href=""http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapView.html#getZoomControls%28%29"">The mapView.getZoomControls() is deprecated</a>. And the documentation suggests using mapView.setBuiltInZoomControls(bool) instead. This is okay, but I simply cannot figure out how to act on events from the built in zoom controls.</p>","81398","","81398","","2010-01-06 15:01:15","2014-02-07 04:15:25","On zoom event for google maps on android","<java><android><events><google-maps><zoom>","11","2","11","",""
"2013549","1","2013800","","2010-01-06 14:30:06","6","6395","<p>we have a problem related to the manifest file and the property ""android:minSdkVersion"".   The issue is: If our platform is 2.0 and we use the property ""android:minSdkVersion=3"" (3 = sdk 1.5) the graphics get corrupted (In details, the application's resolution get reduced to a 2/3 part of the original size, this is, when the resolution should be 480x720, it becomes in a 320x480). This is happening on the Android emulator, and on the devices Droid/Milestone (Which are platforms 2.0). When we switch the property to ""android:minSdkVersion=4"" (4 = sdk 1.6) the problem gets solved, but when we want to put that version on platform 1.5, Android doesn't allow us to install it.  It would help us to know any conflict regarding graphics within the 2.0 sdk, or any known problem around the ""android:minSdkVersion"" in the manifest.</p><p>Thanks!</p>","244218","","234938","","2010-01-06 14:46:15","2012-10-27 19:25:32","Problems wih minSdkVersion 1.5","<android><layout><resources><dpi>","3","0","5","",""
"2013763","1","2013824","","2010-01-06 15:00:10","0","1248","<p>I am trying to populate the text of a second EditText widget with the text from the first EditText widget only when the second EditText widget receives focus, the second widget is not empty, and the first widget is not empty. </p><p>I have the following OnFocusChangeListener handler code.</p><pre><code>        public void onFocusChange(View v, boolean hasFocus) {        EditText stxt = (EditText) findViewById(R.id.numberone);        EditText etxt = (EditText) findViewById(R.id.numbertwo);        if (hasFocus &amp;&amp; stxt.getText().toString().trim() != """" &amp;&amp; etxt.getText ().toString().trim() == """")        {            etxt.setText(stxt.getText().toString().trim());        }    }</code></pre><p>When I run it and click into the second widget it does not populate. When I remove the third constraint ('etxt.getText ().toString().trim() == """"')) it works. so getText() on the second EditText widget is returning something even though the second widget has no initial value other then the text that is displayed via the hint attribute. </p><p>How can I accomplish this.</p><p>Thanks</p>","244190","","","","","2010-07-02 08:39:21","Populate EditText widget text from another EditText widget text","<android><edittext>","2","0","","",""
"2013841","1","2031919","","2010-01-06 15:10:33","3","384","<p>I created this little Geolocation experiment site <a href=""http://www.bctx.info/wx"" rel=""nofollow"">http://www.bctx.info/wx</a>it works great on my Android 1.6 (Magic, I/O Phone) it prompts theuser to share, returns lat, log and is snappy. 1.6 uses Gears forthis. I tried it on an up to date Droid and a 2.0 emulator image andit detects the ""navigator.geolocation"" element (excellent!) and waitsfor the user to share but no popup appears on the device and it cannotproceed. Any thoughts?</p>","244806","","","","","2010-01-09 01:16:48","Geolocation in Browser works in 1.6 (Gears) but not 2.0 (HTML5/W3C) - Tested in emulator and real devices","<javascript><android><geolocation><w3c>","1","0","","",""
"2013865","1","2013909","","2010-01-06 15:13:47","2","510","<p>Hey,I have touched on this question <a href=""http://stackoverflow.com/questions/2013433/whats-the-right-choice-create-new-activities-or-just-create-a-different-layout-a"">here</a>, where Christopher gave an answer to this, but I dont really get it so I thought its time to make it a real question, not just a ""follow up"" =)<hr></p><p>As it stands, the application Im writing has 4 different screens: 1. Screen 1 - list of nodes (main screen) 2. Screen 2 - options menu, tableLayout with buttons 3. Screen 3 - navigation 4. Screen 4 - text details on version etc</p><p>These screens can be navigated to/from using a ""header"" View that is placed on top. the header then has 4 different buttons:</p><pre><code>+--------------------+| menu with buttons  |+--------------------+|                    ||                    ||                    ||  C O N T E N T     ||                    ||                    ||                    |+--------------------+</code></pre><p>The header is just an XML-file (header.xml) with a few buttons. That header.xml is the included in the Layouts using the include-markup. For example, the main.xml has the line:</p><pre><code>&lt;include layout=""@layout/header""&gt;&lt;/include&gt;</code></pre><p><b>The header show up alright, but the question is - what is the correct approach to attach OnClickListeners for the buttons in the header?</b></p><p>Christopher <a href=""http://stackoverflow.com/questions/2013433/whats-the-right-choice-create-new-activities-or-just-create-a-different-layout-a"">pointed out</a> that you could create an Activity class and do the hooks there, like this:</p><pre><code>public class BaseActivity extends Activity {    protected View.OnClickListener mButtonListener;    protected void setupHeaderButtons() {        findViewById(R.id.header_btn_1).setOnClickListener(mButtonListener);        // ...        findViewById(R.id.header_btn_n).setOnClickListener(mButtonListener);    }}public class FirstActivity extends BaseActivity {    @Override    public void onCreate(Bundle b) {        super.onCreate(b);        setContentView(R.layout.first_activity);        // This needs to be done *after* the View has been inflated        setupHeaderButtons();    }}</code></pre><p>First, I cant make it work since the method <i> setupHeaderButtons</i> isnt accessible from FirstActivity.Secondly, is this the right way to go at it?</p><p>Regards</p>","178143","","234938","","2010-01-06 15:20:16","2011-03-19 09:32:18","""Header"" Views and buttons: how do I attach listeners to Buttons in a ""header"" that does not have its own Activity?","<java><android>","3","0","","",""
"2013981","1","2014052","","2010-01-06 15:27:58","0","949","<p>I want to have an element in my preference menu that does the following:</p><ul><li>Show a list of options.</li><li>Many are selectable</li><li>Maximum amount of options to be chosen 2.</li></ul><p>Possibilities I thought of:</p><ol><li>Doing a separated PreferenceScreen and showing options as checkBoxes but I don't know where to place the logic of max 2 options.</li><li>Extending DialogPreference and doing it by hand.</li></ol><p>What's the best way?</p><p>Thanks.</p>","119895","","","","","2010-01-06 16:16:51","ListPreference with a max number of selectable options","<android><android-preferences>","2","0","","",""
"2014041","1","2035345","","2010-01-06 15:35:55","17","6023","<p>I am investigating SVG, so I was wondering if anyone knows how good SVG support is for browsers on smart-phones. I know Opera Mini/iPhone support a lot of SVG Tiny, but I cannot figure out the support for other browsers (Blackberry, Pre, Android, Nokia smart-phones). I know phones using IE as rendering engine will have no support at all. </p><p>I have tried to find latest data, but cannot find anything later than 2007. I would appreciate if anyone can link to a post that discusses SVG support on mobile browsers.</p>","175988","","522877","","2013-01-05 02:44:30","2013-01-10 10:00:07","SVG support on smart-phone browsers","<android><ios><html5><svg><mobile-website>","4","1","2","",""
"2014102","1","2014194","","2010-01-06 15:44:10","2","3115","<p>I'm getting this error:""Uncaught handler: thread main exiting due to uncaught exception java.lang.VerifyError""</p><p>It's only happening on 1.6. Android 2.0 and up doesn't have any problems, but that's the main point of all.</p><p>I Can't catch the Error/Exception (VerifyError), and I know it's being caused by calling isInitialStickyBroadcast() which is not available in SDK 4, that's why it's wrapped in the SDK check. I just need this BroadcastReceiver to work on 2.0+ and not break in 1.6, it's an app in the market, the UNDOCK feature is needed for users on 2.0+ but obviously not in 1.6 but there is a fairly amount of users still on 1.6.</p><p>How to fix?</p><p>Thanks!</p><pre><code>private BroadcastReceiver mUndockedReceiver = new BroadcastReceiver(){      @Override      public void onReceive(Context context, Intent intent)       {          //FROM ECLAIR FORWARD, BEFORE DONUT THIS INTENT WAS NOT IMPLEMENTED          if (Build.VERSION.SDK_INT &gt;= 5)          {              if (!isInitialStickyBroadcast()) {                  int dockState = intent.getExtras().getInt(""android.intent.extra.DOCK_STATE"", 1);                  if (dockState == 0)                  {                      finish();                  }              }          }                 }};  </code></pre>","241869","","241869","","2010-01-08 16:37:16","2010-01-20 21:33:01","can't catch java.lang.VerifyError","<android>","3","2","1","",""
"2014305","1","","","2010-01-06 16:11:50","1","1405","<p>I have an Activity which has a Scrollview as the top level element. Inside there are some other Views and at some point there is a TabHost. You might get a better impression by looking at <a href=""http://img263.imageshack.us/img263/5329/bildschirmfoto20100106u.png"" rel=""nofollow"">the screenshot</a>. The TabHost has three tabs, each with another Activity that are launched by an Intent. </p><p>Everything is working fine except one thing. Whenever I click on a Tab, the Scrollview automatically scrolls down as you can see <a href=""http://img341.imageshack.us/img341/5329/bildschirmfoto20100106u.png"" rel=""nofollow"">over here</a>. The TabHost is out of the screen afterwards. I simply don't want it to scroll down, but can't see what the problem is. I tested on a 1.5 and 1.6 device and a 2.0 Emulator with the same results.</p><p>The xml of my TabHost looks like this:</p><pre><code>    &lt;TabHost        android:id=""@+id/tabhost""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;LinearLayout            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""&gt;            &lt;TabWidget                android:id=""@android:id/tabs""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content"" /&gt;            &lt;FrameLayout                android:id=""@android:id/tabcontent""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""&gt;            &lt;/FrameLayout&gt;        &lt;/LinearLayout&gt;    &lt;/TabHost&gt;</code></pre><p>And this is the code for adding a Tab:</p><pre><code>private void addTab(int descriptionRes, Class&lt;?&gt; destination, int flags) {    String description = getString(descriptionRes);    TabSpec spec = mTabHost.newTabSpec(description);    spec.setIndicator(description);    Intent i = new Intent(this, destination);    i.setData(Uri.parse(member.getId())).setFlags(flags);    spec.setContent(i);    mTabHost.addTab(spec);}</code></pre><p>Any suggestions?</p>","81364","","","","","2010-05-31 21:52:19","TabHost inside of a Scrollview: always scrolls down when a Tab is clicked","<java><android>","1","0","","",""
"2014633","1","2014714","","2010-01-06 16:57:46","6","1348","<p>I've been asked for some review copies of an Android app I've written, which is great, but I'm not willing to give out the full app to just anyone.  I want to make a time-limited version (which works for about two weeks, then gives up the ghost).</p><p>What is the easiest way to do this?  I haven't tested this myself, but I think that in theory if one built the app using a keystore which expires in two weeks might work.  Is that correct, or do I have to put a line of code in the app which shuts it down if you attempt to boot it after a set date?</p>","60261","","","","","2012-06-18 20:11:51","How can you make a review copy of an Android app?","<android>","7","0","1","",""
"2014827","1","2015026","","2010-01-06 17:23:25","0","285","<p>Would I be able to access the following information by HTML 5?</p><ul><li>GPS position</li><li><a href=""http://en.wikipedia.org/wiki/Bluetooth"" rel=""nofollow"">Bluetooth</a> device list</li><li><a href=""http://en.wikipedia.org/wiki/Wi-Fi"" rel=""nofollow"">Wi-Fi</a> network list</li><li>Contacts</li><li>Calendar</li></ul>","243782","","63550","","2010-01-06 17:42:51","2010-01-06 22:22:33","What functionalities can I access by WebKit?","<android><webkit>","3","0","","",""
"2015015","1","","","2010-01-06 17:50:41","5","11711","<p>How do you do you fetch a single RSS feed and show it in an ListView?</p><p>I realize there's hundreds of ways, but a clean and simple example would be appreciated.</p>","226384","","","","","2013-06-07 12:38:03","Android RSS Example","<java><android>","4","0","3","",""
"2015138","1","2015746","","2010-01-06 18:07:50","1","2243","<p>Here is my XML for a Button:</p><pre><code>&lt;Button  style=""@style/Btest""  android:id=""@+id/Button01""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:text=""Some text""  /&gt;</code></pre><p>And here is the style XML for the Button:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;style name=""Btest"" parent=""@android:style/Widget.Button""&gt;        &lt;item name=""android:textColor""&gt;#FFFFFFFF&lt;/item&gt;        &lt;item name=""android:textSize""&gt;16dip&lt;/item&gt;        &lt;item name=""android:textStyle""&gt;bold&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>But, the style XML has no effect on the Button. If I skip the style XML and apply the style directly in the Button XML, things work as intended.</p><p>What am I missing?</p>","178143","","110358","","2012-03-11 06:09:19","2012-03-11 06:09:19","Style does not work on Button","<android>","1","1","1","",""
"2015167","1","2032937","","2010-01-06 18:14:11","6","12378","<p>I'm looking for a way to implement image zoom and scrolling the way it is implemented in <a href=""http://www.robotcomics.net/android-comic-viewer/"">Droid Comic Viewer</a>. Is there any quick way to do that? If not, then could you please give some advices at least on implementing kinetic scrolling.</p>","162909","","","","","2010-05-01 22:24:03","Rich image scroll and zooming on android","<android><scrolling><image-manipulation>","2","0","7","",""
"2015259","1","","","2010-01-06 18:31:34","3","1889","<p>I have <a href=""http://en.wikipedia.org/wiki/HTC_Tattoo"" rel=""nofollow"">HTC Tattoo</a> with Android 1.6. I have maed a Java program for SMS sending. I got the  source on the Internet, I think, versions before 1.6. The problem is: SMSs are sent twice.</p><p>What is a possible cause for this problem?</p><p>If possible, please simply post sample code what works OK.</p>","244954","","63550","","2012-06-26 19:41:30","2012-06-26 19:42:02","Android 1.6 SMS (older application code)","<android><sms>","2","0","1","",""
"2015567","1","2015657","","2010-01-06 19:25:28","11","8381","<p>I am starting with Android programming with the help of <a href=""http://www.manning.com/ableson/"">Unlocking Android / Manning</a> which came from Santa and is a pretty good book. After running a few little tests and examples, I'm moving towards developing the concepts for my own application.</p><p>I want my App to execute as a Home Widget and I'm using <a href=""http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html"">this example</a> as my model to get started. </p><p>While I am able to load and run in the Android ADB emulator the code example in the example's Wiktionoary which is a normal Android App. I am not able to run, but only load into the emulator the Widget version of that code named SimpleWiktionary. </p><p>Am I am able to debug Android Home Widgets with the emulator? If so, what am I missing on starting/activating the Widget or having it show up in the Apps window? </p><p>T, Kenny</p>","3225","","","","","2011-11-26 07:36:32","Debugging Android Widget Code In Eclipse","<android><android-emulator><android-widget>","1","5","1","",""
"2016054","1","2016301","","2010-01-06 20:38:14","4","1458","<p>I have a strange problem. I'm parsing a document with large text field.In my characters section I'm using StringBuilder</p><pre><code>currentStory.append(ch, start, length);</code></pre><p>Then in my endElement I'm assigning it to the appropriate field on my object.</p><pre><code>  if (name.equals(tagDesc)) {     inDesc = false;     if (currentItem != null ) {         currentItem.setSummaryText(currentStory.toString());     }     currentStory.setLength(0);  }</code></pre><p><code>setSummaryText(String text)</code> method is:</p><pre><code>    public void setSummaryText(String text) {      Story = text;    }</code></pre><p>And I'm running out of memory.</p><p>If I change setSummaryText to something completely weird like this</p><pre><code>public void setSummaryText(String text) {      char[] local = text.toString()      Story = new String(local);   }</code></pre><p>I'm fine. I just can't figure out where I'm holding that reference ? Story is a member var of this object initialized with """";Note - Assigning to local String variable instead of char[] - fails as well.</p>","176761","","1777090","","2013-01-07 08:53:26","2013-01-07 08:53:26","SAX, StringBuilder and memory leak","<android><memory-leaks><sax>","1","0","1","",""
"2016108","1","2018768","","2010-01-06 20:47:24","2","2581","<p>I'm having quite a problem here and I hope for someone here to able to help me. let's go. </p><p>Let's say, I have quite a big image ( 1500x2000 ), i load it as a drawable, fine so far. Now I have a SurfaceView and I want to draw a certain region ( lets say the top-left-most region ) onto a canvas, in a non-scaled version. I thought using ClipDrawable would be just the right thing to use, but actually, I can't get it to do what I want to. It just displays a scaled-down image with the clip applied. </p><p>So basically my question is: how to draw a non-scaled drawable onto a surface, and how to clip that drawable?</p><p>any help appreciated, thank you :-)</p>","228358","","","","","2011-11-22 10:01:29","Android - ClipDrawable, ScaleDrawable, how does it work?","<android><graphics><drawable><surfaceview>","2","3","","",""
"2016249","1","2016344","","2010-01-06 21:08:13","46","56007","<p>I'm getting a view from the XML with the code below: </p><pre><code>Button view = (Button) LayoutInflater.from(this).inflate(R.layout.section_button, null);</code></pre><p>I would like to set a ""style"" for the button how can I do that in java since a want to use several style for each button I will use.</p>","221204","","648313","","2011-10-15 16:32:08","2014-01-30 11:28:09","How to programmatically setting style attribute in a view","<android><styles>","4","0","11","",""
"2016297","1","","","2010-01-06 21:15:16","0","208","<p>I have an activity which queries and display some Contact Information. And it has a button which launches the intent for 'Edit Contact' (the default Android activity). What should I do to refresh my view in case user edits Contact Information?</p><ul><li>requery in the onResume() of my activity?</li><li>add a content observer?</li></ul><p>Thank you for any advice.</p>","128983","","","","","2010-01-06 23:36:33","Need advice in how to update my Activity due to contact info changes","<android>","2","1","","",""
"2016471","1","","","2010-01-06 21:42:24","0","569","<p>When I try to install the Android plugin for Eclipse on MacOS X (Leopard) I get the error:</p><p>Cannot create tempfile for site.xmlPermission denied</p><p>I'm not sure what persmissions the system is referring to.  I have set this up on a Linux distro with no trouble at all.  </p>","245087","","","","","2010-01-10 00:45:58","Can't install Android plugin for Eclipse on MacOS X (Leopard)","<android><eclipse><plugins>","2","0","","",""
"2017414","1","5220954","","2010-01-07 00:34:33","32","42010","<p>I'm trying to do something I thought would be relatively simple: Upload an image to a server with the Android SDK. I'm found a lot of example code:</p><p><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/f9e17bbaf50c5fc/46145fcacd450e48"">http://groups.google.com/group/android-developers/browse_thread/thread/f9e17bbaf50c5fc/46145fcacd450e48</a></p><p><a href=""http://linklens.blogspot.com/2009/06/android-multipart-upload.html"">http://linklens.blogspot.com/2009/06/android-multipart-upload.html</a></p><p>But neither work for me. The confusion I keep running into is what is really needed to make a multipart request. What is the <em>simplest</em> way to have a multipart upload (with an image) for Android?</p><p>Any help or advice would be greatly appreciated!</p>","186655","","229044","","2011-09-28 21:02:26","2014-04-02 06:27:40","Post multipart request with Android SDK","<android><http><multipartform-data>","5","3","41","",""
"2017486","1","2017641","","2010-01-07 00:54:04","2","3044","<p>Is it possible to add ZIP file to APK package as a raw resource and read it with ZipFile class? It looks like it's trivial to open file from SD card, but not from APK.</p>","7162","","","","","2010-01-07 01:35:06","Android: is it possible to add ZIP file as a raw resource and read it with ZipFile?","<android><file><zip><filesystems><open>","1","0","1","",""
"2017584","1","2075070","","2010-01-07 01:19:18","4","6790","<p>Im thinking that more ""global"" styles are always overridden by more ""local"" Styles. For example, if I redefine all Buttons to have textSize=40dip (apply that Style as a Theme for the Application) and then apply another Style to a specific Button that says textSize=10dip, then that specific Button should get 10dip textSize.</p><p>And that is how it works, usually. But not when it comes to maxHeight. Here is the scenario:</p><p>In my <i>styles.xml</i> I have one Style where I inherit the default Button and change textSize and minHeight, and then another Style that sets some other values (but also inherits from Button), like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;style name=""Button"" parent=""@android:style/Widget.Button""&gt;    &lt;item name=""android:textSize""&gt;26dip&lt;/item&gt;    &lt;item name=""android:minHeight""&gt;60dip&lt;/item&gt;&lt;/style&gt;&lt;style name=""ButtonHeader"" parent=""@android:style/Widget.Button""&gt;    &lt;item name=""android:textSize""&gt;18dip&lt;/item&gt;    &lt;item name=""android:minWidth""&gt;70dip&lt;/item&gt;    &lt;item name=""android:maxHeight""&gt;10dip&lt;/item&gt;&lt;/style&gt;&lt;/resources&gt;    </code></pre><p>I apply the first Style as a theme for my Activity which makes all the buttons larger (minHeight=60dip). But I have a ""header"" (where I have some other buttons) that I do not want to have a minHeight of 60dip, and for those buttons I want to use the <i>ButtonHeader</i>, setting the maxHeight to 10dip.</p><p>In my <i>header.xml</i> it looks like this:</p><pre><code>&lt;Button style=""@style/ButtonHeader"" android:text=""UPP"" android:id=""@+id/Header_Button_UPP"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" &gt;&lt;/Button&gt;&lt;Button style=""@style/ButtonHeader"" android:text=""ALT"" android:id=""@+id/Header_Button_ALT"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" &gt;&lt;/Button&gt;&lt;Button style=""@style/ButtonHeader"" android:text=""NAV"" android:id=""@+id/Header_Button_NAV"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" &gt;&lt;/Button&gt;&lt;Button style=""@style/ButtonHeader"" android:text=""HIS"" android:id=""@+id/Header_Button_HIS"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" &gt;&lt;/Button&gt;</code></pre><p>I am specificly styling the buttons, overriding the ""global"" theme. It works in some parts; the textSize for these header-buttons is correctly set to 18dip, but the maxHeight is ignored - these buttons also increase in height to 60dip.</p><p>If I, in the style for ButtonHeader, set android:minHeight=""100dip"" the buttons in the header will increase in size to 100dip, overriding the Theme.But, as stated above, when I have android:maxHeight instead, nothing happens.</p><p>What am I missing?</p>","178143","","178143","","2010-01-09 00:19:53","2010-01-15 22:01:43","Styles, minHeight/maxHeight: I cannot get the maxHeight to override the theme minHeight","<android>","2","1","1","",""
"2017594","1","","","2010-01-07 01:23:17","0","722","<p>It seems to me that the method ""speak"" of class TextToSpeech only works in  method  onInit or onUtteranceCompleted. However, onInit and onUtteranceCompleted don't have any parameter for passing strings. </p><p>In the following code, I tried to define a global string arraylist outside the methods and used the arraylist for string input.For some reason , it didn't work out.But the engine did speak ""did you sleep well"". Any help is appreciated.</p><pre><code>public class TTS extends Activity implements OnInitListener,OnUtteranceCompletedListener,Runnable  {    ArrayList&lt;String&gt; content=new ArrayList&lt;String&gt;();        int MY_DATA_CHECK_CODE=50; private TextToSpeech mTts;</code></pre><p>public void onCreate(Bundle savedInstanceState) {</p><pre><code>        content.add(""test"");        content.add(""another test"");        super.onCreate(savedInstanceState);         setContentView(R.layout.splash);        Intent checkIntent = new Intent();        checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);        startActivityForResult(checkIntent, MY_DATA_CHECK_CODE);    }     protected void onActivityResult(int requestCode, int resultCode, Intent data) {    if (requestCode == MY_DATA_CHECK_CODE) {        if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {            // success, create the TTS instance            mTts = new TextToSpeech(this,this);        } else {            // missing data, install it            Intent installIntent = new Intent();            installIntent.setAction(            TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);            startActivity(installIntent);        }    }}  public void  onInit(int status){ if(status==TextToSpeech.SUCCESS){  mTts.setLanguage(Locale.US);  mTts.setOnUtteranceCompletedListener(this);             String myText1 = ""Did you sleep well?"";             mTts.speak(myText1, TextToSpeech.QUEUE_FLUSH, null);            for(int i=0;i&lt;content.size();i++){           mTts.speak(content.get(i),TextToSpeech.QUEUE_ADD,null);            }           if(status==TextToSpeech.ERROR){  mTts.shutdown();          }        }</code></pre><p>}</p>","1500136","","168868","","2012-01-01 21:59:56","2012-01-01 21:59:56","string input for Android's speech engine","<android><text-to-speech>","1","0","","",""
"2017598","1","3854937","","2010-01-07 01:23:50","5","727","<p>Are there any guidelines where should my app store resource files downloaded from internet?</p>","7162","","","","","2010-10-04 11:51:16","Android: good practices for organizing dirs and files on storage SD card?","<android><file><resources><storage><sd-card>","2","1","1","",""
"2017633","1","2017672","","2010-01-07 01:33:10","13","21472","<p>In my ListActivity, I need header and footer views (on the top and bottom of the list) to be used as previous page and next page buttons on my list, respectively, because I want to display only 20 items at a time.</p><p>I set my header and foot views by doing:</p><pre><code>getListView().addHeaderView(myHeaderView);getListView().addFooterView(myFooterView);setListAdapter(adapter);</code></pre><p>This works fine, but I need to dynamically remove and add these header and footer views, because some pages of my list may not have a next page button or a previous page button.</p><p>The problem is, I cannot call addHeaderView or addFooterView after I have called setListAdapter.</p><p>Is there a way around this?</p>","236300","","60261","","2010-01-07 07:02:27","2011-12-07 07:37:49","android listviews: header and footer views","<java><android><listview><adapter>","3","5","7","",""
"2017674","1","2017791","","2010-01-07 01:48:01","20","12350","<p>How do I get a Edittext with both a phone input and the ability to hide the string. I know that</p><pre><code>android:inputType=""textPassword""</code></pre><p>hides the string, while</p><pre><code>android:inputType=""phone""</code></pre><p>brings up a dialpad interface.</p><p>How to combine the two?</p>","244418","","","","","2014-01-04 00:45:29","Edittext set for password with phone number input? (android)","<android><edittext>","5","0","3","",""
"2017777","1","2017825","","2010-01-07 02:13:25","3","9470","<p>How do I go about changing the color of the frame of this dialog? I've tried a bunch of things and nothing works.  </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;  &lt;style name=""CustomDialogTheme"" parent=""@android:style/Theme.Dialog""&gt;                   &lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;  &lt;/style&gt;&lt;/resources&gt;</code></pre>","88847","","88847","","2011-06-20 15:44:27","2013-11-25 04:14:11","Change color of window frame","<android>","1","2","1","",""
"2017968","1","","","2010-01-07 03:11:08","9","5030","<p>I know that android sdk 2.0 has provided the new <a href=""http://developer.android.com/guide/topics/wireless/bluetooth.html#ManagingAConnection"" rel=""nofollow"">bluetooth API</a> for developers. But I'm not sure if this can help me connect to bluetooth printers. Are there any protocol restrictions or device limitaion for this? Is it possible that the bluetooth device is undetectable by android phone?</p>","67391","","","","","2011-03-16 20:24:46","Is it possible to connect android phone to printer via bluetooth?","<android><bluetooth><printing><wireless-connection>","2","0","4","",""
"2018186","1","2045357","","2010-01-07 04:18:48","2","1432","<p>I am working on the Android SDK on Eclipse.</p><p>Whenever I look at the SDcard after running this code (either before or after closing the emulator) the file exists but its contents are empty. I have tried reading the contents after writing them, with a BufferedReader, and they are indeed there, but vanish when I open the file.</p><pre><code>File file = new File(Constants.UPDATE_FILE);final java.util.Calendar c = java.util.Calendar.getInstance();if(!file.exists()){    Log.i(TAG, ""create new file"");    file.createNewFile();    lastUpdate = c.getTime();}BufferedWriter bufferedFileWriter = new BufferedWriter(new FileWriter(file));String dateToWrite = c.getTime().toGMTString();bufferedFileWriter.write(dateToWrite);bufferedFileWriter.flush();bufferedFileWriter.close();</code></pre>","214773","","214773","","2010-10-31 16:54:11","2010-10-31 16:54:11","Android can't write to file","<android><android-emulator>","2","1","","",""
"2018212","1","2019354","","2010-01-07 04:29:36","1","471","<p>I am mainly developing in .NET C# and I love the Events in C#.</p><p>Im now doing som Android stuff and thus must deal with Java. When porting some code from C# to Java I ran into the problem of Events; Java does not have anything that corresponds to C# Events.</p><p>So, when reading up on how Java handles ""events"", the only thing I can conclude is that it doesnt. There is no such thing as ""events"" in Java. Instead they use normal Interfaces and classes that implement those interfaces.</p><p>In Java:First, you have to first create the InterfaceThen, all classes that want to listen to the ""event"" has to implement that interface.Then, the class that fires the ""event"" has to keep a list of all listeners (Array of some sort)Then, the class that fires the ""event"" has to have a method so that listeners can add themselves to the Array</p><p>And when the firing class decides to ""fire the event"", it has to iterate through the Array of the listeners, calling the methods.</p><p>That is just plain Interface-usage, not Events in my world.</p><p>Am I wrong?</p>","178143","","219183","","2010-01-07 06:20:09","2010-01-07 09:52:53","Java ""events"" - nothing more than Interfaces. Why pretend it is Events when it is just a normal Interface and classes that implements that interface?","<c#><java><android>","5","1","","",""
"2018263","1","2019597","","2010-01-07 04:48:45","93","97750","<p>I am having lots of logging statements to debug for example.</p><pre><code>Log.v(TAG, ""Message here"");Log.w(TAG, "" WARNING HERE"");</code></pre><p>while deploying this application on device phone i want to turn off the verbose logging from where i can enable/disable logging.</p>","216431","","","","","2013-12-19 22:09:12","Android logging","<android><logging>","13","0","99","",""
"2018929","1","2019441","","2010-01-07 07:44:59","6","1587","<p>Is it possible to make 2 MapView on one Activity ?</p><p>If so, How to make it ?</p><p>I've tried but no luck.</p><p>Thanks in advance. </p>","227889","","","","","2013-01-08 13:44:52","How to to make 2 MapView on one Activity?","<android>","2","0","","",""
"2019141","1","2019250","","2010-01-07 08:46:22","1","528","<p>I am using a listview to display items.Currently I am passing an String array of items to it.But I want to pass one more array and display its items alongwith the items of the first array(i.e somehow two lines of text).How can I do that?</p>","199525","","","","","2010-01-07 09:19:30","How to pass more than one array to a listview?","<android><listview>","3","0","","",""
"2019321","1","2030893","","2010-01-07 09:31:12","0","1178","<p>I am using a simple <code>EditText</code> and register an <code>View.OnKeyListener</code>. Some GUI changes should happen (fading in/out of views) when certain conditions for the EditView text apply.In the emulator, this works as expected. On the Motorola Droid/Milestone, the listener does not work, only </p><ol><li>after pressing DEL, the listener is called the first time and always afterwards</li><li>when activating the number input, the listener works correctly</li></ol><p>Note: I deactivated the suggestions with TYPE_TEXT_FLAG_NO_SUGGESTIONS and used the IME action  IME_ACTION_GO to have a workaround for this (otherwise the user could not ""start"" a request).</p>","157229","","","","","2010-11-26 03:01:17","Android (Milestone/Droid): View.OnKeyListener not working correctly?","<android><listener><textview><milestone>","2","0","","",""
"2019391","1","","","2010-01-07 09:49:53","0","446","<p>Is it possible to write an application to prevent the Android handset from storing the capture picture? My thoughts area. Hook onto native camera apps and monitor for camera capture (or events). Once there is a capture event, my application will be able to detect and maybe remove the capture pictureb. Continously monitor camera capture picture storage. Are there any known i/o api l can use to do this?c. Prevent all writes to the OS. Possible?</p><p>Thanks for all the feedback in advance!</p><p>Cheers,</p>","245408","","","","","2010-01-07 11:43:39","Prevent Camera Capture on Android handet","<android>","1","0","","",""
"2019539","1","","","2010-01-07 10:21:49","12","1527","<p>I'm having a problem using the <code>org.apache.commons.net.telnet.*</code> library in my Android application and I was hoping someone could help me.</p><p>I have implemented an app which uses telnet to communicate with a remote server and all works fine.  The problem I have is when I call <code>TelnetClient.disconnect()</code> the method does not return. When calling the method when running a test case (meaning sans Android, just through Eclipse) it returns immediately, but on Android something is screwing it up. My test case looked something like:</p><pre><code>TelnetClient telnet = new TelnetClient();telnet.connect(ipAddress, port); telnet.disconnect(); //HERE</code></pre><p>Could anyone enlighten me as to why this may be?</p><p>If I obtain an <code>InputStream</code> from the connected telnet object and some info is sent from the telnet server after disconnect has been called, it can cause the method to return and closes the comm thread which was created by calling <code>.connect(..)</code>, which makes me think there is some sort or lock being held somewhere?</p><p>What would the fundamental difference be between the Dalvik VM or Android OS and my Java VM and XP machine to cause the behavior?</p><p>Thanks for any help, stack traces below!</p><p>I have a stack trace from the comm thread created by the <code>TelnetClient.connect()</code> at the time the ANR appears (as a result of the disconnect call indefinitely hanging).</p><pre><code>""Thread-15"" daemon prio=6 tid=17 NATIVE | group=""main"" sCount=1 dsCount=0 s=N                obj=0x43812d90 self=0x1be528 | sysTid=1403 nice=-2 sched=0/0 handle=2703408   at org.apache.harmony.luni.platform.OSNetworkSystem.receiveStreamImpl(Native Method)   at org.apache.harmony.luni.platform.OSNetworkSystem.receiveStream(OSNetworkSystem.java:236)   at org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:550)   at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:87)   at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:67)   at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:177)   at java.io.BufferedInputStream.read(BufferedInputStream.java:259)   at java.io.PushbackInputStream.read(PushbackInputStream.java:160)   at org.apache.commons.net.io.FromNetASCIIInputStream._read(FromNetASCIIInputStream.java:77)   at org.apache.commons.net.io.FromNetASCIIInputStream.read(FromNetASCIIInputStream.java:175)   at org.apache.commons.net.io.FromNetASCIIInputStream.read(FromNetASCIIInputStream.java:138)   at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:177)   at java.io.BufferedInputStream.read(BufferedInputStream.java:259)   at org.apache.commons.net.telnet.TelnetInputStream._read(TelnetInputStream.java:122)   at org.apache.commons.net.telnet.TelnetInputStream.run(TelnetInputStream.java:564)   at java.lang.Thread.run(Thread.java:1060)</code></pre><p>And also from the thread calling <code>.disconnect()</code> (which for my test case is just on the main thread):</p><pre><code>DALVIK THREADS: ""main"" prio=5 tid=3 MONITOR | group=""main"" sCount=1 dsCount=0 s=N   obj=0x4001ab08 self=0xbc60 | sysTid=1390 nice=0 sched=0/0 handle=-1343996920   at java.io.BufferedInputStream.close(BufferedInputStream.java:~166)   at org.apache.commons.net.telnet.TelnetInputStream.close(TelnetInputStream.java:535)   at java.io.FilterInputStream.close(FilterInputStream.java:81)   at java.io.BufferedInputStream.close(BufferedInputStream.java:167)   at couk.mypackage.comm.TelnetClient.closeTelnet(IGSTelnetClient.java:441)   at couk.myoackage.comm.Translator$1.handleMessage(IGSTranslator.java:65)   at android.os.Handler.dispatchMessage(Handler.java:99)   at android.os.Looper.loop(Looper.java:123)   at android.app.ActivityThread.main(ActivityThread.java:4203)   at java.lang.reflect.Method.invokeNative(Native Method)   at java.lang.reflect.Method.invoke(Method.java:521)   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)   at dalvik.system.NativeStart.main(Native Method)</code></pre><h3>Update:</h3><p>If I close the output and input streams explicitly (which the javadoc says NOT to do), but to call <code>disconnect()</code> instead, then I can close the connection, i.e.,</p><pre><code>out.close();in.close();telnet.disconnect();</code></pre><p>I'm confused!</p>","236743","","12148","","2011-07-18 17:05:07","2011-08-19 06:42:30","Problem using org.apache.commons.net.telnet.* with android","<java><android>","1","11","1","",""
"2020046","1","2020109","","2010-01-07 11:56:19","2","1184","<p>I've received report from the user of an app I've written that he gets FC whenever starting a certain activity. I have not been able to reproduce the issue on the emulator or on my HTC Hero (running 1.5), but this user running HTC Magic (with 1.6) is facing this error every time.</p><p>What bothers me is that no single step in the stacktrace actually includes any code in my app (<code>com.filmtipset</code>)</p><pre><code>01-07 00:10:26.773 I/ActivityManager(  141): Starting activity: Intent { cmp=com.filmtipset/.ViewMovie (has extras) }01-07 00:10:27.023 D/AndroidRuntime( 2402): Shutting down VM01-07 00:10:27.023 W/dalvikvm( 2402): threadid=3: thread exiting with uncaught exception (group=0x4001e170)01-07 00:10:27.023 E/AndroidRuntime( 2402): Uncaught handler: thread main exiting due to uncaught exception01-07 00:10:27.083 E/AndroidRuntime( 2402): java.lang.NullPointerException01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.widget.TabWidget.dispatchDraw(TabWidget.java:173)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.drawChild(ViewGroup.java:1529)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.drawChild(ViewGroup.java:1529)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.drawChild(ViewGroup.java:1529)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.View.draw(View.java:6552)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.widget.FrameLayout.draw(FrameLayout.java:352)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.drawChild(ViewGroup.java:1531)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.View.draw(View.java:6552)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.widget.FrameLayout.draw(FrameLayout.java:352)01-07 00:10:27.083 E/AndroidRuntime( 2402): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1883)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewRoot.draw(ViewRoot.java:1332)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewRoot.performTraversals(ViewRoot.java:1097)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.os.Handler.dispatchMessage(Handler.java:99)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.os.Looper.loop(Looper.java:123)01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.app.ActivityThread.main(ActivityThread.java:4320)01-07 00:10:27.083 E/AndroidRuntime( 2402): at java.lang.reflect.Method.invokeNative(Native Method)01-07 00:10:27.083 E/AndroidRuntime( 2402): at java.lang.reflect.Method.invoke(Method.java:521)01-07 00:10:27.083 E/AndroidRuntime( 2402): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)01-07 00:10:27.083 E/AndroidRuntime( 2402): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)01-07 00:10:27.083 E/AndroidRuntime( 2402): at dalvik.system.NativeStart.main(Native Method)</code></pre><p><a href=""http://pastebin.com/m1aed9808"" rel=""nofollow"">Full dump here if I've missed anything of interest</a></p><p>I'm guessing, then, that there might be something wrong with my layout. It's quite verbose, so <a href=""http://pastebin.com/f6af745ab"" rel=""nofollow"">I'm posting it here</a>, rather than pasting the whole thing on SO.</p><p>There is a tabwidget, where one tab is connected to the scrollview, <code>svFilmInfo</code>, and one to the linear layout <code>llComments</code>.</p><p>The tab host is populated as such:</p><pre><code>Drawable commentSelector = getResources().getDrawable(R.drawable.tabcomment);Drawable infoSelector = getResources().getDrawable(R.drawable.tabinfo);mTabHost = getTabHost();mTabHost.getTabWidget().setBackgroundColor(Color.BLACK);mTabHost.addTab(mTabHost.newTabSpec(""tabInfo"").setIndicator(""Filminfo"", infoSelector).setContent(R.id.svFilmInfo));mTabHost.addTab(mTabHost.newTabSpec(""tabInfo"").setIndicator(""Kommentarer"", commentSelector).setContent(R.id.llComments));</code></pre><p>Since I cannot reproduce the error myself, and since I cannot find any mention in the stack trace of what might be causing the error, I don't quite know where to start troubleshooting this.</p><p>I'd appreciate any pointers.</p>","133802","","","","","2010-04-11 21:41:34","NPE when drawing TabWidget in android (only on HTC Magic?)","<android><nullpointerexception><tabwidget>","2","0","","",""
"2020088","1","2033124","","2010-01-07 12:04:43","242","163813","<p>I am trying to create a mail sending application in Android. </p><p>If I use: </p><pre><code>Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);</code></pre><p>this will launch the built-in Android application; I'm trying to send the mail on button click directly <strong>without</strong> using this application.</p>","28557","","3","","2012-05-02 02:51:22","2014-02-25 16:15:40","Sending Email in Android using JavaMail API without using the default/built-in app","<android><email>","12","0","238","",""
"2020245","1","2020330","","2010-01-07 12:32:15","-1","802","<p>i done my application in portrait configaration but when load my application in to device its coming portraint configaration but i keep in landscape mode missing some controls.so i want to add scroll view to screen when changing the config to landscape.how i can add scrollview to screen</p>","217065","","","","","2010-01-07 21:08:16","how to add scrollview to screen in android?","<android>","1","1","","",""
"2020341","1","2020432","","2010-01-07 12:50:41","3","2987","<p>Please guide, in Android how can I pass my string (less then 160 char) to the default built-in SMS applicaion or queue, which will complete the process.</p><p>I mean, from my activity I want to call a built-in SMS application and pass my SMS string to that, then the built-in application will be responsible to rest of activity like SMS resending, etc.</p>","184143","","345546","","2011-01-24 22:47:45","2012-01-20 11:59:20","android: handover sms to default application","<android>","3","1","3","",""
"2020542","1","2027331","","2010-01-07 13:22:46","2","5432","<p>I am testing the AdMob for Android SDK. I can't set the <code>admob:testing=""true""</code> because the admob attribute is unknown.</p><pre><code>&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  xmlns:admob=""http://schemas.android.com/apk/res/org.ifies.android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:orientation=""vertical""  android:background=""#FF000000""  android:clickable=""true""&gt;  &lt;com.admob.android.ads.AdView      android:id=""@+id/admob""     android:visibility=""visible""    android:layout_width=""fill_parent""     android:layout_height=""100px""    android:background=""#FF0000""    admob:testing=""true""  /&gt;&lt;/LinearLayout&gt;</code></pre><p>My Eclipse is complaining that <code>admob:testing=""true""</code> would have an unknown prefix. Anyone got an idea on how to fix this?</p><p>Sub question: Anyone got an idea how to change the height of the ad? It seems to be fixed to 48px, which is not looking good on any DROID phone...</p>","133858","","18771","","2010-01-07 13:29:18","2011-05-23 04:18:10","What is correct xmlns url for AdMob in Android Layout XML","<android><testing><sdk><admob>","2","5","1","",""
"2020882","1","2021119","","2010-01-07 14:13:34","63","85548","<p>I'm using an horizontal progress bar in my Android application, and I want to change its progress color (which is Yellow by default). How can I do it using code (not XML)?</p>","239193","","114066","","2010-08-17 07:51:16","2013-04-04 11:25:43","How to change progress bar's progress color in Android","<android><android-widget>","9","2","61","",""
"2021066","1","","","2010-01-07 14:50:27","1","864","<p>All, I've googled over and over again to find a solution and while I found a bug regarding camera release, etc I can not for the life of me seem to get the cam code to work.  Every time I executed takePicture the system simply hangs, sometimes it calls the <code>PictureCallback</code>, but most of the time it simply hangs.</p><p>Weird issues about not being able to read /data/ap_gain.bin files, etc</p><p><strong>Below is the code:</strong></p><pre><code>public class CameraActivity extends Activity implements Camera.PictureCallback, RequestConstants { private static final String TAG = ""Camera""; private Preview preview; private boolean previewRunning; private int addressNotificationId; @Override protected void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  addressNotificationId = getIntent().getIntExtra(REQ_RA_ID, 0);  getWindow().setFormat(PixelFormat.TRANSLUCENT);  requestWindowFeature(Window.FEATURE_NO_TITLE);  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);  if (preview == null) {   preview = new Preview(this);  }  setContentView(preview); } @Override protected void onDestroy() {  if (isFinishing()) {   preview.cleanup();  }  super.onDestroy(); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) {  if (keyCode == KeyEvent.KEYCODE_CAMERA) {   /*   preview.setDrawingCacheEnabled(true);   Bitmap ss = preview.getDrawingCache();   byte[] data = ImageUtility.getImageData(ss,75,1);   Log.v(TAG, ""Pic with size: "" + data.length);   ApplicationManager.getInstance().createPacketRecord(PacketConstants.PT_FLAG_ADDRESS_PHOTO, ApplicationDatabaseManager.getInstance().getRouteAddressBySystemId(addressNotificationId), data);   finish();   */   preview.getCamera().takePicture(new Camera.ShutterCallback() {    @Override    public void onShutter() {    }   }, null, this);   return true;  }  return super.onKeyDown(keyCode, event); } @Override public void onPictureTaken(byte[] data, Camera camera) {  /*  if (data == null || isFinishing())   return;  camera.stopPreview();  previewRunning = false;  camera.release();  */  //Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0,data.length);  //data = null;  //data = ImageUtility.getImageData(bitmap, 75,1);  Log.v(TAG, ""Pic with size: "" + data.length);  ApplicationManager.getInstance().createPacketRecord(PacketConstants.PT_FLAG_ADDRESS_PHOTO, ApplicationDatabaseManager.getInstance().getRouteAddressBySystemId(addressNotificationId), data);  finish(); }}class Preview extends SurfaceView implements SurfaceHolder.Callback {    SurfaceHolder mHolder;    Camera mCamera;    Preview(Context context) {        super(context);        // Install a SurfaceHolder.Callback so we get notified when the        // underlying surface is created and destroyed.        mHolder = getHolder();        mHolder.addCallback(this);        mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);    }    Camera getCamera() {     return mCamera;    }    void cleanup() {     mCamera.stopPreview();        mCamera.release();        mCamera = null;    }    public void surfaceCreated(SurfaceHolder holder) {        if (mCamera == null)         mCamera = Camera.open();        try {           mCamera.setPreviewDisplay(holder);        } catch (IOException exception) {            mCamera.release();            mCamera = null;        }    }    public void surfaceDestroyed(SurfaceHolder holder) {    }    public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {        Camera.Parameters parameters = mCamera.getParameters();        parameters.setPreviewSize(w, h);        parameters.setPictureSize(w, h);        mCamera.setParameters(parameters);        mCamera.startPreview();    }}</code></pre>","172878","","881229","","2014-01-15 04:28:09","2014-01-15 04:28:09","Android Moto Droid Camera Hangs EVERY Time onTakePicture","<android><camera>","2","1","","",""
"2021135","1","2021178","","2010-01-07 15:02:34","5","1453","<p>I have an Android application (java) that was working fine when compiled with the Android 1.6 SDK using the following code from the android.provider.Contacts class:</p><pre><code>Uri baseUri = Contacts.Phones.CONTENT_FILTER_URL;</code></pre><p>When the 2.0 SDK came out, the android.provider.Contacts class was depreciated and replaced with android.provider.ContactsContract.  In order to get one program to work on both 1.6 and 2.0, I compiled under 1.6 with the following change:</p><pre><code>Uri baseUri = Contacts.Phones.CONTENT_FILTER_URL;…try {    Class&lt;?&gt; c = Class.forName(""android.provider.ContactsContract$PhoneLookup"");    baseUri = (Uri) c.getField(""CONTENT_FILTER_URI"").get(baseUri);}     catch (Exception e) {           }</code></pre><p>Since I was compiling under 1.6, I could not import android.provider.ContactsContract since it is a class known only to 2.0.  Is this considered reflection and to what degree?</p><p><b>Added Comment:</b> After reading the ""Reflection"" chapter of ""The Java Programming Language"" (which I should have done first), I mostly now understand what you can do with reflection but a concise definition of reflection is not easy to come by. Your answers have helped to clarify what prompted my question - that once a class has been reflected on, and an instance of the class created using reflection, you can interact with the instance as if the class was new'ed.</p><p>Here is my meager attempt at a concise definition that is far from perfect and I am sure I will need to revise as I learn more:</p><p>Reflection is the indirect, dynamic inquiry, manipulation or invocation of class objects using class objects contained in java.lang.reflect or the Class or Package classes that requires initially accessing the class using a fully qualified string name.</p>","236975","","236975","","2010-01-08 04:25:36","2010-01-08 04:25:36","Is this considered reflection and to what degree?","<java><android><reflection>","4","4","3","",""
"2021176","1","","","2010-01-07 15:06:32","55","72319","<p>How can I check the current status of the GPS receiver? I already checked the <code>LocationListener</code> <a href=""http://developer.android.com/reference/android/location/LocationListener.html#onStatusChanged%28java.lang.String,%20int,%20android.os.Bundle%29""><code>onStatusChanged</code></a> method but somehow it seems that is not working, or just the wrong possibility.</p><p>Basically I just need to know if the GPS icon at the top of the screen is blinking (no actual fix) or solid (fix is available).</p>","245625","","496830","","2011-11-08 13:19:07","2013-07-23 19:04:45","How can I check the current status of the GPS receiver?","<android><gps>","16","0","64","",""
"2021354","1","2021401","","2010-01-07 15:26:08","0","1162","<p>I have a main class filled with a cursor adapter:</p><pre><code>public class MainMenu extends ListActivity{ ... private void updateData(){ ... SimpleAdapter notes = new SimpleAdapter(this, array, R.layout.row_task, from, to); setListAdapter(notes); } }</code></pre><p>I need to know when this list has finnished to inflate it, so I've discovered this methods:</p><p>ListView.onFinishInflate()...</p><p>But I have no idea how to override it inside my code.</p><p>Any idea?</p>","245638","","","","","2010-04-15 09:00:11","OnFinishInflate inside ListActivity","<android>","1","0","","",""
"2021398","1","2021462","","2010-01-07 15:31:53","0","1923","<p>I've got an app using MapActivity.onCreate() to initialize the map and show it on screen. Now I would like to add a menu to my app. From what I've found out I can't add a menu from MapActivity and need to use Activity (correct me if I'm wrong).</p><p>Now I have no idea how to ""initialize"" the map from my Activity-class.</p><p>And how would I have to fix the views, will I wrap my activity-layout around my Map-layout?</p>","175495","","","","","2010-07-27 14:20:31","How to add a menu to MapActivity?","<android><google-maps>","3","1","","",""
"2021471","1","","","2010-01-07 15:40:46","2","560","<p>A friend and I are currently working on a turn-based game with chat with both desktop browser and Android clients, with Google App Engine as the server. </p><p>We're using the Java API for GAE and using HTTP for communication with the server. We've implemented simple chat functionality, and we're getting undesirable latencies 1-3 seconds from both the browser and Android clients while just posting simple one-word chat messages.</p><p>My friend thought it would be best to use XMPP instead of HTTP, but we want to use a Google Accounts cookie for authentication from the Android client, and according to the GAE documentation, XMPP clients cannot use a Google Accounts cookie and must use the user's password.</p><p>Does anyone have any suggestions as to where the latency might be coming from, how to troubleshoot it, and/or what to do about it?</p><p>Also, is anyone aware of any opensource implementations of chat (or something similar) on GAE done in Java? Can't seem to find any.</p>","242869","","","","","2010-03-14 22:40:55","Google App Engine, Java, and HTTP Performance","<java><android><http><google-app-engine>","2","3","0","",""
"2021880","1","2023396","","2010-01-07 16:32:08","1","10211","<p>In order to get XML data from a server repeatedly, I'm attempting to use AsyncTask and Timer as per <a href=""http://www.mail-archive.com/android-beginners@googlegroups.com/msg11150.html"" rel=""nofollow"">Mark Murphy's suggestion</a>.</p><p>I get the following error:</p><pre><code>01-07 16:11:26.705: ERROR/AndroidRuntime(729): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()</code></pre><p>I'm using SDK 1.5 with Eclipse on Windows.</p><p>I've looked in documentation, on StackOverflow and in the Android Developers group, but I'm not clear what's causing the error or how to fix it.</p><p>I can get the data once -- i.e. without Async and Timer -- and parse it via SAX without problems.</p><p>Full app code below. </p><p>Please excuse any naive errors: I'm quite new to Android.</p><pre><code>package com.foo.bar.myactivity;import java.net.URL;import java.util.Timer;import java.util.TimerTask;import javax.xml.parsers.SAXParser;import javax.xml.parsers.SAXParserFactory;import org.xml.sax.InputSource;import org.xml.sax.XMLReader;import android.app.Activity;import android.os.AsyncTask;import android.os.Bundle;import android.util.Log;public class MyActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Timer timer;        timer = new Timer();        timer.schedule(new MyTimerTask(), 0, 1000);     }    public class MyAsyncTask extends AsyncTask&lt;String, Integer, MyData&gt; {        protected MyData doInBackground(String... string) {            MyData myData = new MyData();            try {                URL url = new URL(""http://www.example.com/my.xml"");                SAXParserFactory spf = SAXParserFactory.newInstance();                SAXParser sp = spf.newSAXParser();                XMLReader xr = sp.getXMLReader();                MyHandler myHandler = new MyHandler();                xr.setContentHandler(myHandler);                System.setProperty(""http.proxyHost"", ""www-cache.example.com"");                System.setProperty(""http.proxyPort"", ""80"");                xr.parse(new InputSource(url.openStream()));                myData = myHandler.getParsedData();                return myData;            } catch (Exception e) {                Log.e(""&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Error getting myData: "", e.getMessage(), e);                return myData;            }        }        protected void onProgressUpdate(Integer... progress) {            // setProgressPercent(progress[0]);        }        protected void onPostExecute(MyData myData) {            Log.d(""&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;My data: "", myData.toString());        }    }    public class MyTimerTask extends TimerTask {        public void run() {            try {                new MyAsyncTask().execute("""");            } catch (Exception e) {                Log.e(""&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Error executing MyAsyncTask: "", e.getMessage(), e);            }        }    }}</code></pre>","51593","","51593","","2010-01-07 21:40:25","2010-01-08 12:09:46","How to get XML using AsyncTask and Timer?","<android><android-asynctask>","5","0","6","",""
"2022170","1","2022465","","2010-01-07 17:17:11","9","11698","<p>I am creating an android application which has to execute web requests in the background and then handle the received data and modify the user interface according to the server response.</p><p>The goal of posting requests and handling data in the background is to avoid the freezing of user interface. Currently however I notice that the user interface is freezing so I am not sure the logic is working as it is supposed to.</p><p>Here is the part of code which is supposed to post requests and handle responses in its own thread and then pass the data to GUI:</p><pre><code>public class ServerConnection {Queue&lt;String&gt; requests;...DefaultHttpClient httpClient;HttpHost targetHost;Handler handler;ServerResponseHandler responseHandler;Activity activity;public ServerConnection(Activity activity){    this.activity = activity;    this.responseHandler = (ServerResponseHandler) activity;    httpClient = new DefaultHttpClient();    targetHost = new HttpHost(TARGET_DOMAIN, 80, ""http"");    requests = new LinkedList&lt;String&gt;();}private Runnable requestSender = new Runnable(){    @Override    public void run() {        if(!requests.isEmpty()){            String requestString = requests.remove();            HttpGet httpGet = new HttpGet(requestString);            httpGet.addHeader(""Accept"", ""text/xml"");            String encodingString = ""testuser:testpass"";            String sEncodedString = Base64Coder.encodeString(encodingString);            try{                String sContent = fetchURL(requestString, sEncodedString);                XMLParser xmlParser = new XMLParser();                List &lt;Product&gt; products = xmlParser.getProducts(sContent);                responseHandler.onProductsResponse(products);            }            catch(Exception ex){                Log.e(TAG, ex.getMessage());            }        }    }};public void sendRequest(String requestString){    requests.add(requestString);    handler = new Handler();    handler.post(requestSender);}</code></pre><p>The method sendRequest() is called from the main activity which implements ServerResponseHandler. I guess the request is executed in its own thread and by calling </p><p>responseHandler.onProductsResponse(products);</p><p>the list of products (data from the web) is passed to main activity. Anyway due to poor performance I would appreciate if anyone could correct any possible issue in the logic above or suggest any other (better) option.</p>","22996","","","","","2010-01-07 18:14:36","How to execute web request in its own thread?","<java><android><multithreading>","2","0","6","",""
"2022183","1","","","2010-01-07 17:19:38","3","5768","<p>I'm trying to use BouncyCastle with android to implement ECDH and EL Gamal. I've added the bouncycastle jar file (bcprov-jdk16-144.jar) and written some code that works with my computers jvm however when I try and port it to my android application it throws: </p><pre><code>java.security.NoSuchAlgorithmException: KeyPairGenerator ECDH implementation not found</code></pre><p>A sample of the code is:</p><pre><code>Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());java.security.KeyPairGenerator keyGen = org.bouncycastle.jce.provider.asymmetric.ec.KeyPairGenerator.getInstance(""ECDH"", ""BC"");                ECGenParameterSpec ecSpec = new ECGenParameterSpec(""prime192v1"");                keyGen.initialize(ecSpec, SecureRandom.getInstance(""SHA1PRNG""));                KeyPair pair = keyGen.generateKeyPair();                PublicKey pubk = pair.getPublic();                PrivateKey prik = pair.getPrivate();</code></pre><p>I then wrote a simple program to see what encryption algorithms are available and ran it on my android emulator and on my computers jvm the code was:</p><pre><code>Set&lt;Provider.Service&gt; rar = new org.bouncycastle.jce.provider.BouncyCastleProvider().getServices();    Iterator&lt;Provider.Service&gt; ir = rar.iterator();    while(ir.hasNext())        System.out.println(ir.next().getAlgorithm());</code></pre><p>On android I do not get any of the EC algorithms while ran normally on my computer it's fine.</p><p>I'm also getting the following two errors when compiling for a lot of the bouncy castle classes:</p><p>01-07 17:17:42.548: INFO/dalvikvm(1054): DexOpt: not resolving ambiguous class 'Lorg/bouncycastle/asn1/ASN1Encodable;'</p><p>01-07 17:17:42.548: DEBUG/dalvikvm(1054): DexOpt: not verifying 'Lorg/bouncycastle/asn1/ess/OtherSigningCertificate;': multiple definitions </p><p>What am I doing wrong?</p>","245737","","445517","","2013-07-03 20:41:26","2013-07-03 20:41:26","Bouncycastle encryption algorithms not provided","<android><encryption><bouncycastle>","3","3","1","",""
"2022256","1","2022930","","2010-01-07 17:33:10","4","18326","<p>I'm creating a file in data/data/myPackage/files/ :  </p><pre><code>file = new File( getFilesDir() + ""/file.txt"");</code></pre><p>I'm absolutely sure that the file is created.<br>Right after its creation I call:  </p><pre><code>file.canWrite();</code></pre><p>and the result is true.  </p><p>When I try to use that file<br>I get: ""Permission Denied"".<br>In Eclipse, in DDMS, this file permissions are like:  </p><pre><code>-rw-------</code></pre><p>Can anyone help here?</p><p>Thanks</p>","243376","","","","","2012-02-04 13:52:44","Permission denied: File created in .../files","<android>","6","0","2","",""
"2022380","1","","","2010-01-07 17:48:46","3","2514","<p>So here's the problem. I am displaying a big image in ImageView and need to find it's position relative to the image. Like this:</p><pre><code>+-------------------------------+¦ Image                         ¦ ¦--&gt;+-------------+             ¦¦   ¦ ImageView   ¦             ¦¦   ¦             ¦             ¦¦   +-------------+             ¦¦                               ¦¦                               ¦+-------------------------------+</code></pre><p>Any help?</p><p><strong>UPD:</strong> Since there were some misunderstandings I will explain the problem in detail.</p><p>I have an image. A Bitmap actually. I am displaying it in an ImageView with <code>CENTER</code> scale type. Assume that the image is bigger than the ImageView, so only a part of the image is displayed. I want to find the position of this part relative to the whole image.</p>","162909","","162909","","2010-01-08 09:44:26","2010-01-08 10:59:32","Find position of ImageView relative to the image it's displaying","<android><image>","2","0","1","",""
"2022658","1","2022670","","2010-01-07 18:32:14","3","623","<p>I am a Java professional. Now I'd like to write an application for the Android platform. </p><ul><li>What is the initial step I need to take?</li><li>How does my Java programming experience help in this case?</li></ul>","240698","","2197","","2010-01-07 19:34:19","2010-01-08 02:09:59","What is the initial step to start with android? How does java programming help?","<java><android>","6","0","1","",""
"2022868","1","2046607","","2010-01-07 19:03:39","0","3476","<p>I'm having a strange problem with Android 1.6</p><p>I have an application that has a ListView (found in Activity #1).  </p><p>The user can click on one of the rows in the ListView and is taken to a 2nd Activity (Activity # 2).  </p><p>User can then use the back button to go back to the ListView.</p><p>The problem is that if the user scrolls down the list after returning from Activity # 2 the application crashes, but doesn't leave a traditional stack trace.</p><p>If I look at LogCat, I see the following show up right before the crash (see below).</p><p>The additional strangeness is that when I attach the debugger to try and pinpoint the error, <strong>I can't reproduce the error!</strong></p><p><strong>Any thoughts on what LogCat is telling me here?</strong>  There's a small section near the end of the log shown below that indicates ""debuggerd committing suicide to free the zombie!"", which sounds like a memory leak, but google isn't giving me much luck with this error.</p><p><strong>Thoughts on what to try next?</strong></p><pre><code>01-07 13:49:36.234: WARN/UsageStats(1018): Failed to persist new stats01-07 13:49:37.570: INFO/DEBUG(10977): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***01-07 13:49:37.570: INFO/DEBUG(10977): Build fingerprint: 'verizon/voles/sholes/sholes:2.0.1/ESD56/20996:user/release-keys'01-07 13:49:37.570: INFO/DEBUG(10977): pid: 12291, tid: 12292  &gt;&gt;&gt; com.ggggg.dot &lt;&lt;&lt;01-07 13:49:37.570: INFO/DEBUG(10977): signal 11 (SIGSEGV), fault addr 0000000401-07 13:49:37.570: INFO/DEBUG(10977):  r0 00000004  r1 40024108  r2 00000004  r3 4185dfd401-07 13:49:37.570: INFO/DEBUG(10977):  r4 00000000  r5 00000000  r6 40024108  r7 4185dfa801-07 13:49:37.570: INFO/DEBUG(10977):  r8 100ffcf8  r9 4185dfa0  10 4185df8c  fp 0013e8f801-07 13:49:37.570: INFO/DEBUG(10977):  ip ad36c2ec  sp 100ffce0  lr ad32995f  pc afb04524  cpsr 0000001001-07 13:49:37.586: DEBUG/dalvikvm(12291): GC freed 2278 objects / 266992 bytes in 99ms01-07 13:49:37.664: INFO/DEBUG(10977):          #00  pc 00004524  /system/lib/libcutils.so01-07 13:49:37.688: INFO/DEBUG(10977):          #01  pc 0002995c  /system/lib/libandroid_runtime.so01-07 13:49:37.688: INFO/DEBUG(10977):          #02  pc 00048cf4  /system/lib/libandroid_runtime.so01-07 13:49:37.688: INFO/DEBUG(10977):          #03  pc 0000ecb4  /system/lib/libdvm.so01-07 13:49:37.688: INFO/DEBUG(10977):          #04  pc 000387c4  /system/lib/libdvm.so01-07 13:49:37.695: INFO/DEBUG(10977):          #05  pc 000139b8  /system/lib/libdvm.so01-07 13:49:37.695: INFO/DEBUG(10977):          #06  pc 00019338  /system/lib/libdvm.so01-07 13:49:37.695: INFO/DEBUG(10977):          #07  pc 00018804  /system/lib/libdvm.so01-07 13:49:37.703: INFO/DEBUG(10977):          #08  pc 0004eea0  /system/lib/libdvm.so01-07 13:49:37.703: INFO/DEBUG(10977):          #09  pc 0004eec8  /system/lib/libdvm.so01-07 13:49:37.703: INFO/DEBUG(10977):          #10  pc 00044aaa  /system/lib/libdvm.so01-07 13:49:37.703: INFO/DEBUG(10977):          #11  pc 00044b36  /system/lib/libdvm.so01-07 13:49:37.711: INFO/DEBUG(10977):          #12  pc 00044fc0  /system/lib/libdvm.so01-07 13:49:37.719: INFO/DEBUG(10977):          #13  pc 000425c4  /system/lib/libdvm.so01-07 13:49:37.719: INFO/DEBUG(10977):          #14  pc 0000fd74  /system/lib/libc.so01-07 13:49:37.719: INFO/DEBUG(10977):          #15  pc 0000f840  /system/lib/libc.so01-07 13:49:37.719: INFO/DEBUG(10977): code around pc:01-07 13:49:37.719: INFO/DEBUG(10977): afb04514 e8bd4010 e12fff1e e92d4010 e1a02000 01-07 13:49:37.719: INFO/DEBUG(10977): afb04524 e5920000 e3e03a0f e28fe004 e2401001 01-07 13:49:37.719: INFO/DEBUG(10977): afb04534 e243f03f 3afffff9 e2810001 e8bd4010 01-07 13:49:37.719: INFO/DEBUG(10977): code around lr:01-07 13:49:37.719: INFO/DEBUG(10977): ad32994c fffeb07c 00005e20 4604b510 f7f03004 01-07 13:49:37.719: INFO/DEBUG(10977): ad32995c 2801ea4e 6060d104 68436820 47984620 01-07 13:49:37.719: INFO/DEBUG(10977): ad32996c bf00bd10 461eb5f7 f1d24c1a bf380301 01-07 13:49:37.719: INFO/DEBUG(10977): stack:01-07 13:49:37.719: INFO/DEBUG(10977):     100ffca0  00000000  01-07 13:49:37.727: INFO/DEBUG(10977):     100ffca4  afe0f028  /system/lib/libc.so01-07 13:49:37.727: INFO/DEBUG(10977):     100ffca8  00000001  01-07 13:49:37.727: INFO/DEBUG(10977):     100ffcac  300040ac  01-07 13:49:37.727: INFO/DEBUG(10977):     100ffcb0  00000001  01-07 13:49:37.727: INFO/DEBUG(10977):     100ffcb4  100ffd28  01-07 13:49:37.727: INFO/DEBUG(10977):     100ffcb8  418cd52c  /dev/ashmem/dalvik-LinearAlloc (deleted)01-07 13:49:37.727: INFO/DEBUG(10977):     100ffcbc  418cd52c  /dev/ashmem/dalvik-LinearAlloc (deleted)01-07 13:49:37.727: INFO/DEBUG(10977):     100ffcc0  000002a4  01-07 13:49:37.727: INFO/DEBUG(10977):     100ffcc4  ad061e8d  /system/lib/libdvm.so01-07 13:49:37.727: INFO/DEBUG(10977):     100ffcc8  100ffd28  01-07 13:49:37.727: INFO/DEBUG(10977):     100ffccc  ad058201  /system/lib/libdvm.so01-07 13:49:37.727: INFO/DEBUG(10977):     100ffcd0  40024108  /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)01-07 13:49:37.727: INFO/DEBUG(10977):     100ffcd4  0000000d  01-07 13:49:37.727: INFO/DEBUG(10977):     100ffcd8  df002777  01-07 13:49:37.727: INFO/DEBUG(10977):     100ffcdc  e3a070ad  01-07 13:49:37.727: INFO/DEBUG(10977): #00 100ffce0  00000000  01-07 13:49:37.727: INFO/DEBUG(10977):     100ffce4  ad32995f  /system/lib/libandroid_runtime.so01-07 13:49:37.727: INFO/DEBUG(10977): #01 100ffce8  100ffd18  01-07 13:49:37.727: INFO/DEBUG(10977):     100ffcec  ad348cf9  /system/lib/libandroid_runtime.so01-07 13:49:38.344: INFO/DEBUG(10977): debuggerd committing suicide to free the zombie!01-07 13:49:38.352: INFO/ActivityManager(1018): Process com.ggggg.dot (pid 12291) has died.01-07 13:49:38.359: INFO/WindowManager(1018): WIN DEATH: Window{44a51e60 com.ggggg.dot/com.ggggg.dot.Dot paused=false}01-07 13:49:38.375: WARN/UsageStats(1018): Unexpected resume of com.android.launcher while already resumed in com.ggggg.dot01-07 13:49:38.383: DEBUG/Zygote(986): Process 12291 terminated by signal (11)01-07 13:49:38.391: INFO/DEBUG(12309): debuggerd: Nov 25 2009 17:44:5401-07 13:49:38.406: WARN/InputManagerService(1018): Got RemoteException sending setActive(false) notification to pid 12291 uid 1007801-07 13:50:06.844: DEBUG/dalvikvm(4885): GC freed 15 objects / 600 bytes in 113ms</code></pre>","141146","","","","","2011-02-11 19:51:57","android application failing upon user scrolling - no 'obvious' error","<android><listview>","3","3","2","",""
"2022945","1","4881734","","2010-01-07 19:14:31","47","30313","<p><strong>Edit</strong>: Android now supports <a href=""http://developer.android.com/guide/market/billing/index.html"">in-app billing</a>!</p><p><strong>Original question:</strong></p><p>It looks like Android won't natively support in-app purchases for a while, and when it does there might be a huge user base with devices that don't support them.</p><p>What's the best way to implement iPhone-like (additional content or services) in-app purchases in Android using the Android Market if possible? </p><p>The solution should consider in particular: </p><ul><li>For all kinds of in-app purchases: Android Market's 24-hour cancellation policy</li><li>For consumables/non-consumables: storage of additional content (ie: use precious application memory to avoid piracy, or use SD card to avoid bloating application memory)</li></ul><p>Thanks!</p>","143378","","143378","","2011-06-09 15:54:34","2014-01-09 23:57:47","Implementing In App purchases in Android?","<android><in-app-purchase><in-app-billing>","10","1","21","",""
"2023347","1","2023359","","2010-01-07 20:16:22","4","5793","<p>In the emulator I can't seem to write to the attached SDCard. The following code always spits out the ""can't write root"" log message, but not the ""can't read root"" one.</p><pre><code>File routesRoot = Environment.getExternalStorageDirectory();if (!routesRoot.canWrite())    Log.v(getClass().getSimpleName(), ""can't write root"");if (!routesRoot.canRead())    Log.v(getClass().getSimpleName(), ""can't read root"");</code></pre><p>Ideas?</p>","76835","","164901","","2010-07-08 18:49:05","2011-07-09 23:54:06","Why is my SD Card not writable (Android)?","<android><storage><sd-card>","1","0","1","",""
"2023557","1","","","2010-01-07 20:50:49","16","10802","<p>Is someone from Google able to advise when the Android SDK is likely to include a public API for reading/writing event data to the user's calendar?</p><p>Searching the forums I see that this is a much desired feature by many developers but I haven't seen any indication as to when (or even if) this need will be addressed.</p><p>Thanks in advance ...</p>","245920","","","","","2011-10-20 21:49:18","When will Android have a public Calendar API?","<android>","4","1","8","",""
"2023664","1","2024029","","2010-01-07 21:05:07","8","4355","<p>There is a web service that provides some data that my app makes use of. This data is fairly large and only changes VERY infrequently so I thought it would be nice if the app could cache it on the SD Card and only update it as needed.</p><p>Currently I'm grabbing the data (an XML file) and parsing it into an object tree using SAX. This process takes (at most) 2-3 seconds over my WIFI. However, serializing the resulting objects to the SDCard takes significantly longer (a minute or more) and deserializing it still takes longer than just download/parsing in the first place.</p><p>Does anyone have any recommendations for improving this or alternate ideas for persisting this data (other than just saving the XML file and reparsing every time)?</p><p><strong>UPDATE:</strong> This is more than a trivial collection of records. The object-graph is actually ridiculously complex and storing it into a database would result in dozens of tables with only a single record in each one.</p>","76835","","76835","","2010-01-07 22:07:10","2010-01-08 15:33:59","Recommendations for persisting data on Android?","<android><serialization><object>","5","0","4","",""
"2023669","1","2023685","","2010-01-07 21:05:38","78","80487","<p>On Android 1.0 there was a com.google.googlenav namespace for driving directions:<br><a href=""http://www.anddev.org/route_-_improved_google_driving_directions-t1892.html"">Route - Improved Google Driving Directions</a><br>But in newer SDK it was removed by some reason...<br><a href=""http://stackoverflow.com/questions/1612533/android-drivingdirections-removed-since-api-1-0-how-to-do-it-in-1-5-1-6"">Android: DrivingDirections removed since API 1.0 - how to do it in 1.5/1.6?</a>On BlackBerry there is also lack of APIs for such stuff:<br><a href=""http://stackoverflow.com/questions/1542252/how-to-find-the-route-between-two-places-in-blackberry"">how to find the route between two places in Blackberry?</a></p><p>csie-tw gives a workaround (query gmaps for kml file and parse it):<br><a href=""http://csie-tw.blogspot.com/2009/06/android-driving-direction-route-path.html"">Android - Driving Direction (Route Path)</a><br>Also <a href=""http://stackoverflow.com/users/223088/andrea"">Andrea</a> made a <a href=""http://home.ameliemedia.com/android-app-aroundme/#tips"">DrivingDirections helper classes</a> for Android.<br>I wrote a little helper for this functionality, in j2me, so I would like to share my samples on Android and BlackBerry.  </p><p><strong>UPDATE</strong><br>As it was stated in comments, it's not officially allowed <a href=""http://code.google.com/intl/uk/apis/maps/terms.html"">Google Maps APIs Terms of Service </a>:</p><blockquote>  <p>Google Maps/Google Earth APIs Terms of Service<br>  Last updated: May 27, 2009<br>  ...<br>  10. License Restrictions. Except as expressly permitted under the Terms, or unless you have received prior written authorization from Google (or, as applicable, from the provider of particular Content), Google's licenses above are subject to your adherence to all of the restrictions below. Except as explicitly permitted in Section 7 or the Maps APIs Documentation, you must not (nor may you permit anyone else to):<br>  ...<br>  10.9 use the Service or Content with any products, systems, or applications for or in connection with:<br>  (a) real time navigation or route guidance, including but not limited to turn-by-turn route guidance that is synchronized to the position of a user's sensor-enabled device;</p></blockquote><p>and may be disabled for certain apps (somehow, at least on Android)... From <a href=""http://groups.google.com/group/Google-Maps-API/msg/7fa25a13e6153d02"">Geocode scraping in .NET conversation</a>:  </p><blockquote>  <p>This is not allowed by the API terms of use.  You should not scrape  Google Maps to generate geocodes.  We will block services that do  automated queries of our servers.</p>    <p>Bret Taylor<br>  Product Manager, Google Maps </p></blockquote><p>Would be grateful for any alternatives and/or suggestions!<br>Thanks!</p>","67407","","67407","","2010-01-09 12:07:12","2013-02-05 08:08:55","J2ME/Android/BlackBerry - driving directions, route between two locations","<android><blackberry><java-me><geolocation><driving-directions>","1","5","96","",""
"2023811","1","2024222","","2010-01-07 21:28:56","5","2980","<p>I'm trying to catch an Android Market search intent.</p><p>That's the way you launch Android Market and search for an app by package name:</p><pre><code>startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(""market://search?q=pname:com.google.somepackage"")));</code></pre><p>Now, here's the intent filter for one of my activities:</p><pre><code>&lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.VIEW"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;data android:scheme=""market"" android:host=""search"" /&gt;&lt;/intent-filter&gt;</code></pre><p>I'd expect Android to ask me which app should handle the intent which doesn't happen.<br>Yet, if I replace <code>market</code> with <code>market1</code> or <code>search</code> with <code>search1</code>, in both places, my activity gets launched.<br>Is there a notion of ""untouchable"" intents or something?</p><p>TIA.</p>","15187","","","","","2010-01-07 22:40:37","Catching market search intents?","<android><android-intent>","1","0","5","",""
"2024079","1","","","2010-01-07 22:14:13","1","180","<p>so I just recently (yesterday) started developing on the Android platform. So far I have created a Hello World application as described in their tutorial, but it does not run. When I run it, it waits at the blinky Android screen, then finally moves to the screen where it says Android in a fancy font and its kind of glossy and silver but never moves from there. What have I done wrong? Thank you.</p>","245967","","","","","2010-01-07 23:07:55","Nooby Android Developer","<android><eclipse><sdk><emulator>","2","3","","",""
"2024371","1","2024874","","2010-01-07 23:06:21","1","2010","<p>All,I'm coding an app that works with the current status of the Android Media Player, basically, I'm trying to find a way to obtain, for example, the current track information or the track next on the library/playlist. Thing is, I couldn't find any way to ""connect"" to the app, I read about some services and copying an Android MP file to my project and so on, but I just wanted to check if there's another way such as a content provider.</p><p>Thanks a lot for your attention.</p><p>Let me know if you have any questions, hope I was clear enough.</p>","245998","","","","","2010-01-08 01:24:47","Android Default Media Player Access","<android><media><player>","2","1","","",""
"2024478","1","","","2010-01-07 23:29:53","0","721","<p>hii all :Di'm dying to see the source code for the voice enabled-keyboard feature for android :\i'm new to open source developing yet i'm very interested in this application particularlycan someone tell me where to find the code ... please :)Thanx in advance ...</p>","","user246011","","","","2010-01-07 23:43:25","voice enabled-keyboard","<android><keyboard><voice>","2","0","","",""
"2024821","1","","","2010-01-08 01:05:34","1","886","<p>In the Android emulator, a long keypress on the ""keyboard"" will pop up a selection of variants on that letter to choose from.  A long keypress on the same key in the soft keyboard displayed on the device itself (still in the emulator here) will also pop up a selection of variants on that letter to choose from.  But the two lists are different -- for example, long keypress on ""a"" gives nine options when pressing the keyboard, and seven options when pressing the IME key.  (The a+ogonek and a+macron are missing.)</p><p>I assume the keyboard in the emulator allows the developer to simulate things going through keyboard event handling and the keys displayed on the device's screen allows the developer to simulate things going through the IME instead, but does anyone know why the variants displayed are different?</p>","246061","","","","","2010-01-08 01:05:34","Different accented characters available to keyboard vs. Latin IME?","<android><android-emulator>","0","0","","",""
"2025282","1","2025541","","2010-01-08 03:23:46","1658","377032","<p>Can anyone explain the differences between the <code>px</code>, <code>dip</code>, <code>dp</code> and <code>sp</code> units in Android?</p>","235885","","832776","","2013-07-26 19:27:03","2014-03-24 07:17:55","Difference between px, dp, dip and sp in Android?","<android><units-of-measurement>","15","6","748","",""
"2025880","1","","","2010-01-08 06:25:36","0","179","<p>I'm going to be starting on a project building a Google Gadget and a Google Android with similar functionality.</p><p>I've read through a bit of  the documentation, but before I start I thought I'd ask if anyone has any tips they'd like to share to make the job easier.</p><p>I program in lots of different languages, so I don't think it'll be too hard, but are there any traps for the unwary ?</p>","246109","","","","","2010-08-28 01:55:39","Any Tips for Writing a Google Gadget / Google Android App?","<android><google-gadget>","1","0","","",""
"2025903","1","","","2010-01-08 06:32:09","3","1382","<p>Can somebody tell me how to change the pitch of a wave file in Android?</p>","274107","","79061","","2011-01-29 14:58:58","2012-05-20 19:53:13","change the pitch of a wave file in Android?","<android><playback><wave><pitch><audio-processing>","1","2","1","",""
"2025985","1","","","2010-01-08 06:55:40","2","1274","<p>I've got working code that uses the gdata to retrieve feeds from my user's Google Finance portfolios, but I had to use <em>setUserCredentials(username,password)</em>. What I'd like to do is avoid asking the user for their username/password since the Android device already has access to their Google account.</p><p>I believe I should be able to do this with <em>setUserToken(String)</em>, but I can't figure out how to get the appropriate token from Android. I've tried <em>AccountManager.get(context).blockingGetAuthToken()</em> but that's either not the correct call or I'm passing it the wrong arguments.</p><p>Has anyone gotten gdata working with the user's existing Google credentials on the phone?</p><p>Thanks in advance,Lenny</p>","246190","","","","","2011-02-24 22:49:19","com.google.gdata.client.GoogleService.setUserToken(android.accounts.AccountManager.getAuthToken(???))","<java><android><authentication><gdata>","1","3","4","",""
"2026343","1","2026535","","2010-01-08 08:35:31","1","4447","<p>I am creating a android app using LunarLander as a example.Now I need to create a few buttons which are drawn over the view.I do not want them as a seperate layout above or below the view but in the custom view.Is this possible or am I going to have to programmatically show the button images then detect the touch. The buttons I create using new never show on the app. I assume this is because I have overwritten the onDraw and the buttons are never drawn even though I callsuper.onDraw(canvas);</p>","246240","","","","","2010-10-26 12:20:25","android custom view how to draw button on top of the view","<android><view>","3","0","","",""
"2026393","1","2028340","","2010-01-08 08:46:26","4","21373","<p>HI,</p><p>I have a back ground service running.I have a client which interacts with service.</p><p>When the client requests for some operation, the service performs it and it should send the result back to the activity(client).</p><p>I know how to invoke the service methods in activity and using call backs we can achive wat I wan to do. But I am not able to understa the call back mechanism and code example provided in Api demos(remoteservice).</p><p>Can any one give better tutorial on this service call back or any thing which is achievable using simpler mechanism.</p><p>Thanku in advance!</p>","142521","","","","","2014-02-26 04:14:35","Service call backs to activity in android","<android><callback><service>","3","0","4","",""
"2026555","1","2026630","","2010-01-08 09:22:52","1","1499","<p>I have been developing my program on my desktop, and now want to continue to work on my program on my laptop.</p><p>I copied (via SFTP - using filezilla) the folder of the project (in the workspace) to the workspace on my laptop.</p><p>When I open eclipse, it did not show up.</p><p>I am developing for android 1.5.</p><p>I have copied over the android SDK from my desktop (both using 32-bit) and got the plugin for Eclipse. I also pointed Eclipse to the SDK</p><p>I tried to open existing project, but it will not show any projects to open.</p><p>How do I open my project?</p><p>EDIT:""File"" => ""Import"" => ""General"" => ""Existing Projects into workspace"" does not work. THe project is not recognized.<img src=""http://file-hosting.site-hosts.net/Eclipse-Import_error.png"" alt=""IMport existing project does not work""></p>","244418","","174261","","2011-11-03 05:37:24","2013-07-29 19:45:11","Cannot get android project into Eclipse","<android><eclipse><project>","3","1","","",""
"2026824","1","","","2010-01-08 10:12:44","1","1774","<p>I'm putting a formatted single line text (no \n's) to a noneditable TextView. In the navigation of the program, the text can be changed. On some text, the TextView shrinks to 0x0 pixel and I can see nothing! I added some menus to truncate the text 10 characters each time and I found that if the number of characters are larger than 4470, the TextView shrinks.</p><p>Splitting the text into several lines by putting \n in between solves the problem, but that's not my intention.</p><p>Could you help me find if this is documented, or is there anything that can be set to remove this limitation?</p>","11238","","","","","2010-01-08 10:12:44","Maximum line length on Android TextView","<android><textview><paint>","0","1","1","",""
"2026873","1","2027286","","2010-01-08 10:24:10","4","18015","<p>Is there a way to appear bordered text on the TextView ?</p>","227889","","777408","","2012-07-24 17:19:36","2012-07-24 17:19:36","Android - Way to appear bordered text on the TextView?","<android><gui><custom-controls><border>","2","2","9","",""
"2027066","1","","","2010-01-08 11:00:19","2","8550","<p>i need to have an mapview on a tab.The <a href=""http://www24.zippyshare.com/v/37272515/file.html"" rel=""nofollow"">attached example</a> shows how to do this if using intents.Now i want to change the zoom level of the mapview(s).How can i do this, although i'm using intents (or is there completelydifferent solution)?</p><p>Activity code:  </p><pre><code>public class TabMapsExample extends TabActivity {        TabHost mTabHost;            @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);          Context ctx = this.getApplicationContext();                 //tab 1        mTabHost = getTabHost();        TabSpec tabSpec1 = mTabHost.newTabSpec(""tab_test1"");        tabSpec1.setIndicator(""Map1"");        Intent i1 = new Intent(ctx, MapTabView.class);        tabSpec1.setContent(i1);        mTabHost.addTab(tabSpec1);                  //tab2        mTabHost = getTabHost();        TabSpec tabSpec2 = mTabHost.newTabSpec(""tab_test1"");        tabSpec2.setIndicator(""Map2"");        Intent i2 = new Intent(ctx, MapTabView.class);        tabSpec2.setContent(i2);        mTabHost.addTab(tabSpec2);                  //tab 3        mTabHost = getTabHost();        TabSpec tabSpec3 = mTabHost.newTabSpec(""tab_test1"");        tabSpec3.setIndicator(""Map"");        Intent i3 = new Intent(ctx, MapTabView.class);        tabSpec3.setContent(i3);        mTabHost.addTab(tabSpec3);        }}</code></pre><p>Layout code:  </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/maptablayout"" android:orientation=""vertical""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_height=""fill_parent"" android:layout_width=""fill_parent""        android:background=""#000000"" android:orientation=""vertical""&gt;        &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""fill_parent"" android:layout_height=""50px""            android:id=""@+id/textview"" /&gt;        &lt;com.google.android.maps.MapView            android:id=""@+id/mapview"" android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" android:clickable=""true""            android:apiKey="""" /&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>thx</p>","245625","","67407","","2010-01-08 12:09:39","2010-05-17 08:00:59","Android MapView + Tab example","<android><gui><tabs><android-mapview>","3","1","0","",""
"2027328","1","","","2010-01-08 11:51:13","1","123","<p>I have an android app which i have written, which exhibits some strange behaviour. </p><p>When i have an app open, say with three acitivties in the stack</p><p>A - B - C</p><p>where a is the entry point and C is the currently viewed activity, if i press the home button and reselect the icon for my app sometimes i see A, which on pressing the back button i can see the task now contains the activities </p><p>A - B  - C - A</p><p>and sometime it just reopens the app in the last state</p><p>A - B - C</p><p>which is what i want to happen. Could anyone inform me of why the inconsitant behaviour is happening. On both cases i press the icon strait after exiting the app via the home key. </p><h1>Thanks for any help!</h1><p>ps i have also asked this question on anddev <a href=""http://www.anddev.org/viewtopic.php?p=32699#32699"" rel=""nofollow"">here</a></p>","236743","","236743","","2010-01-08 12:24:39","2012-12-05 09:19:39","Android icon sometimes open new app sometimes brings up old app, help!","<java><android>","1","0","0","",""
"2027515","1","2028303","","2010-01-08 12:28:17","0","676","<p>In my application, I have 2 list activities which can start one or the other by clicking on their items. </p><pre><code>|--Activity1--|           |--Activity2--|           |--Activity1--||   item11    | -&gt;click-&gt; |   item21    |           |   item21    | -&gt;click-&gt; ...|   item12    |           |   item22    | -&gt;click-&gt; |   item12    | |   item13    |           |   item23    |           |   item13    ||-------------|           |-------------|           |-------------|</code></pre><p>So if the user clicks too much, he can fill all the stack and the system will throw a <code>StackOverFlowException</code> won't it ?</p><p>The solution I chose then was to tag these 2 activities with <code>noHistory=""true""</code>, but now I regret that the user can't navigate between these 2 activities with the back button.</p><p>Can someone help me to find a better alternative ?</p><p>Thanks in advance</p><blockquote>  <p><strong>EDIT: to be more comprehensive, let's explain what is this activity workflow goal :</strong></p></blockquote><p>I have a database which store a list of names linked to a list of days in a year. A name can be linked to multiple days, and same thing a day can be linked to multiple names.</p><pre><code>the database schema |  names  |---&lt; n, m &gt;---|  days  |</code></pre><p><strong>So this activity workflow is a kind of database navigator :</strong></p><ul><li><code>Activity1</code> is the <code>NameListActivity</code>, it displays a list of names linked to a specific day.  </li><li><code>Activity2</code> is the <code>DateListActivity</code>, it displays a list of days linked to a specific name.</li></ul><p>When user clicks on an item (a <em>name</em>) of the <code>NameListActivity</code>, the <code>DateListActivity</code> is started with the list of days linked to the clicked name.<br>And same thing, when user click on an item (a <em>day</em>) of the <code>DateListActivity</code>, the <code>NameListActivity</code> is started with the list af names linked to the clicked day.</p>","231417","","26334","","2010-01-08 18:03:21","2010-01-08 22:08:36","Dilemna : prevent StackOverflowException or improve user experience?","<android><workflow-activity>","7","1","1","",""
"2027725","1","2028125","","2010-01-08 13:11:10","1","973","<p>Can anyone give me a tip for how to get the position of a view what is a child of an AbsoluteLayout? I want to do this for drag and drop the selected view.</p><p>Thank you!</p>","217360","","","","","2010-01-08 16:49:23","How can I get the position of a view in an AbsoluteLayout?","<android>","2","0","","",""
"2027771","1","2027786","","2010-01-08 13:18:41","59","34578","<p>I'm developing my first Android application, and I'd like to create a settings screen. </p><p>I'd like the screen to have a similar look-and-feel as the native phone-settings screens and the native ""create/edit alarm"" screen. Thus with different kinds of (statically defined) items vertically stacked with a thin line between them.</p><p>How do I define such screen? </p><p>I understand I can use the ListView, but this seems to be primarily meant for serving dynamic data using a ListAdapter, where each item is served in the same format. It seems to be possible to create different items (that is, some with checkbox, some with two text-lines, some with an icon) by creating my own ListAdapter and overriding getView but this seems like overkill. Should I be using a ListView for this purpose?</p>","181894","","63550","","2012-07-08 20:04:06","2012-07-08 20:04:06","Using a ListView to create a settings screen in Android?","<android><listview>","3","0","35","",""
"2028697","1","2029128","","2010-01-08 15:46:56","35","39048","<p>Coming from the .NET-environment Im am now looking to understand how Dialogs work in Android.</p><p>In .NET, when calling <i>MessageBox.Show(...) </i> that creates and shows a popup dialog. In the call to Show I can specify what buttons should be available in the popup, for example:</p><pre><code>DialogResult myDialogResult = MessageBox.Show(""My text here"", ""My caption here"", MessageBoxButtons.YesNoCancel);</code></pre><p>As you can see, the call to Show returns a DialogResult when a button is pressed in the popup, informing me what button was clicked. Note that in .NET, execution is halted at the line where the call to <i>Show(...)</i> is made, so it can return the value when a button is pressed.</p><p>If I in the above example press ""No"" the myDialogResult will be equal to </p><pre><code>myDialogResult == DialogResult.No</code></pre><p>Since I find the .NET-way of using/creating popups very easy and intuitive, I would like that way of creating popups in Android too. </p><p>So, the question is if anyone know how to ""halt execution"" like with the MessageBox.Show, and then return a value whenever the Button is pressed (and the dialog goes away)?</p><p>Regards</p><hr><p><b>EDIT 1:</b>To be a little bit more clear:</p><p>I need for the execution to halt and wait until the user has chosen a button to click in the popup. The code that follow the call to show the Dialog is dependent on what button is clicked in the Dialog.</p><p>Thats why I cannot use what Erich and Alex suggest, since writing code in the onClick-methods as suggested below is not gonna work. The reason is that I cannot continue the ""normal execution"". Let me take an example:</p><p>Let me take an example:</p><pre><code>int nextStep = 0; // this variable will not be reached from within the onClick-methodsAlertDialog.Builder builder = new AlertDialog.Builder(this);builder.setMessage(""Hello!"")       .setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int id) {                nextStep = 1; // *** COMPILER ERROR!! ***            }        })        .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int id) {                nextStep = 2; // *** COMPILER ERROR!! ***            }        })        .create().show();if (nextStep == 1){    // then do some damage}else if (nextStep == 2    // dont do damage</code></pre><p>If I wanted the execution to be dependent on the choice in the popup, I would somehow have to make all the variables in the ""normal execution"" (in this case <i>nextStep</i>) available in the onClick-methods, and that sounds like hell to me.</p><p><b>EDIT 2</b>:</p><p>Another obvious example would be a popup asking <i>""Do you want to continue""</i> with the options <i>""Yes""</i> and <i>""No""</i>.</p><p>If the user presses ""Yes"", the whole method should be aborted otherwise it should continue execution. How do you solve that nicely?</p><p>Regards</p>","178143","","178143","","2010-01-08 16:27:54","2014-04-16 11:54:12","Dialogs / AlertDialogs: How to ""block execution"" while dialog is up (.NET-style)","<android>","19","2","10","",""
"2029041","1","2029354","","2010-01-08 16:33:12","3","1635","<p>I'm looking at AndroidManifest files and I see entries for <code>android:backupAgent</code> and according to the Documentation <code>android:backupAgent</code> is</p><blockquote>  <p>The name of the class implementing BackupAgent to manage backup and restore of the application's settings to external storage.</p></blockquote><p>But I can't find a <code>BackupAgent</code> interface or any other documentation.  Can someone point me in the right direction?</p>","236136","","810368","","2012-10-29 08:32:58","2012-10-29 08:32:58","How does a BackupAgent work?","<android><android-manifest><android-backup-service>","2","0","2","",""
"2029269","1","2069587","","2010-01-08 17:13:50","2","389","<p>I've got a small issue which I was hoping someone could give me some insight on.</p><p>Sometimes, when a user updates my app from the market (from one version to another) they get a VerifyError upon running the app.  It happens to a random class; you can use part of the app, then going to a different Activity in the app causes it to blow up.  This only happens once; once Dalvik gets it out of its system it never happens again.</p><p>Since it only happens once per update (and most of the time, not at all), it is admittedly a minor issue, but I think it reflects badly on my app, so if anyone has any ideas that would be great.</p><p>The stack traces don't seem that helpful, since they always happen in a different place (which further confuses me).  Here's an example of one:</p><pre><code>java.lang.VerifyError: com.mypackage.myapp.package.SomeClass    at java.lang.Class.newInstanceImpl(Native Method)    at java.lang.Class.newInstance(Class.java:1472)    at android.app.Instrumentation.newActivity(Instrumentation.java:1097)    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2255)    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2371)    at android.app.ActivityThread.access$1800(ActivityThread.java:118)    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1759)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:123)    at android.app.ActivityThread.main(ActivityThread.java:4077)    at java.lang.reflect.Method.invokeNative(Native Method)    at java.lang.reflect.Method.invoke(Method.java:521)    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)    at dalvik.system.NativeStart.main(Native Method)</code></pre>","60261","","","","","2010-01-15 04:48:19","VerifyError in App After Upgrade","<android>","1","1","","",""
"2029299","1","2029327","","2010-01-08 17:19:01","0","2176","<p>I have a little problem with a ScrollView.</p><p>I have a layout for an activity which is made with a ScrollView. This scrollview contains two ListViews.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>    </p><pre><code>    &lt;ListView android:id=""@+id/accountsListView""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:scrollbars=""none"" /&gt;    &lt;ListView android:id=""@+id/cardsListView""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:scrollbars=""none"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>In onCreate method of my activity I compute ListViews height according there contents.</p><p>During execution, on activity launch, ScrollView is already scrolled a bit.</p><p>So I tried, at the end of onCreate to call method scrollTo(0, 0), but it does not change anything.</p><p>Any idea ?</p><p>Regards,Quentin</p>","60292","","","","","2010-01-08 17:30:01","How to scroll programatically a ScrollView?","<android>","1","0","","",""
"2029464","1","2053549","","2010-01-08 17:40:38","0","2477","<p>I'm attempting to create a list view in Android that shows clickable items that wrap horizontally much like the ""To"" field in the OS X and iPhone's Mail programs. They have a horizontal list of names that wrap vertically and each name is a separate object, the list is not just a single string. My questions are:</p><ol><li><p>Is there a way to do this with a ListView or some other type of AdapterView? Everything I've seen and experimented with is either horizontal scrolling or vertically stacking, but not horizontal wrapping.</p></li><li><p>Are you aware of an existing app with available source that has a view like this that I could look at as an example? The Google Mail/SMS apps just has a single string in the too field that isn't clickable. </p></li></ol>","9574","","","","","2011-08-23 20:29:11","How to create a wrapping horizontal list","<android>","3","0","","",""
"2029506","1","2029568","","2010-01-08 17:46:01","1","505","<p>I want to dynamically hide/show controls in an activity based on a button touch event. When the user presses the ""details"" button I want to show more controls in the same activity. What is the best way to handle this? Is there a way to do TextView.Hide()? Can it animate the transition.</p><p>Thanks</p>","246589","","","","","2010-01-08 17:56:22","How do you do your dynamic layouts?","<android>","1","0","","",""
"2029719","1","","","2010-01-08 18:20:44","10","15047","<p>We have in our project a keyboard with ""Key"" elements, this Key elements have attributes such as android:codes=""119"", android:keyLabel=""w"" and so on.</p><p>My question is how can I include an custom attribute like a ""android:alternativeKeyLabel"" to do something else.</p>","244218","","","","","2012-06-28 17:07:43","How can I create my custom properties on xml for Android?","<java><android>","4","0","7","",""
"2030333","1","","","2010-01-08 19:58:51","0","2140","<p>Basic description of what I'm trying to do:Load up a background image, paint some text into a new bitmap layer, position that text over the background image where I want it to show up, then save the background image with the new layer on top of it where I had positioned it.</p><p>Problem:The problem I'm having is that when I paint the text over the background image it ends up in the wrong x/y position.</p><p>For example:1. I load in a 640x480 image with the ScaleType set to Fit_Start (which shrinks it to 1/2 the size).  I'm keeping track of the ratio and using it when painting the text to the final image.</p><ol><li><p>Then I create a blank overlay bitmap, paint some text onto it, trim the extra transparent space off, and place it into another imageview (ScaleType of Matrix)</p></li><li><p>Then I position that new imageview using my mouse and the onTouchEvent method.  I keep track of the X and Y:</p><p>float X = event.getX();</p><p>float Y = event.getY() - 50; // Title bar, status bar</p><p>overlayView.layout((int)X, (int)Y, overlay.getWidth() + (int)X, overlay.getHeight() + (int)Y);</p></li><li><p>Then I attempt to write the text to the final image (background image) using the X &amp; Y except that I double the X &amp; Y since I know that the image was shrunk in half to fit the screen.</p></li><li><p>Final result is the text being written to the wrong location.  It ends up being slightly too much X and not enough Y (like 25+ depending on the background image scale -- this varies).</p></li></ol><p>Somewhere my math is wrong or I'm forgetting to add something into the formula for calculating the correct position on the background where the text should be painted to.  I've been working on this for quite a few hours and haven't been able to pin-pointed the problem.</p><p>The last thing I tried was to take into account the title bar and status bar, which on the simulator takes up like 50 pixels.  So, I'm subtracting that from Y, which is done when dragging.  But that still doesn't correct Y being off different amounts depending on the background image dimensions.</p><p>Anyone have any ideas on what I'm doing wrong?</p>","237912","","","","","2012-03-08 01:15:55","Adding overlay image at drag position on a final bitmap - Android","<android>","1","0","","",""
"2030431","1","2030486","","2010-01-08 20:14:13","0","342","<p>Some of the analytics packages (for instance, <a href=""http://flurry.com"" rel=""nofollow"">Flurry</a>) will listen for <a href=""http://developer.android.com/reference/java/lang/Exception.html"" rel=""nofollow"">Exception</a>s and log them w/o actually catching them. How are they doing this?</p>","76835","","","","","2010-01-08 20:23:26","How to listen for Exceptions in Android?","<android><exception>","2","0","1","",""
"2030487","1","2532319","","2010-01-08 20:23:31","7","6371","<p>I'm trying to play a playlist I get using the MediaStore provider. However, when I try playing a playlist nothing happens. Can a MediaPlayer play a playlist (m3u file) and do I need to set the first track to play ?</p><p>This is my test code in the onCreate() method:</p><pre><code>        Uri uri = MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI;    if(uri == null) {        Log.e(""Uri = null"");    }    String[] projection = new String[] { MediaStore.Audio.Playlists._ID, MediaStore.Audio.Playlists.NAME, MediaStore.Audio.Playlists.DATA };    Cursor c = managedQuery(uri, projection, null, null, null);    if(c == null) {        Toast.makeText(getApplicationContext(), R.string.alarm_tone_picker_error, Toast.LENGTH_LONG).show();        return;    }    if(!c.moveToFirst()) {        c.close();        Toast.makeText(getApplicationContext(), R.string.alarm_tone_picker_no_music, Toast.LENGTH_LONG).show();        return;    }    c.moveToFirst();    try {        MediaPlayer player = new MediaPlayer();        player.setDataSource(c.getString(2));        player.start();    } catch(Exception e) {        e.printStackTrace();    }</code></pre><p>I have turned on every volume stream.</p><p>Thanks you,</p><p>Kaloer</p>","236130","","","","","2011-02-24 02:49:39","Play playlist with MediaPlayer","<android>","1","0","3","",""
"2030536","1","","","2010-01-08 20:32:51","3","1105","<p>Do I need google developer Phone to be an android developer?  If I purchase a phone from Rogers with Android OS, is that ok for me to write applications and try it out?  Let me know what is the best practice?</p><p>Thanks</p><p>Naeem</p>","246709","","127404","","2010-01-08 20:35:01","2010-02-28 10:40:40","Google Developer Phone","<android><phone>","3","0","","",""
"2030638","1","","","2010-01-08 20:50:12","0","413","<p>What is wrong with piece of code?</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {</code></pre><p>Eclipse states that @override cant be where it is.It says that 'Bundle' is wrong.  I am lost. </p>","236414","","76835","","2010-01-08 22:01:50","2010-01-08 23:20:21","Why won't @override work?","<android><eclipse><code-generation><override><annotations>","5","10","","",""
"2030985","1","2031914","","2010-01-08 21:47:20","0","997","<p>Hey,Ive been trying to find some way in JAVA-code to determine if the device has ""Mobile network"" enabled in Settings. </p><p>I have been looking around, but havent found the answer yet and since I know that StackOverflow is a great place, here I am =)</p><p>So, any tips on how to get it?</p>","178143","","","","","2010-01-09 01:15:08","Get device settings to see if ""Mobile Network"" is On or off?","<android>","1","3","","",""
"2031039","1","2031442","","2010-01-08 21:58:29","1","316","<p>I need to create 3 things:  </p><ul><li>Content Provider  </li><li>Service</li><li>Application</li></ul><p>I'm wondering if these all three will be in one single project, or they will be three different projects?</p><p>Also how can I limit my Content Provider to my services and my applications?</p><p>Regards,<br>Pentium10</p>","243782","","","","","2010-01-09 15:29:54","Content Provider is part of my application?","<android><service><activity><android-contentprovider>","2","1","2","",""
"2031070","1","2076134","","2010-01-08 22:03:42","21","8128","<p>It seems like every step I take in the Android world I run into problems. Im soon up to 20 questions here on StackOverflow hehe =)</p><p>Usually, I have my HTC Hero connected to the computer via USB and I launch the application either in debug mode or in normal mode.</p><p>So, the last time I ran the app in normal mode. Then I disconnect the device (I want to try to have it ""free"", not connected to computer) and I start the app from the menu. When I do that I get a popup saying ""Application xxx is waiting for the debugger to attach"" and there it stops and eventually dies.</p><p>Why is it waiting for the debugger, when the last time I ran the app (while connected) I didnt run it as Debug?</p><p>Regards</p><hr><p>EDIT 1:I might add this little weird fact:</p><p>If I do ""Run"" (green/white arrow) when the device is connected I STILl get a popup on the device saying ""Application xxx is waiting for the debugger to attach""...</p><hr><p>EDIT 2:Found <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg49749.html"">this</a> page. He restared his device and that worked for me too. Stupid not to try that right away...</p>","178143","","178143","","2010-01-08 22:40:56","2013-09-17 16:34:12","Why is the app waiting for the debugger when its not connected to computer?","<android>","5","0","2","",""
"2031336","1","2031415","","2010-01-08 22:48:29","0","765","<p>The last image button is not being rendered (in fact I see an error which quickly disappears to show the rest of my view minus the last imagebutton.</p><p>My activity layout looks like this:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;     &lt;ScrollView android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:background=""#FFFFFF""&gt;      &lt;TableLayout android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:layout_gravity=""top"" android:stretchColumns=""1, 2""&gt;       &lt;TableRow&gt;           &lt;ImageButton android:background=""#ffffff"" android:src=""@drawable/gettingstarted_cover"" android:paddingTop=""10px"" android:paddingLeft=""8px"" android:paddingBottom=""10px"" android:layout_gravity=""center_vertical|left""/&gt;           &lt;TextView android:text=""@string/book_title1"" android:textColor=""#000000"" android:paddingTop=""10px"" android:paddingLeft=""8px"" android:layout_gravity=""center_vertical|center_horizontal""/&gt;           &lt;ImageButton android:src=""@drawable/icon_i_page"" android:background=""#ffffff"" android:layout_gravity=""center_vertical|right"" android:paddingRight=""8px""/&gt;          &lt;/TableRow&gt;          &lt;View android:layout_height=""1px"" android:background=""#CCCCCC"" /&gt;          &lt;TableRow&gt;           &lt;ImageButton android:background=""#ffffff"" android:src=""@drawable/underthedome_cover"" android:paddingTop=""10px"" android:paddingLeft=""8px"" android:paddingBottom=""10px"" android:layout_gravity=""center_vertical|left"" /&gt;           &lt;TextView android:text=""@string/book_title2"" android:textColor=""#000000"" android:paddingTop=""10px"" android:paddingLeft=""8px"" android:layout_gravity=""center_vertical|center_horizontal"" /&gt;           &lt;ImageButton android:src=""@drawable/icon_i_page"" android:background=""#ffffff"" android:layout_gravity=""center_vertical|right"" android:paddingRight=""8px""/&gt;          &lt;/TableRow&gt;          &lt;View android:layout_height=""1px"" android:background=""#CCCCCC"" /&gt;         &lt;/TableLayout&gt;     &lt;/ScrollView&gt;     &lt;ImageButton android:src=""@drawable/free"" android:background=""#ffffff"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:paddingTop=""10px""/&gt;    &lt;/LinearLayout&gt;</code></pre><p>Tried to debug this in Eclipse but didn't find the cause.</p>","246793","","398248","","2011-08-11 18:44:52","2011-08-11 18:44:52","Disappearing imagebutton in my layout - why?","<android><layout>","1","0","","",""
"2031830","1","2031874","","2010-01-09 00:51:34","0","1789","<p>I'm trying to set up a large number OnClickListeners through a for loop. Each view should run a method when clicked; view 0 should run the method with the value 0, view 1 with the value 1, etc. However, if I declare the OnClickListener using a variable which increments through the for loops, the OnClickListener remembers the reference to the variable rather than the value of the variable at the time it was declared.</p><p>That's probably not very clear - here's the code:</p><pre><code>for (int i = 0; i &lt; 20; i++) {    cells[i] = (ImageView) findViewById(cellIDs[i]);    cells[cellnumber++].setOnClickListener(new OnClickListener() {    public void onClick(View v){          cellClicked(cellnumber, v);       }    });}</code></pre><p>That correctly sets up the OnClickListeners for each cell, but whichever one is clicked, it always runs calls cellClicked with value of 21. I know I can manually set up the OnClickListeners using cell[0] ... cellClicked(0, v), but is a way to do it so that the ClickListener is passed the value of the variable rather than a reference to the variable in the for loop?</p><p>(I saw a few pages which said that Java normally operates with passing values and not references, but I assume the Android libraries somehow do it differently and hence my difficulties here.)</p><p>Thanks for your help!Steve</p><p>PS: Sorry if this question goes up twice; the page appeared to freeze the first time I tried posting.</p>","235654","","234938","","2010-01-09 01:01:34","2010-01-09 01:10:16","Passing a variable's value not reference in an OnClickListener()","<java><android>","2","0","","",""
"2031850","1","2031996","","2010-01-09 00:56:01","1","2771","<p>After following some instructions on <a href=""http://dtmilano.blogspot.com/2008/11/android-testing-on-android-platform.html"" rel=""nofollow"">Diego Torres blog</a> I am able to test my classes using the regular Eclipse JUnit test-runner, however I also want to be able to run my unit tests from within the emulated android environment. </p><p>For now this should make no real difference since the classes I am working on do very basic numerical or networking tasks, but obviously anything which involves the UI or Android API specific functions can only ever be tested on the emulator. </p><p>I set up a new run configuration of type AndroidJUnitTest wich uses the android.test.InstrumentationTestRunner, however whenever I fire up the test I get the following error in the console:</p><pre><code>[2010-01-09 00:45:23 - Pal1]Uploading Pal1.apk onto device 'emulator-5556'[2010-01-09 00:45:23 - Pal1]Installing Pal1.apk...[2010-01-09 00:45:25 - Pal1]Success![2010-01-09 00:45:25 - Pal1]Launching instrumentation android.test.InstrumentationTestRunner on device emulator-5556[2010-01-09 00:45:27 - Pal1]Test run failed: Unable to instantiate instrumentation ComponentInfo{org.stodge.traderpal/android.test.InstrumentationTestRunner}: java.lang.ClassNotFoundException: android.test.InstrumentationTestRunner in loader dalvik.system.PathClassLoader@43598c28</code></pre><p>As you might expect, the test ends (without actually having run any tests after the final ""Unable to instantiate instrumentation ComponentInfo"" message.</p><p>For now my test-cases consist of nothing more than Junit3 and Junit4 boiler-plater code. The  implementations of the tests consist of nothing more than fail() calls. All I need to do at this stage is show that I can execute a basic unit-test in both environments so that I can begin test-driven development.</p><p>Notes: - Running Eclipse 3.5 on Ubuntu 64bit - Emulator is set to API level 2 - I'm new to both Android and Java, so excuse my basic questions</p>","46411","","","","","2010-01-09 01:48:53","Why does this error occur when I try to run a Junit test-case on the Android emulator?","<java><android><eclipse>","1","2","1","",""
"2031856","1","","","2010-01-09 00:57:31","0","849","<p>The code comes from ""Hello Android""  Page47.  I am using 1.6 since that is what the book is written for.</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.content.Intent;import android.view.View;import android.view.View.OnClickListener;    /** Called when the activity is first created. */e1  @Overridee2  public void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState),    setContentView(R.layout.main),    // Set up click listeners for all the buttons</code></pre><p>error message  e1the annotation @override is dissallowed for this location</p><p>error message  e2Multiple markers at this line    - Syntax error on token(s), misplaced      construct(s)    - Syntax error on token ""void"", @ expected    - Syntax error on token "")"", = expected</p><p>I have no idea whats wrong.  The code is identical to the code in the book.  I'm sure.  TIA</p>","236414","","90848","","2010-01-09 01:07:39","2010-01-09 01:16:06","code errors copying from a book","<java><android><code-generation>","2","5","","",""
"2031947","1","","","2010-01-09 01:29:05","2","1140","<p>So I'm developing an app for android, and before I get too much into it, I want to conceptually get my arms around what I am trying to do. Is it very difficult to calculate or track the most frequently accessed apps? Any ideas or insights about how I might go about getting this done would be greatly appreciated! I'm used to iphone development, and am quite new to the android platform. Thanks </p>","246867","","","","","2010-01-09 05:29:46","how to calculate the most used apps-android","<java><android>","2","0","2","",""
"2032007","1","2032040","","2010-01-09 01:51:48","3","10031","<p>Hey, im trying to override the method <i>onConfigurationChanged</i> and I get the error:</p><p><i>The method onConfigurationChanged(Configuration) of type BaseActivity must override or implement a supertype method</i></p><p>Here is my BaseActivity.java:</p><pre><code>import android.app.Activity;import android.content.Intent;import android.view.View;import android.view.View.OnClickListener;public class BaseActivity extends Activity {    protected View.OnClickListener mButtonListenerUPP;    protected View.OnClickListener mButtonListenerALT;    protected View.OnClickListener mButtonListenerNAV;    protected View.OnClickListener mButtonListenerHIS;    @Override    public void setContentView(int layoutResID)     {        super.setContentView(layoutResID);    }    @Override    public void onConfigurationChanged(Configuration newConfig)     {      setContentView(R.layout.main);    }}</code></pre><p>A lot of post out here in the Internet is saying that I can do that... Any ideas?</p>","178143","","","","","2012-05-25 16:26:18","Why cant I override onConfigurationChanged?","<java><android>","4","0","2","",""
"2032045","1","","","2010-01-09 02:02:50","0","1102","<p>I am using Eclipse 3.5 (Galileo), and I'm trying to install ADT plugin from remote as well as local archive.It is  not installing. I am getting the following error for both remote as well local:</p><pre><code>Android Development Tools 0.9.5.v200911191123-20404 (com.android.ide.eclipse.adt.feature.group 0.9.5.v200911191123-20404)Missing requirement: Android Development Tools 0.9.5.v200911191123-20404 (com.android.ide.eclipse.adt.feature.group 0.9.5.v200911191123-20404) requires 'org.eclipse.gef 0.0.0' but it could not be found</code></pre><p>How do I solve this?Thanks in Advance</p>","246877","","1288","","2011-03-04 18:34:04","2011-12-24 05:40:49","ADT installation Error","<android>","3","0","","",""
"2032168","1","","","2010-01-09 02:49:20","5","6214","<p>I have some .png icons that are alpha masks. I need to render them as an drawable image using the Android SDK.</p><p>On the iPhone, I use the following to get this result, converting the ""image"" alpha mask to the 'imageMasked' image using black as a fill:</p><pre><code>CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();CGContextRef context = CGBitmapContextCreate(NULL, thumbWidth,     thumbHeight, 8, 4*thumbWidth, colorSpace, kCGImageAlphaPremultipliedFirst);CGRect frame = CGRectMake(0,0,thumbWidth,thumbHeight);CGContextClipToMask(context, frame, [image CGImage]);CGContextFillRect(context, frame);CGImageRef imageMasked = CGBitmapContextCreateImage(context);CGContextRelease(context);</code></pre><p>How do I accomplish the above in Android SDK?</p><p>I've started to write the following:</p><pre><code>Drawable image = myPngImage;final int width = image.getMinimumWidth();final int height = image.getMinimumHeight();Bitmap imageMasked = Bitmap.createBitmap(width,    height, Config.ARGB_8888);Canvas canvas = new Canvas(iconMasked);image.draw(canvas); ???</code></pre><p>I'm not finding how to do the clipping on imageMasked using image. </p>","246887","","114066","","2012-02-09 09:09:42","2013-01-14 04:30:44","How to clip and fill a canvas using an alpha mask","<android>","1","3","6","",""
"2032173","1","2032237","","2010-01-09 02:53:32","17","13315","<p>Ok, so I read up on how Android handles ""configuration changes"" - by destroying the active Activity.</p><p><b>The first question</b> I really want to know from Android Team - why? I would appreciate an explanation on how the reasoning went, cause I dont get it =)</p><p>In any case, the fact that it acts in that way puts us all, as I see it, in a world of pain. </p><p>Lets assume you have a Activity which presents a number of EditText:s, checkboxes etc. If a User starts to fill that form with text/data and then changes orientation (or get a Phonecall), then all input the User made is gone. I havent found any way to preserve state. That forces us to make extremely painful coding to not loose all data. </p><p>As I see it, you need another ""non-Activity"" class (or <i>""value-holding"" class</i> perhaps) that has one field for each ""form element"" (EditText, checkbox etc). </p><p>For every single ""form element"" that exists, you then need to attach an Event like ""onChanged"" (or onTextChanged or something like that) that updates the corresponding field in the <i>""value-holding"" class</i> to make sure that for every single character you type (in a EditText for example) is saved at once.</p><p>Perhaps you can use some listener (like ""onDestroy"" or something) and then fill the value-holding class with data...</p><p>I have also found <a href=""http://stackoverflow.com/questions/151777/how-do-i-save-an-android-applications-state"">this piece of info</a> where they talk about using Bundle, <i> onSaveInstanceState</i> and <i> onRestoreInstanceState</i>, but that also mean that the programmer has to manually save and then later put back the values in the correct place? This approach is a bit less messier than my suggestions above, but still not very nice...</p><p>Now, can someone please tell me that I am totally wrong and that this is not how it works and that I totally missed some vital information? ;-)</p><p>Regards</p>","178143","","178143","","2010-01-09 02:59:02","2012-09-21 09:06:55","configuration changed (orientation change) and destroying Activities - is this the way its supposed to work?","<android>","4","3","3","",""
"2032262","1","2035861","","2010-01-09 03:36:13","0","571","<p>I can not get the ContextMenuResource to return the correct information that I am looking for.  At times it returns what I want, other times not so much so.</p><p>public class montypython extends Activity implements OnClickListener {    private static final int SAVE_SOUND = 0;</p><pre><code>// Tag to easily locate errors in the log file.private static final String TAG = ""Monty"";// Declares the buttons.Button button0;Button button1;Button button2;Button button3;Button button4;Button button5;Button button6;Button button7;Button button8;Button button9;Button button10;Button button11;Button button12;Button button13;Button button14;Button button15;Button button16;Button button17;Button button18;Button button19;Button button20;Button button21;Button button22;Button button23;Button button24;Button button25;// Makes contextMenuResource available for use in other methods.public int contextMenuResource;// Makes MediaPlayer (mp) null and ready to go.MediaPlayer mp=null;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);// Set Views and Listeners and Tags for buttons.button0=(Button)findViewById(R.id.button0);button0.setOnClickListener(this);button0.setTag(R.raw.a);button1=(Button)findViewById(R.id.button1);button1.setOnClickListener(this);button1.setTag(R.raw.b);button2=(Button)findViewById(R.id.button2);button2.setOnClickListener(this);button2.setTag(R.raw.c);button3=(Button)findViewById(R.id.button3);button3.setOnClickListener(this);button3.setTag(R.raw.d);button4=(Button)findViewById(R.id.button4);button4.setOnClickListener(this);button4.setTag(R.raw.e);button5=(Button)findViewById(R.id.button5);button5.setOnClickListener(this);button5.setTag(R.raw.f);button6=(Button)findViewById(R.id.button6);button6.setOnClickListener(this);button6.setTag(R.raw.g);button7=(Button)findViewById(R.id.button7);button7.setOnClickListener(this);button7.setTag(R.raw.h);button8=(Button)findViewById(R.id.button8);button8.setOnClickListener(this);button8.setTag(R.raw.i);button9=(Button)findViewById(R.id.button9);button9.setOnClickListener(this);button9.setTag(R.raw.j);button10=(Button)findViewById(R.id.button10);button10.setOnClickListener(this);button10.setTag(R.raw.k);button11=(Button)findViewById(R.id.button11);button11.setOnClickListener(this);button11.setTag(R.raw.l);button12=(Button)findViewById(R.id.button12);button12.setOnClickListener(this);button12.setTag(R.raw.m);button13=(Button)findViewById(R.id.button13);button13.setOnClickListener(this);button13.setTag(R.raw.n);button14=(Button)findViewById(R.id.button14);button14.setOnClickListener(this);button14.setTag(R.raw.o);button15=(Button)findViewById(R.id.button15);button15.setOnClickListener(this);button15.setTag(R.raw.p);button16=(Button)findViewById(R.id.button16);button16.setOnClickListener(this);button16.setTag(R.raw.q);button17=(Button)findViewById(R.id.button17);button17.setOnClickListener(this);button17.setTag(R.raw.r);button18=(Button)findViewById(R.id.button18);button18.setOnClickListener(this);button18.setTag(R.raw.s);button19=(Button)findViewById(R.id.button19);button19.setOnClickListener(this);button19.setTag(R.raw.t);button20=(Button)findViewById(R.id.button20);button20.setOnClickListener(this);button20.setTag(R.raw.u);button21=(Button)findViewById(R.id.button21);button21.setOnClickListener(this);button21.setTag(R.raw.v);button22=(Button)findViewById(R.id.button22);button22.setOnClickListener(this);button22.setTag(R.raw.w);button23=(Button)findViewById(R.id.button23);button23.setOnClickListener(this);button23.setTag(R.raw.x);button24=(Button)findViewById(R.id.button24);button24.setOnClickListener(this);button24.setTag(R.raw.y);button25=(Button)findViewById(R.id.button25);button25.setOnClickListener(this);button25.setTag(R.raw.z);// Registering ContextMenu's for long clicks.registerForContextMenu(button0);registerForContextMenu(button1);registerForContextMenu(button2);registerForContextMenu(button3);registerForContextMenu(button4);registerForContextMenu(button5);registerForContextMenu(button6);registerForContextMenu(button7);registerForContextMenu(button8);registerForContextMenu(button9);registerForContextMenu(button10);registerForContextMenu(button11);registerForContextMenu(button12);registerForContextMenu(button13);registerForContextMenu(button14);registerForContextMenu(button15);registerForContextMenu(button16);registerForContextMenu(button17);registerForContextMenu(button18);registerForContextMenu(button19);registerForContextMenu(button20);registerForContextMenu(button21);registerForContextMenu(button22);registerForContextMenu(button23);registerForContextMenu(button24);registerForContextMenu(button25);</code></pre><p>}</p><pre><code>// Using the Tag to allow for simple media playing coding.@Overridepublic void onClick(View vv) {    if (mp !=null) {mp.stop();}    mp=MediaPlayer.create(this, ((Integer)vv.getTag()).intValue());    mp.start();}// Create ContextMenu's.@Overridepublic void onCreateContextMenu(ContextMenu menu, View vv, ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, vv, menuInfo);    contextMenuResource = ((((Integer) (vv.getTag())).intValue()));    menu.setHeaderTitle(((Button)vv).getText());    // contextMenuResource used here just to see what value it contains    // when called it shows /res/raw/*.mp3 depending on which button    menu.add(0, SAVE_SOUND, 0, contextMenuResource);}public boolean onContextItemSelected(MenuItem item) {    switch(item.getItemId()) {        case SAVE_SOUND:    AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);    // contextMenuResource used here just to see what value it contains    // when called it shows at least a seven digit integer (which makes sense to me)    dialogBuilder.setMessage(""You selected "" + contextMenuResource);    dialogBuilder.setCancelable(true);    dialogBuilder.create().show();    // Creates a directory on the SDCard         File sddir = new File(""/sdcard/NetApex/Ringtones"");        if (!sddir.mkdirs()) {            Log.e(TAG, ""Create dir on sdcard failed"");              return false;            }       // The rest is commented out since I can't get the data I would like in order    // to copy the file to the SDCard    /*  InputStream fIn = getBaseContext().getResources().openRawResource(contextMenuResource);        int size = 0;        size = fIn.available();        byte[] buffer = new byte[size];        fIn.read(buffer);        fIn.close();        File rtNew = new File(""/sdcard/NetApex/Ringtones""        + contextMenuResource        +"".mp3"");        FileOutputStream rtFOS = null;        rtFOS = new FileOutputStream(rtNew);        rtFOS.write(buffer);        rtFOS.flush();        rtFOS.close();  */        return true;      }    return false;      }// Options menu created just to see it created@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.layout.menu, menu);    return true;}// This makes the selection work@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch(item.getItemId()) {    case R.id.quit:        finish();        return true;    }    return false;}</code></pre><p>}</p>","246892","","","","","2010-01-10 02:37:07","Android coding question - contextMenuResource","<android>","2","0","","",""
"2032304","1","2033469","","2010-01-09 04:08:48","19","47491","<p>I've created a layout with an image view and a web view. The web view is set to have a default visibility of gone. When the activity fires up it displays the image view first and when the web view has finished loading its url, it marks itself as visible and the imageview is marked as hidden.</p><p>When the imageview is shown, I would like it to rotate repeatedly just for a little added pizazz. </p><p>I have never done animations before in Android and all the posts I found when I asked the internet were not helpful; thus, I have returned to SO for help. </p><p>So if I start with this...</p><pre><code>    final ImageView splash = (ImageView)findViewById(R.id.splash);</code></pre><p>How do I create a repeated rotate animation and apply it to the ImageView?</p><p>Thanks again!</p>","88847","","267269","","2010-04-20 14:45:42","2013-09-19 06:31:48","Android ImageView Animation","<android><android-animation>","7","0","17","",""
"2032335","1","","","2010-01-09 04:24:30","1","2073","<p>In a number of questions (<a href=""http://stackoverflow.com/questions/2013865/header-views-and-buttons-how-do-i-attach-listeners-to-buttons-in-a-header-th"">like this one</a>) I have been looking into how to ""change screens"" in my app. I have a ""header"" on top, with 4 buttons. Each button is meant to replace the ""content"" (ie change screen):</p><pre><code>+--------------------+| menu with buttons  |+--------------------+|                    ||                    ||  C O N T E N T     ||                    ||                    |+--------------------+</code></pre><p>When I click a Menu button, I run the following code:</p><pre><code>@Overridepublic void onClick(View v){    Intent myIntent = new Intent(BaseActivity.this, ActivityMain.class);    BaseActivity.this.startActivity(myIntent);}</code></pre><p>As you can see, the <i>startActivity</i> is executed. Now, if I do not specify <i>""launchMode""</i> for the Activity that means that launchMode = normal. If launchMode == normal that means that the Activity will be re-created each and every time I navigate using the top header buttons, and that means that all data entered in ""form elements"" are gone (or at least hidden).</p><p>So, I found the launchMode ""singleTask"" that sounded sort of nice. If I add that launchMode to my Activity, it will not be re-created when I navigate with the buttons, thus keeping state. Great! Well, until I read <a href=""http://developer.android.com/guide/topics/fundamentals.html#acttask"" rel=""nofollow"">this</a>:</p><p><i>As noted above, there's never more than one instance of a ""singleTask"" or ""singleInstance"" activity, so that instance is expected to handle all new intents.</i></p><p>I found out that the sentence mean that <b>there can be only one</b> Activity that has the launchMode set to ""singleTask"" - if I have more than one it wont work (no compiler error though). </p><p><b>This means that I can only ""keep the state"" for one Activity, when switching back and forth (navigating) between my screens!</b></p><p><a href=""http://stackoverflow.com/questions/2032173/configuration-changed-orientation-change-and-destroying-activities-is-this-th"">Once again</a>, is this really how it supposed to work?</p>","178143","","","","","2010-01-09 13:00:25","launchModes, singleTask: how to switch between ""screens""? Is Intents the only way, and if so I think I have a problem","<android>","3","4","","",""
"2032417","1","2032590","","2010-01-09 05:08:48","22","17384","<p>I've been learning to develop in Android and had more of a general question: If I have a layout that uses a list and some other views, should I be using Activity or ListActivity for my activity class?</p><p>I know that ListActivity will probably make things easier to override list-specific events, but is there any other advantage to using a ListActivity over Activity?  What if I wanted to change the layout in the future to a GridView?  Would it be any more/less of a pain to change the class' code?</p><p>I was just curious about ""best practices"" in this regard and what the benefits entail, so any answer would be helpful :)</p><p>Bara</p>","164312","","","","","2013-03-12 05:56:44","Android - Activity vs. ListActivity - Which one should my activity class extend?","<android><activity><listactivity>","2","0","8","",""
"2032422","1","2032454","","2010-01-09 05:10:42","2","4212","<p>I'd like to create a very simple android activity that takes a file path on the sd card and displays the contents of that directory in a listview.</p><p>I know how to get a list of the files via File.listFiles() which returns an Array of File objects.  What I want to know is how I can adapt that array to a ListView.  Would an ArrayAdapter be the right thing to use and how would I do that?</p>","131871","","","","","2012-10-12 10:27:11","Show a list of Files in android?","<android><file><listview><android-arrayadapter>","1","0","","",""
"2032606","1","","","2010-01-09 06:45:39","5","4681","<p>what is the view element which gives effect like a HTML's TextArea? I want to create a form to send Email and for the body field I want to create a textarea type of UI element in the form. </p><p>Can someone suggest what is the way to go for it?</p>","246943","","","","","2010-01-09 06:52:08","what is the alternative of HTML's TextArea in Android","<android>","1","0","","",""
"2032804","1","","","2010-01-09 08:24:14","0","473","<p>I am facing a problem with a stopping thread which is in a synchronized block. I am using TCP socket. The problem is that I am waiting on a <code>DataInputStream</code> object and I want to create a new socket again but it doesn't allow me to do because of the synchronized block.</p><p>I have tried with <code>Thread.interrupted()</code>. I cannot avoid the synchronized block.  Is there any other way to do the same?</p><pre><code>dis = new DataInputStream(ReadWriteData.kkSocket.getInputStream());int i = -1;String aval = """"; //new String();char c = (char)dis.read();</code></pre><p>It is getting blocked on <code>dis.read()</code>.</p><p>What I should do for escaping the <code>dis.read</code> when I want to create a new socket? </p><p>Thanks in advance.</p>","95877","","3171","","2010-01-09 09:08:34","2010-01-09 09:31:15","Thread stopping in synchronized block","<java><android>","3","0","","",""
"2033001","1","2033319","","2010-01-09 10:14:35","3","2012","<p>Logcat output:</p><pre><code>[2010-01-09 15:47:19 - HelloMapView]------------------------------[2010-01-09 15:47:19 - HelloMapView]Android Launch![2010-01-09 15:47:19 - HelloMapView]adb is running normally.[2010-01-09 15:47:19 - HelloMapView]Performing org.example.hellomapview.HelloMapView activity launch[2010-01-09 15:47:19 - HelloMapView]Failed to find an AVD compatible with target 'Google APIs'.[2010-01-09 15:47:21 - HelloMapView]Performing org.example.hellomapview.HelloMapView activity launch[2010-01-09 15:47:22 - HelloMapView]Application already deployed. No need to reinstall.[2010-01-09 15:47:22 - HelloMapView]Starting activity org.example.hellomapview.HelloMapView on device [2010-01-09 15:47:23 - HelloMapView]ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined[2010-01-09 15:47:23 - HelloMapView]ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined[2010-01-09 15:47:23 - HelloMapView]ActivityManager: Starting: Intent { comp={org.example.hellomapview/org.example.hellomapview.HelloMapView} }</code></pre><p>When I run my application it is showing the above error. I am not able to run myMap application I used the same code what they have given in myMap application. Please help me.</p>","1746300","","1777090","","2013-01-07 09:23:14","2013-01-07 09:23:14","Android MapView is not working","<android>","1","2","","",""
"2033046","1","2033450","","2010-01-09 10:32:21","6","3126","<p>We're designing an Android app that has several activities which are working in a wizard like way - user should pass from the activity #1 to activity #5 to get to the final activity (#6).</p><p>Since we know an activity can be suddenly terminated by OS on low memory we used Application class as a static storage for keeping the data the user inputs on ""wizard"" activities and other data our app needs for the whole session.</p><p>Unfortunately we've discovered this approach fails - looks like the Application class instance is also can be killed by OS (this was specifically discovered on Android 1.6 versus 1.5). Are our expectations wrong on this approach (we think Application class instance always lives for the whole app session)?</p><p>So the question is - what is the best practices on Android to keep data between activities deathes/restarts for the whole application session?</p>","247013","","","","","2012-04-30 05:55:22","What is the best practices on Android to keep data between activities deathes/restarts for the whole application session?","<android><session><activity><architecture>","2","0","1","",""
"2033088","1","2033135","","2010-01-09 10:47:10","12","64884","<p>I am creating an application which retrieves images from the web. In case the image cannot be retrieved another local image should be used.</p><p>While trying to execute the following lines:</p><pre><code>Drawable drawable = Common.getDrawableFromUrl(this, product.getMapPath());                if(drawable.equals(null)){                    drawable = getRandomDrawable();                }</code></pre><p>The line if(drawable.equals(null)) throws an exception if drawable is null.</p><p>Does anyone know how should the value of drawable be checked in order not to throw an exception in case it is null and retrieve the local image (execute drawable = getRandomDrawable())?</p>","22996","","","","","2014-02-17 01:51:09","Java: How to check if object is null?","<java><android>","8","2","2","",""
"2033186","1","","","2010-01-09 11:32:32","0","144","<p>When I run my applictaion in an emulator/device, automatically one drawable image other than default image I used, comes for my application as background. How can I avoid it?</p>","217065","","1777090","","2013-01-07 09:26:11","2013-01-07 09:26:11","How can I avoid the change in background image for an application while it runs in emulator/device?","<android>","1","1","","",""
"2033296","1","2034666","","2010-01-09 12:14:19","27","29228","<p>I have had a number of problems with ScrollViews. Recently I tried to create a LinearView which content exceeds the screen size so I created the new layout with parent element ScrollView and set its width and height to custom values (the layout has to appear as dialog - not filling the whole screen). </p><p>When the element is selected the red border appears to embrace the rectangle of predefined ScrollView LayoutWidth and LayoutHeight which is OK. Then I placed inside the LinearView and set the values LayoutWidth and LayoutHeight to fill_parent. </p><p>Then when I started to add the elements into the LinearLayout the border (red lile) wrapped the inserted elements, not the whole parent ScrollView.</p><p>So when the content of the LinearLayout (child of ScrollView) exceeded the size of parent ScrollView the scroll didn't appear and the bottom elements are simply invisible.</p><p>Anyway.. in that case the XML content was too extensive to post the question here and now I'm having the same problem with the more simple example.</p><p>The following part of the layout is intended to be a scrollable EditText (in case the user input exceeds the primary size of the widget). I wanted to set the EditText height to 120px, so I set the parent ScrollView height to 120px and the child EditText to fill_parent. Again in this case the EditText doesn't fill the whole ScrollView area but a single line:</p><pre><code> &lt;ScrollView android:layout_height=""120px"" android:layout_width=""fill_parent""&gt;&lt;EditText android:id=""@+id/txtContent"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:text=""TestContent""&gt;&lt;/EditText&gt;&lt;/ScrollView&gt;</code></pre><p>Does anyone know how to reshape the content above so the EditText fills the parent control and in case the user's input exceeds the control size the scroll appears?</p><p>Thank you!</p><p><strong>Edit:</strong></p><p>Below are the screenshots of the layout</p><p><img src=""http://img691.imageshack.us/img691/6913/scrollviewproblem2.png"" alt=""alt text""><img src=""http://img130.imageshack.us/img130/9631/scrollviewproblem1.png"" alt=""alt text""></p>","22996","","107392","","2014-02-25 19:52:21","2014-02-25 19:52:21","Android: ScrollView Issue","<android><layout><scrollview>","2","0","9","",""
"2033410","1","2057675","","2010-01-09 12:51:50","0","520","<p>I want to make a Drawable touchable for a component I am creating, does anyone know how to do that?</p><pre><code>final Drawable selected = backgroundSelected;selected.setBounds(0, 0, 20, 90);selected.draw(canvas);canvas.save();</code></pre>","174868","","","","","2010-01-13 15:14:35","add TouchListener to Drawable","<android><drawing>","1","2","","",""
"2033818","1","2033841","","2010-01-09 15:20:23","2","14052","<p>I would like to somehow send a file from my app on one android device to my app on another device.  This can be done any which way, and I'm open to suggestions if you can tell me how to send over network or something like that.  </p><p>Currently, I'm looking at sending the file as an email attachment, but I haven't found any good documentation on how to do it.  I need two things to accomplish this, be able to send my file (stored on sd card or somewhere on device) as an attachment, and have my app recognized by android as the app to open an attachment with the file extention (.lst).</p><p>Any thoughts?</p><p>The files will all be fairly small xml text files if that makes a difference.</p>","131871","","","","","2012-01-04 07:04:58","How to send/open email attachments from android app?","<android><email><attachment><file-sharing>","2","0","1","",""
"2033914","1","2034238","","2010-01-09 15:59:46","515","152794","<p>Moving on in my attempt to learn Android, I just <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/1bf0f7a4a9c62edd/a0a4aedf21ae5f76"">read the following</a>:</p><blockquote>  <p>Question: <i>Does the user have a choice to kill the application   unless we put a menu option in to kill it? If no such option exists,   how does the user terminate the application? </i></p>    <p>Answer: (Romain Guy): <i>The user doesn't, the system handles this automatically. That's what the activity lifecycle (especially onPause/onStop/onDestroy) is for. No matter what you do, do not put a ""quit"" or ""exit"" application button. It is useless with Android's application model. This is also contrary to how core applications work. </i></p></blockquote><p>Hehe, for every step I take in the Android world I run into some sort of problem =(</p><p>Apparently, you cannot quit an application in Android (but the Android system can very well totally destroy your app whenever it feels like it). What's up with that? I am starting to think that it's impossible to write an app that functions as a ""normal app"" - that the user can quit the app when he/she decides to do so. That is not something that should be relied upon the OS to do.</p><p>The application I am trying to create is not an application for the Android Market. It is not an application for ""wide use"" by the general public, it is a business app that is going to be used in a very narrow business field.</p><p>I was actually really looking forward to developing for the Android platform, since it addresses a lot of issues that exist in Windows Mobile and .NET. However, the last week has been somewhat of a turnoff for me... I hope I don't have to abandon Android, but it doesn't look very good right now =(</p><p>Is there a way for me to <b>really</b> quit the application?</p>","178143","","128967","","2014-02-24 04:04:26","2014-03-26 10:32:22","Quitting an application - is that frowned upon?","<android>","32","20","322","","2013-04-14 11:31:45"
"2034163","1","","","2010-01-09 17:15:45","7","7183","<p>I'm having trouble getting <code>MediaPlayer</code> to be resilient when streaming from a HTTP URL.</p><p>If I start playing the file, but then drop the connection (e.g. airplane mode), <code>MediaPlayer#OnErrorListener</code> generates <code>what=1, extra=-17</code> and then shortly afterwards <code>what=-38, extra=0</code>. </p><p>There's no documentation I can see in the APIs of what this denotes, except extra is ""Typically implementation dependant"". I'm using a HTC Hero (well, it's T-Mobile UK's G2 Touch).</p><p>Do other people get the same values and is it safe to catch these values as meaning the connection's gone?</p><p>How can I best resume when the connection reappears? (save the current seek to preferences, and retry every 5 seconds?)</p><p>How do I know when the device has decided to start playing what it's been buffering - is there a callback (other than polling <code>isPlaying()</code>)?</p><p>Additionally, I'm not entirely sure what <code>onBufferingUpdate</code> provides. I'm using a 40 minute podcast <code>MP3 (64kbps bitrate)</code> - buffering goes 1%, 2%, 3%. When I seek to about 30 mins in, it shows 75%, then when I seek back to the start back to 5% - what is the point of this callback other than showing approximately what is cached?</p><p>Finally - is there any way to pipe what's streamed to an <code>MP3</code>?</p>","202807","","1098127","","2014-04-03 04:20:01","2014-04-03 04:20:01","Streaming with Android MediaPlayer - catching errors and buffering","<android><streaming><media-player><buffering>","4","1","7","",""
"2034239","1","2034717","","2010-01-09 17:35:51","0","410","<p>So, this HTC site is supposed to have links to update the g1 dev phones (and I've used it before).</p><p><a href=""http://www.htc.com/www/support/android/adp.html"" rel=""nofollow"">http://www.htc.com/www/support/android/adp.html</a></p><p>Now, it seems like the update links are no longer there - Anyone know what's going on, or where I can get 1.6?</p>","247153","","225647","","2012-10-29 20:43:03","2012-10-29 20:43:03","Where'd the Link Go to Upgrade G1 Dev Phone to 1.6","<android>","2","2","","",""
"2034334","1","","","2010-01-09 18:06:19","10","19767","<p>I just recently got an android phone and found that the drag and drop on my site doesn't work! I understand why it wouldn't, but has anyone found a solution to this? I'm using JQuery to implement the D &amp; D...</p>","91748","","102703","","2010-01-27 01:21:24","2014-02-22 16:31:56","enabling drag and drop on a touchscreen mobile device","<jquery><android><browser><mobile><mobile-phones>","6","0","6","",""
"2034348","1","2034566","","2010-01-09 18:10:42","3","6793","<p>I am using an SQLITE database to store latitudes and longitudes of locations.</p><p>I want to be able to sort the results by rough distance from the current location. I already have the current location of the device as a double (lat, lng), the lat and lng in the database are also doubles.</p><p>What I want is a query that will create a virtual column that I am able to sort the results by.</p><p>I currently use a function to show the distance for a selected record:</p><p><code>float pk = (float) (180/3.14159);<br>float a1 = (float) (db_lat / pk);<br>float a2 = (float) (db_lon / pk);<br>float b1 = (float) (current_lat / pk);<br>float b2 = (float) (current_lon / pk);<br>float t1 = FloatMath.cos(a1)*FloatMath.cos(a2)*FloatMath.cos(b1)*FloatMath.cos(b2);<br>float t2 = FloatMath.cos(a1)*FloatMath.sin(a2)*FloatMath.cos(b1)*FloatMath.sin(b2);<br>float t3 = FloatMath.sin(a1)*FloatMath.sin(b1);<br>double tt = Math.acos(t1 + t2 + t3);<br>double dist = (6366000*tt);</code></p><p>For example, a MySQL select could be (taken from: www.movable-type.co.uk):</p><p><code>Select Lat, Lon, acos(sin($lat)*sin(radians(Lat)) + cos($lat)*cos(radians(Lat))<em>cos(radians(Lon)-$lon))</em>$R As distFrom MyTableORDER BY dist DESC</code></p><p>Currently I select locations using the following:</p><p><code>    public Cursor locationGetAllRows(long groupid)     {        try         {            return db.query(LOCATION_DATABASE_TABLE, new String[] {              ""_id"", ""lat"",""lon"",""groupid""},              ""groupid=""+groupid, null, null, null, null);        }         catch (SQLException e)         {            Log.e(""Exception on query: "", e.toString());            return null;        }    }</code></p><p>OK so is it possible to use the SQLITE database in this way? If not the only option I can think of is to have an extra column, iterate through the rows running the above function on each row and filling out an extra column on the row, then sorting on that column?</p>","232565","","","","","2012-09-17 00:48:40","Android sqlite sort on calculated column (co-ordinates distance)","<android><sqlite><coordinates>","4","0","4","",""
"2034822","1","2196281","","2010-01-09 20:28:13","13","8841","<p>I'm building an Android app that takes advantage of OpenGL. As it stands, the background for the <code>GLSurfaceView</code> is dynamically generated by my code and loaded in as a texture and drawn with <code>glDrawTexfOES</code>. Which is ""ok"", but I can simply display the image much more smoothly to its own surface (without OpenGL). Is there any way that I can make the background of a <code>GLSurfaceView</code> transparent? I've heard some rumors that this can be done with <code>setEGLConfigChooser</code>, but I haven't found any confirmation. Ultimately, I'd like to take a surface which I'm drawing to and put the <code>GLSurfaceView</code> over it to achieve a layered effect.</p><p>I know this is a tricky and is quite possibly infeasible, but any input is appreciated. Thanks in advance.</p>","205229","","190309","","2014-03-11 03:19:27","2014-03-11 03:19:27","Android OpenGL ES Transparent Background","<android><opengl-es><background><transparent>","4","1","4","",""
"2034859","1","","","2010-01-09 20:36:38","3","3317","<p>I have a file within my application that I want to have included within the .apk for my android app that is a .txt file.  My application is almost entirely written in C through the use of the NDK, using OpenGL as well.  I know I can bundle the txt file by placing it in /res/raw/, but is there anyway I can access this within the android NDK? </p><p>-Thanks</p>","135135","","","","","2013-12-27 00:48:02","Read txt file in res/raw/ within Android NDK","<android><file-io><android-ndk>","1","2","","",""
"2034892","1","","","2010-01-09 20:46:05","2","1344","<p>I have an app where the user can choose a profile pic using images stored on the phone or SD. Do I have to write my own file explorer for this? I've seen a couple examples on anddev, but wasn't sure if there is another way. Thanks.</p>","222361","","","","","2010-01-09 21:25:15","How do I allow a user to browse/choose a file for my app use in Android?","<android><file><browser>","2","0","2","",""
"2035063","1","2035139","","2010-01-09 21:40:16","2","280","<p>I'm in the process of researching if and how an entrerprise Windows Mobile .NET application can be ported to Android. The question that I'm into right now is how to distribute and update the application once it's developed.</p><p>The current .NET application is ""installed"" on a device using an approperiate system image. The program then updates itself by downloading new updates from a website during usage and installing those updates on the next startup. So now the question is, how is this task best performed with an android application? I've received indication that the company would like to get away from using images so that more devices can be supported, so using images is not a requirement. However, it is an internal enterprise application and as such no external users are to be able to download it, so simply putting it on android market for anyone to download is not an option.Does anybody know if there is an ""easy"" solution to this problem in the Android world?</p>","245943","","","","","2010-01-09 22:10:23","Distribution of Android application","<android>","1","0","","",""
"2035197","1","2035231","","2010-01-09 22:20:36","1","428","<p>isInitialStickyBroadcast() is obviously only available after 2.0 (SDK 5)</p><p>I'm getting this error: ""Uncaught handler: thread main exiting due to uncaught exception java.lang.VerifyError""</p><p>It's only happening on 1.6. Android 2.0 and up doesn't have any problems, but that's the main point of all.I Can't catch the Error/Exception (java.lang.VerifyError), and I know it's being caused by calling isInitialStickyBroadcast() which is not available in SDK 4, that's why it's wrapped in the SDK check. I just need this BroadcastReceiver to work on 2.0+ and not break in 1.6, it's an app in the market, the UNDOCK feature is needed for users on 2.0+ but obviously not in 1.6 but there is a fairly amount of users still on 1.6.</p><p>Here's an easy-to-read version of part of the code I'm using, see it's wrapped in an SDK check to only run on 2.0+, but the VerifyError is still showing up.</p><pre><code>private BroadcastReceiver mUndockedReceiver = new BroadcastReceiver(){    @Override    public void onReceive(Context context, Intent intent)     {        //FROM ECLAIR FORWARD, BEFORE DONUT THIS INTENT WAS NOT IMPLEMENTED        if (Build.VERSION.SDK_INT &gt;= 5)        {            if (!isInitialStickyBroadcast()) {                //Using constant instead of Intent.EXTRA_DOCK_STATE to avoid problems in older SDK versions                int dockState = intent.getExtras().getInt(""android.intent.extra.DOCK_STATE"", 1);                if (dockState == 0)                {                    finish();                }            }        }    }}; </code></pre>","241869","","","","","2010-01-09 22:35:20","How to call ""isInitialStickyBroadcast()"" and avoid problems on 1.6?","<android>","1","2","","",""
"2035199","1","","","2010-01-09 22:20:58","2","915","<p>What's the best way to access the database through an async task? I don't think I should pass in a reference to the DbAdapter that the activity is using (could be closed as the activity may be garbage collected). Also, the db needs a context to be opened and closed, but I don't have that with the asynctask.</p>","247255","","","","","2010-01-09 23:11:30","AsyncTask and SQLite Database","<android>","1","0","2","",""
"2035698","1","","","2010-01-10 01:24:27","3","1155","<p>I have code in an appwidget that I want to run when the phone's orientation changes on the home screen, ie like when the keyboard flips out. I have an image that I want to change in an imageview in my appwidget. I can't use different layouts linked to the orientation (ie ""layout"" and ""layout-land"") because I don't know the name of the image file until runtime, it is created at runtime. Is there anyway to trigger code to run only if the home screen is shown, my appwidget is active and the orientation just changed?</p><p>I could listen for a configuration_change broadcast but that will run everytime the phone switches to landscape or portrait and I only want it to happen when the homescreen is shown. I cannot think of any good way in android to do this. Thanks</p><p>Ryan</p>","247304","","247304","","2010-01-21 23:56:01","2010-07-08 12:52:11","appWidget Orientation Code","<android><android-widget><screen-orientation><appwidget>","3","2","1","",""
"2035736","1","2035780","","2010-01-10 01:38:13","0","456","<p>sorry for this dumb question, but i am really stuck...</p><p>the thing is i am trying to create a todo list application on android. </p><p>I am stuck because at the moment I dont know the way to create many todo lists.I have created the GUI for one list, using listview. entries of the list are added by the user when running the application. Particularly i dont know how to pass a list object, if i create new one.</p><p>please, could you give me any hints?</p>","200123","","","","","2010-01-10 02:05:57","How to create many lists on Android?","<android><list><view>","1","2","","",""
"2035974","1","","","2010-01-10 03:28:43","1","6435","<p>I have a Gallery with a set of images that was downloaded at run time.</p><p>I followed the example here:<a href=""http://www.anddev.org/a_androidwidgetgallery_-_example-t332.html"" rel=""nofollow"">http://www.anddev.org/a_androidwidgetgallery_-_example-t332.html</a></p><p>but instead of using </p><pre><code>i.setImageResource(this.myImageIds[position]);</code></pre><p>I used </p><pre><code>i.setImageBitmap(bitmaps.get(position));</code></pre><p>This doesn't fill the entire width of the screen, only as much as the width specified here:</p><pre><code>i.setLayoutParams(new Gallery.LayoutParams(150, 150)); </code></pre><p>When I increase this number, the item scales with it instead of showing more images per the example. I've even tried to scale the images before adding them to the set. Not sure what I'm missing, or where other examples of this might be. Any help would be great, Thanks.</p>","247325","","","","","2011-09-16 00:28:02","Gallery item width vs gallery width","<android><gallery>","2","4","2","",""
"2036186","1","2036964","","2010-01-10 05:15:05","3","3381","<p>Our application displays a camera preview and it seems to work fine on all phones except for the Motorola Droid where we get a runtime exception when we set the camera parameters:</p><pre><code>    java.lang.RuntimeException: setParameters failed   at android.hardware.Camera.native_setParameters(Native Method)   at android.hardware.Camera.setParameters(Camera.java:611)   at com.highwaynorth.andrometer.CameraPreviewSurfaceView.surfaceChanged(CameraPreviewSurfaceView.java:57)   at android.view.SurfaceView.updateWindow(SurfaceView.java:460)   at android.view.SurfaceView.dispatchDraw(SurfaceView.java:287)   at android.view.ViewGroup.drawChild(ViewGroup.java:1525)</code></pre><p>Here is the code for surfaceChanged() which is mostly taken from <a href=""http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html"" rel=""nofollow"">APIDemos</a></p><pre><code>public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {   // Now that the size is known, set up the camera parameters and begin   // the preview.   Camera.Parameters parameters = mCamera.getParameters();   parameters.setPreviewSize(w, h);   parameters.setPictureFormat(PixelFormat.JPEG);   parameters.setPreviewFormat(PixelFormat.YCbCr_422_SP);   parameters.setPreviewFrameRate(1);   mCamera.setParameters(parameters);   mCamera.startPreview();</code></pre><p>}</p><p>Does anyone know what is wrong with how we are setting the parameters that would be causing the exception on the Motorola Droid?</p>","213138","","213138","","2010-01-11 04:19:48","2012-08-23 00:16:39","Camera Preview on Motorola Droid","<android><camera><motorola><motorola-droid>","3","0","1","",""
"2036213","1","2036225","","2010-01-10 05:24:04","48","29218","<p>A lot of open source libraries that aid in Android application development have sprung up with time. IMO looking at source code of good projects helps learn the system better, faster and not to mention reduces development time. Is there a recommended list of such projects or if not, can we build such a list? I think it will really be useful to other developers.</p><p>Thanks.</p>","236128","","21234","","2010-11-25 12:18:00","2012-07-12 18:14:02","List of Open Source projects that aid Android app development","<android><open-source>","6","1","32","2012-09-03 17:51:03",""
"2036430","1","2036951","","2010-01-10 07:35:42","3","1821","<p>I'm trying to tackle a problem that seemingly many Android developers have, which is how to intersperse lists with non-list data, in one big scrollable pane.  </p><p>The model I have in mind is the screen for an individual app in the Market. You have a big description, a list of a few lazily loaded comments, and then some individual items that do different things, like visit the developer's web page, call them, etc.  And then in between them all, are nice section headers.</p><p>Emulating this approach seems to be extremely hard.  I've read enough SO answers and mailing list posts to know not to put a ListView inside of a ScrollView, but I want the same effect without using addHeader() and addFooter() with very complex header and footer views.  </p><p>I've tried using a LinearLayout that I stock with views myself, but I can't get the pleasant click effects that default list items have (the orange background, white for long-click, etc.).  </p><p>What do I do?</p>","16075","","","","","2011-01-25 13:24:59","Best practices combining list and non-list views, like the Market","<android><listview><scrollview>","3","0","1","",""
"2036626","1","2036841","","2010-01-10 09:47:18","0","5214","<p>I am creating an application for the android, and would like it to be able to read a text file via anonymous FTP.  I've tried URLConnection, but it doesn't seam to be working.  After some Google searching it appears that URLConnection doesn't always work with some FTP servers.  All of the java FTP connection libraries I've found require you to download the file to a local location before reading it.  However I would like to have the same functionality as URLConnection in that I can just use the following similar code:</p><pre><code>String urlString = ""ftp://ftp.domain.com/testing.txt"";URL url = new URL(urlString);FTPConnection conn = url.openConnection();BufferedReader reader = new BufferedReader(new InputStreamReader(                conn.getInputStream()));</code></pre><p>Thank you in advance,</p><p>John</p>","105500","","","","","2010-01-10 11:34:55","How to read a text file via FTP","<java><android><ftp>","1","4","2","",""
"2036909","1","2036930","","2010-01-10 11:59:11","2","5738","<p>I want to detect when a user taps anywhere in a view in my Android application.</p><p>My code looks like this:</p><pre><code>linearLayout = (LinearLayout) findViewById(R.id.linearLayout); // main layout// ...linearLayout.setOnTouchListener(this);// ...public boolean onTouch(View v, MotionEvent event) {    Toast.makeText(this, ""Touch!"", 1000);    if (event.getAction() == MotionEvent.ACTION_DOWN) {        Toast.makeText(this, ""Down!"", 1000);        return true;    }    return false;}   </code></pre><p>...but when I click on the view, I don't get Toast!</p><p>Do touch events work in the emulator -- or have I got something wrong in my code?</p>","51593","","","","","2010-03-02 18:09:36","How to detect when a user taps on a view in Android","<android>","1","0","1","",""
"2036952","1","2036975","","2010-01-10 12:13:38","2","5618","<p>I created an application which enables the user to set whether he wants to receive notification while the application runs in background mode. If the notifications are enabled an activity should be started (the dialog should appear on the screen).</p><p>I tried to enabled it the following way:</p><pre><code>@Overridepublic void onProductsResponse(List&lt;Product&gt; products) {    this.products = products;    moboolo.setProducts(products);    if(moboolo.getAutomaticNotificationsMode() != 0 &amp;&amp; products.size() &gt; 0){        if(isRunningInBackground)        {            Intent intent = new Intent(this, ProductListActivity.class);            intent.setAction(Intent.ACTION_MAIN);            startActivity(intent);        }    }    drawProducts(products);}</code></pre><p>this is the method from main activity. When onPause() is executed isRunningInBackground is set true.When I tried to debug it when the main application was running in the background the line </p><p>startActivity(intent) had no effect (the activity didn't appear).</p><p>Does anyone know how to midify the logic in order to start an activity from the main activity when the main activity is running in the background (after onPause() is called)?</p><p>Thank you.</p>","22996","","","","","2013-12-12 15:32:00","how to start activity when the main activity is running in background?","<android><activity>","2","0","","",""
"2037208","1","2037257","","2010-01-10 14:03:29","1","2849","<p>I have a ListView, as well as a refreshListFromDB(String searchKeywords) method which updates the adapter.</p><p>I'd like to implement search, where pressing the search key on my device will pop up the standard search box (and on-screen keyboard if required), and pass the result (onKeyDown) to refreshListFromDB() - or is this considered bad UI design?</p><p>Search is a complex beast, so can anyone recommend any bare-bones examples? I don't want to use global QSB, as it's not relavent for my type of app. Do I really need to get into Intents, searchable XML, new activities, content providers etc?</p>","202807","","","","","2010-07-22 08:58:48","Tutorials for simple Android search & what's necessary","<android><search>","3","1","","",""
"2037551","1","2037612","","2010-01-10 16:08:08","1","3704","<p>I want to open a specific type of file that my app can already send over email as an attachment.  I need to be able to have the android email app choose my app to download or open that specific file type.  I can't figure out how to set up an intent filter that would let me do that though.  Anyone know how this is done?</p>","131871","","","","","2012-02-14 14:11:48","How to open email attachment in my app on android?","<android><email><download><attachment><intentfilter>","1","0","","",""
"2037737","1","2037766","","2010-01-10 17:05:40","1","934","<p>Can anyone tell me what views can I use in an appWidget?</p><p>Thank you!</p>","217360","","","","","2013-04-18 17:22:09","What views can i use in an appWidget?","<android>","3","0","1","",""
"2038040","1","","","2010-01-10 18:33:31","61","85356","<p><strong>Hi All,</strong></p><p>I have 2 questions regarding a ListView in Android:</p><ol><li><p>How can I <strong>get</strong> the color of the listview's focused row ?I tried to use the <strong>ListView.getSelector()</strong> method, which according to its documentation should give me what I'm looking for, but it's giving me a Drawable object which I don't know how to retrieve the color from (if possible...).</p></li><li><p>How can I <strong>set</strong> the color of the listview's focused row ?Here I tried to use the <strong>setSelector()</strong> method on the listview, passing it a ColorDrawable object, but the result of doing it is that the whole background of the list view is painted in that color... and this is not what I wanted of course...</p></li></ol><p>Thanks!</p>","239193","","","","","2013-04-08 07:36:08","Android ListView Selector Color","<android>","2","2","42","",""
"2038151","1","2038184","","2010-01-10 18:58:36","8","5423","<p>How could I power off an android device via java code?<br>Is it even possible? Do I need special permissions to do this?</p>","129488","","114066","","2011-08-18 08:57:03","2012-09-14 19:20:19","How to power off an Android device?","<android>","2","0","3","",""
"2038344","1","2038413","","2010-01-10 19:53:03","3","2184","<p>Maybe I'm going about this the wrong way, but if so, please correct me.Here is the situation: I have a query which returns URI strings for ringtones stored in a database.I am trying to add a ""column"" to this cursor with the ringer ""Title"" (since this can change outside my program).I can successfully user RingtoneManager to get the title, but I cannot figure out how to add this ""column"" to the cursor data for later use.</p><p>Here is what I have so far:<code>if (cursor != null) {<br>    cursor.moveToFirst();<br>    do {<br>    String ringerTitle =   getRingerTitle(cursor.getString(cursor.getColumnIndex(PoolDbAdapter.KEY_RINGER)));  </p><pre><code>// how can i add ringerTitle to a new column here?} while (cursor.moveToNext());   </code></pre><p>}<br></code></p>","155978","","","","","2010-01-10 20:38:59","Adding data to a database cursor","<android>","2","2","2","",""
"2038587","1","2043083","","2010-01-10 20:59:40","3","2062","<p>What is the best way to determine a file type in Android?</p><p>I want to check if the given file is an image, a music file etc.</p>","186620","","418183","","2011-05-16 09:54:50","2013-10-26 07:48:06","How to determine file types in Android","<android><file-type>","3","1","2","",""
"2038905","1","2038926","","2010-01-10 22:28:12","5","4310","<p>Just my a new Android phone and I've been tinkering with some basic apps. It's been driving my crazy that the Android plugin for Eclipse refreshes externals folders whenever I save ANYTHING. Normally I wouldn't mind but when it takes 10s to refresh I start to notice. </p><p>I already searched and other people have this problem, but there are no solutions.</p><p>If it matters, Eclipse 3.5 running on a 64bit jvm on Ubuntu 9.10</p>","287","","","","","2012-03-14 09:36:51","Why does Android Eclipse constantly refresh external folders and take forver?","<android><eclipse><performance><refresh>","4","0","2","",""
"2038916","1","2038985","","2010-01-10 22:31:24","1","260","<p>Maybe I'm going about this the wrong way, but if so, please correct me. Here is the situation: I have a query which returns URI strings for ringtones stored in a database. I have extended the SimpleCursorAdapter to override the getView() function to query the RingtoneManager for the TITLE of the associated ringer URI, however the getView() function is called more than once per row and slows my application down quite a bit. Is there a way I can run the function once to map uris to titles and store that data somewhere that the getView() can access the data quickly?</p><p>Related code snippets:</p><pre><code>public String getRingerTitle(String uriString) {      Uri ringtoneUri = Uri.parse(uriString);       Ringtone r = RingtoneManager.getRingtone(this.context, ringtoneUri);      return r.getTitle(context);  }  public View getView(int position, View convertView, ViewGroup parent)      {             View v = convertView;             if (v == null) {                  LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);                  v = inflater.inflate(this.layout, null);            }             this.cursor.moveToPosition(position);           String ringer = this.cursor.getString(this.cursor.getColumnIndex(PoolDbAdapter.KEY_RINGER));            TextView rTitle = (TextView) v.findViewById(R.id.ringer_line_item);            rTitle.setText(getRingerTitle(ringer));           return(v);    }  </code></pre><p>How can the getRingerTitle() function be optimized to cache the data or to only query for each item once?OR - is there a better way I should be approaching this?</p><p>Thanks</p>","155978","","155978","","2010-01-10 22:51:59","2010-01-10 22:51:59","Associating cursor data","<android>","1","1","","",""
"2039049","1","2039062","","2010-01-10 23:08:19","2","814","<p>Just started writing java / android and I am trying to use android.widget.VideoView.</p><p>I set the video by using the setVideoPath('/path/filename') method, but can't seem to figure out how to get the path on an existing object?</p><p>I'm using methods such as 'getDuration()', and 'getCurrentPosition()' and they work great.. but where is a getPath method?</p><p>Thanks in advance.</p>","234967","","","","","2013-12-04 13:20:33","Get absolute path and filename from VideoView object","<java><android>","2","0","","",""
"2039350","1","2045865","","2010-01-11 00:59:04","0","826","<p>Is there an emulator for the <a href=""http://en.wikipedia.org/wiki/Nexus_One"" rel=""nofollow"">Nexus</a> ?  i want to test some of my android apps on it. </p>","143373","","","","","2010-01-12 00:11:41","HTC Nexus emulator","<android><android-emulator><emulator>","1","1","","",""
"2039513","1","2039517","","2010-01-11 01:51:28","2","2476","<p>So it looks like mobile phones these days are capable of providing gps data ;)</p><p>I'm building a django app with a mobile edition that I want to be location aware.</p><p>My question is, how does one access GPS data? Is there a standard, or do you have to custom code for android/iphone/other.</p><p>Ideally, I'd imagine it being provided in the HTTP request in the same way you get information such as the IP Address and User Agent.</p>","202392","","","","","2011-11-24 16:06:59","Web App GPS Polling","<iphone><android><django><mobile><gps>","4","1","2","",""
"2039555","1","","","2010-01-11 02:08:57","24","61093","<p>My WakeLock isn't keeping my device awake.</p><p>In <code>OnCreate()</code> I've got:</p><pre><code>PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, ""My Tag"");mWakeLock.acquire();</code></pre><p>then:</p><pre><code>new CountDownTimer(1320000, 200) {    public void onTick(long millisUntilFinished) {        // I update a progress bar here.                                             }    public void onFinish() {        // I finish updating the progress bar.        mWakeLock.release();    }}.start();</code></pre><p>The screen turns off before the timer finishes, how can I make the screen stay visible?</p><p><code>mWakeLock</code> is a field previously declared like so:</p><pre><code>private PowerManager.WakeLock mWakeLock;</code></pre><p>My device uses Android 1.6.  I would really appreciate any help to resolve this.</p>","41742","","","","","2013-12-23 08:32:17","How to get an Android WakeLock to work?","<android>","8","0","24","",""
"2039842","1","2040447","","2010-01-11 04:02:09","2","689","<p>I have developed some widget and what I want to attain is to put it on desktop automatically after installation without doing it manually.</p><p>Thanks in advance,kogut</p>","217852","","14343","","2010-07-13 02:14:27","2010-07-13 02:14:27","Put widget on desktop automatically after installation","<android><android-widget><android-manifest>","1","2","1","",""
"2039964","1","2702663","","2010-01-11 04:49:29","131","180484","<p>How can I connect my android emulator to the internet, e.g. to use the browser? I've found lots of advice on what do to when your connected through a proxy, but that's not the case here, my machine (win7) is directly connected to the router... </p>","102181","","165495","","2011-02-07 01:09:18","2014-01-30 18:01:15","how to connect android emulator to the internet","<android><internet><android-emulator>","28","1","34","",""
"2040198","1","2040315","","2010-01-11 06:05:23","1","820","<p>When user copy or paste on TextView,Is there anyone explains me what happen on TextView.If some methods called while user click 'Copy' or 'Paste' in menus,I'd like to hook them and replace them with my own one.</p><p>Here is what I want to do.1. user copy or paste some string to my TextView.2. some string copied and paste on my Textview.3. Before some string is added on Textview, I want to check or change string.</p>","258508","","","","","2010-01-11 06:37:06","Can I hook when user copy or paste on TextView?","<android>","1","0","1","",""
"2040324","1","2040414","","2010-01-11 06:39:39","2","858","<p>Is there any way to get in the code:</p><p>Email idPasswordSMTP hostSMTP port</p><p>which the user used to setup his Email account with the Android built in Email application</p><p>Required because, I am written a MailSender class using JavaMail API there I need to send the mail using the details what user configured in Built in Android Email application.</p>","28557","","28557","","2010-01-11 07:42:03","2010-02-05 15:49:42","Android Email application - Is it possible to get all the details which are configured in Email application","<android><email>","2","1","","",""
"2040381","1","","","2010-01-11 06:57:59","3","623","<p>I want to have some static numeric and text values as an application resource. For example my data is like this:</p><pre><code>Levels 5 First_Level 500 60 1 Second_Level 500 80 1 Third_Level 200 60 1 Fourth_Level 130 30 2 Final_Level 100 30 3... and another 300 lines...</code></pre><p>The format and order of the data is predefined and guaranteed to be valid.</p><p>I could read it with <code>java.util.Scanner</code>, but it's extremely slow in Android, reading a 10 KB file takes minutes. It's slow because of the regular-expression-based pattern matching inside (when I traceview'ed it). </p><p>What way would you suggest to store them?</p>","11238","","21234","","2011-05-15 13:39:31","2011-05-16 02:36:37","Storing short strings and numeric values in resources in Android","<android><java-util-scanner>","3","0","","",""
"2040625","1","","","2010-01-11 08:28:07","1","2595","<p>I'm doing an IPC between a client Activity and a Service using AIDL. ServiceConnection.onServiceConnected() seems to run when binding the Service with bindService(). However after unbindService() is called when releasing the Service, there's no indication ServiceConnection.onServiceDisconnected() is ever run. Can anybody provide any insight as to why this happens? </p><p>Found another thread on this issue here:<a href=""http://stackoverflow.com/questions/971824/when-does-serviceconnection-onservicedisconnected-get-called"">http://stackoverflow.com/questions/971824/when-does-serviceconnection-onservicedisconnected-get-called</a></p><p>Which doesn't quite answer my question. My Service didn't fail on any exception.</p><p>Here's my service binding and releasing code:</p><pre><code>//bind serviceprivate void initService(){    conn = new NetServiceConnection();    Intent i = new Intent();    i.setClassName( ""framework.network"", ""framework.network.NetService"" );    bindService( i, conn, Context.BIND_AUTO_CREATE);//This returns TRUE}//unbind serviceprivate void releaseService(){    unbindService(conn);    conn = null;}class NetServiceConnection implements ServiceConnection{    //THIS RUNS FINE    public void onServiceConnected(ComponentName name, IBinder service) {         mService = INetService.Stub.asInterface(service);          Log.d( ""ADDERSERVICECLIENT"",""onServiceConnected"" );    }    //THIS DOESN'T RUN    public void onServiceDisconnected(ComponentName name) {        mService = null;        Log.d( ""ADDERSERVICECLIENT"",""onServiceDisconnected"" );    }};</code></pre><p>Any help is very much appreciated. Thanks in advance.</p>","247884","","","","","2010-12-23 16:49:43","AIDL ServiceConnection.OnServiceDisconnected() not called","<android>","2","0","","",""
"2040691","1","2040790","","2010-01-11 08:45:03","4","1503","<p>I have written my application logic in domain objects (to enable multiple user interfaces and porting to other platforms), and am now lookng at implementing Activities for the user interface.</p><p>Considering that each activity needs to serialise its state, what is the best way to ensure my domain objects are only serialised once?</p>","3603","","","","","2010-01-11 09:28:45","Sharing domain objects between activities","<android><domain-driven-design><activity>","1","0","4","",""
"2040731","1","2042038","","2010-01-11 08:54:41","1","768","<p>I've been working on a practice Android application to familiarize myself with the platform.  Specifically, the app I'm trying to implement allows the user to select a sound file (MP3 or WAV) to play at a specific date and time showing a dialog with a progress bar and an OK/Cancel button allowing the user to stop the playing of the sound file.  I want it to behave something like the countdown apps I've seen or even the built-in alarm clock app.  As I'm implementing this simple (I thought!) app, I'm trying to better understand the platform and make the application conform to the Android way.</p><p>As I've been writing the app, I learn more about how things are supposed to work on the Android platform. And here's where I'm getting a bit confused. During my attempts to get the alarm to fire and display, I'm learning that properly formed Android applications are not supposed to show dialogs as a result of a background service or broadcast receiver being invoked through Android's alarm service. Instead, I think, the app is supposed to use a notification on the status bar to alert the user. The user then has the option to look at the notification to see what the app is trying to tell them.</p><p>I’ve managed to get the dialog I wanted to bring up to appear by launching a new activity from a service that was launched by Android’s alarm service.  However, it appears that I’ve broken an Android rule by doing so. I knew this first because I saw a message in the DDMS LogCat window that asked if I was sure I wanted to start a new activity from a Service. Second, I read in several places that it was not nice to do so.   One statement that comes to mind was from a Google developer that said he’d certainly uninstall an app that did something like that.</p><p>The app is instead, if I understand correctly, supposed to use the status bar and notification to get the user’s attention and allow them to see what the app wants at their leisure. This seems counter-intuitive to what my app is trying to do.  Again, I’m trying to get it to behave, essentially, like the countdown apps I’ve seen or the built-in alarm clock application that comes on the Android phones.  If my app is not behaving correctly, is the alarm clock app behaving?  Obviously I’d say the alarm clock app is doing exactly what I’d expect.  And a user of my app, I think, would expect the sound file to play with a dialog showing allowing the playing of the sound file to be stopped without having to go through the status bar.</p><p>Am I understanding the Android platform correctly?  Any opinions on how an app like this could be implemented without being naughty by bringing up the dialog I mentioned? I’d like the application to be regarded as a well-formed Android app, but I’m having a difficult time seeing how my app is so different from others I’ve seen or even the built-in alarm clock application.</p><p>Thanks!Jeff</p>","247872","","","","","2010-01-11 13:17:43","Understanding proper Android alarm ""flow""","<android>","1","0","1","",""
"2040878","1","2040915","","2010-01-11 09:30:36","2","71","<p>I am trying to write a mapView application .When i extend my class with MapActvity it will ganerates an error force to close application. And in log chat i got an runtime error like classNotFoundException.</p><p>plz solve my problem.ThanQ.</p>","247921","","","","","2010-01-11 09:36:32","problem with HelloMapView in android","<android>","1","0","","",""
"2040963","1","3529316","","2010-01-11 09:45:33","20","18214","<p>I use a WebView to display some internet content on one of our app'sActivities.<br>The problem is that when the user switches out of this activity,WebView's threads keep running!<br>The problematic threads are:</p><pre><code>Thread [&lt;17&gt; WebViewCoreThread] (Running)Thread [&lt;25&gt; CookieSyncManager] (Running)Thread [&lt;19&gt; http0] (Running)Thread [&lt;29&gt; http1] (Running)Thread [&lt;31&gt; http2] (Running)Thread [&lt;33&gt; http3] (Running)</code></pre><p>Pausing each one of these threads, and checking what it is busy doing:</p><pre><code>Thread [&lt;17&gt; WebViewCoreThread] (Suspended)    Object.wait(long, int) line: not available [native method]    MessageQueue(Object).wait() line: 288    MessageQueue.next() line: 148    Looper.loop() line: 110    WebViewCore$WebCoreThread.run() line: 471    Thread.run() line: 1060Thread [&lt;25&gt; CookieSyncManager] (Suspended)    Object.wait(long, int) line: not available [native method]    MessageQueue(Object).wait(long) line: 326    MessageQueue.next() line: 144    Looper.loop() line: 110    CookieSyncManager(WebSyncManager).run() line: 90    Thread.run() line: 1060Thread [&lt;19&gt; http0] (Suspended)    Object.wait(long, int) line: not available [native method]    RequestQueue(Object).wait() line: 288    ConnectionThread.run() line: 93</code></pre><p>I wonder how can I tell the <code>Looper</code> in each of those threads to quit.</p><p>I tried calling <code>webView.destroy()</code> in the activity's <code>onPause()</code> method,but it had no influence.<br>When I disable the call for opening a web page in the webView( <code>webView.loadUrl(...)</code> ), those threads naturally are not started, andtherefore don't stay on after leaving the activity.</p><p>Any ideas as to how I can make <code>WebView</code>'s threads stop after leavingtheir activity?</p>","247924","","648313","","2011-07-10 15:58:41","2013-05-17 15:57:05","WebView threads never stop (WebViewCoreThread, CookieSyncManager, http[0-3])","<android><multithreading><webview>","7","3","18","",""
"2041002","1","2041974","","2010-01-11 09:54:11","2","654","<p>I am currently developing an application which has a maps feature. My map is working, but I still need to create a Directions option. In previous versions of the Android SDK there used to be a class called DrivingDirections, which did exactly what I want. Now it's gone and I don't know how to add this feature to my current map. I read that Google have updated their terms thus making the use of Directions in apps kinda illegal or something like that. But there are Directions in my built-in Maps application. So my question is - Is there any way for me to pass parameters (longitude, latitude) from my application to the built-in application so that the built-in Maps can then draw the route from the start point to the end point?</p><p>P.S. I don't necessarily need this to be done by passing parameters. Any solution will be fine, as long as I can draw the route from point A to point B on my already displayed map.</p><p>Thank you.</p>","247927","","","","","2010-06-17 17:15:36","Use Maps application in my Android application","<android><google-maps><parameters><map>","2","0","0","",""
"2041003","1","2041091","","2010-01-11 09:54:29","2","876","<p>As a follow on from <a href=""http://stackoverflow.com/questions/2040691/sharing-domain-objects-between-activities"">my question on sharing state between Activities</a>, how can I save the instance state of my Application? Since <code>Application</code> does not extend <code>Activity</code>, there is no <code>onSaveInstanceState</code> method to override.</p><p><em>NB: In advance, this is not a duplicate. Despite its name, <a href=""http://stackoverflow.com/questions/151777/how-do-i-save-an-android-applications-state"">How do I save an Android application’s state?</a> relates to Activity state</em></p>","3603","","3603","","2010-01-11 10:05:23","2010-01-11 10:19:02","Saving Application state","<android>","1","0","1","",""
"2041083","1","2041413","","2010-01-11 10:11:32","58","82100","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2757107/developing-for-android-in-eclipse-r-java-not-generating"">Developing for Android in Eclipse: R.java not generating</a>  </p></blockquote><p>I hv imported a project into my eclipse ide but its giving error since R file is generated automatically.How i can edit the R file so that it matchs my project reqt's</p>","133648","","77335","","2012-02-10 07:46:01","2013-04-27 02:26:19","How to regenerate R class?","<android>","26","0","7","2012-10-22 13:24:50",""
"2041207","1","2041459","","2010-01-11 10:36:55","12","14204","<p>I want to show images using drawBitmap() method. But before I want to resize it according screen dimensions. I have a problem with quality of result image. You can see screenshots and test code below. How can I resize images in runtime with a good quality?</p><p>Thank you for solutions.</p><p>Original image:<img src=""http://dl.dropbox.com/u/709109/gradient.png"" alt=""alt text""></p><p>Result screenshot on device:<img src=""http://dl.dropbox.com/u/709109/device.png"" alt=""alt text""></p><pre><code>import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Rect;import android.os.Bundle;import android.view.View;import android.widget.LinearLayout;import java.io.IOException;import java.io.InputStream;public class MyActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        LinearLayout container = (LinearLayout) findViewById(R.id.container);        container.addView(new View(this) {            @Override            protected void onDraw(Canvas canvas) {                Bitmap unscaledBitmap;                try {                    InputStream in = getAssets().open(""images/gradient.png"");                    unscaledBitmap = BitmapFactory.decodeStream(in);                    in.close();                    canvas.drawBitmap(unscaledBitmap, null, new Rect(0, 0, 320, 480), null);                } catch (IOException e) {                    e.printStackTrace();                }            }        });    }}</code></pre>","227016","","","","","2012-08-30 18:07:55","android: quality of the images resized in runtime","<android><image><drawing><resize><draw>","6","0","7","",""
"2041300","1","2041322","","2010-01-11 10:52:51","6","10365","<p>How can I change the first visible item in a list view (I searched a method such as setFirstVisiblePosition) ?</p>","164460","","82118","","2010-07-22 20:52:53","2010-07-22 20:52:53","android listview first visible position","<android><listview>","2","0","","",""
"2041559","1","2042242","","2010-01-11 11:45:25","0","2137","<p>There is way to allow the application to make a phone call using</p><pre><code>startActivity(new Intent(Intent.ACTION_CALL, Uri.parse(toDial)));</code></pre><p>My question is, Is there any way to end the phone call through application, More specifically I need to try like end the call as soon as i get the call.</p><p>Cheers,Vinayak</p>","28557","","","","","2010-01-11 13:56:00","Android - How to allow the application to end a phone call","<android>","2","0","1","",""
"2041891","1","7071289","","2010-01-11 12:53:37","10","16993","<p>How can i make an activity go to background without calling its <code>finish()</code> method and return to the Parent activity that started this .I tried so much but it really dint help.So if you guys could help i would be very thankful.</p><p>Thanx n Regards, </p><p>HaKr</p>","248031","","","","","2012-02-19 04:34:28","Sending Activity to background with out finishing","<android><activity>","4","2","1","",""
"2042222","1","2043302","","2010-01-11 13:51:59","60","135325","<p>I have two different activities. The first launches the second one. In the second activity, I call <code>System.exit(0)</code> in order to force the application to close, but the first activity is automatically displayed instead of the application returning to the home screen. How can I avoid this, and get the application to return to the home screen?</p>","164460","","1079354","","2012-07-30 13:00:26","2014-02-02 16:16:00","Close application and launch home screen on Android ","<android><android-activity>","19","0","32","",""
"2042278","1","","","2010-01-11 14:04:57","5","14169","<p><strong>Hi All,</strong></p><p>I apologize for the following long question... </p><p>I have a LinearLayout which contains a ListView and some other items. As for the ListView, each on of its rows is a LinearLayout that contains 3 views - Checkbox, ImageView and TextView (from left to right - horizontal).Since I wanted the whole row to be selected when using the trackball (to be highlighted with a background color), I set the all three views inside the LinearLayout row as not focusable, and it worked.</p><p>Now I'm having 2 problems regarding this ListView.First, I want that whenever I touch a row in the ListView (with my finger), to get the same behavior as when using the trackball - means that I want the row to be selected (highlighted). What's happening right now is that when I touch the row it really becomes selected, but when I release my finger the selection is gone (much like happens in device's contact list).</p><p>Second - from a Menu, I can display a new LinearLayout instead the one that contains the ListView (different application's screen). When this happens, I still stores the object of the LinearLayout that contains the ListView, because I want to be able to re-display it later without creating it from scratch.The problem is that when I re-disaply the LinearLayout with the ListView, none of the ListView's rows are selected, even if a ceratin row was selected when the the LinearLayout with the ListView ""left"" the screen.</p><p>Sorry again for the long post.</p><p>Thanks!</p>","239193","","","","","2013-02-19 00:53:02","Android ListView Selection Problem","<android>","5","0","4","",""
"2042561","1","2043249","","2010-01-11 14:57:35","0","696","<p>In a SurfaceView, I'm dispatching new thread that draws on canvas within standard ""LockCanvas-Draw-unlockCanvasAndPost"" loop. (note that thread doesn't contains message loop).</p><p>How to show Android standard Dialog from that thread?</p><p>As thread doesn't have msg loop, following code doesn't work:</p><pre><code>Builder builder = new AlertDialog.Builder(this);builder.setTitle(""Alert"");builder.setMessage(""Stackoverflow!"");builder.setNegativeButton(""cancel"", null);builder.show(); </code></pre>","35425","","164901","","2010-04-18 00:03:25","2010-04-18 00:03:25","Fireing Android Dialogs from another thread without Message Loop","<android><multithreading><surfaceview><message-loop>","1","2","1","",""
"2042663","1","","","2010-01-11 15:15:22","0","1461","<p>How can you dynamically create a CheckedTextView in android [without creating a new implementation]?</p><p>It seems CheckedTextView is <strong>abstract</strong> ... (which does not make any sense at all) because I keep getting the compile time error: <em>""Cannot instantiate the type CheckedTextView""</em></p><p><strong>Using</strong> Android 1.5</p>","61525","","61525","","2010-01-11 17:39:09","2010-01-11 17:39:09","Android: Create a CheckedTextView dynamically","<android><checkedtextview>","1","0","","",""
"2042934","1","2042982","","2010-01-11 15:53:24","1","1160","<p>I'm a beginner in android and i tried running some code I got from the net.Android can't import the following:</p><blockquote>  <p>import android.net.http.EventHandler;</p>    <p>import android.net.http.Headers;</p>    <p>import android.net.http.RequestQueue;</p></blockquote><p>Are these packages not included in the sdk? Where can I get these packages? </p>","245385","","","","","2010-01-11 16:02:11","missing packages","<android><packages>","3","0","","",""
"2043019","1","","","2010-01-11 16:07:46","4","14777","<p>I'm writing an application for Android. I need to make some image processing on the picture taken from camera.I use Camera.PictureCallback to get the photo, and I get picture in byte array.The problem is I want to make operations on every pixel of photo (some filtering and other stuff) so I guess, have photo in byte array is not a bad idea. But I don't know how interpret information in this byte array... The only way I know to make the processing is use BitmapFactory.decodeByteArray() and then use Bitmap object. Is this a good way to handle a lot of image processing?Right now I use something look like this:</p><blockquote>  <p>Bitmap mPhotoPicture mPhotoPicture = BitmapFactory.decodeByteArray(imageData, 0 , imageData.length);</p>    <p>mPhotoPicture = mPhotoPicture.copy(Bitmap.Config.RGB_565, true);</p></blockquote><p>I appreciate any help.</p>","248190","","","","","2010-01-11 16:22:14","Image Processing on Android","<android><image-processing>","1","0","6","",""
"2043352","1","","","2010-01-11 16:56:08","19","1439","<p>I am using Native code to render OpenGL in Android and I get periodic errors that look like this:</p><blockquote>  <p>ERROR/IMGSRV(1435): frameresource.c:610: WaitUntilResourceIsNotNeeded: PVRSRVEventObjectWait failed</p>    <p>ERROR/IMGSRV(1018): sgxif.c:124: WaitForRender: PVRSRVEventObjectWait failed</p>    <p>ERROR/IMGSRV(1435): osfunc_um.c:318: PVRSRVEventObjectWait: Error 13 returned</p></blockquote><p>Once these errors come up I have to restart the phone or the rendering won't start again correctly.  I have done a lot of web searching and I can't find out what could be the cause of these errors.  Does anyone else have any suggestions?</p>","236136","","236136","","2010-01-11 17:08:35","2012-06-03 12:05:18","Trouble with Native OpenGL Renderer","<android><opengl-es><android-ndk>","1","1","","",""
"2043619","1","2043683","","2010-01-11 17:37:28","4","3751","<p>I understand how to save an application's state by using SharedPreferences, onSavedInstanceState() &amp; onRestoreInstanceState(), etc as outlined in a similar post ( <a href=""http://stackoverflow.com/questions/151777/how-do-i-save-an-android-applications-state"">http://stackoverflow.com/questions/151777/how-do-i-save-an-android-applications-state</a> ), but how do I save the last activity?</p><p>To be more specific, my application starts up and goes to a login screen. Once a user logs in and navigates through several activities, lets say he or she leaves the app using the home button or in some other way. Next time the user starts the app, it will go back to the login screen and do a login again. Instead, I want the app to start up and go to the last activity that was on top of the stack when the user left the app in the previous session.</p><p>How is the last activity saved so that it can be restored on app startup?</p>","236300","","","","","2010-08-27 14:45:55","Saving Android application state","<java><android>","3","0","3","",""
"2043768","1","","","2010-01-11 18:04:14","1","1500","<p>Let me first state that I do not know Java.  I'm a .NET developer with solid C# skills, but I'm actually attempting to learn Java and the Android SDK at the same time (I know it's probably not ideal, but oh well, I'm adventurous :))</p><p>That said, my end goal is to write a streaming media player for Android that can accept Windows Media streams.  I'm okay with restricting myself to Android 2.0 and greater if I need to.  My current device is a Motorola Droid running Android 2.0.1.  There is one online radio service I listen to religiously on my PC that only offers Windows Media streaming, and I'd like to transcode the stream so my Android device can play it.</p><p>Is such a thing possible?  If so, would it be feasible (i.e., would it be too CPU intensive and kill the battery)?  Should I be looking into doing this with the NDK in native code instead of Java?  I'm not opposed to writing some sort of service in between that runs on a desktop computer (even in C#), but ideally I'd like to explore purely device-based options first.  Where should I start?</p><p>Thanks in advance for any insight you can provide!</p>","98877","","","","","2011-05-29 23:13:25","Audio Stream Transcoding with Android","<java><android><audio-streaming><transcoding>","2","3","","",""
"2043833","1","2049924","","2010-01-11 18:13:45","3","4658","<p>A component I have created works fine if I put it in the main project and reference it from any res/layout xml, but when I put it in a project on which the main project depends, I get a ClassNotFoundException in the xml. </p><p>Whilst after compiling the interface works fine, it is a pain in the * to design an interface without seeing what I am doing because of the error. Does anyone know how to solve it?</p><p><strong>Stacktrace:</strong></p><pre><code>java.lang.ClassNotFoundException: com.package.widget.Tabber    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)    at java.security.AccessController.doPrivileged(Native Method)    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)    at android.view.LayoutInflater.createView(LayoutInflater.java:465)    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:564)    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:122)    at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)    at android.view.LayoutInflater.inflate(LayoutInflater.java:407)    at android.view.LayoutInflater.inflate(LayoutInflater.java:296)    at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:377)    at com.android.ide.eclipse.adt.internal.editors.layout.GraphicalLayoutEditor.computeLayout(Unknown Source)    at com.android.ide.eclipse.adt.internal.editors.layout.GraphicalLayoutEditor.recomputeLayout(Unknown Source)    at com.android.ide.eclipse.adt.internal.editors.layout.GraphicalLayoutEditor.activated(Unknown Source)    at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.pageChange(Unknown Source)    at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1076)    at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:601)    at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.selectDefaultPage(Unknown Source)    at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.addPages(Unknown Source)    at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)    at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:357)    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:662)    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462)    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)    at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)    at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)    at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)    at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)    at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)    at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256)    at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1209)    at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1608)    at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)    at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)    at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)    at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)    at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)    at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225)    at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213)    at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:778)    at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:677)    at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:638)    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2854)    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2762)    at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2754)    at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2705)    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2701)    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2685)    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2676)    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)    at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:361)    at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:168)    at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:229)    at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:208)    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:373)    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:526)    at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)    at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:842)    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)    at org.eclipse.core.runtime.Platform.run(Platform.java:888)    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)    at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:840)    at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1101)    at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1205)    at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:264)    at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:258)    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:298)    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)    at org.eclipse.equinox.launcher.Main.run(Main.java:1311)</code></pre>","174868","","174868","","2010-01-11 20:27:19","2010-01-12 15:10:53","Android Component ClassNotFoundException","<java><android><components>","2","0","1","",""
"2043991","1","","","2010-01-11 18:36:43","4","1091","<p>Why does an OnClickListener for a View inside a ListView not respond to a trackball click on the view, while an OnItemClickListener for the ListView does respond to a trackball click on one of the ListView's views?</p>","239193","","4234","","2010-05-13 20:13:59","2011-10-17 10:55:44","Android ListView OnItemClickListner Vs. View OnClickListener","<android>","1","3","1","",""
"2043998","1","","","2010-01-11 18:37:13","1","4754","<p>Given this XML property of the CheckedTextView's checkMark:</p><pre><code>android:checkMark=""?android:attr/listChoiceIndicatorMultiple""</code></pre><p>How can you set the checkMark property dynamically (i.e. from code)?Does Android have any documentation on this?</p><p><strong>Using:</strong> Android 1.5</p><p><strong>Note:</strong>I am building a regular jar library that does not have any access to android XML resource files or drawables so everything has to be created programatically.</p>","61525","","61525","","2010-01-11 19:24:35","2011-03-02 10:20:49","Android CheckedTextView - Set checkMark dynamically","<android><checkmark><checkedtextview>","1","0","2","",""
"2044000","1","2044544","","2010-01-11 18:37:18","4","3710","<p>Is there a way to customize the MediaController? I need to change the style of buttons, SeekBar etc.</p>","227014","","759866","","2013-12-29 13:20:18","2013-12-29 13:20:18","Change style of android MediaController","<android><android-widget>","2","1","","",""
"2044775","1","","","2010-01-11 20:44:04","75","124843","<p>I'm really tired looking for a solution for vertical and horizontal Scrollview.</p><p>I read that the any view/layout implements this feature in the framework but I need something like this:</p><p>I need to define a layout within other, the child layout must implement scrolling vertical/horizontal for moving.</p><p>Initially implemented a code that moved the layout pixel by pixel, but I think that is not the right way.I tried it with ScrollView and Horizontal ScrollView but nothing works like I want it to, because it only implements vertical or horizontal scrolling.</p><p>Canvas is not my solution because I need to attach listeners in someones child elements.</p><p>What can I do?</p>","424140","","1333975","","2012-08-11 12:22:38","2014-03-31 21:11:05","Scrollview vertical and horizontal in android","<android><scrollview>","12","1","46","",""
"2044985","1","2045077","","2010-01-11 21:13:33","3","1512","<p>I need my app to run on all Android versions, but the Contacts API changed in 2.0.</p><p>In SDK 1.6 and earlier I use android.provider.Contacts to query the contacts DB, but this does not work in 2.0</p><p>Instead, for 2.0 I use android.provider.ContactsContract. This presents a problem: when I have code for ContactsContract, my app will not build for 1.6 and earlier.</p><p>Do I need to have two separate versions of my app (one for &lt;= 1.6 and one for 2.0 and later) or is there a way to avoid doing this?</p>","236300","","","","","2010-01-11 21:28:18","Android ContactsContract and building across multiple SDK versions","<java><android><contacts>","1","0","3","",""
"2046486","1","2046733","","2010-01-12 03:17:41","2","10865","<p>I'm trying to alter the default screen resolution of the Android emulator (and by extension, the Android device) to work at 1700x1200.  In other words, I need the screen to be able to display unique points over that range.</p><p>I have set the dimensions in my layout file, yet the device still defaults to 320x480.  I've set different dpi densities, but to no avail.  </p><p>Any help would be great, even just a direction to explore.</p><p>EDIT:  Thanks for the two responses.  I guess my question wasn't clear - I understand that the top resolution for the device is fixed, but I need to scale the screen to display with finer granularity than just 640X850 (which I believe is the highest resolution).  I understand you can set dpi density from 120-240, but I need to know how to set the scaling functionality to simulate a screen of 1700x1200.  My guess is that it will have to be done by my code, but I would prefer for the platform to auto-scale it down for me.  This may not be possible, but I just wanted to check.</p>","248568","","19750","","2011-08-23 16:05:58","2011-08-23 16:05:58","Set android screen resolution","<android><android-emulator><screen>","2","0","1","",""
"2046523","1","2052927","","2010-01-12 03:28:05","14","12629","<p>I copied the code from <a href=""http://stackoverflow.com/questions/1048739/android-camera-setpreviewdisplay-problem/1048844#1048844"">the answer here</a> and I still am getting a RuntimeException: setParameters failed error on my nexus one. My manifest file has camera and wake_lock permissions. This works on the emulator, and on the droid I don't get the error but it does have a rotation problem.</p>","247325","","","","","2014-01-02 18:32:21","RuntimeException on Camera.setParameters() on nexus one","<android><camera>","3","0","6","",""
"2046529","1","","","2010-01-12 03:29:56","2","1994","<p>I am writing an app which will create drawable shapes and add them to other drawables. (Think Tetris pieces onto a Tetris board.) As a test, I want to have a particular shape appear when my activity is loaded, but I cannot get a Drawable to appear in the ImageView I created. Could anyone explain why the following code isn't working?</p><p>Activity code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ImageView mImg = (ImageView) findViewById(R.id.img);    ShapeDrawable sD = new ShapeDrawable(new RectShape());    sD.setBounds(1,1,10,10);    sD.getPaint().setColor(Color.BLUE);    mImg.setImageDrawable(sD);}</code></pre><p>main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;ImageView        android:id=""@+id/img""        android:layout_width=""320px""        android:layout_height=""206px""        /&gt;    &lt;TextView        android:id=""@+id/debug""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>Note: I have been able to make static resources from the 'drawable' folder appear in this ImageView, just not Drawables I have created in the code.</p>","248573","","","","","2010-01-14 09:19:45","Problem displaying ShapeDrawable in an ImageView","<android>","2","0","1","",""
"2046619","1","2047991","","2010-01-12 03:54:46","0","1575","<p>I'd like to include a simple draw feature on my app. A friend told me I can't use canvas because I need to control the frame buffer and not redraw the entire screen every for every frame. He suggested I find a openGL 2d engine. I've searched around and I've only found Rokon which doesn't have any documentation and the examples aren't quite what I need.</p><p>Any suggestions?</p>","247325","","44729","","2011-05-26 15:45:46","2011-05-26 15:45:46","Making a draw/paint app","<android><opengl-es><drawing><2d>","2","0","0","",""
"2046753","1","2046800","","2010-01-12 04:42:09","0","121","<p>I want to publish my application to android market and I have a question to ask. I am just wondering where I can define owner names of the application. I want the owner name to be seen in users willing to download my application. Is it possible to define the owner name when I sign my application? If not can I define it when I publish my application to android market?</p><p>thanks in advance.</p>","227889","","","","","2010-01-12 04:59:08","Application owner issue","<android>","1","0","","",""
"2046847","1","2046868","","2010-01-12 05:13:15","3","6608","<p>I'm developing a native app for Android and I'm trying to use functions such as glIsEnabled which appear to be only available in OpenGL ES 1.1. Google's docs claim that NDK 1.6R1 supports OpenGL ES v1.1 but the function call fails with ""unimplemented Open GL ES API"" and if i do a glGetString(GL_VERSION) it returns ""OpenGL ES 1.0 CM"" as the version.</p><p>So if 1.1 is available, what do I have to link against to get it or what else do i need to change to get it?</p>","57662","","","","","2010-05-25 06:16:00","Android runs OpenGL ES 1.1 or 1.0?","<android><opengl-es>","3","0","3","",""
"2046859","1","2051690","","2010-01-12 05:17:14","0","192","<p>While I'm developing custom widget by using TextView widget, this question come up to my mind.When mText(member variable of TextView) is displayed, actually?</p><p>I have thought that ,just like other widgets, if I override onDraw method in the custom widget, which is derived from TextView, I can draw mText as I want.But, it's not true.</p><p>I'm reviewing Android Widget source, and than I realized that mText is not displayed while onDraw is called, definitely.</p><p>Is there someone who know about it?</p>","258508","","","","","2010-01-12 19:23:04","When is mText(member variable of TextView) displayed, actually?","<android>","1","0","","",""
"2046869","1","2049367","","2010-01-12 05:18:50","3","584","<p>Can anyone explain 3G technology from a programmer's perspective? I am a little bit confused. For instance, if I develop a mobile application with Android or IPhone SDK. Shall I concern about the network I used? Or the SDK has a same interface for all those different network(3G,GPRS,CDMA).Moreover, is 3G a specific technology or a set of communication technology? Is it just same as WCDMA? </p><p>Thanks.</p>","166482","","","","","2010-01-12 13:55:26","Any simple interpretation about 3G","<android><iphone><mobile><communication>","5","0","","",""
"2047105","1","2047565","","2010-01-12 06:20:32","7","2915","<p>I have a library-only Android eclipse project (no main class, only library classes) that I want to include in my main Android Application project. </p><p>I went to the Build Path and added the library project to the ""Required projects on the build path"" on the Projects tab, and checked it on the ""Order and Export"" tab.</p><p>However, when the application is run, it emits VerifyError exception, because the class from the library project didn't happen to be packaged together in the apk.</p><p>Any solution to this?</p>","11238","","775046","","2012-03-03 23:15:22","2012-06-04 19:26:56","Including other Eclipse Projects in an Android application project","<android><eclipse><adk><verifyerror>","3","0","3","",""
"2047261","1","2055455","","2010-01-12 06:56:33","10","5073","<p>Android provides various packages for testing like</p><blockquote>  <p><em><strong>AndroidTestCase   ApplicationTestCase  InstrumentationTestCase  ActivityInstrumentationTestCase2                                               ActivityTestCase</em></strong></p></blockquote><p>I need to know how to decide which package is best suitable for testing my app. Some info is provided in this link </p><p>http:<a href=""http:////developer.android.com/reference/android/test/package-summary.html"">//developer.android.com/reference/android/test/package-summary.html</a></p><p>But I need more clarity on this...</p>","237388","","237388","","2010-01-13 09:07:58","2013-03-09 05:51:49","Using Android Test Framework","<android><testing>","3","0","10","",""
"2047333","1","","","2010-01-12 07:15:10","2","20017","<p>want to know is there any architecture wise problem or else ?</p>","248676","","","","","2012-09-20 06:54:49","INSTALL_FAILED_CPU_ABI_INCOMPATIBLE while installing apps on target getting this error message how to resolve?","<android>","3","3","1","2012-08-27 17:16:45",""
"2047554","1","2053644","","2010-01-12 08:11:44","3","23339","<p>I have an image put on an ImageButton, which looks good on a mdpi (medium-dpi) screen. However, when the device has a hdpi (high-dpi) screen, the image is still pixel-by-pixel accurate, which look small on the device screen. </p><p>How do I make such that the image (and therefore the ImageButton) scaled based on the density-independent pixels (dp or dip) instead of pixels?</p>","11238","","1140748","","2012-05-06 16:59:21","2012-06-08 11:58:28","How to make ImageButton in Android automatically scale based on screen density?","<android><imagebutton><dpi>","4","0","2","",""
"2047573","1","2047643","","2010-01-12 08:16:56","18","23707","<p>How to draw filled polygon in Android ?</p>","227889","","777408","","2012-07-24 17:18:44","2013-06-25 22:40:39"," How to draw filled polygon?","<android>","4","0","1","",""
"2047706","1","2533538","","2010-01-12 08:55:18","20","14668","<p>Today I tried including the apache.commons.codec package in my Android application and couldn't get it running. Android could not find method ord.apache.commons.codec.binary.* and output the following errors in DDMS</p><blockquote>  <p>01-12 08:41:48.161: ERROR/dalvikvm(457): Could not find method org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString, referenced from method com.dqminh.app.util.Util.sendRequest</p>    <p>01-12 08:41:48.161: WARN/dalvikvm(457): VFY: unable to resolve static method 10146: Lorg/apache/commons/codec/binary/Base64;.encodeBase64URLSafeString ([B)Ljava/lang/String;</p>    <p>01-12 08:41:48.161: WARN/dalvikvm(457): VFY:  rejecting opcode 0x71 at 0x0004</p></blockquote><p>Any clue on how to solve this problem ? Thanks a lot.</p>","108841","","7595","","2010-03-28 16:12:36","2013-03-13 18:44:33","Apache Commons Codec with Android: could not find method","<android><base64><apache-commons-codec>","5","1","4","",""
"2047971","1","2946810","","2010-01-12 09:45:52","8","9317","<p>Is there a way to simulate opening/closing the 'hardware' keyboard in the emulator?I have to test some changes that I capture using getResources().getConfiguration().keyboardHidden and this would help a fair lot :)</p><p>Thank you in advance!</p>","235910","","","","","2012-01-16 02:58:58","Simulating opening/closing the hardware keyboard in emulator","<android>","2","0","2","",""
"2047973","1","","","2010-01-12 09:46:48","2","1704","<p>My actual task is to have zoom in zoom out for the WebView, but I don't want to scale images.</p><p>Are there ways to do that?</p><p>10x in advance,Danail</p>","232798","","232798","","2010-01-12 09:56:46","2011-02-07 10:50:43","Other ways for zoom-in zoom-out in Android WebView?","<android><webview>","1","0","","",""
"2048023","1","","","2010-01-12 09:58:14","2","335","<p>How to use Dev tools which flashes momentary pink rectangle on any screen sections being redrawn?</p><p>Tool description is given at<a href=""http://developer.android.com/guide/developing/debug-tasks.html"" rel=""nofollow"">http://developer.android.com/guide/developing/debug-tasks.html</a></p><p>Could anybody please suggest me where to install this tool and how to use it?</p><p>Thanks,Mahesh</p>","248761","","","","","2010-01-12 10:26:45","How to use Dev tools which flashes momentary pink rectangle on any screen sections being redrawn?","<android>","1","0","","",""
"2048415","1","2049319","","2010-01-12 11:10:54","16","42051","<p>Recently I have been having quite some problems with R.java file. Now I have decided to do a backup and delete the file to see what happens.</p><p>Nothing happened, so I created an empty R.java file and hopped for the best. Now Eclipse seems to figure out that the file was tempered with and even issues a warning:</p><pre><code>R.java was modified manually! Reverting to generated version!</code></pre><p>And that's all there is. I tried building it manually but got no results. </p><p>So, I have two questions:</p><ol><li>what should I do to force Eclipse to generate the file</li><li>what is happening here? How is the file created, where is the code that is generating the file?</li></ol><p>I would appreciate any help. As usual the problem occurred just a few days before the deadline :)</p>","235910","","246263","","2012-12-30 16:14:28","2013-11-01 20:49:49","Magic behind R.java file","<android><eclipse><eclipse-plugin><r.java-file>","19","0","5","",""
"2048427","1","2048506","","2010-01-12 11:13:40","30","11142","<p>Can anyone provide me a code snippet to identify whether the phone is in Silent mode or not. <br/><br/>I am using Android 1.5. I tried by using ""android.provider.Settings.ACTION_SOUND_SETTINGS"". It is not working.<br/><br/></p>","179043","","932307","","2012-09-07 15:07:09","2012-09-07 15:07:09","how can I detect whether the android phone in Silent mode programatically","<android>","1","0","14","",""
"2048478","1","2048521","","2010-01-12 11:22:58","5","15546","<p>I have an HTC HERO andI need to push my application.apk<br> to the /system/app/ folder.</p><p>I've followed some tuts on rooting the device<br>and that is fine, but when I try to push my package to the system/app<br>folder, I get: ""permission denied"":  </p><pre><code>$ push /sdcard/myApp.apk /system/app/push: permission denied</code></pre><p>I also try:</p><pre><code>$ susu# push /sdcard/myApp.apk /system/app/push: not found</code></pre><p>Is this possible in a device that is not a developer intended device?</p><p>Thank you all!</p>","243376","","","","","2014-01-02 02:33:29","Push .apk to /system/app/ in HTC HERO","<android>","2","0","8","",""
"2048998","1","","","2010-01-12 12:52:35","0","7544","<p>I've got thumbnails which larger side is 70px (e.g 70x40 or 52x70).</p><p>I need to create a gray box 70x70px and put the thumbnail in it, so that image is aligned with the box at top vertically and center horizontally.</p><p>How to do that?</p><p>I've tried with an ImageView 70x70px, gray background, but image is not positioned as it should (it's in vertical and horizontal center, instead of vertical top and horizontal center).</p><p>I've also tried wrapping it with LinearLayout 70x70px, gray background and then positioning it, but then i get 1 or 2px line between LinearLayout and ImageView. I tried to set padding and margins to 0, but the gray line stays on...</p>","133648","","","","","2012-08-02 14:51:27","How to align image?","<android><layout>","3","0","","",""
"2049084","1","2049258","","2010-01-12 13:06:53","0","996","<p>Android Platform 1.5</p><ul><li>I open splash screen at the end i call finish() then i moved to browse page.</li><li>At the browse page when i click on home button it hide the application.(b/c of Android's Multi tasking feature)</li><li>When i go to Android's desktop launch application again it starts from splash screen.</li></ul><p>Android Platform 1.6</p><ul><li>I open splash screen at the end i call finish() then i moved to browse page.</li><li>At the browse page when i click on home button it hide the application.(b/c of Android's Multi tasking feature)</li><li>When i go to Android's desktop launch application again it always starts from browse screen instead of splash screen why is that ?</li></ul><p>I am putting all the data in onsave instance</p><pre><code>@Override protected void onSaveInstanceState(Bundle outState) {  outState.putString(WLConstants.READ_GPS, readGPS );  outState.putSerializable(WLConstants.SEARCH_CRITERIA, searchCriteria);  outState.putString(WLConstants.PARAM_WHERE, locationField.getText().toString());  outState.putBoolean(WLConstants.PARAM_NEAR_ME, rNearMe.isChecked());  super.onSaveInstanceState(outState);  Log.v(TAG, ""onSaveInstanceState()""); } </code></pre><p>i am extracting values from oncreate method</p><pre><code>public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);if(savedInstanceState != null){Log.v(TAG,""instace found"");}else{Log.v(TAG,""instace not found"");}}</code></pre><p>""Instance found"" never get called means it never returns bundle any reason why ?</p>","216431","","12704","","2010-01-30 00:51:27","2010-01-30 00:51:27","Android 1.5 and 1.6 afer calling finish activity and home button weird behavior","<android><savestate>","1","1","","",""
"2049590","1","","","2010-01-12 14:26:45","3","2262","<p>HelloI have Picture data in byte rgb_565 array, and I want convert it in a productive way into argb array. Right now I have found only one (little slow) way to do this:</p><pre><code>Bitmap mPhotoPicture = BitmapFactory.decodeByteArray(imageData, 0 , imageData.length);</code></pre><p>where <code>imageData</code> is my <code>byte[]</code> array in rgb_565, and then:</p><pre><code>int pixels[] = new int[CameraView.PICTURE_HEIGHT*CameraView.PICTURE_WIDTH];mPhotoPicture.getPixels(pixels, 0,PICTURE_WIDTH, 0, 0, PICTURE_WIDTH, PICTURE_HEIGHT);</code></pre><p>The point is I believe creating a <code>Bitmap</code> object is exacting and not necessary in this case. Is there any other faster way to convert rgb_565 array into argb array? </p><p>I need this because making image processing on rgb_565 array seems to be a little annoying. Or maybe it is not so hard?</p>","248190","","3171","","2010-01-12 14:39:33","2010-01-12 14:40:47","Android - converting byte rgb_565 array into argb or rgb array","<android><image-processing><image-manipulation>","1","0","4","",""
"2050255","1","2050304","","2010-01-12 15:57:28","6","1526","<p>With the iPhone, Apple has a system of free codes you can send to reviewers so they can install the app for free.  Is there a way to do this with paid Android apps?</p>","148736","","334849","","2013-05-21 12:30:39","2013-05-21 12:30:39","how do I give out free review copies of my paid android app?","<android><review>","1","1","2","",""
"2050263","1","2051953","","2010-01-12 15:59:30","111","130918","<p>I've been searching on how to add a barcode scanner to my app.  Does anybody know of any examples or know how to do this easily?  Any help is greatly appreciated.</p>","235708","","235708","","2010-12-15 20:06:37","2014-01-04 19:40:31","Using ZXing to create an android barcode scanning app","<android><barcode><barcode-scanner><zxing>","5","0","116","",""
"2050533","1","4286537","","2010-01-12 16:35:28","7","5322","<p>I have a list view and an adapter that sets alternating background colors to the list items (""zebra"" list style):</p><pre><code>public View getView(final int position, View convertView, ViewGroup parent) {    int colorPos = position % colors.length;    ...    convertView.setBackgroundColor(colors[colorPos]);    return convertView;}</code></pre><p>But now, when i select an item using scroll wheel, or when I click an item, the original colors for selecting/clicking do not override my custom backgrounds (I can see the original color below the one I set).</p><p>How can I set the original colors for these states?</p>","133648","","","","","2010-11-29 10:48:24","List items with alternating colors","<android><listview><adapter>","2","0","3","",""
"2050693","1","","","2010-01-12 16:56:18","0","79","<p>What is the relationship between android:layout_width &amp; android:layout_height in the container and the views contained within?</p><p>For instance if I have a LinearLayout with the layout width and height set to fill_parent, and I have a Button with those values set to wrap_content it uses the value from the Button, like the Button values overide the LinearLayout.</p><p>However if i swap them around so that the LinearLayout values are both wrap_content and the Button values are now fill_parent it still uses wrap_content, this time not overriding the values, but using the values supplied with the LinearLayout.</p><p>Could someone explain how they relate as this is very confusing to me?</p><p>Thanks</p><p>Kyros</p>","249075","","","","","2010-01-12 17:30:05","Hierachy of android:layout_width/ height between containers and views","<android>","1","0","","",""
"2050731","1","","","2010-01-12 17:01:06","2","9164","<p>Again a question. This time I'm parsing XML messages I receive from a server.Someone thought to be smart and decided to place HTML pages in a XML message. Now I'm kind of facing problems because I want to extract that HTML page as a string from this XML message. </p><p>Ok this is the XML message I'm parsing:</p><p><code>&lt;AmigoRequest&gt;&lt;From&gt;&lt;/From&gt;&lt;To&gt;&lt;/To&gt;&lt;MessageType&gt;showMessage&lt;/MessageType&gt;&lt;Param0&gt;general message&lt;/Param0&gt;&lt;Param1&gt;&lt;html&gt;&lt;head&gt;test&lt;/head&gt;&lt;body&gt;Testhtml&lt;/body&gt;&lt;/html&gt;&lt;/Param1&gt;&lt;/AmigoRequest&gt;</code></p><p>You see that in Param1 a HTML page is specified. I've tried to extract the message the following way:</p><pre>public String getParam1(Document d) {        if (d.getDocumentElement().getTagName().equals(""AmigoRequest"")) {            NodeList results = d.getElementsByTagName(""Param1"");            // Messagetype depends on what message we are reading.                       if (results.getLength() > 0 && results != null) {                                return results.item(0).getFirstChild().getNodeValue();            }        }        return """";    }</pre><p>Where d is the XML message in document form.It always returns me a null value, because getNodeValue() returns null.When i try results.item(0).getFirstChild().hasChildNodes() it will return true because he sees there is a  tag in the message.</p><p>How can i extract the html message <code>&lt;html&gt;&lt;head&gt;test&lt;/head&gt;&lt;body&gt;Testhtml&lt;/body&gt;&lt;/html&gt;</code> from Param0 in a string?</p><p>I'm using Android sdk 1.5 (well almost java) and a DOM Parser.</p><p>Thanks for your time and replies.</p><p>Antek</p>","218610","","218610","","2010-01-13 08:54:54","2011-01-31 11:18:30","Android: Parsing XML DOM parser. Converting childnodes to string","<java><xml><android><parsing><dom-parser>","5","2","2","",""
"2051102","1","2051372","","2010-01-12 17:51:49","2","802","<p>I've read that there is a jit compiler module for dalvik vm on the works and the results are quite promising. Some people claim an improvement of 100% in terms of execution speed. Does anyone have an idea when it is going to be incorporated in an android release? The amount of RAM on the nexus one (512MB) hints that a jit may be introduced soon. Android 2.5 maybe? </p>","236237","","","","","2011-02-09 17:20:53","Is android getting a jit compiler soon?","<android><jit><dalvik><nexus-one>","3","0","","",""
"2051153","1","2051233","","2010-01-12 18:00:06","14","11695","<p>There is an event listener in Android called <strong>DatePicker.OnDateChangedListener</strong>. I am trying to set a DatePicker view's on date changed listener as follows:</p><pre><code>DatePicker dp = new DatePicker(getContext());dp.setOnDateChangedListener(this); //where this is my activity extends DatePicker.OnDateChangedListener</code></pre><p>But guess what? Date picker does not have a method called <strong>setOnDateChangedListener</strong>.</p><p>My question is: </p><ol><li>How then do you set a date changed listener in Android?  </li><li>If it is not possible to set a date changed listener, what is the purpose for this event?</li></ol><p>Any documentation/tutorials will be very helpful.</p>","61525","","168225","","2010-05-20 18:52:00","2013-05-16 09:38:18","Android - OnDateChangedListener - how do you set this?","<android><android-datepicker>","3","0","1","",""
"2051541","1","2052163","","2010-01-12 18:57:22","2","2722","<p>I am catching keyboard events/presses using the onKey method:</p><pre><code>public boolean onKey(View arg0, int arg1, KeyEvent arg2) {    //do something    return false;}</code></pre><p>This fires off just fine for physical keyboard presses but it does not fire on virtual keyboard presses. Is there an event handler to handle virtual keyboard presses?</p>","236300","","","","","2010-07-27 12:19:43","Android onKey w/ virtual keyboard","<java><android>","3","0","","",""
"2051745","1","2055820","","2010-01-12 19:31:48","2","3662","<p>I've two phones, the HTC Magic and since today also the MotorolaMilestone.</p><p>While the Magic works perfectly, I'm not able to access the Milestonevia USB (adb devices).</p><p>Here are my log outputs and settings for both:</p><p><strong>HTC Magic</strong></p><p><strong>lsusb:</strong></p><pre><code>Bus 001 Device 009: ID 0bb4:0c02 High Tech Computer Corp.</code></pre><p><strong>/etc/udev/rules.d/51-android.rules:</strong></p><pre><code>SUBSYSTEM==""usb"", SYSFS{idVendor}==""0bb4"", MODE=""0666""</code></pre><p><strong>/var/log/messages</strong></p><pre><code>Jan 12 20:05:44 ubuntu kernel: [  764.343311] scsi 9:0:0:0: Direct-Access     HTC      Android Phone    0100 PQ: 0 ANSI: 2Jan 12 20:05:44 ubuntu kernel: [  764.343826] sd 9:0:0:0: Attached scsi generic sg2 type 0Jan 12 20:05:44 ubuntu kernel: [  764.353414] sd 9:0:0:0: [sdb] Attached SCSI removable disk</code></pre><hr><p><strong>Motorola Milestone</strong></p><p><strong>lsusb:</strong></p><pre><code>Bus 001 Device 010: ID 22b8:41da Motorola PCS</code></pre><p><strong>/etc/udev/rules.d/51-android.rules:</strong></p><pre><code>SUBSYSTEM==""usb"", SYSFS{idVendor}==""22b8"", MODE=""0666""</code></pre><p><strong>/var/log/messages</strong></p><pre><code>Jan 12 20:10:09 ubuntu kernel: [ 1028.580017] usb 1-3: new high speedUSB device using ehci_hcd and address 11Jan 12 20:10:09 ubuntu kernel: [ 1028.731068] usb 1-3: configuration#1 chosen from 1 choice</code></pre><hr><p><strong>Notes</strong></p><ul><li>USB Debugging is enabled on both phones</li><li>After changing the udev rules I did a ""service udev reload"" and""adb kill-server"" -> didn't help</li><li>I even tried to restart the whole machine. Without success.</li></ul><p>Anyone encountered a similar problem and had a solution? </p>","184367","","","","","2012-04-23 14:30:14","Can't access Motorola Milestone on Ubuntu 9.10 via adb (HTC Magic works perfectly fine)","<android><hardware><usb><motorola><milestone>","3","3","1","",""
"2052299","1","2124511","","2010-01-12 20:55:50","14","10964","<p>I have got my android app that uses HttpClient to reach my servletdeployed on my Tomcat. It is installed on my HTC Magic.</p><p>If I launch it when connected on Wifi : it works.If I launch it when connected to 3G (GSM data network) : it doesn't work but my servlet is reached. In other word, it seems that my phone never get the response :</p><pre><code>Technical problem while receiving response.org.apache.http.NoHttpResponseException: The target server failed to respond   at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:85)   at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:174)   at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:179)   at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:235)   at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:259)   at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:279)   at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:121)   at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:410)   at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)   at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)   at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)</code></pre><p>If I use the web browser through 3G to activate the test HTML page that is packaged with my servlet, it reaches the same servlet with success (the page receives the response).</p><p>How could I debug HttpClient or ask it to dump everything ?</p><p>Does someone have a clue on what's going on ?</p>","249234","","1288","","2011-03-24 01:28:34","2012-12-18 07:31:12","HttpClient on Android : NoHttpResponseException through UMTS/3G","<android><http>","3","3","10","",""
"2052461","1","","","2010-01-12 21:16:12","1","1391","<p>How to register a content observer to listen for changes in the contact database in android 2.0? What URI should I use? </p><p>Thank you</p>","249267","","3043","","2010-06-03 04:31:19","2011-04-06 17:10:10","How to register listening for Contact changes on android 2.0?","<android><content><observer-pattern><android-2.0-eclair>","1","4","1","",""
"2052589","1","2053310","","2010-01-12 21:37:42","2","2265","<p>I got back to the widget development after upgrading to the latest SDK and all of the sudden my widget is failing on startup with this message:</p><pre><code>ERROR/AndroidRuntime(5296): java.lang.RuntimeException: Unable to start receiver topjob.widget.SearchWidget: java.lang.SecurityException: Permission Denial: attempt to change component state from pid=5296, uid=10057, package uid=10048</code></pre><p>Here's two lines of code where exception occurs:</p><pre><code>@Overridepublic void onEnabled(Context context) {    PackageManager pm = context.getPackageManager();    pm.setComponentEnabledSetting(new ComponentName(""topjob"",            "".widget.SearchWidgetBroadcastReceiver""),             PackageManager.COMPONENT_ENABLED_STATE_ENABLED,            PackageManager.DONT_KILL_APP);    startAlarm(context, UPDATE_RATE_SEC);}</code></pre><p>so in the code above <code>startAlarm()</code> is never executed since <code>pm.setComponentEnabledSetting()</code> throws the SecurityException</p><p>Am I missing any security settings in my manifest? Currently I have:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;&lt;uses-permission android:name=""android.permission.WAKE_LOCK"" /&gt;</code></pre><p>I'm developing for <code>SDK v. 1.5</code> and it used to work fine</p><p>P.S. It happens on the phone and the emulator</p>","135946","","135946","","2010-01-12 23:26:47","2012-06-26 06:17:39","Android - can't enable BroadcastReceiver","<android><broadcastreceiver><securityexception>","4","3","","",""
"2052629","1","","","2010-01-12 21:41:38","0","514","<p>I have registered a BOOT_COMPLETED Receiver in my application, i want to listen for changes on SMS Database. </p><p>The BroadcastReceiver starts a temporary Service which registers the ContentObserver.Now i want to notify my main activity (which is not started) that the Observer was registered successful.(I want to do this, because if a user installs the app for the first time he don't restart his phone but needs the ContentObserver too. If you have another idea how to do that you can post it. I just want the information that the observer is registered already)</p><p>My idea was to notify the activity with a static attribute:     MyActivity.sObserverRegistered = true</p><p>But i think that is not good and doesn't work because the activity isn't started and this is ignored. Any idea how to solve the problem?</p><p>thanks</p>","142405","","","","","2010-01-12 22:20:01","How to inform your (not started) app from a Boot_completed receiver?","<android>","1","0","","",""
"2052833","1","2052910","","2010-01-12 22:09:42","1","677","<p>This is probably a really dumb/noob like question but what is the best method to have an .apk file that when installed drops a zip file onto the sd card, in a specific directory, from the assets or raw folder?</p>","244048","","","","","2010-01-12 22:24:31","Zip to SD Card from .APK file","<android>","1","0","1","",""
"2052955","1","2052991","","2010-01-12 22:32:19","1","1838","<p>I have the following code to intantiate a SimpleCursorAdapter to use with a ListView. As you can see I have passed the R.layout.log_item to display the list items, and one value/control to bind to (TripDate). </p><pre><code>SimpleCursorAdapter sca = new SimpleCursorAdapter(this, R.layout.log_item,c,new String[] {DBAdapter.KEY_LOG_TRIPDATE},new int[]{R.id.txtTripDate});</code></pre><p>this works</p><p>I currently only have one widget in the layout xml, a TextView to hold the TripDate.How do I pass multiple binding parameters for the additional widgets in the layout? so I can also display other info.</p><p>thankspatrick</p>","249332","","","","","2010-01-12 22:46:12","SimpleCursorAdapter - Binding to multiple item values in ListView","<android><listview>","1","0","","",""
"2052999","1","2053384","","2010-01-12 22:38:40","4","3843","<p>1) Our Android app will store data in a built-in SQLite DB.</p><p>I see the DB can throw android.database.sqlite.SQLiteFullException, but there's no exact info in API what is the limit.</p><p>Could anyone tell what are the size limits for a DB in order not to get into the SQLiteFullException?</p><p>I assume DB will store data in device's internal storage (versus SDCard). Am I right? Given SQLite DB is just a file, probably the DB size is limited with free internal storage space. Again - Am I right? If yes, then what is the internal storage size on Android? How to detect it? Does it vary on a device model basis or OS version basis?</p><hr><p>2) We'll also need to save app settings. I think SharedPreferences will fit nicely. However the question is - are SharedPreferences saved to the internal storage too? If yes, then is it the same storage where the DB stores its file?</p><p>Thanks in advance!</p>","247013","","","","","2010-01-12 23:53:06","Android internal storage - what are the limits?","<android><size><storage><limit><internal>","1","2","1","",""
"2053240","1","","","2010-01-12 23:27:25","0","1373","<p>In order to learn how to use the AlarmManager I created an activitythat consists of a single button. When the button is pressed theactivity creates an Intent of itself and loads it into theAlarmManager 3 seconds in the future before finishing.</p><p>So activity opens, user pushes button, activity closes, 3 secondslater activity opens, repeat.</p><p>Problem is instead of opening an activity 3 seconds later I get anerror:""The application [myappname] has stopped unexpectedly. Please tryagain."" Except when I call a Toast instead, that worked.</p><p>Here's the code for the button:</p><pre><code>thanksButton.setOnClickListener(new View.OnClickListener() {               public void onClick(View view) {               setResult(RESULT_OK);               Intent intent = new Intent(myappname.this,myappnameBroadcastReceiver.class);               PendingIntent appIntent = PendingIntent.getBroadcast(myappname.this, 0, intent, 0);               Calendar calendar = Calendar.getInstance();               calendar.setTimeInMillis(System.currentTimeMillis());               calendar.add(Calendar.SECOND, 3);               AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);               am.set(AlarmManager.RTC, calendar.getTimeInMillis(),appIntent);               finish();               }       });</code></pre><p>Here's the broadcast receiver:</p><pre><code>package com.myappname;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;public class myappnameBroadcastReceiver extends BroadcastReceiver {       @Override       public void onReceive(Context context, Intent intent) {                       context.startActivity(new Intent(context, myappname.class));       }}</code></pre><p>and here's the lines from the manifest.xml</p><pre><code>       &lt;receiver               android:name="".myappnameBroadcastReceiver""               android:process="":remote""&gt;       &lt;/receiver&gt;</code></pre>","249363","","","","","2012-11-26 11:38:58","AlarmManager and the PendingIntent that failed","<android><android-emulator>","1","0","1","",""
"2053370","1","2053929","","2010-01-12 23:50:31","6","2133","<p>I want to release an app on the market. It uses nothing new from the 2.0 release like bluetooth for instance and it works well in every emulator using version 1.6 to 2.1.</p><p>My question is upon version of the sdk should I distribute my application to make it compatible with all devices running 1.6, 2.0 or 2.1?</p><p>I only have a physical device running 1.6 to test it, but as I say, it uses nothing fancy and works well on emulators using API levels 4, 5, 6 or 7.</p><p>Thanks</p>","87883","","881229","","2014-01-24 06:14:34","2014-01-24 06:14:34","which android sdk version to release to market?","<android><google-play><distribution>","5","0","2","",""
"2053440","1","2714085","","2010-01-13 00:05:58","1","1157","<p>I am developing the camera module for an android application.In main application when user clicks on 'take picture' button, new view with SurfaceView control is opened and camera preview is shown. When users click on dpad center, camera takes picture and save it to the disc. Pretty simple and straightforward. </p><p>Everything works fine on my device - HTC Tattoo, minsdkversion 1.6</p><p>...but when I tested application on HTC Hero minsdkversion 1.5, when camera preview is shown,some strange lines occur. </p><p>Anyone has idea what is going on?</p><p>p.s. altough preview is crashed, taking of pictures works fine</p><p>here is the picture<img src=""http://img163.imageshack.us/img163/4088/camerademo.jpg"" alt=""alt text"">:</p><p>ThanxMarko</p>","70324","","723980","","2011-03-16 18:51:41","2011-03-16 18:51:41","camera preview on android - strange lines on 1.5 version of sdk","<android><camera>","1","2","","",""
"2053712","1","","","2010-01-13 01:09:08","1","1241","<p>I'm thinking of creating an answering machine in android that automatically alerts the caller that he/she has reached the answering machine after an alloted time and then records the message. Is it possible in android?</p>","249427","","635608","","2013-06-22 05:26:34","2013-07-28 00:29:36","Is it possible to create a simple answering machine in android?","<android><audio-recording>","1","0","","2013-10-03 12:32:34",""
"2054563","1","","","2010-01-13 05:03:34","0","145","<p>Recently android have launch 2.1 version, so i just want to ask, can phone running on 1.6 version are upgradable to 2.1 version.</p>","201521","","","","","2010-01-13 11:45:41","Is android phone are upgradable to new vaesion platform","<android>","3","2","","",""
"2054579","1","","","2010-01-13 05:08:24","0","8597","<p>I've searched and I know it seems some people frown upon using activities within tabs, but moving past that...how would I restart a tabbed activity while still keeping the tabs visible? I have an activity in a tab, I use the menu to create a new activity to update the tab's activity displayed info, when I return from the menu activity I want the new information to be displayed in the tab's activity. I am using startActivityForResult() from the menu choice, but when I return and try to restart the activity...it wipes out the tabs above(I guess as expected, but I want to re-launch the refreshed activity within the tab).</p><p>Creating the tabs:</p><pre><code>  TabHost host = getTabHost();  Intent home_intent = new Intent(constants.HOME_ACTION,    null, this, homeTab.class);  Intent inbox_intent = new Intent(constants.INBOX_ACTION,    null, this, inboxTab.class);  Intent stats_intent = new Intent(constants.STATS_ACTION, null,    this, infoTab.class);  host.addTab(host.newTabSpec(constants.HOME_TAG)    .setIndicator(getText(R.string.home_label),      getResources().getDrawable(R.drawable.icon))    .setContent(home_intent));  host.addTab(host.newTabSpec(constants.INBOX_TAG)    .setIndicator(getText(R.string.inbox_label),      getResources().getDrawable(R.drawable.icon))    .setContent(inbox_intent));  host.addTab(host.newTabSpec(constants.STATS_TAG)    .setIndicator(getText(R.string.stats_label),      getResources().getDrawable(R.drawable.icon)).setContent(      stats_intent));</code></pre><p>Return from the menu activity in the tab's activity(updating database info):</p><pre><code>  public void onActivityResult(int requestCode, int resultCode, Intent data) {       super.onActivityResult(requestCode, resultCode, data);   switch(requestCode) {   case (constants.ACTIVITY_REQUEST_CODE_UPDATE_PROFILE) : {    if (resultCode == Activity.RESULT_OK) {     boolean profileUpdated = data.getBooleanExtra(constants.ACTIVITY_BUNDLE_UPDATE_PROFILE, false);    Log.d(LOG_TAG, ""activity returned with "" + profileUpdated);    // Check to see if we updated our profile to refresh the screen    if(profileUpdated == true){     // Refresh the screen with the new info     homeTab.this.finish();     this.startActivity(getIntent());    }   }    break;   }   }  }</code></pre>","249531","","","","","2012-10-31 22:55:33","Android: How to restart an activity within a tabhost?","<android><tabs><activity><restart>","5","0","1","",""
"2054828","1","2055460","","2010-01-13 06:18:24","14","8923","<p>I had a question related to whether or not (and how) I should store images loaded from the web.  Let's say I am calling a web service from my Android app.  In this web service I get a URL for an image on the web.  I download and show this image on the left side of a list item in a ListView.  My question is, what method should I use for possibly storing the image?  Should I:</p><ol><li>Save it to the SDCard, checking if it exists when the ListView is created (on subsequent requests) and re-downloading as necessary (while updating the image occasionally, in case it changes).</li><li>Store it in the cache using Context.getCacheDir(), but possibly being forced to re-download it more often since I cannot rely on the image staying in the cache.</li><li>Always download it and never store the image.</li></ol><p>The image files themselves are fairly small, but I expect some users could have dozens of these small images downloaded/stored.  Which would work best, and/or what is the preferred method?</p><p>As a side question, should I load all of the images in my ListView first (and possibly lock the UI for some time) or load them asynchronously but show a placeholder graphic in the meantime (which might be a bit more ""ugly"")?  What's the standard here?</p>","164312","","164312","","2010-01-13 06:24:44","2013-02-12 06:01:02","Android - Storing images downloaded from the web","<android><caching><storage><sd-card>","4","1","19","",""
"2054945","1","2055219","","2010-01-13 06:48:28","3","3142","<p>Most smartphones use modern browser engines that have implementing HTML 5 (or at least partially). Should I start using HTML 5 for my web application ? Where can I find a list of browser engines used by most popular devices (iPhone,Android,etc.) ? My application doesn't have to work on older desktop browsers.</p>","96855","","96855","","2010-01-13 07:31:02","2010-01-13 09:33:11","Can I start using HTML 5 for my smartphone app?","<iphone><android><html5><smartphone>","4","0","1","",""
"2055509","1","2056819","","2010-01-13 09:09:04","42","46427","<p>Is there any android widget that enable to pick the date and the time at the same time ?I already use the basic <a href=""http://developer.android.com/guide/tutorials/views/hello-timepicker.html"">time picker</a> and <a href=""http://developer.android.com/guide/tutorials/views/hello-datepicker.html"">date picker</a>.</p><p>But they are not that sexy and user friendly (I found). Do you know if a widget including both date and time exists?Thanks a lot,Luc</p>","231957","","1403593","","2012-09-30 16:02:52","2014-03-25 06:11:47","DateTime picker in android application","<android><android-widget>","11","0","9","",""
"2055806","1","","","2010-01-13 10:03:02","1","2179","<p>I  am developing an ANDROID small application. It will just handle connecting et and managing one facebook and twitter account.</p><p>How this can be done on ANdroid plateform ?</p><p>Can someone show me a ressource wich can help me?</p>","199826","","1343690","","2013-09-08 18:28:36","2013-09-08 18:28:36","Facebook and twitter API","<android><facebook><twitter>","3","2","2","",""
"2056163","1","2056311","","2010-01-13 11:18:03","9","9437","<p>I'm using</p><pre><code>myLocation = mLocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);</code></pre><p>to retrieve the current location at the start-up of my application.</p><p>As the Android documentation states, this location can be ""out-of-date"", since the method  returns the location when the GPS was used the last time. </p><p>How can I <strong>actively</strong> request the current location from the GPS? I thought about using <code>LocationListener</code>, however that might be a bit of an overkill, since I only need the location once (at the start of my app).</p><p>Any ideas?</p>","184367","","","","","2010-01-13 11:44:39","Android: getLastKnownLocation out-of-date - how to force location refresh?","<android><geolocation><gps>","1","0","5","",""
"2056717","1","2791323","","2010-01-13 12:57:45","5","10211","<p>I'm trying to debug a native shared library that my App uses through JNI. I can attach to a running app just fine with ""gdbserver --attach pid"" but i need to actually launch my app when i launch the gdbserver command.</p><p>There's a million blog hits on this topic but none of them seem to be clear as to how you launch your app. They all say to just type ""gdbserver 10.0.2.2:1234 ./MyProgram"" but what exactly is ""MyProgram"". Is that MyProgram.apk? Is it MyProgram.so? Is it some other file that gets created when the app is installed? If so, what's its path?</p>","57662","","","","","2011-10-05 16:49:55","How to debug an App on Android with GDBSERVER?","<android><debugging><gdb><jni><gdbserver>","2","0","2","",""
"2057459","1","","","2010-01-13 14:50:24","0","1034","<p><strong>Hi</strong></p><p>I have a layout which contains a ListView. Each View (row) in this ListView is a LinearLayout which contains 3 Views - CheckBox, ImageView and a TextView (Horizontal)</p><p>My problem is like this - if I use the trackball to highlight a row in the ListView , it works (row's background color is Orange). By clicking on the trackball when a row is highlighted, I switch the current displayed layout to another one (setContentView()). Now, if re-displays the original layout with the ListView (I store its instance for re-displaying it, it is not being re-created!), the highlighted row is NOT highlighted anymore. According to google this is OK, and the highlight will come back as soon as I'll use the trackball.</p><p>The real problem is that even if I use the trackball to move up or down in the list now, no other row in the ListView becomes highlighted. Instead, in each row which should be highlighted as a result of the scrolling, the TextView becomes selected and I know that since I set the TextView to be ticking (TruncateAt.MARQUEE).</p><p>ONLY if I CLICK the trackball, then the highlight comes back to the row which its TextView is ticking at the moment.</p><p>I've tried to solve this problem by setting the TextView as not focusable, not clickable, and disabled. I even tried to set setItemsCanFocus(false) on the ListView - still with no success.</p><p>Please help me...</p><p>Thank you!</p>","239193","","","","","2010-01-13 16:02:00","Android ListView loses highlight problem","<android>","1","3","","",""
"2057804","1","2062993","","2010-01-13 15:28:00","6","12105","<p>I need to create an Android library which I can include as a jar in any Android application. I use NetBeans 6.8, the nbandroid plugin, and the Android SDK.</p><p>The steps I took so far are:</p><p>1) Create the library project, with android.jar included to have access to Android classes (the library uses android.util.Log and other Android classes).</p><p>2) Compile the library as a jar.</p><p>3) Add the library's jar to the Android application (right-click on Libraries under the project node and add the jar).</p><p><del>4) Add &lt;uses-library&gt; to the Android manifest.</del> (erroneous and unnecessary)</p><p>Step 3 at least allows me to reference the library's classes in the application's source code, but the classes don't seem to actually be included at compile time. When I run the application, I get the following error in the log.</p><pre><code>I/dalvikvm(  349): Could not find method mylibrarypackage.MyClass.myMethod, referenced from method myapplicationpackage.HomeActivity.onCreateW/dalvikvm(  349): VFY: unable to resolve static method 985: Lmylibrarypackage/MyClass;.myMethod ()VD/dalvikvm(  349): VFY: replacing opcode 0x71 at 0x000aD/dalvikvm(  349): Making a copy of Lmyapplicationpackage/HomeActivity;.onCreate code (160 bytes)D/AndroidRuntime(  349): Shutting down VMW/dalvikvm(  349): threadid=3: thread exiting with uncaught exception (group=0x4001b188)E/AndroidRuntime(  349): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(  349): java.lang.NoClassDefFoundError: mylibrarypackage.MyClassE/AndroidRuntime(  349):    at myapplicationpackage.HomeActivity.onCreate(HomeActivity.java:58)E/AndroidRuntime(  349):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)E/AndroidRuntime(  349):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)E/AndroidRuntime(  349):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470)E/AndroidRuntime(  349):    at android.app.ActivityThread.access$2200(ActivityThread.java:119)E/AndroidRuntime(  349):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)E/AndroidRuntime(  349):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  349):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  349):    at android.app.ActivityThread.main(ActivityThread.java:4310)E/AndroidRuntime(  349):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  349):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  349):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime(  349):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime(  349):    at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Do I have to add the library to the build path somewhere else? Am I missing something?</p>","249893","","249893","","2010-01-14 08:49:07","2010-01-14 09:20:12","How can I use an external jar in an Android project in NetBeans?","<android><netbeans><jar>","3","0","2","",""
"2057814","1","","","2010-01-13 15:28:49","0","1638","<p>I'm trying to figure out if its possible for programmers to build an itunes client app for iphone or android where the user has the option to browse and listen to the song preview, something similar to this page: <a href=""http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?playlistId=114688"" rel=""nofollow"">itunes link maker</a></p><p>I greatly appreciate any pointers or links in this direction</p><p>thanks</p>","249924","","","","","2010-03-14 16:29:57","how to play the 30 seconds sample itunes music","<iphone><android><itunes>","2","0","","",""
"2058376","1","2063219","","2010-01-13 16:29:35","0","2847","<p>i am new to Android developmenti have a web service made in php now i want to consume it in android can any one guide me how to achieve this..???</p><p>i have tried many code samples on net but failed to achieve this goal.i am using Eclipse with ADT. </p><p>any help would be appriciated.</p>","249991","","","","","2011-05-10 09:27:34","How to Consume Web service in Android?","<java><android><eclipse>","3","2","","",""
"2058450","1","2058459","","2010-01-13 16:39:18","22","7637","<p>I'm new to Android, but have published iphone and bberry apps.  I see that I have to create an emulator using the SDK, before I can write and test an app.  Why are there no default emulators?  Why not at least a Nexus one, or HTC hero emulator shipped with the product?</p><p>Sure its supposed to be flexible, but why not make it easy to create hello world and play around with a virtual Android phone?  Both blackberry and iphone come with default simulators when you download the sdk.</p><p>Thanks,Gerry</p>","250007","","21234","","2010-01-13 16:41:38","2010-03-25 13:30:30","Why not standard Android emulators?","<android><android-emulator>","6","1","3","",""
"2058612","1","","","2010-01-13 17:00:21","0","1419","<p>Since I'm a newbie I don't know if I'll be explaning this correctly. But here goes it.</p><p>I'm trying from main Activity (MainFile.java) to open a Map as a new intent through a menu. Something like this...</p><pre><code>switch(item.getItemId()) {        case VIEW_AROUND:            **Intent cityMap = new Intent(MainFile.this, Map.class);            startActivity(cityMap);**            return true;        case EXIT:            this.finish();            return true;        }</code></pre><p>... and I already have set up thing on my manifest.xml with access to...</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;&lt;activity android:name="".Map"" /&gt;</code></pre><p>... It worked fine with other File.class, but with the Map.class doesn't seem to be working.</p><p>Might it be a better way to approach it? Is it anywhere I should be looking for the issue? </p><p>I cannot think of anything else :(</p><p>Many thanks in advance!</p>","89008","","","","","2010-01-13 20:25:53","How to open an Intent (MapView) from the Main activity with menu in Android","<java><android><mobile><android-manifest>","1","2","","",""
"2058712","1","2058820","","2010-01-13 17:13:30","2","1460","<p>I'm using Wakelock in my application to prevent the phone from sleeping when the app is visible.</p><p>The problem comes when there is an orientation change and the system destroys and re-creates the app in landscape mode. If the wakelock timer has expired in the background the system takes the release of wakelock as an opportunity to switch off the screen.</p><p>Edit: I should mention that I am setting Wakelock onResume, and releasing onPause - as I understand it, it's necessary to release then to prevent the app from leaking the wakelock.</p><p>I need wakelock to continue through the orientation change.</p><p>Below I've outlined a solution to this. Is this the preferred way to handle it, and are there any alternatives?</p><hr><p>Create a service which holds wakelock (rather than the activity) and when the activity unbinds the service starts a countdown timer (for say 10 seconds) in which it will release wakelock when the timer expires if the activity does not rebind. If it was a simple orientation change the activity will rebind within that 10 seconds and so maintain wakelock, if it doesn't, wakelock will be released.</p><p>Thanks.</p>","172749","","172749","","2010-01-13 18:11:42","2014-02-05 00:20:56","Android: Wakelock & handling orientation change","<android><service><activity><orientation>","2","0","","",""
"2058791","1","","","2010-01-13 17:23:34","1","1090","<p>If I want to render just a huge map, what is the best practice when using OpenGL ES with a mobile device (Android or iPhone based)?</p><p>What is the best structure to contain all the vertices, normales and texture coordinates?</p><p>I guess using a interleaved structure may give you some performance benefits caused by memory caching. Ok?</p><p>Should I use drawArrays or drawElements to push my data to OpenGL ES?</p><p>Well, I did no testing at all but I might think, that drawElements might be faster if the GFX does not use shared memory since you do not have to push that much data. Since this is really close to metall, what do you think? (the iPhone is ARM based while the Android platform is Qualcomm based (also an ARM?))</p><p>Best regards,</p><p>Friedrich</p>","250011","","","","","2010-06-02 07:15:06","OpenGL ES - huge map, best practice","<iphone><android><opengl-es>","2","1","","",""
"2058945","1","2059259","","2010-01-13 17:44:54","31","42321","<p>I'm confused about how VideoView can be used to play video: from a local file, as progressive download and streaming.</p><p><a href=""http://davanum.wordpress.com/2009/12/04/android-%E2%80%93-videomusic-player-sample-take-2/"">This example</a> work for me (on 1.5 and 2.0 at least) by downloading the file and playing it locally. </p><p>But is it necessary to download the video before playing: is it possible to play video as progressive download, or by streaming, simply by using setVideoPath or setVideoURI, as in VideoViewDemo in the API samples?</p><p>The VideoViewDemo code suggests using setVideoURI for streaming, but I'm not clear what kind of URL I should be using.  Does someone have an example URL for a video that can be streamed to the Android emulator using the VideoViewDemo code? </p><p>Can progressive download be used with VideoViewDemo? I get a 'sorry, this video cannot be played' message using setVideoPath with URLs that work fine with the blog example linked to above.(Is this a problem in the emulator? I've tried 1.5 and 2.0.)</p><p>I've found a lot of examples and documentation online but, so far, nothing that really answers this question.</p>","51593","","","","","2013-07-22 22:32:42","Using VideoView for streaming or progressive-download video","<android><videoview>","3","2","29","",""
"2059344","1","2059471","","2010-01-13 18:53:10","6","4866","<p>In my Android app, I have a main activity that serves as an entry point to my application, which is configured in my manifest file like this : </p><pre><code>&lt;activity android:name="".Main""              android:label=""@string/app_name""              android:screenOrientation=""portrait""              android:alwaysRetainTaskState=""true""              android:launchMode=""singleTask""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>So for a particular use case, lets say a user starts up the app from the home screen by clicking the icon inside the application launcher. After starting the app, the user navigates from the Main activity to activity A and then finally to activity B. At this point, the user decides to check their facebook, so they click the home button to put my app in the background, and launches the facebook app. </p><p>After checking their facebook, the user wants to return to my app, so they press the home key, and launch the application from the application launcher (just like they did the first time it was launched).</p><p>When a user returns to my app, I want the app to return to the last activity the user was at when the app was put into the background, which in this case is activity B. In the manifest file, I have set alwaysRetainTaskState=true to make sure the OS doesn't kill my app's activities.</p><p>Now to my question: how do I get the behavior I described above? Whenever I click my app's icon, it always starts at the Main activity, no matter what. I think this is because of the category.LAUNCHER attribute. I have tried android:launchMode=singleTask, but it hasn't made a difference; it always starts at Main.</p><p>If someone could clarify intent filters, launch modes, and tasks, that would be great!</p>","236300","","","","","2012-11-05 10:36:57","Retaining android app state using alwaysRetainTaskState and lauchMode","<java><android><filter><manifest><android-intent>","3","0","1","",""
"2059454","1","2060708","","2010-01-13 19:07:22","2","2318","<p>I'm creating buttons dynamically ...  </p><pre><code>for(int i=0; i&lt;colSize;i++){    final Button btn = new Button(this);        btn.setText(SectionName[i]);            btn.setTextSize(10);    btn.setPadding(8, 3,8, 3);       btn.setTextColor(Color.WHITE);    btn.setTypeface(Typeface.SERIF, Typeface.BOLD);    btn.setOnClickListener(new OnClickListener() {          @Override        public void onClick(View v) {                           //***Every time that I click my button is selected !:)            btn.setSelected(true);              }                        });      }</code></pre><p>But how could I deselect the other buttons that were selected, I just want one Button selected! :)</p>","","Alexi","135946","","2010-01-14 01:31:17","2013-02-18 16:07:24","Creating Buttons Dynamically, Could I select one and deselect the other buttons?","<android><event-handling><android-widget>","2","2","2","",""
"2059538","1","2061070","","2010-01-13 19:21:24","-2","161","<p>i want to add some features to linux kernel to run on my mobile (android based mobile perhaps).but i don't know who let me to upload my custom kernel. i want to buy such mobile phone.some restrictions about uploading custom kernel to phone:   1- replace existing kernel.   2- can use my phones functionalities: it is due to some drivers are closed source and i must use the vendor's kernel to use it's drivers.   3- ...</p>","247584","","","","","2010-01-13 23:21:20","who in mobile phone market allow me to upload my customly compiled linux kernel to my phone","<android>","2","0","","",""
"2059693","1","2059753","","2010-01-13 19:44:40","25","3273","<p>The document says ""@[+]id/myid"" as the definition for android:id, from the notation it indicates that the plus is optional. But nowhere can I find a definition of what the plus sign means or not supplying it would mean.</p><p>What does it mean and why is it there?</p>","250161","","114066","","2010-07-28 14:04:34","2012-04-29 06:25:19","android:id what is the plus sign for","<android>","3","0","3","",""
"2059831","1","2611028","","2010-01-13 20:05:32","11","11031","<p>I'm currently developing an Android application that fetches images using http requests. It would be quite swell if I could cache those images in order to improve to performance and bandwidth use.</p><p>I came across the CacheManager class in the Android reference, but I don't really know how to use it, or what it really does.</p><p>I already scoped through this example, but I need some help understanding it:</p><p><a href=""http://gitorious.org/android-eeepc/base/blobs/33b7987c5c8fc2443b50e31246272ba42b4d1add/core/java/android/webkit/gears/ApacheHttpRequestAndroid.java"">/core/java/android/webkit/gears/ApacheHttpRequestAndroid.java</a></p><p>Also, the reference states:</p><blockquote>  <p>""Network requests are provided to this component and if they can not be resolved by the cache, the HTTP headers are attached, as appropriate, to the request for revalidation of content.""</p></blockquote><p>I'm not sure what this means or how it would work for me, since CacheManager's getCacheFile accepts only a String URL and a Map containing the headers. Not sure what the attachment mentioned means.</p><p>An explanation or a simple code example would really do my day. Thanks!</p><p><em>Update</em></p><p>Here's what I have right now. I am clearly doing it wrong, just don't know where.</p><pre>public static Bitmap getRemoteImage(String imageUrl) {        URL aURL = null;        URLConnection conn = null;        Bitmap bmp = null;        CacheResult cache_result = CacheManager.getCacheFile(imageUrl, new HashMap());        if (cache_result == null) {            try {                aURL = new URL(imageUrl);                conn = aURL.openConnection();                conn.connect();                InputStream is = conn.getInputStream();                cache_result = new CacheManager.CacheResult();                copyStream(is, cache_result.getOutputStream());                CacheManager.saveCacheFile(imageUrl, cache_result);            } catch (Exception e) {                return null;            }        }        bmp = BitmapFactory.decodeStream(cache_result.getInputStream());        return bmp;    }</pre>","49346","","","","","2010-12-24 21:33:04","How to use Android's CacheManager?","<android><caching><httpwebrequest>","2","2","2","",""
"2059862","1","2060095","","2010-01-13 20:08:59","0","3020","<p>I'm building an android app which should perform a GET on my site to get two cookies and then perform a post to the same site with these cookies. </p><p>As mentioned I start of with the GET and I'm using org.apache.http.client.HttpClient to perform this operation. </p><pre><code>String requiredCookies = """";HttpContext localContext = null;System.out.println(""------------------GET----------------------"");HttpClient httpClient = new DefaultHttpClient();HttpGet get = new HttpGet(""www.mysitegeturl.com"");//Creating a local instance of cookie store.CookieStore cookieJar = new BasicCookieStore();// Creating a local HTTP contextlocalContext = new BasicHttpContext();// Bind custom cookie store to the local contextlocalContext.setAttribute(ClientContext.COOKIE_STORE, cookieJar);HttpResponse response;try {    response = httpClient.execute(get, localContext);HttpEntity entity = response.getEntity();System.out.println(response.getStatusLine());if (entity != null) {   System.out.println(""Response content length: "" + entity.getContentLength());}//Do this so that Java.net impl should workList&lt;Cookie&gt; cookies = cookieJar.getCookies();for (int i = 0; i &lt; cookies.size(); i++) {     requiredCookies += cookies.get(i).getName()+""=""+cookies.get(i).getValue()+"";"";}if (entity != null) {    entity.consumeContent();}} catch (ClientProtocolException e1) {        // TODO Auto-generated catch block e1.printStackTrace();} catch (IOException e1) {    // TODO Auto-generated catch block    e1.printStackTrace();}System.out.println(""------------------GET-END---------------------"");</code></pre><p>So far so good. Don't mind the requiredCookies line yet, it will be used in the Java.net impl since I can't get the HttpClient one to work =(.Let's take a look at the non working HttpClient Post part.</p><pre><code>System.out.println(""------------------HttpClient - POST----------------------"");HttpPost post = new HttpPost(""www.mysiteposturl.com"");//Params       HttpParams params = new BasicHttpParams();params.setParameter(""foo"", ""post"");params.setParameter(""bar"", ""90"");params.setParameter(""action"", ""search"");post.setParams(params);post.setHeader(""Content-Type"", ""application/x-www-form-urlencoded"");try {    HttpResponse response2 = httpClient.execute(post, localContext);     System.out.println(response2.getStatusLine());} catch (ClientProtocolException e) {    // TODO Auto-generated catch block    e.printStackTrace();} catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();}System.out.println(""------------------POST END---------------------"");</code></pre><p>What happens now is that I perform a POST with the localContext where the cookies are stored. This doesn't work. I get a  HTTP/1.1 401 No session. Since I had no luck with this I tried another approach(java.net.HttpURLConnection). Remember I still use the same GET part</p><pre><code>URL url = new URL(""www.mysiteposturl"");HttpURLConnection connection = null;String dataString = ""bar=90&amp;foo=post&amp;action=search"";try {connection = (HttpURLConnection)url.openConnection();connection.setRequestProperty(""Cookie"", requiredCookies);//Set to POSTconnection.setDoOutput(true);Writer writer = new OutputStreamWriter(connection.getOutputStream());writer.write(dataString);writer.flush();writer.close();connection.connect();if (connection.getResponseCode() == 200 || connection.getResponseCode() == 201) {    System.out.println(connection.getContent().toString());} else {   System.out.println(""Error"");}} catch (IOException e) {   // TODO Auto-generated catch block     e.printStackTrace();} catch (MalformedURLException e) {   // TODO Auto-generated catch block   e.printStackTrace();}System.out.println(""------------------POST END---------------------"");</code></pre><p>And VIOLA a 200 is displayed and everything works like a charm. What do you guys think? Could someone please provide me with an answer because I can't figure it out.</p>","247071","","247071","","2010-01-13 20:16:52","2010-01-13 20:54:21","Why doesn't HttpClient work but HttpUrlConnenction do when posting data to form","<android><cookies><httpclient><httpurlconnection><urlconnection>","2","1","","",""
"2059933","1","","","2010-01-13 20:19:38","8","3288","<p>I'm try to use a remote URL (like a favicon) for a Notification Icon, however the Constructor for a Notification only accepts a resource id (which is an int), as opposed to something sensical like a FileInputStream.  How can I either, define at runtime a new resource id for a stream source, or download an icon to my resources and then dynamically get a resource id?</p>","36522","","","","","2012-08-08 19:38:52","Setting an Android Notification Icon to a remote URL","<android><resources><notifications>","2","1","","",""
"2060052","1","","","2010-01-13 20:37:34","2","7860","<p>I am trying to follow a simple splash screen example I found.  But I cannot get it to even compile.</p><p>First this is the source of the example:</p><p><a href=""http://www.anddev.org/simple_splash_screen-t811.html"" rel=""nofollow"">http://www.anddev.org/simple_splash_screen-t811.html</a></p><p>I am trying to put in into a form that would work for my program.</p><p>I created a class in Eclipse for this splash screen</p><p>com.ePN.ePNMobileAndroid.ePNSplash</p><p>Here is my current main.xml file.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:orientation=""vertical"" android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;     &lt;ImageView android:id=""@+id/splashscreen"" android:layout_width=""wrap_content""          android:layout_height=""fill_parent"" android:src=""@drawable/com.ePN.ePNMobileAndroid.splash""          android:layout_gravity=""center""/&gt;     &lt;TextView android:layout_width=""fill_parent""          android:layout_height=""wrap_content"" android:text=""Hello World, splash""/&gt;&lt;/LinearLayout&gt; </code></pre><p>And the class itself</p><pre><code>package com.ePN.ePNMobileAndroid;import android.app.Activity;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.view.View;import android.widget.ImageView; public class ePNSplash extends Activity {    private static final int STOPSPLASH = 0;    //time in milliseconds    private static final long SPLASHTIME = 3000;    private ImageView splash;    //handler for splash screen    private Handler splashHandler = new Handler() {         /* (non-Javadoc)          * @see android.os.Handler#handleMessage(android.os.Message)          */         @Override         public void handleMessage(Message msg) {              switch (msg.what) {              case STOPSPLASH:                   //remove SplashScreen from view                  splash.setVisibility(View.GONE);                   break;              }              super.handleMessage(msg);         }    };   /** Called when the activity is first created. */   @Override   public void onCreate(Bundle icicle) {       super.onCreate(icicle);       setContentView(R.layout.main);              splash = (ImageView) findViewById(R.id.splashscreen);              Message msg = new Message();              msg.what = STOPSPLASH;              splashHandler.sendMessageDelayed(msg, SPLASHTIME);   } }</code></pre><p>The XML has an error saying:</p><p>""no resource found that matches the given name (at src with value '@drawable/com.ePN.ePNMobileAndroid.splash')""</p><p>I have tried every way I can think to modify the android:src but it will not work.</p><p>The class is in error because it cannot resolve r_id.splashscreen in the find by id line.</p><p>This is all greek to me, how should this trivial xml and/or java file be modified to make this work?</p><p>Thanx</p><p>Julian</p>","250161","","","","","2012-03-20 14:30:03","Simple Splash Screen","<android>","1","2","2","",""
"2060074","1","","","2010-01-13 20:40:13","1","1394","<p>I'm retreiving data from an internet service.</p><p>Is there a way to control which (data) connection the device uses for connecting to a website?(access via wifi or via the cellular network)</p>","245625","","50776","","2011-05-23 15:55:34","2011-05-23 15:55:34","Android: internet access connection","<android><internet-connection>","2","0","1","",""
"2060701","1","2060727","","2010-01-13 22:17:31","4","1245","<p>I want to create an application in Android which communicates with a server application (written in C#, doesn't matter what version of .NET) on the PC via TCP/IP.What would be the best approach here?  </p><p>I was thinking about some kind of RPC-like SOAP or XML-RPC. But I want to keep the server application as light and simple as possible. And I think in C# you rely on a Webserver to set up an RPC server. Is it better to communicate directly via the TcpListener?</p>","250280","","309308","","2010-12-12 07:39:36","2010-12-12 07:39:36","Communicating between Android and PC (C#)","<c#><android>","2","0","1","",""
"2060949","1","2060969","","2010-01-13 22:59:02","4","584","<p>How can I code my Android application to start the web browser to display a given URL?</p><p>(I'd rather not embed a web browser component into my app, but rather want to start the Android web browser to show the URL.)</p><p>Thanks!</p>","21886","","","","","2013-07-19 13:09:16","How do I launch a URL from my application on Android?","<android><url><browser>","2","0","2","",""
"2061007","1","2062743","","2010-01-13 23:09:42","2","5775","<p>I've created a class that extends a View:</p><pre><code>public class BoardView extends View  {</code></pre><p>and I've specified the width and height of the BoardView in the application's main.xml file:</p><pre><code>  &lt;mypackage.BoardView        android:id=""@+id/board""                 android:layout_width=""270px""         android:layout_height=""270px"" /&gt; </code></pre><p>I'm trying to get the width and height from a function that is called from the BoardView's constructor. Here's what I'm doing:</p><pre><code>ViewGroup.LayoutParams p = this.getLayoutParams();int h = p.height;</code></pre><p>but getLayoutParams is always returning null.  Any idea why this isn't working?</p>","244104","","","","","2010-01-14 08:37:30","getLayoutParams returning null?","<android>","1","0","","",""
"2061143","1","2061447","","2010-01-13 23:36:28","4","4414","<p>My application has two activities, that I start in this order:</p><pre><code>HOME &gt; A &gt; B</code></pre><p>Now I press HOME and launch ""A"" again. I would like to see activity ""B"" on a top of ""A"", but instead I get ""A"" - so the activity stack is cleared.</p><p>Manifest:</p><pre><code>&lt;activity android:name="".activity.A"" android:label=""A"" android:alwaysRetainTaskState=""true""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.MAIN"" /&gt;        &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;&lt;activity android:name="".activity.B"" android:label=""B""&gt;    &lt;intent-filter&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>What should I do?</p>","62192","","62192","","2010-01-14 00:12:42","2010-11-18 19:02:54","Android: keep task's activity stack after restart from HOME","<android><activity-stack>","2","4","2","",""
"2061158","1","","","2010-01-13 23:40:04","1","2425","<p>I am trying to get the emails from a contact on Android (2.0.1). I can´t get the email. The code I am using is:</p><pre><code>String columns = new String[]{ContactsContract.Data._ID,                               ContactsContract.Data.DATA1,                                ContactsContract.Data.DATA2,                                            ContactsContract.Data.DATA3,                               ContactsContract.Data.DATA4,                                             ContactsContract.Data.DATA5,                               ContactsContract.Data.DATA6,                                             ContactsContract.Data.DATA7,                               ContactsContract.Data.DATA8,                                              ContactsContract.Data.DATA9                             };Cursor cursor = contentResolver.query(ContactsContract.Data.CONTENT_URI, columns, null, null, null);</code></pre><p>When I try to get the values of the columns, I get null. How can I obtain the emails? Maybe the CONTENT_URI is not correct or tha data is stored in another table and I have to make a join.</p>","241911","","114066","","2011-11-09 07:08:12","2012-02-05 17:06:31","How to get EMail address on Android 2.0.1","<android><email>","4","0","1","",""
"2061362","1","2061400","","2010-01-14 00:21:22","2","151","<p>How would you go about designing a system based on arbritary zones? Think of the American states - basically the whole map is carved up into irregular zones. Then again another one might show a salesmans territory, TV stations coverage area etc. I need to be able to retrieve the current GPS position and determine which zone I'm in. I can't use an address/zip lookup - its purely based on the lat/long point. So the data structures which define the enclosing boundaries must be flexible enough to provide fairly accurate positioning. As a bonus, I'd also like to be able to render these zones on the map, maybe with different colors. Any tips/pointers to anything close to this would be very welcome, thanks.</p>","250340","","","","","2010-01-14 00:28:07","Coding Zones for Android Maps","<android><mapping>","1","0","","",""
"2061373","1","2061826","","2010-01-14 00:23:04","1","1699","<p>I'm using the Android plugin for Eclipse on OSX, latest versions of everything. When I run or debug my app, Eclipse is very inconsistent about uploading/installing the new APK. Nothing I seem to do has any effect on this. Clean builds, debug, whatever, there seems to be about 50/50 chance of installing the APK. Or not. If not, then I have to kill the emulator and try again. What is going in?</p>","108381","","","","","2010-01-14 02:38:31","Why doesn't Eclipse always install my APK?","<android><eclipse>","1","2","1","",""
"2061500","1","","","2010-01-14 00:53:25","13","1008","<p>Lets say I launch my app from the home screen, navigate through some activities, then I press the home key and do something else in the Gmail app. </p><p>After i'm done checking my mail,I press the home key again to leave the Gmail app and click my app's icon at the home screen again to return to it.</p><p>When I return to my app, I want it to return to the last activity I was at, NOT start a whole new session. I've been trying to figure this out all day.</p><p>My manifest for my first activity is as follows:</p><pre><code> &lt;activity android:name="".Main""              android:label=""@string/app_name""              android:screenOrientation=""portrait""              android:alwaysRetainTaskState=""true""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>The category attribute LAUNCHER makes my app ALWAYS start at activity Main, so I don't know how to go about restoring the last activity. People have told me to use sharedpreferences to save the last activity and load it on Launch, but I don't think it's intended to be done that way because it isn't very elegant. </p>","236300","","","","","2010-04-01 19:55:20","Restore android app stack from background","<java><android>","3","4","","",""
"2061970","1","2062270","","2010-01-14 03:25:33","2","1425","<p>I have a relatively complex layout that I'd like to be the ""row"" of a ListView in Android and I'm having trouble getting the right-most element to show up on each row.</p><p>Here's what the row <em>should</em> look like:</p><p>There's an icon (50dip x 50dip) on the left and an icon (9 x 13) on the right.  The icons should be left and right justified, respectively with variable text in the middle.</p><p>Problem is that my right-most icon (9 x 13) is pushed off of the visible area using my current XML layout and my attempted fixes have all failed.</p><p>Suggestions??</p><p>![alt text][1]</p><p>[1]: <img src=""http://imgur.com/3bNqs.png"" alt=""Hosted by imgur.com"" /></p><pre><code>  &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:padding=""5dip""&gt;    &lt;LinearLayout android:orientation=""horizontal""        android:gravity=""center"" android:layout_width=""fill_parent""        android:layout_height=""60dip""&gt;        &lt;LinearLayout android:orientation=""horizontal""            android:layout_width=""fill_parent"" android:minHeight=""55dip""            android:padding=""5dip"" android:layout_height=""fill_parent""&gt;            &lt;ImageView android:id=""@+id/img"" android:layout_width=""50dip""                android:layout_height=""50dip"" android:layout_marginRight=""6dip"" /&gt;            &lt;TextView android:ellipsize=""end"" android:textColor=""#454545""                android:id=""@+id/ttt"" android:textSize=""18sp"" android:gravity=""center_vertical""                android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" /&gt;        &lt;/LinearLayout&gt;        &lt;ImageView android:layout_height=""13dip"" android:minWidth=""9dip""            android:layout_width=""fill_parent"" android:id=""@+id/disclosure"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","141146","","","","","2010-01-14 05:01:50","Android -- Help with XML of a ""complex"" row in a ListView","<xml><android><listview>","1","0","","",""
"2062177","1","2062231","","2010-01-14 04:33:16","1","2978","<p><strong>Q:</strong> How does <strong>Web Applications</strong> <code>differ</code> from <strong>SmartPhone Applications</strong> (Iphone, Windows Mobile, Android/Nexus Application) and in what <code>specific aspects</code> do they <code>differ</code> and in what degree  ?</p><p>Also for example, </p><p><strong>Q:</strong> Why we need mobile version of Web Application like <code>gmail.com</code> or <code>bankofamerica.com</code> specifically for <code>smartphone devices</code> where we can access same <code>web applications</code> on <code>smartphone</code> using <code>internet connections</code> ? In what <code>aspect</code> do they <code>differ</code> and <code>why</code> do we have those <code>differences</code> ?</p>","164299","","","","","2010-01-20 21:47:31","Web Applications v/s SmartPhone Applications (Iphone, Windows Mobile, Android/Nexus Application)","<iphone><android><web-applications><windows-mobile><smartphone>","4","0","1","",""
"2062330","1","2062367","","2010-01-14 05:24:03","0","76","<p>I have a G1 and an HTC Hero handset. All the applications that I've written were tested only on these devices; come new SDK and Android handsets with (support for) different screen resolutions, densities and capabilities I have been asked to estimate the efforts required to port some of the application to new Android handsets such as Droid, Nexus One etc.</p><p>I know that making such an estimation would depend a lot on the application that is being ported, what device capabilities it uses and assumes and the way it is written.</p><p>This question is an effort to highlight all the things that a developer needs to consider(in general) when making such estimates. Please help.</p><p>Thanks.</p>","236128","","","","","2010-01-14 05:32:42","Things to consider when calculating efforts required to port an application to another Handset","<android>","1","0","","",""
"2062420","1","2063147","","2010-01-14 05:43:54","4","448","<p>I am new to android dev, own an HTC Eris Droid (OS = 1.5 or 1.6 I believe).  I am primarily a Microsoft .NET developer and am trying to figure out where to start.</p><p>What dev IDEs are suggested.  I've seen the droid dev site and they suggest Eclipse.  But which one?</p><p>Will installing Eclipse and the JRE interfere with .NET development?</p><p>What else will I need to get started?  My OS is Win7.</p><p>TIA</p>","86555","","50049","","2011-02-23 19:12:12","2012-06-20 16:25:32","New to android dev","<android>","5","1","1","",""
"2062564","1","","","2010-01-14 06:30:27","6","4498","<p>I have an application, which sets an alarm using AlarmManager, which starts another Activity when it goes off.  The AlarmManager takes a PendingIntent and spawns a BroadcastReceiver class when the specified time comes.  I'm wondering whether there is any way that I can pass arguments to this BroadcastReceiver through the Intent object which goes into PendingIntent?</p><p>Basically what I'd like to do is something like this:</p><p>Intent my_intent = new Intent(this, BroadcastService.class);PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, my_intent, 0);</p><p>my_intent.putExtra(""arg1"", arg1);</p><p>AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);</p><p>alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + (1000), pendingIntent);</p><p>and I'd like to be able to retrieve arg1 in the BroadcastReceiver's onReceive(Context, Intent) method.  I figured that the local variable my_intent would be the second parameter passed on to onReceive by the PendingIntent, but apparently that's not quite right.  Is it possible to pass parameters between an Activity and a BroadcastReceiver in this fashion (using Intent.putExtra()) or should I use a ContentProvider instead?</p><p>Thanks!</p><p>Iva</p>","250493","","","","","2011-12-27 19:05:25","Passing arguments to a BroadcastReceiver through an Intent in Android","<android>","4","0","1","",""
"2062946","1","2063909","","2010-01-14 08:28:22","1","1230","<p>I am using tabwidget when i apply white theme on tab widget selected tab text remain black but unselected tab text turn into white and invisible, how can i change the color of tab widget indicator text.<img src=""http://img684.imageshack.us/img684/3238/tabt.jpg"" alt=""alt text""></p>","216431","","","","","2010-01-14 12:11:02","Android tabwidget","<android><tabwidget>","1","1","1","",""
"2062958","1","2113301","","2010-01-14 08:30:42","0","197","<p>I have a widget that displays an analog clock. What I would like is for the the widget to write to a database the time when a user clicks on the widget. I've already got the databaseHelper class and have an Activity that displays a screen showing the current date and time and writes the time to a database.</p><p>I followed the tutorial here: <a href=""http://nexsoftware.net/wp/2009/07/29/tutorial-creating-a-custom-analogclock-widget/"" rel=""nofollow"">Analog Clock Tutorial</a> and ended up with this:</p><pre><code>public void onReceive(Context context, Intent intent){    String action = intent.getAction();    if (AppWidgetManager.ACTION_APPWIDGET_UPDATE.equals(action))    {        RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);        this.mIntent = new Intent(context, AskTheTime.class);        PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, mIntent, 0);        views.setOnClickPendingIntent(R.id.Widget, pendingIntent);        AppWidgetManager.getInstance(context).updateAppWidget(intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS), views);    }}</code></pre><p>The AskTheTime class extends activity and logs to the database in onCreate(). But this means that it displays only the time when the widget was started - not when it was clicked. (I guess this is because I'm starting a pendingIntent) I'm not sure If I should put the database write in another method or if I should be using Intents to do this sort of thing from widgets. Any pointers would be great! I've look at several tutorials for intents but none of them seem very clear to me.</p>","137839","","","","","2010-01-21 22:11:07","logging to a database when user clicks on a widget","<android><android-widget><android-intent>","1","0","","",""
"2063003","1","","","2010-01-14 08:42:12","3","2365","<p>I have a problem and i will be grateful if anyoune helps me.</p><p>Ok. I've started android programming 2 month ago. Now i am developing a simple game, nava battle. For this programm i need to build a grid, where i can place ships and coordinates. I can't seem to find out how I should be doing this?I think i should build a custom view, which will do all that i need. If anyone could show some examle or explain how to build appropriate view i'll be happy</p>","250559","","","","","2013-03-22 16:01:18","How to build custom grid","<android><custom-component>","1","0","1","",""
"2063320","1","","","2010-01-14 10:03:16","6","2175","<p>There seems to be a couple of ways to go about having a background task being executed. My usecase is to have my app fetch a datafeed every x minutes, regardless of my gui is running, and regardless of whether the phone is sleeping or not.</p><p>I use an alarmmanager to schedule an intent matching a broadcastreceiver. in the onRecieve method i start a service (startService), which spawns an AsyncTask. The task fetches data and stores it and then stopSelf() the service.</p><p>in the onRecieve method i aquire a PARTIAL_WAKE_LOCK, before starting the service, and just before calling stopSelf() in the service, i release it again.</p><p>Is this really the best way to do it? Do i even need the service in this scenario?</p><p>I experience odd behaviour with this setup, where the setup works for hours and then suddenly stops, which makes it very hard to debug.</p><p>Does anyone have a simple foolproof method to achive the same end?</p>","212651","","","","","2010-01-14 12:57:37","How to schedule a background task","<android>","1","0","5","",""
"2063321","1","2063426","","2010-01-14 10:03:20","1","1097","<p>I am using httprequest to retrieve data from webservice, i know using tomcat we can compress response data using gunzip algo.</p><p>but how can uncompress data to display, is un-compress is time consuming?? is there any other way to compress response and uncompress on android ???</p>","216431","","","","","2010-01-14 10:33:50","android httprequest compress response","<android><compression><response><httprequest>","1","0","1","",""
"2063385","1","2064130","","2010-01-14 10:19:51","2","215","<p>Is it possible to control the package installation process<br>in Android?  </p><p>The problem is that I'm asked to install and uninstall packageswithout using the default android installer.I need to control the entire process within my application.  </p><p>I already have my application in the /system/app/ folder,<br>so it might have the INSTALL_PACKAGE and DELETE_PACKAGES permission<br>(that was what I read).  </p><p>I also have been looking to the source code of the installer,<br>but can't find a way to start installing or uninstalling<br>a package on my own.  </p><p>Could this be done?  </p><p>Thank you all</p>","243376","","","","","2010-01-14 12:54:05","Customized Installation in Android","<android>","1","0","","",""
"2063637","1","2065172","","2010-01-14 11:08:12","0","1599","<p>In my application, i've a list view, if the last visible line is truncated and I scroll down to this line, I wish that the line becomes fully visible. I have to scroll down once more for it to become fully visible.</p>","164460","","","","","2010-01-14 15:25:43","android listview last visible line","<android><listview>","2","1","","",""
"2063639","1","2063694","","2010-01-14 11:09:03","3","499","<p>Is it legally OK to store an SHA1 Hash of a user IMEI on a server?</p><p>I have asked the user for permission before sending the IMEI.</p>","248521","","","","","2010-01-14 11:21:41","Storing the IMEI from an Android phone on an American Server","<android>","1","0","1","",""
"2063756","1","","","2010-01-14 11:35:41","6","5898","<p>Why my target option in eclipse is disabled? I cant select the target platform.On the other hand the platform folder and adds-on are empty.Plz any ideas?</p>","250680","","104117","","2010-01-14 11:38:42","2014-03-28 13:37:03","Target option is disabled in Eclipse window->Preference->android","<android><eclipse>","3","0","1","",""
"2064080","1","2064371","","2010-01-14 12:43:51","6","2509","<p>Is there something like an application global <code>onPause()</code> and <code>onResume()</code>?</p><p>My main activity listens for GPS fixes, which I want to continue working when switching to another screen/activity. Therefor I cannot unregister my <code>LocationListener</code> in the activity's <code>onPause()</code>. However I still want to unregister my GPS listener when switching to another application (so save battery) and turning it back on when returning to my application, regardless what screen/activity the user is currently in.</p><p>Any ideas?</p>","184367","","","","","2010-01-14 13:34:13","Android: application global onPause() and onResume()?","<android><geolocation><gps><lifecycle>","1","0","3","",""
"2064100","1","2064210","","2010-01-14 12:48:55","4","6698","<p>can any one provide me solution to this error i have searched alot to this problem but failed</p><p>i am using eclipse with ADT </p><p>with android sdk 2.0.1<br>OS Microsoft windows VIsta x86</p>","249991","","","","","2013-03-28 08:16:31","The Jar of this class file blongs to container Android 2.0.1 which does not allow modifications","<java><android><eclipse>","2","3","1","",""
"2064595","1","2064852","","2010-01-14 14:09:12","8","24678","<p>Just a quickie, </p><p>i have an xml resource in res/values/integers.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;     &lt;integer-array name=""UserBases""&gt;          &lt;item&gt;2&lt;/item&gt;          &lt;item&gt;8&lt;/item&gt;          &lt;item&gt;10&lt;/item&gt;          &lt;item&gt;16&lt;/item&gt;     &lt;/integer-array&gt;&lt;/resources&gt;</code></pre><p>and ive tried several things to access it:</p><pre><code>int[] bases = R.array.UserBases;</code></pre><p>this just returns and int reference to UserBases not the array itself</p><pre><code>int[] bases = Resources.getSystem().getIntArray(R.array.UserBases);</code></pre><p>and this throws an exception back at me telling me the int reference R.array.UserBases points to nothing</p><p>what is the best way to access this array, push it into a nice base-type int[] and then possibly push any modifications back into the xml resource.</p><p>I've checked the android documentation but I haven't found anything terribly fruitful.</p>","213884","","","","","2010-01-14 14:42:47","Get an integer array from an xml resource in Android program","<java><android>","1","0","1","",""
"2064656","1","","","2010-01-14 14:17:50","1","657","<p>I want to change the default layout which Android uses for show the alternative keys when performs a long-press on a key. Keys have an attribute ""android:popupKeyboard"" used for define the layout of the alternative key list (which could be a Keyboard reference) but when I use it the Android's default layout still appears. Is possible to change or override this layout?</p>","244218","","","","","2010-03-09 02:00:06","Can't change the layout of alternatives keys show on android keyboard","<java><android>","1","0","","",""
"2064928","1","2065867","","2010-01-14 14:54:39","11","10821","<p>I am trying to modify the design of <a href=""http://developer.android.com/intl/de/reference/android/widget/Spinner.html"">Spinner</a> widget. I can change the background, but I can't find a way to change the arrow icon on the right side. Is there a way to do it?</p><p>Thanks!</p>","235910","","114066","","2010-03-24 08:46:56","2012-05-21 15:54:03","Changing Android Spinner Layout/Design","<android>","2","0","2","",""
"2065426","1","2066836","","2010-01-14 15:56:32","0","1176","<p>Im pretty new to SSL, however in making an SSL request, how would i prevent the ""handshake"" happening each time i call an HTTPS url in Android. Is it possible to just store the SSL session?</p>","117691","","","","","2011-04-15 03:29:41","Storing SSL sessions in Android","<android><ssl>","2","0","","",""
"2065430","1","","","2010-01-14 15:57:06","16","22194","<p>I'm trying to detect the focus/pressed color for button and other elements.This is needed because I'm developing new components and it's important that those look as part of platform.Those colors are ORANGE on android sdk and GREEN on HTC SenseUI.If I could detect that color my component will look as part of platform on both version.</p><p>Does anyone knows how to do this?</p><hr><p><em><strong>It's possible to create ""selector"" which uses custom image for default state and platform default for focus/selection.</em></strong></p><p><strong>To do this follow the steps:</strong>1) create xml file with selector in ""res/drawable"" (e.g. ""red_button.xml""):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_pressed=""true""        android:drawable=""@android:drawable/btn_default"" &gt;    &lt;/item&gt;    &lt;item android:state_focused=""true""        android:drawable=""@android:drawable/btn_default"" &gt;    &lt;/item&gt;    &lt;item         android:drawable=""@drawable/btn_default_red"" &gt;    &lt;/item&gt;&lt;/selector&gt;</code></pre><p>2) from folder "".../android-sdk-mac/platforms/android-1.5/data/res/drawable/"" take picture ""btn_default_pressed.9.png"" and change color as you like (I needed to change it to red and for this GIMP is enough).</p><p>3) place altered picture in ""res/drawable"" (e.g. with name ""btn_default_red.9.png"")</p><p>4) define button:</p><pre><code>&lt;Button    android:id=""@+id/info_button""    android:layout_width=""wrap_content""     android:layout_height=""37dip""    android:layout_marginTop=""1dip""    android:background=""@drawable/red_button""    android:text=""[Info]"" /&gt;</code></pre><p>That's all.</p><p>This is result:<img src=""http://img200.imageshack.us/img200/1349/custombutton.png"" alt=""alt text""></p>","157599","","157599","","2010-01-16 13:57:10","2011-03-24 04:06:15","Fixed: ""Android: Detecting focus/pressed color""","<android>","3","0","9","",""
"2065521","1","","","2010-01-14 16:07:16","1","151","<p>I have implmented pagination and it display 5 records per page. Now suppose I am on page 3 and click 3'rd element then 3'rd element of page-1 is selected.</p><p>I am not able to figure out problem as I always create new list object while setting data.</p><p>I used below code</p><pre><code>temp = new ArrayList();this.someListAdapter = new SomeListAdapter(this, R.layout.row_facet,temp);setListAdapter(this.someListAdapter );</code></pre><p>Below is signature of SomeListAdapter class.</p><pre><code>public class SomeListAdapter extends ArrayAdapter&lt;VoNeighborhood&gt; {}</code></pre><p>Please help....</p>","229545","","2961","","2010-01-14 16:10:33","2010-03-30 19:00:26","Problem with list activity","<android><list><activity>","1","1","","",""
"2065692","1","2067810","","2010-01-14 16:30:55","0","672","<p>My app's underlying view has bitmaps, lines, etc drawn on a canvas. I want to display images (icons) on top of this which will respond to Touch events. The number and positioning of such images will be variable depending on data in an SQLite database.</p><p>Am I correct in thinking that the way to achieve this is to have a ViewGroup to which I add first the basic view then for each icon an ImageButton object with an OnTouch listener and positioning defined by setting the margins in a RelativeLayout.LayoutParams object?</p><p>My code for each button reads as follows:`</p><pre><code>public class MyButton {ImageButton mButton;private Bitmap Star;public MyButton(int intX, int intY) {    mButton = new ImageButton(Global.thisApp);         mButton.setImageBitmap(BitmapFactory.decodeResource(Global.thisApp.getResources(), R.drawable.star)r);    mButton.setPadding(0, 0, 0, 0);    mButton.setOnTouchListener(new ImageButton.OnTouchListener() {        @Override        public boolean onTouch(View arg0, MotionEvent arg1) {            // ToDo            return false;        }    });    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams         (LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);    params.setMargins(intX, intY, 0, 0);    Global.thisApp.mLayout.addView(mButton, params); }</code></pre><p>}</p><p>`and the code which creates the buttons is as follows:</p><pre><code>      poiCount = 0;    mCursor=Global.mDBAdapter.fetchItems(...);    if (mCursor.getCount()&gt;=0) {        poi = new MyButton[mCursor.getCount()];        mCursor.moveToFirst();        do {            int X = ... ;            int Y = ... ;            poi[poiCount] = new MyButton(""Type"", X, Y);            poiCount++;        } while (mCursor.moveToNext());    }</code></pre><p>This code is called from the onDraw() method for the underlying view.</p><p>This seems to work when the screen is initially drawn, and when the screen is subsequently redrawn (with new data) new buttons are added; however, the previous buttons are not removed.</p><p>I've tried calling Global.ThisApp.MyLayout.removeView with each in turn button as a parameter but Eclipse objects that a MyButton object cannot be a parameter for removeView.</p><p>How can I remove the existing buttons each time the underlying view is invalidated?</p>","250845","","","","","2010-01-14 21:46:50","ImageButtons in a ViewGroup","<android><views><button>","1","1","","",""
"2065818","1","2065838","","2010-01-14 16:45:25","17","20598","<p>I know that android has a <a href=""http://www.ascenderfonts.com/store/search.aspx?q=Droid+"">collection of fonts</a> specifically designed by Ascender for Google, but what other fonts are available? I'm looking for a list like <a href=""http://daringfireball.net/2007/07/iphone_fonts"">this one</a> or even better <a href=""http://daringfireball.net/misc/2007/07/iphone-osx-fonts"">this one.</a></p>","17188","","","","","2010-01-14 16:48:31","What fonts are available on Android?","<android><design><fonts>","1","0","3","",""
"2065993","1","2066183","","2010-01-14 17:09:50","130","58771","<p>I need to take screenshots of an android application running on an emulator in Eclipse Galileo.</p><p>Is there a built-in feature for this or do I have to download a plugin of some sorts?</p>","186384","","617450","","2013-03-01 06:47:54","2013-09-06 16:33:24","How to take emulator screenshots using Eclipse?","<android><eclipse><android-emulator><screenshot><eclipse-3.5>","7","1","27","",""
"2066710","1","","","2010-01-14 18:56:42","1","199","<p>PhoneMyPC tool in Android provides remote desktop connection to PC. But, Do Android based mobiles support VNC protocol/softwares for connection between 2 android mobiles ? Do android based mobiles support RDP or other tools for connections to other OS based mobiles like windows, symbian etc ?</p><p>Thx in advans,Karthik Balaguru</p>","243312","","4071","","2010-01-14 22:08:30","2010-05-01 15:00:03","Between 2 Androids and to other OS mobiles","<android><smartphone><vnc-viewer>","1","0","","",""
"2067245","1","2067292","","2010-01-14 20:10:56","1","1085","<p>Downloaded ASE from google code, and was looking through tutorials, and available scripts.</p><p>I found a script I wanted to try, however copy pasting it is removing all whitespace (and this is a Python script...).</p><p>Is there a simple way to download a script from the internet into the Android Scripting Environment?</p>","224111","","","","","2010-01-14 20:19:37","Download scripts for Android Scripting Environment","<android><android-scripting>","1","0","","",""
"2067250","1","2067282","","2010-01-14 20:12:22","0","2995","<p>I have the following ClickListener code. It will do different stuff depending on what button was pressed. If the Vehicle button is pressed I want it to start another activity by loading the Vehicles.class but it is erroring during the setClass() statement.I believe it is erroring when trying to instantiate the Vehicles class. The error returned is NoClassDefFoundError. </p><p>Can someone tell me what I'm doing wrong here?</p><p>ThanksPatrick</p><p>OnClickListener code:</p><pre><code>    private OnClickListener mClickListener = new OnClickListener() {    @Override    public void onClick(View v) {        Button btn = (Button) v;        String txt = (String) btn.getText().toString();        mSaveButton = (Button) findViewById(R.id.btnSaveTripInfo);        mVehiclesButton = (Button) findViewById(R.id.btnVehicles);        if(btn.equals(mSaveButton)) {            onSaveClick(v);        }else if (btn.equals(mStartStopButton)){            onStartStopClick(v);        }else if (btn.equals(mVehiclesButton)) {            Intent intent = new Intent();            intent.setClass(v.getContext(),Vehicles.class);            startActivity(intent);        }    }};</code></pre><p>The Vehicles class code:</p><pre><code>public class Vehicles extends Activity  {    private static final String TAG = ""Vehicles"";    private static int m_id;    private static String mVehName;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.vehicles);    }</code></pre><p>}</p>","244190","","","","","2010-01-14 20:18:11","Intent.setClass error","<android>","1","0","","",""
"2067426","1","2067461","","2010-01-14 20:44:46","12","26670","<p>I'm pretty close to finished with my first game for Android, and I've come across a problem that's so simple I'm sure I'll feel stupid for not knowing how to solve it, but how can I force the app to stay in a Horizontal layout?  Right now, if you turn the phone (emulator) it flips the graphics and squeezes them.  I want the game to start horizontally and stay that way regardless of how the user turns the phone.</p><p>Thank you.</p>","179518","","","","","2013-09-23 23:32:57","Android force Horizontal layout","<android><layout>","5","0","3","",""
"2067456","1","2067686","","2010-01-14 20:50:40","3","2116","<p>I have a simple listview and listadapter setup as follows:</p><pre><code>listAdapter = new ArrayAdapter&lt;MyDomainObject&gt;(this, android.R.layout.simple_list_item_1, listOfDomainObjects);listView.setAdapter(listAdapter);</code></pre><p>The user makes a selection on the list which takes them to another activity. From the new activity they can click their selection which returns them to the activity with the above list. I want to highlight the previous selection made. I currently find the matching list entry and call:</p><pre><code>listView.setSelection(matchIndex);</code></pre><p>This brings their previous selection to the top of the list. Is it possible to highlight (in that default orange) the previous selection. I have tried several approaches with no luck.</p>","175056","","60261","","2010-01-14 21:09:50","2010-01-14 21:26:06","Android ListView programmatic selection/highlight","<android><listview>","1","0","0","",""
"2067955","1","2068981","","2010-01-14 22:14:47","51","25346","<p>Currently in an Android application that I'm developing I'm looping through the pixels of an image to blur it.  This takes about 30 seconds on a 640x480 image.  </p><p>While browsing apps in the Android Market I came across one that includes a blur feature and their blur is very fast (like 5 seconds) so they must be using a different method of blurring.</p><p>Anyone know a faster way other than looping through the pixels?</p>","237912","","611608","","2011-06-15 14:36:49","2014-04-16 21:02:32","Fast Bitmap Blur For Android SDK","<android><blur>","10","2","66","",""
"2068007","1","2068046","","2010-01-14 22:26:09","3","11446","<p>I'm working on a painting application for Android and I'd like to use raw data from the device's touch screen to adjust the user's paint brush as they draw. I've seen other apps for Android (iSteam, for example) where the size of the brush is based on the size of your fingerprint on the screen. As far as painting apps go, that would be a huge feature.</p><p>Is there a way to get this data? I've googled for quite a while, but I haven't found any source demonstrating it. I know it's possible, because Dolphin Browser adds multi-touch support to the Hero without any changes beneath the application level. You must be able to get a 2D matrix of raw data or something...</p><p>I'd really appreciate any help I can get!</p>","100363","","","","","2010-01-15 09:56:41","Android - How do I get raw touch screen information?","<android><touchscreen><multi-touch>","3","0","1","",""
"2068084","1","","","2010-01-14 22:40:13","40","32317","<p>I'm in the process of evaluating if and how a CF .NET enterprise application can be ported to run on Android devices. The application on Windows Mobile phones are run in kiosk mode where the application autostart in fullscreen-mode after booting and with the users unable to accidentally or willingly access any other parts of the phone. Is it possible for me to port this behavior to android and if so, how?</p>","245943","","168868","","2012-11-23 04:12:37","2013-11-18 11:50:33","Kiosk mode in Android","<android><kiosk><kiosk-mode>","4","1","33","",""
"2068242","1","2068302","","2010-01-14 23:10:31","18","14969","<p>Using a VideoView is it possible to set a scale factor for Android?  By Default the video view resizes itself to fit the encoded resolution of the Video.  Can I force Android to render a video into a smaller or larger rect?</p>","62516","","","","","2013-08-09 11:01:12","Does Android support scaling Video?","<android><video>","5","0","7","",""
"2068386","1","","","2010-01-14 23:43:44","1","1060","<p>It all started with a simple <strong>WebView</strong> within an Android app.</p><p>This view loads info from a public URL. Nothing unusual there.</p><p>However ... if there should be a network interruption, you can easily end up with an error displayed prominently in the <strong>WebView</strong>.</p><p>Well, that's no good, right? So I searched the docs and elsewhere for a way to suppress this, or trap it ... and found no leads. With that, I inquired on <code>#android-dev</code> on IRC: I know about <strong>WebView.onReceivedError</strong>, but can the visual portion be suppressed? (Instead, I wanted to display a <strong>Dialog</strong> warning of said network problem, with an option to retry.)</p><p>Answer: <a href=""http://code.google.com/p/android/issues/detail?id=2340&amp;can=5&amp;colspec=ID%20Type%20Status%20Owner%20Summary%20Stars"" rel=""nofollow"">You can't</a>. :(</p><p>Very well. Time for plan B. Perhaps an <strong>ImageView</strong> might fill the bill?</p><p>Should there be any kind of <strong>WebView</strong> error, the <strong>ImageView</strong> can be used as a makeshift curtain. It overlays the <strong>WebView</strong> at the start (before the URL is loaded), then it fades to reveal the <strong>WebView</strong> behind it. If the <strong>WebView</strong> works, wonderful! But if <strong>onReceivedError</strong> kicks in, we put the curtain back up immediately and show the aforementioned dialog. Once WebView gets an <strong>onPageFinished</strong>, the curtain fades once more.</p><p>... and THIS ... works WONDERFULLY!</p><p>Until I was asked to support screen orientation changes. (Foreshadowing: ""Things went downhill from here."")</p><p>Up until now the app was using <code>android:screenOrientation=""portrait""</code> in the Manifest's main activity. So I removed that part, and of course we ran into the infamous ""activity is being restarted"" issue, which blows away and then brings back the <strong>WebView</strong>.</p><p>Of course it's not an issue per se. This is Android OS working as designed.</p><p>Also, we want the <strong>ImageView</strong> to display properly depending on orientation. Thankfully, we have <a href=""http://developer.android.com/guide/topics/resources/resources-i18n.html#AlternateResources"" rel=""nofollow"">alternate resources</a> we can leverage! Meanwhile, we still have this <strong>WebView</strong> we don't want to reload. We want it to be left alone and let the view do its own thing, be it in portrait or landscape at the time.</p><p>I found <a href=""http://www.androidguys.com/?s=rotational+forces"" rel=""nofollow"">a few well-explained ways to handle screen orientation</a>, plus I have already read through author <a href=""http://commonsware.com/Android/"" rel=""nofollow"">Mark</a> <a href=""http://commonsware.com/AdvAndroid/"" rel=""nofollow"">Murphy's</a> <a href=""http://commonsware.com/AndTutorials/"" rel=""nofollow"">eBooks</a> (highly recommended reading). Yet I was still stuck! With the <strong>ImageView</strong> now in the mix, none of the techniques seem to fill the bill:</p><ol><li><p>Forcing portrait mode is, of course,out of the question (or is it?).</p></li><li><p><code>android:configChanges=""keyboardHidden|orientation""</code>and <code>onConfigurationChanged</code> seem totake care of the WebView, whichblissfully handles the screenresizing gracefully on its own. Ofcourse, the <strong>ImageView</strong> doesn't getthe memo either, and it keeps usingits original (portrait/landscape) resource!</p><p>An ill-conceived call to<code>activity.setRequestedOrientation(newConfig.orientation)</code>within the config change handlerdidn't help matters.</p></li><li><p>Since the <strong>WebView</strong> doesn't need to bepersisted between app executions,<code>onRetainNonConfigurationInstance</code>looked like another possibility.Alas, that didn't seem to workeither. Resetting <code>webview</code> with thelast nonconfig instance (sincethat's all I really passed in)resulted in a blank <strong>WebView</strong>. Notquite what I was after.</p><p>On the otherhand, the <strong>ImageView</strong> seemed toresponding nicely to orientationchanges. Go figure.</p></li><li><p>How about <code>onSaveInstanceState</code>? Samegotchas. <strong>WebView</strong> has a <code>saveState</code>method, but it doesn't seem to besaving it at a level deep enough tokeep the transition seamless. If so,then it's probably not supposed toeither, so this might be the wrongway to go too.</p></li></ol><p>As to the wisdom of using <code>configChanges</code>, <a href=""http://developer.android.com/reference/android/webkit/WebView.html"" rel=""nofollow"">the documentation recommends this very technique</a>, in fact:</p><blockquote>  <p>Standard behavior for an <strong>Activity</strong> is  to be destroyed and recreated when the  devices orientation is changed. This  will cause the <strong>WebView</strong> to reload the  current page. If you don't want that,  you can set your <strong>Activity</strong> to handle  the <code>orientation</code> and <code>keyboardHidden</code>  changes, and then just leave the  <strong>WebView</strong> alone. It'll automatically  re-orient itself as appropriate.</p></blockquote><p>Of course <a href=""http://stackoverflow.com/questions/1002085/android-webview-handling-orientation-changes/2067409#2067409"">I could also be committing some sort of pilot error</a> here, but I have yet to figure out what that might be.</p><p>I have read and re-read the documentation and tried every which way to hack through this on my own. Perhaps I'm missing something (obvious?) in the docs, or the solution is non-obvious (but someone can shed light) ... or this simply isn't possible. Hoping it's not the latter.</p><p>Clues welcome/appreciated!</p>","126660","","126660","","2010-01-15 00:34:37","2010-09-01 16:53:32","From WebView Errors to ImageView Cover-ups to Screen Orientation","<android><activity><webview><screen-orientation>","2","0","1","",""
"2068557","1","2073023","","2010-01-15 00:20:51","6","7210","<p>it's not a programming question, but programmers related.</p><p>if yes, please guide me to some colleges that have that program.thanks.</p>","190451","","3043","","2011-12-09 18:44:41","2012-10-28 14:21:10","is there a masters degree in Mobile development like android?","<android>","8","4","5","2012-10-28 14:48:58",""
"2069671","1","2069678","","2010-01-15 05:24:21","7","15516","<p><br/><br/>  Is there any possibility to Edit String.xml values in Android? Please suggest me the possible ways. <br/><br/> I want to provide Enable/Disable option for my App. To accomplish this I can use SQLite database. But I doesn't like to Use DB for a single variable value.  <br/><br/>Thanks in Advance. <br/><br/> With Regards,  <br/>Raghavendra K.</p>","179043","","","","","2010-01-15 05:27:58","How to change string resource xml values in Android programatically?","<xml><android><string><resources>","1","0","0","",""
"2069810","1","2069906","","2010-01-15 06:15:19","15","10465","<p>If I assign an integer value to change a certain text size of a TextView using java code, the value is interpreted as pixel (px), now does anyone know how to assign in sp?</p>","235885","","235885","","2012-09-28 02:32:52","2013-02-26 06:50:19","How to assign text size in sp value using java code","<android>","4","0","4","",""
"2069983","1","","","2010-01-15 07:02:43","2","1642","<p>Adding an image on <code>EditText</code> works fine.  However, copying an image is another problem.</p><p>When I insert an image on <code>EditText</code> by using <code>ImageSpan</code> it shows correctly, but I copy inserted image, EditText shows me only 'obj'.</p><p>Is there somebody who know how to solve this problem?</p>","258508","","3171","","2010-01-15 09:22:30","2011-02-17 02:00:21","I copy and paste image on EditText, but EditText show me 'obj'","<android>","2","0","","",""
"2070022","1","2070189","","2010-01-15 07:15:42","4","2861","<p>I want to create a static options menu for all my activity screens. I dont want to override <code>onCreateOptionsMenu()</code> in each activity. </p><p>Since <code>Menu</code> class is an interface with a huge number of methods, its difficult to create a static object of the implementing class.</p><p>Any other way of doing the same?</p>","237403","","419","","2011-01-29 14:48:51","2011-01-29 14:48:51","Static options menu","<android><gui>","1","0","3","",""
"2070412","1","2070447","","2010-01-15 09:00:46","4","1963","<p>I have a list of 70 text items with image icons(which are stored in drawables folder). If I launch application the first time and scroll the list slowly - the exception doesn't occur.</p><p>When the application is launched the first time and I scroll the list with 'fling' action the following exception occurs:</p><pre><code>java.lang.OutOfMemoryError: bitmap size exceeds VM budget at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:439) at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:322) at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:688) at android.content.res.Resources.loadDrawable(Resources.java:1710) at android.content.res.Resources.getDrawable(Resources.java:585)</code></pre><p>After that, if I kill the application with DDMS, start it again and scroll it with 'fling' action, exception doesn't occur. So the exception arises only if application is installed and launched the first time.</p><p>Here is the adapter I use for the list:</p><pre><code>public class AuthorAdapter extends ArrayAdapter&lt;Author&gt; {private ArrayList&lt;Author&gt; items;private Context context;private LayoutInflater inflater;public AuthorAdapter(Context context, int textViewResourceId, ArrayList&lt;Author&gt; items) {    super(context, textViewResourceId, items);    this.items = items;    this.context = context;    inflater = LayoutInflater.from(this.context);}static class ViewHolder {    ImageView authorFace;    TextView authorName;    TextView authorWho;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    ViewHolder holder;    if (convertView == null) {        convertView = inflater.inflate(R.layout.autor_data, null);        holder = new ViewHolder();        holder.authorFace = (ImageView) convertView.findViewById(R.id.authorFaceImageView);        holder.authorName = (TextView) convertView.findViewById(R.id.authorNameTextView);        holder.authorWho = (TextView) convertView.findViewById(R.id.authorWhoTextView);        convertView.setTag(holder);    } else {        holder = (ViewHolder) convertView.getTag();    }    Author author = items.get(position);    if (author != null) {        if (holder.authorFace != null) {            String faceFileName = author.getFace();            String facePlaceName = context.getPackageName() + "":drawable/"" + faceFileName.subSequence(0, faceFileName.lastIndexOf("".""));            int faceFileId = context.getResources().getIdentifier(facePlaceName, null, null);            holder.authorFace.setImageResource(faceFileId);        }        if (holder.authorName != null) {            holder.authorName.setText(author.getName());        }        if (holder.authorWho != null) {            holder.authorWho.setText(author.getWho());        }    }    return convertView;}</code></pre><p>}</p><p>Is there a way to avoid the exception?Should I catch the exception and escape the memory somehow? </p><p>Any advice how to accomplish this?</p><p>Thanks.</p>","251369","","","","","2010-01-15 09:07:38","OutOfMemory exception appears while scrolling the list of images","<android><listview><out-of-memory>","1","2","","",""
"2071005","1","2072567","","2010-01-15 11:13:14","3","576","<p>I am having SearchCritiera object and i make it singleton and declare this variable as static,now problem is if i left my application remain open for couple of hours that static object is removed by Android OS, how can i make sure static object should not be removed by the OS.</p><p>like i know there are few keywords like </p><p>Weekreference and softreference is there any strongreference keyword which can tell Android OS do not remove the reference ??</p>","216431","","","","","2010-01-15 15:16:12","Android strong reference","<android><object>","3","0","","",""
"2071155","1","","","2010-01-15 11:42:15","1","737","<p>I have a screen layout that is forced to be <code>potrait mode</code>. Because it is very complex I don't have the time right now to invest creating a separate one for <code>landscape mode</code>. It also doesn't make much sense for my type of application.</p><p>However, for input fields it's better to provide a <code>landscape mode</code>, because some phones have a hardware keyboard, which automatically aligns the phone in landscape and therefor makes it hard to look at the app that is still in <code>portrait mode</code>.</p><p>My solution to this is to put all text input into a dialog and temporarily enable landscape mode (if requested by the user) until the dialog is dismissed again.</p><p>This works perfectly. Except of the overlaying search widget (when pressing the search button from my application). I'm looking for two <em>callbacks</em>: one, when the search widget is raised (I cannot listen to the search button, because I sometimes raise it manually via a soft button) and when it is dismissed again (regardless if the search was finally triggered or canceled - it needs to work for both cases).</p><p>Any suggestions?</p>","184367","","","","","2014-03-03 17:59:53","Android: callback for search widget opened and dismissed","<android><search><callback><widget><screen-orientation>","2","1","2","",""
"2071371","1","3059389","","2010-01-15 12:24:59","4","1973","<p>I'm trying to replace a color for something that is drawn on a Canvas using <a href=""http://developer.android.com/reference/android/graphics/AvoidXfermode.html"" rel=""nofollow"">AvoidXferMode</a>.From the android docs it looks like it's exactly what I need:</p><blockquote>  <p>AvoidXfermode xfermode will draw the src everywhere except on top of the opColor or, depending on the Mode, draw only on top of the opColor.</p></blockquote><p>What I'm trying is something like this:  </p><pre><code>Paint paint = new Paint();paint.setColor(Color.RED);canvas.drawPaint(paint); // actually drawing a bitmap herepaint.setXferMode(new AvoidXferMode(Color.RED, 0, TARGET);paint.setColor(Color.GREEN);canvas.drawPaint(paint);</code></pre><p>However, this just gives a red screen, not green as I would expect (replacing the red with green). I guess I'm missing the point some where...Any suggestions?</p>","251443","","251443","","2010-01-15 15:11:36","2012-08-16 21:46:35","AvoidXferMode to replace a color on canvas","<android><graphics>","2","0","","",""
"2071396","1","2073347","","2010-01-15 12:29:22","1","1038","<p>I am having search application, which loads data retreived from the webservice.</p><p>While application on create it shows progress dialog once its done with loading data it dismiss the progress dialog.</p><p>problem is while loading if i change the orientation of the phone it works fine it try to load activity again, but if i start shaking the cellphone while it is loading data application get crashed, any solution ???</p>","216431","","","","","2010-01-15 17:00:12","Android Screen orientation, shake cellphone crashes the application","<android><orientation>","1","1","1","",""
"2071477","1","2071804","","2010-01-15 12:42:31","1","564","<p>I'm a bit lost right now, what I'm trying to do: build a 1.5 compatible app that should also run on 2.0/2.1 devices like the Nexus. The problem is that supports-screen doesn't work the way it's supposed to with 1.5 target set in eclipse.</p><p>Did I miss something? Basically, I just want my app not to scale anything, I'll handle that ( anyScale = true )</p><p>Thanks in advance!</p>","228358","","","","","2010-01-15 13:30:13","supports-screen with 1.5 target, can't make app non-scaling","<android><screen><compatibility>","1","0","","",""
"2071614","1","2072275","","2010-01-15 13:06:48","3","19571","<p>am facing a problem in Eclipse android development tool </p><pre><code>Source not foundEDIT SOURCE LOOKUP PATH</code></pre><p>while i debug code in class Instrumentation.class at line@param info ActivityInfo from the manifest </p><p>above error is raised.</p><p>can any one guide me how to resolve this issue?? i am new to android development..</p>","249991","","105224","","2010-01-15 13:13:23","2014-02-11 18:43:31","Source not found Android?","<java><android><eclipse>","5","3","","",""
"2071791","1","","","2010-01-15 13:27:55","1","2272","<p>The method disconnect from HttpURLConnection seems not to work properly.If I execute the following code:</p><pre><code>url = new URL (""http:// ..."");connection = (HttpURLConnection) url.openConnection ();connection.setRequestMethod (""POST"");connection.setRequestProperty (""Content-Type"", ""application/x-www-form-urlencoded"");connection.setUseCaches(false);connection.setDoInput(true);connection.setDoOutput(true);connection.connect ();// Some codeconnection.disconnect ();connection.setDoInput(false); // -&gt; IllegalStateException</code></pre><p>I get an <code>IllegalStateException</code> when I call the method <code>setDoInput</code>. The exception says: ""Already connected"" </p>","164460","","234938","","2010-01-15 18:08:59","2010-01-15 18:16:53","Android HttpURLConnection disconnect doesn't work","<android><httpurlconnection><disconnect>","1","0","","",""
"2072148","1","2073844","","2010-01-15 14:20:36","18","10191","<p>I was reading the the Android Publishing docs and they said to remove all Log calls from my code.  I have some calls to e.printStackTrace() in my code that can be printed as part of the normal running of my program (ie. if a file does not exist yet).</p><p>Should I also remove these calls?</p>","248521","","","","","2014-03-28 17:25:06","Should I remove e.printStackTrace() from my code before publishing","<android>","7","0","8","",""
"2072244","1","2072358","","2010-01-15 14:33:05","66","35043","<p>I have developed some apps for Android, and this questions stays always:</p><p>How should I structure my UI? Should I launch activity after activity and leave the phone to make the ""back"" button, or should I choose more optimized, but more complex to implement, way with switching manually Views and then manually doing the ""Back"" button functionality?</p><p>What do you think (or know) is the better practice?</p>","232798","","","","","2014-03-11 19:39:25","Android: What is better - multiple activities or switching views manually?","<android>","6","0","24","",""
"2073150","1","2074689","","2010-01-15 16:34:26","2","791","<p>I am running into a problem creating an android emulator from the command line.  When I run the android command the messages below output.  </p><blockquote>  <p>Starting Android SDK and AVD Manager</p>    <p>SWT folder 'lib\x86_64' does not exist</p>    <p>Please set ANDROID_SWT to point to the folder containing swt.jar for platform</p></blockquote><p>I've already:</p><ol><li>Execute SDK Setup.exe and brought down the android packages</li><li>Modified my environment variables to point to the tools folder</li><li>Verified that the SWT.jar was in fact located in lib\x86_64</li></ol><p>I've already successfully set this up on my primary development unit.  The system I am installing on now runs 64-bit Windows 7 (same as my other development unit).</p>","246639","","246639","","2010-02-10 21:45:15","2010-02-10 21:45:15","Android SDK Error Upon Creating Emulator","<android><android-emulator>","1","0","","",""
"2073568","1","2073665","","2010-01-15 17:33:59","0","1168","<p>I want to learn some programming for my android phone.I was successful doing the hello world app.Now I wanted to try the mapview found here: <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a></p><p>My code is the following:</p><pre><code>package com.example.hellomapview;import android.os.Bundle;import android.widget.LinearLayout;import android.widget.ZoomControls;import com.google.android.maps.*;public class HelloMapView extends MapActivity {    /** Called when the activity is first created. */ LinearLayout linearLayout; MapView mapView; ZoomControls mZoom;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        linearLayout = (LinearLayout) findViewById(R.id.zoomview);        mapView = (MapView) findViewById(R.id.mapview);        mZoom = (ZoomControls) mapView.getZoomControls();        linearLayout.addView(mZoom);        setContentView(R.layout.main);    }    protected boolean isRouteDisplayed() {    return false;}}</code></pre><p>I'm using eclipse and I have the SDK and AVD all installed correctly but as soon as I do a run->run in eclipse it starts off ok with:</p><pre><code>[2010-01-15 12:27:03 - HelloMapView]New emulator found: emulator-5554[2010-01-15 12:27:03 - HelloMapView]Waiting for HOME ('android.process.acore') to be launched...[2010-01-15 12:27:46 - HelloMapView]HOME is up on device 'emulator-5554'[2010-01-15 12:27:46 - HelloMapView]Uploading HelloMapView.apk onto device 'emulator-5554'[2010-01-15 12:27:46 - HelloMapView]Installing HelloMapView.apk...The emulator comes up and I see my droid phone ready to load the HelloMapView app..but then it dies with the following:[2010-01-15 12:27:51 - HelloMapView]Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY[2010-01-15 12:27:51 - HelloMapView]Please check logcat output for more details.[2010-01-15 12:27:52 - HelloMapView]Launch canceled!</code></pre><p>I've never done any android type development and I come from a C# background so my java is iffy...but does anyone see anything that I might be missing?</p>","168703","","996493","","2012-04-30 08:18:15","2012-04-30 08:18:15","Google Map View Error when running - Droid","<java><android><eclipse><google-maps>","1","3","","",""
"2073769","1","2398544","","2010-01-15 18:13:02","4","4070","<p>I am working on an application for android and we since we have lots of graphics, we use a lot of memory.</p><p>I monitor the memory heap size and its about 3-4 Mb , and peeks of 5Mb when I do something that requires more memory (and then goes back to 3).  This is not a big deal, but some other stuff is handled outside the heap memory, like loading of drawables.</p><p>For example if I run the ddms tool outside eclipse, and go to sysinfo, I see that my app is taking 20Mb on the Droid and 12 on the G1, but heap size are the same in both, because data is the same but images are different.</p><p>So the questions are: How do I know what is taking the memory outside the heap memory?What other stuff takes memory outside the heap memory? Complex layouts (big tree) ? Animations?</p><p>Thanks</p><p>Daniel</p>","237115","","","","","2010-03-07 23:57:16","android memory management outside heap","<android><memory>","2","0","4","",""
"2074267","1","","","2010-01-15 19:37:49","0","799","<p>The subject says it all. My application gets internet access thanks to the android.permission.INTERNET permission, but my test cases don't while using the instrumentation test runner.</p><p>This means I can't test my server IO routines in my test cases. What's up?</p><p>Here's my manifest in case it helps you. Thanks!</p><p>Sorry about the lack of indents - could not get it working on short notice with this site. Thanks!</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android"" package=""com.example.helloandroid"" android:versionCode=""1"" android:versionName=""1.0""&gt;&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;&lt;uses-library android:name=""android.test.runner"" /&gt;&lt;activity android:name="".HelloAndroid"" android:label=""@string/app_name""&gt;&lt;intent-filter&gt;&lt;action android:name=""android.intent.action.MAIN"" /&gt;&lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;&lt;/intent-filter&gt;&lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""2"" /&gt;&lt;instrumentation android:name=""android.test.InstrumentationTestRunner"" android:targetPackage=""qnext.mobile.redirect"" android:label=""Qnext Redirect Tests"" /&gt;&lt;/manifest&gt; </code></pre>","","user251813","","","","2010-12-28 11:45:10","My android tests don't get internet access!","<android>","2","0","2","",""
"2074625","1","2074640","","2010-01-15 20:40:00","18","11058","<p>My app code is starting to get unmanageable and I want to start source control, primarily because I need to branch my code.</p><p>What are some good systems that you have used in the past and what would you recommend to me.</p><p>Requirements:<br>Must be free<br>Must integrate with eclipse<br>Must work well with android development plugin</p>","131871","","918414","","2012-06-30 04:45:53","2012-09-03 11:29:30","What's a good, free source control system for eclipse android development?","<android><version-control><eclipse-plugin>","11","2","8","",""
"2074708","1","2074759","","2010-01-15 20:52:51","5","5136","<p>Since you should be able to build Chromium browser on any reasonably modern Linux distribution, can we assume that you should be able to build it onto Android ?</p>","70711","","","","","2012-12-14 05:08:29","Is it possible to run the Chromium Browser on Android?","<android><google-chrome><chromium>","5","4","1","",""
"2074757","1","2075154","","2010-01-15 21:00:35","6","10213","<p>I have multiple activities and one service. In <code>MainActivity</code> I successfully connect to service (using a class that implements <code>ServiceConnection</code> + <code>bindService()</code> + <code>startService()</code>) but when I try to apply same method in other activity I see in LogCat a error:  </p><pre><code>01-15 22:29:37.438: ERROR/ActivityThread(12206): android.app.ServiceConnectionLeaked:      Activity com.app.liviu.simpleMusicPlayer.PlaylistActivity has leaked ServiceConnection      com.app.liviu.simpleMusicPlayer.PlaylistActivity$CounterServiceConnection@43713c90      that was originally bound here.</code></pre><p>Is it possible to connect to a service in an other way: something like to make static my <code>CounterServiceConnection</code> object in <code>MainActivity</code> and use it in the second one?</p>","217360","","648313","","2011-10-11 17:08:16","2011-10-11 17:08:16","How to stay connected to an Android service between multiple activities?","<android><activity><android-service>","2","0","1","",""
"2074939","1","2095554","","2010-01-15 21:35:53","1","3264","<p>I have a working mapview application in which I can hit a service and show GPoints on the map as overlay.</p><p>What I want to do next is show an encoded Gpolyline as an overlay on my mapView.When I try to instantiate a GPolyline poline object in my main activity, eclipse doesnt recognize the class. Is there a library import I am missing?</p><p>A quick example of adding a GPolyline to the mapView in an android application will be a great help.</p><p>Thanks,Prachi Gupta</p>","251876","","","","","2010-01-19 17:34:12","GPolyline overlay in android MapView","<android><android-mapview>","1","0","","",""
"2075064","1","","","2010-01-15 21:59:48","0","4629","<p>I have an activity which has a Spinner widget to display categories. Initially I was using an ArrayAdapter to populate the the spinner as in the following code</p><pre><code>private static final String[] arrayCategories = {  ""Business"",   ""Personal""};mCatSpinner = (Spinner) findViewById(R.id.thecategory);ArrayAdapter&lt;String&gt; catAdapter = new ArrayAdapter&lt;String&gt;(this, R.layout.track_category_item, arrayCategories);catAdapter.setDropDownViewResource(R.layout.track_category_dropdown_item); mCatSpinner.setAdapter(catAdapter);</code></pre><p>This works fine, and the spinner displays the first array item by default if no selection is made. It does show the selected item when an item is actually selected</p><p>But now I want to use a SimpleCursorAdapter to pull the list contents from a db. So I changed it to </p><pre><code>SimpleCursorAdapter scaCategories = new SimpleCursorAdapter(this, R.layout.track_category_item,cCategories,new String[] {DBAdapter.KEY_CATEGORIES_NAME},new int[]{R.id.text1});scaCategories.setDropDownViewResource(R.layout.track_category_dropdown_item); mCatSpinner = (Spinner) findViewById(R.id.thecategory);mCatSpinner.setAdapter(scaCategories);</code></pre><p>This populates the dropdown, but it does not display the first item in the spinner. Even if selected, it does not show the selected item.</p><p>I tried to setSlection to the first item using</p><pre><code>if(mCatSpinner.isSelected() != true) {    mCatSpinner.setSelection(0);}</code></pre><p>but it didn't work</p><p>What is wrong?</p>","244190","","1765573","","2013-07-26 11:28:47","2013-07-26 11:28:47","Using a Spinner with a SimpleCursorAdapter","<android><spinner><simplecursoradapter>","1","0","","",""
"2075073","1","2075119","","2010-01-15 22:02:27","3","1221","<p>I'm developing an Android app, and I am having an issue with a layout resource, failing.</p><p>I'm new(ish) to Java, Android and Eclipse.  Everytime I save the XML, Eclipse simply outputs the following:</p><p>... ""Invalid file name: must contain only [a-z0-9_.]""</p><p>I've checked there are not .out files kicking around.  I've checked over the XML and it seems to be valid.  The filename is numberSelectorDialog.xml.  I've checked the path isn't close to the Win32 limit.</p><p>My Layout resource xml looks like so:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""    android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:padding=""12px""     android:layout_width=""175px"" android:layout_gravity=""center_vertical|center_horizontal|center""    android:focusable=""true"" android:focusableInTouchMode=""true""    android:gravity=""center_vertical|center_horizontal|center""&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout02""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;Button android:id=""@+id/Button01"" android:text=""1""            android:layout_width=""50px"" android:layout_height=""50px""&gt;&lt;/Button&gt;        &lt;Button android:id=""@+id/Button02"" android:text=""2""            android:layout_height=""50px"" android:layout_width=""50px""&gt;&lt;/Button&gt;        &lt;Button android:id=""@+id/Button03"" android:text=""3""            android:layout_height=""50px"" android:layout_width=""50px""&gt;&lt;/Button&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout03""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;Button android:text=""4"" android:layout_height=""50px""            android:layout_width=""50px"" android:id=""@+id/Button04""&gt;&lt;/Button&gt;        &lt;Button android:text=""5"" android:layout_height=""50px""            android:layout_width=""50px"" android:id=""@+id/Button05""&gt;&lt;/Button&gt;        &lt;Button android:text=""6"" android:layout_height=""50px""            android:layout_width=""50px"" android:id=""@+id/Button06""&gt;&lt;/Button&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout04""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;Button android:text=""7"" android:layout_height=""50px""            android:layout_width=""50px"" android:id=""@+id/Button07""&gt;&lt;/Button&gt;        &lt;Button android:text=""8"" android:layout_height=""50px""            android:layout_width=""50px"" android:id=""@+id/Button08""&gt;&lt;/Button&gt;        &lt;Button android:text=""9"" android:layout_height=""50px""            android:layout_width=""50px"" android:id=""@+id/Button09""&gt;&lt;/Button&gt;    &lt;/LinearLayout&gt;&lt;Button android:layout_height=""wrap_content"" android:text=""Clear"" android:layout_width=""fill_parent"" android:id=""@+id/ButtonClear""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>Any other suggestions?  </p><p>Thanks,</p><p>Philip</p>","135761","","","","","2012-10-11 10:33:03","Android SDK Resource Transformation/Compilation Issue","<android><resources>","1","0","","",""
"2075512","1","","","2010-01-15 23:52:45","7","1688","<p>Let me first state what I am trying to achieve:</p><p>To create a patch for the Android OS to enable it to display <strong>Arabic/Hebrew</strong> correctly. Both of these languages are <strong>Right-to-Left</strong> (RTL) and their script involves connected letters/<strong>glyphs</strong> (unlike Latin alphabets which have discrete letters).</p><p>Example:</p><p>The Arabic word for ""car"" is: </p><blockquote>  <p><strong>?????</strong></p></blockquote><p>The discrete letters look like this: </p><blockquote>  <p><strong>? ? ? ? ?</strong></p></blockquote><p>As you can see, each letter connects to each other letter in different ways depending on what precedes it &amp; what follows it. Ok, enough with the language lessons :) My question is:</p><p>What binary/class in android do I need to hijack to enable this functionality?</p><p>Another way to put it is; if you wanted every instance ""x"" to be displayed as ""y"", system-wide, what binary/class would you need to meddle with?</p><p>The source code is browsable at GitHub: <a href=""http://github.com/android/"" rel=""nofollow"">http://github.com/android/</a></p><p>I think it might be somewhere under the C/C++ <strong>platform_system_core</strong>, or thier custom JVM <strong>platfom_dalvik</strong>.</p><p>Just to be clear, the font is not an issue since you can drop Arabic/Hebrew fonts as fall-back fonts and they would display, albeit in discrete form.</p><p>Your help would be much appreciated :)</p>","","user251949","569101","user251949","2013-06-05 11:26:48","2013-06-05 11:26:48","Where exactly in the Android OS is text renderred?","<android><arabic><right-to-left><glyph><bidi>","3","0","0","",""
"2075531","1","2103781","","2010-01-15 23:57:35","1","3583","<p>I am not able to get the ACTION_WEB_SEARCH to work correctly, does this require any permissions on the AndriodManifest.xml?</p><p>This is my code:</p><pre><code> String q = edittext.getText().toString(); Intent myIntent = new Intent(Intent.ACTION_WEB_SEARCH, Uri.parse(q)); startActivity(myIntent);</code></pre><p>Any help would be much appreciated.</p><p>Platform 2.0.</p>","17162","","309086","","2012-10-23 10:21:56","2012-10-23 10:21:56","Android ACTION_WEB_SEARCH","<java><android>","2","1","","",""
"2075671","1","","","2010-01-16 00:33:13","2","671","<p>I need to have gps running all the time in my application, but I don´t know if it is better throw it like a thread inside of the activity or if I should creat a Service and then in the Service, throw the thread</p><p>Can anybody help me?? Thank you!!</p><p>P.D: Sorry for my English</p><hr><p>My answer doesn´t lie in how my application will work because I want my application goes to the background and it works.I'm going to try to explain what my application consists: It has one activity that starts one service with the gps, the locations from gps are compared with others locations that it has in a file. When a condition is true, then it starts another service running a multimedia player.</p><p>So if I am watching another application or if I have the device in my pocket, I want my application continues running.</p>","251962","","59303","","2013-07-14 12:03:10","2013-07-14 12:03:10","threads or service","<android>","3","0","0","",""
"2075762","1","2075888","","2010-01-16 00:54:28","4","3836","<p>I am getting the text 'android.database.sqlite.SQLiteCursor@435b9ba0' returned from a spinner.getSelectedItem().toString() call. I'm not sure why. The spinner is tied to a SimpleCursorAdapter.</p><p>Here is the code</p><pre><code>    cCategories = (Cursor) myAdapter.getAllCategories();    this.startManagingCursor(cCategories);    SimpleCursorAdapter scaCategories = new SimpleCursorAdapter(this, R.layout.track_category_item,cCategories,new String[] {DBAdapter.KEY_CATEGORIES_NAME},new int[]{R.id.text1});    scaCategories.setDropDownViewResource(R.layout.track_category_dropdown_item);     mCatSpinner = (Spinner) findViewById(R.id.thecategory);    mCatSpinner.setAdapter(scaCategories);    if(mCatSpinner.isSelected() != true) {        mCatSpinner.setSelection(0);    }</code></pre><p>and the xmltrack_category_item.xml</p><pre><code>&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/text1""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""@android:id/text1""    style=""?android:attr/spinnerItemStyle""    android:ellipsize=""marquee""    android:singleLine=""true""&gt;&lt;/TextView&gt;</code></pre><p>track_category_dropdown_item.xml</p><pre><code>&lt;CheckedTextView xmlns:android=""http://schemas.android.com/apk/res/android""               android:id=""@+id/text1""    style=""?android:attr/spinnerDropDownItemStyle""    android:singleLine=""true""    android:layout_width=""fill_parent""    android:layout_height=""?android:attr/listPreferredItemHeight""    android:ellipsize=""marquee"" /&gt;</code></pre><p>The spinner xml looks like this</p><pre><code>&lt;Spinner    android:id=""@+id/thecategory""    android:prompt=""@string/SELECT_CATEGORY""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_x=""15px""    android:layout_y=""133px"" &gt;&lt;/Spinner&gt;</code></pre><p>and the cursor being returned is</p><pre><code>public Cursor getAllCategories() {    return db.query(DATABASE_CATEGORIES_TABLE, new String[] {            KEY_CATEGORIES_ROWID,            KEY_CATEGORIES_NAME,            KEY_CATEGORIES_DEFAULT},             null,             null,             null,             null,             null);}</code></pre><p>The spinner appears to work properly. When I try to save this is what is passed as the value of the selected item using spinner.getSelectedItem().toString().</p><p>Anyone see anything blatently wrong here. not sure what to do.</p><p>thankspatrick</p>","244190","","1306012","","2012-09-30 09:28:36","2012-09-30 09:28:36","android.database.sqlite.SQLiteCursor@435b9ba0","<android><android-widget><spinner>","2","1","0","",""
"2075836","1","2075847","","2010-01-16 01:25:54","6","13468","<p>I'm new to android and I'm trying to figure out how to get the contents of a URL as a String. For example if my URL is <a href=""http://www.google.com/"">http://www.google.com/</a> I want to get the HTML for the page as a String. Could anyone help me with this?</p>","200565","","","","","2012-06-13 06:31:31","Read contents of a URL in Android","<android>","1","0","2","",""
"2075977","1","","","2010-01-16 02:31:28","3","428","<p>I have an activity which lets the user select a phone number. Naturally, I'd like my class to remember the id of the contact selected, so I save this in a class field.  However when the method onActivityResult returns, my class variable is reset.  Here is what I'm trying to do:</p><pre><code>    Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI);    startActivityForResult(intent, PICK_CONTACT);     ...    public void onActivityResult(int reqCode, int resultCode, Intent intent){        super.onActivityResult(reqCode, resultCode, intent);               switch(reqCode){            case(PICK_CONTACT):                if(resultCode == Activity.RESULT_OK){                    Uri contactData = intent.getData();                    Cursor c = managedQuery(contactData, null, null, null, null);                    if(c.moveToFirst()){                        contactName = c.getString(c.getColumnIndexOrThrow(People.NAME));                        contactId = c.getInt(c.getColumnIndexOrThrow(People._ID));        break;</code></pre><p>When I set a breakpoint within this method, the values for contactName and contactId are as I expect, however once the method returns, the values somehow get reset to their defaults.  Clearly I'm missing something, but I'm not sure what I'm doing wrong or forgetting.</p><p>Thanks!</p><p>Iva</p>","250493","","","","","2010-01-26 17:58:29","Class variables set in onActivityResult are reset when method returns","<android>","0","1","1","",""
"2076037","1","2077804","","2010-01-16 03:03:16","25","15708","<p>Inside an OnClickListener I cannot access most variables ""outside"" of the scope, like this:</p><pre><code>findViewById(R.id.Button01).setOnClickListener(new OnClickListener()        {            @Override            public void onClick(View v)            {                Intent mainApps = new Intent(Intent.ACTION_MAIN);                mainApps.addCategory(Intent.CATEGORY_LAUNCHER);                List&lt;ActivityInfo&gt; activities = this.getPackageManager().queryIntentActivities(mainApps, 0);                /*                Intent intent = new Intent(""com.sygic.drive/com.sygic/drive/.SygicDriveActivity"");                startActivity(intent);*/            }        });</code></pre><p>in this example I need to get the PacketManager, and I cannot get it since I do not have the Context available inside the OnClickListener. </p><p>I could make a static reference outside, and use it inside, but is that correct? Seems odd to have to do that all the time?</p>","178143","","234938","","2010-01-23 12:07:08","2013-04-21 13:47:57","Inside OnClickListener I cannot access a lot of things - how to approach?","<java><android>","3","0","11","",""
"2076093","1","2076094","","2010-01-16 03:32:09","1","2109","<p>Im not sure this is actually allowed here, but since I usually go to StackOverflow and search for answers (and in many cases find the answers) I thought I would ask a question and then answer it myself =)</p><p>So, I have Sygic Navigation om my HTC Hero, and since I need to start that app from code (and then use the API to control it) I did some investigation on how to start it - what intent to use.</p><p>So, the question is: what Intent or Activity should I use to start the app?</p>","178143","","","","","2013-02-11 09:45:14","How to start Sygic Navigation from code","<android><navigation>","2","0","","",""
"2076107","1","","","2010-01-16 03:41:23","1","520","<p>I am using Sygic Navigation on my HTC Hero. I can start it by calling the correct intent as I <a href=""http://stackoverflow.com/questions/2076093/how-to-start-sygic-navigation-from-code"">described here</a>. Now, Sygic starts in fullscreen-mode and I cannot use the BACK-button to go back to my previous Activity (dont ask me why). </p><p>The question is: is there some trick or way so I can control how that Sygic Activity is started? I want to add my own ""header"" on top; the header contains my buttons for navigation. It would be great if I could add that header, then have Sygic below that (as the ""content"" then, as shown <a href=""http://stackoverflow.com/questions/2002920/android-layout-how-to-create-a-header-content-layout"">here</a>).</p><p>Thx =)</p>","178143","","","","","2010-01-16 12:43:24","Start external app/Activity and add my own header?","<android><navigation>","1","0","","",""
"2076150","1","2076390","","2010-01-16 04:01:15","2","265","<p>I have an Android application that uses the well known <a href=""http://developer.android.com/intl/fr/guide/practices/screens_support.html#strategies"" rel=""nofollow""><i>Strategies for Legacy Applications</i></a>.  It is build with the Android SDK 2.0 with manifest settings minSdkVersion=""3"" (API 1.5) and targetSdkVersion=""5"" (2.0).  <b>Question1:</b> Since maxSdkVersion is not specified, the application should be installable and compatable with newly released Android versions 2.01 and 2.1 correct?  At this point in time, I am not planning any enhancements that will use any new API features.  <b>Question2:</b> is there any value in rebuilding the application with Android SDK 2.1?  <b>Question3:</b> If so, should targetSdkVersion be changed from 5 (API 2.0) to 7 (API 2.1)?  </p>","236975","","","","","2010-01-16 06:11:28","Should a legacy Android application be rebuilt using SDK 2.1?","<android><legacy>","1","0","1","",""
"2076176","1","","","2010-01-16 04:13:02","2","3790","<p>I would like to make a Google map overlay with changable pins. An easy way to visualize this would be to think of a near real time overlay, where the pins are constantly changing location. </p><p>However, I can't seem to think of a safe way to do this with the <a href=""http://code.google.com/android/add-ons/google-apis/reference/index.html?com/google/android/maps/package-tree.html"" rel=""nofollow"">ItemizedOverlay</a>. The problem seems to be the call to populate - If size() is called by some maps thread, and then my data changes, then the result when the maps call accesses getItem() can be an IndexOutOfBoundsException. </p><p>Can anyone think of a better solution than overloading populate and wrapping super.populate in a synchronized block? </p><p>Perhaps I could get better luck using a normal Overlay? The Itemized one seems to exist to manage the data for you, perhaps I am making a fundamental mistake by using it?</p><p>Thanks for any help, my brain is hurting!</p><p>Hamy</p>","119592","","","","","2011-12-13 15:27:10","How to make a mutable ItemizedOverlay","<android><google-maps><overlay><near-real-time>","2","1","2","",""
"2076381","1","","","2010-01-16 06:08:11","11","3534","<p>Here's my Python script written using <a href=""http://code.google.com/p/android-scripting/wiki/PythonAndroidAPI"">android-scripting</a>:</p><pre><code>import android, timedroid = android.Android()interval = 1 # every 1 minutewhile True:    # define your own vibrate pattern here    droid.vibrate(200)    time.sleep(0.3)    droid.vibrate(300)    time.sleep(60*interval)</code></pre><p>It basically vibrates every minute (like a <a href=""http://www.reddit.com/r/Android/comments/ag6b6/periodic_reminder_app/"">motivator</a>). However, when the phone is locked with screen blanked out, I don't sense any vibration. Perhaps Android is freezing the script (and hence the while loop)? Note that I am indeed running this script as a service (long-tap and click 'Start as service').</p><p>Is there a way to make this script work all the time regardless of the phone suspend state?</p><p><strong>Update 1</strong>: I do hear the vibration occasionally, not every minute .. but rather like every 5-10 minutes randomly.</p><p><strong>Update 2</strong>: This problems occurs if I run the script normally (not as a service). Seems like ""time.sleep"" is not sleeping for the specified time.</p>","55246","","55246","","2010-01-19 01:45:02","2011-11-14 22:22:09","Making an android Python service to run in suspend state","<python><android><android-scripting>","5","0","2","",""
"2076535","1","","","2010-01-16 07:19:14","0","383","<p>I have an intent open my phone; when something comes from the server from another Java class I want to refresh the current screen. Can you please help me with how I can refresh my current screen without creating a new one?</p>","","raj","3609","","2010-01-16 07:22:03","2010-01-16 07:31:03","Android Intent related","<android>","1","0","","",""
"2076610","1","2076704","","2010-01-16 07:50:29","6","1265","<p>How to set text on status bar (line that placed Battery life, time ..etc) ?</p><p>Thanks in advance.</p>","227889","","","","","2010-01-16 09:01:52","How to set text on status bar?","<android>","1","0","","",""
"2076617","1","2077704","","2010-01-16 07:54:15","1","1638","<p>Do you know about how to set coordinates (X, Y position), height and width for MapView ?</p>","227889","","73488","","2011-11-05 05:18:32","2011-11-05 05:18:32","How to set height and width for MapView?","<android>","1","0","","",""
"2077008","1","2077361","","2010-01-16 10:38:32","36","40945","<p>Is it possible to show a list of applications (with <code>intent.createChooser</code>) that only show me my twitter apps on my phone (so htc peep (htc hero) or twitdroid). I have tried it with <code>intent.settype(""application/twitter"")</code> but it doesnt find any apps for twitter and only shows my mail apps.</p><p>Thank you,</p><p>Wouter</p>","188119","","3171","","2010-01-17 08:02:19","2014-01-28 19:34:50","Android Intent for Twitter application","<android><twitter><android-intent>","9","0","32","",""
"2077054","1","2083156","","2010-01-16 10:50:33","9","8539","<p>I have a <a href=""http://code.google.com/android/add-ons/google-apis/reference/index.html?com/google/android/maps/MapView.html"">MapView</a> that I'm displaying a ""useful radius"" (think accuracy of coordinate) in. Using <code>MapView</code>'s <a href=""http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/Projection.html"">Projection</a>'s <a href=""http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/Projection.html#metersToEquatorPixels%28float%29"">metersToEquatorPixels</a>, which is admittedly just for equatorial distance) isn't giving me an accurate enough distance (in pixels). How would you compute this if you wanted to display a circle around your coordinate, given radius?</p>","76835","","","","","2012-07-18 09:12:50","How to compute a radius around a point in an Android MapView?","<android><gps><android-mapview>","2","4","9","",""
"2077436","1","","","2010-01-16 13:21:55","4","5718","<p>I'm having a bit of a problem here. What I want to do is launch an Activity from within the PreferenceActivity. So my preference.xml which holds the preference layout looks like this:</p><pre><code>&lt;Preference android:title=""Launch Activity"" &gt;   &lt;intent android:action=""org.momo.SOME_ACTIVITY"" /&gt;&lt;/Preference&gt;</code></pre><p>The manifest is aware of the activity I want to launch.. </p><pre><code>&lt;activity android:label=""@string/app_name"" android:name=""SomeActivity""&gt;        &lt;intent-filter&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;action android:name=""org.momo.SOME_ACTIVITY"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>guess what, I'm getting a Security Exception ( Permission Denial ) when I want to launch it. Am I missing something? My understanding of intents is still a bit incomplete, yet I figured that it <em>must</em> work that way.</p><p>Thank you for any help!</p>","228358","","","","","2012-01-27 17:04:15","Launch Activity from Preference Activity causes Permission Denial Exception","<android><activity><preference>","2","4","1","",""
"2077679","1","","","2010-01-16 14:48:10","5","670","<p>I'm writing an app that's basically a wrapper around a 250K JNI.  The JNI (a game engine) has APIs like handle_penUp(int x, int y).  Sometimes it needs to query the user from inside handle_penUp() (via callbacks into Java code), so the dialog I use to implement the query must block.</p><p>I understand that the main thread of execution can't block.  So I've spawned a second thread that makes all the JNI calls that might result in callbacks that would need to block.  Inside that second thread, when I need to put up a blocking dialog, I call startActivityForResult() and then acquire() on a semaphore.  When onActivityResult() gets called on the main thread it calls release() on the same semaphore.</p><p>This works if my query is implemented as a new Activity, but not if I want to showDialog() within the existing Activity.  Log messages tell me my thread needs a Looper.  I'm adding one -- and will append info on whether it works -- but it feels as if I'm going down the wrong path here.  What I need is a recipe for doing blocking dialogs (useful if only because every other platform has them and so ported code will often work that way.)</p>","252195","","102703","","2010-06-18 22:04:57","2010-10-27 09:32:20","Blocking Dialog from within JNI code","<java><android><jni><android-ndk>","2","0","1","",""
"2077797","1","","","2010-01-16 15:18:32","1","3446","<p>i'm trying to catch the onTouchEvent of a WebView, in order to handle actions like<code>MotionEvent.ACTION_UP</code>, <code>MOVE</code> and <code>CANCEL</code>. I made a simple example but did not success, however i succed with just a View. Am i missing something?</p><p>Thanks </p><pre><code>public class HelloWebView extends Activity { @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(new MyWebView(this)); } private static class MyWebView extends WebView {  @Override  public boolean onTouchEvent(MotionEvent event) {   int action = event.getAction();   Log.w(""TouchEvent"",""Touch"" + action);   Log.w(""HitResult"",this.getHitTestResult().toString());   switch (action) {   case (MotionEvent.ACTION_DOWN): // Touch screen pressed    break;   case (MotionEvent.ACTION_UP): // Touch screen touch ended    break;   case (MotionEvent.ACTION_MOVE): // Contact has moved across screen    break;   case (MotionEvent.ACTION_CANCEL): // Touch event cancelled    break;   }   return super.onTouchEvent(event);  }  public MyWebView(Context context) {   super(context);   this.getSettings().setJavaScriptEnabled(true);   this.loadUrl(""http://www.google.com"");  } }}</code></pre>","252209","","221955","","2012-01-20 05:03:12","2012-01-20 05:03:12","webView onTouchEvent","<android><webview>","1","0","","",""
"2077900","1","2078051","","2010-01-16 15:44:57","1","895","<p>My programming knowledge is slim, i discovered Java and the Android SDK some days ago.</p><p>I have a SQLiteDatabase, a SQLiteOpenHelper, and a Cursor working properly( means i think i understood how to create/open a DB using a SQLiteOpenHelper, make queries on my DB and get a cursor )</p><p>currently, i'm wrapping i + labName + labCity into a single results String, and display into a single TextView R.id.label</p><p>Is it possible to bind labName to R.id.label, and bind labCity to another TextView R.id.label2 ?</p><p>Here is the code of my ListActivity i need help with :</p><pre><code>public class MainLabList extends ListActivity implements OnItemClickListener {@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main_lab_list);    // DB    GestionDB gdb = new GestionDB(this, GestionDB.DATABASE_NAME, null, GestionDB.DATABASE_VERSION);    SQLiteDatabase theDB = gdb.getWritableDatabase();    // Cursor    String[] columns = {GestionDB.LAB_NAME, GestionDB.LAB_ADDRESS_CITY};    Cursor c =        theDB.query(GestionDB.TABLE_NAME, columns, null, null, null, null, null);    ////////    this.setTitle("" "" + c.getCount() + "" Labs in Local Database"");    ArrayList&lt;String&gt; results = new ArrayList&lt;String&gt;();    int i = 0;     c.moveToFirst();    /* Loop through all Results */     do {          i++;                  String labName = c.getString(c.getColumnIndex(GestionDB.LAB_NAME));         String labCity = c.getString(c.getColumnIndex(GestionDB.LAB_ADDRESS_CITY));          /* Add current Entry to results. */          results.add("""" + i + "": "" + labName                         + "" ("" + labCity +  "")"");     } while (c.moveToNext());    //need rework                   ListView lvLabListing = (ListView) findViewById(android.R.id.list);    ArrayAdapter&lt;String&gt; labListAdapter = new ArrayAdapter&lt;String&gt;(this,            R.layout.listing, R.id.label, results );    lvLabListing.setAdapter(labListAdapter);    lvLabListing.setOnItemClickListener(this);    //    // don't forget to close the database    gdb.close();</code></pre><p>And the listing.xml i would like to modify :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;&lt;ImageView android:id=""@+id/ImageView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:src=""@drawable/icon""&gt;&lt;/ImageView&gt;&lt;TextView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/label""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>My GestionDB class is simple, just define some columns if the database doesn't exist, along with some variables.</p>","252222","","252222","","2010-01-16 15:51:39","2010-01-16 16:21:33","Begginner working with ListAdapters / SQLite Database","<android>","1","0","","",""
"2077961","1","2077986","","2010-01-16 15:59:34","1","974","<p>I'm creating a webapp for Android mobile phones with ASP.NET and the Ajax Control Toolkit.I've included a CalendarExtender-Control which popups a calendar when focusing the associated Textbox-Control.</p><p>If I select this textbox on my mobile phone, the Android webbrowser highlights it with an orange border. The problem is that this border is shown in front of my Calendar popup. Has anybody any idea how to fix this issue?</p><p>Thanks!</p>","252233","","","","","2010-01-16 16:06:05","ASP.NET AJAX CalendarExtender - Problem with Android Browser","<asp.net><css><android><asp.net-ajax><webkit>","1","0","","",""
"2078122","1","2078150","","2010-01-16 16:41:07","21","12430","<p>I am trying to implement a simple widget for display on the home screen. The problem I am experiencing is that onUpdate is only being called once when I install the widget. The configuration is below. Note: I will not leave update period at 20 secs as I know that would kill battery (just testing).</p><p>Configuration:</p><pre><code>&lt;appwidget-provider xmlns:android=""http://schemas.android.com/apk/res/android""   android:minWidth=""294dp""   android:minHeight=""72dp""   android:updatePeriodMillis=""20000""   android:initialLayout=""@layout/my_custom_app_widget""&gt;`&lt;/appwidget-provider&gt;`</code></pre><p>Manifest Excerpt:</p><pre><code>&lt;receiver android:name=""MyCustomWidgetProvider""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;    &lt;/intent-filter&gt;    &lt;meta-data android:name=""android.appwidget.provider""        android:resource=""@xml/my_custom_app_widget_info"" /&gt;&lt;/receiver&gt;</code></pre><p>I am observing the following behavior when I install the widget:In my WidgetProvider class on onReceive is called then onEnabled then onReceive, then onUpdate.</p><p>After that the widget displays and onUpdate is never called again. I also inspect the settings of the provder when onUpdate is called and everything set in XML above (e.g. update period) is correct.</p>","175056","","2598","","2011-06-15 01:51:56","2011-08-03 06:49:35","Android Widget Not Updating","<android><widget><appwidget>","2","0","6","",""
"2078196","1","","","2010-01-16 17:01:53","2","389","<p>I'd like to access an Internet database from my app to edit it and read it. Any link I should read or any advise?</p><p>Thanks</p>","252257","","","","","2010-01-17 08:32:21","Accessing distant database, android","<database><android><internet>","0","1","","",""
"2078198","1","2078779","","2010-01-16 17:02:38","16","6127","<p>I am developing an Android app that needs to communicate bi-directionally with a server.  By that, I mean either the server or the device can send a message at any time, with an arbitrary amount of time in between messages.  Sending data from the device to the server is a common and I think well understood task, but I'm not as sure what the best approach is to go in the opposite direction from the server to the device.</p><p>I think having the device periodically poll the server may be a bad idea due to latency and the drain on the battery, but I'd be willing to consider this option.  My plan at the moment is to send text messages from the server via an email-to-SMS bridge, and to have my app run a service to receive and handle these messages.  </p><p>The question I have is if there are any best practices for this scenario, and if using text messages has some downsides that I have failed to consider.  For the sake of this question, I want to assume that users have an unlimited text data plan, so paying per text won't be an issue.</p>","3126","","3126","","2010-01-16 18:18:35","2014-04-15 09:06:32","Best approach to send data from a server to an Android device","<android>","1","0","17","",""
"2078229","1","","","2010-01-16 17:11:28","-5","1472","<p>We are developing an app that will need to capture camera image and send it via MMS. (large or small image please)</p><p>Based on a method invocation in another activity, take an image and send it via MMS</p><p>This is one of the last two parts left for us.</p><p>Thanks a milion.</p><p>Mat</p>","235228","","222908","","2010-01-16 17:17:03","2010-01-18 23:30:43","Capture an image in Android and send it via MMS","<android>","2","1","","2013-11-23 15:55:25",""
"2078289","1","","","2010-01-16 17:34:02","9","8965","<p>I have a multi language app.I want to give the user the ability to control which language to use.that mean that even if he has the English Locale he could use a different language if he wants.How can I change the Locale language? (per app)Thanks....</p>","379425","","","","","2010-03-09 22:32:39","(ANDROID) controling the user language","<android><locale>","2","0","4","",""
"2078475","1","2351880","","2010-01-16 18:34:07","4","4360","<p>I am new to java, eclipse, and android development, so I may be missing something simple although I have checked basic stuff like spelling several times.</p><p>Because there is no number picker control (such as that used in the date picker) in the public Android SDK, the <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/65da9820998fddc9"" rel=""nofollow"" title=""conventional wisdom"">conventional wisdom</a> is to ""clone and own"" the control that exists in the Android source.</p><p>In an attempt to do that, I have copied the code for NumberPicker into my project and its dependency, NumberPickerButton.  I have also copied the supporting resources. </p><p>The problem I am having is that when I try to include the NumberPicker in a layout, the rendered version of the layout within Eclipse does not work.</p><pre><code>&lt;com.spencerandbrown.PatientTracker1.NumberPicker android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:id=""@+id/spanEnd2"" /&gt;</code></pre><p>Adding that tag causes the Layout view of the XML file to only show the following error.</p><pre><code>ClassCastException: com.spencerandbrown.PatientTracker1.NumberPickerButton cannot be cast to com.spencerandbrown.PatientTracker1.NumberPickerButton</code></pre><p>I have tried both the fully qualified name and the unqualified name and it makes no difference.  </p><p>The strange thing is that the control works at run time, it just will not render in Eclipse.</p><p>Is there a solution for this issue?  Am I just doing something wrong?</p><p>If necessary, I can include more code from my project to clarify.</p><p>If I reference the internal Android widget, it works fine in the Eclipse layout view, but it is clumsy to interact with that way and it might break in the future.</p><pre><code>&lt;com.android.internal.widget.NumberPickerandroid:layout_width=""wrap_content""android:layout_height=""wrap_content"" android:id=""@+id/spanStart""/&gt;</code></pre><p>Here is the stack trace from Eclipse.</p><pre><code>java.lang.ClassCastException: com.spencerandbrown.PatientTracker1.NumberPickerButton cannot be cast to com.spencerandbrown.PatientTracker1.NumberPickerButtonat com.spencerandbrown.PatientTracker1.NumberPicker.&lt;init&gt;(NumberPicker.java:110)at com.spencerandbrown.PatientTracker1.NumberPicker.&lt;init&gt;(NumberPicker.java:98)at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)at java.lang.reflect.Constructor.newInstance(Constructor.java:532)at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(Unknown Source)at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:198)at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:126)at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)at android.view.LayoutInflater.rInflate(LayoutInflater.java:620)at android.view.LayoutInflater.rInflate(LayoutInflater.java:620)at android.view.LayoutInflater.inflate(LayoutInflater.java:407)at android.view.LayoutInflater.inflate(LayoutInflater.java:296)at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:377)at com.android.ide.eclipse.adt.internal.editors.layout.GraphicalLayoutEditor.computeLayout(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.GraphicalLayoutEditor.recomputeLayout(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.GraphicalLayoutEditor.activated(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.pageChange(Unknown Source)at org.eclipse.ui.part.MultiPageEditorPart$2.widgetSelected(MultiPageEditorPart.java:291)at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1200)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1185)at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1025)at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3256)at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2045)at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:323)at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3493)at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3112)at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:616)at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)at org.eclipse.equinox.launcher.Main.run(Main.java:1311)</code></pre>","76916","","76916","","2010-01-16 19:18:17","2010-03-10 08:22:22","Eclipse ClassCastException when trying to expand XML layout for Android","<xml><android><eclipse><classcastexception>","2","0","2","",""
"2078710","1","2078748","","2010-01-16 19:48:55","9","4919","<p>Can anyone tell me, is it possible to use the ADB to pull and push a database from an app, without root privaliges on the phone?</p><p>For example, I know the location on my rooted magic and dream is:</p><pre><code>/data/data/com.xxxx.xxxx/databases/xxxx</code></pre><p>I know that you can use ADB without root, but when trying to use the shell - you can't view that location without root privaliges. But I have been told you can use push and pull if you know the file you want?</p><p>Basically I want to pull a database from MY app on a non rooted phone modify it and push it back on.</p><p>Only trouble I have is, the two phones I have are both root and I don't have access to a non root one to try it out.</p>","232565","","2961","","2010-01-16 19:59:15","2013-06-19 13:51:47","Android ADB access to application databases without root","<android><root>","3","1","8","",""
"2078768","1","2097131","","2010-01-16 20:12:24","9","5803","<p>I am currently starting a game engine in Android, first forray onto the platform and have the basics in place however i am unsure of the best way to approach resolution independence when using SurfaceView to draw graphics. </p><p>Looking for pointers as to how to keep the game / sprites etc all looking the same independent of the screen, obviously it wouldn't be efficient to scale all the sprites every frame or store many variations for differing resolutions</p>","192065","","102703","","2010-01-26 01:08:53","2010-08-09 00:35:53","Resolution independence in Android SurfaceView","<android><screen-resolution>","2","0","11","",""
"2078809","1","9306130","","2010-01-16 20:27:22","3","5635","<p>I am trying to create a custom progress bar in android. I have used the following xml file for it (progress_bar_horizontal.xml):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;layer-list xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;item android:id=""@android:id/background""&gt;   &lt;shape&gt;    &lt;corners android:radius=""8dip"" /&gt;    &lt;stroke android:width=""2dip"" android:color=""#FFFF""/&gt;    &lt;solid android:color=""#FFFF""/&gt;                 &lt;/shape&gt;  &lt;/item&gt;  &lt;item android:id=""@android:id/secondaryProgress""&gt;   &lt;clip&gt;    &lt;shape&gt;     &lt;corners android:radius=""8dip"" /&gt;     &lt;stroke android:width=""2dip"" android:color=""#FFFF""/&gt;     &lt;solid android:color=""#FF00""/&gt;     &lt;/shape&gt;   &lt;/clip&gt;  &lt;/item&gt;  &lt;item android:id=""@android:id/progress""&gt;   &lt;clip&gt;    &lt;shape&gt;     &lt;corners android:radius=""8dip"" /&gt;     &lt;stroke android:width=""2dip"" android:color=""#FFFF""/&gt;     &lt;solid android:color=""#FF00""/&gt;     &lt;/shape&gt;   &lt;/clip&gt;  &lt;/item&gt; &lt;/layer-list&gt;</code></pre><p>Everything works great apart from the fact I would like to have the progress in my progress bar rounded on both sides. The aforementioned code makes a progress bar to be rounded on the left hand side and simply cut (not rounded) on the right hand side. It is because of the clip tag probably. Could you please help me on that? What should i change to have the progress in my progress bar rounded on both sides? </p><p>The full layout goes below:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:orientation=""vertical""&gt;  &lt;LinearLayout  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:orientation=""vertical""  android:background=""@drawable/gradient_progress""  android:padding=""10dip""  &gt;   &lt;LinearLayout   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:orientation=""horizontal""   &gt;    &lt;TextView     android:id=""@+id/progress_header""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:textColor=""#FF000000""     android:textAppearance=""?android:attr/textAppearanceMedium""     android:textStyle=""bold""     android:text=""Uploading""                   /&gt;    &lt;TextView     android:id=""@+id/progress_percent""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:textColor=""#FF000000""     android:textAppearance=""?android:attr/textAppearanceMedium""     android:textStyle=""bold""     android:text=""55%""              android:paddingLeft=""10dip""    /&gt;         &lt;/LinearLayout&gt;             &lt;ProgressBar    android:id=""@+id/progress_bar""    style=""?android:attr/progressBarStyleHorizontal""    android:layout_gravity=""center""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:progressDrawable=""@drawable/progress_bar_horizontal""    android:maxHeight=""12dip""        android:minHeight=""12dip""        android:max=""100""    /&gt;  &lt;/LinearLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>Here is the result of my effort: <a href=""http://stud.ics.p.lodz.pl/~youri/progress.jpg"" rel=""nofollow"">link text</a></p><p>I would like the red bar to have rounded edges on the right hand side as well.Thank you so much for your comments.</p>","251349","","251349","","2010-01-16 22:54:55","2014-02-21 02:15:25","Progress bar rounded on both sides in android","<android><user-interface><progress-bar>","3","3","6","",""
"2079074","1","","","2010-01-16 22:12:30","5","2455","<p>I have a custom View inherited from LinearLayout. It contains a Buttonand a EditText. EditText has initial visibility set to GONE. WhenButton is pressed I want EditText to appear with animation effect. SoI've made an ScaleAnimation and when Button is pressed I setEditText#setVisibility(VISIBLE) and start the animation. The problemis that it takes 100% of space and animation is performed inside thosebounds. So when there are more View's placed below they are moved downimmediately, but I want them to move slowly as the animationprogresses. Is there any way to do this?</p>","186620","","186620","","2012-06-21 21:49:17","2012-06-21 21:49:17","Update layout with the animation","<android><animation>","1","1","1","",""
"2079328","1","3069050","","2010-01-16 23:21:16","19","16292","<p>I'm new to Android.</p><p>I am drawing bitmaps, lines and shapes onto a Canvas inside the OnDraw(Canvas canvas) method of my view. I am looking for help on how to implement smooth scrolling in response to a drag by the user. I have searched but not found any tutorials to help me with this.</p><p>The reference for Canvas seems to say that if a Canvas is constructed from a Bitmap (called bmpBuffer, say) then anything drawn on the Canvas is also drawn on bmpBuffer. Would it be possible to use bmpBuffer to implement a scroll ... perhaps copy it back to the Canvas shifted by a few pixels at a time? But if I use Canvas.drawBitmap to draw bmpBuffer back to Canvas shifted by a few pixels, won't bmpBuffer be corrupted? Perhaps, therefore, I should copy bmpBuffer to bmpBuffer2 then draw bmpBuffer2 back to the Canvas.</p><p>A more straightforward approach would be to draw the lines, shapes, etc. straight into a buffer Bitmap then draw that buffer (with a shift) onto the Canvas but so far as I can see the various methods: drawLine(), drawShape() and so on are not available for drawing to a Bitmap ... only to a Canvas.</p><p>Could I have 2 Canvases? One of which would be constructed from the buffer bitmap and used simply for plotting the lines, shapes, etc. and then the buffer bitmap would be drawn onto the other Canvas for display in the View?</p><p>I should welcome any advice!  </p><p>Answers to similar questions here (and on other websites) refer to ""blitting"". I understand the concept but can't find anything about ""blit"" or ""bitblt"" in the Android documentation. Are Canvas.drawBitmap and Bitmap.Copy Android's equivalents?</p>","250845","","","","","2013-05-22 00:49:14","Scrolling a Canvas smoothly in Android","<android><canvas><smooth-scrolling>","5","2","10","",""
"2079691","1","2080353","","2010-01-17 01:53:04","10","16012","<p>When creating one Intent so that MyActivity reacts to a User pressing the Home-button is easy using the XML markup:</p><pre><code>    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.MAIN"" /&gt;        &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;category android:name=""android.intent.category.HOME"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;/intent-filter&gt;</code></pre><p>I want to know how to avoid getting the choice of ""what activity do you want to use"" for the Home screen? HTC has made its ""Touch Flo"" (Sense) override the default ""start"" Activity and I never get the question if I want to use ""Start"" or ""TouchFlo"" usually. However, when I added my own Activity I always get the question.</p><p>Yes, I know that I can check the ""Use this as standard""-checkbox, but thats not what I want right now. So, question is: can I make the system override everything else and always use MyActivity as default?</p><p>Next, I really only want to override the normal Home Screen when my app is running. If its not running, everything should work as normal, ie MyActivity should NOT be associated with the Home button.</p><p>Any ideas would be great.</p>","178143","","","","","2012-04-19 18:26:22","Overriding the Home button - how do I get rid of the choice?","<android>","3","2","7","",""
"2079766","1","2079926","","2010-01-17 02:29:55","1","23657","<p>I found out that you can use something like this to create a file:</p><pre><code>FileOutputStream  fs = openFileOutput(""/test.in"", MODE_WORLD_WRITEABLE);String s = ""[Head]\r\n"";s += ""Type=2"";byte[] buffer = s.getBytes();fs.write(buffer);fs.close();</code></pre><p>When running the above code I get an IllegalArgumentException stating: </p><blockquote>  <p>java.lang.IllegalArgumentException:  File /test.in contains a path  separator</p></blockquote><p>and Im guessing the ""/"" is not appreciated. I wanted the ""/"" since I need to write the file to the root directory of the device, as stated in the API in trying to follow:</p><blockquote>  <p>A request is a textfile (UNICODE) with  the file extension "".in"". The  application reads and parses the .in  file when it's placed in root  directory on the mobile device.</p></blockquote><p>Question is: how do I place a file in the root-directory? I have been looking around for an answer, but havent found one yet.</p><p>regards</p>","178143","","","","","2012-06-18 07:52:01","How to create/write file in the root of the android device?","<android><file-io>","3","1","1","",""
"2079770","1","2082289","","2010-01-17 02:32:19","5","4375","<p>I'm trying to basically have a button move down to the bottom of the screen with an animation after it is clicked.</p><p>I have the animation working perfectly, but the button doesn't stay at the bottom of the screen after the animation finishes. I've tried using <code>offsetTopAndBottom()</code>, but it only stays down there for one frame, and is redrawn at the top. How can I get the button to stay?</p>","118241","","39709","","2011-09-10 17:47:38","2013-09-12 12:07:57","Android: Move View after animation?","<android><animation>","3","0","3","",""
"2079879","1","2079920","","2010-01-17 03:42:46","5","1801","<p>Manage applications shows my app as ""com.mydomain.myapp"" instead of ""My App"".  What do I need to change?</p>","9328","","","","","2013-05-03 11:49:02","Android ""Manage Applications"" shows my app name as my package name instead of a friendly name","<android>","2","0","2","",""
"2079927","1","2080958","","2010-01-17 04:15:51","4","1568","<p>I would like to create a ListView item layout where I can touch certain portions of a line item. This is similar to the behavior of the 2.0's Contacts Call Log where I can click on the green phone logo to initiate a call or click on the incoming call details to get more information about the contact.</p><p>I don't need a behavior only implementation. I already know to bind OnClickListeners to the portions of the line items where I want to capture the press. My real issue is that the UI doesn't react properly in certain cases when a user press against a certain area of the screen. IE: if they clicked the green phone icon, only the box around the phone will highlight as pressed. Where as pressing the name will highlight that area.</p><p>I looked at the source code for the contacts app but it's very complicated and I was able to get some success I have issues where the source code is referencing Drawables and resources that aren't exposed in the SDK itself.</p><p>I would like a reasonable implementation that does not rely on internal resource of android. Or at least some pointers in the right direction.</p><p>I'm looking for a solution that works with not only pressing but the 5-way directional keypad as well.</p><p>Here's a graphic that shows what I'm talking about.</p><p><img src=""http://the-gadgeteer.com/wp-content/uploads/2009/05/and_cupcake_call-log1-200x300.png"" alt=""Android Call Log""></p>","42005","","42005","","2010-01-17 20:40:30","2010-03-03 11:00:04","Android ListView partial pressable areas","<android><listview><touch>","1","0","5","",""
"2080401","1","2082376","","2010-01-17 08:20:24","60","59140","<p>In Android, you can say something and it will search it for Google. Google can turn speech into text.</p><p>How can I use this API?</p>","179736","","365265","","2013-08-02 20:38:06","2013-08-04 17:34:02","Is there a speech to text API by Google?","<android><google-api><speech-recognition>","8","0","48","",""
"2080644","1","5425660","","2010-01-17 10:16:47","20","6217","<p>(I am not interested in pure theory, but as a practical near or mid-term possibility, say within 12-24 months.)</p><p>As a developer familiar with (but not specializing in) two major smartphone platforms, should I expect an Android library to come out which can spoof itself onto an iPhone app's GameKit-based network. It seems reasonable that a Bluetooth interface between platforms might square the opportunity to make useful applications, in the same way that modems benefited PC/Mac platforms via Metcalfe's Law.</p><p>I am looking for one of two answers:</p><ol><li><p>Is this obviously not likely (e.g. because of encryption)? If so, what is the reason? Is it possible in principle, but requiring years of reverse-engineering (like SMB/CIFS/Samba)? Or is it a no-brainer and just a matter of time? Please give evidence supporting your reason.</p></li><li><p>Is there an alternative way to have direct peer-to-peer networking besides GameKit? For example, a hand-rolled network using Bluetooth or ad-hoc WiFi? It would be nice to spoof an Android device into an existing iPhone app but my main question is, can the devices speak with each other at all!</p></li></ol>","2938","","2938","","2010-01-21 05:30:14","2012-02-15 18:27:18","Is it possible, in principle, for an Android device to interface with an iPhone over Bluetooth/GameKit?","<iphone><android><bluetooth><gamekit>","6","4","11","",""
"2080674","1","2080998","","2010-01-17 10:31:50","0","1709","<p>IN json object if we can found if data exist by jsonobj.has(""element_name"") by how can we check that data is jsonarray or json object, follow error gives error if only one events element found and throws JSONexception.</p><pre><code>JsonObject jObj;if (json.has(""Events"")) {    try {        JSONArray eventsArray = json.getJSONObject(""Events"");    } catch (JSONException e) {        jObj = json.getJsonObject(""""Events"""")    }}</code></pre>","216431","","234938","","2010-01-17 12:52:30","2010-01-17 12:52:30","JSON exception while calling getJSONObject","<java><android><json><getjson>","1","0","","",""
"2080731","1","2642064","","2010-01-17 10:55:17","47","45269","<p>Does anyone know if there is a google goggles API for Android? If not, is there one coming any time soon? With an API for this thing the possibilities are endless...</p><p>So far all I've been able to find on this subject is a discussion about not currently having a version for the iPhone due to it's ""google labs"" status (iPhone version coming once it's more ""complete""). I'm hoping an API may be released then. Anybody have any info on this at all? </p>","132858","","132858","","2010-05-12 10:32:41","2013-08-16 07:02:59","Google goggles API","<android><google-goggles>","5","1","20","",""
"2080750","1","2080947","","2010-01-17 11:06:04","1","676","<p>What is the best (meaning: most popular) UI Java markup language for <strong>designing</strong> applications for Google Android?</p><p>So i will say something like</p><pre><code>&lt;Application layout=""vertical""&gt; &lt;Panel width=""250"" height=""200"" layout=""vertical"" horizontalAlign=""center""  verticalAlign=""middle"" title=""This is a panel""&gt;  &lt;Button label=""This is a button""/&gt; &lt;/Panel&gt;&lt;/Application&gt;</code></pre><p>and get something like </p><p><img src=""http://www.vdrillpro.net/blogs/flex_2/example_app.PNG"" alt=""this window""> </p>","434051","","434051","","2010-01-17 11:09:09","2010-01-17 12:29:58","What is the best UI Java markup language for designing applications for Google Android?","<java><xml><android><markup>","1","1","","",""
"2081565","1","2081768","","2010-01-17 16:02:28","7","11998","<p>ViewHolder pattern improves ListView scrolling framerate, as seen in following example:<a href=""http://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html"">http://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html</a></p><p>Is it possible to keep this pattern while using different kind of Views for different rows?</p><p>In other words, is it possible to do something like:</p><pre><code> public View getView(int position, View view, ViewGroup parent) {       // calculate viewID here     if (view == null || *view is not null but was created from different XML than viewID* ) {          view = mInflater.inflate(viewId, null);  </code></pre>","7162","","","","","2013-08-12 07:47:54","Android: ViewHolder pattern and different types of rows?","<android><listview><performance><reusability><listadapter>","1","0","7","",""
"2081824","1","","","2010-01-17 17:11:29","2","227","<p>Is there a way to get photos from the Android contact list in full resolution?</p><p>I've tried with the loadContactPhoto method but that returns a 50x50px image. I've tried querying the Contacts.Photos contentprovider and convert the Photos.DATA blob to a bitmap but that returns a 96x96px image.</p><p>I'm using SDK1.5 because I would like my app to support 1.5 devices</p>","251077","","","","","2010-01-17 17:11:29","Is there a way to get full-resolution contact photos on Android","<android>","0","0","","",""
"2081986","1","","","2010-01-17 17:55:52","0","153","<p>I'm using themes to style widgets in Android.</p><p>With the code:</p><pre><code>&lt;item name=""android:width""&gt;200px&lt;/item&gt;</code></pre><p>... i can set the width of the widget to 200px.</p><p>But how can I specify ""wrap_content"" and ""fill_parent""?</p><p>Strings are not allowed there!</p>","252711","","","","","2012-04-30 08:46:08","Android XML Styling","<xml><android><styling>","1","0","","",""
"2082126","1","","","2010-01-17 18:39:18","1","2414","<p>I am trying to create a listview that has check box beside each item. (i am following a code from the book android), but i can't get it to work, every time i run it, it crashes. since i am very new to this android staff, i have no clue what to do to get it to work, any help is appreciated.the code is below.*i have created two layout files in names of list and list_item.the code for the main activity:<hr><code></p><pre><code>public class ListDemoActivity extends ListActivity {/** Called when the activity is first created. */String[] listItems = {""exploring"", ""android"",""list"", ""activities""};private SimpleCursorAdapter adapter;@Overrideprotected void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.lists);    //setListAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1, listItems));            //setContentView(R.layout.lists);    Cursor c = getContentResolver().query(People.CONTENT_URI, null, null, null, null);    startManagingCursor(c);    String[] cols = new String[]{People.NAME};    int[] names = new int[]{R.id.row_tv};    adapter = new SimpleCursorAdapter(this,R.layout.list_item,c,cols,names);    this.setListAdapter(adapter);}</code></pre><p>}</p><p>the lists file content:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;&lt;ListView android:id=""@android:id/list""        android:layout_width=""fill_parent""        android:layout_height=""0dip""        android:layout_weight=""1""        android:stackFromBottom=""true""        android:transcriptMode=""normal""/&gt;&lt;/LinearLayout&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;&lt;Button android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Submit Selection""/&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>and the list_item file content:</p><pre>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;&lt;CheckBox xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/row_chbox""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""/&gt;&lt;TextView android:id=""@+id/row_tv"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre>","249398","","174261","","2011-08-18 09:29:34","2011-08-18 09:29:34","Creating ListView with check boxes...Android","<android><listview><checkbox>","1","2","","",""
"2082428","1","2082504","","2010-01-17 20:10:53","1","1024","<p>There's documentation to build the android source code base. But it's hard to find information on how to run the android os and its applications in the emulator environment so you can test your changes.</p><p>Can anyone point me in the right direction? I am unfamiliar with Linux development.</p>","42005","","","","","2010-01-17 20:28:46","Debug Android Source Builds","<android><android-build><android-source>","1","0","2","",""
"2082556","1","2082579","","2010-01-17 20:44:24","5","2003","<p>I have a program that uses the SD card, so I want to be informed if the state of the card changes by registering a listener if possible. I'm aware of the Environment class and its methods, but I don't really want to be constantly polling the state. I'd rather not have my program force close when running cause someone mounted the sd card to their computer.</p>","175156","","164901","","2010-07-08 18:49:23","2010-07-08 18:49:23","How can I listen for SD card mounting in android?","<android><listener><sd-card>","1","0","4","",""
"2082580","1","","","2010-01-17 20:50:27","0","1018","<p>I have a ListView that could have 4 different views for a row depending on the data for the row. I have the ListView working correctly overriding getViewTypeCount and getItemViewTYpe. I originally was trying to dynamiclly update the view type count as new views were inflated by forcing calls to getViewTypeCount because it was possible that maybe one or two views may be all that would be needed. The app never functioned correctly crashing  after there was more than one view  added. The problem was fixed by setting getViewTypeCount to always return 4.I noticed getViewTypeCount is automatically called on app start-up and never called again unless a force call is made. So I'm just curious if this can be changed dynamically or do you need to know the number of max views you can possibly have and override getViewTypeCount to return that max value.</p><p>Vince</p>","252760","","","","","2010-01-18 07:41:49","Multiple Views for for a row in a ListView","<android>","1","0","","",""
"2082640","1","2082978","","2010-01-17 21:06:03","19","12500","<p>Hi i'm launching activity from preferences screen. Activity is shared among three preferences.I wonder if i can set extras for this activity in xml</p><pre><code>&lt;Preference    android:key=""action_1""    android:title=""@string/action_1_title""&gt;    &lt;intent        android:action=""com.package.SHAREDACTION""    &gt;    &lt;/intent&gt;&lt;/Preference&gt;</code></pre><p>i wonder if i can do something like</p><pre><code>&lt;extras&gt;     &lt;item      android:name=""""      android:value=""""/&gt;&lt;/extras&gt;</code></pre><p>All i need to do to pass an integer really. I can different actions and check action instead of extras.</p>","176761","","","","","2013-11-10 07:56:25","Is there any way to put extras to Intent from preferences?","<android><android-intent><intentfilter><extras>","6","1","7","",""
"2082707","1","2086227","","2010-01-17 21:21:56","48","23288","<p>I recently discovered that the Android 2.0 SDK supports multitouch through new functions in the MotionEvent class. You can specify a pointer index when retrieving touch properties, and in cases where multiple fingers are on the screen there should be multiple pointers provided.</p><p>Unfortunately, I only have a G1 to test on and it's running Android 1.5 and not 2.0.</p><p>Is there any way to test multitouch without a 2.0 device? In the iPhone simulator, you can hold down option and shift option to perform two fingered pinch and two fingered drag, respectively. Is there any similar functionality in the Android emulator? Is it something I should expect to see in the future, or should I just suck it up and buy a new test phone?</p>","100363","","","","","2013-04-04 12:51:47","Android Multitouch - Possible to test in emulator?","<android><android-emulator><emulator><multi-touch>","5","1","8","",""
"2082998","1","2092235","","2010-01-17 22:56:08","16","25032","<p>I am just getting started with Android development and I have created a nice little widget that displays some info on my home screen.  However, I now want to implement a Button on my widget that updates the info in my widget TextView.</p><p>Can anyone advise how to go about doing this?</p><p>Thanks</p>","252830","","","","","2013-05-25 20:18:26","How to implement a Button on an Android Widget","<android><widget>","2","3","7","",""
"2083582","1","2083644","","2010-01-18 02:30:36","5","1662","<p>Since I'm really not a fan of Eclipse I'm developing my Android app by following the rules listed here: <a href=""http://developer.android.com/guide/developing/other-ide.html"">http://developer.android.com/guide/developing/other-ide.html</a></p><p>When I'm deploying with the 'adb install' command I have to manually uninstall the APK from the emulator every time or else the install won't work.  Is there any way to bypass this?  It's fairly annoying having to add this step in every time.</p>","110539","","","","","2010-01-18 07:05:54","Can you repeatedly deploy an APK with 'adb install' without uninstalling first?","<android><android-emulator>","1","0","1","",""
"2083757","1","2083947","","2010-01-18 03:33:09","4","759","<p>Is there a way to test the application on the real device without publishing to Android market?</p>","227889","","1250033","","2013-03-01 16:44:22","2013-03-01 16:44:22","Is there a way to test an application on a real device without publishing?","<android>","2","0","1","",""
"2083909","1","2089935","","2010-01-18 04:31:09","25","15816","<p>I'm developing an Android application that uses a WebView to display the login page for Facebook. The page loads beautifully, and I'm able to select the username/password textboxes, but typing in them will not work. That is, they definitely have input focus (they have the orange focus highlight box and a flashing cursor), but typing in them does absolutely nothing. I'm not certain, but I think maybe the form buttons are also playing up - they appear to be simply refreshing the page, rather than submitting the form.</p><p>Just to be clear, although I'm particularly interested in getting Facebook running, I'm sure that this isn't a Facebook issue since other websites (Google, etc) also display the same behavior.</p><p>Does anyone have any ideas what might be the issue?</p>","214149","","1250033","","2013-03-01 16:51:35","2013-11-19 15:36:00","Why is Android WebView refusing user input?","<android><webview>","8","0","8","",""
"2083980","1","2084004","","2010-01-18 04:57:26","1","425","<p>For example, I am inside a building and i want to get my location with the accuracy of 0.75 (<code>Criteria.ACCURACY_FINE</code>) and this will use the gps if my gps is on. Since I am inside a building, gps won't work.</p><p>How can I determine if it is really impossible to get a gps fix location?</p><p>Is <code>onLocationChanged(Location arg0)</code> will be called even though no gps fix location was received when using <code>LocationListener</code>?</p><p>Is it possible to use a timeout in requesting gps location so that I can shift to network as the location provider if i can't get any location? </p>","235885","","","","","2011-03-07 10:58:14","How am I notified if I can't get any gps fix location?","<android>","1","0","","",""
"2083993","1","","","2010-01-18 05:01:00","0","860","<p>I have listview with images and its bottom has it's name. in list view each row has no'of images getting from server with left and right arrows are  in each row i want see all the images in each row by clicking left and right arrows which are available in each row of list view .and while loading images i have to run progress bar in the place of images, how to do this asynchronous task please help,it's very urgent for me</p><p>ThanksAbi</p>","252921","","","","","2010-08-08 22:24:03","asynchronous list view","<android><listview><asynchronous><custom-component>","1","2","","",""
"2084065","1","","","2010-01-18 05:32:32","6","28448","<p>I am writing an app that requires to get the current map location. My Map file works fine by it self, but I need to get the address (see <code>addressString</code> below at the buttom) from another <code>Activity</code>. I tried <code>getAddress</code>/<code>setAddress</code> (setters/getters). They do not work. They always return 'no address' (the default).</p><p>Here is my code...</p><p>How can I make this a standalone Java class??? Or get the address from another activity?</p><p>Thanks a lot.</p><p>This code works by itself.</p><p>Mat</p><hr><pre><code>import android.content.Context;import android.location.Address;import android.location.Criteria;import android.location.Geocoder;import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;import android.os.Bundle;import android.widget.TextView;import java.io.IOException;import java.util.List;import java.util.Locale;public class GetMapAddress extends MapActivity {    MapController mapController;    MyPositionOverlay positionOverlay;    MapController mc;    GeoPoint p;    String addressString = ""No address found"";    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.map);        MapView myMapView = (MapView) findViewById(R.id.myMapView);        mapController = myMapView.getController();        // Configure the map display options        myMapView.setSatellite(true);        myMapView.setStreetView(true);        // Zoom in        mapController.setZoom(17);        myMapView.setBuiltInZoomControls(true);        // Add the MyPositionOverlay        positionOverlay = new MyPositionOverlay();        List&lt;Overlay&gt; overlays = myMapView.getOverlays();        overlays.add(positionOverlay);        LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);        Criteria criteria = new Criteria();        criteria.setAccuracy(Criteria.ACCURACY_FINE);        criteria.setAltitudeRequired(false);        criteria.setBearingRequired(false);        criteria.setCostAllowed(true);        criteria.setPowerRequirement(Criteria.POWER_LOW);        String provider = locationManager.getBestProvider(criteria, true);        Location location = locationManager.getLastKnownLocation(provider);        updateWithNewLocation(location);        locationManager.requestLocationUpdates(provider, 2000, 10, locationListener);        mc = myMapView.getController();        String coordinates[] = {            ""1.352566007"", ""103.78921587""        };        double lat = Double.parseDouble(coordinates[0]);        double lng = Double.parseDouble(coordinates[1]);        p = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));        mc.animateTo(p);        mc.setZoom(17);        myMapView.invalidate();    }    private final LocationListener locationListener = new LocationListener() {        public void onLocationChanged(Location location) {            updateWithNewLocation(location);        }        public void onProviderDisabled(String provider) {            updateWithNewLocation(null);        }        public void onProviderEnabled(String provider) {        }        public void onStatusChanged(String provider, int status, Bundle extras) {        }    };    /** Update the map with a new location */    private void updateWithNewLocation(Location location) {        TextView myLocationText = (TextView) findViewById(R.id.myLocationText);        String latLongString;        if (location != null) {            // Update my location marker            positionOverlay.setLocation(location);            // Update the map location.            Double geoLat = location.getLatitude() * 1E6;            Double geoLng = location.getLongitude() * 1E6;            GeoPoint point = new GeoPoint(geoLat.intValue(), geoLng.intValue());            mapController.animateTo(point);            double lat = location.getLatitude();            double lng = location.getLongitude();            latLongString = ""Lat:"" + lat + ""\nLong:"" + lng;            Geocoder gc = new Geocoder(this, Locale.getDefault());            try {                List&lt;Address&gt; addresses = gc.getFromLocation(lat, lng, 1);                StringBuilder sb = new StringBuilder();                if (addresses.size() &gt; 0) {                    Address address = addresses.get(0);                    for (int i = 0; i &lt; address.getMaxAddressLineIndex(); i++)                        sb.append(address.getAddressLine(i)).append(""\n"");                    sb.append(address.getCountryName());                }                addressString = sb.toString();            } catch (IOException e) {            }        } else {            // Place the CellID here            latLongString = ""No location found"";        }        // This commented out line will include latitute and longtitute        // myLocationText.setText(""Your Phone is Currently at.. \n"" + latLongString + ""\n"" +        // addressString);        myLocationText.setText(""Your Phone is Currently at.. \n"" + addressString);        setAddress(addressString);        ;    }    public void setAddress(String add) {        this.addressString = add;    }    public String getAddress() {        return addressString;    }    @Override    protected boolean isRouteDisplayed() {        return false;    }}</code></pre>","252933","","234938","","2010-01-18 23:43:20","2013-12-03 16:54:16","Get Map address or Location Address in Android","<java><android><google-maps>","4","2","3","",""
"2084347","1","2085750","","2010-01-18 06:55:51","1","2050","<p>A Checkbox found in the Ringer Volume settings that allows youto set a separate Notification volume and incoming call volume</p><p>Is there a way to Check/Uncheck the Check box for Notification volume programatically.</p>","28557","","114066","","2010-07-05 10:42:10","2010-07-05 10:42:10","Android - Toggle Notification volume programatically","<android>","2","0","2","",""
"2084700","1","2209360","","2010-01-18 08:31:46","9","17251","<p>I am new to the Android SDK. Is there a way to share files from my Android app, so that it can be accessed by another computer using WiFi? Is there support for something like SMB? (Android version on phone is 1.6)Thanks.</p>","253029","","","","","2014-02-06 22:41:00","File sharing between Android phone and a PC","<android>","8","0","4","",""
"2084745","1","2085725","","2010-01-18 08:42:25","19","32478","<p>How can I install an application without any developer tools (Eclipse, Android SDK tools)?</p><p>I've compiled and created an .apk file. Now I am gonna send this apk file to my friend.</p><p>He is not an Android developer; he doesn't know how to use Eclipse or the SDK.And I don't want to publish my application to android market.</p><p>Is there a way to launch the application on a real device without publishing it or having access to a machine with the SDK?</p>","227889","","811","","2011-09-23 16:22:25","2014-01-31 10:21:43","How to install an Android application on a real device without publishing and Eclipse?","<android><deployment>","7","0","15","",""
"2085003","1","","","2010-01-18 09:33:13","16","29218","<p>Hey, I am currently working on a live wallpaper and I allow the user to select an image which will go behind my effects. </p><p>Currently I have:</p><pre><code>Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);            i.putExtra(""crop"", ""true"");            startActivityForResult(i, 1);</code></pre><p>And slightly under that:</p><pre><code>@Override    public void onActivityResult(int requestCode, int resultCode, Intent data) {      super.onActivityResult(requestCode, resultCode, data);      if (requestCode == 1)        if (resultCode == Activity.RESULT_OK) {          Uri selectedImage = data.getData();          Log.d(""IMAGE SEL"", """" + selectedImage);          // TODO Do something with the select image URI          SharedPreferences customSharedPreference = getSharedPreferences(""imagePref"", Activity.MODE_PRIVATE);          SharedPreferences.Editor editor = customSharedPreference.edit();          Log.d(""HO"", """" + selectedImage);          editor.putString(""imagePref"", getRealPathFromURI(selectedImage));          Log.d(""IMAGE SEL"", getRealPathFromURI(selectedImage));          editor.commit();        }     }</code></pre><p>When my code is ran, Logcat tells me that selectedImage is null. If I comment out the </p><pre><code>i.putExtra(""crop"", ""true""):</code></pre><p>Logcat does not give me the null pointer exception, and I am able to do what I want with the image. So, what is the problem here? Does any one have any idea how I can fix this? Thanks, for your time.</p>","","user253055","","","","2013-02-15 19:51:52","How to select and crop an image in android?","<java><android><image><android-intent><crop>","1","2","18","",""
"2085443","1","2085581","","2010-01-18 10:58:20","9","20148","<p>i am new to android and i have created a login page after verifing login </p><p>i get results true or false on the bases of user authentication now my goal is to show another screen on successful authentication with some new textboxes and button i mean new layout how to achieve this???</p><p>any help would be appriciated.</p>","249991","","2699","","2010-08-12 19:20:06","2011-11-12 07:37:37","how to Open new screen in Android?","<android><activity><screen><android-intent>","4","2","2","",""
"2085799","1","2086028","","2010-01-18 12:00:26","0","162","<pre><code>public class MYApplication extends Application {   String property;setter getter}</code></pre><p>does above code make sure property will not be collectied by android OS if not used for a long period of time.</p>","216431","","1288","","2013-07-06 14:01:13","2013-07-06 14:01:13","Android Application data should not be released by android OS","<android><android-application>","2","0","0","",""
"2086120","1","2090608","","2010-01-18 13:00:29","7","1817","<p>How do you stop the Android softkeyboard from displaying completed text in a TextView.  It is very important for my application that the spelling is not shown.  In 1.6 SDK I made the InputType = VisiblePassword and that seemed to stop it, however this does not appear to work in the 2.1 SDK.</p><p>thanks </p>","248521","","","","","2011-10-07 11:09:02","Stop the Android softkeyboard from word completion","<android>","2","2","1","",""
"2086137","1","2086155","","2010-01-18 13:02:33","0","2065","<p>i am trying to display google map on Android refering to this tutorial<a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a>when i go to google website to download addon it says addons are not available kindly guide what should i do to achieve this??</p>","249991","","","","","2010-01-18 14:48:52","Android Google Map Addon not available?","<android><eclipse>","1","0","","",""
"2086269","1","2086717","","2010-01-18 13:27:13","7","606","<p>As I do not have the money to buy all the Android phones, is there a resource somewhere or can somebody suggest the settings that would best emulate the Nexus, Motrola Droid and HTC Magic etc.  Some users are reporting problems with my app and I am thinking it may be due to the screen sizes.</p><p>thanks</p>","248521","","171461","","2010-01-18 13:30:28","2012-11-14 11:10:08","Creating Emulators for the current Android phones","<android><emulator>","2","0","5","",""
"2086325","1","2086541","","2010-01-18 13:37:14","1","1756","<p>I need your help. I'm really new to Android, developing in Eclipse with the latest 2.1 SDK.</p><p>This is really simple. I make a ListView which is filled with Checkbox widgets.</p><p>My code:</p><pre><code>public class HelloAndroid extends Activity {    static final String[] COUNTRIES = new String[] {        ""Afghanistan"", ""Albania"", ""Algeria"", ""American Samoa"", ""Andorra"",        ""Angola"", ""Anguilla"", ""Antarctica"", ""Antigua and Barbuda"", ""Argentina"",        ""Armenia"", ""Aruba"", ""Australia"", ""Austria"", ""Azerbaijan"",        ""Bahrain"", ""Bangladesh"", ""Barbados"", ""Belarus"", ""Belgium""};     protected ListView myList;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        myList = (ListView)findViewById(R.id.myList);        ArrayAdapter&lt;String&gt; myAdapter = new ArrayAdapter&lt;String&gt;(this, R.layout.row, R.id.myBox, COUNTRIES);         myList.setAdapter(myAdapter);    }}</code></pre><p>And this is the Layout-XML-file (row.xml), consisting of a single checkbox:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;CheckBox    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/myBox""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:textAppearance=""?android:attr/textAppearanceLarge""/&gt;</code></pre><p>Now if there are enough strings in the <code>COUNTRIES</code>-Array and you can scroll the List, you will see, that if you check one CheckBox and scroll down, some another CheckBox gets checked automatically. And if you check some more boxes, more get checked automatically, or ones that were checked get unchecked.</p><p>I've also tried <code>android:focusable=""false""</code> for the CheckBox (in the XML), as well as <code>android:focusableInTouchMode</code>, as described in some similar threads, but nothing seems to help...</p><p>Looks like its a bug??</p>","252647","","","","","2010-01-18 19:13:38","ListView filled with CheckBoxes -- they go mad","<java><android>","1","0","2","",""
"2086989","1","2087467","","2010-01-18 15:20:08","23","27080","<p>i'm creating custom title for activity by disabling standard one and managing everything myself. I wonder if it's possible to replace/theme standart title to my needs.</p><p>I can customize size, background image, and text via themes by changing windowXYZStyle items.</p><p>The only thing i couldn't find - how i can add image instead of text.I've tried <code>requestWindowFeature(Window.FEATURE_CUSTOM_TITLE)</code>and assign custom layout - but it doesn't seems to work. </p><p>EDIT : Here is a report of testing suggestions, code is below - result - image view is not showing up.</p><p>Activity</p><pre><code>public class SettingsActivity extends PreferenceActivity  {    @Override    protected void onCreate(Bundle savedInstanceState) {        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.settings);    }}XML :&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/title""    android:layout_width=""fill_parent""    android:layout_height=""26dip""    android:paddingLeft=""5dip""    android:background=""@drawable/titlebar_bg""    android:layout_gravity=""left|center""&gt;    &lt;ImageView        android:id=""@+id/logo""        android:src=""@drawable/title_logo""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre>","176761","","176761","","2010-01-20 15:07:27","2010-05-18 23:19:48","Custom title with image","<android><window><titlebar>","3","0","20","",""
"2087015","1","2138675","","2010-01-18 15:24:03","1","692","<p>Hello I have been using <a href=""http://libtomcrypt.com/download.html"" rel=""nofollow"">LibTomCrypt</a> to use SHA1 encryption ( for data integrity checking ) on mobile devices (iPhone OS and Android for the moment ). I was wondering if anyone is using anything else, things to consider are Portability ( C preferred but C++ is also an option ), and libraries size ( small == better for my particular needs ).</p><p>Thanks</p>","145077","","","","","2010-01-26 10:08:07","Best encryption library for mobile devices?","<c++><iphone><c><android><encryption>","3","0","1","",""
"2087164","1","2383760","","2010-01-18 15:42:19","3","2697","<p>I am new to JUnit and Android and good test documentation for working with Android is hard to find.</p><p>I have a test project with classes that extend ActivityInstrumentationTestCase2.  Simple tests to examine the state of the GUI (what's enabled, relative positions, etc) work as expected.  However when I attempt to perform button click actions, the wrong thread exception is thrown. Anyone know how to get around this issue?  </p><p>As a follow-on, does anybody have any good suggestions for free resources on test or TDD for Android?  I am using Eclipse/MotoDev.</p><p>Thanks</p><p>I can get different failure traces depending on how I invoke each button, but including one here for reference:</p><pre><code>android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.at android.view.ViewRoot.checkThread(ViewRoot.java:2683)at android.view.ViewRoot.playSoundEffect(ViewRoot.java:2472)at android.view.View.playSoundEffect(View.java:8307)at android.view.View.performClick(View.java:2363)at com.android.tigerslair.demo1.test.GoTest.setUp(GoTest.java:49)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)</code></pre><p>Here is the simple setup() routine:</p><pre><code>@Overrideprotected void setUp() throws Exception {    super.setUp();    TigersLair activity=getActivity();    mGoBtn = (Button) activity.findViewById(R.id.go);    mGoBtn.performClick();        }</code></pre><p>It doesn't matter if I perform the click in setUp() or the actual test.</p>","252631","","996493","","2012-04-30 09:32:33","2012-04-30 09:32:33","CalledFromWrongThreadException exercising JUnit tests on Android","<java><android><junit>","1","0","3","",""
"2087345","1","","","2010-01-18 16:05:00","5","7806","<p>I'm streaming an mp3 file using <code>MediaPlayer</code></p><pre><code>mp.setDataSource(myContext, Uri.parse(""http://my_song.mp3""));  mp.prepareAsync();  mp.setOnPreparedListener(mpOnPreparedListener);  mp.setOnBufferingUpdateListener(mpOnBufferingUpdateListener);  </code></pre><p>Any idea about how I can read the ID3 tags from this stream using android API or any alternative methods?</p>","227014","","94363","","2013-03-19 19:19:42","2013-03-19 19:19:42","Android - Reading ID3 tags from mp3 stream","<java><android><android-mediaplayer><id3>","3","0","4","",""
"2087475","1","","","2010-01-18 16:23:24","6","4007","<p>The code below works perfectly for real devices running on 1.5, 1.6and 2.0 as well as the emulator running on 2.1.</p><p>However, executing iton the Nexus One (running 2.1) raises an IOException:</p><pre><code>java.io.IOException: Unable to parse response from serverat android.location.Geocoder.getFromLocation(Geocoder.java:124)</code></pre><p>That's the code snippet where it happens: </p><pre><code>Double myLatitude = AppObject.myLocation.getLatitude();Double myLongitude = AppObject.myLocation.getLongitude();DEBUG.i(TAG, ""My location: "" + myLatitude + "" | "" + myLongitude);Geocoder geocoder = new Geocoder(MainActivity.this);java.util.List&lt;Address&gt; addressList;try {    addressList = geocoder.getFromLocation(myLatitude, myLongitude, 5);    if(addressList!=null &amp;&amp; addressList.size()&gt;0) {        currentAddress = new String();        DEBUG.i(TAG,addressList.get(0).toString());        currentAddress = addressList.get(0).getAddressLine(0) + "", ""        + addressList.get(0).getAddressLine(1) + "", ""        + addressList.get(0).getAddressLine(2);     }    return true;} catch (IOException e) {    e.printStackTrace();    return false;}</code></pre>","184367","","","","","2012-11-13 09:58:46","Android: Nexus One - Geocoder causes IOException - works perfectly with other devices and emulator","<android><geocoding><ioexception><nexus-one>","2","5","1","",""
"2088046","1","2088164","","2010-01-18 17:50:03","1","4824","<p>I need to be able to write textfiles to the root directory of my Android device (as <a href=""http://stackoverflow.com/questions/2079766/how-to-create-write-file-in-the-root-of-the-android-device"">this related questions explains</a>).</p><p>Can I change write permissions for root directory / and if so, how?</p><p>I tried pushing a file using adb, but it said file system was read-only =(</p><p>Its pretty annoying that I cannot control my own device, that everything is so restricted =(</p><hr><p>EDIT 1:This thread has evolved into discussing Sygic Navigation and their API, which seems to be wrong when it comes to the Android platform. I have some other questions that discuss Sygic and their navigation software.</p>","178143","","178143","","2010-01-18 21:07:31","2012-11-08 08:22:27","Can I change write access for root directory? Sygic Navigation and their API","<android><linux><file-io>","8","14","","",""
"2088080","1","","","2010-01-18 17:55:12","0","2315","<p>I'm creating an app for the Android platform which will connect with just one site using https. It is essential that it won't be able to connect to any other sites, even with valid SSL certificates. I want it to be resistant to every form redirection (for example to site pretending to be the one I need to connect with) or other ""<strong>attacks</strong>"". Unfortunately I cannot find any good tutorial about SSL in Android... Do you know any? I'd be grateful for some links or advices. Or maybe could you give me some code snippets? My app is prepared to use HttpURLConnection or HttpClient - it makes no difference which path will I choose.</p><p>Thank you in advance :)</p>","253399","","750613","","2012-07-12 06:35:29","2014-03-12 15:17:10","HTTPS connection to exactly one site (Android)","<android><ssl>","5","0","","",""
"2088863","1","","","2010-01-18 20:09:17","3","12435","<p>Im looking for navigation software for the Android platform and I have a few requirements:</p><ul><li><p>Offline maps. The maps should be stored on the device/memory card so no Internet-connection is required</p></li><li><p>There should be some way to interact with the application ""through code""; sending route requests, getting current location perhaps, bringing app to foreground/background, etc. An API  so it can be controlled from another application.</p></li><li><p>No monthly fees</p></li></ul><p>The only one I found so far to match the above is <a href=""http://www.sygic.com"" rel=""nofollow"">Sygic Navigation</a>. However, I havent yet been able to communication with the app even though they say that it can be done. Still investigating that...</p>","178143","","","","","2013-04-26 19:55:43","Offline navigation software for Android - what is out there?","<android><navigation>","4","0","","",""
"2088973","1","2089025","","2010-01-18 20:29:34","0","612","<p>I am trying to find a way to listen to a built-in Camera application Capture event.I want my application to be triggered each time a picture is taken.</p><p>Is it possible?</p><p>I read <a href=""http://stackoverflow.com/questions/2019391/prevent-camera-capture-on-android-handet"">here</a></p><p>that it is impossible...</p><p>If it is impossible then, maybe, there is another way to achieve it?For example receive a new file event and check if the file is picture...</p>","246119","","","","","2010-01-18 20:36:25","How to catch an image capture event on Android?","<android><events><image-capture>","1","0","","",""
"2089111","1","2504882","","2010-01-18 20:48:10","5","4824","<p>How do i create a drop shadow to add it to a custom drawable i made using shape?</p>","117691","","","","","2011-08-25 02:25:47","Drop shadow for Drawable","<android>","2","0","1","",""
"2089196","1","","","2010-01-18 21:03:25","0","366","<p>i am trying to run an application on an android emulator, but it crashes. i am following a <a href=""http://android-er.blogspot.com/2009/11/read-gps-location-locationmanager.html"" rel=""nofollow"">howto</a></p><p>i don't know what to do, it just crashes. other applications are running fine, can anyone tell me what i am doing wrong.here is the code:</p><pre><code>public class Finder extends Activity {    /** Called when the activity is first created. */ private LocationManager myLocationManager; private LocationListener myLocationListener; private TextView myLatitude, myLongitude;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    myLatitude = (TextView)findViewById(R.id.Latitude);    myLongitude = (TextView)findViewById(R.id.Longitude);    myLocationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);    myLocationListener = new MyLocationListener();    myLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,myLocationListener);    myLatitude.setText(String.valueOf(        myLocationManager.getLastKnownLocation(          LocationManager.GPS_PROVIDER).getLatitude()));      myLongitude.setText(String.valueOf(       myLocationManager.getLastKnownLocation(         LocationManager.GPS_PROVIDER).getLongitude()));}private class MyLocationListener implements LocationListener{ public void onLocationChanged(Location argLocation) { // TODO Auto-generated method stub myLatitude.setText(String.valueOf(   argLocation.getLatitude())); myLongitude.setText(String.valueOf(   argLocation.getLongitude())); } public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } public void onStatusChanged(String provider,  int status, Bundle extras) { // TODO Auto-generated method stub } };</code></pre><p>}</p><p>i looked in the logcat after running the application, it seems that the following lines are cause of the problem but i don't understand it:(</p><pre><code>01-18 22:12:46.017: WARN/dalvikvm(1091): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)01-18 22:12:46.017: ERROR/AndroidRuntime(1091): Uncaught handler: thread main exiting due to uncaught exception01-18 22:12:46.037: ERROR/AndroidRuntime(1091): java.lang.RuntimeException: Unable to start activity ComponentInfo{pro.googleLocation/pro.googleLocation.Finder}: java.lang.NullPointerException01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at android.os.Handler.dispatchMessage(Handler.java:99)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at android.os.Looper.loop(Looper.java:123)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at android.app.ActivityThread.main(ActivityThread.java:4203)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at java.lang.reflect.Method.invokeNative(Native Method)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at java.lang.reflect.Method.invoke(Method.java:521)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at dalvik.system.NativeStart.main(Native Method)01-18 22:12:46.037: ERROR/AndroidRuntime(1091): Caused by: java.lang.NullPointerException01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at pro.googleLocation.Finder.onCreate(Finder.java:28)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)01-18 22:12:46.037: ERROR/AndroidRuntime(1091):     ... 11 more</code></pre>","249398","","69802","","2011-05-28 22:32:28","2011-05-28 22:32:28","Android Application Crashes","<android><android-emulator>","2","4","","",""
"2089489","1","","","2010-01-18 21:51:21","13","9682","<p>I'm in the process of working on an automated test suite for our android app, and running into trouble waiting for activities to fully load.  I can call getActivity, but just because it shows the activity that I'm hoping to see in my test doesn't always seem to mean that the activity's components are ready for use (fully loaded).  Looking through the Activity API didn't turn anything up, and other methods seem too invasive and have spoiled the tests initial state.  Does anyone know if there's a way to ask the app or the VM if the current activity is loaded?</p>","234894","","","","","2010-01-18 23:34:54","how can you tell when an Android activity is finished loading?","<android><view><activity><loaded>","3","0","5","",""
"2089552","1","3818124","","2010-01-18 22:01:46","37","23123","<p>I am using the onScroll method of GestureDetector.SimpleOnGestureListener to scroll a large bitmap on a canvas. When the scroll has ended I want to redraw the bitmap in case the user wants to scroll further ... off the edge of the bitmap, but I can't see how to detect when the scroll has ended (the user has lifted his finger from the screen).</p><p>e2.getAction() always seems to return the value 2 so that is no help.e2.getPressure seems to return fairly constant values (around 0.25) until the final onScroll call when the pressure seems to fall to about 0.13. I suppose I could detect this reduction in pressure, but this will be far from foolproof.</p><p>There must be a better way: can anyone help, please?</p>","250845","","881229","","2013-12-07 20:34:28","2013-12-07 20:34:28","Android: How to detect when a scroll has ended","<android><android-canvas><smooth-scrolling>","11","4","25","",""
"2089893","1","2090039","","2010-01-18 23:10:29","4","745","<p>I'd like to hack on my new Android phone using a Linux development environment.</p><p>What tools would you recommend?</p>","164171","","59087","","2010-01-18 23:13:12","2013-02-06 12:22:21","Android development tools","<android><linux>","5","0","1","2012-04-30 12:31:03",""
"2089944","1","2114812","","2010-01-18 23:20:53","1","5038","<p>I'm making some changes to the provisioning app that ships with the Android Eclair source code. I'd like a way to launch the app to test it that doesn't involve reflashing my device or restarting my emulator. The app is located in packages/apps/Provision and the main Activity is src/com/android/provision/DefaultActivity.java. I've tried:</p><pre><code>adb shell am start -a android.intent.action.MAIN -n com.android.provision/.DefaultActivityadb shell am start -n com.android.provision/com.android.provision.DefaultActivity</code></pre><p>Both of which return:</p><pre><code>Starting: Intent { act=android.intent.action.MAIN cmp=com.android.provision/.DefaultActivity }Error type 3Error: Activity class {com.android.provision/com.android.provision.DefaultActivity} does not exist.</code></pre>","9574","","","","","2014-03-17 20:58:12","How to launch provisioning app on Android","<android>","2","0","1","",""
"2090152","1","2090192","","2010-01-19 00:11:57","0","989","<p>My View doesn't use an XML layout, I just reference a View subclass defined in the Action class. The app consists of an empty canvas that the user can create/interact with various 2D objects. That's the easy part, but I want an onscreen widget to appear on the right side of the screen that allows the user to select various objects to create. Because there can be several objects the widget will just display the two or three most recently used objects, and expand to present all possible objects when an expansion button is clicked.</p><p>Due to the highly specific nature of this widget I was thinking I needed to write my own custom widget, but was unsure how I could integrate this into my existing view. Is it possible to display a small widget inline in this manner?</p><p>The other option I am considering is using Drawable to create this widget on the Canvas, detecting mouseclicks, and handling the action that way. Doesn't sound like that is the right way to do it within the Android architecture, however.</p>","253575","","","","","2010-01-19 00:20:17","Android Layouts- Mixing dynamic with static elements","<java><android><layout><widget>","1","0","","",""
"2090632","1","2091401","","2010-01-19 02:16:01","1","2606","<p>I'm using Android 2.1 SDK on MacOS 10.6.2.</p><p>When I try to run the standard Notepad app in the emulator, I get the expected messages from Eclipse</p><pre><code>[2010-01-18 17:42:24 - NotesList]New emulator found: emulator-5554[2010-01-18 17:42:24 - NotesList]Waiting for HOME ('android.process.acore') to be launched...[2010-01-18 17:42:26 - Emulator]2010-01-18 17:42:26.567 emulator[96730:903] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.[2010-01-18 17:43:31 - NotesList]HOME is up on device 'emulator-5554'[2010-01-18 17:43:31 - NotesList]Uploading NotesList.apk onto device 'emulator-5554'[2010-01-18 17:43:32 - NotesList]Installing NotesList.apk...[2010-01-18 17:43:55 - NotesList]Success![2010-01-18 17:43:55 - NotesList]Starting activity com.example.android.notepad.NotesList on device [2010-01-18 17:44:06 - NotesList]ActivityManager: Starting: Intent { cmp=com.example.android.notepad/.NotesList }</code></pre><p>Then it starts to go wrong.   A dialog flashes on to the screen too fast for me to read it.</p><p>Then notepad starts (I have to ""unlock"" the screen manually by dragging the lock tag)</p><p>Then there is a ""Force close or wait"" dialog that announces ""<em>Application Android keyboard (in process com.android.inputmethod.latin) is not responding.</em>""</p><p>The app won't do anything further at this point.  I have not made any changes to the app.</p><p>Has anyone else seen this error ?</p><p>Does anyone have advice on how to avoid it ?</p>","253661","","996493","","2012-04-30 09:26:32","2012-04-30 09:26:32","""Keyboard not responding"" in emulator?","<android><keyboard><android-emulator><notepad>","1","0","","",""
"2090765","1","2212400","","2010-01-19 03:00:50","13","11981","<p>I've found plenty of examples how to do encryption in C#, and a couple for Android, but I'm particularly looking for a way to handle encrypting (using something like AES, TripleDES, etc.) from Android, and eventually wind up being decrypted in C#. I found an <a href=""http://www.androidsnippets.org/snippets/39/"">example for encoding AES</a> in Android and <a href=""http://stackoverflow.com/questions/273452/c-implementations-of-aes-encryption"">encoding/decoding AES</a> in C# but am not sure if these are compatible (C# requires an IV, nothing is specified for this in the Android example). Also, a recommendation on a good way of encoding the encrypted string for transmission over HTTP (Base64?) would be helpful. Thanks.</p>","151495","","","","","2012-06-07 21:53:37","Encryption compatable between Android and C#","<c#><java><.net><android><encryption>","4","0","8","",""
"2091127","1","","","2010-01-19 04:44:13","6","26370","<p>I followed some tutorials to create an application that shows the current position of the user on the map with a marking. But for some reasons I can't get to work the marking part? The other parts work well, but whenever I add the marking code the application crashes.<br>Here is the code:</p><pre><code>public class LocationActivity extends MapActivity {    private MapView mapView;    private LocationManager lm;    private LocationListener ll;    private MapController mc;    GeoPoint p = null;    Drawable defaultMarker = null;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mapView = (MapView) findViewById(R.id.mapView);        // show zoom in/out buttons        mapView.setBuiltInZoomControls(true);        // Standard view of the map(map/sat)        mapView.setSatellite(false);        // get controller of the map for zooming in/out        mc = mapView.getController();        // Zoom Level        mc.setZoom(18);        MyLocationOverlay myLocationOverlay = new MyLocationOverlay();        List&lt;Overlay&gt; list = mapView.getOverlays();        list.add(myLocationOverlay);        lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);        ll = new MyLocationListener();        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, ll);        // Get the current location in start-up        GeoPoint initGeoPoint = new GeoPoint((int) (lm.getLastKnownLocation(                LocationManager.GPS_PROVIDER).getLatitude() * 1000000),                (int) (lm.getLastKnownLocation(LocationManager.GPS_PROVIDER)                        .getLongitude() * 1000000));        mc.animateTo(initGeoPoint);    }    protected class MyLocationOverlay extends com.google.android.maps.Overlay {        @Override        public boolean draw(Canvas canvas, MapView mapView, boolean shadow,                long when) {            Paint paint = new Paint();            super.draw(canvas, mapView, shadow);            // Converts lat/lng-Point to OUR coordinates on the screen.            Point myScreenCoords = new Point();            mapView.getProjection().toPixels(p, myScreenCoords);            paint.setStrokeWidth(1);            paint.setARGB(255, 255, 255, 255);            paint.setStyle(Paint.Style.STROKE);            Bitmap bmp = BitmapFactory.decodeResource(getResources(),                    R.drawable.push);            canvas.drawBitmap(bmp, myScreenCoords.x, myScreenCoords.y, paint);            canvas.drawText(""I am here..."", myScreenCoords.x, myScreenCoords.y,                    paint);            return true;        }    }    private class MyLocationListener implements LocationListener {        public void onLocationChanged(Location argLocation) {            GeoPoint myGeoPoint = new GeoPoint(                    (int) (argLocation.getLatitude() * 1000000),                    (int) (argLocation.getLongitude() * 1000000));            /*             * it will show a message on location change             * Toast.makeText(getBaseContext(), ""New location latitude [""             * +argLocation.getLatitude() + ""] longitude ["" +             * argLocation.getLongitude()+""]"", Toast.LENGTH_SHORT).show();             */            mc.animateTo(myGeoPoint);        }        public void onProviderDisabled(String provider) {}        public void onProviderEnabled(String provider) {}        public void onStatusChanged(String provider, int status, Bundle extras) {}    }    protected boolean isRouteDisplayed() {        return false;    }}</code></pre><p>here is the logcat:</p><pre><code>    01-19 05:31:43.011: DEBUG/AndroidRuntime(759): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;01-19 05:31:43.011: DEBUG/AndroidRuntime(759): CheckJNI is ON01-19 05:31:43.411: DEBUG/AndroidRuntime(759): --- registering native functions ---01-19 05:31:43.431: INFO/jdwp(759): received file descriptor 19 from ADB01-19 05:31:43.431: INFO/jdwp(759): Ignoring second debugger -- accepting and dropping01-19 05:31:44.531: INFO/ActivityManager(583): Starting activity: Intent { flg=0x10000000 cmp=pro.googlemapp/.LocationActivity }01-19 05:31:44.641: DEBUG/AndroidRuntime(759): Shutting down VM01-19 05:31:44.641: DEBUG/dalvikvm(759): DestroyJavaVM waiting for non-daemon threads to exit01-19 05:31:44.641: DEBUG/dalvikvm(759): DestroyJavaVM shutting VM down01-19 05:31:44.641: DEBUG/dalvikvm(759): HeapWorker thread shutting down01-19 05:31:44.651: DEBUG/dalvikvm(759): HeapWorker thread has shut down01-19 05:31:44.651: DEBUG/jdwp(759): JDWP shutting down net...01-19 05:31:44.651: DEBUG/jdwp(759): +++ peer disconnected01-19 05:31:44.651: INFO/dalvikvm(759): Debugger has detached; object registry had 1 entries01-19 05:31:44.661: DEBUG/dalvikvm(759): VM cleaning up01-19 05:31:44.681: INFO/ActivityManager(583): Start proc pro.googlemapp for activity pro.googlemapp/.LocationActivity: pid=770 uid=10025 gids={3003}01-19 05:31:44.761: DEBUG/dalvikvm(759): LinearAlloc 0x0 used 676436 of 4194304 (16%)01-19 05:31:44.801: INFO/jdwp(770): received file descriptor 20 from ADB01-19 05:31:44.822: INFO/dalvikvm(770): ignoring registerObject request in thread=301-19 05:31:44.851: INFO/jdwp(770): Ignoring second debugger -- accepting and dropping01-19 05:31:44.851: ERROR/jdwp(770): Failed writing handshake bytes: Broken pipe (-1 of 14)01-19 05:31:44.851: INFO/dalvikvm(770): Debugger has detached; object registry had 0 entries01-19 05:31:45.320: ERROR/ActivityThread(770): Failed to find provider info for com.google.settings01-19 05:31:45.320: ERROR/ActivityThread(770): Failed to find provider info for com.google.settings01-19 05:31:45.340: ERROR/ActivityThread(770): Failed to find provider info for com.google.settings01-19 05:31:45.781: DEBUG/LocationManager(770): Constructor: service = android.location.ILocationManager$Stub$Proxy@4379d9f001-19 05:31:45.791: WARN/GpsLocationProvider(583): Duplicate add listener for uid 1002501-19 05:31:45.791: DEBUG/GpsLocationProvider(583): setMinTime 001-19 05:31:45.791: DEBUG/GpsLocationProvider(583): startNavigating01-19 05:31:45.831: INFO/jdwp(770): received file descriptor 27 from ADB01-19 05:31:46.001: INFO/MapActivity(770): Handling network change notification:CONNECTED01-19 05:31:46.001: ERROR/MapActivity(770): Couldn't get connection factory client01-19 05:31:46.451: DEBUG/dalvikvm(770): GC freed 4539 objects / 298952 bytes in 118ms01-19 05:31:46.470: DEBUG/AndroidRuntime(770): Shutting down VM01-19 05:31:46.470: WARN/dalvikvm(770): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)01-19 05:31:46.481: ERROR/AndroidRuntime(770): Uncaught handler: thread main exiting due to uncaught exception01-19 05:31:46.541: ERROR/AndroidRuntime(770): java.lang.NullPointerException01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at com.google.android.maps.PixelConverter.toPixels(PixelConverter.java:58)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at com.google.android.maps.PixelConverter.toPixels(PixelConverter.java:48)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at pro.googlemapp.LocationActivity$MyLocationOverlay.draw(LocationActivity.java:101)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:42)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at com.google.android.maps.MapView.onDraw(MapView.java:476)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.View.draw(View.java:6274)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.ViewGroup.drawChild(ViewGroup.java:1526)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.ViewGroup.drawChild(ViewGroup.java:1524)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.View.draw(View.java:6277)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.widget.FrameLayout.draw(FrameLayout.java:352)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.ViewGroup.drawChild(ViewGroup.java:1526)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.ViewGroup.drawChild(ViewGroup.java:1524)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.View.draw(View.java:6277)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.widget.FrameLayout.draw(FrameLayout.java:352)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1883)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.ViewRoot.draw(ViewRoot.java:1332)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1097)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.os.Handler.dispatchMessage(Handler.java:99)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.os.Looper.loop(Looper.java:123)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at android.app.ActivityThread.main(ActivityThread.java:4203)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at java.lang.reflect.Method.invokeNative(Native Method)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at java.lang.reflect.Method.invoke(Method.java:521)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)01-19 05:31:46.541: ERROR/AndroidRuntime(770):     at dalvik.system.NativeStart.main(Native Method)01-19 05:31:46.551: INFO/Process(583): Sending signal. PID: 770 SIG: 301-19 05:31:46.581: INFO/dalvikvm(770): threadid=7: reacting to signal 301-19 05:31:46.661: INFO/dalvikvm(770): Wrote stack trace to '/data/anr/traces.txt'01-19 05:31:46.871: INFO/ARMAssembler(583): generated scanline__00000077:03515104_00000000_00000000 [ 27 ipp] (41 ins) at [0x2c69c8:0x2c6a6c] in 973448 ns01-19 05:31:46.911: INFO/ARMAssembler(583): generated scanline__00000077:03515104_00001001_00000000 [ 64 ipp] (84 ins) at [0x2c6a70:0x2c6bc0] in 1985378 ns01-19 05:31:49.881: INFO/Process(770): Sending signal. PID: 770 SIG: 901-19 05:31:49.931: INFO/ActivityManager(583): Process pro.googlemapp (pid 770) has died.01-19 05:31:49.941: WARN/GpsLocationProvider(583): Unneeded remove listener for uid 100001-19 05:31:49.941: DEBUG/GpsLocationProvider(583): stopNavigating01-19 05:31:49.951: INFO/WindowManager(583): WIN DEATH: Window{438891c0 pro.googlemapp/pro.googlemapp.LocationActivity paused=false}01-19 05:31:50.111: WARN/UsageStats(583): Unexpected resume of com.android.launcher while already resumed in pro.googlemapp01-19 05:31:50.200: WARN/InputManagerService(583): Got RemoteException sending setActive(false) notification to pid 770 uid 10025</code></pre>","249398","","281545","","2013-05-11 17:56:26","2013-05-11 17:56:26","Marking Current Location on Map, Android","<android><overlay><android-emulator>","5","1","6","",""
"2091222","1","2091376","","2010-01-19 05:11:02","1","596","<p>Is there any way to open the menu option via the code, sort of auto trigger on a particular action. </p>","237403","","","","","2010-01-19 05:44:02","Open options meny via code","<android>","1","0","","",""
"2091455","1","","","2010-01-19 06:03:34","0","1380","<p>Android:how do i retrieve the contact photo,name,number from the address book and display it using a list view </p>","253758","","","","","2010-01-19 06:56:01","Android:how do i retrieve the contact photo,name,number from the address book and display it using a list view","<android>","1","0","","",""
"2091465","1","2091482","","2010-01-19 06:06:36","214","176447","<p>I have a scenario where after logging in through a login page, there will be sign out button on each activity.</p><p>On clicking signout, I will be passing the session id of the signed in user to signout.Can anyone guide me on how to keep session id available to all activities??</p><p>Alternatively, are there any other solutions to this problem?</p>","249991","","675502","","2011-08-18 23:03:22","2014-02-06 12:23:40","How do I pass data between activities in Android?","<android>","16","2","89","",""
"2091474","1","","","2010-01-19 06:09:55","5","7097","<p>i am a beginner to android development...i was trying to get the sources for the 1.6 release... but the reposync operation keeps hanging...i am pasting the last part of the message i get on the terminal here:</p><pre><code>Fetching projects:  19% (32/164)Initializing project platform/external/freetype ...remote: Counting objects: 970, done.remote: Compressing objects: 100% (414/414), done.Receiving objects:  57% (558/970), 1.28 MiB | 26 KiB/s</code></pre><p>it just hangs there... no error messages or aything of that sort...has anyone faced a similar issue.. i would appreciate if anyone couldhelp me out.</p>","253761","","62525","","2010-01-19 06:14:15","2011-04-19 10:50:17","repo sync problem","<android><git><sync><repository><sources>","3","1","1","",""
"2091509","1","","","2010-01-19 06:17:56","3","1192","<p>Android source code contains code for calendar application perhaps it not seen in the emulator.</p><ol><li>what is the work around to be done to view the calendar application.</li></ol><p>I went through the source code, core.mk file doesn have a tag for calendar as well as calendar provider.</p><ol><li>What can i do so as to include calendar application in my sdk.Any other steps need to be taken take?</li></ol><p>Answers would be appreciated . Thanks in advance.</p>","142521","","525478","","2012-09-21 14:54:45","2012-09-21 14:54:45","Android calendar application not seen in the emulator.","<android><android-emulator>","2","0","1","",""
"2091762","1","2091965","","2010-01-19 07:18:44","1","1140","<p>I was trying to download and parse a webpage with foreign (Chinese) characters. I'm not sure whether I should use ""utf-8"" or something else. But none of these seems to work for me.  I used the sample Wikitionary code for <code>getUrlContent()</code>.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mText = (TextView) findViewById(R.id.textview1);    huaren.prepareUserAgent(this);    String test = new String(""fail"");    try {        test = getUrlContent(""http://huaren.us/"");    } catch (ApiException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    byte[] b = new byte[100000];    try {          b = test.getBytes(""utf-8"");    } catch (UnsupportedEncodingException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    char[] charArr = (new String(b)).toCharArray();    CharSequence seq = java.nio.CharBuffer.wrap(charArr);     mText.setText(charArr, 0, 1000);//.setText(seq);}protected static synchronized String getUrlContent(String url) throws ApiException {    if (sUserAgent == null) {        throw new ApiException(""User-Agent string must be prepared"");    }    // Create client and set our specific user-agent string    HttpClient client = new DefaultHttpClient();    HttpGet request = new HttpGet(url);    request.setHeader(""User-Agent"", sUserAgent);    try {        HttpResponse response = client.execute(request);        // Check if server response is valid        StatusLine status = response.getStatusLine();        if (status.getStatusCode() != HTTP_STATUS_OK) {            throw new ApiException(""Invalid response from server: "" +                    status.toString());        }        // Pull content stream from response        HttpEntity entity = response.getEntity();        InputStream inputStream = entity.getContent();        ByteArrayOutputStream content = new ByteArrayOutputStream();        // Read response into a buffered stream        int readBytes = 0;        while ((readBytes = inputStream.read(sBuffer)) != -1) {            content.write(sBuffer, 0, readBytes);        }        // Return result from buffered stream        return new String(content.toByteArray(), ""utf-8"");    } catch (IOException e) {        throw new ApiException(""Problem communicating with API"", e);    }}</code></pre>","253800","","1079354","","2012-05-04 16:27:00","2012-05-04 16:27:00","Foreign Characters in android & Java","<java><android><utf-8><cjk>","2","0","1","",""
"2091897","1","2092629","","2010-01-19 07:47:37","1","2264","<p>i am trying to run google map tutorial using following link<a href=""http://mobiforge.com/developing/story/using-google-maps-android"" rel=""nofollow"">http://mobiforge.com/developing/story/using-google-maps-android</a></p><p>followed all steps but when i try to run this application it does not display anything except boxes and zooming button</p><p>can any one guide is there any thing i am missing?? i have obtained new google map key from google website too.</p>","249991","","","","","2010-08-06 20:33:30","Google Map does not display in Android?","<android><eclipse>","2","1","1","",""
"2092028","1","2093545","","2010-01-19 08:16:10","0","1466","<p>I need to establish communication between two android phones (same application, if it matters).</p><p>Is there any possibility for android applications to establish a data stream via bluetooth (so there is no need for internet connection)?</p><p>Or (UDP)TCP/IP over internet is currently best solution?</p>","35425","","109749","","2011-01-10 18:07:18","2011-01-10 18:07:18","Options for application communication between two android phones","<android><connection>","2","0","","",""
"2092061","1","2092603","","2010-01-19 08:21:28","0","2992","<p>keytool -list -alias alias_name -keystore my-release-key.keystore</p><p>using above command when i try to create md5 fingerprintit asks for the password and in password i cannot type any thing.</p><p>can any one guide me how can i create this i need this finger print to run google map api in android and to obtain googlemap api key from google website..</p><p>any help would be appriciated..</p>","249991","","","","","2012-01-26 09:50:23","cannot Create MD5 FingerPrint?","<android><google-api>","2","0","","",""
"2092098","1","7072899","","2010-01-19 08:29:51","87","12448","<p>I know about camel case rules, but I'm confused with this m rule. What does it stand for? I'm a php developer, ""we"" use first letters of variables as indication of type, like 'b' for boolean, 'i' for integer and so on.</p><p>Is 'm' a java thing? Does it stand for mobile? mixed? ;)</p>","220065","","1228","","2013-08-16 17:17:54","2013-08-16 17:17:54","Why most of android tutorial's variables start with m?","<android>","5","6","24","",""
"2092190","1","2093383","","2010-01-19 08:46:36","8","2661","<p>I am wondering if which of the two is better in loading images in a listview from web, is it by batch through some number of threads that are running simultaneously or one by one through thread queue?</p><p>I have noticed (but I don't know if that is really the implementation) from the youtube app that the images are loaded by batch and it is kinda fast. Even for not only loading images but also requesting some data from the web as well. Does anyone have an idea?</p>","235885","","","","","2012-04-10 06:43:03","Which is better loading of images for ListView?","<android>","4","0","5","",""
"2092470","1","2092674","","2010-01-19 09:38:12","2","1436","<p>On Android, I'm having a problem trying to figure out which ringtone is actually playing (I'm not trying to detect the default ringtone, but the one actually playing as it may be different due to user setting a particular ringtone for a particular contact).</p><p>I'm using the Ringtone.isPlaying() function as I cycle through (successfully) all the available Ringtones from the RingtoneManager. However none of them ever returns true to Ringtone.isPlaying()! Anyone have a clue what I am doing wrong? Here is the code sample that is definitely being run whilst the ring is playing:</p><pre><code>RingtoneManager rm = new RingtoneManager(this); // 'this' is my activity (actually a Service in my case)if (rm != null){    Cursor cursor = rm.getCursor();    cursor.moveToFirst();     for (int i = 0; ; i++)     {            Ringtone ringtone = rm.getRingtone(i);  // get the ring tone at this position in the Cursor            if (ringtone == null)            break;        else if (ringtone.isPlaying() == true)                return (ringtone.getTitle(this));   // *should* return title of the playing ringtone    }    return ""FAILED AGAIN!""; // always ends up here}</code></pre>","253868","","","","","2010-01-19 10:29:47","Android detect which ringtone is actually playing (Ringtone.isPlaying problem)","<android><ringtone>","1","0","1","",""
"2092745","1","2176077","","2010-01-19 10:28:28","0","1904","<p>i am looking to put search on google map in android application can any one guide me how to achive this???</p><p>and want to display some text along with that perticular search location.</p><p>any help would be appriciated.</p>","249991","","","","","2010-02-01 10:50:47","how to put Search on Google map in Android?","<android><eclipse>","1","1","2","","2010-01-19 10:28:28"
"2092951","1","5036668","","2010-01-19 11:07:15","94","200649","<p>I want to close my application, so that it no longer runs in the background.</p><p>How to do that? Is this good practice on Android platform?</p><p>If I rely on the ""back"" button, it closes the app, but it stays in background. There is even application called ""TaskKiller"" just to kill those apps in the background.</p>","232798","","","","","2013-11-01 12:33:37","How to close Android application?","<android>","12","1","83","",""
"2093164","1","","","2010-01-19 11:46:15","1","2001","<p>I'm wondering if is possible to install/use Android with other phones? Will be nice to have it on such a piece of hardware like the new SH004.</p>","253959","","597607","","2011-08-27 16:09:07","2011-08-27 16:59:04","Is possible to Install Android in other phone? Like the SH004 or other OEM Phones","<android><mobile><phone>","2","0","","",""
"2093197","1","2093239","","2010-01-19 11:52:48","3","1740","<p>Is there any way to redirect cell phone output to a standard screen?</p><p>Would it be possible on Linux &amp; X-server based devices - like Maemo? And on Android devices?</p>","206743","","","","","2010-01-19 12:14:47","Redirecting screen output from cell phone to monitor screen","<android><redirect><screen><cellphone><maemo>","2","0","1","",""
"2093439","1","2093568","","2010-01-19 12:35:12","1","896","<p>When I try to add a strServerIP to the class Server, I get a:<br>Cannot resolve symbol string<br>compiler error. </p><p>Why?</p><pre><code>package com.example;public class Server{    //public static java.lang.string SERVERIP;    public static android.R.string SERVERIP;    public static java.lang.string strServerIP = ""monster.idsoftware.com"";    public static string strServerIP = ""monster.idsoftware.com"";    public static int SERVERPORT = 27950;    public static int PROTOCOL = 68;}</code></pre>","155077","","5731","","2010-01-19 12:38:09","2010-01-19 13:32:44","Android compiler: Cannot resolve symbol string","<java><android><sockets><udp><intellij-idea>","2","2","","",""
"2093594","1","","","2010-01-19 13:05:13","45","19789","<p>I'm in the process of writing an OpenGL ES powered framework for my next Android game(s). Currently I'm supporting three different techniques of drawing sprites:  </p><ul><li>the basic way: using <strong>vertex arrays</strong> (slow)</li><li>using <strong>vertex-buffer-objects</strong> (VBOs) (faster)</li><li>using the <strong>draw_texture</strong> extension (fastest, but only for basic sprites, i.e. no transforming)</li></ul><p>Vertex arrays are supported in OpenGL ES 1.0 and thus in every Android-device. I'm guessing most (if not all) of the current devices also support VBOs and draw_texture.</p><p>Instead of guessing, I'd like to know the extensions supported by different devices. If majority of devices support VBOs, I could simplify my code and focus only on VBOs + draw_texture.</p><p>It'd be helpful to know what different devices support, so if you have an Android-device, do report the extensions list please. :)</p><pre><code>String extensions = gl.glGetString(GL10.GL_EXTENSIONS);</code></pre><p>I've got a <strong>HTC Hero</strong>, so I can share those extensions next.</p>","114759","","","","","2012-02-14 12:31:08","OpenGL extensions available on different Android devices","<java><android><opengl-es>","23","5","37","2012-03-07 17:51:53",""
"2093779","1","2094014","","2010-01-19 13:30:35","1","1383","<p>can any one guide me how to add some  menu related buttons at the bottom of each activity?</p>","249991","","","","","2010-01-19 14:32:25","how to add image buttons in each Android activity?","<android><eclipse>","1","1","","","2010-01-19 13:30:35"
"2093974","1","2094192","","2010-01-19 14:04:40","1","372","<p>I would like to block either:</p><ol><li>The entire cellphone carrier Sprint</li><li>The specific phones Sprint Hero and Sprint Moment</li></ol><p>Is there a way to do this in the manifest file or any other code related means?</p><p>I want to block the Sprint Hero for the widget bug and the Moment for handling contacts incorrectly. A huge fail on the part of Sprint.</p>","242904","","242904","","2010-01-19 14:19:20","2010-01-19 14:40:20","Manifest code to block specific carrier?","<android>","1","0","1","",""
"2094198","1","2099133","","2010-01-19 14:41:03","0","220","<p>When I execute the following code: </p><pre><code>Preferences.userRoot().nodeExists(strNodeName);</code></pre><p>I get an exception :</p><pre><code>java.util.prefs.BackingStoreException: Cannot get children names for User Preference Node: /!</code></pre><p>Any idea ?</p>","164460","","164460","","2010-01-19 14:49:31","2011-02-22 14:09:05","Android preferences exception","<android><exception><preferences>","1","0","","",""
"2094360","1","2094942","","2010-01-19 15:00:51","0","580","<p>I'm investigating the possibility to develop Flash or FlashLite apps that runs on Android as stand-alone apps, but I'm not finding anywhere a clear, definitive and up-to-date answer. Questions:</p><ul><li><p>The HTC Hero supports Flash out-of-the-box (without installing it), right?...it's written everywhere, but which version? Flash 9? Flash 10? Flash Lite?</p></li><li><p>Does the Google Nexus One supports Flash, out-of the box? Must it be installed separately? </p></li><li><p>Can I develop Flash OR Flash Lite stand-alone apps for Android? What devices will they run on, today? (including Nexus One?)</p></li><li><p>If ""yes"" to the previous version...is there any integration with the device capabilities? (camera, gps, access to contacts, accelerometer etc.)</p></li></ul><p>I think a definitive answer to these questions will be useful to many out there!</p><p>The only programming example I found is this (http://www.flashmobileblog.com/2009/08/12/flash-development-with-android-sdk-1-5/) and it doesn't help much to understand what I can actually do with it...</p>","39680","","","","","2010-01-19 16:15:10","Flash or FlashLite development for Android?","<android><flash><flashlite>","1","1","","",""
"2094529","1","2468340","","2010-01-19 15:23:46","7","10431","<p>I have the following code that reads the content of a url</p><pre><code>public static String DownloadText(String url){    StringBuffer result = new StringBuffer();    try{        URL jsonUrl = new URL(url);        InputStreamReader isr  = new InputStreamReader(jsonUrl.openStream());        BufferedReader in = new BufferedReader(isr);        String inputLine;        while ((inputLine = in.readLine()) != null){            result.append(inputLine);        }    }catch(Exception ex){        result = new StringBuffer(""TIMEOUT"");        Log.e(Util.AppName, ex.toString());    }        in.close();        isr.close();    return result.toString();}</code></pre><p>The problem is I am missing content after 4065 characters in the result returned. Can someone help me solve this problem.</p><p>Note:The url I am trying to read contains a json response so everything is in one line I think thats why I am having some content missing.</p>","254103","","114066","","2010-03-18 09:05:17","2012-02-10 11:26:32","Android Read contents of a URL (content missing after in result)","<android><httpwebrequest>","1","3","3","",""
"2094619","1","2096713","","2010-01-19 15:34:44","4","1464","<p>I am working on android application and I am able to displayed multiple icons on map using ItemizedOverlay and I have also implemented onTap(int index) method of ItemizedOverlay to display icon specific information in a required window.</p><p>Now, I want to change icon of selected overlay when user click on some other coponent. I am calling setFocus(OverlayItem) method of ItemizedOverlay to display different icon of specific overlay. it works fine when user tap on any specific overlay but does not change icon when I call setFocus(OverlayItem)  method. </p><p>Any pointers? what is best way of programtically changing icon of selected overlay in mapView?</p><p>I have overriden getMarker method of my custom OverlayItem class to display different markers for different state of overlayItem.and I want to use setFocus(OverlayItem) method to change the state of OverlayItem and also change the marker when selected. </p><pre><code>@Overridepublic Drawable getMarker(int stateBitset){ if(stateBitset==0){  icon = Util.getCategoryMapIcon(0);     icon.setBounds(0-icon.getIntrinsicWidth()/2, 0-icon.getIntrinsicHeight(), icon.getIntrinsicWidth()/2, 0);  return icon; }else {  icon = Util.getCategoryMapIcon(OverlayItem.ITEM_STATE_SELECTED_MASK);  icon.setBounds(0-icon.getIntrinsicWidth()/2, 0-icon.getIntrinsicHeight(), icon.getIntrinsicWidth()/2, 0);  return icon;    }}</code></pre><p>here Util.getCategoryMapIcon(0) is Utility method to return appropriate icon, this method takes some parameters, which I have removed to make this example look simple.</p><p>and below is code to change the state</p><pre><code>Button leftNavigation = (Button) findViewById(R.id.left_navigation_button);leftNavigation.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) {  OverlayItem item = searchResultsOverlay.get(index+1);  setFocus(item); }});</code></pre><p>Any help will be much appreciated.Thanks,Aamir</p>","254032","","254032","","2010-02-01 16:35:18","2010-02-01 16:35:18","setFocus(overlayItem) of ItemizedOverlay is not working","<android><google-maps><map><overlay>","1","0","","",""
"2094760","1","","","2010-01-19 15:49:57","2","417","<p>My application connects to web server, downloads data (approximately 43000 Bytes) and do mathematics function (such as log, +, -, * etc...) on each byte. </p><p>To prepare apk file, it is just like publishing to android market. Turned off debug mode and deactivated all loggers.</p><p>Then put it to the web server and downloaded (installed) on my HTC device. After installation, I've tested the application.The time from beginning read bytes to end of task is approximately 4 minutes. It is very slow.</p><p>I've researched this part. It seems that is working slow on mathematics functions. </p><p>Is there any way to increase working speed ? </p><p>My code is same as iphone version of my application. It is very fast. All parts complete in 4 - 10 seconds. </p><p>What is wrong here ?</p><p>Or do I need to any configuration (related debug mode) ?</p><p>Please advice.</p><p>Thanks.</p>","227889","","","","","2011-03-25 23:24:09","Working very slow","<android>","3","0","1","",""
"2094812","1","","","2010-01-19 15:55:42","2","1476","<p>I am thinking of developing a simple Android application that lets users compose music on Android phones.</p><p>I am new to the Android platform. I have some coding experience in Java that involves being aware of basic OOPS and Java concepts and developing some small Java applications(less than 1k lines of code). I have set up Android on my Linux system and have been able to run a ""hello World"" application.</p><p>I want to develop a simple Android app in a month wherein users can compose music. What I want to do is this- A  touch on the screen should produce/emit a sound/tone. Touching different parts of the screen should produce/emit sounds of different pitch levels/frequencies. Once this is done I want to improve the UI and add some basic features of playback, ""clearing"" currently selected tones on the screen.</p><p>How do I start doing this? Also, given my limited experience with java, how should I divide the tasks so that I can finish this in a month? </p>","254141","","254141","","2010-01-19 16:06:15","2010-01-20 18:33:33","Android app for composing music: Beginner","<java><android><music>","1","1","2","",""
"2095175","1","","","2010-01-19 16:46:34","5","7151","<p>I have the following</p><pre><code>&lt;TableRow xmlns:android=""http://schemas.android.com/apk/res/android""          android:id=""@+id/admin_row""          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:gravity=""center_horizontal""&gt;    &lt;RelativeLayout android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    android:orientation=""horizontal""                    android:background=""@color/silver""&gt;</code></pre><p>I dynamically populate the table but with the relative layout colored silver it only spans about 3/4 of the table row. If I put a LinearLayout with horizontal orientation it spans completely but if I change it to vertical the same problem occurs. I need a relative layout in the table row because I need to something like this:</p><p>Value<br>Detail             MoreDetail.</p><p>Any ideas on getting the relative layout to span the table row?</p>","175056","","","","","2010-04-28 13:50:25","Android TableRow RelativeLayout Issue","<android><tablelayout><tablerow><relativelayout>","3","0","1","",""
"2095564","1","","","2010-01-19 17:35:26","0","1242","<p>i'm having a main activity that runs a gps listener.If i'm starting a new activity the listener is destroyed.I need the gps to be still activated, also after starting the 2nd activity.Do i have to implement an own listener there, or is there another solution?</p><p>thx </p>","245625","","","","","2010-01-19 21:04:39","Android: Keep GPS active","<android><gps><active>","1","2","","",""
"2095695","1","2095761","","2010-01-19 17:54:29","10","4275","<p>I am writing my first Android database backend and I'm struggling to unit test the creation of my database.</p><p>Currently the problem I am encountering is obtaining a valid Context object to pass to my implementation of SQLiteOpenHelper.  Is there a way to get a Context object in a class extending TestCase?  The solution I have thought of is to instantiate an Activity in the setup method of my TestCase and then assigning the Context of that Activity to a field variable which my test methods can access...but it seems like there should be an easier way.</p><p>Thanks for your input!</p><p>Macy</p>","229270","","","","","2013-05-04 02:57:14","Android Unit Tests Requiring Context","<database><android><unit-testing>","4","0","2","",""
"2095751","1","2096194","","2010-01-19 18:00:54","3","992","<p>Trying to make an google maps overlay in an android program. Inside of my overlay's draw method, I have two ways of adding a pin. One of them works, and one does not. Unfortunately, the one that does not work is also the only one that has the ability to add a shadow! Any help? </p><pre><code>@Overridepublic void draw(android.graphics.Canvas canvas, MapView mapView,        boolean shadow) {    Point po = mapView.getProjection().toPixels(mapView.getMapCenter(),            null);    // This does _not_ work, but I would really like it to!    drawAt(canvas, mapView.getResources().getDrawable(R.drawable.map_marker_v),           po.x, po.y, false);    // This does work, but only does half the job    canvas.drawBitmap(BitmapFactory.decodeResource(mapView.getResources(),            R.drawable.map_marker_v), po.x, po.y, null);}</code></pre><p>Edit: fixed type</p>","119592","","","","","2010-08-13 13:23:41","Not understanding drawAt() method for com.google.android.maps.Overlay","<android><google-maps><overlay>","2","2","","",""
"2096370","1","2097389","","2010-01-19 19:23:38","1","1868","<p>I have the following layout xml. I am trying to place the TextView to the left, and the Radiobutton to the right. How can I accomplish this?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;    &lt;TextView      android:id=""@+id/txtVehName""      android:hint=""@string/VEH_NAME""      android:textSize=""18sp""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""&gt;    &lt;/TextView&gt;    &lt;RadioButton      android:id=""@+id/rbDefault""      android:text=""""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""&gt;    &lt;/RadioButton&gt;&lt;/LinearLayout&gt;</code></pre><p>thanks</p><p>patrick</p>","244190","","759749","","2011-08-23 00:17:57","2011-08-23 00:17:57","How can I get my TextView to the left and the Radiobutton to the right with this code?","<android>","4","3","1","",""
"2096874","1","2097594","","2010-01-19 20:38:10","5","11327","<p>I do a:</p><pre><code>java.net.InetAddress serverAddr;try {    serverAddr = java.net.InetAddress.getByName(Server.SERVERNAME);}catch (java.net.UnknownHostException exception) {    //System.err.println (""wrong server name !!!"");    HelloWorldActivity.tv.setText(""wrong server name !!!"");    return;}</code></pre><p>in my android application, but it's never resoling the hostname, it always throws an exception, no matter what name I use.</p><p><br>But using the internet on the same emulator works, and I've added</p><pre><code>&lt;use-permission id=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE"" /&gt;</code></pre><p>to AndoidManifest.xml</p><p>and here's the server class for those who assume I have none</p><pre><code>public class Server{    public static String SERVERNAME = ""monster.idsoftware.com"";    public static String SERVERIP = ""209.85.129.99"";    public static int SERVERPORT = 27950;    public static int PROTOCOL = 68;}</code></pre>","155077","","60261","","2010-01-19 20:54:22","2012-08-16 14:55:34","InetAddress.getByName on Android","<java><android><sockets>","4","8","","",""
"2097473","1","2097537","","2010-01-19 22:01:55","2","5852","<p>How do I unsubscribe a <code>LocationListener</code> from recieving updates from the <code>LocationManager</code>?</p><p>Here is how I'm setting it up</p><pre><code>mLocationManager = (LocationManager)this.getSystemService(LOCATION_SERVICE);mListener = new LocationListener() {    public void onLocationChanged(Location location) {        Log.i(""LocationListener"", ""Logging Change"");    }}mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,                5000, 1, mListener);</code></pre><p>After I have exited the the view that created the <code>LocationListener</code> I am still getting log messages in the LogCat window.</p><p>I understand that this is because I am orphaning the listener but I cannot see any destroy method on the <code>LocationListener</code> nor can I see any ""remove listener"" style methods on the <code>LocationManager</code> object.</p>","1741868","","1741868","","2011-07-03 17:02:48","2012-06-07 20:14:16","Unsubscribing a LocationListener from the LocationManager","<android><locationmanager><locationlistener>","3","0","1","",""
"2097643","1","","","2010-01-19 22:26:35","1","2238","<p>Ok, after figuring out the earlier question 'Layout Question', now my OnItemClickListener, and ItemLongClickListener(ContextMenu) have stopped working. With just the TextView it works fine</p><p>xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout    xmlns:android=""http://schemas.android.com/apk/res/android""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""&gt;    &lt;TextView       android:id=""@+id/txtVehName""       android:hint=""@string/VEH_NAME""       android:textSize=""18dp""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""      android:layout_marginTop=""10dip""      android:layout_alignParentBottom=""true""      &gt;     &lt;/TextView&gt;    &lt;RadioButton       android:id=""@+id/rbDefault""       android:text=""""       android:layout_width=""wrap_content""       android:layout_height=""wrap_content""      android:layout_alignParentRight=""true""      android:layout_alignParentBottom=""true""      &gt;     &lt;/RadioButton&gt; &lt;/RelativeLayout&gt;</code></pre><p>Anyone have any ideas as to why this would stop working?</p><p>thanks</p>","244190","","1832221","","2013-05-29 09:55:49","2013-05-29 09:55:49","Why my layout OnItemClickListener not working now?","<android>","0","2","1","",""
"2097657","1","","","2010-01-19 22:29:58","5","22384","<p>Can anyone tell me how to update the database in android. I created an app with an embedded database. I changed the version of the database in the manifest and created the on update method. I wanted to test it to see if the database was updating properly but when I use the adb command only the -r will allow me to do a reinstall but it keeps the database. Is there a way to run the adb command that will allow me to update the database. Thanks.</p>","237259","","","","","2013-07-31 17:38:06","Update Database Android","<android>","6","0","2","",""
"2097813","1","3231037","","2010-01-19 22:49:43","71","75404","<p>This file appears to be in a binary XML format.  What is this format and how can it be parsed programmatically (as opposed to using the aapt dump tool in the SDK)?  </p><p>This binary format is not discussed in the documentation <a href=""http://developer.android.com/guide/topics/manifest/manifest-intro.html"">here</a>.</p><p><strong>Note</strong>: I want to access this information from outside the Android environment, preferably from Java.</p>","94478","","2360535","","2014-01-05 13:42:46","2014-02-25 06:48:10","How to parse the AndroidManifest.xml file inside an .apk package","<android><android-manifest>","10","3","46","",""
"2097909","1","2709308","","2010-01-19 23:06:19","16","15341","<p><em>Hello! First time to ask a question here at stackoverflow. Exciting! Haha.</em></p><p>We're developing an Android game and we play some background music for our intro (we have an Intro Activity) but we want it to continue playing to the next Activity, and perhaps be able to stop or play the music again from anywhere within the application.</p><p>What we're doing at the moment is play the bgm using MediaPlayer at our Intro Activity. However, we stop the music as soon as the user leaves that Activity. Do we have to use something like Services for this? Or is MediaPlayer/SoundPool enough? If anyone knows the answer, we'd gladly appreciate your sharing it with us. Thanks!</p>","245642","","","","","2011-02-21 16:20:39","Playing BG Music Across Activities in Android","<java><android><media><music><background-music>","6","1","5","",""
"2097938","1","","","2010-01-19 23:10:35","9","7137","<p>Is possible to play an Internet radio stream in Android? And since most of the Internet radios use MMS to stream their content is <em>that</em> possible using Android? </p>","234898","","811","","2010-01-19 23:18:46","2011-10-22 11:47:18","Is it possible to use MMS to stream Internet radio in Android?","<android><stream><mms>","2","1","2","",""
"2098152","1","2098472","","2010-01-20 00:04:48","0","1346","<p>Quick question - I'm having control that's extending LinearLayout and I'm overriding it's onPaint method like this</p><pre>@Overrideprotected void onDraw(Canvas canvas) {    super.dispatchDraw(canvas);    _background.draw(canvas);    _object1.draw(canvas);    _object2.draw(canvas);    _object3.draw(canvas);    // etc...}</pre><p>Every 40ms I invoke postInvalidate() in background and onPaint gets called on UI thread. The problem is _background.draw is taking over 80% of my drawing time.</p><p>So - is it possible to somehow cache background and not redraw it every time?</p>","237858","","","","","2010-01-20 01:29:44","Android drawing - Background caching","<android>","1","2","1","",""
"2098318","1","2100111","","2010-01-20 00:44:47","26","14342","<p>Grrr...</p><p>I create a subclass of view as an inner class in my Activity. Before I simply linked to this view from my activity with:</p><pre><code>setContentView(new CustomView(this));</code></pre><p>without problems.</p><p>Now, however, my view is getting more complex so I am making it part of a FrameLayout so that I can make this the base view and add a Spinner widget on top of it. The problem is, when I do this I get an error:</p><pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.grafightscratch.ochemmer/com.grafightscratch.ochemmer.MoleculeTablet}: android.view.InflateException: Binary XML file line #4: Error inflating class com.grafightscratch.ochemmer.MoleculeTablet.MoleculeTabletView...Caused by: android.view.InflateException: Binary XML file line #4: Error inflating class com.grafightscratch.ochemmer.MoleculeTablet.MoleculeTabletView...Caused by: java.lang.ClassNotFoundException: com.grafightscratch.ochemmer.MoleculeTablet.MoleculeTabletView in loader dalvik.system.PathClassLoader@43b74a28</code></pre><p>So- this view worked before when I linked to it directly, but when I tried to add it in the main.xml file as part of a framelayout I got the above error. I also tried putting into a layout with only it being displayed via:</p><pre><code>&lt;com.grafightscratch.ochemmer.MoleculeTablet.MoleculeTabletViewxmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/molecule_tablet_view""android:layout_width=""fill_parent""android:layout_height=""fill_parent""/&gt;</code></pre><p>Nothing works. I keep getting the InflateException/ClassNotFoundException errors. It complains about ""line #3"" in the binary XML file, and if it is talking about main.xml that is the package declaration which I have triple checked.</p><p><strong>EDIT</strong>I tried making this view a separate class (ie- not an inner class) and it works. After some searching around I found some posts saying that the xml tag should look like this:</p><pre><code>&lt;com.grafightscratch.ochemmer.MoleculeTablet$MoleculeTabletView ...&gt;</code></pre><p>Ie, a dollar sign should be used to separate the innerclass from the main class. However, Eclipse barfs on this, calls it an error, and refuses to let me build or deploy with that character there. So now the question becomes: how does one reference a View that is an inner class?</p>","253575","","253575","","2010-01-20 08:07:31","2011-06-04 01:34:03","Error referencing an inner class View in layout/main.xml","<android><layout><view>","4","0","7","",""
"2098548","1","2099068","","2010-01-20 01:49:32","3","6772","<p>Can anyone please provide me some idea/guidance on how to save an image from a webserver and set it as wallpaper? i am developing an android application which needs to do that and i am new in android. Thanks a lot.</p><p>I had tried writing my own code but it doesn't work as i can't find my images after download but the wallpaper has change to the downloaded picture. here is my existing code.</p><pre><code>Bitmap bmImg;void downloadFile(String fileUrl) {    URL myFileUrl = null;    try {        myFileUrl = new URL(fileUrl);    } catch (MalformedURLException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    try {        HttpURLConnection conn = (HttpURLConnection) myFileUrl                .openConnection();        conn.setDoInput(true);        conn.connect();        int length = conn.getContentLength();        InputStream is = conn.getInputStream();        bmImg = BitmapFactory.decodeStream(is);        // this.imView.setImageBitmap(bmImg);    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    try {        String filepath=Environment.getExternalStorageDirectory().getAbsolutePath();         FileOutputStream fos = new FileOutputStream(filepath + ""/"" + ""output.jpg"");         bmImg.compress(CompressFormat.JPEG, 75, fos);        fos.flush();        fos.close();        Context context = this.getBaseContext();        context.setWallpaper(bmImg);    } catch (Exception e) {        //Log.e(""MyLog"", e.toString());        TextView tv = (TextView) findViewById(R.id.txt_name);        tv.setText(e.toString());    }}</code></pre>","679696","","679696","","2010-01-20 05:58:02","2011-09-19 05:56:20","android - save image from web server and set it as wallpaper","<android><image><save><set><wallpaper>","1","0","4","",""
"2098558","1","2098866","","2010-01-20 01:51:59","28","19307","<p>Is it possible to use a OnItemClickListener on a ListView when the Items layout has a clickable/editable widget (RadioButton,EditText, or CheckBox)? </p>","244190","","","","","2013-10-11 10:04:12","ListView with clickable/editable widget","<android><android-widget>","4","1","15","",""
"2098634","1","","","2010-01-20 02:15:17","5","8512","<p>I want to know if I can create an application in android that encrypts your voice in a normal phone call and sends it to the destination where it can then be decrypted...</p>","254542","","","","","2012-10-26 10:42:30","Is it possible to encrypt/decrypt voice calls in Android?","<android><encryption><voice>","5","0","3","2012-07-22 15:44:31",""
"2098642","1","","","2010-01-20 02:16:11","13","42189","<p>I have one simple question regarding Java TimerTask. How do I pause/resume two TimerTask tasks based on a certain condition? For example I have two timers that run between each other. When a certain condition has been met inside the task of first timer, the first timer stops and starts the second timer, and the same thing happens when a certain condition has been met inside the task of second timer. The class below shows exactly what I mean:</p><pre><code>public class TimerTest {    Timer timer1;    Timer timer2;    volatile boolean a = false;    public TimerTest() {        timer1 = new Timer();        timer2 = new Timer();         }    public void runStart() {        timer1.scheduleAtFixedRate(new Task1(), 0, 1000);    }    class Task1 extends TimerTask {        public void run() {            System.out.println(""Checking a"");            a = SomeClass.getSomeStaticValue();            if (a) {                // Pause/stop timer1, start/resume timer2 for 5 seconds                timer2.schedule(new Task2(), 5000);            }        }    }    class Task2 extends TimerTask{        public void run() {            System.out.println(""Checking a"");            a = SomeClass.getSomeStaticValue();            if (!a) {                // Pause/stop timer2, back to timer1                timer1.scheduleAtFixedRate(new Task1(), 0, 1000);            }            // Do something...        }    }    public static void main(String args[]) {        TimerTest tt = new TimerTest();        tt.runStart();          }}</code></pre><p>So my question is, how do I pause <code>timer1</code> while running <code>timer2</code> and vice versa while <code>timer2</code> is running? Performance and timing is my main concern as this needs to be implemented inside another running thread. By the way I am trying to implement these concurrent timers on Android. </p><p>Thanks for your help!</p>","196863","","188331","","2014-01-09 07:34:41","2014-01-09 07:34:41","Pausing/stopping and starting/resuming Java TimerTask continuously?","<java><android><multithreading><timer>","6","9","4","",""
"2099249","1","2099477","","2010-01-20 05:34:16","41","46001","<p>Getting started with Android and having trouble getting a simple layout going.  </p><p>I would like to use a LinearLayout to position two TextViews in a single row.  One TextView on the left hand side, the other on the right hand side (analogous to float:left, float:right in CSS).</p><p>Is that possible or do I need to use a different ViewGroup or further layout nesting to accomplish it?</p><p>Here's what I have so far:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:orientation=""horizontal"" android:padding=""10sp""&gt;&lt;TextView android:id=""@+id/mytextview1"" android:layout_height=""wrap_content"" android:text=""somestringontheleftSomestring"" android:layout_width=""wrap_content""/&gt;&lt;TextView android:id=""@+id/mytextview2"" android:layout_height=""wrap_content"" android:ellipsize=""end""    android:text=""somestringontheright"" android:layout_width=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre>","233202","","","","","2014-04-15 06:33:04","Aligning textviews on the left and right edges in Android layout","<android>","2","0","10","",""
"2099570","1","2099946","","2010-01-20 07:03:33","4","447","<p>Guys I wanted to know what are the open-source tools other than the ones provided by android you are using.... </p>","237388","","237388","","2010-01-21 09:48:32","2012-08-06 05:17:31","What open source tools do you use when developing/testing for Android?","<android><open-source>","4","0","1","",""
"2099782","1","","","2010-01-20 07:52:02","3","5246","<p>My Query is, I want to get notified if the receiver at the other side picks my call when I am making an outgoing call. Is it possible with the Android SDK.</p><p>The onCallStateChanged Function is called only when the Person dial a number(OFFHOOK), from his phone and When the call reciever person disconnects the call(IDLE), but there is no State parameter to knowthat, does the other end person has recieved the call?</p><pre><code>public class MyPhoneStateListener extends PhoneStateListener{    public void onCallStateChanged(int state,String incomingNumber){        Log.d(""Checking----&gt;"",TelephonyManager.ACTION_PHONE_STATE_CHANGED);    }}</code></pre><p>Logcat give only the following information when call recieved at the other side:</p><pre><code>01-19 19:33:30.633: DEBUG/CallNotifier(638): stopRing()... (OFFHOOK state)01-19 19:33:30.662: DEBUG/Ringer(638): stopRing()...01-19 19:33:30.694: DEBUG/Ringer(638): - stopRing: null mRingHandler!01-19 19:33:31.256: DEBUG/PhoneApp(638): updateWakeState: callscreen true, dialer false, speaker false...01-19 19:33:31.287: DEBUG/PhoneApp(638): updateWakeState: keepScreenOn = false (isRinging false, showingDisc false)</code></pre>","28557","","1055764","user658042","2013-07-19 09:49:17","2013-07-19 09:49:17","Outgoing call status","<android>","1","0","3","",""
"2099811","1","2100004","","2010-01-20 08:03:04","2","1354","<p>I have a URL for a video file which I need to play using the native Video-player of the handset.<br>I figured using <code>Intent.ACTION_VIEW</code> and setting the URI as Intent data, I am able to achieve the aforementioned on G1 except HTC hero. In case of Hero, I have to explicitly set the class Name in the Intent to start the default Video Player: <code>intent.setClassName(""com.htc.album"",""com.htc.album.ViewVideo"");</code></p><p>However, I am not comfortable with this approach as it might break on other Android devices. Please advice on :<br>1. What would be the best way to play this video url via Intent, irrespective of the handset?<br>2. How to conditionally setClassName in Intent, specific to a Handset?</p><p>Note: Writing a standalone Video Player for our app is NOT an option we can afford at the moment.</p><p>Thanks!</p>","236128","","","","","2010-01-20 08:41:06","Best way to play a Video file?","<android><android-intent><android-video-player>","1","0","0","",""
"2099959","1","2101773","","2010-01-20 08:30:39","31","50359","<p>My class extends extends TabActivity</p><pre><code>TabHost mTabHost =  getTabHost();TabHost.TabSpec tab1 =mTabHost.newTabSpec(""tab1"");TabHost.TabSpec tab2 =mTabHost.newTabSpec(""tab2"");tab1 .setIndicator(""title tab1"");tab2 .setIndicator(""title tab2"");mTabHost.addTab(tab1);mTabHost.addTab(tab2);TabHost.setCurrentTab(0 or 1)</code></pre><p>Can anybody guide me how do I change the background image or color of selected tab?</p>","216431","","121364","","2010-01-20 08:33:38","2014-02-04 10:38:40","How do I change the background of an Android tab widget?","<android><widget><tabs>","6","0","18","",""
"2100158","1","2105216","","2010-01-20 09:11:25","1","7018","<p>google map is not displayed ,in this i am generate new md5 key also but it is not coming.instead of map boxes and zoom buttons r coming</p><p>I am using this layout:</p><pre><code>&lt;LinearLayout   xmlns:android=""http://schemas.android.com/apk/res/android""   android:id=""@+id/frame""   android:orientation=""vertical""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""&gt;   &lt;com.google.android.maps.MapView      android:id=""@+id/map""      android:apiKey=""0Hk8f49CqFaKR6GAiakhaQ5qAbrmcWXM4WLjV1A""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""       android:clickable=""true"" /&gt;&lt;/LinearLayout&gt;</code></pre>","454808","","3171","","2010-01-21 09:26:45","2012-10-20 01:36:06","Google map not displayed in android","<android>","7","5","1","",""
"2100401","1","2100640","","2010-01-20 09:54:53","1","558","<p>I've got the following:</p><p>Activities <code>A, B, C, D</code>. <code>A</code> and <code>D</code> can be reached at any time, anywhere from the application.</p><p><code>B</code> and <code>C</code> are reached like this: </p><pre><code>A -&gt; B -&gt; C</code></pre><p>I have the following use case:</p><p>The user has entered <code>C</code> ( <code>A -&gt; B -&gt; C</code> ) then she has gone to <code>D</code>. </p><p>When she wants to go to <code>A</code>, I want to transfer her to the already started queue from <code>A</code> - in other words I want her to go to the started <code>C</code>.</p><p>Something like this <code>A -&gt; B -&gt; C -&gt; D -&gt; (same) C</code>. But I don't want to lose <code>D</code> from the activity stack. After this, when she presses the ""back"" button, she is transfered to <code>D</code> again.</p><p>Is this possible and correct to do? What is the best practice?</p><p>If I haven't explained my situation clear enough, feel free to ask questions.<br/>10x in advance,<br/>Danail</p>","232798","","232798","","2010-01-20 13:38:42","2010-10-25 14:10:03","Android: Handling Activity stack","<android>","1","0","1","",""
"2100737","1","2100949","","2010-01-20 10:50:29","21","14783","<p>I want to know the progress of some download.<br>When I'm getting some resource from the internet,like this:</p><pre><code>        String myFeed = request.getURI().toString();        URL url = new URL(myFeed);        URLConnection connection = url.openConnection();        HttpURLConnection httpConnection = (HttpURLConnection) connection;        int responseCode = httpConnection.getResponseCode();        if (responseCode == HttpURLConnection.HTTP_OK) {            InputStream in = httpConnection.getInputStream();            // Process the input stream        }</code></pre><p>When ""InputStream in = httpConnection.getInputStream();"" is called,<br>all the content of the file is downloaded at once.  </p><p>If I use:</p><pre><code>        htttpResponse = httpClient.execute(httpRequestBase);</code></pre><p>The problem is the same.</p><p>How can I detect the actual progress of the download?  </p><p>Thank you all!</p>","243376","","102937","","2011-02-14 19:40:32","2011-02-14 19:40:32","Android Download Progress","<android><progress>","1","0","11","",""
"2100866","1","2100972","","2010-01-20 11:12:55","4","746","<p>Is there any Java ME compatibility layer for Android, which makes porting Java ME (aka. J2ME) applications easier?</p><p>I mean a third party class library which redirects calls to internal Android API.</p>","11238","","","","","2010-01-20 13:06:00","Java ME compatibility layer for Android","<android><java-me><libraries>","2","0","1","",""
"2101253","1","","","2010-01-20 12:23:33","3","14573","<p>The below code results in a timeout. </p><p>It works fine on non-Android Java.  What's the matter?</p><pre><code> //@Overridepublic static void run(){    //System.out.println ( ""Local Machine IP : ""+addrStr.toString (  )  ) ;    HelloWorldActivity.tv.setText(""Trace 1"");    try    {        // Retrieve the ServerName        InetAddress serverAddr; //= InetAddress.getByName(Server.SERVERIP);        InetAddress ias[] = InetAddress.getAllByName(Server.SERVERNAME);        serverAddr  = ias[0];        Log.d(""UDP"", ""C: Connecting..."");        /* Create new UDP-Socket */        DatagramSocket socket = new DatagramSocket();        /* Prepare some data to be sent. */        String strQuery=""˙˙˙˙getservers""+"" ""+Server.iProtocol+"" ""+""'all'"";        Log.d(""UDP"", strQuery);        //byte[] buf = (""˙˙˙˙getservers 68 'all'"").getBytes();        byte[] buf = strQuery.getBytes();        /* Create UDP-packet with         * data &amp; destination(url+port) */        DatagramPacket packet = new DatagramPacket(buf, buf.length, serverAddr, Server.SERVERPORT);        Log.d(""UDP"", ""C: Sending: '"" + new String(buf) + ""'"");        /* Send out the packet */        socket.setSoTimeout(5000);        socket.send(packet);        Log.d(""UDP"", ""C: Sent."");        Log.d(""UDP"", ""C: Done."");        // http://code.google.com/p/android/issues/detail?id=2917        byte[] buffer= new byte[1024*100];        DatagramPacket receivePacket = new DatagramPacket(buffer, buffer.length); //, serverAddr, Server.SERVERPORT);        socket.receive(receivePacket);        HelloWorldActivity.tv.setText(""TTT"");        String x = new String(receivePacket.getData());        Log.d(""UDP"", ""C: Received: '"" + x  + ""'"");        HelloWorldActivity.tv.setText(x);   } catch (Exception e)   {       HelloWorldActivity.tv.setText(e.getMessage());        Log.e(""UDP"", ""C: Error"", e);   }}public class Server{    /*    //public static java.lang.string SERVERIP;    public static String SERVERNAME = ""monster.idsoftware.com"";    public static String SERVERIP = ""192.246.40.56"";    public static int SERVERPORT = 27950;    public static int PROTOCOL = 68;      */        //public static String SERVERNAME=""monster.idsoftware.com"";    public static String SERVERNAME=""dpmaster.deathmask.net"";    public static String SERVERIP=""192.246.40.56"";    public static int SERVERPORT=27950;    //public static int iProtocol= 68; // Quake3    public static int iProtocol=71; // OpenArena}</code></pre><p>Android manifest:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>&lt;use-permission id=""android.permission.READ_CONTACTS"" /&gt;    &lt;use-permission android:name=""android.permission.WRITE_SETTINGS"" /&gt;    &lt;uses-permission android:name=""android.permission.READ_CONTACTS"" /&gt;    &lt;uses-permission android:name=""android.permission.CALL_PHONE"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_GPS"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_MOCK_LOCATION"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_LOCATION"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_ASSISTED_GPS"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_CELL_ID"" /&gt; &lt;uses-permission android:name=""android.permission.RECEIVE_SMS"" /&gt;&lt;uses-permission android:name=""android.permission.VIBRATE"" /&gt;&lt;uses-permission android:name=""android.permission.WAKE_LOCK"" /&gt;&lt;application        android:icon=""@drawable/icon""        android:label=""AAA New Application""        &gt;    &lt;activity android:name=""HelloWorldActivity""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN""/&gt;            &lt;category android:name=""android.intent.category.LAUNCHER""/&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;&lt;/application&gt;</code></pre><p></p>","155077","","3171","","2010-01-20 13:51:45","2012-09-20 08:52:27","Android never receives UDP packet","<java><android><udp>","4","2","2","",""
"2101442","1","2101600","","2010-01-20 12:57:35","0","919","<p>I want to display data in list activity. How do I achieve this?</p><hr><p>TITLE                    Date</p><h2>Sub Title                Button</h2><p>TITLE                    Date</p><h2>Sub Title                Button</h2><p>TITLE                    Date</p><h2>Sub Title                Button</h2><p>....and so on</p><p>Does a tutorial exist related to custom list activity?</p>","249991","","63550","","2010-01-23 10:41:09","2010-01-23 10:41:09","How to display custom list activity in Android?","<android><eclipse>","1","0","","",""
"2101476","1","","","2010-01-20 13:03:40","2","437","<p>I have managed to successfully write a little test app that canreceive and send SMS, but got a couple of questions. (That's 'cos partof the code I copied from elsewhere and I would like to understandbetter).</p><ol><li><p>In my <code>AndroidManifest</code> as well as the sub-class of<code>BroadcastReceiver</code>, there is reference to the string literal<code>""android.provider.Telephony.SMS_RECEIVED""</code>. However, I couldn't findany reference in the API that mentions this. Could someone point me tosome reference that lists/explains these?</p></li><li><p>As part of getting the message from the Intent, I did this:</p><p><code>Object[] pdus = (Object[]) intent.getExtras().get(""pdus"");</code></p></li></ol><p>Again this question is related to the use of hardcoded string literal.Where is the string <code>""pdus""</code> listed and described?</p><p>Thanks in advance!</p>","254894","","1606378","","2012-11-20 16:03:07","2012-11-20 16:03:07","Questions Regarding Handling of Received SMS","<android><sms>","1","2","","",""
"2101762","1","2101844","","2010-01-20 13:51:00","12","39662","<p>We recently released an android application that pulls information from an external server.  Last week we moved from shared hosting to a dedicated server, that went smoothly up until we started getting complaints that users were getting server not found errors.  We checked on our android-based phones (Droid) and everything worked fine.  The vast majority of users are fine, there seems to be a small percentage of t-mobile users running android o/s 1.5 (g1, mytouch 3g) that seem to be having trouble.  We believe these are all previous users of the application.</p><p>Anyway, we've been trying to find a fix (similar to ipconfig /flushdns) but have been unable to do so.  Has anyone had experience with something similar to this?  Thanks.</p>","254919","","","","","2011-12-31 01:55:27","Android: Flush DNS","<android><dns>","3","1","3","2013-02-03 21:00:36",""
"2101867","1","2111526","","2010-01-20 14:11:10","18","14497","<p>i was hoping someone could help me in generating a javadoc for my eclipse project. When i select 'Generate Javadoc' from the project menu I get lots of errors like</p><pre><code>cannot find symbolsymbol  : class ListView</code></pre><p>everytime a class referencing an Android API class, so i only get Javadocs outputted for the classes that do not reference any android api stuff. My app compiles and runs correctly and on the project setting the Android 1.6 lib is present (on the build path - external jars section).</p><p>Any ideas what im doing wrong?</p><p>Thanks. </p><p>Dori</p>","236743","","","","","2013-10-11 07:24:35","Generate a Javadoc for my Android project","<java><android><javadoc>","9","0","8","",""
"2101917","1","2102067","","2010-01-20 14:16:50","0","1176","<p>friends,</p><p>i want to put description and buttons dynamically can any one guide how can i do that??</p><p>i have data in the form of object list/array i.e ID,Titleand want to display in list activity like..</p><p>TITLE  [Details Button]  [Edit Button] (repeating in list activity)</p><p>any help would be appriciated.</p>","249991","","","","","2010-01-20 14:36:45","how to add buttons Dynamically in List Activity in Android?","<android><eclipse>","1","0","","","2010-01-20 14:16:50"
"2102362","1","","","2010-01-20 15:11:43","3","6376","<p>I've recorded audio in my Android application in its AMR format and I'd like to convert these to something that I can more easily use, such as WAV or MP3.</p><p>I've found some online instructions for this, for instance:<a href=""http://www.aquarionics.com/2004/08/04/how_to_convert_amr_files_to_mp3/"" rel=""nofollow"">http://www.aquarionics.com/2004/08/04/how_to_convert_amr_files_to_mp3/</a></p><p>which say to start with the 3GPP reference solutions to convert AMR to WAV, and then use sox and lame from there.</p><p>I compiled this code and tried to convert my AMR file, but it seg faults.  I <em>think</em> this is because Android's AMR files are wrapped in a 3GP container. There is some code online about how to unwrap the AMR files (http://www.benmccann.com/dev-blog/extracting-amr-audio-from-android-3gp-files/), but I can't seem to get it to work and it seems like a lot of extra trouble just to get the audio from these files.</p><p>Does anyone know of a good commandline solution?</p>","247153","","","","","2013-04-07 05:35:17","Android's AMR audio Files to WAV/MP3","<android><compiler><mp3><wav><amr>","3","1","3","",""
"2103976","1","2104075","","2010-01-20 18:41:56","1","3761","<p>I have a hard time understanding the layout tutorial. I am not able to align columns on different rows. For example, what does 3dip mean in android:padding=""3dip"". The documentation says ""Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). "".</p><p>Specifically, I want to create a layout with top and bottom two rows, and the middle are lists. And I want the bottom row to stick to the bottom. e.g.,</p><hr><h2>title1 | title 2| title 3|</h2><h2>list 1</h2><h2>list 2</h2><h2>bottom 1     |  bottom 2  |</h2><p>My current xml looks very ugly (without the middle lists)</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>&lt;TableRow&gt;    &lt;TextView         android:layout_width=""wrap_content""          android:gravity=""center_horizontal""        android:text=""title 1""         /&gt;    &lt;TextView    android:layout_width=""wrap_content""     android:gravity=""center_horizontal""        android:text=""title 2""         /&gt;        &lt;TextView         android:layout_width=""wrap_content""          android:gravity=""center_horizontal""        android:text=""title 3""                    /&gt;&lt;/TableRow&gt;&lt;View        android:layout_height=""2dip""        android:background=""#FF909090"" /&gt;   &lt;TableRow&gt;    &lt;TextView         android:layout_width=""wrap_content""          android:gravity=""center_horizontal""        android:text=""bottom 1""         /&gt;        &lt;TextView         android:layout_width=""wrap_content""          android:gravity=""center_horizontal""        android:text=""bottom 2""                    /&gt;&lt;/TableRow&gt;</code></pre><p></p>","253800","","","","","2010-12-09 07:55:00","android: help creating tablelayout","<android><layout><tablelayout>","4","0","1","",""
"2104372","1","2105659","","2010-01-20 19:43:26","2","5275","<p>I want to do something after the the phone is put into charger. So I created ChargingOnReciever: </p><pre><code>public class ChargingOnReceiver extends BroadcastReceiver {         public void onReceive(Context context, Intent intent) {                 context.startActivity(someActivity);                Log.d(TAG, ""Phone was connected to power"");        } } </code></pre><p>and I want my receiver to listen to android.intent.action.ACTION_POWER_CONNECTED, so I put this into manifest:</p><pre><code>    &lt;reciever android:name="".ChargingOnReceiver"" android:enabled=""true""        android:exported=""true""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.ACTION_POWER_CONNECTED"" /&gt;        &lt;/intent-filter&gt;    &lt;/reciever&gt;</code></pre><p>But ChargingOnReceiver is apparently not started when I put my G1 to charger (connect to my notebook via USB cable). Any help is much appreciated. </p>","243225","","","","","2011-12-17 19:44:53","Android: Event ACTION_POWER_CONNECTED is not sent to my BroadcastReceiver","<android>","3","0","2","",""
"2104933","1","","","2010-01-20 20:59:46","0","886","<p>Is it possible to have multiple selector tags on a single listview...ie: change the background color of each item of the listview (alternating between two drawables), but still have the selector of the list view active for focus and click events?</p><p>Also, is it possible to ensure that the margin stays constant when using selector tags?  For some reason, the margins and paddings all reset to zero...</p>","255262","","255262","","2010-01-20 21:05:37","2011-01-10 19:56:59","Android ListView - Multiple <Selector> Tags","<android><listview><selectors>","1","0","","",""
"2105052","1","","","2010-01-20 21:20:46","3","2166","<p>I've created simple test app with one activity. The activity contains frame animation. The total size of images in frame animation(riffle_forward_anim) is about 1MB. Here is the code I use to load animation:</p><pre><code>public class MainScreen extends Activity {/** Called when the activity is first created. */</code></pre><p>private ImageView imgForward; private ImageView imgBack;</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    imgForward = (ImageView) findViewById(R.id.imgForward);    imgForward.setBackgroundResource(R.anim.riffle_forward_anim);}@Overridepublic void onPause(){ super.onPause(); AnimationDrawable anim = (AnimationDrawable) imgForward.getBackground(); int count = anim.getNumberOfFrames(); for(int i=0;i&lt;count;i++){  anim.getFrame(i).setCallback(null); } imgForward.getBackground().setCallback(null); imgForward = null;}</code></pre><p>}</p><p>As you can see I try to release memory in onPause() method. Yes, I've read <a href=""http://developer.android.com/resources/articles/avoiding-memory-leaks.html"" rel=""nofollow"">http://developer.android.com/resources/articles/avoiding-memory-leaks.html</a></p><p>Anyway crash occurs if I change protrait/landscape mode several times.I understand that I can handle orientation change and avoid crash but I need to release memory in my other app without orientation change. That is why I've created simple test app to understand how realisng memory works.Can anyone give me a hint on how to implement this?</p><p>Thanks</p>","251369","","","","","2011-01-03 13:19:12","How to avoid memory leaks in frame animation?","<android><animation><out-of-memory>","0","0","2","",""
"2105110","1","2105227","","2010-01-20 21:28:49","2","4564","<p>When I try to run traceview I get:</p><p>'java' is not recognized as an internal or external command,operable program or batch file.SWT folder '' does not exist.Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.</p><p>I can't figure out how it get it working. Does anyone know?</p>","92259","","4593","","2010-04-16 18:27:10","2012-08-29 14:10:23","Getting Android Traceview to work","<android><trace>","1","0","2","",""
"2105303","1","2110917","","2010-01-20 21:56:23","3","1610","<p>Is there any info about the future of extending the safe C++ header list in the NDK (or maybe some hints to what might be safe to use) ? Or how soon we can expect the next NDK update? Also will there be any tutorials and documentation comming out for the NDK?</p><p>Thanks</p>","255293","","","","","2010-11-17 12:10:55","Android NDK future extended support for C++","<android><irc><android-ndk>","2","0","","",""
"2105364","1","3770867","","2010-01-20 22:05:57","21","18106","<p>I upload photo to the server via the default HttpClient in Android SDK. I want to show progress in the user interface, is there a way to find out how much has been uploaded? Is it possible with HttpUrlConnection?</p>","243225","","","","","2011-10-30 08:22:41","Android - I want to show file upload progress to the user","<android>","6","3","17","",""
"2105493","1","2105518","","2010-01-20 22:25:52","0","3637","<p>I have a listview that I want to add event listener to it. The following simple code exits with ""Source Not Found"" when debugging.</p><p>I remembered using exactly the same code for Button object and it did not caused any problem.</p><pre><code>mArticleList = (ListView)findViewById(R.id.ArticleList);    populateArticleList();    mArticleList.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {                           launchFullArticle();            ;        }    });    protected void launchFullArticle() {    // TODO Auto-generated method stub    Context context = getApplicationContext();    CharSequence text = ""Hello toast!"";    int duration = Toast.LENGTH_SHORT;    Toast toast = Toast.makeText(context, text, duration);    toast.show();}</code></pre>","253800","","","","","2012-10-29 10:51:23","android: Source Not Found when setOnClickListener","<android><listener>","3","2","","",""
"2105732","1","2124492","","2010-01-20 23:05:42","6","3213","<p>Trying to replicate the behavior of ItemizedOverlay.boundCenterBottom(), inside of one of my Overlay classes. I am fairly certain that I can do this using setBounds(), but I am utterly lost as to what setBounds() is actually doing. </p><p>Thanks, Hamy</p>","119592","","","","","2010-01-23 19:59:10","Need help understanding boundCenterBottom()","<android><google-maps><overlay>","1","0","3","",""
"2105835","1","2105848","","2010-01-20 23:24:29","0","345","<p>Can anybody enlighten me why value/strings.xml is useful(important)? It occurred to me that all the attributes, e.g., id, label can be set in the layout xml as well. So why strings.xml?</p><p>A side question is, once get an ID of an object, say a listitem, how do I get the android:text from it? I did not find any getText() function.</p>","253800","","223391","","2010-01-20 23:29:49","2010-01-21 19:15:55","value/strings.xml vs. layout/*.xml","<android><layout>","3","0","","",""
"2106121","1","","","2010-01-21 00:33:19","4","9435","<p>requestFocus() moves cursor to edit box, but does not highlight it. I want to highlight it like as if it was touched.</p>","62192","","","","","2010-01-21 02:21:38","Android: How to highlight EditText programmatically?","<android>","2","1","1","",""
"2106123","1","","","2010-01-21 00:33:52","4","11823","<p>I'm really new at this. I'm following the book ""Android"" by O'Reilly press a little outdated, I'm using Pulsar for Mobile Java Developers. Build id: 20090920-1017 I go to File, New Project, Android, Android Project. I enter ""Hello World"" for Project Name. Then I get ""An SDK Target must be specified."" There is a check box but it says ""no target specified"".</p><p>How do I get this resolved and how do I get to the command line?</p>","255386","","","","","2012-06-07 15:56:16","An SDK Target must be specified","<android>","3","0","2","",""
"2106144","1","","","2010-01-21 00:40:10","0","4302","<pre><code>@Overrideprotected void onResume(){     //super.onResume();        sensorManager.registerListener((SensorListener) listener,                SensorManager.SENSOR_ACCELEROMETER                |SensorManager.SENSOR_ORIENTATION,                SensorManager.SENSOR_DELAY_NORMAL);}private SensorEventListener listener=new SensorEventListener() {    public void onSensorChanged(SensorEvent event){        if(event.sensor.getType() == Sensor.TYPE_ORIENTATION){            System.out.println(event.values[0]);        }    }    public void onAccuracyChanged(Sensor sensor, int accuracy){    }};</code></pre><p>So the SensorManager.registerListener is where I'm having the issue. Eclipse insists on a SensorListener, and then proceeds to whine when I pass it one because SensorListener is depreciated. I can't seem to get this worked out and would really appreciate some input! I read the previous post and followed the instructions there to no avail. Thank you all very much!</p><p>Brad </p>","255388","","223391","","2010-01-21 00:43:09","2013-07-06 13:02:27","SensorManager.registerListener wants a SensorListener despite its depreciation","<android><eclipse>","2","11","","",""
"2106196","1","2106244","","2010-01-21 00:55:57","0","267","<p>I trying to get the source of android using repo and git. Everytime I do a repo sync, the terminal indicates that it is fetching projects but it will freeze at that particular line for hours. I am guessing that my network is behind a firewall. Which port should I open? or What should I do?</p>","254504","","4799","","2010-01-21 01:12:15","2010-01-21 01:12:15","Getting Android source","<android><git><firewall>","1","1","","",""
"2106702","1","2107581","","2010-01-21 03:24:58","0","546","<p>I'm using PackageManager.getApplicationLabel(ApplicationInfo) to retrieve application labels.  It looks like the label that is returned depends on the Locale set for the phone.</p><p>For instance with the music app I get ""Music"" in English, vs. ""Musica"" if I have my locale set to Spanish.</p><p>Is there a way to get the default application label (perhaps as defined in strings.xml)?  I want to be able to retrieve an application label for each app that is independent of locale.</p>","233202","","","","","2010-01-21 07:34:38","Can I retrieve a locale independent application label from the Android PackageManager?","<android>","1","0","","",""
"2107053","1","","","2010-01-21 05:06:48","3","831","<p>Might sound crazy, but it's what I need to do.  I want to take a Bitmap object and use the XMLPullParser/XmlSerializer to write this to a flat file.  Obviously I will need to read the XML tag back into a Bitmap object.</p><p>I have tried various things, similar to how I write and read Bitmaps from a database.</p><pre><code>            Bitmap bitmap = ((BitmapDrawable) icon).getBitmap();                            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();             bitmap.compress(CompressFormat.PNG, 0, outputStream);             byte[] bitmapByte = outputStream.toByteArray(); </code></pre><p>Where I get lost is once I write this out to my XML file as a String, I can never get it converted back properly.  Any pointers is appreciated.</p><p>Edit:I want to provide a little more information. I am writing out a good deal of XML data for a backup purpose, so loading or writing time is of no concern.  This is not a main source of the data (main source is a SQLite database).  I do not want to have to write out a couple of very small (48x48pixel) images as well if I can help it.</p><p>I am reading in my XML using the XMLPullParser, which reads a String:</p><pre><code>if (name.equalsIgnoreCase(""someXmlTag"")){String someString = parser.nextText();</code></pre><p>I am writing out my XML using the XmlSerializer, which writes a String:</p><pre><code>            XmlSerializer serializer = Xml.newSerializer();        StringWriter writer = new StringWriter();            serializer.setOutput(writer);            serializer.startDocument(""UTF-8"", true);            serializer.startTag("""", ""someTag"");                           serializer.text(someString);</code></pre><p>So somehow I have to turn my Bitmap into a String and then turn that String back into a Bitmap. I will do some searches on Base64 to see if I get any good examples.</p>","242904","","242904","","2010-01-21 13:15:19","2010-01-21 13:15:19","How to write a Bitmap out to a XML file","<android>","2","0","","",""
"2107069","1","2152611","","2010-01-21 05:10:08","1","407","<p>Has anybody implemented the <strong><em>PerformanceTestCase</em></strong> provided by <em>android</em> and got some results...If you have done it please provide some <em>source code</em>,it will be really helpful...</p><p>Here is the android link:<a href=""http://developer.android.com/reference/android/test/PerformanceTestCase.html"" rel=""nofollow"">http://developer.android.com/reference/android/test/PerformanceTestCase.html</a></p><p>I have used the <strong><em>traceview</em></strong> tool but I need results like <em>CPU cycles</em> used,<em>memory</em> used by the app either in real-time or after its execution..</p>","237388","","","","","2012-06-30 03:25:21","Performance TestCase Interface in Android","<android><performance><testing>","1","0","1","",""
"2107235","1","2107315","","2010-01-21 05:59:06","3","3103","<p>I have a gridView that I display in a popupwindow (the gridview is in a transparent layout, which inherits from linearlayout and just has a partially transparent background).  I can never get this GridView's OnItemClick to execute.  When I touch an image in my gridview it <em>appears</em> to be clicked (image bachgrond changes), but OnItemClick is not being called.</p><p>Below is the code for my Adapter and my popupview containing the gridView.  Thanks!</p><pre><code>//Adapter</code></pre><p>public class ImageAdapter extends BaseAdapter {    private Context mContext;    private int itemBackground;</p><pre><code>public ImageAdapter(Context c) {    mContext = c;  //---setting the style---    TypedArray a = c.obtainStyledAttributes(R.styleable.Gallery1);    itemBackground = a.getResourceId(R.styleable.Gallery1_android_galleryItemBackground, 0);    a.recycle();}</code></pre><p>....</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {    ImageView imageView;    if (convertView == null) {        imageView = new ImageView(mContext);    } else {        imageView = (ImageView) convertView;    }    imageView.setImageResource(images[position]);    imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);    imageView.setBackgroundResource(itemBackground);    return imageView;}public Integer[] images = {        R.drawable.sound1,        R.drawable.sound2,        R.drawable.sound3,        R.drawable.sound4};</code></pre><p>}</p><pre><code>//////////In Activity, onCreate////////...final LayoutInflater inflater=(LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    final TransparentLayout musicGrid = (TransparentLayout) inflater.inflate(R.layout.gridviewpopup, null, false);    final GridView gView = (GridView) musicGrid.findViewById(R.id.music_gridview);    gView.setAdapter(new ImageAdapter(this));    final PopupWindow soundSelectorWindow = new PopupWindow(this);    soundSelectorWindow.setContentView(musicGrid);    soundSelectorWindow.setTouchable(true);    gView.setOnItemClickListener(new OnItemClickListener()     {        public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id)         {               //NEVER GETS HERE            soundSelectorWindow.dismiss();        }    }); </code></pre>","208501","","","","","2012-02-08 01:50:37","Cannot execute OnItemClick for GridView in PopupWindow","<android><irc>","3","0","1","",""
"2107351","1","","","2010-01-21 06:38:09","1","1224","<p>My application process incoming/outgoing calls and shows some UI. So I use PhoneStateListener to listen changes  such as  CALL_STATE_IDLE , CALL_STATE_RINGING ,CALL_STATE_OFFHOOK. on receiving call to my BroacastReceiver  for incoming/outgoing call. </p><p>Most of the time things work properly.  But sometimes my application does not receive events of PhoneStateListener and hence it is not able to change/clear  UI.  From user feedback this typically occurs on HTC Hero. But I have came across this issue sometime on other devices also.</p><p>My first guess is that android is killing my application in midway during call due to memory requirement. If so, is there any way to ensure that android does not my kill application under such situation .</p><p>Any thoughts ?</p>","255507","","","","","2012-11-13 05:29:55","PhoneStateListener events stop receiving sometime","<android>","2","0","","",""
"2108102","1","","","2010-01-21 09:30:31","0","1443","<p>I need to pass a value back to the same activity and refresh the activity to generate new data. Can anyone please provide me some ideas/guidance on how to do it? Thank you.I had try using intent to call the same activity but it doesn't work. Here is the code which i tried to use intent:</p><pre><code>btn_next = (ImageButton) findViewById(R.id.btn_next);        btn_next.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                page_counter = page_counter + 1;                if (page_counter &gt; 1){                        btn_prev.setEnabled(true);                }                 Intent i = new Intent();                 i.setClassName(""sample.android.androidgallery"",""helloAndroid"");                 i.putExtra(""page"",wallpaper_page_counter); //to pass this activity's data to next                 startActivity(i);            }        });</code></pre>","679696","","150882","","2010-01-21 09:40:10","2012-01-04 21:48:35","android - pass value back to the same activity on a button click and refresh the page","<android><callback>","1","4","2","",""
"2108456","1","","","2010-01-21 10:35:26","63","110838","<p>I use a table layout to display data as table, but I want a table with user-defined columns and rows with borders.  Suggestions?</p>","454808","","85950","","2012-05-29 22:32:26","2014-02-13 09:46:58","How can I create a table with borders in Android?","<android><tablelayout>","10","0","44","",""
"2108527","1","","","2010-01-21 10:46:37","8","28590","<p>i'm using eclipse to develop over android, i'm trying to connect to a .net webservice...when i'm calling a webmethod with no parameters it works fine... but when i come to pass a parameter to the webmethod things turn upside down... the parameter is passed as null (while debugging the webservice i discovered that) and i get a null from the webmethod in the client side code... i've been searching for a solution for a day now and all that i can interpreter is that people keep talking about encoding styles and such stuff.... i've tried it all but in vain. i'm using ksoap2 version 2.3 with the following code </p><pre><code>package com.examples.hello;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.PropertyInfo;import org.ksoap2.serialization.SoapObject;import org.ksoap2.serialization.SoapSerializationEnvelope;import org.ksoap2.transport.HttpTransportSE;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class HelloActivity extends Activity {    /** Called when the activity is first created. */ private static final String SOAP_ACTION = ""http://Innovation/HRService/stringBs""; private static final String METHOD_NAME = ""stringBs""; private static final String NAMESPACE = ""http://Innovation/HRService/""; private static final String URL = ""http://196.205.5.170/mdl/hrservice.asmx""; TextView tv; @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.main);     tv=(TextView)findViewById(R.id.text1);     call(); } public void call() {         try {          SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);          //PropertyInfo PI = new PropertyInfo();             //request.addProperty(""a"", ""myprop"");             SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);             envelope.setOutputSoapObject(request);             envelope.dotNet=true;             envelope.encodingStyle = SoapSerializationEnvelope.XSD;             HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);             androidHttpTransport.call(SOAP_ACTION, envelope);             Object result = (Object)envelope.getResponse();             String results = result.toString();             tv.setText( """"+results);          } catch (Exception e) {             tv.setText(e.getMessage());             }     }}</code></pre>","","user255681","13070","","2010-05-06 14:29:32","2014-03-13 04:16:59","how to pass parameter to a webservice using ksoap2?","<java><android><web-services><parameters><ksoap2>","5","1","2","",""
"2108557","1","2110465","","2010-01-21 10:52:18","2","2235","<p>In addition to the general <code>res/layout</code> folder I have a <code>res/layout-v3</code>folder for backward compatibility with Android 1.5, which has problemswith some <code>RelativeLayout</code> layouts.</p><p>It works perfectly with all phones and emulator versions tested sofar. Except of 2.1 (emulator and Nexus One). They choose to displaythe Android 1.5 layout (<code>res/layout-v3</code>) instead of the default <code>res/layout</code>.</p><p>Can anyone else confirm that? Is this an Android OS bug? If so, whereis the best place to submit the bug report?</p><p>Thanks </p><hr><p><strong>UPDATE:</strong></p><p>After reading up on <a href=""http://developer.android.com/intl/fr/guide/practices/screens_support.html#qualifiers"" rel=""nofollow"">http://developer.android.com/intl/fr/guide/practices/screens_support.html#qualifiers</a> again (thanks Mark for the hint), especially this part</p><blockquote>  <p>Resources that are for use only on a  specific API Level or higher. For  example, if your application is  designed to run on both Android 1.5  (API Level 3) and Android 1.6 (API  Level 4 and higher), you can use the  -v4 qualifier to tag any resources that should be excluded when your  application is running on Android 1.5  (API Level 3).</p></blockquote><p>I changed my layout order from having</p><ul><li>res/layout-v3 (for Android 1.5 only -> this was a wrong assumption I made)</li><li>res/layout (for anything else)</li></ul><p>to my new configuration of having:</p><ul><li>res/layout-v4 (for Android 1.6 and higher)</li><li>res/layout (for anything else -> in this case this would be Android 1.5 only)</li></ul><p>If I understand the above documentation right and if my assumptions in the parentheses are correct this time it should work now. However, the result is the following:</p><ul><li>Android 1.5 is using res/layout -> OK</li><li>Android 1.6 is using res/layout-v4 -> OK</li><li>Android 2.0 is using res/layout -> <strong>NOT OK</strong></li><li>Android 2.1 is using res/layout-v4 -> OK</li></ul><p>So why is Android 2.0 (on both Emulator and Motorola Milestone) not picking the right layout resource folder?</p><p>I tested it then again with 2.0.1 and it seems to work there. So that seems to be a bug in 2.0 which got fixed in 2.0.1</p><p>But now the weirdest thing: in order to make it somehow run on 2.0 I copied the res/layout-v4 folder to res/layout-v5 to force Android 2.0 using this layout resource. Didn't work. But then I tried copying it to res/layout-v6 (which is supposed to be Android 2.0.1) and voilŕ all the sudden it works with 2.0. Very strange! But I hope this workaround will help a few other people out there.</p>","184367","","184367","","2010-01-22 10:57:46","2010-01-22 10:57:46","Android 2.1 bug: uses res/layout-v3 instead of res/layout","<android><layout>","1","1","2","",""
"2108600","1","3505884","","2010-01-21 10:57:51","8","17202","<p>I'm new at this (java and opengl) so please bear with me if the answer to the question is simple. :)</p><p>I'm trying to get a camera preview screen with the ability to display 3d objects simultaneously. Having gone through the samples at the api demos, I thought combining the code for the the examples at the api demo would suffice. But somehow its not working. The forces me to shut down upon startup and the error is mentioned as null pointer exception. Could someone share with me where did I go wrong and how to proceed from there. How I did the combination for the code is as shown below:</p><p>myoverview.xml </p><hr><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:orientation=""horizontal""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;     &lt;android.opengl.GLSurfaceView             android:id=""@+id/cubes""             android:orientation=""horizontal""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""/&gt;     &lt;SurfaceView             android:id=""@+id/camera""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""/&gt; &lt;/FrameLayout&gt;</code></pre><p>myoverview.java </p><hr><pre><code>import android.app.Activity; import android.os.Bundle; import android.view.SurfaceView; import android.view.Window; public class MyOverView extends Activity { @Override     protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // Hide the window title.        requestWindowFeature(Window.FEATURE_NO_TITLE);        // camera view as the background        SurfaceView cameraView = (SurfaceView) findViewById(R.id.camera);        cameraView = new CameraView(this);        // visual of both cubes        GLSurfaceView cubesView = (GLSurfaceView) findViewById(R.id.cubes);        cubesView = new GLSurfaceView(this);        cubesView.setRenderer(new CubeRenderer(false));        // set view        setContentView(R.layout.myoverview);     } }</code></pre><p>GLSurfaceView.java </p><hr><pre><code>import android.content.Context; class GLSurfaceView extends android.opengl.GLSurfaceView {     public GLSurfaceView(Context context) {             super(context);     } } </code></pre><p>NOTE : </p><ul><li><p>I didnt list the rest of the files as they are just copies of the api demos. The cameraView refers to the camerapreview.java example and the CubeRenderer refers to the CubeRenderer.java and Cube.java example. Any help would be appreciated as I've been stuck at this for a couple of days :p Thanks </p></li><li><p>Sorry, didnt realise that the coding was out of place due to formatting mistakes. :p</p></li></ul>","255582","","255582","","2010-01-21 13:40:54","2011-05-19 00:57:49","surfaceview + glsurfaceview + framelayout","<android><surfaceview>","4","0","7","",""
"2109096","1","2114704","","2010-01-21 12:23:54","6","5275","<p>I am trying to test my application with location information.You know the Emulator Control has an ability to load from KML file. (Eclipse -> DDMS -> Emulator Control -> Location Controls -> KML -> Load KML...)I've prepared KML file using Google earth application with its ""Add path"". Then saved it by .kml extension and load it on the Eclipse. Eclipse didn't load this KML file.</p><p>How to prepare KML file for Android Emulator Control?</p>","227889","","114066","","2010-10-21 09:40:53","2012-07-02 09:13:23","How to prepare KML file for Android Emulator Control?","<android><debugging><kml>","4","0","2","",""
"2109271","1","2109535","","2010-01-21 12:53:37","11","15561","<p>i am new to android development can any one provide me two_line_list_item example...???</p><p>any help would be appriciated..</p>","249991","","179850","","2011-09-26 19:02:48","2012-03-21 23:05:43","can any one provide me example of Two_line_list_item in Android?","<android><listactivity>","2","0","2","","2010-01-21 12:53:37"
"2109600","1","12382920","","2010-01-21 13:46:52","3","2932","<p>I am developing an application which require accessing  a website fordata, and will show that data on device. I wants to fetch data fromInternet in background and show ProgressDialog or ProgressBar ondevice and when application receive response from server  app willdismiss the dialog or bar and will show data .</p><p>For this i am using AsyncTask -</p><p>code for AsyncTask is as follows--</p><pre><code>ServerTask extends AsyncTask {        @Override        protected void onPreExecute() {                dialogAccessingServer = new ProgressDialog(ctx);                dialogAccessingServer.setMessage(shownOnProgressDialog);                dialogAccessingSpurstone.show();        }        @Override        protected ServerResponse doInBackground(String... urlArray) {                String urlString = urlArray[0];                HttpResponse serverResponseObject = null;                //finding HttpResponse                return serverResponseObject;        }//end of doInBackground        @Override        protected void onPostExecute(HttpResponse serverResponseObject){                dialogAccessingSpurstone.dismiss();        }}</code></pre><p>and calling this code as follows--</p><pre><code>ServerTask serverTaskObject = new ServerTask();serverTaskObject.execute();HttpResponse response = serverTaskObject.get();</code></pre><p>//performing operation on response</p><p>but ProgressDialog is not shown.(I guess the reason for it is thethread is not complete and android invalidate only when thread hascompleted).</p><p>My Questions --1- If my guess is right ? If yes then how I should implement it?2- If there is any other better way to do this?</p><p>thanks </p>","215419","","473070","","2011-05-05 10:24:37","2012-09-12 07:13:56","Fetching data from Internet in background and showing ProgressDialog or ProgressBar","<android>","2","0","2","",""
"2109782","1","2109826","","2010-01-21 14:11:41","3","422","<p>I'm building an application, and need to support both 1.5 (Magic and Hero) and 1.6 (Tattoo) devices.As Android SDK is forward compatible, it seemed logical to build against Android 1.5 SDK, and expect application to work on Tattoo.While that's true, (I tested app, it works ok), I'm now having problems on Android Market.</p><p>On Tattoo, Market search by default filters android apps that doesn't have explicit support for small screens defined in AndroidManifest.</p><p>Problem is that attribute exists only on Android 1.6 SDK, so Building against Android 1.5 SDK is no an option anymore.</p><p>How safe is to build App agains A1.6 (with minSdkVersion=""3"") and run it on 1.5 devices?Is there anything else I should take care of except just change target SDK?</p><p>Thanx</p>","35425","","","","","2010-01-21 14:54:28","How safe is to build an app for Android 1.5 devices while targeting Android 1.6 SDK?","<android><sdk><version>","1","1","","",""
"2110620","1","2110804","","2010-01-21 15:56:12","1","1387","<p>I want to set an alarm in my application which will be triggered each day. According to the doc, I have to set a one-time alarm, and in the BroadcastReceiver which will receive the alarm signal, reset the alarm for the day after. <strong>Is that correct ?</strong></p><p>My BroadcastReceiver handles well the wakelock and launch a service which releases this wakelock. Everything works fine here.</p><p>However I have problems. In my application there is a checkbox which is checked when alarm is up. To know if my alarm is up, I use the following condition :</p><pre><code>Intent intent = new Intent( context, AlarmReceiver.class );boolean alarmUp = (PendingIntent.getBroadcast( context, 0, intent, PendingIntent.FLAG_NO_CREATE) != null)</code></pre><p>But this doesn't seem to work very well, <strong>is that a good way to know if an alarm is up ?</strong></p><p>Thanks in advance</p>","231417","","13070","","2010-01-21 16:20:14","2010-01-21 16:20:14","How to handle an alarm triggered each day in android","<android><broadcastreceiver><alarm>","1","0","1","",""
"2110934","1","","","2010-01-21 16:36:07","2","921","<p>I'm doing an app that need to notify the user doing a call that the call is taking to long...I got every thing up an running and an the notification is made at the right time (I can see it at the status bar) but with no sound. If I make the notification call when there is no call the sound is played. </p><p>My notification looks like this:</p><pre><code>        NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);    int icon = R.drawable.icon;    CharSequence tickerText = ""Hello From CallTimerService"";    long when = System.currentTimeMillis();    Notification notification = new Notification(icon, tickerText, when);    Context context = getApplicationContext();    CharSequence contentTitle = ""My notification"";    CharSequence contentText = ""ss"";    Intent notificationIntent = new Intent(this, CallTimer.class);    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);    notification.defaults = Notification.DEFAULT_SOUND;    notification.flags |= Notification.FLAG_AUTO_CANCEL;    mNotificationManager.notify(2, notification);</code></pre><p>I also tried changing the notification.audioStreamType using the AudioManager.STREAM_ but with no luck.</p><p>Do any body now how to do this? or just an good idea what to try next.... </p>","255979","","","","","2012-03-09 18:22:25","Status bar notification with sound doing call","<android>","1","2","","",""
"2111512","1","2111569","","2010-01-21 17:46:53","13","3714","<p>We all know that when generating an id for Android using</p><pre><code>@+id/foo</code></pre><p>Android creates for us an entry in R.java like:</p><pre><code> public static final class id {        public static final int foo=0x7f060005; }</code></pre><p>What happens if there is a name collision in different xml files (let's say, inside two layouts)? The @+id mechanism ensures us to overwrite the id name if another one still exist, but which one is generated in R.java for us?</p>","237076","","","","","2012-10-26 19:03:44","Android id collision mechanism for R.java","<android><collision>","3","1","2","",""
"2111689","1","","","2010-01-21 18:11:10","3","10014","<p>I've got a Problem. I am working on a Project where I am using a Programm on the PC to handle different data (which another programm = my android app creates), which i found on the plugged in sd-card of the android device.</p><p>My aim is now to use the programm on the Computer to install the Android App on the Android Device. In other words: My PC-Programm copies the .apk to the sd card of the Android Device via USB. But how can i install it now? I would be awesome if, after the copy-process has finished the app installs automatically. </p><p>Is something linke this possible?</p>","209902","","","","","2013-06-14 00:33:40","Install Android App via USB","<android><usb><install>","1","0","","",""
"2111800","1","","","2010-01-21 18:27:43","2","3683","<p>I have searched and searched and searched. I cannot seem to download the Google APIs using the Android SDK and AVD manager. It's driving me nuts! I get the subject title message as an error:<br>SHA-1 MessageDigest not available</p><p>My PATH var <code>JAVA_HOME=C:\Program Files\Java\jre6\bin</code>Any thoughts?Thanks!</p>","256070","","220819","","2010-01-22 14:16:46","2013-06-06 06:52:40","SHA-1 MessageDigest not available","<java><android><avd><sha1>","3","0","","",""
"2111985","1","2112254","","2010-01-21 18:58:07","3","2550","<p>I have an application that uses OpenGL on a GLSurfaceView. The problemis that the initial load takes quite a while processing textures andgetting things ready.</p><p>What i want to do is have a simple PNG displayed (with a slightanimation) while the GLSurfaceView is getting ready. As soon as it'sready to render, i would like to tear down the splash screen.</p><p>What is the right way to do this? I've tried ViewFlipper, ViewSwitcherand a bunch of other things to switch between my R.layout.main viewand my GLSurfaceView but i can't seem to get it right.</p><p>Any ideas? </p>","57662","","44729","","2011-05-26 15:45:39","2012-02-26 07:44:30","Creating a proper Android Splash/Loading screen","<android><opengl-es><glsurfaceview>","2","0","1","",""
"2112054","1","","","2010-01-21 19:07:22","0","1043","<p>In Android when you upgrade a database all data is lost.  I'm going through a phase of development right now that is forcing many database upgrades.  I don't want to lose all my data (and have to manually re-enter it) each time I upgrade my database.  I would like to store my data in flat files and load those flat files into their respective tables each time a database upgrade occurs.</p><p>My questions is:  What is the best way to go about this on the Android platform?  Where should I store the data files (res/raw???) What sql should I execute to load these files?</p><p>Thanks.</p>","256096","","","","","2010-01-21 20:51:48","Best way to load flat files into Android database table","<database><android><sqlite>","2","1","0","",""
"2112161","1","2112248","","2010-01-21 19:23:18","0","661","<p>sorry for constant questions. </p><p>i would like to ask if doing smth like this is possible on android:Scrollview of layouts, and each layout in horizontal orientation contains button, another button and checkbox.</p><p>e.g: button1, button2, checkbox     button1, button2, checkbox     .........     button1, button2, checkbox</p><p>thank you!</p>","200123","","","","","2010-01-21 19:35:58","android scroll view of linearlayouts","<android><scrollviewer>","1","0","","",""
"2112187","1","2114936","","2010-01-21 19:27:07","0","2656","<p>How to Debug on the Samsung Galaxy I7500 Android Phone</p><p>modify c:\android-sdk-windows-1.5_r3\usb_driver\x86\android_usb.inf</p><p>under the [Google.NTx86] entry add; SAMSUNG GALAXY%USB\VID_04E8&amp;PID_6640.DeviceDescRelease%=androidusb.Dev, USB\VID_04E8&amp;PID_6640%USB\VID_04E8&amp;PID_6640&amp;MI_04.DeviceDescRelease%=androidusb.Dev, USB\VID_04E8&amp;PID_6640&amp;MI_04%USB\VID_04E8&amp;PID_6640.DeviceDescRelease%=androidusb.Dev, USB\VID_04E8&amp;PID_6640</p><p>under the [Strings] entry add; SAMSUNG GALAXYUSB\VID_04E8&amp;PID_6640.DeviceDescRelease=""SAMSUNG GALAXY""USB\VID_04E8&amp;PID_6640&amp;MI_04.DeviceDescRelease=""SAMSUNG GALAXY Composite ADB Interface""USB\VID_04E8&amp;PID_6640.DeviceDescRelease=""SAMSUNG GALAXY Bootloader""</p><p>Some people have reported the MI_04 combination above is not working; you may want to try MI_1 to MI_4 to be sure.</p><ol><li>go to the phone -> Settings -> Applications -> Development -> enable USB debugging</li><li>Windows will ask for a new driver - this is used for debugging. Point the driver search to c:\android-sdk-windows-1.5_r3\usb_driver\x86.</li></ol><p>When i followed the above steps system tried to install driver and then prompt  following error.<img src=""http://img16.imageshack.us/img16/9986/errorpi.png"" alt=""alt text""></p><p>Reference URL: <a href=""http://adrianvintu.com/blogengine/post/How-to-Debug-on-the-Samsung-Galaxy-I7500-Android-Phone.aspx"" rel=""nofollow"">http://adrianvintu.com/blogengine/post/How-to-Debug-on-the-Samsung-Galaxy-I7500-Android-Phone.aspx</a></p>","216431","","","","","2010-01-22 04:23:12","How to Debug on the Samsung Galaxy I7500 Android Phone","<android><debugging><device>","1","0","","",""
"2112583","1","2113899","","2010-01-21 20:24:53","2","1048","<p>I was wondering how to get the email from the owner of the phone or from the gmail account used on the phone.</p><p>I am trying to do this on android 1.6 and up.</p><p>I know its possible because I have seen some apps that get the email.Maybe its undocumented or it reads it from a undocumented provider or some authentication service, but I know its possible.</p><p>Can anybody help me on this?</p><p>Thanks</p><p>Daniel</p>","237115","","","","","2010-05-12 06:53:55","how to get email from owner or from gmail account on android","<android><gmail><user>","1","0","","",""
"2112714","1","2112817","","2010-01-21 20:40:40","0","1336","<pre><code>&lt;RelativeLayout    android:layout_width=""fill_parent""    android:layout_height=""50dip""&gt;    &lt;Button        android:text=""Edit""        android:width=""50dip""        android:layout_height=""fill_parent""        android:layout_width=""wrap_content""        android:layout_alignParentLeft=""true""        android:layout_alignParentTop=""true"" /&gt;    &lt;ToggleButton        android:textOn=""All""        android:textOff=""Wishlist""        android:layout_height=""fill_parent""        android:layout_width=""wrap_content""        android:layout_centerHorizontal=""true""        android:layout_alignParentTop=""true"" /&gt;    &lt;Button         android:text=""+""        android:width=""50dip""        android:layout_height=""fill_parent""        android:layout_width=""wrap_content""        android:layout_alignParentRight=""true""        android:layout_alignParentTop=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p><a href=""http://i50.tinypic.com/15qadd2.jpg"" rel=""nofollow"">http://i50.tinypic.com/15qadd2.jpg</a></p><p>I have these three buttons I want to align them in a similar fashion to the iphone version. I've tried using gravity and things but I can't seem to get them to look the same without absolute positioning.</p><p>Thanks</p><p>So I figured it out. I replaced my original code with the solution if any one happens to need it. </p>","255123","","255123","","2010-01-21 20:58:41","2010-01-21 20:58:41","Android Layout How to?","<android>","2","0","","",""
"2112768","1","2230053","","2010-01-21 20:47:28","13","11862","<p>I'm writing an Android application that uses OpenGL ES (GLSurfaceView and GLSurfaceView.Renderer). The problem is that when the user switches applications and then switches back to my app, the GLSurfaceView destroys and recreates the GL context. This is what it's supposed to do according to the documentation but is there a way to prevent this from happening?</p><p>It takes a long time to load textures into the context and i'd like to prevent having to reload them.</p>","57662","","","","","2012-06-23 08:22:34","Prevent onPause from trashing OpenGL Context","<android><opengl-es>","4","0","9","",""
"2112876","1","2122090","","2010-01-21 21:02:14","0","2423","<p>My .apk file is confirmed working, however for users of the Motorola Milestone (which runs the same android version 2.0 and up) they receive the error upon attempt to install. I've googled and searched through the other questions here. The error seems to normally only appear if you did something wrong in the signing wizard or renamed the file. Is it possible that some kind of software difference on the OS build on these Milestones is preventing the install?</p>","246883","","","","","2010-01-23 04:15:47","Install error ""problem parsing the package"" occurring for one specific device","<android>","1","2","","",""
"2112965","1","2175688","","2010-01-21 21:14:40","177","87342","<p>How do you get the Android's primary e-mail address (or a list of e-mail addresses)?</p><p>It's my understanding that on OS 2.0+ there's support for multiple e-mail addresses, but below 2.0 you can only have one e-mail address per device.</p>","135199","","135199","","2010-01-22 18:23:09","2014-03-18 17:13:50","How to get the Android device's primary e-mail address","<android>","3","5","130","",""
"2113154","1","","","2010-01-21 21:43:48","1","1442","<p>If I plug the Nexus One to my computer via USB, is there a way for me to see <a href=""http://localhost"" rel=""nofollow"">http://localhost</a> from the computer in the Nexus One screen?</p>","256215","","125389","","2011-07-27 19:45:08","2011-07-27 19:45:08","Localhost on Nexus One/Android","<android><localhost><android-networking>","3","0","1","",""
"2113164","1","","","2010-01-21 21:44:53","1","3477","<p>I started working through the tutorials in Mark L Murphy's book ""Android Programming Tutorials"". In Tutorial #6, they are starting to work with tabs. I copied the code:</p><pre><code>    TabHost.TabSpec spec=getTabHost().newTabSpec(""tag1"");    spec.setContent(R.id.restaurants);    spec.setIndicator(""List"", getResources()    .getDrawable(R.drawable.list));    getTabHost().addTab(spec);    spec=getTabHost().newTabSpec(""tag2"");    spec.setContent(R.id.details);    spec.setIndicator(""Details"", getResources()    .getDrawable(R.drawable.restaurant));    getTabHost().addTab(spec);    getTabHost().setCurrentTab(0);</code></pre><p>into my application, and got syntax errors on ""getTabHost"". I am using </p><pre><code>import android.app.Activity;import android.app.ActivityGroup;import android.app.TabActivity;import android.os.Bundle;import android.view.View;import android.view.ViewGroup;import android.view.LayoutInflater;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.ImageView;import android.widget.ListView;import android.widget.RadioGroup;import android.widget.TabHost;import android.widget.TextView;import java.util.ArrayList;import java.util.List;</code></pre><p>How do I clear the ""The method getTabHost() is undefined for the type ListerApp"" error? Am I missing an import?</p>","256206","","223391","","2010-01-21 21:48:25","2011-09-15 14:35:03","Android Programming Tutorials: #6","<android>","1","0","","",""
"2113283","1","2114495","","2010-01-21 22:02:19","8","1292","<p>I need to prepare some objects based on the initial layout of widgets and views in my Activity.  I'd like to do it in the initialization steps, ideally onCreate and onStart.  Considering the possibility of changes that happen when we're not in the foreground, some of them might need to happen in onResume.</p><p>So I checked whether I could measure how my views had been laid out.</p><pre><code>Log.d(""MyApp"", ""w,h of X is "" + findViewById(R.id.X).getWidth() +      "","" + findViewById(R.id.X).getHeight());</code></pre><p>I ran this in onCreate, onStart, and onResume.  Each time I get 0,0 for width, height.  If I wait for onTouchEvent I get the layout information, so the layout is done by then.</p><p>I'm surprised that the layout isn't set and final by the time I'm seeing onResume.  I expected the widgets to be already laid out and ready to fiddle with by then.</p>","8959","","","","","2010-01-22 02:06:48","When does android first do layout?","<android><layout>","1","0","1","",""
"2113411","1","","","2010-01-21 22:21:39","5","21183","<p>I have the following layout, which is 1 icon on the left and 2 text views (stack on top of each other) on the right. I would like to have the text1 vertically center in the panel and when I make the text2 Visible.GONE. Can you please tell me how can i do that?  </p><pre><code>&lt;RelativeLayout android:id=""@+id/panel""        android:layout_width=""fill_parent""        android:layout_height=""?android:attr/listPreferredItemHeight""&gt;    &lt;ImageView        android:id=""@+id/icon1""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_gravity=""center_vertical""/&gt;    &lt;TextView android:id=""@+id/text1""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/icon1""        android:textAppearance=""?android:attr/textAppearanceSmall""        android:layout_gravity=""center_vertical""/&gt;    &lt;TextView android:id=""@+id/text2""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/icon1""        android:layout_below=""@id/text1""        android:textAppearance=""?android:attr/textAppearanceSmall""/&gt;    &lt;/RelativeLayout&gt;</code></pre>","128983","","128983","","2010-01-22 17:25:02","2013-01-29 14:45:03","How can I align image vertical center in a Linear Layout","<android>","2","1","","",""
"2113469","1","","","2010-01-21 22:32:47","0","2165","<p>I wrote code that can send http requests in parallel way with multiple threads. The parent thread uses thread.join() to wait for all child threads to finish. But in my code, join() didn't work sometimes. Could someone point out what's wrong with my code? Thanks.</p><pre><code>/** * @param urlSet *            , a set of link URLs (Can not be null) * @return Map&lt;link URL, response in byte array&gt; * @throws InterruptedException */protected Map&lt;String, byte[]&gt; multiProcessRequest(Set&lt;String&gt; urlSet)        throws InterruptedException {    if (urlSet.isEmpty()) {        return null;    }    // Create and initialize HTTP parameters    HttpParams params = new BasicHttpParams();    ConnManagerParams.setMaxTotalConnections(params, MAX_CONNECTIONS);    HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);    // Create and initialize scheme registry    SchemeRegistry schemeRegistry = new SchemeRegistry();    schemeRegistry.register(new Scheme(""http"", PlainSocketFactory            .getSocketFactory(), 80));    // Create an HttpClient with the ThreadSafeClientConnManager.    // This connection manager must be used if more than one thread will    // be using the HttpClient.    ClientConnectionManager cm = new ThreadSafeClientConnManager(params,            schemeRegistry);    m_httpClient = new DefaultHttpClient(cm, params);    List&lt;String&gt; urlList = new ArrayList&lt;String&gt;(urlSet);    // create a thread for each URI    GetThread[] threads = new GetThread[urlSet.size()];    for (int i = 0; i &lt; threads.length; i++) {        HttpGet httpget = new HttpGet(urlList.get(i));        threads[i] = new GetThread(m_httpClient, httpget, i + 1);    }    // start the threads    for (int j = 0; j &lt; threads.length; j++) {        threads[j].start();    }    // join the threads    for (int j = 0; j &lt; threads.length; j++) {        threads[j].join();    }    // FIXME: debug for statement only    for (int j = 0; j &lt; threads.length; j++) {         if (threads[j].isAlive()) {            s_logger.debug(""Thread "" + (j+1) + "" is still alive : "" + threads[j].getState());         }    }    // When HttpClient instance is no longer needed,    // shut down the connection manager to ensure    // immediate deallocation of all system resources    m_httpClient.getConnectionManager().shutdown();    s_logger.debug(""ConnectionManager shutted down."");    /* Prepare the return. */    Map&lt;String, byte[]&gt; urlToResponseMap = new HashMap&lt;String, byte[]&gt;(            threads.length);    for (int i = 0; i &lt; threads.length; ++i) {        urlToResponseMap.put(urlList.get(i), threads[i].getResult());    }    return urlToResponseMap;}/** * A thread that performs a GET. */static class GetThread extends Thread {    private final HttpClient httpClient;    private final HttpContext context;    private final HttpGet httpget;    private final int internalId;    /** The response result of the URL get. */    private byte[] result;    public GetThread(HttpClient httpClient, HttpGet httpget, int id) {        this.httpClient = httpClient;        this.context = new BasicHttpContext();        this.httpget = httpget;        this.internalId = id;    }    public byte[] getResult() {        return result;    }    /**     * Executes the GetMethod and prints some status information.     */    @Override    public void run() {        s_logger.debug(internalId + "" - about to get something from ""                + httpget.getURI());        try {            // execute the method            HttpResponse response = httpClient.execute(httpget, context);            s_logger.debug(internalId + "" - get executed"");            // get the response body as an array of bytes            HttpEntity entity = response.getEntity();            if (entity != null) {                result = EntityUtils.toByteArray(entity);                s_logger.debug(internalId + "" - "" + result.length                        + "" bytes read from "" + httpget.getURI());                s_logger.debug(internalId + "": "" + result);            }        } catch (Exception e) {            httpget.abort();            s_logger.error(internalId + "" - error: "", e);        }    }}</code></pre><p>In the log, I saw these debug messages after running multiProcessRequest():</p><pre><code>D/GetThread:run(  964): 16 - get executedD/GetThread:run(  964): 16 - 9444 bytes read from ......D/dalvikvm(  964): GC freed 675 objects / 463256 bytes in 84msD/GetThread:run(  964): 16: [B@4383add8D/GetThread:run(  964): 17 - get executedD/GetThread:run(  964): 17 - 9000 bytes read from ......D/GetThread:run(  964): 17: [B@437f5240D/GetThread:run(  964): 18 - get executedD/:multiProcessRequest(  964): Thread 18 is still alive : RUNNABLED/:multiProcessRequest(  964): Thread 20 is still alive : RUNNABLED/dalvikvm(  964): threadid=17 wakeup: interruptedD/:multiProcessRequest(  964): ConnectionManager shutted down.D/GetThread:run(  964): 18 - 9427 bytes read from ......D/$GetThread:run(  964): 18: [B@438412e8D/dalvikvm(  964): GC freed 1269 objects / 666456 bytes in 90msW/ExpatReader(  964): DTD handlers aren't supported.D/$GetThread:run(  964): 20 - get executedD/$GetThread:run(  964): 20 - 12751 bytes read ......D/$GetThread:run(  964): 20: [B@43836dc0</code></pre><p>These two lines below showed that two threads were still running after join():</p><pre><code>D/:multiProcessRequest(  964): Thread 18 is still alive : RUNNABLED/:multiProcessRequest(  964): Thread 20 is still alive : RUNNABLE</code></pre>","256239","","996493","","2012-04-30 11:12:02","2012-04-30 11:12:02","thread join not working in Android?","<java><android>","1","0","","",""
"2113638","1","2186772","","2010-01-21 23:01:25","9","5259","<p>I have a series of OpenGL-ES calls that properly render a triangle and texture it with alpha blending on the emulator (2.0.1). When I fire up the same code on an actual device (Droid 2.0.1), all I get are white squares.</p><p>This suggests to me that the textures aren't loading, but I can't figure out why they aren't loading. All of my textures are 32-bit PNGs with alpha channels, under res/raw so they aren't optimized per the <a href=""http://developer.android.com/guide/topics/graphics/2d-graphics.html"">sdk docs</a>.</p><p>Here's how I am loading my textures:</p><pre><code>private void loadGLTexture(GL10 gl, Context context, int reasource_id, int texture_id){    //Get the texture from the Android resource directory    Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), reasource_id, sBitmapOptions);    //Generate one texture pointer...    gl.glGenTextures(1, textures, texture_id);    //...and bind it to our array    gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[texture_id]);    //Create Nearest Filtered Texture    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);    //Different possible texture parameters, e.g. GL10.GL_CLAMP_TO_EDGE    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);    //Use the Android GLUtils to specify a two-dimensional texture image from our bitmap    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);    //Clean up    bitmap.recycle();}</code></pre><p>Here's how I am rendering the texture:</p><pre><code>        //Clear    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    //Enable vertex buffer    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);        gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);        gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer);        //Push transformation matrix        gl.glPushMatrix();        //Transformation matrices        gl.glTranslatef(x, y, 0.0f);        gl.glScalef(scalefactor, scalefactor, 0.0f);        gl.glColor4f(1.0f,1.0f,1.0f,1.0f);        //Bind the texture        gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[textureid]);        //Draw the vertices as triangles        gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_BYTE, indexBuffer);        //Pop the matrix back to where we left it        gl.glPopMatrix();            //Disable the client state before leaving    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);    gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);</code></pre><p>And here are the options I have enabled:</p><pre><code>        gl.glShadeModel(GL10.GL_SMOOTH);            //Enable Smooth Shading        gl.glEnable(GL10.GL_DEPTH_TEST);            //Enables Depth Testing        gl.glDepthFunc(GL10.GL_LEQUAL);             //The Type Of Depth Testing To Do        gl.glEnable(GL10.GL_TEXTURE_2D);        gl.glEnable(GL10.GL_BLEND);        gl.glBlendFunc(GL10.GL_SRC_ALPHA,GL10.GL_ONE_MINUS_SRC_ALPHA);</code></pre><p>Edit: I just tried supplying a BitmapOptions to the BitmapFactory.decodeResource() call, but this doesn't seem to fix the issue, despite manually setting the same preferredconfig, density, and targetdensity.</p><p>Edit2: As requested, here is a screenshot of the emulator working. The underlaying triangles are shown with a circle texture rendered onto it, the transparency is working because you can see the black background.</p><p><img src=""http://img706.imageshack.us/img706/7177/emulatorworking.png"" alt=""alt text""></p><p>Here is a shot of what the droid does with the exact same code on it:<img src=""http://img94.imageshack.us/img94/9105/droidnotworking.png"" alt=""alt text""></p><p>Edit3:Here are my BitmapOptions, updated the call above with how I am now calling the BitmapFactory, still the same results as below:sBitmapOptions.inPreferredConfig = Bitmap.Config.RGB_565;</p><pre><code>sBitmapOptions.inDensity = 160;sBitmapOptions.inTargetDensity = 160;sBitmapOptions.inScreenDensity = 160;sBitmapOptions.inDither = false;sBitmapOptions.inSampleSize = 1;sBitmapOptions.inScaled = false;</code></pre><p>Here are my vertices, texture coords, and indices:</p><pre><code>    /** The initial vertex definition */    private static final float vertices[] = {                                         -1.0f, -1.0f, 0.0f,                                         1.0f, -1.0f, 0.0f,                                        -1.0f, 1.0f, 0.0f,                                        1.0f, 1.0f, 0.0f                                                        };    /** The initial texture coordinates (u, v) */   private static final float texture[] = {                                                //Mapping coordinates for the vertices                                    0.0f, 1.0f,                                    1.0f, 1.0f,                                    0.0f, 0.0f,                                    1.0f, 0.0f                                    };/** The initial indices definition */   private static final byte indices[] = {                                        //Faces definition                                        0,1,3, 0,3,2                                        };</code></pre><p>Is there anyway to dump the contents of the texture once it's been loaded into OpenGL ES? Maybe I can compare the emulator's loaded texture with the actual device's loaded texture?</p><p>I did try with a different texture (the default android icon) and again, it works fine for the emulator but fails to render on the actual phone.</p><p>Edit4: Tried switching around when I do texture loading. No luck. Tried using a constant offset of 0 to glGenTextures, no change.</p><p>Is there something that I'm using that the emulator supports that the actual phone does not?</p><p>Edit5: Per Ryan below, I resized my texture from 200x200 to 256x256, and the issue was NOT resolved.</p><p>Edit: As requested, added the calls to glVertexPointer and glTexCoordPointer above. Also, here is the initialization of vertexBuffer, textureBuffer, and indexBuffer:</p><pre><code>ByteBuffer byteBuf = ByteBuffer.allocateDirect(vertices.length * 4);byteBuf.order(ByteOrder.nativeOrder());vertexBuffer = byteBuf.asFloatBuffer();vertexBuffer.put(vertices);vertexBuffer.position(0);byteBuf = ByteBuffer.allocateDirect(texture.length * 4);byteBuf.order(ByteOrder.nativeOrder());textureBuffer = byteBuf.asFloatBuffer();textureBuffer.put(texture);textureBuffer.position(0);indexBuffer = ByteBuffer.allocateDirect(indices.length);indexBuffer.put(indices);indexBuffer.position(0);loadGLTextures(gl, this.context);</code></pre>","164980","","164980","","2010-01-27 22:01:12","2011-05-18 18:05:22","Trying to draw textured triangles on device fails, but the emulator works. Why?","<android><opengl-es>","7","7","6","",""
"2113708","1","","","2010-01-21 23:09:27","4","638","<p>I created a simple Animation-derived class and added an onclick listener to a view (a LinearLayout in this example, just to make a quick proof-of-concept) that called startAnimation on the object (passing it an instance of my class).  In my Animation class, I simply get a reference to the Translation's Matrix object and call setTranslate.  So, the translation looks fine, but if I attempt to click again where I now see the object (the translated location), nothing happens.  If I go back to the original location and click, it repeats the same animation from the same starting point.  I was under the impression that the translation would actually translate the object itself and not just the visual representation.  Is there a way to do what I was expecting to happen with an animation class?  Or, is there some other standard way of doing this sort of thing?  Any insight into why this behavior is the way it is?  Thanks.</p>","53501","","","","","2012-06-04 12:10:49","Matrix.setTranslate() only translates the visual surface of the View and not the clickable area?","<java><android><animation>","2","0","","",""
"2113931","1","","","2010-01-21 23:54:32","0","126","<p>I have a <code>CustomListActivity</code> which I wish to expose two facets of the same data.</p><p>For example: I have a list of cars, and would like to list the set of colors, and the set of models. These would be filtered on mimetype from my <code>ContentProvider</code>:</p><p>org.acme.cars.cursor.dir/colors  org.acme.cars.cursor.dir/models</p><p>My <code>CustomListActivity</code> is quite involved, but general enough to be re-used, but:</p><ul><li>the user should be able to swap between the two lists from a menu/button bar</li><li>the list is MAIN LAUNCHER intent.</li><li>the user's choice of facet (model or color) should be remembered</li><li>we should be able to call these activities via mimetype.</li></ul><p>So, my question is: </p><p><strong>Can I declare two activities in the AndroidManifest.xml, each one with the same class, parameterizing it, or do I need to use some switch from within the class?</strong></p>","4737","","","","","2010-08-07 22:40:41","How do I parameterize an Activity from within AndroidManifest.xml","<android><activity>","2","0","","",""
"2114168","1","","","2010-01-22 00:47:47","0","3622","<p>So our app has the option to take either a picture or a video. If the user takes a picture, we can use the MediaStore.Images.Media.insertImage function to add the new image (via a filepath) to the phone's gallery and generate a content:// style URI. Is there a similar process for a captured video, given that we only have it's filepath?</p>","256322","","","","","2014-04-15 14:46:04","Android MediaStore insertVideo","<android><video><mediastore>","5","1","0","",""
"2114312","1","2115685","","2010-01-22 01:22:14","2","2586","<p>In order to persist state in my android app, so that the user will return to the activity they left off at, i've set the very useful flag alwaysRetainTaskState in my manifest:</p><pre><code>&lt;activity android:name="".Main""              android:label=""@string/app_name""              android:alwaysRetainTaskState=""true""&gt;         &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>This gets the job done, or so I thought; I discovered that the system can still destroy my app's activities to preserve memory, while still keeping state. To verify this, I wrote a little test app that creates a whole bunch of activities in a loop to see if my app's activities would be destroyed. Sure enough, the system destroys my activities.</p><p>With some reading, I found that I need to use onSaveInstanceState() and onRestoreInstanceState() to help maintain activity state. </p><p>To get to my question, let's say I have an Activity with a number of global variables, some of them are static and some aren't. They consist of booleans, arraylists, strings, etc. My issue is that I am confused which of these variables are persistent when an activity is destroyed. Which ones should I package into the bundle in onSaveInstanceState()? Does the system do anything to these variables when an activity is destroyed?</p>","236300","","","","","2010-01-22 07:20:07","Android persistent state with global variables when system kills activities","<java><android><android-intent>","1","0","1","",""
"2114367","1","","","2010-01-22 01:33:43","3","354","<p>There is a given set of predefinied Views that can be used in layouts for AppWidgets. How can a customized View added to this list?The minimum requirement is that the class is annotated with RemoteView. What else is necessary to be acceptable as view in the layout.xml?</p>","256342","","","","","2010-06-30 16:50:20","How to create customized Views for AppWidgets?","<android>","1","0","","",""
"2114380","1","2114460","","2010-01-22 01:37:35","8","11620","<p>The code below does NOT change the text of all of a ListView's rows because ""getChildCount()"" does not get all of a ListView's rows, but just the rows that are visible.   </p><pre><code>for (int i = 0; i &lt; listView.getChildCount(); i++){    View v = listView.getChildAt(i);    TextView tx = (TextView) v.findViewById(R.id.mytext);    tx.setTextSize(newTextSize);}</code></pre><p>So, what SHOULD I do?  Is there code for getting a notification when a ListView's row becomes visible, so I can set its text size then?</p>","9328","","","","","2010-01-22 06:21:42","In an android ListView, how can I iterate/manipulte all the child views, not just the visible ones?","<android><android-widget>","2","1","3","",""
"2114385","1","2114685","","2010-01-22 01:38:36","2","4301","<p>Would it be possible to provide a emulator image that has all the Google apps that come with real devices, like Gmail etc? I don't have access to a 2.0 device which makes it close to impossible for me to develop/debug apps which uses AccountManager etc.</p>","253583","","","","","2010-01-22 03:29:15","Use Google apps in the emulator","<android>","3","0","4","",""
"2114498","1","","","2010-01-22 02:08:26","2","239","<p>I would like to know which applications the user has started within the last, say, 24hours. Is this possible?</p>","256342","","14860","","2010-01-22 02:12:29","2010-01-22 02:27:54","Is there a way to monitor and record which applications have started recently?","<android>","1","0","","",""
"2115227","1","","","2010-01-22 05:24:55","2","739","<p>Could someone explain how to use the <a href=""http://developer.android.com/reference/java/util/Timer.html#schedule%28java.util.TimerTask,%20java.util.Date%29"" rel=""nofollow"">Timer.schedule</a> - that is used for scheduling tasks - in <a href=""http://code.google.com/p/android-scripting/wiki/PythonAndroidAPI"" rel=""nofollow"">Python</a>?</p><p>Note that Python's <code>time.sleep</code> will not work in Android.</p>","55246","","20760","","2011-02-23 21:25:28","2011-05-27 12:10:23","Using Android's `Timer.schedule` in Python","<python><android><timer><android-scripting>","1","0","","",""
"2115319","1","2117134","","2010-01-22 05:47:32","1","134","<p>I'm trying to figure out which URL I was directed to. I'm using the following code and it seems to hide the redirect.</p><pre><code>HttpPost httpPost = new HttpPost(url);DefaultHttpClient httpclient = new DefaultHttpClient();HttpResponse response = httpclient.execute(httpPost);</code></pre><p>Thanks,Erik</p>","247325","","247325","","2010-03-10 00:30:36","2010-03-10 00:30:36","How do I see which URL I was redirected to?","<java><android><http>","1","0","","",""
"2115519","1","","","2010-01-22 06:39:48","2","1146","<p>We are utilizing the Intent.ACTION_IMAGE_CAPTURE for taking a new picture from within our app. However, we would like to force geo-tagging of the pictures. Is there a way to set the intent to do this or does it rely solely on the default Camera app's setting to ""Store Location""?</p><p>(Also, it would be nice if this worked for the ACTION_VIDEO_CAPTURE intent as well...)</p>","256322","","","","","2010-01-22 06:39:48","Android Camera Intent Geo-Tagging","<android><geolocation><camera><android-intent>","0","1","1","",""
"2115710","1","","","2010-01-22 07:25:27","1","1008","<p>while activity loading if user shake the handset my activity was crashign to fix this i added</p><pre><code>android:configChanges=""keyboardHidden|orientation""</code></pre><p>to my activity, after that my activity stopped crashing and not calling oncreate again only changing then UI orientation, now i want to load images from drawable-land while orientation change how can i do it ?</p>","216431","","","","","2010-01-22 07:25:27","android orientation change","<android><orientation>","0","3","1","",""
"2115758","1","","","2010-01-22 07:37:11","90","141962","<p>I want to display dialog/popup window of ""Are you sure you want to delete this entry?"" on click of button <code>Delete</code>. If I press ""ok"" it should delete that entry otherwise nothing.</p><p>I have written a click listener of those buttons but I dont know how to invoke dialog or popup and its functionality.</p>","249991","","436938","","2013-03-01 11:41:26","2014-04-13 18:03:24","how to display Alert Dialog in android?","<android><android-dialog>","7","1","26","","2010-01-22 07:37:11"
"2115872","1","2117168","","2010-01-22 08:09:56","1","434","<p>I was trying to override the back button functionality where I wanted to call the default functionality in case a boolean is set false</p><pre><code>public boolean onKeyDown(int keyCode, KeyEvent event) {        boolean temp = false;        if (event.KEYCODE_BACK == keyCode) {            System.out.println(""Back pressed"");            if (isTrue) {                //Do something                return true;            }            else return false;        }        return false;    }</code></pre><p>Now this doesn't exactly work how the documentation states. the <code>//Do Something</code> part is executed well, but when <code>isTrue</code> is <code>false</code> i want the default back functionality which is not happening. Im using SDK 1.5</p><p>Now,</p><ol><li><p>How do I fix this?</p></li><li><p>Is this issue fixed in later SDK updates? If not can someone raise a bug for the same?</p></li></ol>","237403","","","","","2010-01-22 12:31:16","onKeyDown() functionality issue","<android>","1","0","","",""
"2115887","1","","","2010-01-22 08:13:53","1","253","<p>I start an Activity from my Widget, which should start a special view.<br/>But if the app is already running (not left with back button), Android instead activates the activity that was last shown.<br/>Is there any flag or other way to avoid this behaviour?<br/>Closing the previous activity wouldn't be a problem in my app, there's no user input that would be lost.<br/>I tried a workaround with finish() in onStop(), but onStop is also invoked when a sub activity (startActivityForResult) is invoked, so returning from there returns to nothing - the app would be closed.</p>","256541","","","","","2011-06-07 14:42:10","How to enforce activity if app is running?","<android><activity>","3","0","","",""
"2116032","1","2116428","","2010-01-22 08:50:06","1","596","<p>How difficult would it be to build an android app that responds to all SMS from a certain number.</p><p>Given a certain regexp on those SMS responds with an answer to a certain number.</p><p>Example input: ""HelloWorld 12345""</p><p>Example regexp: ""([0-9]{5})""</p><p>Example output confif: ""Purchase $2""</p><p>Should give ""Purchase 12345""</p><p>Is this possible to build on Android? Is there perhaps already an app for this?</p>","40939","","14343","","2010-07-14 23:42:41","2010-07-14 23:42:41","Android SMS App","<android>","1","0","2","",""
"2116069","1","","","2010-01-22 08:58:32","1","403","<p>My application shows UI based on events received in various BroacastReceiver .  Since I need to generate view directly from BroadcastReceiver I  use code like this :</p><pre><code>mWindowManager = (WindowManager) context    .getSystemService(Context.WINDOW_SERVICE);    WindowManager.LayoutParams lp = new WindowManager.LayoutParams(        LayoutParams.FILL_PARENT,        LayoutParams.WRAP_CONTENT,        WindowManager.LayoutParams.TYPE_TOAST,         WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE                | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,        PixelFormat.OPAQUE);    TextView view = new TextView(context);    view.setText(""You got Broadcast !"");    mainView = view;     mWindowManager.addView(view, lp); Log.d(""MyApp"","" View shown "")</code></pre><p>This code displays  TextView with text ""You got Broadcast"" properly when I receive BroadcastReceiver event when my main application activity is accessed beforehand. Means if my application is in memory and my main activity has been shown. </p><p>Now when I restart phone and my BroadcastReceiver receives event everything works fine. Infact I can see the debug statement ""MyApp, View shown"" in logcat. But strangely, actual view with text ""You got Broadcast"" does not appear on screen. Now again I launch my main activity and press home button . Now if BroadcastReceiver again receives event, it is now able to show the texview with text ""You got Broadcast""  properly.</p><p>At present I'm not doing anything in main activity apart from showing default generated xml layout. It's dead simple code :</p><pre><code>public class MainActivity extends Activity {public static final String TAG = ""MainActivity"";/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Log.d(TAG, "" Main screen"");}</code></pre><p>}</p><p>Am I missing some screen/graphics initialization  which happens when main activity is launched ?Or do I need to pass on any additional parameter to WindowManager ?</p>","255507","","255507","","2010-01-25 10:41:51","2010-12-02 01:12:35","WindowManager is unable to show Window View on screen even though it's visibility property is true","<android>","1","0","1","",""
"2116082","1","","","2010-01-22 09:00:21","1","1711","<pre><code>    @Overridepublic void onConfigurationChanged(Configuration _newConfig) {    if (_newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {        Toast toast = Toast.makeText(this, ""test orientation_landscape"",                Toast.LENGTH_LONG);        toast.show();        setContentView(R.layout.proceed);    }    if (_newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {        Toast toast = Toast.makeText(this, ""test orientation_portrait"",                Toast.LENGTH_LONG);        toast.show();        setContentView(R.layout.proceed);    }    super.onConfigurationChanged(_newConfig);}</code></pre><p>when i change the emulator orientation, the toast is not shown...?SDK 1.6</p><p>i have set the android manifest config -> orientation</p><p>When the emulator is changed from portrait to landscape, no effect is shown,but from landscape to portrait, works fine.</p><p><strong>If there is any method by which i can keep my app display intact, without any orientation change, when the device is changed in orientation, please let me know that also.</strong></p><p>Advanced Thanks for help.</p>","132347","","132347","","2010-01-22 09:20:23","2010-01-22 09:20:23","Set ORIENTATION_LANDSCAPE not working Android","<android><screen-orientation><setorientation>","0","3","2","",""
"2116158","1","2116202","","2010-01-22 09:14:07","32","6405","<p>I need to replace the current activity with a new one. That is, I want to start a new activity and remove the current activity from the task stack.</p><p>Based on the documentation, it seems the best way would be to start the activity using <a href=""http://developer.android.com/reference/android/app/Activity.html#startActivity%28android.content.Intent%29"">Activity.startActivity</a> as per usual, and then call <a href=""http://developer.android.com/intl/fr/reference/android/app/Activity.html#finish%28%29"">Activity.finish</a> immediately to close the current activity.</p><p>Is this a valid usage of these APIs or should I be doing something else?</p>","3603","","3603","","2010-01-22 09:22:36","2012-04-30 10:57:34","Replace current activity","<android><activity>","2","0","","",""
"2116162","1","2116191","","2010-01-22 09:14:22","186","102362","<p>I have simple HTML:</p><pre><code>&lt;h2&gt;Title&lt;/h2&gt;&lt;br&gt;&lt;p&gt;description here&lt;/p&gt;</code></pre><p>I want to display it in <code>TextView</code>. How to do this???</p><p>Any help would be appreciated.</p>","249991","","56285","","2013-11-14 17:40:43","2014-04-16 15:47:26","How to display HTML in TextView?","<android><html><android-textview>","4","2","43","","2010-01-22 09:14:22"
"2116260","1","2116293","","2010-01-22 09:33:45","12","12716","<p>Is there any way of retrieving log messages from an Android handset.</p><p>I'm building an application which uses the GPS of my HTC Hero. I can run and debug the application from eclipse but this isn't a good use case of GPS, sat at my desk.</p><p>When I fire the app up when I am walking around, I get an intermittent exception. Is there anyway I can output these exceptions to a text file on the SD card or output calls to <code>Log.x("""")</code> to a text file so that I can see what the exception is.</p><p>Thanks</p><p><strong>EDIT : Solution</strong></p><p>Here is the code I finally went with...</p><pre><code>Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {    @Override    public void uncaughtException(Thread thread, Throwable ex) {    PrintWriter pw;    try {        pw = new PrintWriter(                new FileWriter(Environment.getExternalStorageDirectory()+""/rt.log"", true));        ex.printStackTrace(pw);        pw.flush();        pw.close();    } catch (IOException e) {        e.printStackTrace();    }}});</code></pre><p>I had to wrap the line </p><pre><code>pw = new PrintWriter(new FileWriter(Environment.getExternalStorageDirectory()+""/rt.log"", true));</code></pre><p>in a try/catch as Eclipse would not let me compile the app. It kept saying </p><blockquote><pre><code>Unhandled exception type IOException1 quick fix    Sorround with try/catch</code></pre></blockquote><p>So I did and it all works which is fine by me but it does make me wonder what Eclipse was on about...</p>","1741868","","1741868","","2010-01-22 20:32:51","2013-05-09 12:36:17","Logging to a file on Android","<android><logging>","5","2","6","",""
"2116493","1","2116692","","2010-01-22 10:14:52","1","12864","<p>Im new on Android, and im trying to start an Activity from a MenuItem choose of the user.</p><p>Actually, im building my menu (and is working ok) from my main activity class using a MenuInflater:</p><pre><code> @Override    public boolean onCreateOptionsMenu(Menu menu)     {        super.onCreateOptionsMenu(menu);        //the Menu Inflater class allows to create a menu from a XML File        MenuInflater inflater = new MenuInflater(this);        inflater.inflate(R.layout.menutest,menu);        return true;    }</code></pre><p>And im handling the Menu selection using the following code (working fine too):</p><pre><code>public boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId())     {        case R.id.MenuItemNewWebsite:            ShowScreenAddSite();        break;        default:            break;    }    return false;}  </code></pre><p>I have a second and last activity called AddWebsite, and i would like to start it, but the following code doesnt work:</p><pre><code>protected void ShowScreenAddSite(){    Intent i = new Intent(AddWebsite.class);    startActivity(i);}</code></pre><p>Do you know what is the extra thing that i have to pass to the Intent constructor?Thanks in advance.Best Regards.Jose</p>","79919","","1030113","","2012-09-15 05:25:50","2012-09-15 05:25:50","Android: Start activity from a MenuItem","<android><htc>","3","0","","",""
"2116556","1","2208540","","2010-01-22 10:25:30","2","805","<p>I would like my application icon to be available to other applications.</p><p>I understand this is a bit unclear so will try explain:</p><p>Applications such as Astros program manager lists applications with their icon.  For all apps this is the correct icon as on the launcher, except mine which is displaying the standard android icon.  I have set my icon as the manifest using: <code>android:icon=""@drawable/runninglate""</code></p><p>This works on the launcher but Astro still shows the default icon from when I create the project (which I deleted a long time ago).  I have also tried renaming my icon file to icon.png in case this was a standard.  This also failed to work.</p><p>I am clearly doing something wrong, or have missed a setting somewhere, can some one point me in the right direction.</p>","238174","","","","","2010-05-25 17:15:32","Make android app icon available to other applications","<android><icons><manifest>","2","0","","",""
"2116592","1","2117537","","2010-01-22 10:30:29","1","805","<p>In a RelativeLayout I have a Button to the right of a TextView.  The problem is that the text view gets squished to the left of the screen.  I want the Button to be squished to the right and the TextView take up all the remaining space.  I can't use 'Fill Layout' on the TextView because the button then gets removed from the View completely.</p><p>How do I do this?</p>","248521","","","","","2012-04-30 10:55:42","Relative Layout and a Button to the left of a TextView - Squishing problem","<android>","1","0","","",""
"2116622","1","","","2010-01-22 10:35:02","0","661","<p>I want to create a java.util.map in android from a resource. I want to do this because I have a lot of entries to populate into the java.util.map and I want to store the values in the res folder of the project in xml format.</p><p>Is there an effecient way to do this in android? My map will have around 2500 entries so I want to do this as effeciently as possible and I don't want to hard code them...</p><p>Thanks,Gaz</p>","119396","","","","","2010-01-22 10:53:06","Creating java.util.Map in Android","<android><map>","1","0","1","",""
"2116910","1","2458150","","2010-01-22 11:36:56","4","3848","<p>SoundPool works properly on Android 1.6 but when I run on 2.1 in the Emulator I am getting a ""sample 2 not READY"" error message everytime I try to play a sound.</p><p>How do I fix this?</p>","248521","","","","","2013-02-18 17:47:40","WARN/SoundPool sample 2 not READY","<android>","3","0","0","",""
"2117001","1","","","2010-01-22 11:57:20","1","541","<p>textNoSuggestions is ignored by 2.0.1 emulator...am I doing something wrong?  I am using the stock settings which has a 12 key softkeyboard.</p>","248521","","","","","2011-10-31 10:21:54","textNoSuggestions is ignored by 2.0.1 emulator","<android>","1","3","1","",""
"2117135","1","","","2010-01-22 12:24:57","0","1231","<p>I have followed all the necessary installation and setup steps for Eclipse 3.4 + ADT + Android SDK on <strong>Windows 7</strong>. I followed the Hello, Android tutorial in Eclipse and code-completion also works like a charm. No errors shown.</p><p>unfortunately the emulator never shows up. When I run the project. I have fullfilled the same steps in a virtual Windows XP machine and - though very slow - it does work there.</p><p>I have not found anything about known problems with Windows 7. What can I do?</p>","256710","","","","","2010-01-22 15:22:50","Developing for Android on Windows 7 using Eclipse","<android><eclipse><windows-7>","3","3","","",""
"2117565","1","2118023","","2010-01-22 13:46:29","18","14347","<p>I'm currently building my first app for Android. What I'm having trouble with is the storage and localized display of dates in connection with a <code>SimpleCursorAdapter</code>. I have a class that encapsulates access to an <code>SQLitedatabase</code>  with three tables. This class takes care of storing all dates in ISO format (""yyyy-MM-dd""). When the date values are read from the database and displayed on the screen I want them to be formatted in a localized format. Here's the approach I've come up with. It uses a <code>ViewBinder</code> to do the formatting:</p><pre><code>adapter.setViewBinder(new SimpleCursorAdapter.ViewBinder() {    @Override    public boolean setViewValue(View view, Cursor cursor,            int columnIndex) {        if (view.getId() == R.id.text1) {            ((TextView) view).setText(getDateFormatView().format(                parseDatabaseDate(cursor.getString(columnIndex))));            return true;        } else if (view.getId() == R.id.text2) {            ((TextView)view).setText(                cursor.getString(columnIndex));          return true;        } else {            return false;        }    }});</code></pre><p><code>getDateFormatView()</code> creates a <code>SimpleDateFormat</code> object with a pattern that is read from <code>strings.xml</code>. <code>parseDatabaseDate()</code> does the parsing of the date from the database with a <code>SimpleDateFormat</code> that is constructed using a constant pattern <code>yyyy-MM-dd</code>.</p><p>Although this code works just fine I'm wondering if there is a better way to do that. What I don't like is that I need:</p><ul><li>two <code>SimpleDateFormat</code> objects (one is used in <code>parseDatabaseDate()</code> in order to parse the date string from the <code>SQLiteDatabase</code>, the other is used to format the value)</li><li>a <code>java.util.Date</code> object that is created then thrown away immediately</li><li>quite a lot of (in my opinion) boilerplate code.</li></ul><p>So that's why I'm asking: is there a better way to display dates in localized format?</p>","143531","","493939","","2012-06-03 07:19:07","2012-06-03 07:19:07","Displaying dates in localized format on Android","<android><localization><internationalization><android-viewbinder>","1","0","9","",""
"2118251","1","2119625","","2010-01-22 15:24:23","16","4825","<p>I have theme that specifies textColor for TextView as red.</p><p>I am using LayoutInflater to instantiate TextView. The problem is that styles are not applied to TextView when inflater created using ApplicationContext - the color is not red. All works fine when LayoutInflater created using activity.</p><p>Why this happens, and how can be fixed?</p><p>/res/values/styles.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;style name=""MyTheme""&gt;        &lt;item name=""android:textViewStyle""&gt;@style/MyTextView&lt;/item&gt;    &lt;/style&gt;    &lt;style name=""MyTextView"" parent=""@android:style/Widget.TextView""&gt;        &lt;item name=""android:textColor""&gt;#f00&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>AndroidManifest.xml:</p><pre><code>&lt;application     android:icon=""@drawable/icon""     android:label=""@string/app_name""    android:theme=""@style/MyTheme""    &gt;</code></pre><p>Code:</p><pre><code>public class A extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.test_a);        final LayoutInflater goodInflater = getInflater((Activity)this);         final LayoutInflater badInflater = getInflater(getApplicationContext());        final LinearLayout container = (LinearLayout)findViewById(R.id.container);        findViewById(R.id.add_with_appContext).setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                add(container, badInflater); // Creates gray TextView            }                    });        findViewById(R.id.add_with_activity).setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                add(container, goodInflater); // Creates red TextView            }                    });    }    private LayoutInflater getInflater(Context context) {        return (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    }    private void add(LinearLayout container, LayoutInflater inflater) {        inflater.inflate(R.layout.my_template, container, true);    }}</code></pre><p>/res/layout/test_a.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""&gt;    &lt;Button         android:text=""Add with AppContext""         android:id=""@+id/add_with_appContext""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         /&gt;    &lt;Button         android:text=""Add with Activity""         android:id=""@+id/add_with_activity""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         /&gt;    &lt;LinearLayout        android:id=""@+id/container""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""vertical""          /&gt;&lt;/LinearLayout&gt;</code></pre><p>/res/layout/my_template.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    &gt;    &lt;TextView        android:id=""@+id/text""        android:text=""Some text...""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""    /&gt;&lt;/LinearLayout&gt;</code></pre>","62192","","","","","2010-01-23 15:25:52","Theme/Style is not applied when inflater used with ApplicationContext","<android><coding-style><themes>","1","0","3","",""
"2118427","1","2118436","","2010-01-22 15:49:00","2","3987","<p>I have a brand new Nexus One.  I'm trying to follow the directions for <a href=""http://developer.android.com/guide/developing/device.html"" rel=""nofollow"" title=""Developing on a Device"">installing the USB driver</a>.  When I plug in the device, it doesn't start the New Hardware Wizard, as the documentation suggests.  I can run hdwwiz.exe to launch it and manually install the driver, but when I do, Device Manager says: ""This device cannot start. (Code 10)""</p><p>What am I doing wrong here?</p>","54829","","","","","2010-08-11 13:09:36","Can't debug Android: This device cannot start. (Code 10)","<android><debugging><usb>","2","0","","",""
"2118606","1","2134030","","2010-01-22 16:12:46","1","977","<p>Running Titanium Appcelerator 0.8.1 on a Windows XP Virtual Machine, with Android SDK 2.1</p><p>When running build/install app, getting the following error (last line broken for display here):</p><pre><code>[TRACE] f = open(os.path.join(dest, dest_file), ""w"")[TRACE] IOError: [Errno 13] Permission denied:  'C:\\Documents and Settings\\firstname.surname\\Desktop\\MyApp\\build\\android\\.classpath'</code></pre><p>Removing .classpath results in .classpath being created, but the error simply moves  onto the next file it has to write to.</p><p>The files are in a git repository, checked out via msysgit, but the same error occurs when the files are copied directly from the git server to the Windows machine. Unfortunately the Titanium dev app won't rebuild the Android package for an existing app if the build\android files are missing, so it's not possible just to not check these into git.</p><p>The files appear to have the correct permissions - are writable by the current user account, don't have the read-only flag set (checked via 'attrib'), and have set the access options and owner via the Security/Advanced dialogues on the files and directories (and checked by a Windows IT admin here)</p><p>As far as I can tell, nothing else has the file open (a possible cause of IOError 13).</p><p>What could be the reason here? Could Git be the culprit?</p>","89093","","600500","","2011-09-04 15:35:06","2011-09-04 15:35:06","Why do I get a Windows file permission error (IO Error 13) with Android SDK when writing to files starting with a dot?","<windows><git><android><titanium><appcelerator>","1","0","","",""
"2118815","1","","","2010-01-22 16:42:08","2","7372","<p>It is possible to put any view over a VideoView? (I.e. put the control buttons over the video, like in vimeo). I'm trying to do it using FrameLayout, but I have not found the way, and I'm still not sure if what I'm trying to do something that's is simply not possible.</p>","256905","","","","","2010-04-14 08:00:03","Put any View over a VideoView in Android","<android><overlay><android-widget><videoview>","2","0","2","",""
"2118946","1","","","2010-01-22 17:00:39","6","4745","<p>Is there anyone using Flurry to generate reports for uncaught exceptions that could post some sample code on how to do this?</p><p>I don't see any example via Flurry themselves, and though I've seen code samples of custom exception reporters, I haven't seen a simple example of how to implement the basic error reporting just using Flurry.</p><p>Thanks.</p>","242869","","","","","2012-09-28 15:28:27","Flurry Error Reporting for Android","<android>","6","0","5","",""
"2118963","1","2119045","","2010-01-22 17:02:04","1","603","<p>I am curious if there is a way to bind more then one db column to a resource. I need to bind more information to R.id.secondLine then just the difficulty column. But I'm unsure how to go about this? I'm currently subclassing SimpleCursorAdapter. Should I subclass another adapter? If so How to do I go about it?</p><pre><code>    Cursor activityHikes = mDbAdapter.fetchAllHikes(false);    startManagingCursor(activityHikes);    String[] from = new String[] { ActivityHike.NAME, ActivityHike.DIFFICULTY, ActivityHike.THUMBNAIL};    int[] to = new int[]{R.id.mainText, R.id.secondLine, R.id.icon};    HikeAdapter hikes = new HikeAdapter(this, R.layout.hike_row, activityHikes, from, to);    ListView list = (ListView) this.findViewById(R.id.hikelist);    list.setAdapter(hikes);</code></pre><p>Thanks</p><p>For anyone who has this same problem this link helped me alot too.<a href=""http://stackoverflow.com/questions/1505751/android-binding-data-from-a-database-to-a-checkbox-in-a-listview"">http://stackoverflow.com/questions/1505751/android-binding-data-from-a-database-to-a-checkbox-in-a-listview</a></p>","255123","","255123","","2010-01-22 18:14:35","2010-01-22 18:14:35","How to bind more then one column to a textview","<android><sqlite>","2","0","","",""
"2119060","1","4663831","","2010-01-22 17:15:52","16","25149","<p>I currently have code that reads a recording in from the devices mic using the AudioRecord class and then playing it back out using the AudioTrack class.</p><p>My problem is that when I play it out it plays via the speaker phone.</p><p>I want it to play out via the ear piece on the device.</p><p>Here is my code:</p><pre><code>public class LoopProg extends Activity { boolean isRecording; //currently not used AudioManager am; int count = 0; /** Called when the activity is first created. */ @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);        am.setMicrophoneMute(true);        while(count &lt;= 1000000){        Record record = new Record();          record.run();        count ++;        Log.d(""COUNT"", ""Count is : "" + count);        }    }    public class Record extends Thread{      static final int bufferSize = 200000;      final short[] buffer = new short[bufferSize];      short[] readBuffer = new short[bufferSize];      public void run() {        isRecording = true;      android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);      int buffersize = AudioRecord.getMinBufferSize(11025, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT);      AudioRecord arec = new AudioRecord(MediaRecorder.AudioSource.MIC, 11025, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, buffersize);      AudioTrack atrack = new AudioTrack(AudioManager.STREAM_MUSIC, 11025, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, buffersize, AudioTrack.MODE_STREAM);      am.setRouting(AudioManager.MODE_NORMAL,1, AudioManager.STREAM_MUSIC);      int ok = am.getRouting(AudioManager.ROUTE_EARPIECE);      Log.d(""ROUTING"", ""getRouting = "" + ok);      setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);      //am.setSpeakerphoneOn(true);      Log.d(""SPEAKERPHONE"", ""Is speakerphone on? : "" + am.isSpeakerphoneOn());      am.setSpeakerphoneOn(false);      Log.d(""SPEAKERPHONE"", ""Is speakerphone on? : "" + am.isSpeakerphoneOn());      atrack.setPlaybackRate(11025);      byte[] buffer = new byte[buffersize];      arec.startRecording();      atrack.play();      while(isRecording) {                         arec.read(buffer, 0, buffersize);                         atrack.write(buffer, 0, buffer.length);                         }      arec.stop();      atrack.stop();      isRecording = false;      }   } }</code></pre><p>As you can see if the code I have tried using the AudioManager class and its methods including the deprecated setRouting method and nothing works, the setSpeakerphoneOn method seems to have no effect at all, neither does the routing method.</p><p>Has anyone got any ideas on how to get it to play via the earpiece instead of the spaker phone?</p>","243999","","1055764","","2013-05-29 11:40:40","2014-01-18 03:51:17","Android - Getting audio to play through earpiece","<android><audio><route>","6","0","17","",""
"2119072","1","2284973","","2010-01-22 17:17:28","17","15661","<p>I have an EditText that shows time. After user clicks the EditText I want to show a TimePickerDialog, so I set a View.OnClickListener to my EditText. But the OnClickListener is behaving wierdly - I touch the EditText and then software keyboard appears (which I don't want). When I touch again, OnClickListener.onClick() is finally called and the dialog appears.</p><p>What should I do if I want the dialog to appear immediately?</p>","243225","","","","","2012-08-28 17:38:12","Android: How to do something after user clicks on my EditText","<android>","5","0","2","",""
"2119081","1","","","2010-01-22 17:19:05","0","544","<p>I have a comment activity that loads a Thread and sends some data to a server, the activity is immediately finished once the submit button is pressed.  The user is then free to do other things in my application.</p><p>When the server response an AlertDialog is shown.</p><p>The problem is that since the initial Context has been destroyed, my application crashes.  I tried getApplicationContext() but still get an exception.</p>","248521","","","","","2010-01-22 18:38:03","Loading an Alert Box from a Thread when the activity has gone away","<android>","2","0","","",""
"2119248","1","2119308","","2010-01-22 17:43:53","0","1343","<p>Let me explain with example... Consider 'android.R.layout.simple_list_item_multiple_choice'. It used to create multi-select lists. But the only definitions I found:</p><p>/platform/frameworks/base/core/res/res/values/public.xml:</p><pre><code>&lt;public type=""layout"" name=""simple_list_item_multiple_choice"" id=""0x01090010"" /&gt;</code></pre><p>/platform/frameworks/base/api/current.xml:</p><pre><code>&lt;field name=""simple_list_item_multiple_choice"" type=""int"" transient=""false"" volatile=""false"" value=""17367056"" static=""true"" final=""true"" deprecated=""not deprecated"" visibility=""public""&gt;</code></pre><p>But where is actual layout defined? When multi-select list created I see checkbox, where it comes from?</p>","62192","","","","","2010-01-22 17:52:27","Where definitions in public.xml are linking to?","<android>","1","0","1","",""
"2119448","1","2119941","","2010-01-22 18:16:56","1","655","<p>The normal way how AutoCompleteTextView shows suggestions, is that it shows only strings that begin with the text the user entered, but the sort order of the results is undefined. Can I somehow sort them by myself? So that when user enters e.g. ""g"", I show him results beginning with ""g"" that are most relevant for him.</p>","243225","","","","","2010-01-22 19:39:28","Android: AutoCompleteTextView - how to customize sort order","<android>","1","0","1","",""
"2119701","1","2121580","","2010-01-22 19:00:32","7","6332","<p>I have a simple LinearLayout with one TextView and one ImageView. I want the text in the TextView to be aligned to the right, but the result show that the Text was aligned to the left. Is there anything wrong with my layout xml? Thanks.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:background=""#E8E3E4""&gt;    &lt;LinearLayout android:orientation=""horizontal""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        &gt;        &lt;TextView android:layout_width=""260dp"" android:layout_height=""wrap_content""            android:text=""More Comments"" android:textStyle=""bold"" android:background=""#ff0000""            android:textColor=""#121222"" android:layout_gravity=""right"" /&gt;        &lt;ImageView android:layout_width=""50dp""            android:layout_height=""wrap_content"" android:src=""@drawable/arrow_right""            android:layout_gravity=""center"" android:scaleType=""centerInside"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><hr><p>Thanks, Michael. But the workaround you mentioned doesn't work either.</p><p>I tried to use RelativeLayout, but it still gave me result like:More Comments             (Icon)</p><p>What I expected is             More Comments (Icon)</p><p>The RelativeLayout xml is below. Is there anything wrong with it?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;TextView android:id=""@+id/label"" android:layout_width=""260dp""        android:layout_height=""wrap_content"" android:text=""More Comments""        android:textStyle=""bold"" android:background=""#ff0000""        android:textColor=""#121222"" android:layout_gravity=""right"" /&gt;    &lt;ImageView android:layout_width=""50dp"" android:layout_height=""wrap_content""        android:src=""@drawable/arrow_right"" android:layout_gravity=""center""        android:scaleType=""centerInside"" android:layout_toRightOf=""@id/label"" /&gt;&lt;/RelativeLayout&gt;</code></pre><hr><p>Following the workaround in Michael's comment, I have the XML below. I expected the output to be:</p><pre><code>     RightLeft</code></pre><p>but the actual output is:</p><pre><code>Right             Left</code></pre><p>So the workaround doesn't work for me. Any thoughts?</p><p></p><p></p><pre><code>   &lt;LinearLayout android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""&gt;           &lt;TextView                   android:layout_width=""wrap_content""                   android:layout_height=""wrap_content""                   android:layout_gravity=""right""                   android:layout_weight=""1.0""                                          android:text=""RIGHT""/&gt;           &lt;TextView                   android:layout_width=""wrap_content""                   android:layout_height=""wrap_content""                   android:layout_gravity=""left""                   android:text=""LEFT""/&gt;   &lt;/LinearLayout&gt;</code></pre><p> </p>","256239","","102937","","2011-09-14 03:52:10","2013-02-03 22:17:34","android:layout_gravity doesn't work as expected","<java><android>","4","5","","",""
"2119947","1","","","2010-01-22 19:39:57","8","3129","<p>I am trying to stream video (or use progressive download) to a Motorola Droid Browser and am not having a lot of luck.  With my iPhone, I can direct Safari to <a href=""http://xxx.xxx.xxx/FileName.mp4"">http://xxx.xxx.xxx/FileName.mp4</a> (which is an MPEG-4 video file), and Safari opens quicktime, and the video plays.  However, with the Droid, I go to the same web address and am faced with a error stating ""Cannot play video....  Sorry, this video is not valid for streaming to this device"".</p><p>When I direct the Droid's browser to a WMV file, it will fully download the video file and then play it in what appears to be the Droid video player if I click on it.</p><p>Ideally, I'd like to replicate the behavior of the iPhone on the Droid, where the video player pops up and the video starts before the complete download.  Video format isn't an issue, as I can encode the video to pretty much any standard.  I was trying the .mp4 file because the Droid documentation says that it supports MPEG-4 video, although I can't get it to work from the browser.</p><p>Any insight would be much appreciate.</p>","257021","","","","","2011-12-04 04:31:42","Streaming Video (or Progressive Download) to the Droid Browser","<iphone><android><video><mpeg-4>","4","0","4","",""
"2120035","1","2120190","","2010-01-22 19:51:28","13","14936","<p>Is it possible to Highlight text in a <code>TextView</code> or <code>WebView</code>?</p><p>I see it is possible in a <code>EditText</code></p><p><a href=""http://stackoverflow.com/questions/1529068/android-is-it-possible-to-have-multiple-styles-inside-a-textview"">Highligh text in a EditText</a></p><p>I'd like to do the same in <code>TextView</code> or <code>WebView</code>.<br/>Thats Possible?</p>","","Alexi","158689","","2012-02-08 08:57:49","2014-01-02 18:00:36","Highlight Text in TextView or WebView","<android><android-widget>","4","2","10","",""
"2120324","1","","","2010-01-22 20:37:35","0","3696","<p>I am trying to follow an eclipse and android tutorial from ibm.  The source code from the tutorial is giving me an error that says ContentURI cannot be resolved to a type..</p><p>here is the source code line...</p><p>ContentURI theContact = new ContentURI(android.provider.Contacts.ContactMethods.CONTENT_URI.toURI());</p><p>eclipse wanted me to fix it by either creating a class an interface or changing it to ContentUris  </p><p>I tried the last one w/no luck so was looking for some advice.</p>","257079","","","","","2010-01-22 20:49:31","ContentURI cannot be resolved to a type","<android>","3","1","","",""
"2120699","1","","","2010-01-22 21:34:11","7","6233","<p>I cannot instantiate a sub activity.  In the logcat I see this line:</p><pre><code>01-22 15:14:38.906: DEBUG/dalvikvm(411): newInstance failed: no &lt;init&gt;()</code></pre><p>This is the line in dalvik that generates that logcat.</p><pre><code>/* * public T newInstance() throws InstantiationException, IllegalAccessException * * Create a new instance of this class. */static void Dalvik_java_lang_Class_newInstance(const u4* args, JValue* pResult)...    /* find the ""nullary"" constructor */    init = dvmFindDirectMethodByDescriptor(clazz, ""&lt;init&gt;"", ""()V"");    if (init == NULL) {        /* common cause: secret ""this"" arg on non-static inner class ctor */        LOGD(""newInstance failed: no &lt;init&gt;()\n"");        dvmThrowExceptionWithClassMessage(""Ljava/lang/InstantiationException;"",            clazz-&gt;descriptor);        RETURN_VOID();    }</code></pre><p>Here is the action I take to activate the activity in a timer handler.</p><pre><code>// move on to Activation// ePNSplash is this activity a splash screenIntent i = new Intent (ePNSplash.this, Activation.class);startActivity (i);</code></pre><p>The activity that I am trying to start is 2 extensions above Activity</p><p>Here is the first extension</p><pre><code>public abstract class AndroidScreen extends Activity {    ....public AndroidScreen (String title, AndroidScreen parent, AndroidScreen main){    super ();    myGlobals = Globals.getGlobals ();    myGlobals.myLogger.logString(""AndroidScreen: 001"");    myParent = parent;    myMainScreen = main;    myTitle = title;}</code></pre><p>This is only the constructor, which seems to be the part that has the problem.  Here is the 2nd extension and the class i am trying to instantiate.</p><pre><code>public class Activation extends AndroidScreen {public Activation (String title, AndroidScreen parent, AndroidScreen main){    super (title, parent, main);}</code></pre><p>I am absolutely confused, I have a constructor, I make sure I call my super constructors, what could possibly be wrong?</p><p>Thank you</p><p>Julian</p>","250161","","","","","2012-08-21 18:11:54","newInstance failed: no <init>","<android>","1","0","2","",""
"2121785","1","","","2010-01-23 02:11:17","5","13899","<p>My layout design is a TextView with long text and a ImageView to the right of the TextView. I want to center the ImageView in its parent vertically, so I used android:layout_centerVertical=""true"", but it turned out that the ImageView was aligned to the bottom of its parent. If I don't use layout_centerVertical property, the ImageView will be aligned to the top of its parent. How can I solve this problem? Thanks.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:background=""#000000""&gt;    &lt;ImageView android:id=""@+id/t3"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:src=""@drawable/arrow_right""        android:layout_alignParentRight=""true"" android:background=""#ff0000""        android:layout_centerVertical=""true"" android:scaleType=""centerInside"" /&gt;    &lt;TextView android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""This a very very very very very very very very very very very very very very very very long sentence""        android:textColor=""#231ACC"" android:layout_toLeftOf=""@id/t3"" /&gt;&lt;/RelativeLayout&gt;</code></pre>","256239","","","","","2013-06-20 20:08:24","How to center a ImageView vertically in its parent?","<java><android>","5","0","2","",""
"2121833","1","","","2010-01-23 02:29:19","57","84120","<p>I would like my app to archive the application DB to the SD card. In my code I check if the directory <code>canWrite()</code> exists, and if not, throw an <code>IOException</code>. In this particular instance, I am trying to copy the db file to the root directory on the SD card, but it's throwing an <code>IOException</code>. How can I change the permission on a folder/file to be able to write to it?</p>","244190","","127742","","2014-04-09 22:43:47","2014-04-09 22:43:47","Permission to write to the SD card","<java><android>","2","0","15","",""
"2121961","1","","","2010-01-23 03:25:09","0","538","<p>I'm experiencing kind of strange behavior of my application after hard Home button is pressed. When you press Home, everything is OK - my app goes to the background, showing Home screen. But if you try to choose my app in the main menu or in the list of last tasks it behaves like it was not started before and does not show the last activity you were on - it just starts from scratch, namely, shows the splash screen and starts next corresponding activities. Moreover, old activities of this app remain on the activities stack, and previous instance of the app is not terminated - so if you press Back for a few times you'll just run into those activities which were undoubtedly started during the previous session of work with my app. Splash screen activity is filtered by ""android.intent.action.MAIN"" filter and ""android.intent.category.LAUNCHER"" category. The strange thing is that all of that happens despite the fact that I do not intercept any Back key hits, or override any onPause or onResume methods. What's happening contradicts with my understanding of Android app lifecycle - I was sure that when you hit Home an app just goes to the background, and when you choose it in the menu later - it just unwinds and does not start anew. (Of course, unless stuff like that is stated in the app manifest or corresponding methods are overridden or something else).I also checked it for some other lifecycle events - such as changing orientation or flipping hard keyboard out - and none of those led to such strange results. It appears that the problem occurs when you try to start the app from main menu or menu of last applications.I hope you will be able to help me. Any advice on what to pay attention to or where to search for solution would be really great. </p><p>Regards, Alex</p>","257264","","","","","2010-01-23 04:27:12","Weird Home button behavior","<android>","1","0","","",""
"2122024","1","2122078","","2010-01-23 03:47:40","4","917","<p><strong>BackGround:</strong>  </p><ol><li><p>There are Facebook APIs(and SDKs) available to develop applications for other Mobile devices like iPhone, BlackBerry etc, but it seems there are no <em>official</em> ones for Android(?).</p></li><li><p>People have <em>ported</em> Java APIs to work on Android and have written FaceBook Client applications(<a href=""http://wiki.developers.facebook.com/index.php/User%3aAndroid"" rel=""nofollow"">FaceBook dev: Wiki Page</a>). Apparently, there is also a light weight FaceBook SDK in alpha release for Android(a la FBRocket). But it is not avised to be used in Production.</p></li><li><p>Since these FaceBook functionalities have been exposed as REST based service, most of work would invove sending requests in desired format over Http. So, writing a FaceBook client app for Android certainly is doable.There are similar applications already in market e.g.: Bloo.</p></li></ol><p><strong>Questions:</strong>  </p><ol><li><p>When asked to write a FaceBook client application what approach should one undertake? Should we choose the SDK or invoke the services over Http?  </p></li><li><p>If there is already a Web application that integrates with FaceBook, can we just browse to that Application from inside a WebView and be done with this?</p></li></ol><p>Thanks!</p>","236128","","","","","2010-01-23 04:09:23","Best Approach to write a FaceBook application for Android","<android><facebook>","1","0","0","",""
"2122179","1","","","2010-01-23 04:56:12","2","11050","<p>I'm completely new to Eclipse/Java/Android programming, so this might sound like a dumb question, but I can't open the project I was working on last week... it's the ""HelloWorld"" project.</p><p>I'm very familiar with Visual Studio so I've been looking for something like a project file/solution or a way to open a directory in Exlipse, but I'm having no luck and am completely lost.</p><p>Any helps is appreciated!</p>","197472","","","","","2011-06-30 05:02:14","Open a project in Eclipse","<java><android><eclipse>","4","4","1","",""
"2122199","1","2123712","","2010-01-23 05:07:23","30","38400","<p>On the android website, there is a <a href=""http://developer.android.com/guide/topics/resources/available-resources.html#colordrawableresources"">section about color drawables</a>.  Defining these drawables in xml looks like this:</p><pre><code>&lt;resources&gt;    &lt;drawable name=""solid_red""&gt;#f00&lt;/drawable&gt;    &lt;drawable name=""solid_blue""&gt;#0000ff&lt;/drawable&gt;    &lt;drawable name=""solid_green""&gt;#f0f0&lt;/drawable&gt;&lt;/resources&gt;</code></pre><p>In the java api, they have thr following method to define rounded corners:</p><pre><code>setCornerRadius(float radius)</code></pre><p>Is there a way to set the rounded corners in the xml?</p>","240566","","240566","","2010-01-23 13:07:50","2010-05-07 00:28:32","How do I set the rounded corner radius of a color drawable using xml?","<android><drawable>","2","1","13","",""
"2122370","1","2122399","","2010-01-23 06:24:44","3","7206","<p>I am new to android development and i want to access the ringtones list. How can i access ring tones list?</p><p>At later i want to add/ remove ring tones to library? Is it possible?</p><p>Thanks &amp; Regards,<br>Jim.</p>","188965","","","","","2010-09-20 13:01:59","how to access all ringtones list in Android phone?","<android>","1","0","","",""
"2122483","1","2122595","","2010-01-23 07:22:28","2","15003","<p>I have installed Android SDK on my MAC OS X 10.6 and facing lots of problem while creating AVD. </p><ol><li>When I tried to create it for ECLIPSE (3.5 Gallelio) then after clicking the 'new' button, when I try to type a name there comes a message bellow saying 'a target must be selected in order to create an AVD'. But the problem is, the Target field is deactivated.</li><li>If I'm trying to create AVD from terminal with the command './android avd --target 2 --name my_avd' it shows an error saying 'Error: Expected verb after global parameters but found 'avd' instead.'</li></ol><p>I don't understand what to do right now. Can anybody help me in this regard please??</p><p>Thanks</p>","400859","","","","","2011-07-18 18:10:54","Problem creating AVD","<android>","2","0","1","",""
"2122585","1","2123328","","2010-01-23 08:16:31","0","567","<p>I am developing application with Google Map.</p><p>I've tested on the emulator and saw error line In the log: </p><pre><code>01-23 16:04:28.453: ERROR/MapActivity(733): Couldn't get connection factory client</code></pre><p>But it worked fine on the emulator.</p><p>Then I've signed the application and created its .apk file. I've put it on the web server downloaded and installed it on the real device (it is HTC with Verizon). </p><p>But my application didn't appear google maps on the device. I've checked API key and other configuration. Everything was ok. But google maps didn't work.</p><p>Have you faced to problem same as mine ?</p><p>Please suggest.</p><p>Thanks in advance.</p>","227889","","1869904","","2012-12-26 16:01:46","2012-12-26 16:01:46","Google maps doesn't work on the HTC?","<android><google-maps>","1","3","","",""
"2122707","1","","","2010-01-23 09:28:18","6","3263","<p>I have an application with several Activities.My A Activity has the Manifest Intent filter parameters: action.MAINand category.LAUNCHER. after its being loaded I call Activity B andfinish() A since I don't use it anymore.</p><p>After I run my application, go from Activity A to B and press the Homebutton, when I relaunch it from the applications menu or from theMarket app for ex.(not by a long press on the Home button), it startsfrom the A Activity and do not save its last Activity B.</p><p>I definitely know that this is possible to relaunch an applicationfrom its last Activity (some application from the Market do supportit) and I think that this can be determined by the Manifest parametersbut I don't know which one.</p><p>does anyone know how to implement it so my application can relaunchfrom its last Activity B?</p><p>Thanksayanir</p>","257331","","","","","2013-01-17 01:08:06","Android Run application from last Activity","<android><android-manifest>","3","1","","",""
"2122966","1","2122982","","2010-01-23 11:27:09","1","1794","<p>I know that it's mostly ""approximate"". </p><p>But, I must know the EXACT location of the phone, regardless of battery life or whatever.I need the exact location of the phone! Is it possible?</p>","179736","","","","","2010-01-27 09:09:54","GPS on iPhone and Android...is there any way to get the EXACT location of the phone (not approximate)?","<iphone><android><geolocation><gps>","5","0","","",""
"2123083","1","2123881","","2010-01-23 12:10:23","35","17178","<p>After I have gotten the data for a single row of a ListView, I want to update that single row.</p><p>ATM. I am using notifyDataSetChanged(); but that makes the View react very slow, are there any other solutions?</p>","174868","","","","","2014-01-14 06:41:21","Android ListView Refresh Single Row","<android><listview>","4","0","16","",""
"2123743","1","2129389","","2010-01-23 16:06:21","0","8650","<p>I would like to have an EditText with one modification: on the right (still inside the EditText) there is an arrow pointing downwards, that I can set OnClickListener to. So when user clicks on the arrow it displays a menu. What is the best way to do this?</p>","243225","","12704","","2010-01-23 16:10:13","2010-01-24 23:33:08","Android: How to do create custom EditText with a clickable arrow on the right","<android>","3","0","2","",""
"2123828","1","2124808","","2010-01-23 16:35:28","0","3616","<p>Is there a way to get system file descriptor (socket or file number as int) from Android's FileDescriptor object? I'd like to access file descriptor directly in JNI code without using any Java wrappers.</p><p>Edit:I've found getParcelFileDescriptorFD and that FileDescriptor has int field named ""descriptor"", example usage in <code>media/jni/android_media_MediaPlayer.cpp</code>, func definition is in <code>frameworks/base/core/jni/android_util_Binder.cpp</code>, field itself is in <code>libcore/luni/src/main/java/java/io/FileDescriptor.java</code></p><p>But this is not part of official documented API. Is there a documented ""right"" way to do that?</p>","257452","","257452","","2012-02-06 16:34:46","2012-02-06 16:34:46","FileDescriptor's actual system file descriptor (as int) in Android","<android><native>","1","1","1","",""
"2123899","1","","","2010-01-23 16:59:59","1","255","<p>How do I access ContentResolver content as a file? There's a simple way to open underlying file-based content as an InputStream, but it's not possible to seek on InputStream. There's RandomAccessFile, but either File or file name is needed to create instances.</p><p>Content I'm trying to read is mapped to file (email attachment).</p>","257452","","2388621","","2013-12-18 06:06:11","2013-12-18 06:06:11","ContentResolver - hot to get get random access / seekable representation of the resource which maps to file","<android><android-contentresolver>","0","2","","",""
"2123909","1","","","2010-01-23 17:02:51","2","683","<p>Does anyone have any experience using JNI to call native C/C++ libraries in Android? Is the environment suitable for running C/C++ libraries and if so is there anything specific about the environment which you need to accommodate?Thanks</p>","257468","","","","","2011-02-07 10:31:41","Will C/C++ libraries work on Android Phone","<android>","3","0","1","",""
"2123993","1","","","2010-01-23 17:30:22","-1","252","<p>I am a cameraman and I want to make an app for my Moto Droid that willcalculate my depth of field given four inputs. I am literally brandnew to javascript and this programming stuff, so I was wondering ifanyone could help me out.</p><p>I have a very basic GUI set up using Droiddraw which allows me toinput my 4 variables, which are:</p><p>Focus (@+id/focust)</p><p>Focal Length (@+id/flt)</p><p>Aperture (@+id/apt)</p><p>Circle of Confusion (@+id/coct)</p><p>Equations for this calculation are located here: <a href=""http://www.dofmaster.com/equations.html"" rel=""nofollow"">http://www.dofmaster.com/equations.html</a></p><p>for example...</p><p>to get hyperfocal distance I need to get: ((f^2)/(N*c))+f  </p><p>all of these variables will be drawn from inputs in the GUI, but I don't know how to call them, how to write the actual math, and how to address the results so I can make them appear in the ""results area"" on the bottom of the screen.</p><p>I've never done java before and I only want to make this app because the existing ones don't fit my needs. Can someone help?</p><p>Thanks!</p>","257482","","","","","2010-01-23 18:46:43","Converting equations to java for android?","<java><android>","1","2","","",""
"2123994","1","","","2010-01-23 17:30:41","1","201","<p>I'm a n00b developer at my second attempt to use the Android SDK. I'mdeveloping on the Mac platform and I've noticed that the latestversion of the SDK doesn't include anything except the tools (so Ihave no plugins, no targets to choose from inside the package Idownloaded).</p><p>So I tried to use the Android SDK and AVD Manager to download andinstall some, however, I got this error:Failed to fetch URL <a href=""https://dl-ssl.google.com/android/repository/"" rel=""nofollow"">https://dl-ssl.google.com/android/repository/</a></p><p>I went to the settings and checked the box to force fetching via HTTP,but no result. I was suggested to look for a configuration file, butcouldn't find any.</p><p>Any suggestions? I'm dying to get my hands dirty with the SDK.</p>","","user257483","41761","","2010-01-23 17:34:22","2010-06-10 10:32:18","Android SDK beginner question","<android>","2","2","","",""
"2124046","1","2124067","","2010-01-23 17:44:41","47","52276","<p>I've seen references to being able to specify two separate layout xml files for an activity, one for Portrait and one for Landscape.  I've not been to find any information on how to do that though.  How do I specify for each activity which xml file is it's portrait layout and which is the Landscape layout?  </p><p>Is it also possible to specify different layouts for different screen sizes?  If so, how is this done?</p>","240566","","","","","2013-10-30 09:19:33","How do I specify different layouts for portrait and landscape orientations?","<android><orientation><landscape><portrait>","4","0","13","",""
"2124437","1","2124454","","2010-01-23 19:42:26","0","1142","<p>I am trying to create a screen with some dynamic controls, well radio buttons to be precise purely for learning purposes.</p><p>I have managed to add the radio button by referencing the radio group in the main.xml file.</p><pre><code>RadioGroup rg = (RadioGroup)findViewById(R.Id.types);RadioButton rb = new RadioButton(this);rb.setText(""some text!"");rg.addView(rb);</code></pre><p>What I cannot figure out is how do I set the id of the radio button?</p><p>If  use rb.setId() it wants an integer?  I am trying to basicaly do the xml bit dynamically:</p><p></p>","257459","","996493","","2012-05-01 03:32:20","2012-05-01 03:32:20","Creating dynamic controls","<android>","2","0","","",""
"2124701","1","2939624","","2010-01-23 20:57:59","31","27634","<p>I've been working with AsyncTasks in Android and I am dealing with an issue.</p><p>Take a simple example, an Activity with one AsyncTask. The task on the background does not do anything spectacular, it just sleeps for 8 seconds.</p><p>At the end of the AsyncTask in the onPostExecute() method I am just setting a button visibility status to View.VISIBLE, only to verify my results.</p><p>Now, this works great until the user decides to change his phones orientation while the AsyncTask is working (within the 8 second sleep window).</p><p>I understand the Android activity life cycle and I know the activity gets destroyed and recreated.</p><p>This is where the problem comes in. The AsyncTask is referring to a button and apparently holds a reference to the context that started the AsyncTask in the first place.</p><p>I would expect, that this old context (since the user caused an orientation change) to either become null and the AsyncTask to throw an NPE for the reference to the button it is trying to make visible.</p><p>Instead, no NPE is thrown, the AsyncTask thinks that the button reference is not null, sets it to visible. The result? Nothing is happening on the screen! </p><p><strong>Update:</strong> I have tackled this by keeping a <code>WeakReference</code> to the activity and switching when a configuration change happens. This is cumbersome.</p><p>Here's the code:</p><pre><code>public class Main extends Activity {    private Button mButton = null;    private Button mTestButton = null;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mButton = (Button) findViewById(R.id.btnStart);        mButton.setOnClickListener(new OnClickListener () {            @Override            public void onClick(View v) {                new taskDoSomething().execute(0l);            }        });        mTestButton = (Button) findViewById(R.id.btnTest);       }    private class TaskDoSomething extends AsyncTask&lt;Long, Integer, Integer&gt;     {        @Override        protected Integer doInBackground(Long... params) {            Log.i(""LOGGER"", ""Starting..."");            try {                Thread.sleep(8000);            } catch (InterruptedException e) {                e.printStackTrace();            }            return 0;        }        @Override        protected void onPostExecute(Integer result) {            Log.i(""LOGGER"", ""...Done"");            mTestButton.setVisibility(View.VISIBLE);        }    }}</code></pre><p>Try executing it and while the AsyncTask is working change your phones orientation.</p>","254638","","254638","","2013-08-21 14:39:26","2013-08-21 14:39:26","Android AsyncTask context behavior","<android><multithreading><android-asynctask><android-context>","4","0","12","",""
"2125052","1","","","2010-01-23 22:53:37","0","257","<p>Making a simple app for my android.</p><p>in my xml interface there is a text box in which the user will input a number (for example: 10). the id of this text box is ""input1""</p><p>how do I call the value of input1 in java and then perform a calculation on it?</p><p>For example...</p><p>suppose input1 = x</p><p>x + 5   or  x*2</p><p>and for that matter, how do I have the resulting value appear as constantly updated text output in a specified place on the UI?</p>","257482","","","","","2012-05-01 03:31:42","how do you call a value entered in a UI to your java class?","<java><android><math>","2","1","","",""
"2125197","1","","","2010-01-23 23:31:06","3","2672","<p>I am making an application that asks the user for userid, appends the userid to a static HTTP link to retrieve the user's daily schedule info file that has a .ical (calendar) extension.</p><p>I need to read the data from file, format in new UI and representing some useful data on an Android device.</p><p>My query is can I access a static HTTP link behind the scenes? And when I use the same link on desktop browser, it asks user to save the file &mdash; how can I do this on a mobile? Do I need to read the data and save it somewhere or I can save the .ical file and read from it?</p>","257580","","234938","","2010-01-23 23:54:03","2010-10-03 00:00:27","Retrieving and parsing iCal data over HTTP on Android","<android><http><user-interface><icalendar>","2","2","2","",""
"2125212","1","","","2010-01-23 23:34:50","2","1195","<p>I'm new to Android programming, and I wanted to pull list options from a column of the SQLite database for the user to select. How would I go about doing this? Like, say the database table to be read is called countries, and the columns were ID, country, and capital. How would I let the user pick from the list of capitals and have the application return the information in that row?</p>","257601","","","","","2010-01-24 04:14:19","How do you make a multiple-choice list from the sqlite database in Android?","<database><android><sqlite><list>","1","0","","",""
"2125354","1","2125393","","2010-01-24 00:27:13","11","3863","<p>For learning purposes, I would like to code a simple 2D game inspired by Zelda series on the nes/gb.</p><p><a href=""http://www.5min.com/Video/The-Legend-of-Zelda-a-Link-to-the-Past---Walkthrough-Part-3-89824010"" rel=""nofollow"">http://www.5min.com/Video/The-Legend-of-Zelda-a-Link-to-the-Past---Walkthrough-Part-3-89824010</a> is a nice example.</p><p>The player could move on a scrollable view, and when hits defined map limits, like a house door, dungeon, or new zone, load a new specific map.</p><p>What would be the best and simplest way to achieve this, specifically for Android devices ? Could you point me to some useful resources, snippets, books.</p><p>I've read some begginers stuff about OpenGL ES, but it sounds way too much for what i am willing to do : 2D ; however, im not sure i can handle anything that is bigger than a phone screen with Canvas..</p><p>Thanks.</p>","252222","","252222","","2010-01-24 00:43:25","2013-06-14 07:40:51","Best approach for oldschool 2D zelda-like game","<android>","4","2","6","",""
"2125357","1","2339975","","2010-01-24 00:27:53","5","15088","<p>I have two OverlayItem's on a MapView. How can I draw a route between the two geopoints?</p>","116305","","116305","","2010-01-24 00:36:30","2012-01-21 01:34:06","How to draw a route between two geopoints on the Android","<java><android><google-maps><draw>","2","0","1","",""
"2125624","1","2125863","","2010-01-24 02:11:16","0","1066","<p>I’m developing an Android and web application that will function as a service (use the same data).  My question is how should the data be stored to allow for both the web and the android application to have access to the same set of data?  Should the android application connect to the sites MySQL server to store/access data?  If so how do I allow someone to access the data when they are not in a service area?</p>","246639","","","","","2010-01-24 03:52:19","How to store data accessible to both a web site and android application?","<android><web-services><sqlite><storage>","1","0","","",""
"2125694","1","2126285","","2010-01-24 02:42:04","3","6112","<p>I have a basic animation of a button after it is pressed currently in my application. After the button finishes animating, I can no longer click on it. It doesn't even press with an orange highlight.</p><p>Any help?</p><p>Here's my code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);animation = new AnimationSet(true);animation.setFillAfter(true);Animation translate = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 5.0f);translate.setDuration(500);animation.addAnimation(translate);LayoutAnimationController controller = new LayoutAnimationController(animation, 0.25f);generate = (Button)findViewById(R.id.Button01);generate.setOnClickListener(new View.OnClickListener(){    public void onClick(View v){            keyFromTop();        }    });}public void keyFromTop(){       generate.setAnimation(animation);    }</code></pre>","118241","","118241","","2010-01-24 03:53:19","2012-07-16 14:29:27","Android Button Doesn't Respond After Animation","<java><android>","3","2","4","",""
"2125740","1","2126478","","2010-01-24 02:58:01","3","5032","<p>Is there any way to use an image that I'm generating on the fly as a <a href=""http://developer.android.com/reference/android/app/Notification.html"" rel=""nofollow"">Notification</a> icon?</p>","76835","","","","","2012-10-25 18:14:16","Using custom drawables in an Android Notification","<android><notifications>","3","0","","",""
"2126105","1","","","2010-01-24 05:43:41","0","1011","<p>I am using LinearLayout implemented in order to paint polygon on it. But my implemented dispatchDraw(Canvas canvas) method is working very slow.</p><p>Approximately, one draw cycle finish in 535ms (milliseconds).</p><p>To call myLinearLayout.postInvalidate() from non UI thread, using following code :</p><pre><code>myActivity.runOnUiThread(new Runnable() {    public void run() {             myLinearLayout.postInvalidate();        }});</code></pre><p>Is there a way to increase drawing speed ?</p><p>Please suggest.</p><p>Thanks in advance.</p>","227889","","","","","2010-09-22 04:33:43","postInvalidate() is working slow?","<android>","1","0","","",""
"2126110","1","2156169","","2010-01-24 05:48:02","1","232","<p>i want to develop an application on android,webos,wince. how to develop application that should run on all paltform with developing each paltform </p>","1746300","","","","","2010-02-17 17:07:04","os compatibility on mobiles","<android><windows-ce><webos>","2","0","1","",""
"2126640","1","","","2010-01-24 10:09:34","4","948","<p>I want to do an image gallery like in iphone. I want to show low quality (pre-resized) images and when the image is active I want to process the big image and show the result in the gallery.</p><p>I have two questions. How to attach a listener on the animation stop in gallery? And how to access an image after this action?</p>","227016","","56338","","2010-07-29 06:59:06","2010-12-09 21:47:38","Android: how to change a low quality image to the hi quality one when the animation stops in gallery?","<android><image><lazy-loading><listener><gallery>","1","1","1","",""
"2126717","1","2126852","","2010-01-24 10:39:49","36","13116","<p>I am using AutoCompleteTextView , when user clicks on it, I want to show suggestions even if it has no text - but setThreshold(0) works exactly the same as setThreshold(1) - so the user has to enter at least 1 character to show the suggestions.</p>","243225","","243225","","2010-01-24 10:48:48","2014-01-29 21:41:59","Android: AutoCompleteTextView show suggestions when no text entered","<android>","8","1","13","",""
"2126986","1","2346668","","2010-01-24 12:20:33","7","2442","<p>Im developing for both iPhone and Android. For iPhone im using iUI to show what the user interface would look like from a browser. Does anyone know if there is a similar javascript/css library which would allow me to mock up the Android interface?</p>","257793","","","","","2012-04-17 14:20:24","is there an iUI for the Android","<iphone><android><user-interface>","5","2","","",""
"2127044","1","2127179","","2010-01-24 12:40:21","26","17513","<p>I have a device management application, which essentially runs as a service in the background from boot. I'd like to start this application immediately after installation. How do I achieve this?</p>","190522","","","","","2012-10-11 08:46:45","How to start android service on installation","<android>","2","0","9","",""
"2127177","1","2130528","","2010-01-24 13:21:15","12","16930","<p>So I have looked around and found out that <code>android.R.styleable</code> is no longer part of the SDK even though it is still documented here: <a href=""http://developer.android.com/reference/android/R.styleable.html"" rel=""nofollow"">http://developer.android.com/reference/android/R.styleable.html</a><br>That wouldn't really be an issue if it was clearly documented what the alternative is. For example the AOSP Calendar App is still using the <code>android.R.styleable</code></p><pre><code>// Get the dim amount from the theme   TypedArray a = obtainStyledAttributes(com.android.internal.R.styleable.Theme);lp.dimAmount = a.getFloat(android.R.styleable.Theme_backgroundDimAmount, 0.5f);a.recycle();</code></pre><p>So how would one get the <strong><code>backgroundDimAmount</code></strong> without getting the <code>int[]</code> from <code>android.R.styleable.Theme</code>? What do I have to stick into <code>obtainStyledAttributes(int [])</code> in order to make it work with the SDK?</p>","257811","","1820695","","2013-02-28 07:52:33","2013-02-28 07:52:33","How do I use obtainStyledAttributes(int []) with internal Themes of Android","<android><android-xml><android-resources><android-styles>","3","1","7","",""
"2127438","1","2127812","","2010-01-24 14:54:50","15","7580","<p>I'm trying to draw a nine patch onto a Canvas object on the Android. What seems strange is that although I generated my nine patch using the draw9patch tool, the constructor for NinePatch requires an additional byte array called the ""chunk"" to construct the nine patch.</p><p>Why isn't this simpler? What is the ""chunk""? And if you have done this yourself, how did you go about it?</p><p>Any help appreciated.</p>","209838","","","","","2012-07-24 12:33:04","Drawing Nine Patch onto Canvas (Android)","<java><android><graphics><nine-patch>","1","0","10","",""
"2127459","1","2127593","","2010-01-24 15:04:57","3","2119","<p>I'm taking my first steps in Android programming.</p><p>My application is to create entries in a database. For this task I have created a new Activity. All is fine - but I don't really like how it looks.</p><p>Currently, the emulator shows this:<br><img src=""http://i45.tinypic.com/jr8lc8.jpg"" alt=""Current Layout""></p><p>I'd like to have something similar to the ""New Contact"" Activity:  </p><ul><li>Buttons at the bottom of the window, not directly below the other controls (I'll hopefully figure that out myself)</li><li>Buttons within a nice ""box"" like shown in the screenshot (what's the control hosting the buttons here?)</li><li>When soft-keyboard is displayed, the buttons should ""move up"". If there's not enough room, the entire area should be scrollable (I'll try and figure that out myself too)</li></ul><p>Sample can be seen here:<br><img src=""http://i46.tinypic.com/2va1dnb.png"" alt=""alt text""></p><p>Which control hosts the buttons in the above ""New contact"" screenshot? I'd like to use the same for my buttons.</p>","117362","","104117","","2010-01-24 15:11:07","2010-02-08 20:30:01","Which Android control to use?","<android>","4","0","7","",""
"2127656","1","2129526","","2010-01-24 16:00:38","1","1061","<p><br>I have a simple demo with two buttons. They are laid out with a RelativeLayout at the top and bottom of the screen.<br>When I click one of them, I want them to switch places.What is the best way to do that?</p><p>This is my res/layout/main.xml :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;ImageButton        android:id=""@+id/android_button_1""        android:layout_width=""200dip""        android:layout_height=""wrap_content""        android:src=""@drawable/icon""        android:layout_alignParentTop=""true"" /&gt;    &lt;ImageButton        android:id=""@+id/android_button_2""        android:layout_width=""200dip""        android:layout_height=""wrap_content""        android:src=""@drawable/icon2""        android:layout_alignParentBottom=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>And this is my Activity:</p><pre><code>public class HelloButtons extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final ImageButton button1 = (ImageButton) findViewById(R.id.android_button_1);        final ImageButton button2 = (ImageButton) findViewById(R.id.android_button_2);        button1.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                // Perform action on clicks                Toast.makeText(HelloButtons.this, ""Beep Bop"", Toast.LENGTH_SHORT).show();            }        });        button2.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                // Perform action on clicks                Toast.makeText(HelloButtons.this, ""Beep Bop"", Toast.LENGTH_SHORT).show();            }        });    }}</code></pre>","215904","","","","","2010-01-25 00:21:41","Moving widgets in runtime on Android","<android>","2","0","","",""
"2128245","1","2128257","","2010-01-24 18:46:32","4","175","<p>Coding a calculation tool for my android. On of the inputs is distance in Feet and Inches.</p><p>I have two inputs (input3 and input4) for feet and inches, respectively. In my calculation I am trying to convert these two inputs to a decimal number to be used in the rest of the equation. Here's the part of my code that does this:</p><pre><code>private void doCalculation() {     // Get entered input value     String strValue3 = input3.getText().toString();     String strValue4 = input4.getText().toString();    // Perform a hard-coded calculation     double imperial1 = (Integer.parseInt(strValue3) + (Integer.parseInt(strValue4) / 12));    // Update the UI with the result to test if calc worked     output2.setText(""Test: ""+ imperial1); }</code></pre><p>My test values are 4 feet, 6 inches. The 4 comes across fine, but the 6 inches defaults to 0 when it is divided by 12. So my result is 4.0  I tried cutting the calculation down to JUST the division operation, and the result was 0.0</p><p>What am I doing wrong? (fyi: this is my first time using Java)</p>","257881","","","","","2010-01-24 20:25:58","Basic imperial conversion problem","<java><android><math>","3","0","","",""
"2128695","1","","","2010-01-24 20:34:21","3","1654","<p>is there a way (through javascript/jquery/css) to hide the scrollbar in android's web browser? Can't seem to find any valid info online and things that work for Google Chrome (webkit engine, as well) don't seem to work for the Android's browser.</p><p>Thanks bunches</p>","248347","","","","","2010-06-05 08:00:17","Android Webapp hide scrollbar?","<css><android><webkit><web-applications>","1","0","1","",""
"2128830","1","2128933","","2010-01-24 21:03:38","4","1306","<p>I want to do something like this: user clicks on a button ""Choose color"", and a simple popup with e.g. 5 colors appears. I could do this with PopupWindow and inner ListView, but is there a simpler solution, like a specific widget for this?</p><p>How it should look like: <img src=""http://1.bp.blogspot.com/_9l0GmPwgCzk/SeAfVu4IazI/AAAAAAAAADs/ZZYmkwOOYTk/s400/device.png"" alt=""alt text""></p>","243225","","198536","","2010-01-24 21:15:44","2010-01-24 21:26:39","Android: How to create popup with choices","<android>","1","0","3","",""
"2129110","1","2129130","","2010-01-24 22:14:21","4","10479","<p>I have a long series of graphics -- icon1_0.png, icon1_1.png, icon1_2.png..., icon12_0.png, icon12_1.png, icon12_2.png -- and I'd like to package them with my android application.  Ideally I think I should be able to load them as resources but the resource id's are set up as java identifiers.  Of course, java identifiers can't be assembled at runtime.  I have to ask for R.drawable.icon12_00 so I cannot set up a loop</p><pre><code>for(int icon=0;icon&lt;12;icon++) for(int frame=0;frame&lt;3;frame++)  //syntax error obviously  BitmapFactory.decodeResource(getResources(), R.drawable.""icon"" + icon + ""_"" + frame + "".png"");</code></pre><p>So is there any way to get resources by their names?  Better yet, is there a canonical way outside the resource system to pack data files into an android application package so that I can get at them?  </p><p>I'm thinking about reflection but that doesn't seem like the right solution to me.</p>","8959","","","","","2010-01-25 08:10:28","Batch getting many bitmap resources on Android","<android><resources>","3","0","2","",""
"2129125","1","2134104","","2010-01-24 22:18:46","1","2720","<p>following this question : <a href=""http://stackoverflow.com/questions/2125354/best-approach-for-oldschool-2d-zelda-like-game"">http://stackoverflow.com/questions/2125354/best-approach-for-oldschool-2d-zelda-like-game</a></p><p>Thank to previous replies, and with a major inspiration from <a href=""http://insanitydesign.com/wp/projects/nehe-android-ports/"" rel=""nofollow"">http://insanitydesign.com/wp/projects/nehe-android-ports/</a> , i started to build a simple Tile Generator for my simple 2D  zelda-like game project.</p><p>I can now generate a map with the same textured tile, using 2 for(..) imbricated iterations to draw horizontal and vertical tiles, and got some basic DPAD key input listeners to scroll over the x and y axis.</p><p>but now im running into my first performance problems, just with one texture and one model.</p><p>When trying to build a 10x10 map, scrolling is fine and smooth.</p><p>When trying with 50x50, things get worse, and with a 100x100, its way unacceptable.</p><p>Is there a way only to tell OpenGL to render the 'visible' part of my mapset and ignore the hidden tiles? im a totally new to this.</p><p>im using </p><pre><code>GLU.gluLookAt(gl, cameraPosX, cameraPosY, 10.0f,cameraPosX, cameraPosY, 0.0f, 0.0f, 1.0f, 0.0f);</code></pre><p>to set the camera and point of view for a 2D-style feeling.</p><p>Any help ? :)</p><pre><code>for (int j = 0; j &lt; 10; j++) {        for (int i = 0; i &lt; 10; i++) {            gl.glPushMatrix(); // Sauvegarde la matrice sur le stack            //Bind the texture according to the set texture filter            gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[filter]);            //Set the face rotation            gl.glFrontFace(GL10.GL_CW);            //Enable texture state            gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);            //Enable vertex state            gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);            //Point to our vertex buffer            gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);            //point to our texture buff            gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer);            //Draw the vertices as triangle strip            gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertices.length / 3);            //Disable the client state before leaving            gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);            gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);            gl.glTranslatef(1.0f, 0.0f, 0.0f); // on avance d'une tile        }        // on va commencer a dessiner la 2e ligne        gl.glPopMatrix(); // Rappelle la matrice sur le stack        gl.glTranslatef(0.0f, -1.0f, 0.0f);    }</code></pre>","252222","","","","","2010-02-14 09:20:46","android OpenGL ES simple Tile generator performance problem","<android><opengl-es>","2","0","1","",""
"2129337","1","2129371","","2010-01-24 23:17:13","1","1887","<p>I have a Gallery widget and 2 imageviews, one on the left of the screen and one on the right. I want the imageview and gallery to stay on the same line, but if there is an overlap, the imageview's z-index should be higher then the gallery's.</p><p>The problem is the imageview appears underneath the gallery item. I've had a look in the android doc, but can't find the solution. My XML file is below (For some reason, the opening Root relative layout's opening and closing tag isn't showing up):</p><pre><code>&lt;ImageView    android:id=""@+id/greenarrow_right""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:src=""@drawable/green_arrow_right""    android:layout_alignParentRight=""true""    android:layout_marginRight=""10dip""    android:layout_marginTop=""10dip""/&gt;  &lt;ImageView    android:id=""@+id/greenarrow_left""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:src=""@drawable/green_arrow_left""    android:layout_alignParentLeft=""true""    android:layout_marginLeft=""10dip""    android:layout_marginTop=""10dip""/&gt;  &lt;Gallery     android:id=""@+id/gallery""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:spacing=""3dip""         /&gt;  &lt;!-- more elements here --&gt;</code></pre>","258044","","1694500","","2014-03-16 15:22:17","2014-03-16 15:22:17","Make imageview appear above Gallery","<android><layout><view><gallery><z-index>","2","0","","",""
"2129624","1","2131381","","2010-01-25 01:01:03","5","6986","<p>I have a spinner widget in my activity which lets users pick a list name.</p><p>Normally, the function of the spinner is to switch between lists but for a couple of instances, I swap out the selection change listener to perform a different function with the same list of options.  Once the selection has been made, the old listener is restored and life goes on.</p><p>This is a bad and buggy arrangement.  Instead, I would like to have a function that just takes a selection listener and some other parameters and shows a popup list that's populated by the same cursor (or and identical cursor) as the spinner, without using the spinner itself.</p><p>Is there any way I can do this?</p>","131871","","","","","2014-01-15 15:57:44","How to popup list like a spinner without spinner in android?","<android><listview><popup><spinner>","5","0","5","",""
"2129903","1","","","2010-01-25 02:35:01","3","7883","<p>I have a spinner 'aperture' set up with a list of numbers, and a spinner 'mode' with two options. When a button is pushed I need a calculation to run using various inputs, including the current selection from 'aperture' and a value derived from 'mode'. How do I call the value of a spinner so I can use it in a calculation?</p><p>Also, how do I use the spinner 'mode's selection to set this other value before implimenting it in the calculation? To be more specific, if the spinner is set to Small then the value I use in the calculation is 0.015, whereas if Large is selected I need to use 0.028</p><p>My other inputs are EditText views, so right now I am set up like this:</p><pre><code>    input = (EditText) findViewById(R.id.input1);     input2 = (EditText) findViewById(R.id.input2);    input3 = (EditText) findViewById(R.id.input3);     input4 = (EditText) findViewById(R.id.input4);    output = (TextView) findViewById(R.id.result);     output2 = (TextView) findViewById(R.id.result2);    //aperture dropdown    Spinner s = (Spinner) findViewById(R.id.apt);    ArrayAdapter adapter2 = ArrayAdapter.createFromResource(        this, R.array.apertures,           android.R.layout.simple_spinner_item);    adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    s.setAdapter(adapter2);    //button    final Button button = (Button) findViewById(R.id.calculate);    button.setOnClickListener(new View.OnClickListener() {                  public void onClick(View v) {                       // Perform action on click      doCalculation();       }               });     }private void doCalculation() {     // Get entered input value     String strValue = input.getText().toString();     String strValue2 = input2.getText().toString();    String strValue3 = input3.getText().toString();     String strValue4 = input4.getText().toString();    // Perform a hard-coded calculation     double imperial1 = (Double.parseDouble(strValue3) + (Double.parseDouble(strValue4) / 12));    double number = Integer.parseInt(strValue) * 2;     double number2 = ((number / 20) + 3) / Integer.parseInt(strValue2);    // Update the UI with the result     output.setText(""Result:  ""+ number);     output2.setText(""Result2: ""+ imperial1); }}</code></pre><p>That is not the actual equation, it is just a test to make sure everything connects properly. How would I call the value of spinner 'aperture' and the Small/Large spinner 'mode'</p>","257881","","257881","","2010-01-25 02:43:55","2012-05-01 02:58:57","Call a spinner's value? Also, use other values based on a spinner's value","<java><android><spinner>","3","0","","",""
"2130279","1","","","2010-01-25 04:57:52","0","1150","<p>I want to do an application in which I want to store setting of my application in xml so in need to update xml file (updating values of nodes , removing nodes,appending nodes).In java we  will update xml file using javax.xml.transform package classes but it is not available in android so is there any way to update xml(If you know the reason of why android does't have transform package please suggest me).</p><p>Thanx in advance.</p>","258152","","","","","2010-01-25 06:44:43","xml file updation in android","<xml><android>","2","0","","",""
"2130283","1","2130787","","2010-01-25 04:59:50","1","4573","<p>I am trying to get the source code for the android os.How do I repo sync a particular folder from the master branch?</p>","254504","","","","","2011-12-08 21:12:52","Repo Sync a particular folder","<android><git>","1","0","1","",""
"2130420","1","2130486","","2010-01-25 05:41:21","1","1343","<p>When i am uploading my application in android market it showing below error </p><blockquote>  <p>The file is invalid:ERROR:dump failed because no AndroidManifest.xml found.</p></blockquote><p>When I unzip the .apk file, the AndoridManifest.xml file is there.</p><p>What's the problem?</p>","1746300","","95","","2012-01-05 08:01:44","2012-01-05 08:01:44","while uploading file to android market error","<android>","1","3","","",""
"2130517","1","2134069","","2010-01-25 06:09:32","2","1688","<p>I have an android application that I am supporting and after calling one of the activities numerous time, it throws a stackoverflowerror when trying to get the extras from the intent. Here is the the stack trace from when it crashes.  Any ideas as to why after calling the activity at least 4 times the next time throws StackOverflowError when getting the extras from the intent?</p><p>The code used to build the intent is and contains String, String, boolean, Object:</p><pre><code>Intent videoIntent = new Intent(this, VideoPlayer.class);videoIntent.putExtra(AppNames.EXTRA_VIDEO_URI, uri);videoIntent.putExtra(AppNames.EXTRA_VIDEO_TITLE, channel.getName());videoIntent.putExtra(AppNames.EXTRA_VIDEO_MODE_RESUME, false);videoIntent.putExtra(AppNames.EXTRA_MCD_CHANNEL, channel);startActivity(videoIntent);  </code></pre><p>and the code that is throwing the StackOverflowError is:<br><code>uri = getIntent().getStringExtra(AppNames.EXTRA_VIDEO_URI);</code></p><pre><code>I/dalvikvm( 1719): Stack overflow, expanding (0x41048200 to 0x41048000)  I/dalvikvm( 1719): Shrank stack (to 0x41048200, curFrame is 0x4104834c)  D/AndroidRuntime( 1719): Shutting down VM  W/dalvikvm( 1719): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)  E/AndroidRuntime( 1719): Uncaught handler: thread main exiting due to uncaught exception  E/AndroidRuntime( 1719): java.lang.StackOverflowError  E/AndroidRuntime( 1719):  at java.lang.reflect.ReflectionAccessImpl.clone(ReflectionAccessImpl.java:38)  E/AndroidRuntime( 1719):  at java.lang.Class.getDeclaredMethod(Class.java:765)  E/AndroidRuntime( 1719):  at java.io.ObjectStreamClass.getPrivateReadObjectMethod(ObjectStreamClass.java:789)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:1525)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:1455)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2124)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:956)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2289)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2243)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readFieldValues(ObjectInputStream.java:1296)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:545)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:1549)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:1455)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2124)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:956)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2289)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2243)  E/AndroidRuntime( 1719):  at java.util.ArrayList.readObject(ArrayList.java:702)  E/AndroidRuntime( 1719):  at java.lang.reflect.Method.invokeNative(Native Method)  E/AndroidRuntime( 1719):  at java.lang.reflect.Method.invoke(Method.java:521)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:1534)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:1455)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2124)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:956)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2289)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2243)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readFieldValues(ObjectInputStream.java:1296)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:545)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:1549)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:1455)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2124)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:956)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2289)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2243)  E/AndroidRuntime( 1719):  at java.util.ArrayList.readObject(ArrayList.java:702)  E/AndroidRuntime( 1719):  at java.lang.reflect.Method.invokeNative(Native Method)  E/AndroidRuntime( 1719):  at java.lang.reflect.Method.invoke(Method.java:521)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:1534)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:1455)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2124)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:956)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2289)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2243)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readFieldValues(ObjectInputStream.java:1296)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:545)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:1549)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:1455)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2124)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:956)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2289)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2243)  E/AndroidRuntime( 1719):  at java.util.ArrayList.readObject(ArrayList.java:702)  E/AndroidRuntime( 1719):  at java.lang.reflect.Method.invokeNative(Native Method)  E/AndroidRuntime( 1719):  at java.lang.reflect.Method.invoke(Method.java:521)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:1534)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:1455)  E/AndroidRuntime( 1719):  at java.io.ObjectInputStream.readNew  D/dalvikvm( 1719): GC freed 6315 objects / 501704 bytes in 154ms  I/Process (   56): Sending signal. PID: 1719 SIG: 3  I/dalvikvm( 1719): threadid=7: reacting to signal 3  </code></pre>","258047","","234938","","2010-01-25 22:27:39","2011-09-14 17:03:23","Calling Intent.getStringExtra() throws StackOverflowError periodically","<android><android-intent><stackoverflowerror>","2","2","","",""
"2130546","1","2131716","","2010-01-25 06:15:47","8","26323","<p>I'm using an ArrayAdapter to add items to a custom ListView and showing the results in my Android app.  The problem I'm having is that the ArrayAdapter seems to wait until all items are in it before it shows the view.  That is to say, when I'm adding the items to the ArrayAdapter and I call notifyDataSetChanged, it does not update the ListView to show the added item.  It waits until all items are added and GetView is called before showing the items.</p><p>What I would like it to do is to show the item immediately after adding it to the ListView.  Is this possible?</p><p>I believe the relevant code is the following:</p><pre><code>r_adapter = new ReminderAdapater(Activity_ContentSearch.this, R.layout.search_listitem, myList);listView.setAdapter(r_adapter);...r_adapter.notifyDataSetChanged();r_adapter.clear();for(int i = 0; i &lt; myList.size(); i++){    r_adapter.add(myList.get(i));    r_adapter.notifyDataSetChanged();}</code></pre><p>As you can see, even though I am calling notifyDataSetChanged after the add method, it does not actually update the view.  After it has finished the above loop the view is finally updated (based on what I know, that's because GetView isn't called until after this section of the code is done). </p><p>I tried to override the add method of my custom ArrayAdapter with no luck, since I don't have access to the view in that method.</p><p>Any help would be welcome :)</p><p>Bara</p>","164312","","403455","","2012-08-19 18:12:22","2012-08-19 18:12:22","Android - Adding and showing items to ListView one at a time using an ArrayAdapter","<android><listview><android-listview><android-asynctask><android-arrayadapter>","1","0","7","",""
"2130597","1","","","2010-01-25 06:27:22","1","4525","<p>I am trying to launch activities under each tab.I have tried with following code</p><pre><code>public class Tab_Proj1 extends TabActivity {TabHost mTabHost ; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);setContentView(R.layout.main);final Context context = getApplicationContext();//mTabHost = (TabHost) this.findViewById(R.id.);mTabHost = getTabHost();mTabHost.setup();            mTabHost.addTab(mTabHost.newTabSpec(""tab_test4"")    .setIndicator(""Contacts"")    .setContent(new Intent().setClass(context, Tab1Activity.class)));</code></pre><p>Tab1Activity is extending ListActivity and I'm getting the following error:</p><pre><code>01-25 11:57:07.352: ERROR/AndroidRuntime(952): Uncaught handler: thread main exiting due to uncaught exception01-25 11:57:07.382: ERROR/AndroidRuntime(952): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.app.Tab_Proj1/com.android.app.Tab_Proj1.Tab_Proj1}: java.lang.RuntimeException: Could not create tab content because could not find view with id 213103414801-25 11:57:07.382: ERROR/AndroidRuntime(952):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at android.os.Handler.dispatchMessage(Handler.java:99)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at android.os.Looper.loop(Looper.java:123)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at android.app.ActivityThread.main(ActivityThread.java:3948)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at java.lang.reflect.Method.invokeNative(Native Method)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at java.lang.reflect.Method.invoke(Method.java:521)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at dalvik.system.NativeStart.main(Native Method)01-25 11:57:07.382: ERROR/AndroidRuntime(952): Caused by: java.lang.RuntimeException: Could not   create tab content because could not find view with id 213103414801-25 11:57:07.382: ERROR/AndroidRuntime(952):     at android.widget.TabHost$ViewIdContentStrategy.&lt;init&gt;(TabHost.java:539)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at android.widget.TabHost$ViewIdContentStrategy.&lt;init&gt;(TabHost.java:530)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at android.widget.TabHost$TabSpec.setContent(TabHost.java:417)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at com.android.app.Tab_Proj1.Tab_Proj1.onCreate(Tab_Proj1.java:52)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)01-25 11:57:07.382: ERROR/AndroidRuntime(952):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)</code></pre><p>Am I going in correct direction?</p><p>Thanks </p>","264090","","6369","","2011-03-08 09:05:08","2011-10-29 19:22:05","Android : launching diff activities under TabWidget","<android><android-emulator><android-widget><android-manifest>","3","1","1","",""
"2130875","1","","","2010-01-25 07:48:28","19","21682","<p>Got a little problem with a functionnality I'd like to implement.I've got a linear layout, containing 2 TextViews. I'd want to set a onClickListener on it, so that it would behave just like an item in a ListView.I've tried some possible implementation of this, and got it working using the xml attribute android:onClick of the LinearLayout.As I want the application to visually react to a click on the LinearLayout (as in a ListView), I put this in the listener callback method :l.setBackgroundColor(android.R.drawable.list_selector_background);l is a LinearLayout object, initialised with findViewById();I get an application not responding whenever I try to click on the layout. I tried to replace the code in the callback method by a Toast message show up, and it works, so I guess the problem is in the setBackgroundColor.</p><p>Is anyone familiar with this?</p><p>PS: sorry, I can't post more code right now, I'm at work.</p>","","user258241","","","","2014-03-15 07:03:02","onClickListener on a LinearLayout","<android>","4","1","3","",""
"2130932","1","2131051","","2010-01-25 08:06:05","88","109649","<p>I'm trying to save my file to the following location<br><code>FileOutputStream fos = new FileOutputStream(""/sdcard/Wallpaper/""+fileName);</code>but I'm getting hte exception <code>java.io.FileNotFoundException</code><br>However, when I put the path as <code>""/sdcard/""</code> it works.</p><p>Now I'm assuming that I'm not able to create directory automatically this way.</p><p>Can someone suggest how to create a <code>directory and sub-directory</code> via code?</p>","237403","","510491","","2013-07-15 05:46:14","2013-08-25 01:44:18","How to create directory automatically on SD card","<android><android-file>","9","0","37","",""
"2131123","1","2131954","","2010-01-25 08:53:30","15","16817","<p>I have an application with 2 activities, LogonAct and MainAct. LogonAct is a logon activity which I want to force the user to go through each time they return to the application. I've set <strong>android:clearTaskOnLaunch=""true""</strong> on LogonAct.</p><p>When I first start the app I go through this sequence of screens,</p><p><code>Home -&gt; LogonAct -&gt; MainAct -&gt; Home</code></p><p>I then follow this sequence,</p><p><code>LogonAct -&gt; Back -&gt; MainAct</code></p><p>Why is it bringing me back to MainAct? Shouldn't that activity haven been closed since LogonAct has <strong>android:clearTaskOnLaunch=""true""</strong>. I expected to be brought back to Home when I hit the Back button from LogonAct.</p><p>Relevant snippets from AndroidManifest.xml,</p><blockquote><pre><code>   &lt;activity android:name="".LogonAct""             android:clearTaskOnLaunch=""true""&gt;       &lt;intent-filter&gt;           &lt;action android:name=""android.intent.action.MAIN""/&gt;           &lt;category android:name=""android.intent.category.LAUNCHER""/&gt;       &lt;/intent-filter&gt;   &lt;/activity&gt;   &lt;activity android:name="".MainAct""&gt;       &lt;meta-data android:name=""android.app.default_searchable""                  android:value="".SearchResults"" /&gt;   &lt;/activity&gt;</code></pre></blockquote><p>I'm using 1.5.</p><p>Any help appreciated.</p>","219525","","219525","","2010-01-25 23:09:15","2011-06-02 04:42:27","How to clear stack back to root activity when user leaves application?","<android><activity>","2","2","5","",""
"2131243","1","","","2010-01-25 09:22:12","0","894","<p>how to set the custom options panel in android?</p>","258283","","","","","2010-01-25 10:43:20","how to set the custom options panel in android?","<android>","1","1","","",""
"2131638","1","2131897","","2010-01-25 10:35:45","5","1953","<p>How to detect GPS signal strength such as low (weak) or high ?</p><p>is there an API class ?</p><p>Thanks in advance.</p>","164589","","","","","2010-01-27 14:55:04","How to detect whether GPS signal is weak or high?","<android>","2","0","2","",""
"2131690","1","","","2010-01-25 10:46:18","6","5057","<p>I'm developing an application that should add it's shortcut to home screen after installation and remove it after the application is being uninstalled. The application will be preinstalled on the end user device, but still should have an option for uninstall). The task looks very simple but I've faced lots of troubles implementing it.</p><p><strong>What I have done:</strong></p><ul><li>Add shortcut to the home screen usingcom.android.launcher.action.INSTALL_SHORTCUTon app first launch or on newt devicereboot.</li><li>MANUALY remove shortcut usingcom.android.launcher.action.UNINSTALL_SHORTCUT.</li></ul><p><strong>What I can't (and almost giving up):</strong></p><ul><li>Automaticaly remove the shortcut whenthe application is being uninstalled.</li></ul><p>There's not way to use Intent.ACTION_PACKAGE_REMOVED because the application being uninstalled does not receive this intent. I performed some tests and found out that the only shortcut type that is being removed with the application is the shortcut that is created from menu 'Add to home screen => Shortcuts => Applications => Application activity'. The shortcuts that are being created programatically or that are declared in AndroidManifest remain on home screen after the app is uninstalled.</p><p>There's almost none docs and posts on forums about this topic and I'm confused a little bit why such a simple operation that doesn't contradict with the Android security policy could not be implemented in a straight way.</p><p>Is there any way to ask OS to remove the corresponding shortcut on application uninstall?Can I catch the event that the application is being uninstalled before it is removed?</p>","258261","","","","","2012-11-06 13:37:26","How to remove application shortcut from home screen on uninstall automaticaly?","<android><uninstall><shortcuts><homescreen><launcher>","3","0","3","",""
"2131947","1","2132219","","2010-01-25 11:40:56","15","40039","<p>I am getting a ""bitmap size exceeds VM budget"" error. I have read that there is a 16MB memory limit. <a href=""http://groups.google.com/group/android-beginners/browse_thread/thread/6da00e2b221822f/cf80634230b63814?lnk=gst&amp;q=screen+rotation+bitmap#cf80634230b63814"">In this thread</a> Romain Guy says that ""you can only allocate 16 MB of memory for your entire application"".</p><p>However, my app must be running out of memory long before it reaches that limit. So my question is: how do I allocate memory to my application ... how can I get the allocation to my app increased (within the 16MB maximum)? </p>","250845","","","","","2012-12-26 09:46:02","Android memory allocation","<android><memory-allocation>","4","1","13","",""
"2131948","1","2134602","","2010-01-25 11:42:02","66","21378","<p>How do I force the screen to stay active and not shut off while my app is running?</p>","244190","","114066","","2010-09-27 07:56:56","2013-12-30 05:14:47","Force Screen On","<android>","3","0","40","",""
"2132033","1","2132075","","2010-01-25 11:59:57","3","2935","<p>I am finding that performance degrades after one or more screen rotations, and I presume that this is likely to be because an App's main Activity is destroyed and recreated each time the screen is rotated and that my app must be leaking memory when that happens.</p><p>I have read that, contrary to what one might expect, not all the objects created by an app's main Activity (or in classes called by that Activity) are destroyed when the activity is destroyed. Specifically, I think I have read (although I can't now find where) that if the View uses a large bitmap member object then the Activity's onDestroy() method should be over-ridden and the bitmap should be explicitly recycled.</p><p>Are there other objects that need to be destroyed or removed when the Activity is destroyed? What about Listeners? Is there a comprehensive tutorial or guide on this subject?</p>","250845","","","","","2011-03-27 00:27:59","Android: removing/destroying objects when screen is rotated","<android><memory-leaks><object>","2","0","1","",""
"2132124","1","","","2010-01-25 12:17:38","0","955","<p>HiI am new to the android .In android in exact what application socket programming is used?,give example with digram if posible. which is client, which is serve?r </p><p>--kiran</p>","258398","","","","","2010-01-25 12:56:00","client server in android","<android><client>","1","0","","",""
"2132241","1","2132288","","2010-01-25 12:40:24","1","8210","<p>Hay Guys, I'm new to Android but heres what i want to do.</p><p>I want to beable to open a connect to a server using a given IP and PORT, then send commands to the server and get data back.</p><p>Any ideas what i need to google to help on this? I know how to do it in PHP (using fputs, fgets, and fsockopen).</p><p>any help would be brill.</p><p>Thanks</p>","164230","","115145","","2010-01-25 12:49:33","2010-01-25 12:49:38","android open socket and send commands","<java><android><sockets>","1","0","4","",""
"2132248","1","","","2010-01-25 12:40:51","0","134","<p>I have coded a Web call, but when i want to try my Android application into the Android device, the response is a socket exception ""unreachable destination"" (in my mobile device), but if i try with Android Simulator works well (no problems, no exception). My mobile device is connected via UMTS to the service provider, no WIFI.</p><p>My Android model and firmware is the following:</p><p>HTC MagicFirmware: 1.6.</p><p>Thanks a lot.</p>","258413","","","","","2010-01-25 17:26:44","Destination unreacheable (Android mobile)","<android>","2","0","","",""
"2132365","1","2132400","","2010-01-25 12:58:48","0","526","<p>can any one guide me what mistake am i doing in this code??? it not seems to be working.. </p><p>i have two activies </p><pre><code>public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.main);     Intent intent = new Intent(DataPassing.this, DataPassing2.class);     Bundle b = new Bundle();     b.putInt(""key"", 1123);     intent.putExtras(b);     startActivity(intent);     finish(); } </code></pre><p>and in second activity i have written </p><pre><code>public void onCreate(Bundle savedInstanceState) {     Bundle b = getIntent().getExtras();     int value = b.getInt(""key"", 0);     Toast.makeText(this, value, Toast.LENGTH_SHORT).show(); } </code></pre><p>but the code is giving me error i dont know why.. i have added second activity to manifest file.. please guide what mistake i am doing ??? </p><p>any help would be appriciated..</p>","249991","","133802","","2010-01-25 13:00:00","2011-04-08 02:13:33","problem in passing data in android Activities?","<android><activity>","2","1","","",""
"2132370","1","2133897","","2010-01-25 12:59:12","16","7357","<p>I am using it, but it always returns 0, even though I have scrolled till the end of the list.</p>","232798","","","","","2012-12-04 16:54:56","Android: ListView.getScrollY() - does it work?","<android>","2","1","1","",""
"2132518","1","2139789","","2010-01-25 13:24:20","0","2008","<p>I have some questions concerning the communication between an Activity and a Service.I'd like to write a speedmeter application, where the UI is constantly updated with new data derived from the GPS sensor.</p><p>So far, I have an LocationListener running in a service. What is the best practice in Android:</p><p>1) Access the service from an Activity, let's say every second and update the UI. Or,<br>2) Let the service update the UI.</p><p>Could you provide some helpful links for case 2), please?. </p><p>Case 1) shouldn't be a problem with a LocalService and an IBinder interface, right?</p><p>Thanks!</p>","168954","","","","","2010-01-26 13:57:53","Android: Communication Activity / Service","<android>","1","2","2","",""
"2132695","1","","","2010-01-25 13:55:47","1","837","<p>I'm trying to add some custom menu items to some EditText-instances. They appear on in the menu, but when I click the buttons the onTextContentMenuItem-method is not called. The EditText-instances are in a ListView if that matters.</p><p>Any advice on the matter? </p><p>Relevant code:</p><pre><code>class DocumentFragment extends EditText {  public DocumentFragment(Context context) {   super(context);  }  @Override  public void onCreateContextMenu(ContextMenu menu) {   menu.add(Menu.CATEGORY_ALTERNATIVE, CONVERT_TO_H1, Menu.NONE, ""Convert to H1"");      menu.add(Menu.CATEGORY_ALTERNATIVE, CONVERT_TO_P, Menu.NONE,  ""Convert to P"");      super.onCreateContextMenu(menu);  }  @Override  public boolean onTextContextMenuItem(int id) {   Log.i(""ID"", String.valueOf(id)); // The id of CONVERT_TO_{H1,P} never appears.   return super.onTextContextMenuItem(id);  } }</code></pre>","241196","","","","","2012-12-01 04:46:44","onTextContextMenuItem is not called on custom menu items","<android><contextmenu>","2","0","1","",""
"2132908","1","2132984","","2010-01-25 14:30:40","5","2738","<p>Here <a href=""http://source.android.com/source/code-style.html#follow-field-naming-conventions"" rel=""nofollow"">http://source.android.com/source/code-style.html#follow-field-naming-conventions</a> it is stated that :</p><p>""Field Names<br>    * Non-public, non-static field names start with m.<br>    * Static field names start with s.<br>    * Other fields start with a lower case letter.<br>    * Public static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES.""also states that :""The rules below are not guidelines or recommendations, but strict rules. You may not disregard the rules we list below except as approved on a need-to-use basis.""</p><p>I don't like the ""m"" convention before private or package fields in a class... I really find this uninspired... I mean, if we try to apply good designs, the low coupling of the classes implies having few public fields. actually, in my programs I usually have no public fields, even when I need some I use getters and seters... so, why should I be forced to have almost all my fields in the program with an ""m"" in front of them? wouldn't be easier to have the few public fields, if there are any, with some ""g"" in front or something? or just use setters and geters as beans suggest? this really makes my code harder to read.... </p><p>also, following these guidelines, local temp variables used in the methods have no restriction so they could easily be mistaken for public global fields (also without restriction)... this also I find to be wrong, as it is a probable source of mistakes... I understand to have a way of differentiating from fields, but private/protected member fields are the most used in an application, they shouldn't be less ""readable"".what do you think? should I follow the guidelines?</p>","258491","","139010","","2011-04-14 03:08:15","2011-06-22 23:17:41","Android private fields naming guidelines are ok?","<android><coding-style><field><private>","2","3","2","",""
"2133957","1","2133987","","2010-01-25 16:55:53","7","12634","<p>Was wondering if anyone could help me on background threading on Android.</p><p>I have a piece of code that records from the mic of the device and then plays back what it records through the ear piece(on 1.5).</p><p>I am trying to run it in a thread but have been unsuccessful in getting it to run as a background thread. </p><p>Currently it runs and locks up the activity so that all thats happening is the thread is running and the UI is locked up or appears to be hanging.</p><p>Here is the lastest way I tried to do it:</p><pre><code>public class LoopProg extends Activity {boolean isRecording; //currently not used  public void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);   setContentView(R.layout.main);   AudioManager audio_service = (AudioManager) getSystemService(Context.AUDIO_SERVICE);   audio_service.setSpeakerphoneOn(false);   audio_service.setMode(AudioManager.MODE_IN_CALL);   audio_service.setRouting(AudioManager.MODE_NORMAL,   AudioManager.ROUTE_EARPIECE, AudioManager.ROUTE_ALL);   Record record = new Record();     record.run(); }  public class Record extends Thread  {          static final int bufferSize = 200000;          final short[] buffer = new short[bufferSize];          short[] readBuffer = new short[bufferSize];          public void run() {              isRecording = true;            android.os.Process.setThreadPriority            (android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);            int buffersize = AudioRecord.getMinBufferSize(11025,            AudioFormat.CHANNEL_CONFIGURATION_MONO,            AudioFormat.ENCODING_PCM_16BIT);                           AudioRecord arec = new AudioRecord(MediaRecorder.AudioSource.MIC,                                           11025,                                           AudioFormat.CHANNEL_CONFIGURATION_MONO,                                           AudioFormat.ENCODING_PCM_16BIT,                                           buffersize);                           AudioTrack atrack = new AudioTrack(AudioManager.STREAM_VOICE_CALL,                                           11025,                                           AudioFormat.CHANNEL_CONFIGURATION_MONO,                                           AudioFormat.ENCODING_PCM_16BIT,                                           buffersize,                                           AudioTrack.MODE_STREAM);                           setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);                           atrack.setPlaybackRate(11025);                           byte[] buffer = new byte[buffersize];                           arec.startRecording();                           atrack.play();                           while(isRecording) {                                   arec.read(buffer, 0, buffersize);                                   atrack.write(buffer, 0, buffer.length);                           }                           arec.stop();                           atrack.stop();                           isRecording = false;              }      }}</code></pre><p>I was wondering if anybody could guide me on how to turn this into a background thread? Or prehaps point me to some tutorial that may be relevant that I may have missed?</p><p>Thanks in advance</p>","243999","","562073","","2011-05-25 17:56:11","2011-09-02 19:06:55","Android - how to do background threading properly?","<android><audio><multithreading><background>","2","0","3","",""
"2133986","1","2134008","","2010-01-25 16:59:49","29","6753","<p>I noticed that an alarm is disabled when the application which sets this alarm has been upgraded. <strong>Is that true ?</strong></p><p>Until now, I used the <code>SharedPreferences</code> with a <code>FIRST_RUN</code> key in order to know if it's the first run of my application. If I don't find this key, I enable the alarm and set <code>FIRST_RUN</code> to false, else I do nothing.</p><p>But I noticed also that these preferences remain intact between app upgrade !</p><p>So after an upgrade, the <code>FIRST_RUN</code> key is already false, so I do nothing while my alarm need to be enabled.</p><p>How to handle such case ?</p><p>Thanks in advance</p>","231417","","231417","","2010-01-25 17:57:24","2014-02-03 16:35:26","How to know my Android application has been upgraded in order to reset an alarm?","<android>","3","0","22","",""
"2134089","1","2134194","","2010-01-25 17:14:56","0","135","<p>This seems like the answer would be no, but does anyone know if it is possible to build a custom app into a custom-built version of Android and then load that apk file onto a different device?  Obviously, if you make changes to the OS and then rely on them in your app, you can't, but assuming you use the source as-is (or the appropriate version) from the repo can it be done?</p><p>If you can, you could theoretically link against things that are otherwise considered to be hidden in the SDK, right?  Or am I completely off base here?</p><p>Thanks,Chris</p>","150771","","","","","2010-01-25 17:29:12","Can I load an app built with Android source onto other devices?","<android>","2","0","","",""
"2134458","1","","","2010-01-25 18:09:04","4","10756","<p>I need to build a custom android screen saver so anoboy could explain me how to create an activity that will be launched instead of the default screensaver which show only basic informations as Network, DateTime and alarms...</p><p>Tanks for ur help!</p>","","user258654","","","","2011-03-10 15:42:01","Custom Android Screensaver (or sleep screen)","<android>","2","2","","",""
"2134591","1","","","2010-01-25 18:30:51","21","12059","<p>Is it possible to add a little bit of space between a RadioButton and the label while still using Android's built-in components? By default the text looks a little scrunched.</p><pre><code>&lt;RadioButton android:id=""@+id/rb1""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:text=""My Text""/&gt;</code></pre><p>I've tried a couple of things:</p><ol><li><p>Specifying margin and padding seem to add space around the entire element (button and text, together). That makes sense, but doesn't do what I need.</p></li><li><p>Creating a custom drawable via XML specifying images for the checked and unchecked states, then adding a few extra pixels to the right side of each image. This should work, but now you are stepping outside the default UI. (Not the end of the world, but not ideal)</p></li><li><p>Add extra whitespace to the beginning of each label. Android seems to trim a leading space character, as in "" My String"", but specifying unicode U+00A0, as in ""\u00A0My String"" does the trick. This works, but it seems kinda dirty.</p></li></ol><p>Any better solutions?</p>","23977","","","","","2013-05-30 02:54:07","Add margin between a radiobutton its label in Android?","<android><radio-button>","6","0","5","",""
"2135378","1","2136927","","2010-01-25 20:27:27","28","12707","<p>I've been looking around, in vain, for some information on using a dependency injection container in Android development. Specifically, how to override the creation of an <code>Activity</code> in a way that will also work when coming back from being killed (for whatever reason).</p><p>Has anyone got any experience in this area?</p>","3603","","82156","","2010-03-03 00:07:02","2014-02-24 14:06:42","Android and Dependency Injection","<android><spring><dependency-injection><inversion-of-control>","5","1","15","",""
"2135522","1","2135611","","2010-01-25 20:49:43","0","2106","<p>I am a C# developer and getting started with Android.  I am attempting to duplicate a couple applications I already have in VS.  The project is made of 2 executables and 1 common assembly.  The 2 executables contain the application specific logic while the common contains centralized forms and logic (such as login form).  I am using Eclipse.  So how can I accomplish this layout?</p><p>Thanks</p>","24500","","","","","2011-03-16 07:40:19","Adding a project reference to an android project","<android>","1","0","","",""
"2135778","1","","","2010-01-25 21:27:57","1","777","<p>Is there any way to query a root view of an activity for all of its child views even before the root view or its children have been inflated?  I guess what I'm looking for is whether a view knows ahead of time what children it will have before it gets inflated, and can I get that list in some way.  Bizarre I realize, but I think it will help me with some unconventional automation testing I'm working on.  I haven't found anything in the API like this, so I'm hoping the community knows something spiff that will help.</p><p>Thanks!</p>","234894","","","","","2010-01-25 21:37:21","Do root views of an Activity in Android have any prior knowledge of the child views that will be loaded into them?","<android><view><activity><inflate>","1","0","","","2010-01-25 21:27:57"
"2136136","1","2136277","","2010-01-25 22:24:59","0","552","<pre><code>import android.app.Activity;import android.os.Bundle;import android.view.KeyEvent;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.Spinner;import android.widget.SpinnerAdapter;import android.widget.TextView;public class calctest extends Activity {/** Called when the activity is first created. */private EditText input; private EditText input2; private EditText input3; private EditText input4;private TextView output;private TextView output2;private Spinner aperture;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main); // Extract the text fields from the XML layout     input = (EditText) findViewById(R.id.input1);     input2 = (EditText) findViewById(R.id.input2);    input3 = (EditText) findViewById(R.id.input3);     input4 = (EditText) findViewById(R.id.input4);    output = (TextView) findViewById(R.id.result);     output2 = (TextView) findViewById(R.id.result2);    //aperture dropdown    final Spinner aperture = (Spinner) findViewById(R.id.apt);    ArrayAdapter adapter = ArrayAdapter.createFromResource(    this, R.array.apertures, android.R.layout.simple_spinner_item);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    aperture.setAdapter(adapter);    Spinner mode = (Spinner) findViewById(R.id.mode);    ArrayAdapter adapter2 = ArrayAdapter.createFromResource(    this, R.array.formats, android.R.layout.simple_spinner_item);    adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    mode.setAdapter(adapter2);    // Perform calculation when button is pushed    final Button button = (Button) findViewById(R.id.calculate);    button.setOnClickListener(new View.OnClickListener() {                     public void onClick(View v) {                             doCalculation(aperture.getSelectedItem());                }                     });        }private void doCalculation(Object selectedItem) {     // Get entered input value     String cinput1 = input.getText().toString();     String cinput2 = input2.getText().toString();    String cinput3 = input3.getText().toString();     String cinput4 = input4.getText().toString();    Object cinput5 = aperture.getSelectedItem();}</code></pre><p>}</p><p>I know that the doCalculation method isnt actually calculating anything yet, because the app crashes just from trying to get the input's value. If I disable the cinput5 line, it works just fine. What am I doing wrong here? And on that note, how do I convert the spinner's value to a string to use in the calculation?</p><p>Also, as a double check... the spinner displays a list of numbers (1.4, 2, 2.8, 4, 5.6, etc) and whichever number is selected is the number I need to use in the calculation. I'm calling the correct value from the spinner, right?</p><p>I apologize for the probably extremely obvious errors. I just started Java and after I finish this app is <em>promise</em> I will be getting a book!</p>","257881","","","","","2010-01-25 22:48:23","App crashes when calling Spinner value in calculation?","<java><android><math><spinner>","1","0","","",""
"2136258","1","2139780","","2010-01-25 22:44:55","4","17340","<p>I have some custom class BitmapStorage, not attached to any View or whatever - an utility one. And I have born_animation.xml file which contains &lt;animation-list&gt; with animation frames:</p><pre><code>&lt;animation-list oneshot=""true"" &gt;    &lt;item drawable=""@drawable/frame01"" /&gt;    &lt;item drawable=""@drawable/frame02"" /&gt;&lt;/animation-list&gt;</code></pre><p>I want to load animation from xml file as an AnimationDrawable using Resources class (so it would do all the parsing for me), extract Bitmaps and put them to my custom storage class. </p><p>The problem i have: </p><pre><code>Resources res = context.getResources(); AnimationDrawable drawable = (AnimationDrawable)res.getDrawable(R.drawable.born_animation); assertTrue( drawable != null ); &lt;= fails! it's null </code></pre><p>WTF? Can someone explain me that? Code compiles fine. All resources are in place. </p><p>I tried another way - use ImageView to do the parsing (like described in dev guide) </p><pre><code>ImageView view = new ImageView(context); view.setBackgroundResource(R.drawable.born_animation); AnimationDrawable drawable = (AnimationDrawable)view.getBackground(); assertTrue( drawable != null ); &lt;= fails! it's null </code></pre><p>Results are the same. it returns the null drawable. </p><p>Any hinsts would be greatly appreciated, thanks in advance.</p>","258848","","1777090","","2012-11-27 04:06:57","2012-11-27 04:06:57","How to load AnimationDrawable from xml file","<android><android-animation>","3","1","","",""
"2136470","1","2136509","","2010-01-25 23:23:35","0","974","<p>I have one question:</p><p>How can I select what soft-keyboard an edittext will load?</p><p>Thanks</p>","258863","","126562","","2010-05-18 06:13:20","2010-05-18 06:13:20","New soft-keyboard","<android><keyboard>","2","0","","",""
"2136696","1","","","2010-01-26 00:10:29","0","3442","<p>I have a layout which contains five TextView. When user clicks any of the five TextView, it will do the same thing: open another activity. So, the OnClickerListener behavior to the five TextView is the same.Is it possible that I only add OnClickListerner to one view, e.g. to layout, so I don't have to add OnClickListerner to each of the five TextView?Put it another way, if none of the children components receives CLICK event, will the CLICK event passed through to their parent, the layout? </p><p>Thanks.</p>","256239","","","","","2012-08-24 03:40:43","Pass event to parent view?","<java><android>","2","1","","",""
"2136895","1","2137050","","2010-01-26 00:53:31","0","3250","<p>I have a textView which is configured as an EditText. But the problem is that the cursor doesn't appear when i'm pressing keys (text is written correctly).</p><p>Thanks</p>","258863","","","","","2010-01-26 02:02:12","Android: textView doesn't show cursor","<android><textview>","1","0","","",""
"2136916","1","2143532","","2010-01-26 00:59:50","0","937","<p>In my searchable.xml, I have:</p><pre><code>android:voiceSearchMode=""showVoiceSearchButton|launchRecognizer""</code></pre><p>I get the search string returned SearchManager like so:</p><pre><code>if (Intent.ACTION_SEARCH.equals(action)) {  searchString = intent.getStringExtra(SearchManager.QUERY);}</code></pre><p>Is there any way to get from the intent whether the search string came from the keyboard, or as a result of voice search and the speech Recognizer?</p><p>I know I can put entities like:</p><blockquote><pre><code>&lt;actionkey android:keycode=""KEYCODE_SEARCH"" android:queryActionMsg=""search""/&gt;&lt;actionkey android:keycode=""KEYCODE_ENTER"" android:queryActionMsg=""enter""/&gt;</code></pre></blockquote><p>in my searchable.xml file, and then use intent.getIntExtra(SearchManager.ACTION_KEY,-999) to see if the search started because the user hit the <strong>Enter</strong> key on the keyboard, or the hardware <strong>Search</strong> button, but I don't see how to detect that the search was started from the ""microphone"" icon button, or the ""search"" icon button in the search bar.</p><p>(In the case of a voice search, I need to echo the text back to the user while I do a further web lookup. For a text search, echoing what the user just typed is redundant.)</p><p>How can I tell the difference?</p>","42287","","","","","2010-01-26 23:35:27","How can I tell if the search string returned from SearchManager is a result of a VoiceSearch?","<android>","2","0","2","",""
"2136977","1","2137024","","2010-01-26 01:18:54","1","2697","<p>I have an object that has (among other things) a list of Intents.  I want to pass this object as an extra to an Intent.  However, the Intent class is not serializable, it is just ""Parcelable"".  </p><p>I assume that Parcelable is the android version of Serializable, but I'd rather not have to write my own serialization code for my class, and Parcelable seems to require that.</p><p>Anyone have any solutions to this other than just reimplementing the Intent as a serializable class?</p>","234039","","","","","2013-07-18 07:58:39","Android: Serializable Intent","<android><android-intent>","2","0","","",""
"2137340","1","2138341","","2010-01-26 03:19:50","2","4573","<p>I want to have a font-size preference in percentage relative to the default font-size, so I need to get the default font-size for a TextView.</p><p>How do I get the default font-size of a TextView?</p>","11238","","","","","2010-10-11 11:40:28","Getting the default font size of a multiline TextView in Android","<android><textview><font-size>","2","0","","",""
"2137396","1","","","2010-01-26 03:40:26","1","2359","<p>How would I go about converting a measurement from, for example, 12.5 feet to 12ft 6in? How would I created that second number which reads only the decimal place when multiplying by 12?</p><p>right now I have double Measurement01 using other variables and some math to get me the feet in decimals. I send that to a textview with farf.setText(Measurement01 + "" "" + ""ft"");</p><p>Any help would be appreciated!</p>","257881","","","","","2010-01-26 04:53:40","Convert decimal feet to feet and inches?","<android><decimal>","3","0","","",""
"2137514","1","","","2010-01-26 04:24:52","3","8735","<p>I am trying to pass an integer between activities using an intent. The source activity makes the calls info.id is the selected item from a ListView. </p><pre><code>Intent intent = new Intent(myActivity.this, newClass.class); intent.putExtra(""selectedItem"", info.id); this.startActivity(intent); </code></pre><p>The target activity retrieves the intent using getIntent then calls </p><pre><code>int iSelectedItem = intent.getIntExtra(""selectedItem"", -1); </code></pre><p>iSelectedItem is always -1 instead of the value passed to putExtra. Can someone tell me what I am doing wrong or do I misunderstand the use of intents? </p>","258998","","507519","","2012-01-07 01:26:53","2013-10-18 22:28:40","getIntExtra always returns the default value","<android>","5","0","2","",""
"2137537","1","2137547","","2010-01-26 04:32:25","-1","114","<p>In my calculation app, which takes a few inputs and uses them in a fixed formula to produce multiple outputs, the application crashes if I try to run it without putting a value into every input.</p><p>I know how to catch exceptions, but I don't know the name of the exception that would be thrown by this kind of error. Can anyone help me out on this?</p>","257881","","","","","2010-01-26 17:51:22","Exception for an unentered value?","<java><android><exception>","5","0","","",""
"2137947","1","","","2010-01-26 07:10:29","0","160","<p>I am doing an application in which I have to display the numbers on TextView randomly and automatically with the help of Timer. I am able to get the random Numbers in the log without repeating, but I am not able to print the same on device please help me...</p><p>Regards,Akki </p><p>Source:</p><pre><code>//RandomNumber.javapublic class RandomNumber extends Activity{    static Random randGen = new Random();    int tambolanum,count=0;    private Button previousbutton;    private Button startbutton;    private Button nextbutton;    int bingonum[]=new int[90];    boolean fill;    @Override public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.numbers);        LinearLayout number=(LinearLayout)findViewById(R.id.numbersview);        final TextView randomnum=(TextView)findViewById(R.id.numberstext);        previousbutton=(Button)findViewById(R.id.previous);        nextbutton=(Button)findViewById(R.id.next);        startbutton=(Button)findViewById(R.id.start);        startbutton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                // Perform action on click                //--- Initialize the array to the ints 0-90                do{                    fill = true;                    //Get new random number                    tambolanum = randGen.nextInt(90) + 1;                    //If the number exists in the array already, don't add it again                    for(int i = 0; i &lt; bingonum.length; i++)                    {                        if(bingonum == tambolanum)                        {                            fill = false;                        }                    }                    //If the number didn't already exist, put it in the array and move                     //To the next position                    if(fill == true)                    {                        bingonum[count] = tambolanum;                        count++;                    }                } while(count &lt; 90);                for(i=0;i                {                    randomnum.setText(Integer.toString(bingonum[i]);                }             }</code></pre>","259048","","76835","","2010-01-28 04:06:12","2010-01-28 04:11:43","Regarding android Development","<android>","2","1","","",""
"2138087","1","2138103","","2010-01-26 07:51:17","0","396","<p>i created google map test application on two difference computers A, B i created two MD5 finger prints on both and obtained two different keys from google for Computer A and B. </p><p>Key of Computer A does not show google map on Computer B and vise versa.Key of computer A only shows google map on Computer a only and same case with key B.</p><p>now if i deploy or publish that project to use in android mobile which key will i be using ??? </p><p>i am confused.. please guide..</p>","249991","","","","","2010-01-26 08:33:10","Google Map Deployement Or Publishing Problem in Android?","<android><google-maps>","1","0","1","","2010-01-26 07:51:17"
"2138238","1","","","2010-01-26 08:37:01","1","2138","<p>I want to catch any onTouchEvent() on the mapview. After search lots of questions&amp;answers, I found only when I write my own MapView(MyMapView)and define onTouchEvent, then use this MyMapView in main activity.</p><p>Is it the only way??</p>","164005","","","","","2010-01-27 01:45:43","Does onTouchEvent() has to extends from MapView?","<android><android-mapview>","2","0","","",""
"2138510","1","","","2010-01-26 09:36:14","14","5041","<p>I wanna know about max thread number for one application.</p><p>You know Thread.activeCount() returns the number of active Threads in the running Thread's group and its subgroups. </p><p>If I can know the max number of threads to create in current activity, I can limit active threads.</p><p>I am using thread for http connection and catching Http response.</p><p>Thanks in advance.</p>","227889","","","","","2010-01-26 10:51:16","Max thread number for one application?","<android>","1","1","1","",""
"2138897","1","2138966","","2010-01-26 10:56:59","0","345","<p>I'm considering to develop owner drawn EditText widget.So, what do you think I should read or refer, firstly?Or, could you give me some good examples of both owner drawn widget or custom widget?</p>","258508","","","","","2010-01-26 11:13:58","About owner drawn (custom widget)","<android>","1","0","","",""
"2138980","1","2139032","","2010-01-26 11:17:17","0","890","<p>I am trying to show custom alert from onActivityResult. I need to inflate it, so am getting context with <code>getApplicationContext()</code> and everything is fine until I execute <code>alertDialog.show()</code> - then it fails with: </p><pre><code>Unable to add window -- token null is not for an application</code></pre><p>Do you know why I cannot do it? </p><p>(it happens on 1.6 and 2.0 - I didn't test others)</p>","58862","","","","","2010-01-26 11:29:53","Alert shown in onActivityResult","<android>","1","0","","",""
"2139031","1","","","2010-01-26 11:29:40","4","1073","<p>I am trying by using javascript to get the window width and height of the build in webbrowser but can't find the right method, currently it seems the DOM doesn't know about the zoom level changes.</p><p>Thanks </p>","259173","","","","","2011-11-30 16:15:35","Get window inner width and height of android built in webbrowser at all zoom levels","<android><web-browser><height><width><zoom>","1","0","1","",""
"2139134","1","2236529","","2010-01-26 11:52:01","217","168121","<p>How can I pass an object of a custom type from one <a href=""http://developer.android.com/reference/android/app/Activity.html"">Activity</a> to another using the <code>putExtra()</code> method of the class <a href=""http://developer.android.com/reference/android/content/Intent.html"">Intent</a>?</p>","249991","","844882","","2012-07-02 03:59:07","2014-03-13 17:11:39","How to send an object from one Android Activity to another using Intents?","<android><android-intent><android-activity>","17","3","107","","2010-01-26 11:52:01"
"2139410","1","2139444","","2010-01-26 12:52:50","10","12087","<p>I'm developing an Android app (Android 1.6), but this is probably a more general Java question.</p><p>I have an ArrayList of about 10,000 objects</p><p>the objects contain 3 strings (firstName, middleName, lastName).</p><p>The user is presented with a ""search box"" on android where they can search for a particular ""object"" by typing in part of the name.</p><p>I have a class (which I call Filterer) that searches through the list of 10,000 for matching objects and then returns them as a ""sublist"".</p><p>The search is a little bit SLOW (especially on an Android handset) and I'm sure I'm not doing the search/filtering in the most efficient manner possible.</p><p>Does anyone have any suggestions on how to speed up my search?  My code is below.  One possibility to to search against a secondary ""masterList"" that already has every piece of information in lowercase and concatenated…but there may be additional ways to improve this search that would also help.</p><p>TIA!!</p><pre><code>public void filterNames() {  this.filteredList.clear();  String sv = this.searchString.toString.trim().toLowerCase(); // search value  for (int i = 0; i &lt; this.masterList.size(); i++) {    MyObject d = this.masterList.get(i);    String fn = d.getFirstName().toString().toLowerCase();    String mn = d.getMiddleName().toString().toLowerCase();    String ln = d.getLastName().toString().toLowerCase();    if (fn.indexOf(sv) &gt;= 0 ||         md.indexOf(sv) &gt;= 0 ||         ln.indexOf(sv) &gt;= 0) {      this.currentList.add(d);    }  }}</code></pre>","141146","","236831","","2011-03-18 14:16:12","2011-03-18 14:16:12","Efficiently filter an ArrayList in Java/Android","<java><android><filter><arraylist>","4","1","5","",""
"2139418","1","13472365","","2010-01-26 12:55:08","1","430","<p>I have a ""dumb"" custom Android widget (as in <code>View</code>, not a home screen widget) that I need to have retain some state during screen rotations.  This <code>PlayerWidget</code> is essentially a media player UI with some buttons (back, forward, play/pause) and a progress bar.  It exposes the important bits of UI via getters.</p><p>There are a few separate <code>Activities</code>, each of which has a specialised controller object &mdash; these use the getters to update whether the buttons should be enabled, or have a ""play"" or a ""pause"" icon, and updates the progress bar as it receives callbacks from a background <code>Service</code>.</p><p>For example, in one controller's ""start playing"" method, it does this:</p><pre><code>mWidget.getMiddleButton().setImageResource(R.drawable.btn_pause);</code></pre><p>There's an <code>Activity</code> where screen rotation is handled via <a href=""http://developer.android.com/reference/android/app/Activity.html#onConfigurationChanged%28android.content.res.Configuration%29"" rel=""nofollow""><code>onConfigurationChanged</code></a> &mdash; this calls <code>setContentView()</code> (because the layout differs between portrait and landscape), and binds the <em>newly-created</em> <code>PlayerWidget</code> to the <em>still-existing</em> controller object.</p><p>That works fine: progress updates start to happen on the new widget instance and the buttons work as expected.</p><p>However, the buttons do not have the correct icons because the <code>PlayerWidget</code> &mdash; not having knowledge of its controller &mdash; does not know how it is being used and thus what it should be displaying.</p><p>I was wondering whether the best idea would be to write <code>getState</code> and <code>restoreState</code> methods that the parent <code>Activity</code> can call before and after the new <code>setContentView()</code>, however I have no way of parceling a <code>Drawable</code> from the <code>ImageButtons</code> &mdash; or is there?</p><p>Or I considered wrapping the <code>ImageButton</code> objects which the <code>PlayerWidget</code> getters return, so that I can save (and thus later restore) the <code>Drawable</code> resource ID that the controller sets.</p><p>Alternatively, when I bind a new <code>PlayerWidget</code> to the controller, the controller could have some sort of ""set-widget-UI-state-based-on-current-controller-state"" method?  That's potentially complex for various reasons, but feels like the ""right"" way of doing it.</p><p>Any input on this slightly rambling problem would be appreciated! :)</p>","234938","","","","","2012-11-20 11:38:04","Saving and restoring non-Parcelable UI state for a dumb widget","<java><android><model-view-controller><user-interface>","2","0","","",""
"2139422","1","","","2010-01-26 12:56:33","0","553","<p>I have a LinearLayout, when user selects my AutoCompleteTextView(ACTW) I want to move the whole layout upwards, so that the ACTW is at the top and there is space between the ACTW and software keyboard for suggestions. 1) How to do this? 2) How to make this animated (but this is not necessary)?</p>","243225","","","","","2010-01-26 15:25:31","Android: Move whole layout upwards","<android>","1","0","","",""
"2139700","1","2140831","","2010-01-26 13:43:22","7","7860","<p>I have implemented some gesture detection code so that I can detect when a row in my listview (which is situated in a FrameLayout) has been swiped.</p><pre><code>public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {    if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {        int itemId = MainActivity.this.getListView().pointToPosition((int) e1.getX(),(int) e1.getY());        Offer order = (Offer)MainActivity.this.getListView().getAdapter().getItem(itemId);        View v = MainActivity.this.getListView().getChildAt(itemId);    }}</code></pre><p>I want to display a view over the top of the swiped row with a set of context sensitive options for that row.</p><p>My problems is that the following methods:</p><pre><code>v.getTop()v.getBottom()</code></pre><p>return correct values only before the view has been scrolled. I could probably do some calculation to work out offsets using scroll positions etc but I also noticed that I only get values when I swipe a row that is visible on screen to begin with.  If I scroll down the list and then swipe a row (that was not originally off-screen) then these methods return null values.</p><p>The methods below seem to suffer from the same problem...</p><pre><code>v.getLocationOnScreen(loc)v.getLocationInWindow(loc)</code></pre><p>Ultimately, I am looking to find the distance between the top of the visible listView and the row that has been swiped. I will then use this distance to add a view to the parent FrameLayout with the appropriate height padding (so that it covers the swiped row).</p><p>Any help would be much appreciated!</p>","227228","","227228","","2010-01-26 20:08:59","2014-04-14 12:10:28","How to get location (on screen) of row in listview","<android>","3","0","5","",""
"2140023","1","2140259","","2010-01-26 14:35:03","19","9256","<p>How can I programmatically display an hourglass in an Android application ?</p>","164460","","","","","2011-07-13 11:46:24","android hourglass","<android><hourglass>","1","0","14","",""
"2140061","1","2140320","","2010-01-26 14:41:19","0","2406","<p>I have an app with a widget but I am having some difficulty with the layout of the widget.</p><p>The basic idea if the widget should look like an icon and have a little text tag under it like any other icon on the desktop.</p><p>I found one example which uses an android:background for the TextView and uses a drawable XML:</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;solid android:color=""#AA111111""/&gt;&lt;padding android:left=""5dp""   android:right=""5dp""  android:bottom=""1dp""   android:top=""1dp"" /&gt;&lt;corners android:radius=""8dp"" /&gt;&lt;/shape&gt;</code></pre><p>However this does not work brilliantly, the text just isn't the same as the other icons on the desktop and when you rotate the phone part of the text is chopped off!</p><p>The next problem is selecting the widget, I use an ImageButton as the icon - with the android:background set to a transparent image. I have been using another drawable xml file which allows me to change the image when the widget is selected. However I would prefer the default action of an icon, where the square around the icon turns orange.</p><p>How would I achive these two effect - I know it is possible somehow as the app ""sms unread count"" achives exactly what I want to happen!</p>","232565","","","","","2011-12-09 14:57:24","Android Widget Text Background","<android><android-widget>","2","0","","",""
"2140133","1","2140214","","2010-01-26 14:52:18","10","22431","<p>In Android 1.5 (also on 1.6)</p><p>How to add an Access Point from code?</p><p>Given Access point that supports WPA2.Here is my code snippet.</p><pre><code>WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);WifiConfiguration wc = new WifiConfiguration();// This is must be quoted according to the documentation // http://developer.android.com/reference/android/net/wifi/WifiConfiguration.html#SSIDwc.SSID = ""\""SSIDName\"""";wc.preSharedKey  = ""password"";wc.hiddenSSID = true;wc.status = WifiConfiguration.Status.ENABLED;        wc.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);wc.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);wc.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);wc.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);wc.allowedProtocols.set(WifiConfiguration.Protocol.RSN);int res = wifi.addNetwork(wc);Log.d(""WifiPreference"", ""add Network returned "" + res );boolean b = wifi.enableNetwork(res, true);        Log.d(""WifiPreference"", ""enableNetwork returned "" + b );</code></pre><p>This code fails as in LogCat appear </p><blockquote>  <p>01-26 16:44:13.550: ERROR/wpa_supplicant(2032): Line 0: Invalid PSK 'password'.</p></blockquote><p>I am sure that this is the password and that all of the rest of the parameters are right.What do I do I miss?</p>","60114","","","","","2012-12-14 09:18:07","How and what to set to Android WifiConfiguration.preSharedKey to connect to the WPA2 PSK WiFi network","<java><android><wifi>","3","0","17","",""
"2140645","1","2141502","","2010-01-26 16:09:24","1","434","<p>I can run my application on 1.5, 1.6 and 2.0 emulator and on a 1.5 device without any problems. But some of my users are reporting force close and strange menu entries (see the attachment) using 1.6 and higher version devices. Any ideas?</p><p><img src=""http://taypo.com/00.png"" alt=""alt text""></p><p>This screen should look like this: <a href=""http://www.taypo.com/blog/WindowsLiveWriter/TurkceKlavye0.7_6F1/settings_0.7_2.png"" rel=""nofollow"">http://www.taypo.com/blog/WindowsLiveWriter/TurkceKlavye0.7_6F1/settings_0.7_2.png</a></p><p>And the code that generates this screen is: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""&gt;        &lt;PreferenceCategory android:title=""@string/general_settings""&gt;                &lt;CheckBoxPreference android:title=""@string/haptic_feedback"" android:defaultValue=""true""                        android:summary=""@string/haptic_feedback_summary"" android:key=""vibrate"" /&gt;                &lt;CheckBoxPreference android:title=""@string/sound_feedback"" android:defaultValue=""false""                        android:summary=""@string/sound_feedback_summary"" android:key=""sound"" /&gt;                &lt;CheckBoxPreference android:title=""@string/auto_caps"" android:defaultValue=""true""                        android:summary=""@string/auto_caps_summary"" android:key=""auto_caps"" /&gt;        &lt;/PreferenceCategory&gt;        &lt;PreferenceCategory android:title=""@string/layout_settings""&gt;                &lt;ListPreference android:title=""@string/keyboard_layout"" android:defaultValue=""TRQ""                        android:key=""kbd_layout"" android:entries=""@array/layout_names"" android:entryValues=""@array/layout_values"" /&gt;        &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre>","3812","","3812","","2010-01-26 18:24:09","2010-01-26 18:24:09","Application compatibility between versions","<android>","1","1","","",""
"2140813","1","2140835","","2010-01-26 16:31:12","1","625","<p>Greetings, </p><p>I'm looking in the documentation for SQLite on Android but can't seem to find the anser for my question - so maybe someone here can help.</p><p>When I create a database using the SQLiteOpenHelper will the database only be created once if it does not exist or will it be overwritten each time I call the OnCreate method. </p>","84278","","265167","","2011-12-17 20:20:21","2011-12-17 20:20:21","The SQLiteOpenHelper  onCreate(), always creates the database when it runs?","<android><sqlite>","2","0","","",""
"2140952","1","","","2010-01-26 16:48:10","5","4469","<p>I am getting the following error:</p><pre class=""lang-xml prettyprint-override""><code>&lt;error_code&gt;104&lt;/error_code&gt;&lt;error_msg&gt;Incorrect signature&lt;/error_msg&gt;</code></pre><p>What should I be setting contentType type as? Should I set as:</p><pre><code>String contentType = ""application/x-www-form-urlencoded"";</code></pre><p>or </p><pre><code>String contentType = ""multipart/form-data; boundary="" + kStringBoundary; </code></pre><p>This is how I am writing the stream:</p><pre><code>HttpURLConnection conn = null;OutputStream out = null;InputStream in = null;try {    conn = (HttpURLConnection) _loadingURL.openConnection();    conn.setDoOutput(true);    conn.setDoInput(true);    if (method != null) {        conn.setRequestMethod(method);        if (""POST"".equals(method)) {            //""application/x-www-form-urlencoded"";            String contentType = ""multipart/form-data; boundary="" + kStringBoundary;            //String contentType = ""application/x-www-form-urlencoded"";            conn.setRequestProperty(""Content-Type"", contentType);        }        // Cookies are used in FBPermissionDialog and FBFeedDialog to        // retrieve logged user       conn.connect();       out = conn.getOutputStream();       if (""POST"".equals(method)) {            String body = generatePostBody(postParams);            if (body != null) {                out.write(body.getBytes(""UTF-8""));            }        }        in = conn.getInputStream();</code></pre><p>Here's the method I am using to publish the stream:</p><pre><code>private void publishFeed(String themessage) {    //Intent intent = new Intent(this, FBFeedActivity.class);   // intent.putExtra(""userMessagePrompt"", themessage);  //  intent.putExtra(""attachment"",     Map&lt;String, String&gt; getParams = new HashMap&lt;String, String&gt;();    // getParams.put(""display"", ""touch"");    // getParams.put(""callback"", ""fbconnect://success"");    // getParams.put(""cancel"", ""fbconnect://cancel"");     Map&lt;String, String&gt; postParams = new HashMap&lt;String, String&gt;();     postParams.put(""api_key"", _session.getApiKey());     postParams.put(""method"", ""stream.publish"");     postParams.put(""session_key"", _session.getSessionKey());     postParams.put(""user_message"", ""TESTING 123"");    // postParams.put(""preview"", ""1"");     postParams.put(""attachment"", ""{\""name\"":\""Facebook Connect for Android\"",\""href\"":\""http://code.google.com/p/fbconnect-android/\"",\""caption\"":\""Caption\"",\""description\"":\""Description\"",\""media\"":[{\""type\"":\""image\"",\""src\"":\""http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg\"",\""href\"":\""http://developers.facebook.com/connect.php?tab=iphone/\""}],\""properties\"":{\""another link\"":{\""text\"":\""Facebook home page\"",\""href\"":\""http://www.facebook.com\""}}}"");    // postParams.put(""user_message_prompt"", ""22222"");     try {         loadURL(""http://api.facebook.com/restserver.php"", ""POST"", getParams, postParams);     } catch (MalformedURLException e) {         e.printStackTrace();     }}</code></pre><p>Here is generatePostBody() :</p><pre><code>private String generatePostBody(Map&lt;String, String&gt; params) {    StringBuilder body = new StringBuilder();    StringBuilder endLine = new StringBuilder(""\r\n--"").append(kStringBoundary).append(""\r\n"");    body.append(""--"").append(kStringBoundary).append(""\r\n"");    for (Entry&lt;String, String&gt; entry : params.entrySet()) {        body.append(""Content-Disposition: form-data; name=\"""").append(entry.getKey()).append(""\""\r\n\r\n"");        String value = entry.getValue();        if (""user_message_prompt"".equals(entry.getKey())) {            body.append(value);        }        else {            body.append(CcUtil.encode(value));        }        body.append(endLine);    }    return body.toString();}</code></pre><p>Thanks.</p>","259394","","447356","","2011-08-24 07:49:17","2014-03-15 09:00:04","Facebook Connect Android -- using stream.publish @ http://api.facebook.com/restserver.php","<java><android><facebook>","1","1","","",""
"2140964","1","2141321","","2010-01-26 16:50:14","29","46290","<p>I am looking for the source code of the android lock screen. It can be for any version of Android (1.5, 1.6, 2.0, etc).</p><p>I tried looking in the repository at: <a href=""http://android.git.kernel.org"">http://android.git.kernel.org</a>, but it doesn't look like it's under <code>platform/frameworks/base.git</code>. Maybe it's closed source?</p>","237115","","154306","","2013-03-25 11:09:00","2014-01-02 20:25:09","Source of Android's lock screen","<android><android-source>","2","0","18","",""
"2141401","1","2141431","","2010-01-26 17:48:07","5","6563","<p>I have a snippet of code that I'm calling from a service:</p><pre><code>context.registerReceiver(new BroadcastReceiver() {    @Override    public void onReceive(Context context, Intent intent) {        try {            WifiManager mWm = (WifiManager) context                    .getSystemService(Context.WIFI_SERVICE);            ret = mWm.isWifiEnabled();            // DO MORE STUFF HERE        } catch (Exception e) {        }    }}, new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION));</code></pre><p>What I would like is a way to check and make sure that the <code>registerReceiver</code> isn't already listening before it calls it again.  Is this possible?</p><p>For example if my snippet of code is in a method, and I call the method 10 times, right now the <code>onReceive</code> method appears to run 10 times.</p>","242904","","1193333","","2013-03-31 19:55:03","2013-03-31 19:55:03","registerReceiver for Broadcast only if it's not already registered?","<android>","1","0","","",""
"2141583","1","2141819","","2010-01-26 18:16:56","4","284","<p>In my past programming experience I found that learning by example is the shortest way to improve my skills. I'm now looking for a ""poster child"" opensource Android project which would follow best practices such as having good unit-test coverage, following clear design patterns, have well written, well documented sources and (hopefully) documentation. Another must - it should use <code>ContentProvider</code> and <code>SQLite</code> to store data. I'm not looking for the academia/book snippets - I really like to analyze and learn from a ""real life"" project, preferably available at Android Market with a good (min 4 stars) scoreDoes such a beast even exist? I would really appreciate your suggestions and promise to pick the winner carefully. </p><p>I would really appreciate some quality feedback beyond quick Google search. I'm really looking for the ""insider"" opinion of someone who's been exposed to the project and who can recommend and maybe highlight/identify the project's strong and weak points.</p>","135946","","135946","","2010-01-26 18:33:39","2010-08-02 16:44:53","Android - poster child project","<android><unit-testing><design-patterns>","3","3","2","",""
"2141750","1","2452675","","2010-01-26 18:48:13","3","548","<p>I have a widget that acts as a launcher on the home screen.How can I make it behave like a launcher icon?</p><p>I use this layout for portrait:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;  &lt;RelativeLayout    android:background=""@drawable/widget_background_selector""    android:focusable=""true""    android:layout_width=""74dip""    android:layout_height=""79dip""    android:layout_marginLeft=""3dip""    android:layout_marginTop=""14dip""&gt;    &lt;ImageView android:id=""@android:id/background""      android:layout_width=""72dip""      android:layout_height=""72dip""      android:layout_marginLeft=""1dip""      android:layout_marginTop=""4dip"" /&gt;  &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>And this is the background selector:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;   &lt;item android:state_pressed=""true"" android:drawable=""@drawable/widget_background_pressed"" /&gt;   &lt;item android:state_window_focused=""true"" android:state_focused=""true"" android:drawable=""@drawable/widget_background_focused"" /&gt;   &lt;item android:state_window_focused=""false"" android:state_focused=""true"" android:drawable=""@android:color/transparent"" /&gt; &lt;/selector&gt;</code></pre><p>This way if I use the DPAD the widget is focusable but the click doesn't work.The touch still works but the widget is not displayed as focused.</p><p>Any idea what I do wrong?</p>","64475","","","","","2010-03-16 07:22:53","How can I make a home widget behave like a launcher icon?","<android>","1","4","","",""
"2142170","1","2144211","","2010-01-26 19:54:43","1","697","<p>I can get the device (owner's)phone via </p><pre><code>TelephonyManager tm =           (TelephonyManager)ctx.getSystemService(ctx.TELEPHONY_SERVICE);phone = tm.getLine1Number();</code></pre><p>But i am not sure how to determine the gmail or other account belonging to this user(device)</p><p>How do you do that?</p>","237415","","166712","","2010-01-26 20:59:16","2010-01-27 02:32:36","How do i determine the primary (android device) account data eg gmail?","<android><gmail>","1","0","0","",""
"2142348","1","","","2010-01-26 20:22:46","2","5981","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1893072/getting-frames-from-video-image-in-android"">Getting frames from Video Image in Android</a>  </p></blockquote><p>Hi,</p><p>I wanted to know if it is possible to extract frames from a running Video in Android? I need to extract frames at regular intervals and send them for further processing.</p><p>Would someone be able to find an answer for me?</p><p>Thanks,</p><p>Abhi</p>","259544","","","","","2012-07-10 22:06:50","Extract Video frames in Android","<android><video><extraction>","2","2","2","",""
"2142745","1","","","2010-01-26 21:23:14","3","2503","<p>I've a form that occupies upper half of the screen and I want to show the keyboardat the bottom half all the time. How do I do that?</p><p>(Android 2.1, NexusOne)</p>","160261","","160261","","2010-01-26 21:47:02","2010-06-29 06:14:26","Android 2.1: How do I bring the soft keyboard manually?","<android>","3","0","","",""
"2142994","1","","","2010-01-26 22:02:57","1","822","<p>Planning to write a dead simple android application</p><p>it's basically an image viewing application.</p><p>I have 10 images preloaded. Each swipe (left or right) will cause the image to switch.</p><p>that's about it!</p><p>So I've looked across many android sites, couldn't find a single tutorial on this.Anddev.org provided tutorials on displaying graphics, but that was in 2008 and many ppl reported errors due to version changes.</p><p>I'm also looking into the CommonsWare site, they have 3 books for 40 dollars/yr. I looked through the contents, but couldn't see anything that fits what I plan to write. Plus the books talk a lot about other stuff like GPS, HttpRequests, Servers, Databases -- none of which I need in my case.</p><p>Any tips on how I should tackle this? </p><p>Or do you guys already have written something similar to this?</p>","238581","","","","","2010-01-27 05:04:09","Very Simple Android Project - but where to start?","<android>","2","0","","2012-07-27 14:47:46",""
"2143046","1","2143081","","2010-01-26 22:10:38","2","855","<p>I am playing around with a strategy game where squads move around a map. Each turn a certain amount of movement is allocated to a squad and if the squad has a destination the points are applied each turn until the destination is reached. Actual distance is used so if a squad moves one position in the x or y direction it uses one point, but moving diagonally takes ~1.4 points. The squad maintains actual position as float which is then rounded to allow drawing the position on the map.</p><p>The path is described by touching the squad and dragging to the end position then lifting the pen or finger. (I'm doing this on an iPhone now but Android/Qt/Windows Mobile would work the same) As the pointer moves x, y points are recorded so that the squad gains a list of intermediate destinations on the way to the final destination. I'm finding that the destinations are not evenly spaced but can be further apart depending on the speed of the pointer movement. Following the path is important because obstacles or terrain matter in this game. I'm not trying to remake Flight Control but that's a similar mechanic.</p><p>Here's what I've been doing, but it just seems too complicated (pseudocode):</p><pre><code>getDestination() {- self.nextDestination = remove_from_array(destinations)- self.gradient = delta y to destination / delta x to destination- self.angle = atan(self.gradient)- self.cosAngle = cos(self.angle)- self.sinAngle = sin(self.angle)}move() {- get movement allocation for this turn- if self.nextDestination not valid- - getNextDestination()- while(nextDestination valid) &amp;&amp; (movement allocation remains) {- - find xStep and yStep using movement allocation and sinAngle/cosAngle calculated for current self.nextDestination- - if current position + xStep crosses the destination- - - find x movement remaining after self.nextDestination reached- - - calculate remaining direct path movement allocation (xStep remaining / cosAngle)- - - make self.position equal to self.nextDestination- - else - - - apply xStep and yStep to current position- }- round squad's float coordinates to integer screen coordinates- draw squad image on map}</code></pre><p>That's simplified of course, stuff like sign needs to be tweaked to ensure movement is in the right direction. If trig is the best way to do it then lookup tables can be used or maybe it doesn't matter on modern devices like it used to.</p><p>Suggestions for a better way to do it?</p><ul><li>an update - iPhone has zero issues with trig and tracking tens of positions and tracks implemented as described above and it draws in floats anyway. The Bresenham method is more efficient, trig is more precise. If I was to use integer Bresenham I would want to multiply by ten or so to maintain a little more positional accuracy to benefit collisions/terrain detection.</li></ul>","189804","","189804","","2010-04-27 00:10:54","2010-04-27 00:10:54","Moving a unit precisely along a path in x,y coordinates","<iphone><android><algorithm>","2","0","3","",""
"2143102","1","","","2010-01-26 22:19:14","15","12352","<p>I have some code that extends a service and records onSensorChanged(SensorEvent event) accelerometer sensor readings on Android. I would like to be able to record these sensor readings even when the device is off (I'm careful with battery life and it's made obvious when it's running). While the screen is on the logging works fine on a 2.0.1 Motorola Droid and a 2.1 Nexus One. </p><p>However, when the phone goes to sleep (by pushing the power button) the screen turns off and the <code>onSensorChanged</code> events stop being delivered (verified by using a Log.e message every N times <code>onSensorChanged</code> gets called). </p><p>The service acquires a wakeLock to ensure that it keeps running in the background; but, it doesn't seem to have any effect. I've tried all the various PowerManager. wake locks but none of them seem to matter.</p><pre><code>_WakeLock = _PowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, ""My Tag"");_WakeLock.acquire();</code></pre><p>There have been conflicting reports about whether or not you can actually get data from the sensors while the screen is off... anyone have any experience with this on a more modern version of Android (Eclair) and hardware?</p><p>This seems to indicate that it was working in Cupcake:<a href=""http://groups.google.com/group/android-developers/msg/a616773b12c2d9e5"" rel=""nofollow"">http://groups.google.com/group/android-developers/msg/a616773b12c2d9e5</a></p><p>PS: The exact same code works as intended in 1.5 on a G1. The logging continues when the screen turns off, when the application is in the background, etc.</p>","259615","","995926","","2012-05-22 08:19:05","2012-05-22 09:45:48","Accelerometer stops delivering samples when the screen is off on Droid/Nexus One even with a WakeLock","<android><accelerometer><power-management><android-2.0-eclair>","5","5","5","",""
"2143324","1","","","2010-01-26 22:55:02","0","86","<p>How would I code my android app to remember the values entered by the user between uses?</p><p>As an example, say I have an EditText ""input1"" and a spinner ""input2"" which give results in a textview named ""output1"".</p><p>Currently when I close and reopen the app, all entered values and calculations are lost and reset. How can I fix this?</p>","257881","","","","","2010-01-26 23:39:42","Retaining entered information for next startup?","<java><android><retain>","2","0","","",""
"2143392","1","2739176","","2010-01-26 23:06:59","5","30792","<p>I'm trying to set up my workstation for Android development with Eclipse Galileo. I installed the latest ADT plugin and the Android SDK, but I get this error when I try to run any basic Android project I create.</p><pre><code>eclipse.buildId=M20090917-0800java.version=1.6.0_17java.vendor=Sun Microsystems Inc.BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_USFramework arguments:  -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.productCommand-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product -data C:\Documents and Settings\dmcnamar\workspace -product org.eclipse.epp.package.java.productErrorTue Jan 26 18:00:41 EST 2010An internal error occurred during: ""Launching HelloWorld"".java.lang.NullPointerExceptionat com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(Unknown Source)at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.doLaunch(Unknown Source)at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(Unknown Source)at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:866)at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1069)at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)</code></pre>","259642","","1076164","","2012-01-03 16:57:22","2013-10-28 09:08:02","Eclipse launch error when trying to run an Android app","<android><eclipse>","6","4","0","",""
"2143651","1","","","2010-01-27 00:03:15","3","599","<p>here is my problem.I have Some Alarms set via AlarmManager to do some periodic jobs.I set/reset them when user opens the app for the first time &amp; on every boot_complete event.But when the app is reinstalled via ADB then my alarms do not fire anymore. looks like the OS deletes the Alarms on reinstall of the app. I assume this will happen if the user updates the app from the market also.</p><p>If I can receive a broadcast or some sort of callback in the event of reinstall/upgrade etc of my application, I can set the alarms again. but i don't know if it is possible or how?Can someone please help me out.</p>","240694","","","","","2013-01-25 06:58:34","Executing code when Application is updated/reinstalled","<android>","1","0","","",""
"2143754","1","","","2010-01-27 00:28:52","11","10996","<p>I am trying to get a phone object so that I can call and conference two numbers from within my application.</p><p>I have tried using the static PhoneFactory.makeDefaultPhones((Context)this) but have not had any luck.</p><pre><code>String phoneFactoryName = ""com.android.internal.telephony.PhoneFactory"";String phoneName = ""com.android.internal.telephony.Phone"";Class phoneFactoryClass = Class.forName(phoneFactoryName);Class phoneClass = Class.forName(phoneName);Method getDefaultPhone = phoneFactoryClass.getMethod(""getDefaultPhone"");Object phoneObject = getDefaultPhone.invoke(null);</code></pre><p>Error - Caused by java.lang.RuntimeException: PhoneFactory.getDefaultPhone must be called from Looper thread</p>","198523","","","","","2013-05-28 07:50:27","Can a telephony.Phone object be instantiated through the sdk?","<android>","6","4","11","",""
"2144199","1","2147364","","2010-01-27 02:30:04","0","1333","<p>I am trying to access a SeekBar in a AlertDialog. I need to either setOnSeekBarChangeListener(), or access the SeekBar.getProgress() to get its value. Where do I do this? Is it possible?</p><p>The dialog is shown using showDialog(id) from onOptionsItemSelected. </p><p>The following code is used in onCreateDialog to create the AlertDialog with custom content which includes a SeekBar. </p><pre><code>case CALIBRATE_DIALOG_ID: {            // This example shows how to add a custom layout to an AlertDialog            LayoutInflater factory = LayoutInflater.from(this);            final View calibrateView = factory.inflate(R.layout.dlg_calibrate, null);            return new AlertDialog.Builder(this)                .setIcon(R.drawable.alert_dialog_icon)                .setTitle(""Calibrate"")                .setView(calibrateView)                .setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int whichButton) {                        //mSeekBar1 = (SeekBar) findViewById(R.id.SeekBar01);                        //Toast.makeText(ctx, mSeekBar1.getProgress(), Toast.LENGTH_SHORT);                    }                })                .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int whichButton) {                        /* User clicked cancel so do some stuff */                    }                })                .create();        }</code></pre><p>I can't do it in the main activity onCreate; the SeekBar has not been created yet. I thought I would be able to get a handle on the SeekBar.getProgress() value in the Ok Button's onClick handler but could not.</p><p>Any suggestions would be great!</p><p>thanks</p><p>patrick</p>","244190","","","","","2010-01-27 13:57:56","How to set OnSeekBarChangedListener for SeekBar used in AlertDialog via LayoutInflater","<android><android-widget>","1","0","1","",""
"2144694","1","","","2010-01-27 05:04:53","26","29292","<p>I have a non-A2DP single ear BT headset (Plantronics 510) and would like to use it with my Android HTC Magic to listen to low quality audio like podcasts/audio books.</p><p>After much googling I found that only phone call audio can be routed to the non-A2DP BT headsets. (I would like to know if you have found a ready solution to route all kinds of audio to non-A2DP BT headsets)</p><p>So I figured, somehow programmatically I can channel the audio to the stream that carries phone call audio. This way I will fool the phone to carry my mp3 audio to my BT headset. I wrote following simple code.</p><pre><code>import android.content.*;import android.app.Activity;import android.os.Bundle;import android.media.*;import java.io.*;import android.util.Log;public class BTAudioActivity extends Activity{    private static final String TAG = ""BTAudioActivity"";    private MediaPlayer mPlayer = null;    private AudioManager amanager = null;    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        amanager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);        amanager.setBluetoothScoOn(true);        amanager.setMode(AudioManager.MODE_IN_CALL);        mPlayer = new MediaPlayer();        try {            mPlayer.setDataSource(new FileInputStream(                ""/sdcard/sample.mp3"").getFD());            mPlayer.setAudioStreamType(AudioManager.STREAM_VOICE_CALL);            mPlayer.prepare();            mPlayer.start();        } catch(Exception e) {            Log.e(TAG, e.toString());        }    }    @Override    public void onDestroy()    {        mPlayer.stop();        amanager.setMode(AudioManager.MODE_NORMAL);        amanager.setBluetoothScoOn(false);        super.onDestroy();    }}</code></pre><p>As you can see I tried combinations of various methods that I thought will fool the phone to believe my audio is a phone call:</p><ul><li>Using MediaPlayer's setAudioStreamType(STREAM_VOICE_CALL)</li><li>using AudioManager's setBluetoothScoOn(true)</li><li>using AudioManager's setMode(MODE_IN_CALL)</li></ul><p>But none of the above worked. If I remove the AudioManager calls in the above code, the audio plays from speaker and if I replace them as shown above then the audio stops coming from speakers, but it doesn't come through the BT headset. So this might be a partial success.</p><p>I have checked that the BT headset works alright with phone calls.</p><p>There must be a reason for Android not supporting this. But I can't let go of the feeling that it is not possible to programmatically reroute the audio. Any ideas?</p><p>P.S. above code needs following permission  </p><p><code>&lt;uses-permission android:name=""android.permission.MODIFY_AUDIO_SETTINGS""/&gt;</code></p>","174527","","","","","2013-06-17 14:39:54","Routing audio to Bluetooth Headset (non-A2DP) on Android","<android><audio><bluetooth>","3","0","17","",""
"2144784","1","","","2010-01-27 05:34:38","2","1096","<p>I have a layout that I have set up with the android xml layout.  I would like to embed a link in a text view so that if you click on the link, it opens in the android browser.  how is that done.  There does not seem to be a url view or anything.  </p>","259804","","","","","2010-04-06 21:22:33","android view url in xml layout","<android>","2","0","1","",""
"2144827","1","","","2010-01-27 05:49:52","5","5380","<p>I have a website that I want my android visitors to see.  It is created in Joomla 1.5.  The problem is that sometimes I get the message ""The page contains too many server redirects"" on my G1.  Does anyone know what this means or how I can fix the problem?</p>","248521","","","","","2012-08-11 23:51:16","Error Message: The page contains too many server redirects","<android><joomla>","1","1","","",""
"2145131","1","3663956","","2010-01-27 07:15:25","7","12082","<p>Hey.I am creating a button programmatically. It is rounded and has a gradient background, and works fine and looks nice, but I couldn't do two things I wanted:</p><ol><li>Set a 1 pixel stroke with a given color. I tried getPaint().setStroke(), but couldn't figure how to set the stroke color. How should I do it?</li><li>Align the gradient to the bottom of the button, no matter what height it has. Is this possible?</li></ol><p>For reference, this is the code I'm using:</p><pre><code>Button btn = new Button(context);btn.setPadding(7, 3, 7, 5);btn.setTextColor(text_color);// Create a gradient for the button. Height is hardcoded to 30 (I don't know the height beforehand). // I wish I could set the gradient aligned to the bottom of the button.final Shader shader = new LinearGradient(0, 0, 0, 30,    new int[] { color_1, color_2 },    null, Shader.TileMode.MIRROR);float[] roundedCorner = new float[] { 5, 5, 5, 5, 5, 5, 5, 5 }ShapeDrawable normal = new ShapeDrawable(new RoundRectShape(roundedCorner, null, null));normal.getPaint().setShader(shader);normal.setPadding(7, 3, 7, 5);// Create a state list (I suppressed settings for pressed).StateListDrawable state_list = new StateListDrawable();state_list.addState(new int[] { }, normal);btn.setBackgroundDrawable(state_list);</code></pre>","125967","","125967","","2010-01-27 07:52:23","2013-07-04 12:54:41","Trying to draw a button: how to set a stroke color and how to ""align"" a gradient to the bottom without knowing the height?","<android>","3","0","2","",""
"2145283","1","2638080","","2010-01-27 07:56:36","1","977","<p>I am running into a critical conflict of sorts. My app is a remote service which essentially starts an activity when the screen goes to sleep. How it does this is very simple via screen off broadcast receiver and then an explicit intent to start the activity as a new task. The activity is basically in charge of responding to key events and displaying some simple text. </p><p>Thanks to a few window flags added in 2.0, activities can do this. They can be created in a way that either puts them on top of the lockscreen, or completely dismiss the lockscreen. This way they basically have focus without the lockscreen having to be dismissed by user. The alarm clock in 2.0 uses the flags to wake up the device and show the alarm dialog. I use them to place my activity when the screen sleeps so the user sees a custom wakeup lockscreen. The reason we create it at screen off is to get rid of lag the user experiences at wakeup involving first seeing the lockscreen, then seeing the activity appear. Also doing it immediately at sleep allows it to have focus so it can handle key events effectively.</p><p>The process works perfectly except in certain apps. So far, it seems the bug is consistent while browser (and even dolphin browser) as well as the facebook app are running. The bug never happens in GTalk or Launcher. It is rare but can still be duplicated in the messaging app every so often. I can't figure out why my activity doesn't get created at sleep while these apps are active. My remote service still gets the screen off broadcast and does the startActivity for the explicit intent, and that's all I get in the log. My onCreate is not being called. Instead it gets called when we wake the screen up again.</p><p>I have tried, as a control, to hold the partial wakelock starting when my remote service gets created, and the issue persists. So I don't believe it is a problem that the CPU has gone to sleep. Since only these particular apps cause the issue to duplicate, I can't imagine why the activity start fails. What could those apps be doing to interfere with another app's ability to get created? I use singleInstance as the launch mode so that I can ensure that the activity will never be able to be recalled by user process. I want it to go away when user unlocks and it is working fine like this, as long as it is able to be created. The singleInstance ensures I can have the same lockscreen handle an intent to do something specific based on user actions that the remote service monitors.</p><p>my source code can be viewed on my project page. <a href=""http://code.google.com/p/mylockforandroid/source/browse/#svn/trunk/myLock/src/i4nc4mp/myLock"" rel=""nofollow"">http://code.google.com/p/mylockforandroid/source/browse/#svn/trunk/myLock/src/i4nc4mp/myLock</a></p><p>the issue happens to both my CustomLockService and NoLockService variations. These two services will start Lockscreen or ShowWhenLockedActivity and the bug is witnessed. The build illustrating the bug's end result-- user has to try to unlock 3 times due to the bug because on wakeup when the oncreate finally succeeds, user is seeing the activity when normally it would have auto-dismissed thanks to key event logic that also isn't seeming to happen due to the delayed onCreate, so they have to send it to sleep again. Now that the activity is properly done being started, and screen is asleep, the expected functionality happens at next wakeup-- can be downloaded also from the downloads tab.</p><p>This seems like an extremely irrational thing to be caused only by specific apps. I am quite baffled and out of ideas for a solution unless I've made some critical mistake in my activity definitions.</p>","246883","","246883","","2010-01-27 08:40:37","2010-04-14 14:16:53","StartActivity intent fails when certain apps are running","<android>","1","2","","",""
"2145553","1","","","2010-01-27 08:59:31","6","754","<p>Has anyone found a way to catch outgoing calls from the Htc Hero Dialer?</p><p>I currently use the NEW_OUTGOING_CALL intent in my app and this works for the standard Android dialer but not for the Htc Hero one. The hero dialer seems to not fire that specific intent.</p><p>Is there any other way to achieve this?</p>","251077","","","","","2011-02-04 12:41:48","How to catch call intent from Htc Hero Dialer","<android>","1","1","2","",""
"2145639","1","2145674","","2010-01-27 09:17:21","5","12679","<p>I am buiding an Android app, and I have a problem to get resource from string.xml.I need to have an URL in String.xml that will be used several times through the app.I tried Resources.getText(""my_url""), but this does not work. Eclipse complains when I use this.Do you think this is the best way to do ?</p>","231957","","114066","","2010-01-27 09:43:54","2010-01-27 10:10:32","Cannot get resource from android application","<android><resources>","2","0","3","",""
"2146870","1","2147069","","2010-01-27 12:45:45","12","7875","<p>Hay, how do i import org.apache.commons packages into android so i can use them in my applications?</p><p>Thanks</p>","164230","","164230","","2010-01-27 12:53:53","2013-07-04 12:06:35","Importing org.apache.commons into android applications","<java><android><import>","4","0","4","",""
"2146965","1","2147463","","2010-01-27 13:02:02","1","7238","<p>I am currently working on my first android app. In a listview, I need to have the following organisation in each row:</p><ul><li>On the left: one main icon on which takes the whole height of the row</li><li>On the middle: 2 texts, one below the other</li><li>On the right: 2 icons, one below the other</li></ul><p>I end up with a row.xml file like this, but that does not work as I expect.Do you know if something obvious is missing in this file ?Thanks a lot,Luc</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""?android:attr/listPreferredItemHeight""android:padding=""6dip""&gt;&lt;ImageView    android:id=""@+id/icon""    android:layout_width=""48px""    android:layout_height=""48px""    android:layout_marginRight=""0dip""    android:src=""@drawable/icon"" /&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""0dip""    android:layout_weight=""1""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:id=""@+id/title""        android:layout_width=""wrap_content""        android:layout_height=""0dp""        android:layout_weight=""1""        android:textAppearance=""?android:attr/textAppearanceLarge""        android:textSize=""16dp""        android:textStyle=""bold""        android:text=""TITLE""        android:paddingLeft=""5dp""    /&gt;    &lt;TextView        android:id=""@+id/description""        android:layout_width=""wrap_content""        android:layout_height=""0dp""        android:layout_weight=""1""        android:textAppearance=""?android:attr/textAppearanceSmall""        android:textSize=""14dp""        android:text=""DESCRIPTION""        android:paddingLeft=""5dp""    /&gt;&lt;/LinearLayout&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_weight=""1""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:layout_gravity=""right""&gt;    &lt;ImageButton    android:id=""@+id/button_modify""    android:layout_width=""16px""    android:layout_height=""16px""    android:src=""@drawable/deleteicon""    /&gt;    &lt;ImageButton    android:id=""@+id/button_delete""    android:layout_width=""16px""    android:layout_height=""16px""    android:src=""@drawable/modifyicon""    /&gt;&lt;/LinearLayout&gt;</code></pre><p></p>","231957","","","","","2010-02-18 18:25:34","android, cannot align icons on the right in listview's row","<android><android-widget>","2","0","","",""
"2146984","1","","","2010-01-27 13:05:32","3","2601","<p>I want to test parsing of data returned from server.</p><p>I thought I might create several test XML files and then feed them to the sax parser which uses my custom data handler (as in the application that I test).</p><p>But where should I put those test XMLs?</p><p>I tried with <code>[project_root]/res/xml</code>, but then I get the error:</p><p><code>android.content.res.Resources$NotFoundException: Resource ID #0x7f040000 type #0x1c is not validat android.content.res.Resources.loadXmlResourceParser(Resources.java:1870)at android.content.res.Resources.getXml(Resources.java:779)</code></p><p>Does that mean that the xml is invalid, or that android couldn't find the XML file?(I use the same XML that comes from the server - copied it from the firebug's net panel and pasted into the file).</p><p>Can I somehow read that XML as a text file, since <code>getContext().getResources().getXml(R.xml.test_response1)</code> returns <code>XmlResourceParser</code> instead of <code>String</code> (which I'd prefer)?</p>","133648","","133648","","2010-01-27 13:31:57","2013-04-25 10:51:12","Test data sources in Android unit testing","<android><unit-testing><resources>","2","0","1","",""
"2147013","1","","","2010-01-27 13:09:33","1","8429","<p>Was wondering if there's any way to test Gestures (eg: Fling) on the Emulator.</p><p>I saw a project on google code that lets people simulate the accelerometer, but none of Gestures.</p>","238581","","","","","2010-01-27 14:33:24","Android - Any way to test Gestures on the Emulator?","<android>","2","0","","",""
"2147042","1","","","2010-01-27 13:14:36","0","261","<p>We are trying to use a shared server (Ubuntu 9.10 64-bit) to develop Android applications. The thought is that a number of developers should use the shared server for development. We have overcome some obstacles such as setting the base port for DDMS. So it is possible to run multiple emulators and multiple instances of Eclipse.  </p><p>But we run into problems when trying to debug applications from Eclipse. It seems as though all emulators are trying to connect to the same Eclipse instance when debugging.  </p><p>Has anyone succeeded with this? </p><p>I know that this is a really bad idea, but I need to gather facts in order to have a strong case...  </p>","255867","","255867","","2010-01-27 14:41:51","2010-01-27 14:41:51","Developing Android applications on a shared server","<android><adb><ddms>","1","2","","",""
"2147050","1","","","2010-01-27 13:15:40","4","2224","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2116162/how-to-display-html-in-textview"">How to display HTML in TextView?</a>  </p></blockquote><p>I have a string that contains some tags(<code>&lt;p&gt;</code>,<code>&lt;img&gt;</code>,etc).</p><p>Tell how to handle these tags in textview.</p><p>Thanks in advance.</p>","258283","","5731","","2010-01-27 13:19:25","2010-01-27 13:32:52","how to get a value as htmltext on textview in android?","<android>","1","1","","2013-01-20 05:05:00",""
"2147144","1","2147318","","2010-01-27 13:31:29","12","8126","<p>I was wondering if anyone can tell if how to pop a dialog screen up over a native Android screen?</p><p>I currently have an application that traps an outgoing call and stops it, I then want to pop up a dialog that would take over from the dialler screen and alert the user that there attempt to call has been blocked and allow them have some new options from the dialog.</p><p>I know that some people will say that I should use notifications instead but I'm aware of that and its not the way that it should work, I need to be able to pop up a dialog when the call gets trapped.</p><p>This is my dialog code so far</p><pre><code>  AlertDialog LDialog = new AlertDialog.Builder(context)     .setTitle(""Call Blocked"")     .setMessage(""Call Blocked, reroute call?"")     .setPositiveButton(""ok"", null).create();      LDialog.show();</code></pre><p>I presume I have to somehow get the context to be that of the dialler screen?</p><p>Can anyone offer any help and assistance or links to tutorials?</p><p>Thanks in advance</p>","243999","","","","","2013-07-19 19:02:42","Android - How to display a dialog over a native screen?","<android><dialog><popup><screen><native>","2","0","13","",""
"2147157","1","","","2010-01-27 13:33:10","2","1007","<p>/*I have some wierd problem, inside OnMenuItemClickListener, i am calling an alert dialog which i made, but it seems like, when i call the alert dialog, it doesnt show it on right moment, only after onMenuItemClick finish. what am i doing worng?    */</p><pre><code>class MyListMenuListener implements OnMenuItemClickListener    {        private String TAG;        @Override        public boolean onMenuItemClick(MenuItem item)        {            if (item.getItemId() == saveRoute.getItemId())            {                                   alertDialogSaveFile();                //nameInput = ""testone.txt"";                //some operations//                                      ... //                                      return true;            }</code></pre><p>//  ...</p><pre><code>/*the wierd thing is that the alert dialog doesnt show up on the same moment i call it..only after the onMenuItemClick operation ends (with return)and this is how my alertdialog looks like:*/        private void alertDialogSaveFile(){AlertDialog.Builder alert = new AlertDialog.Builder(this);        alert.setTitle(""Save your current map"");        alert.setMessage(""Please insert name for this route"");        final EditText saveNameInput = new EditText(TwittListActivity.this);        alert.setView(saveNameInput);        alert.setPositiveButton(""Ok"", new DialogInterface.OnClickListener()        {            public void onClick(DialogInterface dialog, int whichButton)            {                nameInput = saveNameInput.getText().toString();            }        });        alert.setNegativeButton(""Cancel"", new DialogInterface.OnClickListener()        {            public void onClick(DialogInterface dialog, int whichButton)            {            }        });         AlertDialog ad = alert.create();         ad.show();    }//Thanks!//ray.</code></pre>","252601","","","","","2010-01-29 12:42:57","Alert dialog popping late","<android>","1","1","","",""
"2147170","1","","","2010-01-27 13:35:39","0","3369","<p>I get strings in different encodings (ID3 tags).<br>I use e.g. <code>new String( bytes, ""UTF-16LE"" )</code> to decode them.<br>On my device (Motorola Milestone) and in the emulator, this works fine.<br>But some users complained they get results like ""T i t l e   n a m e"".<br>I've tried the Sun codepage names instead (e.g. ""UnicodeBigUnmarked""), with the same result - works for me, not for the user. (Reported and tested on Samsung Galaxy, but according to Market comments, this doesn't seem to be the only device...)<br>Is there some alternative that works on all devices, like other codepage names or a convertion class? Or is it a bug in the runtime environment I can't work around?</p>","256541","","","","","2013-06-15 04:00:30","Troubles with Unicode string encoding in Android","<android><string><unicode><encoding>","1","1","","",""
"2147293","1","2148411","","2010-01-27 13:49:51","1","777","<p>I have a problem while creating styles in android:</p><p>When I use </p><pre><code>android:textAppearance=""?android:attr/textAppearanceSmall""</code></pre><p>in Button for instance, that's working fine, but if I create a styles.xml like:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;style name=""smalltext"" parent=""@style/Text""&gt;        &lt;item name=""android:textSize""&gt;10sp&lt;/item&gt;        &lt;item name=""android:textColor""&gt;#FFF&lt;/item&gt;        &lt;item name=""android:textAppearance""&gt;?android:attr/textAppearanceSmall&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>and replace in Button:</p><pre><code>style=""@style/smalltext""</code></pre><p>nothing is taken into account.</p><p>Would you have any idea of what could be wrong ?</p><p>thanks a lot,Luc</p>","231957","","","","","2010-01-27 16:05:53","android style is not taken into account","<android>","1","0","","",""
"2147610","1","2147726","","2010-01-27 14:32:25","20","20693","<p>How can I read the error log applications make? Is there any software which reads the error log from the handset and displays it?</p><p>I don't want to debug the app using eclipse, I'm looking for a handset based error log viewer.</p>","216431","","292166","","2013-01-10 10:44:53","2013-01-10 10:44:53","Android read error log from handset","<android><logging>","3","0","1","",""
"2147704","1","","","2010-01-27 14:42:31","0","954","<p>In Reference to this android file download problem</p><p><a href=""http://stackoverflow.com/questions/576513/android-download-binary-file-problems"">http://stackoverflow.com/questions/576513/android-download-binary-file-problems</a></p><p>Can anyone explain what does this line mean in the code </p><p>FileOutputStream f = new FileOutputStream(new File(root,""Video.mp4"")); </p><p>And what does it mean by the parameter root within the File(). Do I need to specify the root path to save the file? if it is the case then how do we specify the root path in android ?</p><p>Regards</p>","257580","","","","","2010-01-27 19:23:57","Can anyone explain the File() parameters used to download file in android?","<android><file><fileoutputstream>","2","0","","",""
"2147755","1","","","2010-01-27 14:48:32","5","4071","<p>I am testing my application on a Nexus One and i have some problems. My theme is Light and when an inner sub PreferenceScreen is displayed, the window backgroundbecomes black instead of keeping the PreferenceActivity's one.</p><pre><code>&lt;PreferenceScreen android:title=""main preferences""&gt;    ...    &lt;PreferenceScreen android:title=""sub screen""&gt;    &lt;/PreferenceScreen&gt;&lt;/PreferenceScreen&gt;</code></pre><p>What is the problem?</p><p>Wouter</p>","188119","","","","","2012-10-11 06:50:30","Background from PreferenceActivity is not applied to sub-PreferenceScreen","<android><background>","2","5","","",""
"2148063","1","2219862","","2010-01-27 15:23:11","1","600","<p>Hay Guy, I'm using org.apache.commons.net.nntp to connect to a nntp server, however running a simple nntp.connect(host, port) crashes the android.</p><p>Anyone got any ideas? Do java packages work with android straight out of the box? or do they need editing?</p><p>Thanks</p><pre><code>import org.apache.commons.net.nntp.*;public class newsdroid extends Activity {    NNTP usenet; /** Called when the activity is first created. */    @Override public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        try {            usenet.connect(""ssl-eu.astraweb.com"", 563);        } catch (SocketException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }}</code></pre>","164230","","834","","2011-11-22 18:06:15","2011-11-22 18:06:15","org.apache.commons.net.nntp crashing android","<java><android>","2","4","1","",""
"2148177","1","2148227","","2010-01-27 15:36:31","0","1563","<p>Have a question about sending data between classes and activities.</p><p>I currently have a class that monitors outgoing class and gets the number of an outgoing call.</p><p>I instantiate this class in my main Activity and run its method that retrieves the number.</p><p>However I now have another Activity that I want to pass the number to.</p><p>I start this Activity through an Intent from the class that gets the number.</p><p>So it works like this:</p><p>MainActiviy Starts > Starts Object that listens for outgoing call > outgoing call detected > Object gets outgoing number > object fires Intent to create new Activity after outgoing call logged and number retrieved > new Activity displays</p><p>I hope that is a bit clearer?</p><p>So I want to send the number from the class (object) to the new Activity that it has started.</p><p>So what is the simplest way to do this?</p><p>Thanks in advance</p>","243999","","76835","","2010-01-27 17:42:52","2010-01-27 17:42:52","Android - Sending data from a class to an activity?","<android><data><activity><android-intent>","2","1","","",""
"2148301","1","2159315","","2010-01-27 15:51:37","8","3222","<p>The content provider/ resolver APIs provide a complicated, but robust way of transferring data between processes using a URI and the <code>openInputStream()</code> and <code>openOutputStream()</code> methods. Custom content providers have the ability to override the <code>openFile()</code> method with custom code to effectively resolve a URI into a <code>Stream</code>; however, the method signature of <code>openFile()</code> has a <code>ParcelFileDescriptor</code> return type and it is not clear how one might generate a proper representation for dynamically generated content to return from this method.</p><p><a href=""http://stackoverflow.com/questions/1542008/returning-a-memory-mapped-inputstream-from-a-content-provider"">Returning a memory mapped InputStream from a content provider?</a></p><p>Are there examples of implementing <code>ContentProvider.openFile()</code> method for dynamic content in the existing code base? If not can you suggest source code or process for doing so?</p>","68042","","","user1521536","2013-03-17 04:39:22","2013-03-17 04:39:22","Custom ContentProvider - openInputStream(), openOutputStream()","<android><file-io><android-contentprovider>","2","0","4","",""
"2148328","1","2148384","","2010-01-27 15:55:09","1","1060","<p>I'm new here in Android.</p><p>I would like to have information about what is the best way to create a database if not exists, and manage few tables with inner join queries.</p><p>Do you have any web page explaining this subject?</p><p>Thanks in advance.Regards.Jose</p>","79919","","76835","","2010-01-27 17:40:24","2012-07-17 13:52:30","New on android programming - create a database If it doesn't exist","<android>","2","0","1","",""
"2148369","1","2148442","","2010-01-27 16:00:08","3","1321","<p>Currently the TimePicker view shows only hours and minutes by default and I am retrieving the values using <code>getCurrentHour()</code> and <code>getCurrentMinute()</code>.</p><p>Is there a solution to add seconds to the TimePicker view?</p>","234967","","166712","","2010-01-27 16:15:19","2010-01-27 16:15:19","Displaying and retreiving 'seconds' with TimePicker","<java><android>","1","0","","",""
"2148570","1","2153484","","2010-01-27 16:30:25","0","1671","<p>In reference to question</p><p><a href=""http://stackoverflow.com/questions/2147704/can-anyone-explain-the-file-parameters-used-to-download-file-in-android"">http://stackoverflow.com/questions/2147704/can-anyone-explain-the-file-parameters-used-to-download-file-in-android</a></p><p>Can I do it without creating virtual SD Card. Is there any way to save the file in phone memory in internal memory? if it is possible without using the virtual SD Card, then how?</p>","257580","","","","","2010-01-28 09:35:14","Can i download file without using the phone memory instead of virtual SD card in emulator?","<android><file><emulator>","2","3","","",""
"2148608","1","2151914","","2010-01-27 16:36:08","1","1398","<p>When the user presses editText, the soft keyboard pops up. I want to hide a view or 2 while it is on. How to do that?</p>","232798","","","","","2010-01-28 02:36:36","Android: how to catch the event when the soft keyboard pops up?","<android>","1","0","","",""
"2148691","1","2148833","","2010-01-27 16:48:36","3","6336","<p>I want to connect to Picasa from an Android application (without interacting with any third-party application).</p><p>I tried to Google it and found no tutorial / explanation.</p><p>Even in <a href=""http://code.google.com/apis/picasaweb/overview.html"" rel=""nofollow"">Picasa Web API site</a> there is no explanations for Android.</p><p>I will really appreciate any tutorial / sample code / instructions.</p><p>Thank you.</p><p>Michael.</p>","246119","","","","","2010-01-27 17:07:36","Connect to Picasa from Android","<android><picasa>","1","0","4","",""
"2149295","1","","","2010-01-27 18:17:01","12","10712","<p>I need to know the signal strength of a Bluetooth connection to a remote device that I make with my Android 2.1 phone. From the SDK, I can see that I can determine the RSSI at the time I discover the remote device. But I can't see how to update that RSSI value over time.</p><p>Can someone give me a hand? Thanks!!</p>","260342","","","","","2012-11-26 02:41:38","Android 2.1: How do I poll the RSSI value of an existing Bluetooth connection?","<android><bluetooth><rssi>","1","1","10","",""
"2149307","1","4798027","","2010-01-27 18:18:48","1","516","<p>I am having trouble while developing Android application.</p><p>i declare custom search critiera object into application context, from every activity i want to access search critiera object from application context and then want to change Search critiera object.</p><p>oncrate() method i get searchcritiera and onresume i save this object into application context's search criteria.</p><p>ON an activity i have detect gps button when user click on the button it detect and store location object into search critiera.</p><ul><li><p>There are two problems, how can retain the search critiera object along the application cycle while every activity wants to change search critiera values ?</p></li><li><p>when i move around and any other application comes front of my activity search critiera gets null from application context ....</p></li></ul><p>help me out.</p>","216431","","580556","","2011-01-25 22:22:54","2011-01-25 22:22:54","android application save state","<android><save>","1","0","","",""
"2149310","1","","","2010-01-27 18:19:33","4","3447","<p><strong>Hi All</strong></p><p>I have a simple question - It is possible to add a menu item with an icon to a context menu ? I've searched this issue and all I found is that it is not possible, but in the Home screen of the Android device when I perform long-click a ""add to home"" context menu is being displayed, contains menu items with text and icon, so I figured there got to be a way of doing it.</p><p>I tried using the <code>MenuItem.setIcon()</code> method but the icon is not disaplyed in the context menu, only the text.</p><p>Thanks!</p>","239193","","","","","2012-09-04 08:24:43","Android ContextMenu option with icon","<android>","2","0","","",""
"2149753","1","2149906","","2010-01-27 19:39:07","3","1838","<p>Is there some native android SDK function which takes bitmap and desired new bitmap dimensions and then returns scaled bitmap?</p>","258848","","","","","2011-12-19 12:35:34","A native sdk function to scale Bitmap?","<android><graphics>","2","0","1","",""
"2149776","1","","","2010-01-27 19:43:29","5","6323","<p>I have a question about bluetooth RSSI functionality on the Android (either 2.0 or 2.1):</p><p>It's easy enough to get the RSSI value when a bluetooth connection is created, but how can you repeatedly get the RSSI value of a connection that is already active?  It's really important to be able to do this, because this lets you determine if bluetooth devices are close to each other or far away, but I can't find any appropriate function calls in the Android API.</p><p>Could someone who understands Android RSSI please help me with this problem?</p><p>Thanks!</p><p>Alex</p>","260392","","166712","","2010-01-27 19:50:04","2011-02-07 21:21:46","Android IRC Office Hours Question About Android Bluetooth RSSI","<android><bluetooth><rssi>","1","0","3","",""
"2150078","1","4737265","","2010-01-27 20:39:30","155","64790","<p>I need to do a very simple thing - find out if the software keyboard is shown. Is this possible in Android?</p>","243225","","1508522","","2012-07-30 13:02:27","2014-03-14 03:34:49","How to check visibility of software keyboard in Android?","<android>","13","2","119","",""
"2150287","1","","","2010-01-27 21:14:36","62","105278","<p>I am using android vnc viewer on my G1. But for some reason, that application always in landscape mode despite my G1 is in portrait mode. Since android vnc viewer is open source, I would like know how is it possible hard code an activity to be 'landscape'. I would like to change it to respect the phone orientation. </p><p>Thank you.</p><p><img src=""http://img192.imageshack.us/img192/8980/picture1gn.png"" alt=""alt text""></p>","128983","","","","","2013-06-15 16:03:26","Force an android activity to always use landscape mode","<android>","9","0","27","",""
"2150473","1","","","2010-01-27 21:44:23","3","1111","<p>I'm dealing with a phone that has no physical keyboard and I'm using my own custom view for rendering.  The device I'm working with, by default, seems to be in a T9 type entry mode where it suggests blocks of text.  However, it never sends me the actual key events.  </p><p>How do I tell whatever soft-keyboard that pops up to enter 'dumb' key event sending mode?  </p><p>The InputMethodManager has a ""isAcceptinText()"" call which would tell me if it's in event-sending mode, but not a method to set it.  Digging through the documentation hasn't produced any insight.  How do I tell the input manager that I only want key events?</p>","62516","","62516","","2010-01-27 22:39:18","2014-03-27 14:12:27","Text Entry on an Android Custom View","<android><text><textview><entry>","1","0","1","",""
"2150481","1","","","2010-01-27 21:45:33","1","369","<p>I am using AutoCompleteTextView (ACTV) in my app. The ACTV is vertically positioned around 100px from the top. When user clicks on it, software keyboard opens and the suggestions dropdown appears <em>below</em> the ACTV. Now I am getting to the bug - when user taps on some suggestion from the dropdown, the dropdown jumps <em>above</em> the ACTV! So if I want to select a suggestion, I have to tap on the screen twice - firstly when the dropdown is below and then after it jumps to the top (by ""jumps"" I mean it immediately disappears under my finger and opens above). Any idea how to circumvent this bug?</p>","243225","","","","","2010-01-27 21:45:33","How to circumvent this incredibly annoying Android AutoCompleteTextView bug","<android>","0","3","","",""
"2150656","1","","","2010-01-27 22:09:21","42","65648","<p>Currently, I have a layout which contains a Button, a TextView and an EditText. When the layout is displayed, the focus will be automatically put on the EditText, which will trigger the keyboard to show up on Android phone. It is not what I want. Is there any way that I can set the focus on TextView or on nothing when a layout is displayed? Thanks.</p>","256239","","","","","2012-02-16 17:09:51","How to set focus on a view when a layout is created and displayed?","<java><android>","14","0","8","",""
"2151116","1","2152665","","2010-01-27 23:25:43","1","938","<p>I have an ExpandableListView contains a link, it does not expand when has a link, and i want the link is clickable.</p><p>code like this:</p><pre><code>&lt;ExpandableListView xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@android:id/list"" android:layout_width=""fill_parent""android:layout_height=""fill_parent"" android:groupIndicator=""@null"" /&gt; </code></pre><p>and:</p><pre><code>&lt;TextView android:layout_below=""@id/screenName"" android:layout_alignLeft=""@id/screenName"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""   android:autoLink=""web|email"" android:linksClickable=""true"" android:id=""@+id/text""  /&gt;</code></pre>","260497","","260497","","2010-01-28 00:20:30","2010-01-28 06:18:18","ExpandableListView centains a link does not expand","<android><android-widget><expandablelistview>","1","2","","",""
"2151241","1","2152972","","2010-01-27 23:45:15","24","32066","<p>I would like to make CheckBox a bit smaller/bigger, how can I do this?</p>","62192","","","","","2014-03-02 13:02:12","Android: How to change CheckBox size?","<android><checkbox>","6","0","5","",""
"2151754","1","2152797","","2010-01-28 01:47:47","3","975","<p>If I want to send an event, e.g. OnClick, to an activity from a thread? Thanks.</p><p>The expected work flow is below:</p><pre><code>public class HelloAndroid extends Activity {   public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.main);       Crate threadA       Start threadA   }   public void OnSomeEvent() {       do something that changes the views in this activity;   }   private class ThreadA extends Thread {       public void run() {           do something ...           Send Some Event to Activity HelloAndroid.       }   }</code></pre>","256239","","","","","2010-01-28 07:45:33","Is it possible to send an event from a thread to an activity?","<java><android>","4","0","0","",""
"2151970","1","","","2010-01-28 02:53:55","2","1148","<p>I know there is a similar question to this floating around stackoverflow.  What I would like to know is if there's a simple way to do beat mapping for a song in Android?  I don't need to do anything as complicated as beat matching between different varieties of songs, as the other question requests; at least I don't think it's anymore complicated, more experienced programmers please feel free to comment.  </p><p>I simply would like to map the beat of a single song to be able to use it later in my program.  I'm very new to both Android programming and sound processing in programs, so any suggestions or comments are appreciated.</p>","94541","","","","","2011-02-07 02:10:32","Sound processing in Android","<android>","1","0","","",""
"2152003","1","2152048","","2010-01-28 03:01:46","3","15389","<p>The Android SDK has an API demo for using the preview of the camera. However, this gives me a runtime exception in the emulator. I'm running with Eclipse on a Mac with 10.6</p><p>Here's the link where I grabbed the code:</p><p><a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html</a></p>","260607","","","","","2010-06-28 01:24:23","Android SDK Camera API Demo Crashes","<android><camera><android-emulator>","5","1","6","",""
"2152227","1","","","2010-01-28 04:06:24","2","6723","<p>Examples of app status: foreground / background!</p>","260627","","321731","","2014-02-27 06:00:41","2014-02-27 06:00:41","I want to get the status of running apps","<android>","3","0","","",""
"2152337","1","2153628","","2010-01-28 04:41:28","1","2150","<p>What is a good way to implement the Google ClientLogin scheme below on Android?</p><p><a href=""http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html"" rel=""nofollow"">http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html</a></p><p>My understanding is that Android does not support the GData API. So I wanted to say, login to my Google books account, will I be able to do it using Android and the reference above? What classes should I be looking at in the Android SDK? (I am using Android 1.6.)</p>","253029","","","","","2010-01-28 12:53:23","How can I implement ClientLogin on Android to access Google services?","<android>","2","0","1","",""
"2152607","1","","","2010-01-28 05:59:50","4","1287","<p>I'm programing a game for Android. As an example, the game might involve bullets, enemies, gems etc.  which need to be:</p><ul><li><p>created and destroyed in the game world during gameplay e.g. a bullet is fire and then disappears when it hits a wall.</p></li><li><p>accessed a lot in sequence e.g. all updated in sequence, then all drawn in sequence.</p></li></ul><p>Based on what I know so far from my work in Android, to keep my frame rate up, I need to consider the following:</p><ul><li><p>Not to allocate objects when you don't have to because the garbage collector will kick in and ruin your framerate.</p></li><li><p>Prefer e.g. local variable accesses to accessing object fields and calling functions.</p></li></ul><p>For the game objects mentioned above in a PC game, I'd usually just something like use something like a Vector or LinkedList. However, these would not recycle objects and using Iterator will create a new object as well as involve several function calls when iterating.</p><p>What is a suitable collection to use?</p><p>What I've found works well at the moment is to create e.g. a standard array of 100 bullets where all 100 bullets are created upfront. I then keep a count of how many bullets are active, when all the active bullets appear at the start of the array. Whenever I'm iterating over an array of bullets and I need to destroy one, I simple swap the current bullet index with the last active bullet index, then decrease the active bullet number. This changes the bullet order, but that's fine.</p><p>This works quite well:</p><p>Pros: Recycles objects, few/no function callsCons: Error prone (especially removal) when not implemented as a collection class</p><p>Can anyone suggest a better alternative? I've seen many classes for managing object pools, but I'm not sure which are suitable for me.</p><p>Thanks.</p>","260693","","","","","2010-01-28 12:36:14","Collection with fast removal/iteration/insertion that recycles objects in Android/Java programs?","<java><android><collections>","2","1","3","",""
"2152653","1","","","2010-01-28 06:13:30","2","767","<p>I need to write an Android application that allows a user to connect to multiple social networking sites like MySpace, LinkedIn, FaceBook etc. and fetch friends list.</p><p>I know that most of these applications have Java libraries or functionalities exposed as REST based WebServices. But since there is a lot of variety and disparity in the ways that these libaries are written or service that can be consumed, is there any single, integrated service or middleware component that I can use to provide a unified interface in my mobile application?</p><p>What would be the best way to go about writing such an application? Any links or pointers to tutorials and documents would be helpful.</p><p>Thanks.</p>","260699","","","","","2012-05-04 14:40:57","Writing a Mobile Application that connects to multiple Social Networking sites","<android>","2","1","3","",""
"2153022","1","","","2010-01-28 07:49:57","1","1322","<p>How can I display a particular array of items from a database (SQLServer) in a Spinner of Android?</p>","217065","","15168","","2010-01-28 08:05:31","2010-01-28 12:40:20","How to display particular array of items from a database (SQLServer) in a Spinner of Android?","<android>","2","0","2","",""
"2153293","1","2153546","","2010-01-28 08:58:49","5","2037","<p>I want to place a common banner and menu on each Activity with footer too.</p><p>Can anyone guide me how can I implement master and child page like asp.net  in Android???</p><p>Any help would be appreciated.</p>","249991","","76835","","2010-01-28 17:59:02","2013-05-28 06:04:09","How to implement master and child page like Activity in Android?","<android><activity>","3","1","1","",""
"2153538","1","","","2010-01-28 09:44:30","1","1442","<p>I currently have a service running in my Android application that makes a wifi scan at a set interval and returns the results.</p><p>I was then passing the data using an aidl interface and to do this I had to bind the service to my Activity I was passing the data to.</p><p>However the design has changed and I now need to be able to send the data that the Service returns to just a normal class that does not extend an Activity.</p><p>So I want to pass the data from the service just to another class that doesn't extend Activity and then be able to use that data in a method of that class.</p><p>So I was wondering how I would go about this if it is possible?</p><p>Thanks in advance</p><p>EDIT:</p><p>Actually is this even the correct way to implement the following:</p><p>I have an application that will have no User Interface (not exactly none altogether but VERY minimal).</p><p>I want it to scan for Wifi access points at regular intervals, check the connected state of Wifi and check the connected level of the currently connected access point.</p><p>It also listens for the OUT_GOING_CALL broadcast and traps the call if connected to wifi and then pops up a dialog that tells the user the call has been blocked and offers the user cheaper options than Gsm if there are any.</p><p>I currently use the Broadcasts to get the Scan Results and to get changes in the connected Level of the wifi connection also.</p><p>However I had thought that moving these to a service of my own would be a good idea, however would I be better leaving them as Broadcast Recievers in Non Activtiy and Non Service classes and just make the main Engine of the application a service that turns on and off these broadcasts from there Classes (Objects) ?</p>","243999","","243999","","2010-01-28 12:39:23","2010-01-28 12:39:23","Android - Passing data from a service to a non activity class/object","<android><class><data><service>","0","2","","",""
"2153873","1","","","2010-01-28 10:47:15","2","1192","<p>I am having issues regarding a <code>LocationListener</code> in my Service called <code>myService</code>.</p><p>Here is my code: </p><pre><code>///onStart method ..onStart() {    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE)    .    .    provider = locationManager.getBestProvider(criteria, true);    locationListener = (LocationListener) new MyLocationListener();    locationManager.requestLocationUpdates(provider, 0, 0, locationListener);}</code></pre><p>In my Activity there is a button which should stop the service.  On the click of the button I am doing: </p><pre><code>stopService(new Intent(getApplicationContext(), myService.class)</code></pre><p>In the <code>myService.java</code> file I have:</p><pre><code>////onDestroy method....onDestroy() {    locationManager=(LocationManager) getSystemService(Context.LOCATION_SERVICE);    locationManager.removeUpdates(locationListener); //Getting **exception here ....}</code></pre><p>I get the following Exception:</p><pre><code>java.lang.IllegalArgumentException: listener==null at android.location.LocationManager.removeUpdates(LocationManager.java:799) at &lt;.package_name&gt;myService.onDestroy(myService.java:407) </code></pre><p>I don't know why listener turns null without reason.  Please can you tell me where I am going wrong! </p>","143434","","3171","","2010-01-28 11:18:11","2012-12-18 22:17:10","Why does my LocationListener become null?","<android><location><locationmanager><locationlistener>","2","2","","",""
"2154140","1","","","2010-01-28 11:38:32","1","400","<p>I want to display a list of image form url which I will get from xml file. How can I do that? Please assist me.</p><p>Any kind of help is appreciated.</p>","260915","","426671","","2013-05-29 18:04:18","2013-05-29 18:04:18","Regarding image Display from url in android","<android>","1","0","","",""
"2154212","1","","","2010-01-28 11:50:24","1","4820","<p>This is my first app so finding my way around bit by bit and have been experimenting a little and would like to change the background colour to a colour from a list.</p><p>Currently it loads a white background specified in strings.xml</p><pre><code>&lt;color name=""all_white""&gt;#FFFFFF&lt;/color&gt; </code></pre><p>This is used in main.xml:</p><pre><code>android:background=""@color/all_white""</code></pre><p>Ideally I would like to change the colour in OnCreate() to a colour of my choice.  I have tried setBackgroundDrawable but it doesnt seem to work?</p><p>This is my code:</p><pre><code>public class TestActivity extends Activity { double dimValPercent = 100;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        SetDimLevel(dimValPercent);        SetBackground();        return;    }    public void SetBackground()    {     getWindow().setBackgroundDrawable( new ColorDrawable       (color.all_blue) );        return;    }   void SetDimLevel(double dimVal)   {        WindowManager.LayoutParams lp = getWindow().getAttributes();       lp.screenBrightness = (float) (dimVal/ 255.0);       getWindow().setAttributes(lp);       return;   }}</code></pre>","51604","","","","","2010-01-28 12:46:00","Android First App, changing the background color from a list of specified colors","<android>","1","0","","",""
"2154328","1","","","2010-01-28 12:07:57","7","7667","<p>I'm using <code>registerContentObserver()</code> to be notified as the contacts are changed, but when I register for the content <code>uri:People.CONTENT_URI</code> and when I observe in the log cat I'm getting the notify as ""false"" even after changing the contact.</p><p>I have also overridden the <code>deliverSelfNotification</code> to true.  What am I doing wrong?</p>","253758","","836407","","2011-11-17 20:59:00","2012-05-17 03:16:32","Android: using registerContentObserver() to be notified as the contacts are changed","<android>","2","0","3","",""
"2154337","1","","","2010-01-28 12:08:55","0","617","<p>I run Android SDK and AVD Manager in Vista and have problems installing components. The installer downloads components successfully, but at the end of the installation it hangs for about minute and then asks to disable AV software. If I choose 'No', the installer stops with error message like: ""Filed to rename directory '...' to '...' "". Thus, I have to unpack downloaded components and place them to proper folders manually.</p><p>I have no AV software. I assumed that the installer requires Administrator rights, but runing it as Administrator didn't help.</p><p>If anybody fixed the issue, please advice something.Thanks.</p>","260947","","","","","2010-08-01 20:45:30","Android SDK and AVD Manager hangs trying to rename temporary folders","<android>","1","0","","",""
"2154438","1","2154612","","2010-01-28 12:26:26","14","12069","<p>i have username,password and checkbox of remember me.</p><p>how to implement remember me function to keep username and password data??</p><p>any help would be appriciated.</p>","249991","","","","","2012-05-11 06:13:43","how to implement Remember me function in login of android Activity?","<android><activity>","1","1","8","",""
"2154494","1","","","2010-01-28 12:38:01","0","139","<p>HiI am getting photos from website and display them in Grid view, buthere I do not want display all of them at time,1. I want show only 10 photos and a ""more"" link below the grid , but ican display ""more"" link at top, how can I add it at bottom?2.when user click on ""more"" it should display the another 10 photosonly, I need to refresh the grid, how can we refresh the grid?</p><p>Thank  you</p>","260967","","","","","2010-01-28 17:25:55","show more photos","<android>","1","0","","",""
"2154862","1","2155119","","2010-01-28 13:43:12","1","575","<p>I want to press an Android button and automatically direct the user to the PayPal site with all the relevant data POSTED along also.  Is this possible?</p>","248521","","","","","2013-11-08 21:42:38","Opening the browser through an Intent and Posting data for PayPal","<android>","1","1","1","",""
"2154945","1","2155358","","2010-01-28 13:55:33","8","2275","<p>I specified a meta-data in my manifest.xml like this:</p><pre><code>&lt;meta-data android:value=""5555555555"" android:name=""foo""&gt;&lt;/meta-data&gt;</code></pre><p>When accessing the meta data like this:</p><pre><code>ActivityInfo ai = act.getPackageManager().getActivityInfo(componentName, PackageManager.GET_META_DATA);Object value = (Object)ai.metaData.get(key);</code></pre><p>this value gets interpreted as int and - more importantly - incorrectly interepreted (1260588259).</p><p>Since the type is determined automatically by the build system ( booleans, ints, floats and strings ) i wondered if there is any way to force the datatype to string.</p><p>I tried adding a space at the end ( ""5555555555 ""), but then the value gets interpreted as 5.5555553E9 float! ).</p><p>I also tried using getString instead of get, but then null is returned.</p><p>Any ideas? TIA.</p>","261009","","3171","","2010-01-28 14:24:43","2010-01-28 14:56:53","How to force a meta-data value to type string?","<android><android-manifest>","2","0","","",""
"2155171","1","","","2010-01-28 14:33:29","3","3581","<p>How do I use Android TTS API's from the web page?</p>","61821","","168868","","2012-01-01 22:02:48","2012-01-01 22:02:48","Can we use Android TTS from web pages?","<android><text-to-speech>","1","2","2","",""
"2155445","1","2155465","","2010-01-28 15:06:42","2","1365","<p>I'm new to android and I'm trying to figure out if there is a best practise in menu handling. Well, here is the thing:</p><p>I have created a menu.xml file (wihtin res/menu), Main.java handle the menu action with a switch case.</p><p>I'm wondering what is the best way to run appropriate task when an action is performed on a menu item:</p><ul><li>Use an intent and trigger the corresponding activity</li><li>define everything (which could be a lot of code) within the case corresponding to this menu item.</li></ul><p>thanks a lot for your help,Luc</p>","231957","","60261","","2010-01-28 15:08:27","2010-01-28 15:08:33","Android, trigger Activity on menu action","<android>","1","0","2","",""
"2155698","1","2155733","","2010-01-28 15:38:53","2","704","<p>I currently have this:</p><pre><code>Builder yesandno = new AlertDialog.Builder(this);           yesandno.setTitle(""QuickResponse"");yesandno.setMessage(message);yesandno.setPositiveButton(""YES"", null);yesandno.setNegativeButton(""NO"", null);yesandno.show();</code></pre><p>How should I go by setting an event listener that will capture if the user clicked YES or NO?</p>","17162","","82118","","2010-01-28 15:44:15","2010-01-28 15:44:15","How to get the response from a modal dialog?","<java><android>","2","0","1","",""
"2156084","1","2156866","","2010-01-28 16:29:12","11","4983","<p>My dev team and I are looking to do a game in Android, instead of iPhone for our next sprint iteration. We've been tweaking with <a href=""http://bitbucket.org/snej/geekgameboard/"" rel=""nofollow"">GeekGameBoard</a> (which we love), and I was wondering if anyone could recommend a similar game library for Java / Android-esque.</p><ul><li>We're not looking for OpenGL </li><li>We're looking for Board Game / Card Game (engine or code framework)</li><li>Also, open-source preferable.</li></ul><p>Any advice?</p>","1247659","","476681","","2012-07-19 20:18:07","2012-07-19 20:33:12","Recommend a Java / Android Game Library - card, board, etc.?","<java><android>","2","0","7","",""
"2156363","1","2158589","","2010-01-28 17:03:35","14","20939","<p>I would like to get user contacts and then append some kind of regular expression and append them to a list view. I am currently able to get all the contacts via </p><p><code>getContentResolver().query(People.CONTENT_URI, null, null, null, null);</code> </p><p>and then pass them to a custom class that extends <code>SimpleCursorAdapter</code>.</p><p>So I would like to know how to get only the contacts that match a regular expression and not all of users contacts.</p>","234898","","67022","","2012-05-21 02:50:20","2012-05-21 02:50:20","How to filter the results of content resolver in android?","<android>","3","0","6","",""
"2157089","1","4682349","","2010-01-28 18:56:47","43","25909","<p>Has anybody succeeded in updating/installing Android SDK platforms on a headless Linux server?  All I got is the following error:</p><p>It seems like the action ""update sdk"" is actually not supported?</p><pre><code>~/android-sdk-linux_86/tools$ ./android --verbose update sdkNo 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        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)        at org.eclipse.swt.internal.gtk.OS.&lt;clinit&gt;(Unknown Source)        at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)        at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)        at org.eclipse.swt.widgets.Display.&lt;clinit&gt;(Unknown Source)        at com.android.sdkuilib.internal.repository.UpdaterWindowImpl.open(UpdaterWindowImpl.java:93)        at com.android.sdkuilib.repository.UpdaterWindow.open(UpdaterWindow.java:110)        at com.android.sdkmanager.Main.showMainWindow(Main.java:281)        at com.android.sdkmanager.Main.doAction(Main.java:251)        at com.android.sdkmanager.Main.run(Main.java:92)        at com.android.sdkmanager.Main.main(Main.java:81)</code></pre><p><strong>Update</strong>: The question was asked a while ago when headless update wasn't supported.  It is now possible to do just a <code>android update sdk --no-ui</code>.  Thanks folks!</p>","71133","","71133","","2012-05-24 17:08:45","2014-04-08 09:47:17","""android update sdk"" on headless linux","<android>","8","1","11","",""
"2158805","1","2158910","","2010-01-28 23:32:00","0","1653","<p>In my app i let the user select one image from the media gallery. To do this i use the Intent.ACTION_PICK.Like</p><pre><code>Intent intent = new Intent(Intent.ACTION_GET_CONTENT);intent.setType(""image/*"");startActivityForResult(intent, IMAGE_PICK);</code></pre><p>The app works mostly fine, the users can select an image and the uri correctly.</p><p>The matter is in the gallery. If the user does a tap on an image all goes well, image is selected and uri returned.But if the user does a long click on an image, be it accident or on purpose, the phone vibrates a split sec, the image is focused, and then nothing happens.I understand on the formal gallery app this brings up a menu, but in this case it does nothing, and it can be confusing to users, to think they tapped and see the app do nothing.</p><p>So the question is, can i do anything to change the behavior of the long click in that screen? Like override the <code>onLongClick</code> or set an <code>onLongClickListener</code> or something?</p><p>Thanks in advance, best regards.</p>","441621","","166712","","2010-01-28 23:33:52","2010-01-29 00:04:11","In the Gallery from Intent.ACTION_PICK, can I override the longClick?","<android><android-intent><image-gallery>","1","0","1","",""
"2159254","1","2164646","","2010-01-29 01:10:52","1","567","<p>I'm planning to perhaps purchase an android phone, and would love to be able to script some simple apps in Ruby on it. I found this article from back in August where the author was able to get the scripts working, but since I'm not a Java head, I had a hard time understanding all the steps.</p><p><a href=""http://amazing-development.com/archives/2009/08/04/android-scripting-environment-supports-jruby/"" rel=""nofollow"">http://amazing-development.com/archives/2009/08/04/android-scripting-environment-supports-jruby/</a></p><p>Do you know of any other tutorials or how to's out there that explain the process in more detail? Do you know if performance has improved since August?</p>","65359","","","","","2012-01-12 02:27:50","Any tutorial-like articles out there that explain how to use jRuby on Android?","<ruby><android><jruby>","1","0","2","2013-07-04 02:02:52",""
"2159320","1","","","2010-01-29 01:30:46","60","71912","<p>How can I size a view based on the size of its parent layout. For example I have a relativelayout that fills the full screen, and I want a child view, say an imageview, to take up the whole height, and 1/2 the width?</p><p>I've tried overriding all on onMeasu onLayout onSizeChanged etc and I couldn't get it working....</p>","261493","","102703","","2010-01-29 01:47:03","2013-07-15 02:08:48","How to size an Android view based on its parent's dimensions","<android><layout>","7","1","23","",""
"2159375","1","","","2010-01-29 01:49:03","5","3833","<p>I have a drupal-based website where people can log in and see private discussion forums. This is where I want to have my beta testers for my Android application download the beta .apk files. I tested this thoroughly on my Android 1.6 based myTouch 3G, and was able to log in, and download files attached to forum posts without problems.</p><p>Now comes the interesting part: my testers on Droids and Nexus Ones (Android 2.0.1 and 2.1) were complaining that their downloads are failing. Since I don't have an 2.0 phone, I tried it out in a 2.0 emulator, and lo-and-behold, it didn't work. The download shows the indeterminate progress for a second or two, then shows ""Download unsuccessful"".</p><p>Based on what I see in the logs, it is apparent that the server is returning a 404 for the download request from 2.0 browsers. I can download to my desktop and 1.6 phone no problem. The only reason I can think of that the server would return a 404 for a request is that for some reason the credentials or cookies aren't being passed by the download process. Logcat shows: http error 404 for download x</p><p>Some background:I added the mime type to my .htaccess like this:AddType application/vnd.android.package-archive apk</p><p>I checked the server logs and see the following for failed downloads:xx.xx.xx.224 - - [28/Jan/2010:20:39:00 -0500] ""GET /system/files/grandmajong-beta090.apk HTTP/1.1"" 404 - ""http://trickybits.com/forums/beta-testing/grandma-jong/latest-version-090-b1"" ""Mozilla/5.0 (Linux; U; Android 1.6; en-us; sdk Build/Donut) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1""</p>","45097","","","","","2012-06-27 09:10:32","Unable to download .apk via webbrowser from drupal site","<android><drupal><web-browser><webkit>","5","0","","",""
"2159528","1","2174062","","2010-01-29 02:31:37","2","930","<p>I have been able to create an *.apk file from my code, place the filein IIS, and download it onto a number of Android phones.  Upon theinstall, the application works exactly as expected.</p><p>However, after a phone is rebooted, the application name is changed tothe fully-qualifed java class name of the activity in the menu (so""MyActivity"" becomes ""com.mycompany.MyActivity""), and when I try to goto Menu > Settings, I get an error that causes android to force closemy application.</p><p>Looking into DDMS, I see that I get an error indicating that it cannot find my Preferences activity, despite the fact upon initialinstall, it works properly.</p><p>I'm using Eclipse on Windows XP, and have several Android devices atmy disposal to test with.</p><p>Any idea what's going on?</p><p>AndroidManifest.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""com.company.app""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/logo"" android:label=""@string/app_name""&gt; &lt;!--android:debuggable=""true""&gt;--&gt;    &lt;activity android:name=""com.company.app.ActivityMain""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name=""com.company.app.Preferences""              android:label=""@string/app_settings""&gt;              &lt;intent-filter&gt;                &lt;category android:name=""android.intent.category.PREFERENCE""&gt;&lt;/category&gt;                &lt;action android:name=""android.intent.action.MAIN""&gt;&lt;/action&gt;              &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;service android:name=""com.company.app.Service""&gt;&lt;/service&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE""/&gt;&lt;uses-permission android:name=""android.permission.INTERNET""/&gt;&lt;uses-permission android:name=""android.permission.ACCESS_WIFI_STATE""/&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""/&gt;&lt;/manifest&gt; </code></pre>","261513","","261513","","2010-01-29 18:46:51","2010-02-01 00:43:37","APK Deployment Issue","<android><android-manifest>","2","5","0","",""
"2159674","1","","","2010-01-29 03:16:45","5","7609","<p>I am using the following code to set the adapter (SimpleCursorAdapter) for an AutoCompleteTextView</p><pre><code>mComment = (AutoCompleteTextView) findViewById(R.id.comment);    Cursor cComments = myAdapter.getDistinctComments();    scaComments = new SimpleCursorAdapter(this,R.layout.auto_complete_item,cComments,new String[] {DBAdapter.KEY_LOG_COMMENT},new int[]{R.id.text1});    mComment.setAdapter(scaComments);</code></pre><p>auto_complete_item.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextViewxmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/text1""android:layout_width=""wrap_content""android:layout_height=""wrap_content""/&gt;</code></pre><p>and thi is the xml for the actual control</p><pre><code>&lt;AutoCompleteTextView                        android:id=""@+id/comment""                        android:hint=""@string/COMMENT""                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""                        android:textSize=""18dp""/&gt;</code></pre><p>The dropdown appears to work correctly, and shows a list of items. When I make a selection from the list I get a sqlite object ('android.database.sqlite.SQLiteCursor@'... ) in the textview.Anyone know what would cause this, or how to resolve this?</p><p>thanks</p><p>Ok I am able to hook into the OnItemClick event, but the TextView.setText() portion of the AutoCompleteTextView widget is updated after this point. The OnItemSelected() event never gets fired, and the onNothingSelected() event gets fired when the dropdown items are first displayed.</p><pre><code>       mComment.setOnItemClickListener( new OnItemClickListener() {        @Override        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,                long arg3) {            // TODO Auto-generated method stub            SimpleCursorAdapter sca = (SimpleCursorAdapter) arg0.getAdapter();            String str = getSpinnerSelectedValue(sca,arg2,""comment"");            TextView txt = (TextView) arg1;            txt.setText(str);            Toast.makeText(ctx, ""onItemClick"", Toast.LENGTH_SHORT).show();        }    });    mComment.setOnItemSelectedListener(new OnItemSelectedListener() {        @Override        public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,                int arg2, long arg3) {            Toast.makeText(ctx, ""onItemSelected"", Toast.LENGTH_SHORT).show();        }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {            // TODO Auto-generated method stub            Toast.makeText(ctx, ""onNothingSelected"", Toast.LENGTH_SHORT).show();        }    });</code></pre><p>Anyone alse have any ideas on how to override the updating of the TextView?</p><p>thanks</p><p>patrick</p>","244190","","244190","","2010-01-30 20:15:47","2012-03-06 15:21:55","AutoCompleteTextView displays 'android.database.sqlite.SQLiteCursor@'... after making selection","<android><android-widget>","4","0","3","",""
"2159679","1","2166692","","2010-01-29 03:18:25","0","791","<p>Hello I am trying to make a terminal type app that is wider than the actual android screen. A listview is great except that I don't want the text to wrap. If the text is wider than the screen I want it to print the full text and then the user can scroll over horizontally if they want to see what was printed off the screen. Just FYI this is for ascii type tables. I have followed this example:</p><p><a href=""http://nan-technicalblog.blogspot.com/2008/12/android-how-to-use-horizontal-scrolling.html"" rel=""nofollow"">http://nan-technicalblog.blogspot.com/2008/12/android-how-to-use-horizontal-scrolling.html</a></p><p>It works great as far as horizontal text goes it does exactly what I want but I am unable to get the ListView inside the custom LinearLayout to actually scroll veritcally. I have tried passing the Y coordinates from the onScroll method to mListView such as:</p><pre><code>mListView.scrollBy(0, distanceY);</code></pre><p>but that seems to move the custom LinearLayout window instead of just scrolling the ListView. I can tell that the ListView is not scrolling because the window moves without the  vertical scroll bar of the ListView moving. Everything just slides around. Any help would be much appreciated.</p>","67455","","","","","2010-01-30 03:19:22","Making child ListView scroll","<android><listview><scrolling><android-linearlayout>","1","0","","",""
"2159847","1","2179039","","2010-01-29 04:17:05","18","24221","<p>I'm struggling with using EditText and Spannable text object, These days, I've read API documents around ten times, even I'm not certain that I understand correctly. So I'm looking for a kind of example which show me how to utilize EditText and Spannable.</p>","258508","","258508","","2010-01-29 07:12:17","2014-03-17 16:38:00","Is there any example about Spanned and Spannable text","<android><android-widget>","3","1","7","",""
"2160048","1","2160240","","2010-01-29 05:22:52","5","4501","<p>I would like to know whether the Android provides any sort of compatibility i.e either forward or backward. It means as in Blackberry if develop an Application with JDE 4.2 then that application will work on any handset with OS 4.2 or higher which means it has forward compatibility. Is there anything similar in Android? </p><p>Suppose I develop application with Android SDK 1.5 then will that application work on any handset having OS 1.5 or higher.</p><p>Hope to get a reply soon.</p><p>Thanks &amp; RegardsSunil</p>","261566","","","","","2012-12-09 23:41:38","Forward or Backward Compatibility in Android?","<android><compatibility><forward>","4","0","2","",""
"2160339","1","","","2010-01-29 06:42:09","1","2448","<p>I am new to this android application development.</p><p>I have a audio files in a particular directory. I want to list the those audio files in a listView.</p><p>please tell me how to do this activity.</p>","229554","","","","","2010-01-29 07:11:29","how to list the audio files in a Listview in android","<android><listview>","1","0","1","",""
"2160437","1","2161403","","2010-01-29 07:07:44","1","649","<p>I am looking to develop an application and would like to know if the earpiece audio output can be captured. </p><p>Thanks,Matt</p>","261617","","261617","","2010-01-29 13:58:34","2011-09-30 15:36:28","Can the audio stream output from the earpiece during a call be captured?","<android>","1","0","0","",""
"2160454","1","","","2010-01-29 07:13:16","13","27887","<p>I am new to Android. Follow the HelloAndroid Tutorials by use Eclipse. After run HelloAndroid, the AVD 'xian_avd2' lunched, but stop there, no "" Hello, Android""displayed on AVD. Looks like Waiting for HOME ('android.process.acore') to be launched...</p><p>Not know how to resolve this, please help.Thankswang813</p><pre><code>[2010-01-29 00:12:13 - HelloAndroid]------------------------------[2010-01-29 00:12:13 - HelloAndroid]Android Launch![2010-01-29 00:12:13 - HelloAndroid]adb is running normally.[2010-01-29 00:12:13 - HelloAndroid]Performing com.example.helloandroid.HelloAndroid activity launch[2010-01-29 00:12:13 - HelloAndroid]Automatic Target Mode: Preferred AVD 'xian_avd2' is not available. Launching new emulator.[2010-01-29 00:12:14 - HelloAndroid]Launching a new emulator with Virtual Device 'xian_avd2'[2010-01-29 00:12:37 - HelloAndroid]New emulator found: emulator-5554[2010-01-29 00:12:37 - HelloAndroid]Waiting for HOME ('android.process.acore') to be launched...[2010-01-29 00:13:59 - HelloAndroid]emulator-5554 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!</code></pre>","261621","","122080","","2010-04-26 12:43:21","2013-10-17 12:16:01","HelloAndroid]emulator-5554 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!","<android>","15","0","2","",""
"2160518","1","","","2010-01-29 07:26:45","6","9221","<p>how to add items to the spinner  dynamically in android?</p>","217065","","","","","2012-01-06 09:28:32","how to add items to the spinner dynamically in android?","<android>","2","0","4","",""
"2160522","1","2164098","","2010-01-29 07:28:06","0","61","<p>Requirement:<br>I have a <code>GridView</code> of thumbnails; the user can click on a thumbnail to view the larger, full sized image. This ""full sized"" image is to be fetched from a remote server. When the user is viewing a particular image he should be able to cycle through all of them by swiping his fingers on the screen(like leafing through pages of a book).</p><p>Questions:<br>1. What component should be used to display the larger version of the bitmap? I thought of using a <code>ViewFlipper</code> as it only seems logical to me. But I haven't used it before and am not sure of how I will create a new View every time, dynamically and pass it to the Flipper. Any tutorial that exemplifies this would be great.<br>2. Is there any other way to approach this problem?</p><p>Thanks!</p>","236128","","","","","2010-01-29 18:11:24","Which control would be a better fit to this problem?","<android><android-controls>","1","0","","",""
"2160619","1","","","2010-01-29 08:02:37","88","49899","<p>I need to ellipsize a multi-line textview. My component is large enough to display at least 4 lines with the ellipse, but only 2 lines are displayed. I tried to change the minimum and maximum number of rows of the component but it changes nothing.</p>","164460","","840669","","2012-04-05 15:59:42","2014-01-17 21:33:23","android ellipsize multiline textview","<android><multiline><textview><ellipse>","14","3","41","",""
"2161243","1","2161265","","2010-01-29 10:24:14","5","10785","<p>I would like to delete a complete database created by my application.</p><p>Do you know any adb command, or android sentence to do it?</p><p>Thanks in advance.Best regards.Jose.</p>","79919","","","","","2011-04-19 18:22:04","Android: Delete entire database","<android><htc>","6","0","4","",""
"2161750","1","2161808","","2010-01-29 12:08:14","32","63466","<p>I am currently trying to set up a WiFi Scan in my Android application that scans for WiFi access points every 30 seconds.</p><p>I have used Timer and TimerTask to get the scan running correctly at the intervals which I require.</p><p>However I want to be able to stop and start the scanning when the user presses a button and I am currently having trouble stopping and then restarting the Timer and TimerTask.</p><p>Here is my code</p><pre><code>TimerTask scanTask;final Handler handler = new Handler();Timer t = new Timer();public void doWifiScan(){scanTask = new TimerTask() {        public void run() {                handler.post(new Runnable() {                        public void run() {                         wifiManager.scan(context);                          Log.d(""TIMER"", ""Timer set off"");                        }               });        }};    t.schedule(scanTask, 300, 30000);  }  public void stopScan(){   if(scanTask!=null){      Log.d(""TIMER"", ""timer canceled"");      scanTask.cancel(); }}</code></pre><p>So the Timer and Task start fine and the scan happens every 30 seconds however I cant get it to stop, I can stop the Timer but the task still occurs and scanTask.cancel() doesn't seem to work either.</p><p>Is there a better way to do this? Or am I missing something in the Timer/TimerTask classes?</p>","243999","","928814","","2011-12-19 09:30:56","2013-07-10 18:44:14","Android - Controlling a task with Timer and TimerTask?","<android><timer><scheduled-tasks><cancel>","3","0","17","",""
"2162043","1","","","2010-01-29 13:02:20","7","3170","<p>My code is stored in SVN version control.  I use Eclipse to build my Android application.</p><p>In my application, I have an about-box.  I want to show the correct source control revision/tag/whatever in this.</p><p>Is there a way of automating this so that my version string in the about-box is always right, or is this something I have to hand-edit each time I commit?</p><p>Thx for the early answers about $keywords$.</p><p>Setting the SVN property <code>svn:keywords</code> to <code>Rev</code> does expand a <code>private String m_svn_rev = ""$Rev:$""</code> every time I submit <em>that</em> file.</p><p>SVN is a per-file version control system.</p><p>Which leads instead to wonder if I can somehow pre-process some files in the Android build thingy to inject svnversion output?</p>","15721","","15721","","2010-01-29 13:38:01","2011-11-26 14:55:28","embed version details in android APK","<java><android><eclipse><version-control>","4","0","7","",""
"2162049","1","","","2010-01-29 13:03:07","3","5585","<p>I'm totally new to this, been tinkering around for a week. </p><p>Came up with a simple image viewer app for 2 images. </p><p>Feature:Left and right swipes will switch the images. Dead simple.</p><p>What i'd like to do:Have up to 100 images.</p><p>note:All my images are in my res/drawable folder.<br>They're named image1.png to image100.png</p><p>I obviously don't want to do:</p><pre><code>    ImageView i = new ImageView(this);    i.setImageResource(R.drawable.image1);    viewFlipper.addView(i);    ImageView i2 = new ImageView(this);    i2.setImageResource(R.drawable.image2);    viewFlipper.addView(i2);    ImageView i3 = new ImageView(this);    i3.setImageResource(R.drawable.image3);    viewFlipper.addView(i3);</code></pre><p>all the way to i100.</p><p>how do I make this into a loop, which is flexible and reads everything from the drawable folder ( and not be limited to 100 images)?</p><p>source:</p><pre><code>    public class ImageViewTest extends Activity {        private static final String LOGID = ""CHECKTHISOUT"";        private static final int SWIPE_MIN_DISTANCE = 120;        private static final int SWIPE_MAX_OFF_PATH = 250;        private static final int SWIPE_THRESHOLD_VELOCITY = 200;        private GestureDetector gestureDetector;        View.OnTouchListener gestureListener;        private Animation slideLeftIn;        private Animation slideLeftOut;        private Animation slideRightIn;        private Animation slideRightOut;        private ViewFlipper viewFlipper;        String message = ""Initial Message"";         /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            //Set up viewflipper            viewFlipper = new ViewFlipper(this);                   ImageView i = new ImageView(this);            i.setImageResource(R.drawable.sample_1);            ImageView i2 = new ImageView(this);            i2.setImageResource(R.drawable.sample_2);            viewFlipper.addView(i);            viewFlipper.addView(i2);            //set up animations            slideLeftIn = AnimationUtils.loadAnimation(this, R.anim.slide_left_in);            slideLeftOut = AnimationUtils.loadAnimation(this, R.anim.slide_left_out);            slideRightIn = AnimationUtils.loadAnimation(this, R.anim.slide_right_in);            slideRightOut = AnimationUtils.loadAnimation(this, R.anim.slide_right_out);            //put up a brownie as a starter            setContentView(viewFlipper);            gestureDetector = new GestureDetector(new MyGestureDetector());        }        public class MyGestureDetector extends SimpleOnGestureListener {            @Override            public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {                try {                    if (Math.abs(e1.getY() - e2.getY()) &gt; SWIPE_MAX_OFF_PATH)                        return false;                    // right to left swipe                    if(e1.getX() - e2.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                        Log.v(LOGID,""right to left swipe detected"");                        viewFlipper.setInAnimation(slideLeftIn);                        viewFlipper.setOutAnimation(slideLeftOut);                        viewFlipper.showNext();                        setContentView(viewFlipper);                    } // left to right swipe                     else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                        Log.v(LOGID,""left to right swipe detected"");                                            viewFlipper.setInAnimation(slideRightIn);                        viewFlipper.setOutAnimation(slideRightOut);                        viewFlipper.showPrevious();                        setContentView(viewFlipper);                    }                } catch (Exception e) {                    // nothing                }                return false;            }        }        // This doesn't work        @Override        public boolean onTouchEvent(MotionEvent event) {            if (gestureDetector.onTouchEvent(event)){                Log.v(LOGID,""screen touched"");                return true;            }            else{                return false;            }        }    }</code></pre>","238581","","","","","2011-12-05 03:52:48","Android question - how to prep 100 images to be shown via Fling/Swipe?","<android><android-widget>","3","0","3","",""
"2162072","1","2162313","","2010-01-29 13:07:18","0","1996","<p>Does anyone know if there is any library available for generating captcha which is possible to implement in android application so the captcha appears in the activity?</p><p>Thank you.</p>","22996","","","","","2012-02-09 11:37:36","generating captcha","<android><captcha>","3","2","2","",""
"2162182","1","","","2010-01-29 13:27:57","48","43499","<p>I have an application, when it launches I have to disable all the buttons on Android device, I succeeded  in disabling end call and others. I need to disable home button click. It should not produce any action on click.</p><p>Any suggestions highly appreciated</p>","28557","","114066","","2012-01-10 09:21:30","2012-10-15 07:05:34","Android - Is It possible to disable the click of home button","<android><android-widget>","6","5","42","",""
"2162329","1","2162609","","2010-01-29 13:56:05","0","319","<p>I have a generic list in android.</p><p>for other hand i have a listview.</p><p>How i could bind the generic list into the listview?</p><p>Thanks in advance.Best regards.Jose</p>","79919","","","","","2010-01-29 14:41:21","Android, collections","<java><android>","1","0","","",""
"2163002","1","4842363","","2010-01-29 15:40:03","0","1607","<p>I have a Wifi class that has a couple of broadcast receivers that listen out for changes in Wifi connection state, Wifi Rssi levels etc...</p><p>I want to be able to pass this data to another ""Engine"" Object and still keep the data changing dynamically.</p><p>I currently create a Wifi object within the ""Engine"" class and run its methods, the data is then dynamically displayed fine in Log statements in the log cat.</p><p>My problem is trying to get the dynamically changing data to the Engine, when I try to get data over it gets the first value and leaves it at that without ever updating.</p><p>So I was wondering what my options are on how to do this?</p><p>Below is my current code setup if that is any help:</p><p>Wifi Class</p><pre><code>public Wifi(Context context){    mainWifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);}public int getCurrentWifiState() {    return currentWifiState;}public void setCurrentWifiState(int currentWifiState) {    this.currentWifiState = currentWifiState;}public String getConnectedSSID() {    return connectedSSID;}public void setConnectedSSID(String connectedSSID) {    this.connectedSSID = connectedSSID;}public int getConnectedLevel() {    return connectedLevel;}public void setConnectedLevel(int connectedLevel) {    this.connectedLevel = connectedLevel;}//method to do a scan and receive info about all access points availablepublic List&lt;ScanResult&gt; scan(final Context context){               receiverWifi = new WifiReceiver();               mainWifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);               context.registerReceiver(receiverWifi, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));               mainWifi.startScan();               Log.d(""WIFI DEBUG"",""\nStarting Scan...\n"");                wifiList = mainWifi.getScanResults();    return wifiList; } class WifiReceiver extends BroadcastReceiver {     public void onReceive(Context c, Intent intent) {          sb = new StringBuilder();          wifiList = mainWifi.getScanResults();          ListIterator&lt;ScanResult&gt; results = wifiList.listIterator();          while (results.hasNext()) {              ScanResult info = results.next();              String wifiInfo = ""Name: "" + info.SSID + ""; capabilities = "" + info.capabilities + ""; sig str = "" + info.level + ""dBm"";              Log.v(""WiFi"", wifiInfo);              Log.d(""Signal Level"", ""Signal Level : "" + mainWifi.calculateSignalLevel(info.level, 5));          }     } } //method to listen for changes in the level of the wifi connection public void initializeWiFiListener(Context context){        Log.d(""WIFI"", ""executing initializeWiFiListener"");        String connectivity_context = Context.WIFI_SERVICE;        final WifiManager wifi = (WifiManager)context.getSystemService(connectivity_context);        if(!wifi.isWifiEnabled()){                if(wifi.getWifiState() != WifiManager.WIFI_STATE_ENABLING){                        //wifi.setWifiEnabled(true);                }        }        rssiListener = new BroadcastReceiver(){                @Override                public void onReceive(Context context, Intent intent) {                        String action = intent.getAction();                        if(WifiManager.RSSI_CHANGED_ACTION.equals(action)){                            WifiInfo data = mainWifi.getConnectionInfo();                            Log.d(""WIFI"", ""RSSI has changed"");                            if(mainWifi.getConnectionInfo()!=null){                            setConnectedSSID(data.getSSID());                            setConnectedLevel(data.getRssi());                            Log.d(""WIFI"", ""new RSSI = "" + data.getSSID()+ "" "" + data.getRssi() + ""dBm"");                            }                        }                      }        };        //leak here - need to de reg receiver        context.registerReceiver(rssiListener, new IntentFilter(WifiManager.RSSI_CHANGED_ACTION));} //method to listen for changes in the connection to a wifi access point public void changeWiFiListener(Context context){        Log.d(""WIFI"", ""executing initializeWiFiListener"");        String connectivity_context = Context.WIFI_SERVICE;        final WifiManager wifi = (WifiManager)context.getSystemService(connectivity_context);        if(!wifi.isWifiEnabled()){                if(wifi.getWifiState() != WifiManager.WIFI_STATE_ENABLING){                        //wifi.setWifiEnabled(true);                }        }        wifiChangeListener = new BroadcastReceiver(){                @Override                public void onReceive(Context context, Intent intent) {                        String action = intent.getAction();                        if(WifiManager.WIFI_STATE_CHANGED_ACTION.equals(action)){                            Log.d(""WIFI"", ""WIFI has changed"");                            int wifiState = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, -1);                            Log.d(""WIFI"", ""WIFI State = "" + wifiState);                            setCurrentWifiState(wifiState);                        }                  }        };        //Leak here - not unregistering receiver        context.registerReceiver(wifiChangeListener, new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION));}public WifiReceiver getReceiverWifi() {    return receiverWifi;}public void setReceiverWifi(WifiReceiver receiverWifi) {    this.receiverWifi = receiverWifi;</code></pre><p>And my Engine Code:</p><p>public Engine(Context aContext){</p><pre><code>    context = aContext;    cm = new CallManager(aContext);    wifiManager = new Wifi(context);    wifiManager.initializeWiFiListener(context);    wifiManager.changeWiFiListener(context);        clc = new CallLogController();}public void controlCalls(){    int currentWifiState = wifiManager.getCurrentWifiState();    cm.monitorOutgoingCalls(context, currentWifiState, clc);}public void unRegAllRecievers(){    wifiManager.unregRegisters(context);    cm.unRegReciever(context);}public void doWifiScan(){    scanTask = new TimerTask() {        public void run() {                handler.post(new Runnable() {                        public void run() {                            wifiManager.scan(context);                             Log.d(""TIMER"", ""Timer set off"");                        }               });        }};    t.schedule(scanTask, 300, 30000); }public void stopScan(){         scanTask.cancel();        t.cancel();        //boolean tf = scanTask.cancel();        //Log.d(""TIMER"", ""Timer True or False? : "" + tf);}</code></pre><p>}</p><p>So I'm just wondering what would be the best solution to make sure the data from the Wifi class is constantly updated in the engine when it recieves changes from the broadcast receiver?</p><p>Thanks in advance</p>","243999","","","","","2011-01-30 10:25:48","Android - Passing changing data from BroadcastReciever to another Object?","<android><dynamic-data><wifi><broadcastreceiver>","1","0","","",""
"2163017","1","","","2010-01-29 15:41:22","4","5829","<p>I'm trying to implement a copy/paste function. How can I get a selection of text from an EditText?</p><pre><code>EditText et=(EditText)findViewById(R.id.title);</code></pre><p>blabla onclicklistener on a button:</p><pre><code>int startSelection=et.getSelectionStart();int endSelection=et.getSelectionEnd();</code></pre><p>Then I'm stuck. Any ideas?</p>","261934","","507519","","2012-01-07 11:40:47","2013-02-08 03:27:15","Android - get selection of text from EditText","<android><selection><edittext>","3","0","2","",""
"2163100","1","2163203","","2010-01-29 15:51:43","0","1915","<p>i was creating a database and deleting it, adding registries on my android htc mobile sqlite database without any problem. </p><p>But now, after last deleting of the database everytime i want to create a new one i get a sqlite exception that says me ""unable to open database file"" with the following data:</p><blockquote>  <p>serialVersionUID (RuntimeException)= -7034897190745766939<br>  cause= SQLiteException  (id=830058513528)<br>  cause= SQLiteException  (id=830058513528)<br>  detailMessage= ""unable to open database file"" (id=830058513560)   stackState=  (id=830058513672)<br>  stackTrace= null    </p></blockquote><p>This is my code to create a database:</p><pre><code>private static String DB_PATH = ""/data/data/Android.Applications/databases/testdatabase.db"";public void OpenDataBase(){            SQLiteDatabase ApplicationDB = null;            //Si existe la base de datos            if(checkDataBase())            {                //Open readonlymode                String myPath = DB_PATH;                //open database as readwrite mode                ApplicationDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);            }            else            {                try                {                    String myPath = DB_PATH ;                    ApplicationDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.CREATE_IF_NECESSARY);                    CreateTables();                    //create all the necessary tables                    System.out.println(""DataBASE CREATED"");                }                catch(SQLiteException e)                {                    System.out.println(""SQL LiteException""+ e.getMessage());                }            }        } private boolean checkDataBase(){        try{            String myPath = DB_PATH;            ApplicationDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);        }catch(SQLiteException e){            //database does't exist yet.        }        if(ApplicationDB != null){            ApplicationDB.close();        }        return ApplicationDB != null ? true : false;    }</code></pre><p>And this is the code for delete database</p><pre><code> public boolean DeleteDatabase()        {            boolean wasdeleted;            try            {                File file=new File(DB_PATH);                wasdeleted=file.delete();            }            catch(SecurityException e)            {                wasdeleted=false;            }            return wasdeleted;        }</code></pre><p>Could you give me a hand? im stucked here, cause this code works few hours ago...</p><p>Thanks in advance.Best Regards.Jose.</p>","79919","","166712","","2010-01-30 23:01:51","2010-01-30 23:01:51","Creating database in android","<java><android><htc>","1","0","","",""
"2163213","1","2163977","","2010-01-29 16:09:06","2","3379","<p>Hey,I'm writing an app for android (although I think this is a generic question) and I need to display a large image (in an ImageView) that can be scrolled and zoomed. I've managed to get scrolling to work by capturing touch events and performing matrix translations, and i'm now working on zooming.</p><p>If I simply apply a scale transformation to the image, it zooms in at the origin, which is the top left-hand corner of the screen. I would like to zoom in at the center of the screen.From what i've read, this means I need a transformation to make the origin the center of the screen. I think what is required is something like the following- assume the center of the screen is (5, 5) for simplicity...</p><p><code>-Translate by (-5, -5)<br>-Scale by the zoom factor<br>-Translate by (+5, +5)*zoomfactor</code></p><p>Unfortunatly, this doesnt seem to work- the zoom seems to go anywhere BUT the center...can someone help me out here?</p><p>EDIT: This is the code that now works</p><pre><code>    Matrix zoommatrix = new Matrix();    float[] centerpoint = {targetimageview.getWidth()/2.0f, targetimageview.getHeight()/2.0f};    zoommatrix.postScale(zoomfactor, zoomfactor, centerpoint[0], centerpoint[1]);    zoommatrix.preConcat(targetimageview.getImageMatrix());    targetimageview.setImageMatrix(zoommatrix);    targetimageview.invalidate();</code></pre>","200426","","200426","","2010-01-30 01:08:17","2010-01-30 01:08:17","Correct transformations for image zooming","<android><matrix><imageview>","1","1","1","",""
"2163427","1","","","2010-01-29 16:41:11","6","3722","<p>I created an non-maximized activity using android:theme=""@android:style/Theme.Dialog"" to make it looks like a dialog. I need to change the position of the activity on screen but I didn't find how to do this... </p>","164460","","","","","2011-12-09 03:58:59","android dialog activity position","<android><dialog><activity>","3","0","4","",""
"2164245","1","2164648","","2010-01-29 18:36:49","8","13904","<p>I am trying to make the item list dynamic, so i can add to it on runtime, but i have no idea. CharSeqence isnt dynamic, and no clue how to use the adapter option, how could i change my code to be dynamic? </p><pre><code>private void alertDialogLoadFile() {    AlertDialog.Builder alert = new AlertDialog.Builder(this);    alert.setTitle(""Choose:"");      CharSequence[] items = { ""moshe"", ""yosi"", ""ee"" };    alert.setSingleChoiceItems(m_items , -1, new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int item){            /* User clicked on a radio button do some stuff */        }    });    alert.setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int id) {    }    });    alert.setNegativeButton(""No"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int id) {            dialog.cancel();        }    });    AlertDialog ad = alert.create();    ad.show();}</code></pre>","260511","","114066","","2010-08-09 09:40:06","2011-07-28 13:30:07","dynamic alertdialog with radio buttons","<android>","4","2","2","",""
"2164660","1","","","2010-01-29 19:41:29","1","550","<p>(quick side question: if you were going to write an android aim client(just for yourself, not necessarily for mass consumption), is the server API the way to go?  It's what I've been focusing on.)</p><p>I've been having trouble getting a session started using the aim server API for some reason.  I've gone so far as to copy code off the official aim developer forums and still got the same error(statuscode: 401, statusdetailcode:1014).  It's an undocumented error code but I believe I read on the official forums that it's got something to do with the URL signing process.</p><p>All of the code here is pretty much slapped together just to get a test up and running, but hopefully the intent is clear enough.  I'm not ruling any code out, especially since I've never written in java with any level of seriousness, so here's the code I use to send an API call to the server(passed in are the strings urlstring, command, and method):</p><pre><code>buffer = new byte[8192];url = new URL(urlstring);connection = (HttpURLConnection)url.openConnection();connection.setRequestMethod(method);connection.setDoOutput(true);connection.setUseCaches (false);connection.setDoInput(true);DataOutputStream output = new DataOutputStream(connection.getOutputStream());output.writeBytes(command);output.flush();output.close();connection.connect();responseBodyStream = connection.getInputStream();responseBody = new StringBuffer();while ((read = responseBodyStream.read(buffer)) != -1){    responseBody.append(new String(buffer, 0, read));}connection.disconnect();return responseBody.toString();</code></pre><p>I start with a clientLogin command that looks something like this:</p><pre><code>response = APICall(""https://api.screenname.aol.com/auth/clientLogin"",""devId=DEVKEY&amp;f=JSON&amp;s=EXAMPLESCREENNAME&amp;pwd=LAMEPASS"",""POST"");</code></pre><p>I then tokenize the response and grab the authorization token, the session secret, and the timestamp like so:</p><pre><code>StringTokenizer st = new StringTokenizer(response, ""=&amp;"",false);String temp = st.nextToken();while(st.hasMoreTokens()){  if(temp.equals(""token_a""))  authcode = st.nextToken(); else if(temp.equals(""sessionSecret""))  sessionsecret = st.nextToken().getBytes(); else if(temp.equals(""hostTime"")) {  aimtime = st.nextToken();        } temp = st.nextToken();}</code></pre><p>Everything runs perfectly up until here(as far as I can tell anyhow).  I've toyed with calculating the time difference between aim's timestamp response and local time, but for simplicity's sake, I'm just going to use their timestamp from here on out. In order to create the session key, we need to do some crypto stuff.  I use the javax.crypto.Mac stuff for the sha256 part of it, and org.apache.commons for the Base64 conversion.  I've tested it against C#'s built-int crypto and it works as intended, but just for completeness(I left in the try/catches this time out of laziness, but believe me, this isn't throwing any exceptions):</p><pre><code>    public byte[] HMAC_SHA256_BASE64(byte[] key, byte[] data)    {     byte[] finalbytes=null;     try { Mac hmac = Mac.getInstance(""HMAC/SHA256""); hmac.init(new SecretKeySpec(key,hmac.getAlgorithm())); finalbytes = hmac.doFinal(data); } catch (NoSuchAlgorithmException e) {  // TODO Auto-generated catch block  e.printStackTrace();  return null; } catch (InvalidKeyException e) {  // TODO Auto-generated catch block  e.printStackTrace();  return null; } Base64 b = new Base64(); return b.encode(finalbytes);    }</code></pre><p>This gets called like this to create the session key:</p><pre><code>byte[] sessionkey;sessionkey = HMAC_SHA256_BASE64(""LAMEPASS"".getBytes(),sessionsecret);</code></pre><p>In the aim server API docs, there is an example password and session secret, along with the resulting session key.  Everything here checks out. Next up, I build the next request/command.. Most of this stuff is pretty much pasted straight out of the aim development forums. The claim was that it was working code.  I wrote my own version first, but out of frustration went to a direct copy and paste, and yet here I am. Here's the code:</p><pre><code>    String baseurl = ""http://api.oscar.aol.com/aim/startSession"";    String signedParams = null;    try {     StringBuffer paramString = new StringBuffer();      paramString.append(""a="" + authcode);      paramString.append(""&amp;clientName="" +      java.net.URLEncoder.encode(""HostileIM"", ""UTF-8""));      paramString.append(""&amp;clientVersion="" +      java.net.URLEncoder.encode(""1"", ""UTF-8""));      paramString.append(""&amp;events="" +      java.net.URLEncoder.encode(""buddylist,clientError,im,offlineIM,presence,sentIM"", ""UTF-8""));      paramString.append(""&amp;f=xml"");      paramString.append(""&amp;k="" + ""DEVKEY"");      paramString.append(""&amp;ts="" + aimtime);      signedParams = signRequest(""GET"", baseurl, paramString.toString());  } catch (UnsupportedEncodingException e) {  // TODO Auto-generated catch block  e.printStackTrace(); }</code></pre><p>Here's signRequest:</p><pre><code>    private String signRequest(String postType, String baseURL, String queryString)    {  try {             String fullRequest = new String(postType + ""&amp;"" +          java.net.URLEncoder.encode(baseURL, ""UTF-8"") + ""&amp;"" +          java.net.URLEncoder.encode(queryString, ""UTF-8""));          String signature = new String(HMAC_SHA256_BASE64(sessionkey, fullRequest.getBytes()));         return queryString + ""&amp;sig_sha256="" + java.net.URLEncoder.encode(signature, ""UTF-8"");   }  catch(Exception ex)  {  System.out.println(""Exception "" + ex.toString());      return null;  }     }</code></pre><p>Finally:</p><pre><code>response = APICall(""http://api.oscar.aol.com/aim/startSession"",signedParams,""GET"");</code></pre><p>And this when I get the statusCode 401, statusDetailCode 1014.</p><p>I definitely should have done this all first outside of android(and in a language I'm more comfortable with), but I've read the docs many times, and I'm really just not sure what I'm missing. Hopefully someone can help me out.  Thanks!</p>","5323","","5323","","2010-01-29 19:47:42","2010-01-29 19:47:42","How do I successfully start a web aim session using the aim web server API on android?","<java><android><aim>","0","0","","",""
"2164729","1","2177490","","2010-01-29 19:51:29","2","5426","<p>My application has a setting menu which is actually a PreferenceActivity. When it's created, if a boolean value is not set I want to go to the DialogPreference which sets that.</p><p>I tried doing it with an intent but the application force closed with this error msg:</p><blockquote>  <p>E/AndroidRuntime(  239):  android.content.ActivityNotFoundException:  Unable to find explicit activity class  {com.xxxx/com.xxxx.xxxxPreference};  have you declared this activity in  your AndroidManifest.xml?</p></blockquote><p>How should I do this? It's ok to add that DialogPreference to the manifest?</p>","119895","","119895","","2010-01-29 20:38:27","2010-02-01 16:18:41","Going from a PreferenceScreen to a DialogPreference","<android>","2","2","2","",""
"2165110","1","","","2010-01-29 20:57:55","0","277","<p>Can I use the sample apps and edit them to publish them on the market?</p>","","user262135","","","","2010-01-29 23:20:52","Android Sample Apps","<android>","2","1","","2012-07-27 16:08:10",""
"2165235","1","","","2010-01-29 21:19:53","4","2547","<p>I have an XML document built with </p><pre><code>org.xmlpull.v1.XmlSerializer</code></pre><p>This document contains following XML prolog</p><pre><code>&lt;?xml version='1.0' encoding='utf-8' standalone='yes' ?&gt;</code></pre><p>When I try to parse this document using</p><pre><code>import org.xmlpull.v1.XmlPullParser;</code></pre><p>with following configuration code</p><pre><code>XmlPullParser pullParser = Xml.newPullParser();pullParser.setInput(theInputStream, ""utf-8"");</code></pre><p>I get undecoded utf-8 strings when I call </p><pre><code>String text = pullParser.getText();</code></pre><p>So it seems that XmlPullParser in Android (I use 1.5) doesn't support utf-8. Did I miss something?</p><p>Thank you in advance.</p>","244211","","","","","2012-06-07 07:52:48","Android XmlPullParser UTF-8 problem","<xml><android><utf-8>","1","1","1","",""
"2165516","1","","","2010-01-29 22:08:50","0","3280","<p>I need to send MMS. Into my hero this code looks ugly but works: </p><pre><code>Intent sendIntent = new Intent(""android.intent.action.SEND_MSG"");    sendIntent.putExtra(""address"", toText); sendIntent.putExtra(Intent.EXTRA_SUBJECT, ""subject"");sendIntent.putExtra(""sms_body"", textMessage); sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));sendIntent.setType(""image/jpeg""); startActivity(sendIntent);</code></pre><p>But it seems to me that on the other devices it doesn't work at all. I want to send directly to main messaging app without any choices(the better solution of course - direct from my app). Because not sure that all of them would handle it properly.If anybody could recommend any third-party library I'll be appretiate.</p>","262179","","","","","2013-01-19 23:36:04","Sending MMS into different Android devices","<android><messaging><mms>","2","0","1","",""
"2165729","1","","","2010-01-29 22:44:16","1","97","<p>I'm new to Android and was just wondering, if I wanted to develop something like HTC's Sense UI, what is the ""entry point"".  I've gone through the developer docs and it seems those docs only refer to developing applications, but not replacing the Android default L&amp;F.</p><p>What's a good starting point?</p>","262203","","","","","2010-02-03 21:40:48","Replacing default Android L&F","<android>","1","1","","",""
"2165741","1","2166295","","2010-01-29 22:46:26","1","2074","<p>Currently I am working on an Android application that is dynamically creating controls.  Everytime a user would click a button a new EditText appears below the button and the user can interact with the EditText.  However if the screen orientation changes, the EditText's that the user created also disappears.  </p><p>Code sample of user creating a EditText: (located in a onClick(), p is basic layoutParamas, and layout is a LinearLayout located undearneath the button)</p><pre><code>    EditText editText = new EditText(this);    layout.addView(buttonView, p);</code></pre><p>Wondering what would be the easiest way to save the layout when the screen orientation changes so I do not loose any of the controls, or am I dyanmically creating the controls wrong.</p><p>Thanks.</p><p>update:  By overriding the onSaveInstanceState() I was able to save a object which contained a list of all the controls the user orignally added.  Using this list I was able to create the controls in the onCreate().</p><p>Still curious if there is an easier way to accomplish this task, as I would have to refactor a lot of code to fully implement this method.</p>","262176","","262176","","2010-01-30 00:24:39","2010-01-30 00:41:29","Android: dynamically creating controls and orientation change","<android>","1","2","1","",""
"2166361","1","2167187","","2010-01-30 01:02:38","2","1351","<p>I'm toying around with an idea for an app that, in theory, a parent would install on a phone he/she gives to his/her child. So, main problem is, how would I be able to prevent the child from just uninstalling the application? Any ideas on how to solve this? I'm really doubtful something like this exists but thought asking here was a good way to find out if there were any tricks.</p><p>EDIT:</p><p>If there's no way to prevent this from happening; how about this: upon uninstall, do something (e.g. send an email to a previously configured email address). This could serve as a disincentive for the child to uninstall the app as the parent could find out about it. Of course, an industrious miscreant would just turn on airplane mode and then uninstall but I'm just fishing for ideas at this point.</p>","88847","","88847","","2010-01-30 02:46:36","2012-08-09 21:57:15","Locking down an android application. Ideas?","<android>","5","0","1","2012-07-27 16:08:05",""
"2166726","1","","","2010-01-30 03:35:55","-3","901","<p>How to display particular array of items from a database (Mysql) in a Spinner of Android?</p>","262312","","234938","","2010-02-02 11:38:17","2010-02-02 11:38:17","How to display particular array of items from a database (SQLServer) in a Spinner of Android?","<android><spinner>","1","2","0","",""
"2166857","1","2170088","","2010-01-30 04:27:55","3","3512","<p>I'm trying to authenticate with a tomcat server through LDAP. Then after I'm authenticated send a basic GET request to get some data back (XML), and display it to the user. How would I go about authenticating with the server and then performing this request? Are there any good good guides or libraries for this? I'm pretty new with this protocol..</p>","247255","","3171","","2010-01-30 07:39:12","2010-01-31 00:32:42","LDAP Authentication and Android","<android><ldap>","1","2","1","",""
"2166961","1","","","2010-01-30 05:24:05","24","20486","<p>I wish to have one application that runs in the background, which knows when any of the built-in applications (messaging, contacts, etc) is running.</p><p>So my questions are:</p><ol><li><p>How I should run my application in the background.</p></li><li><p>How my background application can know what the application currently running in the foreground is.</p></li></ol><p>Responses from folks with experience would be greatly appreciated.</p>","193583","","68805","","2011-12-21 12:56:59","2013-11-26 14:41:58","Determining the current foreground application from a background task or service","<android>","5","1","24","",""
"2166983","1","","","2010-01-30 05:32:46","0","1214","<p>I'm attempting to write my first android app and am having a littleproblem with filling a List Layout from a DB.</p><p>The project itself is here:</p><p><a href=""http://code.google.com/p/biofuelsfinder/"" rel=""nofollow"">http://code.google.com/p/biofuelsfinder/</a></p><p>However the specific code I'm having the problem with is here:</p><pre><code>public void fillData(String fueltype){        ArrayList&lt;String&gt; items = new ArrayList&lt;String&gt;();        Cursor retailers = biofuelsDB.getRetailers(""b5"");        /*while(!retailers.isAfterLast()){                retailers.moveToNext();                try{                    items.add(retailers.getString(retailers.getColumnIndex(""name"")));                } catch(IllegalStateException e){                    String msg = e.getMessage();                }                //items.add(user.lastName);                //items.add(user.country);        }*/        items.add(""Blah1"");        items.add(""Blah2"");        items.add(""Blah3"");        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,             R.layout.retailers_row, items);        /*setListAdapter(adapter);*/}</code></pre><p>The two portions commented out, if run cause and illegalStateExceptionerror which then aborts the code.</p><p>If anyone could have a look and let me know what I'm going wrong thatwould be most appreciated.</p><p>Below is the stacktrace</p><pre><code>W/dalvikvm(  208): threadid=3: thread exiting with uncaught exception (group=0x4001b188)E/AndroidRuntime(  208): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(  208): java.lang.IllegalStateException: Could not execute method of the activityE/AndroidRuntime(  208):    at android.view.View$1.onClick(View.java:2031)E/AndroidRuntime(  208):    at android.view.View.performClick(View.java:2364)E/AndroidRuntime(  208):    at android.view.View.onTouchEvent(View.java:4179)E/AndroidRuntime(  208):    at android.widget.TextView.onTouchEvent(TextView.java:6532)E/AndroidRuntime(  208):    at android.view.View.dispatchTouchEvent(View.java:3709)E/AndroidRuntime(  208):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)E/AndroidRuntime(  208):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)E/AndroidRuntime(  208):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)E/AndroidRuntime(  208):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)E/AndroidRuntime(  208):    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)E/AndroidRuntime(  208):    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)E/AndroidRuntime(  208):    at android.app.Activity.dispatchTouchEvent(Activity.java:2061)E/AndroidRuntime(  208):    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)E/AndroidRuntime(  208):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1690)E/AndroidRuntime(  208):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  208):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  208):    at android.app.ActivityThread.main(ActivityThread.java:4310)E/AndroidRuntime(  208):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  208):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  208):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime(  208):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime(  208):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  208): Caused by: java.lang.reflect.InvocationTargetExceptionE/AndroidRuntime(  208):    at com.biofuelsfinder.biofuelsfinder.buttonClickHandler(biofuelsfinder.java:37)E/AndroidRuntime(  208):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  208):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  208):    at android.view.View$1.onClick(View.java:2026)E/AndroidRuntime(  208):    ... 21 moreE/AndroidRuntime(  208): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime(  208):    at com.biofuelsfinder.RetailerList.fillData(RetailerList.java:34)E/AndroidRuntime(  208):    ... 25 more</code></pre><p>Thanks</p>","262337","","500725","","2011-10-07 22:04:01","2011-10-07 22:04:01","Unable to fill List Layout in App","<android>","1","1","","",""
"2167404","1","2167438","","2010-01-30 09:29:08","3","6289","<p>I am a newbie android developer and so far have only got Hello World running on my android phone.</p><p>When I try to run my app in emulator mode I see the emulator window with the keyboard and answer / hangup buttons but I get a windows dialogue before my app runs sayingemulator.exe has stopped responding:</p><p><a href=""http://picasaweb.google.com/lh/photo/Js-WYzfyoiVHLKOc6EzUaQ?authkey=Gv1sRgCJz76vKLnJSucg&amp;feat=embedwebsite"" rel=""nofollow""><img src=""http://lh5.ggpht.com/_Ac-KtmUjGx8/S2P7F_DyYkI/AAAAAAACe7E/K82sCUKWtSw/s800/Android%20Emulator.JPG"" /></a></p><p>Can anyone else get the emulator to run on 64 bit Windows 7 Professional? I have a 32 bit JDK and run 32 bit Eclipse 3.5.</p><p>Thanks for any help</p>","151770","","","","","2013-12-24 10:56:24","Android emulator crashing on Windows 7 64 Bit","<android><android-emulator>","3","2","1","",""
"2167517","1","8639914","","2010-01-30 10:21:05","7","3287","<p>I noticed that when I swipe my finger from left to right across a home screen widget, in simulator on a AVD, Android switch to the left home screen.</p><p>I was wondering if its possible to prevent this behavior and allow home screen gadgets to listen and react to finger gestures (like swipe)? Its very critical for my widget UI design.</p>","161753","","119895","","2011-08-26 12:45:20","2011-12-26 23:47:12","Are Android app widgets (for home screen) allowed gestures?","<android><android-widget><gesture>","2","0","2","",""
"2167608","1","2174691","","2010-01-30 10:52:17","3","12210","<p>hi guys i have prepared a code to just play a simple mp4 file from my res folder...The coding is something like this...</p><pre><code>    public class VideoPlayer extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.video);        VideoView video = (VideoView)findViewById(R.id.VideoView);        Uri uri = Uri.parse(""android.resource://company.software.myapp/""                + R.raw.myvideo);        MediaController mc = new MediaController(this);        video.setMediaController(mc);        video.setVideoURI(uri);        //video.requestFocus();        video.start();    }}</code></pre><p>now though there is no error in playing... The activity automatically generates a dialog saying ""sorry this video cannot be played""... but i can hear the Audio and it plays till end... i cant figure out wat the problem is...</p>","238071","","","","","2012-04-26 10:29:00","Android not playing Video .mp4","<android><video><playback>","3","2","2","",""
"2167611","1","","","2010-01-30 10:52:56","3","7681","<p>What's a suitable html parser for Android?</p>","258283","","126039","","2010-01-30 10:57:29","2010-01-31 04:51:34","What's a suitable html parser for Android?","<android>","1","1","","",""
"2167901","1","2167909","","2010-01-30 12:50:23","0","708","<p>Please forgive the very basic nature of this questions - but we all have to start somewhere. I've done some googling but all answers seem to relate to UI Events.</p><p>I am creating a very simple android app that will display your location on screen. I have my main class (HelloAndroid at the moment) that extends Activity and I have created a class LcoationUpdateHandler that listens for updates.</p><p>HelloAndroid holds an instance of LocationUpdateHandler so my question is how does the LocationUpdateHandler communicate with HelloAndroid.</p><p>In flex I would dispatch an event from one to the other but from the searching I have done this doesn't seem like a very java-y way of doing things?</p><p>Thanks for your help.</p>","151770","","","","","2010-01-30 12:56:04","Newbie Java developer questions - inter class communication with events","<java><android><events>","2","0","","",""
"2168090","1","2168290","","2010-01-30 13:59:47","0","3022","<p>I have read <a href=""http://developer.android.com/resources/articles/layout-tricks-stubs.html"" rel=""nofollow"">http://developer.android.com/resources/articles/layout-tricks-stubs.html</a> which explains how to use a viewstub as a lazy include for layouts.</p><p>This works fine on a simple list view i have, but <strong>when I try to use it in my actual Tabbed layout, it disappears as soon as the tab gets any real content.</strong></p><p>I have set all tabs, and tab host to use wrap_content as height (so as not to push the stub off)</p><p>Has anyone used stubs with a tabbed view? What is the trick?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt; &lt;TabHost android:id=""@android:id/tabhost"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;  &lt;LinearLayout android:orientation=""vertical""   android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;   &lt;TabWidget android:id=""@android:id/tabs""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;   &lt;FrameLayout android:id=""@android:id/tabcontent""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;    &lt;ListView android:id=""@+id/discqueue"" android:layout_width=""fill_parent""     android:layout_height=""wrap_content"" /&gt;    &lt;ListView android:id=""@+id/instantqueue""     android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;   &lt;/FrameLayout&gt;   &lt;ViewStub android:id=""@+id/stub_navigate""    android:inflatedId=""@+id/panel_navigate"" android:layout=""@layout/pagination_bar""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:layout_gravity=""bottom"" /&gt;  &lt;/LinearLayout&gt; &lt;/TabHost&gt;&lt;/LinearLayout&gt;</code></pre>","82880","","","","","2011-03-04 05:02:29","Using ViewStub with Tabs in Android Layout","<android><layout><stub>","1","1","","",""
"2168153","1","2168295","","2010-01-30 14:22:36","1","430","<p>In my current project I have a full screen TabActivity. Each tab content is handled by two instances of same <code>ListActivity</code>. Now, I put an extra int in intent to know which data should be displayed.So in <code>onCreate()</code> method of my <code>ListActivity</code>, I check the int in extra and I build my query to obtain a SQLLiteCursor.</p><p>I would like to dynamycally give to this two instances of <code>ListActivity</code> the list of item that should be displayed.</p><p>I do not know what is the best way to do this. Any idea ?</p><p>Regards,</p>","60292","","415347","","2011-08-30 19:25:53","2011-08-30 19:25:53","how to communicate with embedded activity","<android>","1","0","","",""
"2169289","1","2169411","","2010-01-30 20:17:01","2","2802","<p>I am having some issues getting tiles to load into my MapView in android development. I have searched and looked at similar problems on here but with no luck so far.</p><p>I have looked at the instructions <a href=""http://code.google.com/android/add-ons/google-apis/mapkey.html#getdebugfingerprint"" rel=""nofollow"">here</a> and have got hold of my debug API key. I have entered this into my MapView.</p><p>I have checked that my emulator and my debug device have got an internet connection.</p><p>I have move my Internet permission tag in my manifest file to be before the application tag.</p><p>I don't know what else to check.</p><p>I am also unsure of the best way to develop this. It seems that I can't debug with a properly signed app as the debug keystore needs the same password - android. This would imply that each time I go to do a release build I have to change the key - which seems very fragile!</p><p>Is there  any way of developing and releasing builds with my own generated maps API key?</p><p>Some code for you to look at:</p><p>Main.xml:</p><pre><code>&lt;com.google.android.maps.MapView    android:id=""@+id/mapView""     android:layout_height=""fill_parent""     android:layout_width=""fill_parent""    android:apiKey=""??:??:??:??:??:??:??:??:??:??:??:??:??:??:??:??""    /&gt;</code></pre><p>AndroidManifest.xml:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""android:versionCode=""1""android:versionName=""1.0"" package=""com.my.package.name""&gt;&lt;uses-sdk android:minSdkVersion=""3""&gt;&lt;/uses-sdk&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;application     android:icon=""@drawable/icon""     android:label=""@string/app_name""     android:debuggable=""true""    &gt;    &lt;activity         android:name="".MyMainClass""         android:label=""@string/app_name""        &gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;uses-library android:name=""com.google.android.maps"" /&gt;&lt;/application&gt;&lt;/manifest&gt; </code></pre><p>Any Help much appreciated. </p>","151770","","","","","2010-01-30 20:58:56","Android MapView - tiles not loading with Debug API key","<android><google-maps>","1","0","","",""
"2169294","1","2169311","","2010-01-30 20:18:48","70","164101","<p>I am trying to access http link using <code>HttpURLConnection</code> in Android to download a file, but getting this warning in <code>LogCat</code>:</p><blockquote>  <p>WARN/System.err(223): java.net.SocketException: Permission denied (maybe missing INTERNET permission) </p></blockquote><p>I have added android.Manifest.permission to my application but its still giving the same exception.</p>","257580","","445131","","2013-04-09 15:22:05","2014-02-18 07:16:52","How to add manifest permission to android application?","<android><exception><android-manifest>","6","3","13","",""
"2169649","1","2636538","","2010-01-30 22:11:43","124","127561","<p>I am trying to open an image / picture in the Gallery built-in app from inside my application.</p><p>I have a URI of the picture (the picture is located on the SD card).</p><p>Do you have any suggestions?</p>","246119","","312743","","2013-05-23 07:48:32","2014-02-23 21:29:39","Get/pick an image from Android's built-in Gallery app programmatically","<android><image><android-intent><gallery>","13","5","146","",""
"2169894","1","2169966","","2010-01-30 23:19:03","3","8519","<p>For Android, I have a custom view which I fill up with primitive shapes in the onDraw() method.</p><p>Coming from a Processing background, I expected the draw method to be called automatically 30 times per second, but its clear that that's not how android views work.</p><p>So how should I go about calling this method 30 times per second?</p>","88905","","88905","","2010-04-09 05:56:44","2010-04-09 05:56:44","How should I call the onDraw() method of an Android view 30 times per second","<android><processing>","1","0","1","",""
"2170031","1","2251647","","2010-01-31 00:10:55","8","15838","<p>How can I backup my database to the sdcard automatically in my app?And afterward, how do I restore it?</p>","242070","","236247","","2011-06-28 14:48:35","2013-12-05 05:58:29","Backup and restore SQLite database to sdcard","<android><sqlite><backup>","3","0","6","",""
"2170200","1","2173651","","2010-01-31 01:32:05","4","8587","<p>i'm trying to use TabHost and TabWidget in my Android application. This is my layout main.xml:</p><pre><code>&lt;TabHost    android:id=""@+id/mainTabHost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;TabWidget android:id=""@android:id/tabs"" android:layout_width=""fill_parent"" android:layout_height=""65px""/&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;LinearLayout            android:id=""@+id/contentTags""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:orientation=""vertical""&gt;        &lt;/LinearLayout&gt;        &lt;LinearLayout            android:id=""@+id/contentPreferences""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:orientation=""vertical""&gt;        &lt;/LinearLayout&gt;    &lt;/FrameLayout&gt;&lt;/TabHost&gt;</code></pre><p>And my code:</p><pre><code>final TabHost mainTabHost = (TabHost) this.findViewById(R.id.mainTabHost);mainTabHost.setup();final TabHost.TabSpec tabSpecTags = mainTabHost.newTabSpec(""tabTags"");tabSpecTags.setIndicator(this.getString(R.string.tab_name_tags));tabSpecTags.setContent(R.id.contentTags);mainTabHost.addTab(tabSpecTags);final TabHost.TabSpec tabSpecPreferences = mainTabHost.newTabSpec(""tabPreferences"");tabSpecPreferences.setIndicator(this.getString(R.string.tab_name_preferences));tabSpecPreferences.setContent(R.id.contentPreferences);mainTabHost.addTab(tabSpecPreferences);</code></pre><p>The problem is that i do not want my tabs to be so tall (65px). However, if i set the layout_height of the TabWidget to e.g. 30px, i can't see the tab labels (indicator) on the tabs at all.</p><p>Seems like there is a ""minimum required"" height for the TabWidget (65px?) and the indicator is positioned at the bottom of this 65px?</p><p>Is there a way to adjust the positioning of the indicator?</p><p>Thanks!</p>","254959","","","","","2012-02-09 16:32:19","TabWidget - How to set position of indicator text?","<android><tabwidget>","4","1","3","",""
"2170214","1","2170734","","2010-01-31 01:41:00","28","40054","<p>I save an image to the sdcard and it doesn't appear in the Gallery application until I pull off the sdcard and return it back.</p><p>Do you have any idea why is it so?</p><p>Seems like the Gallery application has some cache that isn't updated on file save...</p><p>Actually, I also want to open the just-saved image in Gallery application and have no success with that <br/><a href=""http://stackoverflow.com/questions/2169649/open-an-image-in-androids-built-in-gallery-app-programmatically"">this</a> is my question about this issue.</p>","246119","","","","","2014-03-14 12:24:40","Image, saved to sdcard, doesn't appear in Android's Gallery app","<android><image><save><gallery>","11","0","22","",""
"2170416","1","","","2010-01-31 03:07:59","1","654","<p>I'm a complete beginner in java but I need to make this application to send commands over twitter.  I'm using the twitter4J library and android 2.1.  I finally have my code with no errors but when the app starts in the emulator, it immediately crashes.  Has anyone done this before?</p><p>CODE(main file):</p><pre><code>package edu.shs.SHSSRP;import twitter4j.Status;import twitter4j.Twitter;import twitter4j.TwitterException;import twitter4j.TwitterFactory;import edu.shs.SHSSRP.TwitterTest;import android.app.Activity;import android.os.Bundle;import android.webkit.WebView;import android.widget.Button;public class SHSSRP extends Activity {     /** Called when the activity is first created. */  WebView webview;Button Forward;Button Backward;Button Left;Button Right;TwitterTest TwitTest;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main); Twitter twitter = new TwitterFactory().getInstance(""SHSSRP"",""123ABC1234""); try {    Status status = twitter.updateStatus(""HELLO WORLD!"");} catch (TwitterException e) {    // TODO Auto-generated catch block    e.printStackTrace();}/*        Forward = (Button) findViewById(R.id.Forward);    Backward = (Button) findViewById(R.id.Backward);    Left = (Button) findViewById(R.id.Left);    Right = (Button) findViewById(R.id.Right);    webview = (WebView) findViewById(R.id.webview);    webview.getSettings().setJavaScriptEnabled(true);    webview.loadUrl(""http://www.google.com"");    TwitTest.runTest(); */          }}</code></pre><p></p><p>CODE(function)</p><pre><code>package edu.shs.SHSSRP;import twitter4j.DirectMessage;import twitter4j.ResponseList;import twitter4j.Twitter;import twitter4j.TwitterException;import twitter4j.TwitterFactory;import android.app.Activity;import twitter4j.*;public class TwitterTest extends Activity { public void runTest()  {       // The factory instance is re-usable and thread safe.        Twitter twitter = new TwitterFactory().getInstance(""SenderID"",""SenderPass"");       try {        twitter.sendDirectMessage(""ReceiverID"", ""HelloWorld"");    } catch (TwitterException e) {        e.printStackTrace();    } }}</code></pre><p>CODE(manifest)simply add the uses permission for interet</p><p>CODE(layout)</p><p></p><pre><code>&lt;RelativeLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;WebView         android:id=""@+id/webview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""  /&gt;    &lt;Button        android:id=""@+id/Forward""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_centerHorizontal=""true""        android:layout_below=""@id/webview""        android:text=""@string/Forward"" /&gt;    &lt;Button        android:id=""@+id/Left""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@id/Forward""         android:layout_alignParentLeft=""true""                   android:text=""@string/Left"" /&gt;    &lt;Button        android:id=""@+id/Right""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:layout_alignParentRight=""true""        android:layout_below=""@id/Forward""        android:text=""@string/Right"" /&gt;    &lt;Button        android:id=""@+id/Backward""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""center""         android:layout_centerHorizontal=""true""        android:layout_below=""@id/Right""        android:text=""@string/Backward"" /&gt;</code></pre><p></p><p></p><p>thank you in advance,</p><p>Matt</p>","262752","","","","","2010-01-31 22:34:17","for science project I'm direct messaging twitter with twitter4j lib and android 2.1 but app immediately crashes","<android><twitter>","2","2","","",""
"2170473","1","","","2010-01-31 03:39:49","1","1986","<p>I am using a laptop with Windows 7 Home Prem x64. I have installed Java JDK1.6.0_18 and Eclipse Gallileo. I have downloaded and installed the latest version of Android SDK with several Platforms loaded and a AVD defined. I can install the Android Eclipse plugin from the remote site stated in the instructions. The plugin installation performs without any errors and I can verify that the plugins are indeed installed. My problem begins when I go to Windows -> Preferences, there is no Android section to configure. And when I go to File -> New -> Project, there is no Android Project to choose.</p><p>I have uninstalled the plugin and reinstalled at least 10 times, trying different things and still no luck. I originally had the 64 bit version of the JDK installed, but removed it and installed the 32 bit version.</p><p>Has anyone heard of this type of problem? Is it because I am using Windows 7?</p><p>Thanks for any help.tbneff</p>","262762","","","","","2010-09-11 20:34:35","Android Plugin for Eclipse problem","<android><eclipse-plugin>","3","1","","",""
"2170497","1","","","2010-01-31 03:53:49","3","1798","<p>I am using a TimePicker under API 1.5 and when the orientation is changed on my device (a stock G1 running 1.6 - though NOT on the 1.5/1.6 emulator), the hour field goes blank. It still remembers the hour, it just doesn't show it. Is there any workaround for this?</p><p>The same problem was described by someone else here:</p><p><a href=""http://groups.google.com/group/android-beginners/browse_thread/thread/b4288004021b876/de5899a2bb291ab5"" rel=""nofollow"">http://groups.google.com/group/android-beginners/browse_thread/thread/b4288004021b876/de5899a2bb291ab5</a></p><p>Nothing helpful was forthcoming - can StackOverflow do better?</p>","262768","","262768","","2010-01-31 04:40:40","2014-03-07 17:32:06","Android TimePicker hour field disappears after orientation change","<android>","10","3","2","",""
"2170531","1","","","2010-01-31 04:11:16","20","45247","<p>How do I do this per selected list item.</p><p>I tried adding this to <code>android:background</code></p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_focused=""true""         android:state_pressed=""false""        android:drawable=""@color/android_green"" /&gt;    &lt;item android:state_focused=""true""         android:state_pressed=""true""        android:drawable=""@color/black_alpha"" /&gt;    &lt;item android:state_focused=""false""         android:state_pressed=""true""        android:drawable=""@color/black_alpha"" /&gt;    &lt;item android:drawable=""@color/white_alpha"" /&gt;&lt;/selector&gt; </code></pre><p>but it does not work, it changes the entire ListView.</p><hr><p>Still not working, here is what I have so far</p><p>::listview_background</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_focused=""true"" android:drawable=""@color/black_alpha"" /&gt;    &lt;item android:drawable=""@color/white_alpha"" /&gt;  &lt;/selector&gt; </code></pre><p>::My view that is using the above</p><pre><code>&lt;ListView android:id=""@+id/list"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:layout_below=""@+id/round""    android:listSelector=""@drawable/listview_background""&gt;&lt;/ListView&gt;</code></pre><p>The problem is that the black_alpha will apply the the entire list, not just the selected list item</p>","248521","","50776","","2013-01-03 16:11:32","2013-08-03 21:26:35","Change Selection in a ListView from Orange to Green","<android><android-listview>","5","1","11","",""
"2170922","1","2173678","","2010-01-31 07:31:16","5","10051","<p>Say my app has a widget and I use a configuration screen to do initial app widget setup and set a few preferences.</p><p>I want the user to be able to change those settings by simply going into my app's settings screen and clicking an intent preference to open up the same options the user was given when the app was created.</p><p>Can I use the same activity as the configuration activity?  Will I have to handle it differently?  How does the existing widget get updated with the new settings?</p><p>How can I get this to work?</p>","131871","","","","","2010-01-31 22:38:31","Changing android widget setup preferences after creation?","<android><widget><preferences>","1","0","","",""
"2170967","1","","","2010-01-31 07:53:01","4","1573","<p>i am developing an android appi need to go from one activity to anotherin that first i need to change the colors of button then a delay (so that the) and then call this same function(the one i am in rite now)</p><p>in objective-c it is done with  [self performSelector:foo afterDelay:2]</p><p>so i need to the its java equivalent.</p>","262824","","3171","","2010-01-31 08:02:22","2010-01-31 08:15:41","Java's equivalent of [self performSelector:foo afterDelay:2]","<java><android>","1","0","1","",""
"2171031","1","2171123","","2010-01-31 08:25:37","45","5217","<p>I'm mostly using Eclipse for Android development these days, and have developed good muscle memory for Ctrl-F11 to run my app. Problem is, if I happen to be editing an XML file (like manifest or layout) when I hit that key combination, Eclipse does something that I find inscrutable... It attempts to ""run"" my XML file, creating an erroneous output file (called something like <code>layout.out.xml</code>) that I then have to delete, adding a useless XML launch configuration to my history, and generally being a pain in my butt.</p><p>It's no big deal, but it is an ongoing annoyance. Does anyone know how to disable ""run"" for XML in Eclipse? I've tried to find a config item for it, but Eclipse's options are such a rabbit hole that I haven't had any luck there myself.</p><p>Thanks!</p>","252080","","252080","","2010-01-31 11:58:54","2013-02-13 16:32:52","How to stop Eclipse from trying to run XML files?","<xml><android><eclipse>","2","1","6","",""
"2171155","1","2173629","","2010-01-31 09:20:02","2","851","<p>I have been trying to get this seemingly simple problem fixed for about half a day now. I have a working MapView and I just want to show the default zoom keys and have them there all the time. They do not appear at all - it's not that they appear then go away.</p><p>Code:</p><pre><code>public void onCreate( Bundle savedInstanceState ) {    super.onCreate( savedInstanceState );    setContentView( R.layout.main );    _altDisplay = (TextView) findViewById( R.id.altitudeDisplay );    _speedDisplay = (TextView) findViewById( R.id.speedDisplay );    _accuracyDisplay = (TextView) findViewById( R.id.accuracyDisplay );    _mapView = (MapView) findViewById( R.id.mapView );    _mapView.setBuiltInZoomControls(true);    _mapController = _mapView.getController();    _mapController.setZoom(22);    _locationUpdates = new LocationUpdateHandler( (LocationManager) getSystemService( Context.LOCATION_SERVICE) );    _locationUpdates.addObserver( this );}public void updateLocation( GeoPoint point, double altitude, float speed, float accuracy ){    _mapController.setCenter(point);    _altDisplay.setText( ""Altitude: "" + Double.toString(altitude) );    _speedDisplay.setText( ""Speed: "" + Float.toString(speed) );    _accuracyDisplay.setText( ""Accuracy: "" + Float.toString(accuracy) );}</code></pre><p>I have tried commenting out the setZoom and tried moving the setBuiltInZoom controls to the updateLocation method. I've found a lot of posts in relation to this problem but none that solve it.</p><p>Thanks for your help.</p>","151770","","","","","2010-02-01 13:47:58","Unable to get zoom buttons to show on MapView","<android><google-maps>","2","1","","",""
"2171429","1","2172243","","2010-01-31 11:08:47","8","16146","<p>How do I add a marker on a particular location in the map?</p><p>I saw this code that shows the coordinates of the touched location. And I want a marker to pop or be shown in that same location everytime it is touched. How do I do this? </p><pre><code> public boolean onTouchEvent(MotionEvent event, MapView mapView) {                   if (event.getAction() == 1) {                                    GeoPoint p = mapView.getProjection().fromPixels(                        (int) event.getX(),                        (int) event.getY());                        Toast.makeText(getBaseContext(),                             p.getLatitudeE6() / 1E6 + "","" +                             p.getLongitudeE6() /1E6 ,                             Toast.LENGTH_SHORT).show();                        mapView.invalidate();                }                                            return false;            }</code></pre>","245385","","881229","","2014-01-31 05:31:01","2014-01-31 05:31:01","Add marker on touched location using google map in android","<android><google-maps><google-maps-markers>","2","0","4","",""
"2171588","1","2173615","","2010-01-31 12:06:25","5","7794","<p>Following this : <a href=""http://stackoverflow.com/questions/2125354/best-approach-for-oldschool-2d-zelda-like-game"">http://stackoverflow.com/questions/2125354/best-approach-for-oldschool-2d-zelda-like-game</a></p><p>I got a simple 2D tiles generator working, im reading an int map[100][100] filled with either 1's or 0's and draw tiles according to their tile id, 0 is water, 1 grass.</p><p>Im using some basic Numpad control handler, using a camIncr (32.0f), i set the camera position according to the movement :</p><pre><code> case KeyEvent.KEYCODE_DPAD_RIGHT: cameraPosX = (float)(cameraPosX + camIncr); break;</code></pre><p>In my draw loop, im just drawing enough tiles to fit on my screen, and track the top left tile using cameraOffsetX and cameraOffsetY (its the camera position / tile size )</p><p>Im using a GLU.gluOrtho2D for my projection.</p><p>Here is the draw loop inside my custom renderer : </p><pre><code> gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);  gl.glMatrixMode( GL10.GL_PROJECTION );  gl.glLoadIdentity( );  GLU.gluOrtho2D(gl, 0, scrWidth, scrHeight, 0);  repere.draw(gl, 100.0f); // this is just a helper, draw 2 lines at the origin  //Call the drawing methods  gl.glMatrixMode(GL10.GL_MODELVIEW);  gl.glLoadIdentity();  tiledBackground.draw(gl, filtering);</code></pre><p>my tiledBackground draw function :</p><pre><code>  int cols = (569 / 32) + 2;      // how many columns can fit on the screen   int rows = (320 / 32) + 1;     // haw many rows can fit on the screen   int cameraPosX = (int) Open2DRenderer.getCameraPosX();  int cameraPosY = (int) Open2DRenderer.getCameraPosY();  tileOffsetX = (int) (cameraPosX / 32);  tileOffsetY = (int) (cameraPosY / -32);  gl.glPushMatrix();  for (int y = 0; y &lt; rows; y++) {   for (int x = 0; x &lt; cols; x++) {    try {     tile = map[y + tileOffsetY][x + tileOffsetX];    } catch (Exception e) {     e.printStackTrace(); //when out of array     tile = 0;    }    gl.glPushMatrix();    if (tile==0){     waterTile.draw(gl, filter);     }    if (tile==4) {     grassTile.draw(gl, filter);     }    gl.glTranslatef(32.0f, 0.0f, 0.0f);   }//   gl.glPopMatrix();   gl.glTranslatef(0.0f, 32.0f, 0.0f);  }  gl.glPopMatrix(); }</code></pre><p>the waterTile and grassTile .draw function draw a 32x32 textured tile, might post the code if relevant.</p><p>Everything is fine, i can move using numpad arrows, and my map 'moves' with me, since im only drawing what i can see, its fast (see <a href=""http://stackoverflow.com/questions/2129125/android-opengl-es-simple-tile-generator-performance-problem"">http://stackoverflow.com/questions/2129125/android-opengl-es-simple-tile-generator-performance-problem</a> where Aleks pointed me to a simple 'culling' idea)</p><p>I would like my engine to 'smooth scroll' now. I've tried tweaking the camIncr variable, the GLU.gluOrtho2D etc, nothing worked.</p><p>Any ideas ? :)</p>","252222","","","","","2010-10-12 01:12:12","Android Opengl ES tiling engine, smooth scrolling","<android><opengl-es>","1","2","7","",""
"2171701","1","2171803","","2010-01-31 12:49:57","0","782","<p>I'm learning to develop applications for Android but I need to know the XML tags to get my programs to work. They are documented in the javadoc but I would prefer a quick reference.</p><p>EDIT: I was talking about the Android GUI XML-files, sorry that I didn't make this clear.</p>","102893","","102893","","2010-02-01 09:27:43","2010-02-01 09:27:43","Is there an Android XML reference?","<java><xml><android>","2","1","","2014-02-14 09:08:44",""
"2172130","1","2173639","","2010-01-31 15:05:33","2","1030","<p>I have a com.google.android.maps.MapView in my application. When using the normal view I do not get any data in Jerusalem and its surroundings. When scrolling to the same location with the Maps app or the maps.google.com webpage the place is rich with mapdata.</p><p>Is there a (known) difference between the Map API view and the Google view of mapdata that I am unaware of?</p>","16352","","","","","2010-01-31 22:28:16","How come MapView shows less then Map application?","<android><google-maps>","1","0","1","",""
"2172152","1","2172175","","2010-01-31 15:13:01","26","6190","<p>I am new to Java and am trying to run a unit test on a class I am writing. Eclipse (3.5) created the unit test class for me and added Junit4 to my class path.</p><p>My Class:</p><pre><code>public class DistanceUtil {public static double metersToMiles( double meters ) {    return 0;}public static double metersToKilometers( double meters ) {    return 0;}}</code></pre><p>My unit test:</p><pre><code>public class DistanceUtilTest {@Testpublic final void testMetersToMiles() {    fail(""Not yet implemented""); // TODO}@Testpublic final void testMetersToKilometers() {    fail(""Not yet implemented""); // TODO}}</code></pre><p>When I right click on the unit test and select run as Junit Test I get the following:</p><pre><code>## A fatal error has been detected by the Java Runtime Environment:##  Internal Error (classFileParser.cpp:3075), pid=5564, tid=4940#  Error: ShouldNotReachHere()## JRE version: 6.0_17-b04# Java VM: Java HotSpot(TM) Client VM (14.3-b01 mixed mode windows-x86 )# An error report file with more information is saved as:# C:\Users\Giles Roadnight\workspaceAndroid\Cycloid\hs_err_pid5564.log## If you would like to submit a bug report, please visit:#   http://java.sun.com/webapps/bugreport/crash.jsp#</code></pre><p>Anyone got an idea how I can fix this?</p><p>Thanks</p>","151770","","1047418","","2013-11-13 12:22:10","2014-04-02 20:22:02","Can't run JUnit 4 test case in Eclipse Android project","<java><android><eclipse><junit4>","2","0","16","",""
"2172217","1","2173464","","2010-01-31 15:31:52","2","480","<p>I`am trying to delete a specific row in database.i am deleteing by using this query:</p><pre><code>    Uri myUri = Uri.parse(""content://com.idan.datastorageprovider/maps"");    this.getContentResolver().delete(myUri, ""ROUTE_NAME=""+routeName,null);</code></pre><p>in my database i have 2 columns: ROUTE_NAME,ROUTE_PATH.</p><p>and i want to delete a row by the column ROUTE_NAME, while i give it a value of which row in that column i want to delete.i get no errors, but the row is still there..what am i doing wrong?</p><p>Thanks,</p><p>Idan.</p>","260511","","","","","2010-01-31 21:40:34","delete specific row from database","<android>","1","1","","",""
"2172318","1","2172498","","2010-01-31 16:05:50","2","211","<p>The ""Top paid"", ""Top Free"", ""Just In"" buttons (with green selection indicators) in the picture below...Are these standard components that I can use in my Android application?</p><p>I can't seem to find them within the SDK and yet I've seen them here (in the market) and within the Seesmic Twitter Android app.</p><p>I would like to use such and effect to allow sorting on one of my listviews. If these are not available then what is the best way to achieve this effect?</p><p><a href=""http://twitpic.com/10phej"" rel=""nofollow"">image</a></p>","227228","","14343","","2010-07-14 23:42:27","2010-07-14 23:42:27","Is this a standard android component?","<android><android-widget>","1","0","","",""
"2172392","1","","","2010-01-31 16:29:50","0","547","<p>Suppose that I installed app A and app B, app A has a main activity, and app B wants to show that activity by sending a intent. My question is that how android knows I have installed app A and is able to map the intent to its activity? Is there any windows-registry-like store saving such information?</p><p>Thank You</p>","","user262968","","","","2010-01-31 16:41:35","How can android find a certain activity or service based on a given Intent?","<android>","1","0","","",""
"2172523","1","","","2010-01-31 17:03:57","9","30058","<p>Is there another way to draw an object on a canvas in android?</p><p>This code inside draw() doesn't work:</p> <pre><code>Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pushpin);                     canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);  </code></pre><p>Well actually, it's working on my 1st code but when I've transfered this to another class called MarkOverlay, it's not working anymore. </p><pre><code>  markerOverlay = new MarkerOverlay(getApplicationContext(), p);                      listOfOverlays.add(markerOverlay);  </code></pre><p>What parameter should I pass to MarkerOverlay to make this code work? The error is somewhere in getResources().</p><p>FYI, canvas.drawOval is perfectly working but I really want to draw an Image not an Oval. :) </p>","245385","","","","","2013-02-11 16:44:02","draw object/image on canvas","<android><google-maps><bitmap>","2","0","7","",""
"2172752","1","2176153","","2010-01-31 18:19:37","6","5654","<p>I'm hoping someone could help me out with intermittent connections I'm getting using code with HttpsURLConnection. The code I'm using is below: </p><pre><code>HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();            conn.setReadTimeout(10 * 1000); if conn.getResponseCode() != 200) {             Log.v(TAG, ""error code:"" + conn.getResponseCode()); } </code></pre><p>The connection works the first time everytime when I use it to pull a json file. However, when I use the connection again to send a command, it always fails the first time. It then typically works if I send the command quickly ( within 5 seconds), but fails if I wait a while. I don't think its a SSL issue because it connects the first time correctly, but I could be wrong here. I also tried many different variations such as adding: </p><pre><code>conn.setUseCaches(false); conn.setRequestProperty(""Connection"",""Keep-Alive""); conn.getHostnameVerifier(); conn.getSSLSocketFactory(); conn.setDoOutput(true); conn.setDoInput(true); conn.setRequestMethod(""POST""); conn.wait(100); </code></pre><p>However, I had no luck. Any help would be greatly appreciated. </p>","262306","","","","","2011-12-01 10:16:14","HttpsURLConnection and intermittent connections","<android><httpurlconnection><connections><intermittent>","3","2","4","",""
"2172901","1","2173037","","2010-01-31 19:03:05","2","378","<p>I want to create a custom view (extends View) which contains an image and a text.</p><p>Is it possible to set an listener just for image if i use <code>canvas.drawBitmap(imageBitmap, ...)</code> method?</p><p>Thank you!</p>","217360","","166712","","2010-01-31 22:56:50","2010-01-31 22:56:50","Is possible to set an listener just for a part of a custom view?","<android>","1","0","1","",""
"2172956","1","","","2010-01-31 19:18:26","0","219","<p>I have an Android app that works fine the first time you run it.However, when you press HOME (so it pauses), and restart it from the home screen all I get is the music restarted.</p><p>I've not yet got to the stage of saving/restoring states yet (will do soon!).It seems that the main update thread is not resuming.</p><p>It calls <code>onRestart()</code> fine...</p><p>I'm new to Java/Android so I apologize if this is a basic schoolboy error!</p><p>TIA for any advice</p><p>John</p>","263044","","8206","","2010-01-31 19:35:55","2010-01-31 21:18:07","Android newbie problem: restarting an application","<android>","1","2","","",""
"2173606","1","2173786","","2010-01-31 22:19:55","1","1193","<p>How can I call the <code>onUpgrade</code> Method of the database?</p><p>Background of my question:I do a backup on the sdcard of the full database.And the user can restore this database.</p><p>But, if in the meantime (between backup and restore) an app update changes to the database, I will get a problem on restoring. The new columns are not there after restoring.</p><p>So I want to call the <code>onUpgrade</code> method to add all new/changed columns.</p><p>Or is there any better way for this?</p>","242070","","1904504","","2013-12-24 10:36:38","2013-12-24 10:36:38","self call onUpgrade method","<database><android>","1","0","","",""
"2173936","1","7277616","","2010-01-31 23:55:29","38","121395","<p>I'm trying to set the background color of a View (in this case a Button).</p><p>I use this code:</p><pre><code>// set the background to greenv.setBackgroundColor(0x0000FF00 );v.invalidate();</code></pre><p>It causes the Button to disappear from the screen.   What am I doing wrong, and what is the correct way to change the background color on any View?</p><p>Thanks.</p>","253661","","76835","","2010-05-28 19:37:54","2014-02-10 19:52:44","How to set background color of a View","<android><view><colors><background><set>","7","1","22","",""
"2174048","1","","","2010-02-01 00:37:52","11","13082","<p>I am trying to get the sender's name from the contacts database using a content provider.</p><p>The problem is I don't know how to implement it. Like now I can only pull the phone number from the smsMessage. I need to check to see if the phone number that is calling is in the users contacts first and if it is display the name if it is not then display the number.</p>","263146","","234938","","2010-02-01 09:16:17","2013-06-27 13:55:40","How to look-up a contact's name from their phone number on Android?","<android>","2","1","9","",""
"2174332","1","","","2010-02-01 02:35:34","1","6361","<p>I recently downloaded Eclipse (Galileo), the Android SDK and Java.  I followed instructions to write the ""Hello World"" app <a href=""http://developer.android.com/guide/tutorials/hello-world.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/hello-world.html</a> from the developers'webpage and ran the app.  a window opens with a phone screen that reads ""ANDROID"" on the left and a keyboard image on the right. It does not resemble the image on the webpage, wherein the result should read Hello Android. </p><p>Last p.m. I tried several times to run 2 messages appeared in the Console of the Eclipse SDK program:</p><blockquote>  <p>Hello Android]ActivityManager: Can't dispatch DDM chunk 46454154: no  handler defined</p>    <p>Hello Android]ActivityManager: Error: Unable to connect to activity  manager; is the system running?</p></blockquote><p>How do I correct?  Thank you.</p>","263189","","948041","","2012-10-30 05:45:23","2012-10-30 05:45:23","Newbie cannot program Hello world app","<android><eclipse><hello-world>","2","5","1","",""
"2174435","1","","","2010-02-01 03:06:22","3","1465","<p>Is there anyone who has had any problems using WIN7 and Eclipse?</p><p>Everytime Eclipse starts this error always comes up: <code>UNABLE TO PARSE ADB VERSION</code></p><p>If you try and run/debug the app from within WIN7,</p><pre><code>The connection to adb is down, and a severe error has occured.[2010-01-29 19:00:17 - app name] You must restart adb and Eclipse.[2010-01-29 19:00:17 - app name] Please ensure that adb is correctlylocated at 'C:\Android\tools\adb.exe' and can be executed.</code></pre><p>Adb is in the directory:'C:\Android\tools\adb.exe', and can beexecuted from the cmd line.  Tried quitting eclipse and WIN7 andrestarted.  Ran adb kill-server, adb start-server...(daemon notrunning...starting it now.   daemon started successfully.start eclipse, and then that's when the error comes up.  This isdriving us crazy.</p><p>So, IF by chance there is anyone else using WIN7 professional versionto develop on and has encountered this problem with ADB, please postit and let me know.....</p>","263203","","21234","","2010-02-01 03:08:33","2012-04-19 23:33:18","adb error: unable to parse adb version","<android><eclipse><windows-7>","3","2","","",""
"2174676","1","","","2010-02-01 04:34:42","0","839","<p>I would like to know if it is possible to remove one of the frames I added using addFrame in Android?</p><p>Thanks</p><p>Kelvin</p>","263233","","","","","2010-05-02 13:00:03","Android Frame Animation","<android>","1","0","","",""
"2174732","1","2174743","","2010-02-01 04:54:26","7","7985","<p>There are some image files, and I want to get Uri of these image files.In my code, I only know path and file name of image files.How can I get Uri from its path and file name?</p>","258508","","","","","2013-01-22 10:36:43","Can I get Uri of image file from its name?","<android>","2","0","2","",""
"2174865","1","2175174","","2010-02-01 05:40:40","5","1038","<p>I have an Android app modeled after the <code>LunarLander</code> example by Google. I am debugging it on a real device, (<code>Motorola Droid</code>) with <code>Android 2.0</code>. When the orientation changes, the program crashes on a <code>NullPointerException</code>. Logcat from just before crash:</p><pre><code>02-01 00:24:27.956: DEBUG/nate(8358): Starting Game02-01 00:24:36.878: DEBUG/dalvikvm(1086): GC freed 1788 objects / 92256 bytes in 1389ms02-01 00:24:38.542: INFO/WindowManager(1021): Setting rotation to 1, animFlags=002-01 00:24:38.558: INFO/ActivityManager(1021): Config changed: { scale=1.0 imsi=310/4 loc=en_US touch=3 keys=2/1/2 nav=2/2 orien=2 layout=34}02-01 00:24:38.620: WARN/UsageStats(1021): Something wrong here, didnt expect org.nifong.leeder to be resumed02-01 00:24:38.886: DEBUG/nate(8358): New Surface dimensions: 854x44202-01 00:24:38.886: DEBUG/nate(8358): flies was null</code></pre><p>The first line that worries me is <code>""Something wrong here""</code> at <code>24:38.620</code>. I have no idea what it means, but I think its due to me not reacting properly to the screen change.</p><p>Next I get a debug message that I printed myself from within my own method <code>surfaceChanged()</code> about the new surface dimensions.</p><p>Then I print out debug message about whether flies was <code>null</code>. <code>flies</code> is the field that eventually causes the <code>NullPointerException</code>. Its created once, and never written to again for the rest of the program. I know that it was not null before the crash, because it was read several times. </p><p>Does anyone have a clue how my private member variable came to be null just by these clues?</p><p>I would include code but there is a lot of it and I don't know what would be relevant.</p>","88905","","493939","","2012-04-18 09:31:40","2012-04-18 09:31:40","""Something wrong here, didn't expect PACKAGE to be resumed"" error in android Logcat","<android><crash><orientation><nullpointerexception><logcat>","2","0","","",""
"2174875","1","2175123","","2010-02-01 05:43:39","15","21573","<p>I'm drawing 2D images on the canvas following <a href=""http://www.designerandroid.com/?cat=3"" rel=""nofollow"">this</a> tutorial.</p><p>I want to save image shown on canvas to JPEG file, how can I do it?</p>","216431","","881229","","2013-12-31 05:16:50","2013-12-31 05:16:50","Image on canvas to JPEG file","<android><jpeg><android-canvas>","3","1","16","2013-04-07 06:45:05",""
"2174943","1","2618762","","2010-02-01 06:02:15","10","43020","<p>I want to know in which format the contact details are stored in android mobile or emulator.If any body knows the answer please help me.</p>","131062","","487033","","2013-01-10 17:22:26","2013-01-10 17:22:26","In which format the contacts are stored in android?","<android><android-contacts>","2","0","4","",""
"2175076","1","2178247","","2010-02-01 06:38:07","18","38646","<p>I want to create an application based on bluetooth operation in android.I am using the following code</p><pre><code> BluetoothAdapter adapter=BluetoothAdapter.getDefaultAdapter();</code></pre><p>the adapter is returning null value, which means the android emulator is not having bluetooth capability. i am using android 2.1 the latest version of android.Anybody knows how to use the bluetooth from android emulator, please help me.</p>","131062","","","","","2014-03-27 12:23:47","How to use Bluetooth in Android emulator?","<android>","7","0","9","",""
"2175261","1","2175267","","2010-02-01 07:30:16","2","1085","<p>Basically I receive the Image's URI from the Gallery, then created a Bitmap and want to send to another activity for displaying:</p><pre><code>Uri imageUri = intent.getData();mBitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), imageUri);Intent intent = new Intent(TakePictureActivity.this, PreviewActivity.class);intent.putExtra(EXTRA_BITMAP_DATA, mBitmap);startActivityForResult(intent, REQUEST_PREVIEW);</code></pre><p>When I put nothing to the intent, the PreviewActivity can be fired normally. However when I put the bitmap, the emulator was freezing until I forced close. This has happened to me several times and I've always tried to work aroudn that by sending something else other than the Bitmap object.</p><p>But this time I guess I can't. I don't want to change the API by passing the image's Uri because some other Activities are already sending it bitmaps. This one is a special case.</p><p>Here is the output from LogCat during the freezing:</p><pre><code>02-01 14:23:37.808: WARN/IInputConnectionWrapper(219): showStatusIcon on inactive InputConnection02-01 14:23:37.899: INFO/ActivityManager(54): Displayed activity com.android.camera/.ImageGallery: 1456 ms (total 1456 ms)02-01 14:23:40.009: DEBUG/dalvikvm(54): GC freed 2958 objects / 134576 bytes in 98ms02-01 14:23:43.085: DEBUG/dalvikvm(219): GC freed 1712 objects / 372192 bytes in 80ms02-01 14:23:43.085: DEBUG/Camera-JNI(219): release camera02-01 14:23:47.489: INFO/WindowManager(54): Setting rotation to 1, animFlags=002-01 14:23:47.489: INFO/WindowManager(54): Config changed: { scale=1.0 imsi=0/0 loc=en_US touch=3 keys=2/1/2 nav=3 orien=2 layout=18}02-01 14:23:47.539: INFO/WindowManager(54): Config changed: { scale=1.0 imsi=0/0 loc=en_US touch=3 keys=2/1/2 nav=3 orien=2 layout=18}02-01 14:23:47.609: INFO/WindowManager(54): Config changed: { scale=1.0 imsi=0/0 loc=en_US touch=3 keys=2/1/2 nav=3 orien=2 layout=18}02-01 14:23:47.657: DEBUG/StatusBar(54): updateResources02-01 14:23:47.848: DEBUG/dalvikvm(219): GC freed 200 objects / 7936 bytes in 212ms02-01 14:23:48.109: INFO/ActivityManager(54): Starting activity: Intent { cmp=com.multinc.somo/.PreviewActivity (has extras) }02-01 14:23:48.229: INFO/WindowManager(54): Setting rotation to 0, animFlags=002-01 14:23:48.259: INFO/WindowManager(54): Config changed: { scale=1.0 imsi=0/0 loc=en_US touch=3 keys=2/1/2 nav=3 orien=1 layout=18}02-01 14:23:48.259: WARN/WindowManager(54): performLayoutAndPlaceSurfacesLocked called while in layout02-01 14:23:48.417: ERROR/JavaBinder(54): !!! FAILED BINDER TRANSACTION !!!02-01 14:23:48.417: DEBUG/StatusBar(54): updateResources02-01 14:23:48.438: DEBUG/CameraService(31): CameraService::connect E (pid 219, client 0xd228)02-01 14:23:48.438: DEBUG/CameraService(31): Client::Client E (pid 219)02-01 14:23:48.438: DEBUG/CameraHardwareStub(31): initHeapLocked: preview size=176x14402-01 14:23:48.438: ERROR/MediaPlayer(31): Unable to to create media player02-01 14:23:48.438: ERROR/CameraService(31): Failed to load CameraService sounds.02-01 14:23:48.438: ERROR/MediaPlayer(31): Unable to to create media player02-01 14:23:48.438: ERROR/CameraService(31): Failed to load CameraService sounds.02-01 14:23:48.461: DEBUG/CameraService(31): Client::Client X (pid 219)02-01 14:23:48.461: DEBUG/CameraService(31): CameraService::connect X02-01 14:23:48.461: DEBUG/CameraService(31): setPreviewDisplay(0x0) (pid 219)02-01 14:23:48.461: DEBUG/CameraService(31): getParameters(picture-format=jpeg;picture-size=213x350;preview-format=yuv422sp;preview-frame-rate=15;preview-size=176x144)02-01 14:23:48.461: DEBUG/CameraService(31): setParameters(picture-size=213x350;preview-frame-rate=15;preview-size=390x260;picture-format=jpeg;preview-format=yuv422sp)02-01 14:23:48.461: DEBUG/CameraHardwareStub(31): initHeapLocked: preview size=390x26002-01 14:23:48.461: DEBUG/CameraService(31): startPreview (pid 219)02-01 14:23:48.461: DEBUG/CameraService(31): startCameraMode(0) (pid 219)02-01 14:23:48.461: DEBUG/CameraService(31): mSurface is not set yet.02-01 14:23:48.461: DEBUG/CameraService(31): startPreviewMode (pid 219)02-01 14:23:48.533: DEBUG/Camera-JNI(219): release camera02-01 14:23:48.533: DEBUG/CameraService(31): Client::disconnect() E (pid 219 client 0xd228)02-01 14:23:48.533: DEBUG/CameraService(31): hardware teardown02-01 14:23:48.589: DEBUG/CameraService(31): removeClient (pid 219) done02-01 14:23:48.589: DEBUG/CameraService(31): Client::disconnect() X (pid 219)02-01 14:23:48.589: DEBUG/CameraService(31): Client::~Client E (pid 31, client 0xd228)02-01 14:23:48.589: DEBUG/CameraService(31): Client::disconnect() E (pid 31 client 0xd228)02-01 14:23:48.589: DEBUG/CameraService(31): Client::~Client X (pid 31)02-01 14:23:53.257: WARN/WindowManager(54): App freeze timeout expired.02-01 14:23:53.259: WARN/WindowManager(54): Force clearing freeze: AppWindowToken{438f13f8 token=HistoryRecord{43871530 com.multinc.somo/.PreviewActivity}}</code></pre><p>This does not happen with all bitmaps. This particular bitmap is from a ~300K file, but I dont know if it's related to the size. Is this my fault? Has anyone experienced this?</p><p>Thank you very much</p>","159759","","159759","","2010-02-01 07:58:15","2010-02-01 07:58:15","freeze on sending certain bitmaps to activities","<android><bitmap><android-intent><freeze>","1","0","","",""
"2175308","1","2175433","","2010-02-01 07:47:07","3","321","<p>I programmly send sms message with ""|"" in string, and receiving it android make it unreadable. Can I make something with this?Thanks.</p>","263321","","","","","2010-02-01 10:14:21","Character ""|"" in sms","<java><android>","2","1","1","",""
"2175569","1","2175591","","2010-02-01 09:00:31","-2","4107","<p>how to load dynamic  array from vector in android?</p>","217065","","","","","2010-02-01 10:45:58","how to load dynamic array from vector in android?","<android>","1","2","","2012-08-27 12:52:07",""
"2175657","1","","","2010-02-01 09:26:03","0","925","<p>I m new to android development i dont know to how to get the latitude and longitude of device by programatically?If u can provide some code snippet to get the latitude and longitude. </p>","132724","","","","","2010-02-01 10:55:04","How to get device longtitude and latitude programatically in android?","<android>","2","0","","",""
"2175823","1","2176348","","2010-02-01 09:58:11","0","1089","<p>Are the processes in android asynchronous? If they are asynchronous then how can we conclude when the activity or process is finished or completed its execution.</p>","237388","","","","","2010-02-01 11:44:57","Android Process Synchronization","<android><process><synchronization>","2","0","","",""
"2175843","1","2863141","","2010-02-01 10:03:18","15","4877","<p>I have some questions about the cache directory in android.</p><ol><li><p>Does anyone knows the limit for each app's cache directory? </p></li><li><p>Also what will happen if there is not enough disk space to cache data? All I know is when the device runs low on storage, the files here (cache directory)will be the ones that get deleted first and each app has its own cache directory. Now, are the files of other app's cache directory will be cleared to accommodate my app's request to add files in the cache dir when there is not enough storage?</p></li></ol>","235885","","","","","2010-05-19 07:09:51","Limit size of cache directory","<android>","2","0","5","",""
"2175945","1","2176042","","2010-02-01 10:23:40","3","3706","<p>Quick question about android market application updates. If I have an app on the market and release an update, is there a way to ensure that the users download the new update? </p><p>I.e. Does the app tells the user there is an update, or does it stop working until they download an update?</p><p>Or should I be writing code in my apps to stop working after a fixed period thus forcing the user to download the new version?</p>","119396","","309086","","2014-01-08 11:32:50","2014-01-08 11:32:50","Android Market Application Updates","<android><google-play>","3","0","3","2012-07-28 14:03:14",""
"2176037","1","2176084","","2010-02-01 10:42:06","1","4762","<p>i have created 4 activities in eclipse now i want to run activity 1, 2,3 ,4 repectively one by one in emulator for testing.</p><p>can any one guide me how can i run those all???</p><p>when i press run button it only runs first activity.</p><p>any help would be appriciated.</p>","249991","","","","","2013-07-12 06:01:42","how to run Specific activity in android emulator?","<android><eclipse><activity>","5","0","","",""
"2176114","1","2176262","","2010-02-01 10:56:53","15","2199","<p>I'm working on an app which contains some scripting support. The scripts executed by this app might require all sorts of permissions in the future, but it's difficult to predict which ones.</p><p>Is there a way to request additional permissions at runtime (like iPhone apps sometimes do) instead of specifying them all in advance in AndroidManifest.xml?</p>","84352","","","","","2010-02-01 11:22:37","Can Android apps request additinal permissions at runtime?","<android><permissions>","1","0","3","",""
"2176149","1","","","2010-02-01 11:01:46","1","517","<p>I developed UI for iphone apps and now want to use the same UI in Android apps. I read that Android use dip for image resolution and i also read that 1 dip=1.5 pixel.I simply multiply the image size by 1.5px. Now the problem is that the image is blur and not as clear as in iphone apps.So will some body suggest me how should i make a design so that it could be used in iphone and android.</p>","263446","","","","","2010-03-14 09:36:31","Image compatibility in iphone and android","<android>","2","1","","",""
"2176315","1","2176412","","2010-02-01 11:31:43","0","2827","<p>I am looking for a simple image sharpening algorithm to use in my Android application. I have a grayscale image captured from video (mostly used for text) and I would like to sharpen it because my phone does not have auto focus, and the close object distance blurs the text. I don't have any background in image processing. But as a user, I am familiar with unsharp masking and other sharpening tools available in Gimp, Photoshop, etc. I didn't see any support for image processing in the Android API, and hence am looking for a method to implement myself. Thanks. </p>","253029","","","","","2010-02-01 11:54:34","Simple Image Sharpening algorithm for Android App","<android>","2","0","1","",""
"2176319","1","2176381","","2010-02-01 11:32:22","0","320","<p>in my application findlocation opptions is there.can u please help me how to find out the corresponding map by providing the country,city,street or pincode. please help me</p>","1746300","","","","","2010-02-01 11:44:45","find map by providing country,city and street","<android>","1","0","","",""
"2176375","1","2176415","","2010-02-01 11:43:12","12","39439","<p>I currently have a Service that runs fine when I start it but when I try to stop it using the stopService method its onDestroy method doesn't get called.</p><p>Here is the code I use to try to stop the Service</p><pre><code>   stop_Scan_Button = (Button)findViewById(R.id.stopScanButton);    stop_Scan_Button.setOnClickListener(new View.OnClickListener(){        public void onClick(View v){            Log.d(""DEBUGSERVICE"", ""Stop Button pressed"");            Intent service = new Intent(CiceroEngine. CICERO_SERVICE);            releaseBind();            Log.d(""Stop_Scan_Button"", ""Service: "" + service.toString());            stopService(service);            Log.d(""Stop_Scan_Button"", ""Service should stop! "");            }       });</code></pre><p>Am I right in thinking that when stopService is used it calls the onDestroy method of the Service? When I press my stop scan button the <code>onDestroy()</code> method in my Service is not called.</p><p>Is there anything else I am missing that I should put in to  stop the service?</p><p>EDIT: to add <code>onServiceConnected()</code> gets called when stopService is run instead of <code>onServiceDisconnected()</code>, why would that be happening?</p><p>EDIT:<strong>To add more info regards Binding</strong></p><p>I call bindService in the onCreate() method and I then have the releaseBind() method unbind the Service.</p><p>Here is the code for that method:</p><pre><code> public void releaseBind(){    unbindService(this);  }</code></pre><p>So I presume that the unbinding is not my problem?</p>","243999","","2197750","","2014-02-06 02:18:14","2014-02-06 02:18:14","Service won't stop when stopService method is called","<android><service>","2","0","7","",""
"2176397","1","2184239","","2010-02-01 11:49:27","71","73149","<p>I've been busy for a long time finding out how to draw a line between two (GPS) points on the map in HelloMapView but with no luck.</p><p>Could anyone please tell me how to do so.</p><p>Suppose I use the HelloMapView which extends MapView. Do I need to use overlays? If so do I have to override the onDraw() method of the overlay and draw a line here? I actually tried these things but with no result.</p><p>Thank you in advance!</p>","263481","","154306","","2011-03-25 09:14:27","2014-02-06 20:25:13","Drawing a line/path on Google Maps","<android><google-maps><overlay><android-mapview><draw>","11","1","72","",""
"2176878","1","2177045","","2010-02-01 13:21:53","1","3491","<p>This is what i'm trying to achieve:</p><ol><li><p>Use a TextView in a TabWidget (i.e. call <code>TabHost.TabSpec.setIndicator(View)</code> instead of <code>TabHost.TabSpec.setIndicator(String)</code>).</p></li><li><p>And i want to configure that TextView in XML instead of building it programatically.</p></li></ol><p>So initially, in my layout XML, i had:</p><pre><code>&lt;TabHost    android:id=""@+id/mainTabHost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;TabWidget android:id=""@android:id/tabs"" android:layout_width=""fill_parent"" android:layout_height=""30px""/&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:paddingTop=""30px""&gt;    &lt;/FrameLayout&gt;&lt;/TabHost&gt;</code></pre><p>Now i want to put in the TextView configuration somewhere. It does not actually ""belong"" nested anywhere within the layout hierarchy. But, since the layout XML have to be a valid XML of course, it can't have more than one root element. So i'm forced to nest the TextView somewhere. Hence i just put it one level below the root (TabHost):</p><pre><code>&lt;TabHost    android:id=""@+id/mainTabHost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;TabWidget android:id=""@android:id/tabs"" android:layout_width=""fill_parent"" android:layout_height=""30px""/&gt;    &lt;TextView        android:id=""@+id/tvTabIndicatorPreferences""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:text=""@string/tab_name_preferences""/&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:paddingTop=""30px""&gt;    &lt;/FrameLayout&gt;&lt;/TabHost&gt;</code></pre><p>And in my code i do:</p><pre><code>final TabHost mainTabHost = (TabHost) this.findViewById(R.id.mainTabHost);mainTabHost.setup();final TextView tvTabIndicatorPreferences = (TextView) this.findViewById(R.id.tvTabIndicatorPreferences);final TabHost.TabSpec tabSpecPreferences = mainTabHost.newTabSpec(""tabPreferences"");tabSpecPreferences.setIndicator(tvTabIndicatorPreferences);tabSpecPreferences.setContent(R.id.scrlTblPreferences);mainTabHost.addTab(tabSpecPreferences);</code></pre><p>but there's a problem here. When i try to run the application, i get an exception which says</p><pre><code>Caused by: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.</code></pre><p>which is by all means logical and reasonable. The TextView is already a child of the TabHost. i can't just set it as the child of another element. (Note: Putting the TextView nested under the TabWidget yields the same thing.)</p><p>so i'm forced to call <code>mainTabHost.removeView(tvTabIndicatorPreferences)</code> before calling the <code>setIndicator</code>.</p><p>It works actually, but this way of doing feels very wrong to me. Firstly, i have to put the TextView in the XML where it didn't belong, then in the code remove it from where it didn't belong before using it.</p><p>In such a scenario, what's the Right Way to achieve this?</p>","254959","","","","","2010-02-01 13:46:21","Android Views - How to Configure a ""Loose"" Piece of View Element Through XML?","<android><layout><view>","1","0","1","",""
"2176898","1","2176979","","2010-02-01 13:24:12","3","1063","<p>I'm trying to find out how I can create a pop-up menu bar, after I press on a checkbox item, so I can do multiple things like delete..</p><p>I've taken this idea from the <a href=""http://en.wikipedia.org/wiki/Android_%28operating_system%29"" rel=""nofollow"">Android</a> videos:Google I/O 2009 -...Interaction &amp; Visual Design with Android (link: <a href=""http://developer.android.com/videos/index.html#v=wdGHySpipyA"" rel=""nofollow"">http://developer.android.com/videos/index.html#v=wdGHySpipyA</a>), the 25:58 min.</p><p>Here is a screen shot I've made:<a href=""http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs196.snc3/20366_322904078985_613608985_4870141_6451460_n.jpg"" rel=""nofollow"">http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs196.snc3/20366_322904078985_613608985_4870141_6451460_n.jpg</a></p><p>If anyone know about any tutorial, or article it will be fully estimated!</p>","260511","","63550","","2010-02-01 23:14:44","2010-02-01 23:14:44","Pop-up bar on selected list item","<android>","1","0","3","",""
"2176922","1","2700683","","2010-02-01 13:28:02","251","121132","<p>I want to create a transparent Activity on top of another activity.</p><p>How can I achieve this?</p>","249991","","1318946","","2014-02-04 13:31:50","2014-03-10 12:02:07","How to create Transparent Activity in Android?","<android><android-activity><transparent>","10","0","173","",""
"2176928","1","","","2010-02-01 13:28:54","0","2004","<p>Does the <a href=""http://en.wikipedia.org/wiki/Android_%28operating_system%29"" rel=""nofollow"">Android</a> <a href=""http://en.wikipedia.org/wiki/WebKit"" rel=""nofollow"">WebKit</a> supports the <a href=""http://en.wikipedia.org/wiki/XPCOM"" rel=""nofollow"">XPCOM</a> framework or <a href=""http://en.wikipedia.org/wiki/NPAPI#NPRuntime"" rel=""nofollow"">NPRuntime</a> API`s as like Firefox? How to implement JavaScript in the Android WebKit plug-in?</p><p>Update: I am writing a media player plug-in for the Android WebKit browser and my plug-in needs to get the command from the web page through JavaScript (some actions like play/pause/stop/resize are issued as JavaScript commands from the browser). My plug-in is written in native C code. Are there any examples or sample plug-in available for JavaScript communication?</p>","","user263522","63550","","2010-02-02 21:00:36","2010-06-16 23:26:15","XPCOM support in Android webkit browser?","<javascript><android><browser><webkit><xpcom>","3","0","","",""
"2176971","1","2180795","","2010-02-01 13:35:48","1","468","<p>I'm quite new to android and i'm facing some trouble with managing listviews...I'm generating a ListView properly but all the items in it have the same id, so when I click on any of them, they all do the same thing (which is not what I expect of course...)</p><p>I'm loading data from XML URLs, parsing them with a SAX parser.Here is my adapter. My ""liste"" contains 6 rows of 2 strings separated by ""&amp;&amp;&amp;"".I then display the listview with :</p><pre><code>  zadapter.notifyDataSetChanged();   setListAdapter(this.zadapter);</code></pre><hr><p>source below</p><hr><pre><code>class InfoAdapter extends ArrayAdapter&lt;String&gt; {  private ArrayList&lt;String&gt; items;  public InfoAdapter(Context context, int textViewResourceId, ArrayList&lt;String&gt; items) {   super(context, textViewResourceId, items);   this.items = items;  }  public View getView(int position, View convertView, ViewGroup parent) {   View v = convertView;   if (v == null) {    LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);    v = vi.inflate(R.layout.row, null);   }   String liste = items.get(position);   String[] info = liste.split(""&amp;&amp;&amp;"");   if (liste != null) {    TextView tt = (TextView) v.findViewById(R.id.toptext);    TextView bt = (TextView) v.findViewById(R.id.bottomtext);    if (tt != null) {     tt.setText(info[0]);    }    if(bt != null){     bt.setText(info[1]);    }    Log.e(MY_DEBUG_TAG, ""Debug position text""+tt.getId());   }   Log.e(MY_DEBUG_TAG, ""Debug position view""+v.getId());   return v;  } }</code></pre><p>Thank you in advance for any help.</p>","263521","","52201","","2010-02-01 13:36:52","2010-02-08 12:55:40","Constant id for all the items of a ListView making OnClick method useless","<android><listview>","3","0","","",""
"2176995","1","2177066","","2010-02-01 13:39:36","7","5137","<p>I've made an application based on the Google Maps API. The problem is that my application is made to be used in the wild, in places where there is no network. So I would like to manage the cache in order to ensure that specific tiles are saved and available during the trip (I'd like to redirect them in database but any method may do).</p><p>For now, I didn't found any other method (not tested) than try to recode the MapView class. I'm focusing on Google API in order to have satellite photography (for places where there are no roads). What could I do ?</p>","263525","","","","","2011-02-04 22:51:21","Manage cache of MapView","<android><google-maps>","2","0","1","",""
"2177125","1","2177181","","2010-02-01 14:00:18","4","5631","<p>I want to know whether Android 2.0 emulator is Bluetooth enabled.If it is not enabled, then how can i test my bluetooth application.Please any body knows the solution help me.</p>","131062","","974","","2010-02-01 14:01:50","2012-05-28 09:30:39","Is the Android 2.0 emulator Bluetooth enabled?","<android>","4","2","","",""
"2177163","1","2692098","","2010-02-01 14:05:10","2","7691","<p>In order to release a device to the market, You need to run the Compatibility Test Suite given by android...I need to know how to download and run it..</p>","237388","","","","","2012-04-17 00:54:05","How to run CTS tests in android(Eclair)?","<android><testing>","4","0","","",""
"2177464","1","","","2010-02-01 14:49:47","3","868","<p>I have a <code>MapActivity</code> that contains a <code>MapView</code> with some custom controls, state information, and an <code>ItemizedOverlay</code> composed by some locations that I draw using the default approach (using <code>populate()</code>, <code>super.draw()</code> and <code>createItem()</code>) and by some lines that I draw in the overrided <code>draw()</code> method.</p><p>So, when the activity is paused, I have to save:</p><ol><li>Some state information</li><li>The ItemizedOverlay</li><li>[Maybe more Overlays in the future.]</li></ol><p>I'm saving the state information as usual, putting them in the bundle. I'm thinking in doing the same with the <code>Overlays</code>, implementing <code>Parcelable</code>in  each one of the <code>OverlayItems</code> and so, but I don't know if there is a better way to store the complete state of the <code>MapViews</code>.</p><p>The information depends on remote requests that I don't want to repeat each time the activity is paused.</p><p>Any recommendation?</p>","28855","","28855","","2010-02-01 15:06:18","2010-06-22 08:49:46","What's the best way to save and restore a MapView in Android?","<android>","2","0","1","",""
"2177561","1","6665898","","2010-02-01 15:04:20","1","1348","<p>How can I change the icon on the right of the search manager?The default icon is a <code>magnifier</code>, but I've seen an app that does display instead of an magnifier an ""OK""!</p><p>For my needs, the magnifier icon is not so good.I use the <code>SearchManager</code> to display the history of typed words.So a better icon is OK instead of a search icon.</p>","242070","","1904504","","2013-12-24 10:22:44","2013-12-24 10:22:44","SearchManager display another icon instead of the magnifier","<android>","2","0","","",""
"2178161","1","2178398","","2010-02-01 16:19:08","5","1156","<p>After upgrading my application I would like the service to restart if it was running before.  Is there any way to do this?  I didn't see any Broadcast Intents that I could register for in the manifest.</p>","263664","","","","","2010-02-01 16:48:55","Is there a way to restart a service after upgrading the application on Android?","<android>","1","0","3","",""
"2178380","1","","","2010-02-01 16:46:22","1","153","<p>Greetings,</p><p>I am trying to generate android platform specifically for HTC Hero. I have followed the instructions described and built from trunk (I suppose):<a href=""http://source.android.com/download"" rel=""nofollow"">http://source.android.com/download</a>http://source.android.com/documentation/building-for-dream</p><p>The problem is that there is no 'extract_files.sh' script. So what is the proper procedure to build for HTC hero now, or where can I find this file?</p><p>P.S.I need to build the whole platform from scratch because we are going to run C++ application on it.</p>","263694","","","","","2010-02-03 14:08:36","Building specifically for HTC phone","<android><htc-hero>","1","1","","",""
"2178516","1","","","2010-02-01 17:02:31","2","409","<p>I'm trying to come up with a best practice for sharing code among a group of Android applications. For example, suppose I have a content provider that I want to access from several Android applications. I'd like to have a class that contains static members for content URIs, column identifiers, etc. This class would be shared by the content provider implementation as well as the applications that use the content provider. What is the best way to do this in Eclipse? Thanks.</p><p>-rich</p>","263700","","","","","2010-02-01 17:09:00","Sharing code among Android applications","<android><eclipse>","1","0","2","",""
"2178870","1","5574418","","2010-02-01 17:58:58","8","5800","<p>I would like to automatically generate unit testing report in html format for Android application on Hudson continuous integration server.</p><p>Therefore, I try to run test cases first and gather test result files in xml format. Then, I use JUnitReport Task to transform the XML result files into HTML format. </p><p>I run test cases through Android instrumentation framework. However, it only provides verbose output information rather than the standard JUnit XML format. I have no idea how to generate HTML unit test report without JUnit XML result files.</p><p>If I run test cases using Eclipse, it can export results in XML files with time consumed information per test case. Those XML files can be transformed into HTML by JUnitReport Task correctly. As a result, it seems that it is possible to collect the test result with time consumed information.</p><p>Is there any way to get the standard JUnit XML result file automatically after running test cases on Android instrumentation framework?</p>","248557","","248557","","2010-02-02 02:13:23","2011-09-23 09:17:42","How to Generate Android Testing Report in HTML Automatically","<android><unit-testing>","4","0","7","",""
"2179249","1","","","2010-02-01 18:57:23","2","1357","<p>I am using <strong>ganymade eclipse 3.4 IDE</strong> and <strong>android sdk</strong> for development . I am trying to store static database file with some values on it in <strong>sqlite</strong> format . How can I add this file into the IDE and fetch the data from that file and store it? Give me the guidance to do the development .</p><p>Thanks in advance.</p><p>Sivaramakrishnan (frankshiva@gmail.com)</p>","263781","","366898","","2012-07-19 11:47:34","2012-07-19 11:47:34","To store and retrieve from sqlite file  ( android programming ) ","<android><eclipse-3.4>","1","1","1","",""
"2179296","1","","","2010-02-01 19:01:57","5","10381","<p>I am trying to debug something and want to pop up a message dialog box. Eclipse is telling me that it wants me to ""Create Method showAlert(string, string, string, boolean)""  </p><p>I have imported this    import android.content.DialogInterface;</p><p>what step am I missing?</p>","257079","","","","","2012-08-29 04:59:38","How do I use the showAlert method in Android?","<android>","3","0","2","",""
"2179453","1","2356403","","2010-02-01 19:30:51","7","7726","<p>My question concerns using aidl.exe (on a Windows system) from the command line.  This question has nothing to do with Eclipse, Netbeans, etc.</p><p>Included with the Android SDK are the following three AIDL definition files:</p><p>IRemoteService.aidl   IRemoteServiceCallback.aidl   ISecondary.aidl</p><p>located in the following directory:</p><p>C:\android-sdk-windows\platforms\android-2.1\samples\ApiDemos\src\com\example\android\apis\app</p><p>For the sake of simplicity, I copied aidl.exe into the above directory.  Then, from a console Window, I successfully used the following two commands to generate .java files:</p><p>C:\Android-project\ApiDemos\src\com\example\android\apis\app>aidl IRemoteServiceCallback.aidl   C:\Android-project\ApiDemos\src\com\example\android\apis\app>aidl ISecondary.aidl</p><p>Invoking these commands produced the files IRemoteServiceCallback.java and ISecondary.java, respectively.  So far so good.</p><p>I note that both .aidl files are simple; they include no 'import' statements.</p><p>The remaining .aidl file, IRemoteService.aidl, does include the following import statement on line 19:</p><p>import com.example.android.apis.app.IRemoteServiceCallback;</p><p>The problem arises when I run the AIDL tool on this file:</p><pre><code>  C:\Android-project\ApiDemos\src\com\example\android\apis\app&gt;aidl IRemoteService.aidl</code></pre><p>Doing so causes the following error message to be printed in the console window:</p><p>IRemoteService.aidl:19: couldn't find import for class com.example.android.apis.app.IRemoteServiceCallback</p><p>The AIDL tool evidently could not locate the IRemoteServiceCallback.aidl file in the same directory in which it was running.  According to the AIDL tool's ""usage"" message, there is a command that apparently can be used to resolve this problem:</p><pre><code>  -I&lt;DIR&gt;    search path for import statements.</code></pre><p>The problem: I have not been able to specify -I in such a way as to avoid the error message and have the AIDL tool generate a .java file from the .aidl file with an 'import' statement.  (Note: I set the Windows environment variable 'path' to my current directory.)  Here are a few variations I've tried:</p><pre><code>-Ic:\com\example\android\apis\app-Ic:/com/example/android/apis/app-I.\-I.</code></pre><p>I must be missing something simple.  Surprisingly, even though I've seen variations of this question posted in various places, I have yet to see an answer or any documentation about AIDL command line usage (other than the aidl.exe USAGE info).  Can someone clue me in?</p><p>Thanks,Matt</p>","263807","","","","","2012-07-18 08:38:41","How do I use AIDL tool from command line using SDK sample code?","<android><aidl>","3","0","2","",""
"2179466","1","","","2010-02-01 19:33:32","2","114","<p>tried to attend some of the office hours but there were some problems with the IRC, so it was very difficult to follow the discussion. Are the past sessions recorded somewhere ? </p><p>It would be great if the ""best"" topics are summarized and posted, so other people who wasn't at the particular discussion have the knowledge as well. Thanks.</p>","131115","","","","","2010-03-05 13:00:04","Is there a way to read transcription of IRC Office hours somewhere?","<android>","1","0","","",""
"2179756","1","2213369","","2010-02-01 20:17:45","3","2150","<p>I have a DialogPreference and I want to avoid the user from closing it when pressing ""OK"", ""Cancel"", etc.</p><p>How should I do that?</p><p>EDIT:</p><p>I tried to reach the OK button to disable when the dialog is created. But I couldn't make it :(</p>","119895","","119895","","2010-02-04 23:06:35","2013-06-01 08:29:32","DialogPreference shouldn't close if no option selected","<android>","6","0","2","",""
"2180310","1","","","2010-02-01 21:47:45","2","1078","<p>I'm porting an iPhone app to Android, and I need to use OpenGL framebuffers. I have a Nexus One, and a call to glGet(GL_EXTENSIONS) shows that the Nexus One supports the same framebuffer extension as the iPhone. However, I can't seem to call functions related to the OpenGL extension in my GLSurfaceView. When I call a simple framebuffer get function, I get an UnsupportedOperationException.</p><p>I can't seem to resolve this issue, and I <em>must</em> have framebuffers to continue development. Do I need to pass some options in when the OpenGL context is created to get a fully capable OpenGL context object? Here's the block of code that I'm trying to run that determines the capabilities of the hardware. It claims to support the extension and my gl object is an instance of GL11ExtensionPack, but the call to glGetFramebufferAttachmentParameterivOES fails with an UnsupportedOperationException.</p><pre><code>public void runEnvironmentTests(){    String extensions = gl.glGetString(GL11.GL_EXTENSIONS);    Log.d(""Layers Graphics"", extensions);    if (gl instanceof GL11ExtensionPack) {        Log.d(""Layers Graphics"", ""GL11 Extension Pack supported"");        GL11ExtensionPack g = (GL11ExtensionPack) gl;        int[] r = new int[1];        try {            g.glGetFramebufferAttachmentParameterivOES(GL11ExtensionPack.GL_FRAMEBUFFER_OES,     GL11ExtensionPack.GL_COLOR_ATTACHMENT0_OES, L11.GL_TEXTURE_2D, r, 0);            Log.d(""Layers Graphics"", ""Framebuffers are supported"");        } catch (UnsupportedOperationException e) {            e.printStackTrace();            framebuffersSupported = false;            Log.d(""Layers Graphics"", ""Framebuffers are NOT supported"");        }    }}</code></pre><p>If anyone has successfully used the GL_FRAMEBUFFERS_OES extension, please let me know. I'm beginning to think it may just not be implemented in the Java API!</p>","100363","","","","","2010-02-03 02:57:31","Nexus One GL_FRAMEBUFFER_OES Extension... Not actually there?","<android><opengl-es><framebuffer><nexus-one>","1","1","","",""
"2180387","1","2195830","","2010-02-01 22:00:25","3","1560","<p>I am trying to follow the instructions on <a href=""http://developer.android.com/guide/developing/tools/traceview.html"" rel=""nofollow"">this page</a> to create a trace file. I can see the file in File Explorer in DDMS and can pull it onto my PC but it is zero bytes long.</p><p>Any suggestions as to what I might be doing wrong, please?</p>","250845","","","","","2010-02-03 22:04:02","Android trace file created but zero bytes long","<android><debugging><trace>","1","4","","",""
"2180591","1","","","2010-02-01 22:40:30","1","2488","<p>I have written code to enable and disable various things programatically like Wifi, Ringer modes, Airplane modes.  All things that you would see in a power toggle widget.</p><p>The one that I have not found out how to do is bluetooth.  It appears that in SDK level 3 (OS 1.5) there is no pretty bluetooth manager class.  Has anyone pinpointed any good source examples on enabling and disabling bluetooth that will also be forwards compatible with users running 2.0 (Droid) / 2.1 (Nexus)?</p><p>I have found a few partial examples in my google searches that I could not get to actually run.</p><p>Thanks!</p>","242904","","242904","","2010-02-02 03:12:48","2010-02-02 03:12:48","Android - Enabling and Disabling Bluetooth - SDK 3 (OS 1.5) - programatically?","<android>","1","0","0","",""
"2180677","1","","","2010-02-01 22:54:51","8","8941","<p>I need to set initial transparency for a TextView but I don't know how to do it. On iPhone it can be done easily with alpha property. I've tried to set alpha using AlphaAnimation but no good it doesn't work. It just returns to 100% alpha when it ends.</p><pre><code>  AlphaAnimation anim = new AlphaAnimation(1, 0.2f);  anim.setDuration (5000);  textView.startAnimation (anim);</code></pre><p>Any ideas guys?</p>","230466","","","","","2010-09-15 05:45:16","android.View transparency","<android><opacity>","1","2","2","",""
"2180705","1","2180804","","2010-02-01 23:00:34","2","949","<p>i would like to know if using the class ContentValue in querys is a good practice in order to prevent SQL injection.</p><p>Thanks</p>","258863","","","","","2010-02-01 23:20:46","Android SQLite, ask about ContentValues","<database><android>","1","0","1","",""
"2180966","1","","","2010-02-01 23:55:45","3","4620","<p>does not compile. Indeed: even in 1.5, this api, getIntent(), is already listed as deprecated.</p><p>The error message I get complains that getIntent() does not return a String, but setCurrentTab() expects a string.</p><p>If I guess and change the line to read:</p><p>""tabHost.setCurrentTab(1); // was setCurrentTab(getIntent())"",</p><p>then it compiles, builds, but does not run. I get the ""stopped unexpectedly"" error message from the emulator. I cannot even get Log.d to output, so it seems that it stops 'unexpectedly' very early.</p><p>So the first and main question is: what is the correct fix to ""tabHost.setCurrentTab(getIntent())"" in the final line of OnCreate() in <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a>?</p><p>The second and simpler question is: did I guess right in replacing 'mTabHost' with tabHost in the one place where that occurs?</p>","244880","","","","","2010-11-17 19:11:54","Bug Running Android Tutorial HelloTabWidget under SDK 1.5: ""setCurrentTag(getIntent())""","<java><android>","2","2","1","",""
"2181062","1","","","2010-02-02 00:21:31","3","10242","<p>I have a LinearLayout that contains three TextViews. I want to highlight a TextView or the whole Layout when user clicks on the TextView. Is they any way to make it happen?</p><p>Thanks.</p>","256239","","","","","2013-11-05 16:21:36","How to highlight a TextView or LinearLayout when click it?","<android>","2","0","1","",""
"2181359","1","2181373","","2010-02-02 01:30:15","1","2749","<p>I'm a little embarrassed to post this but I can't seem to figure outwhere I'm going wrong.  I've looked at every example and everytutorial and everything looks right to me.  Here's what I'm doing.  Ihave a listview that when you click on an item it will take you to aWebView that displays some static formatted text associated with thatlist entry.</p><p>I had it all working with a TextView but I wanted to be able to useHTML formatting for the text and figured the WebView was the way togo.  Right now it is just supposed to display a generic link fortesting purposes but when the viewContent intent starts it just goesto a black screen.  I can go back and pick another entry and it alsojust shows the black screen.</p><p>I'm not sure what code you are going to want to see so here's theviewSection class file and the viewsection.xml layout.</p><p>viewSection.java:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.webkit.WebView;public class viewSection extends Activity {       /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       WebView wv;       setContentView(R.layout.viewsection);       wv = (WebView) findViewById(R.id.wv1);       wv.loadData(""&lt;a href='x'&gt;Hello World! - 1&lt;/a&gt;"",                                               ""text/html"",                                               ""utf-8"");   }}</code></pre><p>viewsection.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout       xmlns:android=""http://schemas.android.com/apk/res/android""       android:orientation=""vertical""       android:layout_width=""wrap_content""       android:layout_height=""wrap_content""&gt;       &lt;WebView android:id=""@+id/wv1""               android:layout_height=""wrap_content""               android:layout_width=""fill_parent""       /&gt;&lt;/LinearLayout&gt;</code></pre>","264742","","","","","2010-02-02 21:30:16","WebView displays black screen","<android><webview>","1","0","","",""
"2181489","1","","","2010-02-02 02:12:36","1","2302","<p>How to get a live exchange rate data and apply it to an Android App?Currently creating a currency exchange as my project. </p>","264010","","","","","2011-09-10 23:55:21","How to get a live exchange rate data and apply it to an Android App?","<android>","3","1","","",""
"2181588","1","2224627","","2010-02-02 02:46:56","11","7880","<p>For my first and most awesomest Android project, I want to create a home screen widget which displays one of those <a href=""http://www.softpedia.com/progScreenshots/An-Arc-Clock-Screenshot-79251.html"">Arc Clocks</a> that all the kids are raving about these days.</p><p>Based on the limitations of <a href=""http://developer.android.com/reference/android/widget/RemoteViews.html"">RemoteViews</a>, it looks to me that the appropriate way to get it actually drawn on the screen is to use an <a href=""http://developer.android.com/reference/android/widget/ImageView.html"">ImageView</a> in the actual layout, then when it is updating, create a <a href=""http://developer.android.com/reference/android/graphics/drawable/ShapeDrawable.html"">ShapeDrawable</a> or two and draw them onto a newly created <a href=""http://developer.android.com/reference/android/graphics/Bitmap.html"">Bitmap</a>.  Then, set that Bitmap as the source of the ImageView.</p><p>There is Something about that process that I'm just not grokking, though.  The following is the code I tried to use to update the widget.  I get nothing drawn on the screen at all.  The ImageView has a placeholder image just set by its <code>src</code> property.  When I don't run the code to update it to my drawing, the placeholder image stays in place.  So, I know this code is doing <em>something</em>, just obviously not the <em>right</em> thing.</p><pre><code>RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.ARGB_8888);Canvas canvas = new Canvas(bitmap);ShapeDrawable drawable = new ShapeDrawable(new ArcShape(0, 360));drawable.getPaint().setColor(0xffff0000);drawable.getPaint().setStrokeWidth(5.0f);drawable.setIntrinsicWidth(100);drawable.setIntrinsicHeight(100);drawable.draw(canvas);views.setImageViewBitmap(R.id.ImageView01, bitmap);     appWidgetManager.updateAppWidget(appWidgetId, views);</code></pre><p>I knew it couldn't be that easy.  So, am I even heading in the right direction?</p><hr><p><strong>Update</strong></p><p>Ok, maybe that was too much information.  The question I'm really trying to ask is this:</p><p>If I want to draw shapes on a widget, should I use an ImageView and create a bitmap from my ShapeDrawable or is there more appropriate way to draw into a widget where it is constrained by RemoteViews?</p>","93","","93","","2010-02-05 21:23:00","2010-10-16 21:36:47","What's the proper way to implement an Android widget with dynamically drawn content?","<android><android-widget>","4","2","7","",""
"2181668","1","2182037","","2010-02-02 03:11:49","1","576","<p>I am getting error when I rotate the device (it was HTC with Verizon): </p><pre><code>The application My App (process com.mycompany.android) hasstopped unexpectadly. Please try again.</code></pre><p>So, I think I need to code for this issue. In order words, when rotate the device from landscape to portable or from portable to landscape, application needs to catch this event. </p><p>Is it right ?</p><p>How to make it ? What is wrong here ?</p><p>Edit: Is it possible to test on the emulator ?</p><p>Thanks in advance.</p>","227889","","227889","","2010-02-02 03:20:22","2010-02-02 12:50:52","Needs to code when rotate the device?","<android>","3","2","1","",""
"2181915","1","","","2010-02-02 04:34:08","0","737","<p>I want to include contentProvider(say for some application) package in to android.jar.</p><p>I was able to include it in sdk, well I could not do include in android.jar.</p><p>It would be helpfull for me if i can include those apis in android.jar for my further development in eclipse.And to specify there are no proper documentation available as such.</p><p>Kindly provide the steps to include external api into android.jar or any documents.</p><p>Thanks in advance.</p>","142521","","","","","2010-02-02 12:00:41","How to include external contentProvider(any api) package into android.jar in android","<android><jar>","1","0","","",""
"2181947","1","","","2010-02-02 04:45:57","1","2800","<p>Can any one please tell me how to show the route between two geo point in android application.If you can provide some code snippet.</p><p>thanks in advance.</p>","132724","","102703","","2010-02-02 05:18:45","2011-08-27 20:27:03","How to display route between two point in android?","<android><google-maps><android-mapview>","1","2","1","",""
"2181998","1","","","2010-02-02 05:07:31","13","30787","<p>Can anyone please confirm if android development is not yet supported on windows 7 x64?I downloaded the sdk, but when I tried to launch the sdk and avd manager it fails to launch.</p>","378962","","56338","","2011-01-18 07:07:38","2013-07-18 03:36:53","android sdk and avd manager does not launch on windows 7 x64","<android>","9","3","4","",""
"2182088","1","","","2010-02-02 05:38:11","-2","216","<blockquote>  <p><strong>Duplicate:</strong> <a href=""http://stackoverflow.com/questions/2176149/image-compatibility-in-iphone-and-android"">Image compatibility in iphone and android</a></p></blockquote><p>I developed UI for iPhone apps and now want to use the same UI in Android apps. I read that Android use dip for image resolution and I also read that 1 dip=1.5 pixel. I simply multiply the image size by 1.5px. Now the problem is that the image is blur and not as clear as in iPhone apps. So, will somebody suggest how I should make a design so that it could be used on iPhone and Android. </p><p>Note: I use Photoshop for UI developement. It would be better if suggested with reference to Photoshop CS4.</p>","263446","","3171","","2010-02-02 07:58:42","2010-02-02 17:16:54","Image compatibility in iphone and android","<android>","1","2","","",""
"2182578","1","3598855","","2010-02-02 08:01:59","13","27521","<p>How can I use marquee text in an android application?</p>","263325","","944657","","2012-11-30 13:55:54","2014-04-04 20:53:19","Marquee text in Android","<android>","9","1","7","",""
"2182674","1","","","2010-02-02 08:24:38","0","1301","<p>Can someone please point out the code in android source code, where a DNS query is being made?</p><p>I tried to locate the code where the actual DNS query is sent from an application, but i couldn't.</p><p>Any help would be great.</p><p>Thanks in advance</p>","264169","","","","","2010-02-02 08:44:51","DNS query in android source code","<android>","1","0","","",""
"2182793","1","","","2010-02-02 08:53:29","1","855","<p>I want to play the above trailer using following code but it is not working throwing following error</p><p>Command PLAYER_INIT completed with an error or info PVMFFailure02-02 13:40:33.696: ERROR/MediaPlayer(805): error (1, -1)02-02 13:40:33.706: ERROR/MediaPlayer(805): Error (1,-1)</p><p>Trailler link = <a href=""http://uk.clip-1.filmtrailer.com/3230_8406_a_4.wmv?log_var=103|441100218-1|-"" rel=""nofollow"">http://uk.clip-1.filmtrailer.com/3230_8406_a_4.wmv?log_var=103|441100218-1|-</a></p><pre><code>private final void playTrailler(String url)throws IOException, IllegalArgumentException {        MediaPlayer mp = new MediaPlayer();        Log.v(TAG, ""Trailler: "" + url);        mp.setDataSource(url);        mp.setOnPreparedListener(this);        mp.prepareAsync();    }public void onPrepared(MediaPlayer mp) {        mp.start();    }</code></pre>","216431","","","","","2010-02-02 08:53:29","android media player playing trailers","<android><media-player>","0","1","","",""
"2183137","1","2183791","","2010-02-02 09:59:06","3","1457","<p>What is the different b/w running runnable inside handler new Handler().post(runnable) and running in Thread(runable) ?</p>","216431","","19750","","2010-02-02 12:07:27","2010-02-02 12:15:35","android runnable difference","<java><android><multithreading>","2","0","1","",""
"2183210","1","2183812","","2010-02-02 10:12:28","0","517","<p>I don't what to give any background to activity. When I leave this property blank, it gives me an error.</p><p>And I have tried using <code>@null</code> as a value but it shows black background.</p><p>Can any one guide me, how to make it transparent?</p>","249991","","1777090","","2013-02-14 05:09:22","2013-02-14 05:09:22","android:background="""" is giving error","<android><android-ndk>","2","1","1","",""
"2183316","1","2183531","","2010-02-02 10:33:09","2","14947","<p>I have an image that I want to place on the background on my activity.  For the G1 I would use a background of 320x480 but with the nexus 1 the resolution is almost double that.  Should I just place the large image and make the smaller phones size down?  I am trying to keep the size of my package down as much as possible.</p>","248521","","114066","","2010-02-02 10:43:19","2011-05-17 14:15:06","Background image size for Android","<android>","2","0","","",""
"2183331","1","","","2010-02-02 10:35:58","4","13680","<p>I have published the apk files at android market site with a bug. But i want to remove that application from the android market.</p><p>How to Delete a published application from my android market account?</p><p>Below Scenario’s tried for delete application:* From the application page click the upgrade>>click the delete button bottom of the page.* while clicking delete it's displaying the below error message</p><pre><code>""An unexpected error occurred. Please try again later""</code></pre><p>can anyone have the solution for this issue?</p><p>Regards,Jeyavel N </p>","212809","","114066","","2010-02-02 11:39:41","2012-04-05 14:27:38","how to Delete published application from my android market account?","<android><google-play>","6","2","","",""
"2183447","1","2728343","","2010-02-02 11:02:26","36","28564","<p>I have a simple list with a listselector like so.</p><pre><code>&lt;ListView android:id=""@+id/list"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:layout_below=""@+id/round""    android:listSelector=""#99000000"" android:clickable=""true"" android:cacheColorHint=""#00000000"" android:background=""#00000000""&gt;&lt;/ListView&gt;</code></pre><p>As you can see android:listSelector=""#99000000"" but the ""black alpha"" color is applied to the entire list, not the selected item.</p><hr><p>So this is what I have now but the entire list still turns black</p><p>::listview_background.xml <br /></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;item android:state_enabled=""false"" android:state_focused=""true""        android:drawable=""@drawable/list_normal"" /&gt;  &lt;item android:state_pressed=""true""        android:drawable=""@drawable/list_pressed"" /&gt;  &lt;item android:state_focused=""true""        android:drawable=""@drawable/list_active"" /&gt;&lt;/selector&gt;</code></pre><p>::colors.xml<br /></p><pre><code>&lt;resources&gt;    &lt;drawable name=""list_normal""&gt;#96FFFFFF&lt;/drawable&gt;    &lt;drawable name=""list_active""&gt;#66000000&lt;/drawable&gt;    &lt;drawable name=""list_pressed""&gt;#CA000000&lt;/drawable&gt;&lt;/resources&gt;</code></pre><p>::the xml tag in my list <br /></p><pre><code>android:listSelector=""@drawable/listview_background""</code></pre>","248521","","248521","","2010-02-03 15:08:51","2012-02-19 02:25:04","ListSelector applies to the entire list","<android>","6","1","23","",""
"2183610","1","2553338","","2010-02-02 11:27:34","14","19464","<p>I'm pretty new to Android dev and still working out a lot of things.</p><p>I've got a main menu showing using the following code, but can't work out how to disable selected items in the menu.  Can anybody help me with some sample code?</p><pre><code>public class listTest extends ListActivity {    @Override    public void onCreate(Bundle savedState) {        super.onCreate(savedState);        setListAdapter(ArrayAdapter.createFromResource(this, R.array.mainMenu,                android.R.layout.simple_list_item_1));         //not sure how to disable list items here    }    protected void onListItemClick(ListView list, View view, int position, long id) {        // can disable items when they are clicked on        view.setEnabled(false);    }   }</code></pre><p>and I have a <code>string-array</code> in my strings.xml file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string-array name=""mainMenu""&gt;        &lt;item&gt;Item 1&lt;/item&gt;        &lt;item&gt;Item 2&lt;/item&gt;        &lt;item&gt;Item 3&lt;/item&gt;    &lt;/string-array&gt; &lt;/resources&gt;</code></pre><p>Thank you</p>","264276","","264276","","2011-04-06 14:39:04","2014-01-20 12:48:23","Android: How to disable list items on list creation","<java><android><list><listview>","4","2","4","",""
"2183680","1","2198104","","2010-02-02 11:37:11","5","8245","<p>There are many questions about it, no answers are working in my application :(</p><p>I need to remove SMS from a receiver, even if the user can see it, but it must be removed programmatically. </p><p>How can I do it?</p><p>The most suitable I have used was the following, but it doesn't work :(</p><pre><code>context.getContentResolver().delete(                deleteUri,                ""address=? and date=?"",                new String[] { msg.getOriginatingAddress(),                        String.valueOf(msg.getTimestampMillis()) });</code></pre>","263321","","234938","","2010-02-02 11:48:30","2013-03-31 18:58:11","Delete SMS in Android 1.5","<java><android><sms>","5","0","8","",""
"2183808","1","2183859","","2010-02-02 12:04:47","11","27553","<p>I am working on an Android app that displays photos which are downloaded from Flickr. I obtain a bitmap object from a byte array, which in turn is read from the relevant Flickr URL, as follows:</p><pre><code>BitmapFactory.Options opt = new BitmapFactory.Options();opt.inDither = true;opt.inPreferredConfig = Bitmap.Config.ARGB_8888;Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length, opt);</code></pre><p>I then draw the bitmap onto a canvas in the onDraw method of a View object:</p><pre><code>Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG);canvas.drawBitmap(bitmap, 0, 0, paint); </code></pre><p>The problem is that the resulting picture is pixelated and I can't figure out why; I have tried a number of variations of the opt and paint objects with no luck. The difference between the picture displayed in my app and the picture at the original URL is roughly demonstrated by the following:</p><p><img src=""http://homepages.inf.ed.ac.uk/s0677975/bad.jpg"" alt=""Bad image, see pixelation in top left corner""></p><p><img src=""http://homepages.inf.ed.ac.uk/s0677975/good.jpg"" alt=""Good picture, this is the expected result""></p><p>Look e.g. at the clouds in the top-left corner to see the difference.</p><p>Note that JPEG pictures which are loaded from the project resources and drawn in a similar way display just fine, i.e. have no pixelation. </p><p>Can anybody give me a hint as to why this is happening?</p><p>To elaborate a little, the byte array is obtained from Flickr as follows; this is based on code from the Photostream app by Romain Guy:</p><pre><code>InputStream in = new BufferedInputStream(url.openStream(), IO_BUFFER_SIZE);final ByteArrayOutputStream dataStream = new ByteArrayOutputStream();out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE);copy(in, out);out.flush();final byte[] data = dataStream.toByteArray();</code></pre><p>PS: I also posted a variant of this question on the android.developer Google group.</p><hr><p>Thanks a lot for your suggestion -- now I am really puzzled! I did as you suggested and found that the image resulting directly from the downloaded byte array is indeed pixelated. However, this is downloaded from exactly the same URL which, when accessed on my computer, is NOT pixelated. Here is the corresponding Flickr URL:</p><p><a href=""http://farm3.static.flickr.com/2678/4315351421_54e8cdb8e5.jpg"" rel=""nofollow"">http://farm3.static.flickr.com/2678/4315351421_54e8cdb8e5.jpg</a></p><p>Even stranger, when I run the same app in the simulator rather than on my phone (a HTC Hero), there is no pixelation. </p><p>How on earth is this possible? </p><p>Below is the code I use for loading a bitmap from a URL -- it is based on the Photostream app by Romain Guy, and it incorporates Will's suggestion to write the raw byte array to file:</p><pre><code>Bitmap loadPhotoBitmap(URL url) {    Bitmap bitmap = null;        InputStream in = null;        BufferedOutputStream out = null;        try {            FileOutputStream fos = new FileOutputStream(""/sdcard/photo-tmp.jpg"");            BufferedOutputStream bfs = new BufferedOutputStream(fos);            in = new BufferedInputStream(url.openStream(),                    IO_BUFFER_SIZE);            final ByteArrayOutputStream dataStream = new ByteArrayOutputStream();            out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE);            copy(in, out);                                out.flush();            final byte[] data = dataStream.toByteArray();            bfs.write(data, 0, data.length);            bfs.flush();            BitmapFactory.Options opt = new BitmapFactory.Options();            bitmap = BitmapFactory.decodeByteArray(data, 0, data.length, opt);        } catch (IOException e) {            android.util.Log.e(LOG_TAG, ""Could not load photo: "" + this, e);        } finally {            closeStream(in);            closeStream(out)            closeStream(bfs);        }        return bitmap;    }private static void copy(InputStream in, OutputStream out) throws IOException {    byte[] b = new byte[IO_BUFFER_SIZE];    int read;    while ((read = in.read(b)) != -1) {        out.write(b, 0, read);    }}private static void closeStream(Closeable stream) {    if (stream != null) {        try {            stream.close();        } catch (IOException e) {            android.util.Log.e(LOG_TAG, ""Could not close stream"", e);        }    }}</code></pre><p>Am I going crazy here?Best,Michael.</p>","264293","","19679","","2013-11-24 01:34:51","2013-11-24 01:34:51","Android: BitmapFactory.decodeByteArray gives pixelated bitmap","<android><image-processing><flickr>","3","3","5","",""
"2183962","1","2184151","","2010-02-02 12:31:38","78","64042","<p>I have written the line:</p><pre><code>String Mess= R.string.mess_1 ;</code></pre><p>to get string value, but instead of returning string, it is giving me id of type integer. Can anyone guide me as to how I can get its string value? I mentioned the string value in the <code>string.xml</code> file.</p><p>Any help would be appreciated.</p>","249991","","186636","","2011-12-16 19:17:57","2014-03-02 10:45:21","how to read value from string.xml in android?","<android><layout>","7","0","9","",""
"2184226","1","2184759","","2010-02-02 13:11:33","0","6661","<p>i  have following code to call new activity</p><p>now i want to use variable to call new activity  </p><p>String var1,var2,var3;var1=""Login"";var2=""Signup"";var3=""more"";</p><pre><code>Intent i; i = new Intent(Favorites.this, Login.class);  --&gt; login.class with var startActivity(i); </code></pre><p>can any one guide me how to achieve this???</p>","249991","","","","","2011-11-08 22:45:28","how to use variable while calling new activity in intent?","<android><activity>","6","0","","",""
"2184364","1","2184509","","2010-02-02 13:37:37","3","11711","<p>I have tried several different examples but I cannot get any video to show. I hear sound but no video. I thought maybe I just had a incorrect video format so I downloaded a fiat commercial in 3gp format and still no joy. I am using the Eclipse Java EE with android sdk and my app targets the 1.5 sdk (Api Level 3) without google api. Could someone please post a link to a video known to play in android or point out my problem with the code. I have tried all I could think of .. with/without prepare .. different layouts etc. </p><p>Here is my onCreate in activity</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);this.setContentView(R.layout.video_test);    SurfaceView v = (SurfaceView) findViewById(R.id.surface_video);     SurfaceHolder holder = v.getHolder();  // Set the transparency     //getWindow().setFormat(PixelFormat.UNKNOWN);     // Set a size for the video screen     //holder.addCallback(this);     holder.setFixedSize(400,300);     MediaPlayer mp = MediaPlayer.create(this, R.raw.fiat);     mp.setDisplay(holder);    //mp.setAudioStreamType(2);     try {        //mp.prepare();        mp.start();    } catch (IllegalStateException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }</code></pre><p>her is the layout in video_test.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" &gt; &lt;SurfaceView android:id=""@+id/surface_video"" android:layout_width=""250px"" android:layout_height=""250px""&gt; &lt;/SurfaceView&gt; &lt;LinearLayout android:orientation=""horizontal"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:padding=""10dip"" &gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre><p>> Blockquote</p>","246240","","472792","","2013-08-04 13:22:24","2013-08-04 13:22:24","android video, hear sound but no video","<android><video><media-player><surfaceview>","4","1","","",""
"2184605","1","2185676","","2010-02-02 14:15:11","1","248","<p>I'm contemplating making an android version of my iPhone app. One of the attractions is the availability of a micro/miniSD card from Spectec that has an Ant+ radio in it, to communicate with Ant+ protocol devices. </p><p>The technical feasibility of this is not my question; but rather its practicality:</p><p>This obviously involves taking out the SD memory card in the handset and replacing it with one with no on-board memory, leaving the device with only the builtin 256mb or whatever. this is plenty for my app, but I'm concerned that, aside from annoying the user by having all their music removed, there will be apps on the users device that save data to the SD and will be broken by removing the SD memory. </p><p>Can anyone give an opinion on this issue?</p><p>TIA</p>","151163","","","","","2010-02-02 16:27:02","Android app that needs to use non-memory SD card","<android>","1","0","","",""
"2184728","1","2184859","","2010-02-02 14:30:01","2","3711","<p>I have created the private signed keystore file using eclipse and I have released the apk files in android market website. After some days we got some issues from users and we have fixed the issues but I don't have private signed keystore file.While making the apk file I need to use private signed keystore file used in previous version release.</p><p>Is there way to get private signed keystore file from previous apk release file?</p>","212809","","1777090","","2013-02-14 05:12:41","2013-02-14 05:12:41","Is there way to get private signed keystore file from previous apk release file?","<android>","1","1","0","",""
"2184778","1","2185189","","2010-02-02 14:36:17","1","10954","<p>How can i make a Navigation Bar at the top of my application? I would like something like the top bar in the photo:<a href=""http://blog.podgrove.com/iph-1.jpg"" rel=""nofollow"">link text</a></p>","258863","","","","","2013-06-18 00:37:59","Android Navigation Bar Top","<android><uinavigationbar>","2","0","2","",""
"2184927","1","","","2010-02-02 14:56:52","19","2089","<p>What I want is to have an options menu where the user can choose to navigate the menu between:</p><ol><li>Touching a button and then pressing down on the trackball to select it</li><li>Drawing predefined gestures from Gestures Builder</li></ol><p>As it stands now, I have created my buttons with <code>OnClickListener</code> and the gestures with <code>GestureOverlayView</code>. Then I select starting a new <code>Activity</code> depending on whether the using pressed a button or executed a gesture. However, when I attempt to draw a gesture, it is not picked up. Only pressing the buttons is recognized. The following is my code:</p><pre><code>public class Menu extends Activity implements OnClickListener, OnGesturePerformedListener {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    //create TextToSpeech    myTTS = new TextToSpeech(this, this);    myTTS.setLanguage(Locale.US);    //create Gestures    mLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures);    if (!mLibrary.load()) {     finish();    }    // Set up click listeners for all the buttons.    View playButton = findViewById(R.id.play_button);    playButton.setOnClickListener(this);    View instructionsButton = findViewById(R.id.instructions_button);    instructionsButton.setOnClickListener(this);    View modeButton = findViewById(R.id.mode_button);    modeButton.setOnClickListener(this);    View statsButton = findViewById(R.id.stats_button);    statsButton.setOnClickListener(this);    View exitButton = findViewById(R.id.exit_button);    exitButton.setOnClickListener(this);    GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures);    gestures.addOnGesturePerformedListener(this);}public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {  ArrayList&lt;Prediction&gt; predictions = mLibrary.recognize(gesture); // We want at least one prediction if (predictions.size() &gt; 0) { Prediction prediction = predictions.get(0); // We want at least some confidence in the result if (prediction.score &gt; 1.0) {  // Show the gesture   Toast.makeText(this, prediction.name, Toast.LENGTH_SHORT).show();   //User drew symbol for PLAY    if (prediction.name.equals(""Play"")) {       myTTS.shutdown();       //connect to game      // User drew symbol for INSTRUCTIONS     } else if (prediction.name.equals(""Instructions"")) {           myTTS.shutdown();           startActivity(new Intent(this, Instructions.class));       // User drew symbol for MODE   } else if (prediction.name.equals(""Mode"")){      myTTS.shutdown();      startActivity(new Intent(this, Mode.class));       // User drew symbol to QUIT  } else {      finish();   }  } }}@Override    public void onClick(View v) {      switch (v.getId()){      case R.id.instructions_button:         startActivity(new Intent(this, Instructions.class));         break;      case R.id.mode_button:         startActivity(new Intent(this, Mode.class));         break;      case R.id.exit_button:         finish();         break;  }  }</code></pre><p>Any suggestions would be greatly appreciated!</p>","264427","","119895","","2011-03-13 22:26:12","2012-04-02 12:41:03","Using android gesture on top of menu buttons","<android><gesture-recognition>","1","5","3","",""
"2185299","1","","","2010-02-02 15:41:25","2","5889","<p>I've managed to create a Zoom (extends View) in order to load a PNG into a Drawable object and have it on the screen with zooming and panning function. See the code of the View (Zoom.java) :</p><pre><code>public class Zoom extends View {private Drawable image;private int zoomControler = 200;private int shiftleft = 0;private int shiftup = 0 ;public float oldX = 0;public float oldY = 0;public Zoom(Context context) {    super(context);    image = context.getResources().getDrawable(R.drawable.androidmarker);    setFocusable(true);}@Overrideprotected void onDraw(Canvas canvas) {    super.onDraw(canvas);    image.setBounds(getWidth() / 2 - zoomControler - shiftleft,             getHeight() / 2 - zoomControler - shiftup,            getWidth()/ 2 + zoomControler - shiftleft,            getHeight()/ 2 + zoomControler - shiftup);    image.draw(canvas);}@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if (keyCode == KeyEvent.KEYCODE_DPAD_UP)        zoomControler += 10;    if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN)        zoomControler -= 10;    if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT)     {        shiftleft +=10;    }    if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT)    {        shiftleft-=10;    }    if (zoomControler &lt; 10)        zoomControler = 10;    invalidate();    return true;}@Overridepublic boolean onTouchEvent(MotionEvent e) {    int action = e.getAction();    switch (action) {    case MotionEvent.ACTION_DOWN:        oldX = e.getX();        oldY = e.getY();        break;    case MotionEvent.ACTION_MOVE:        shiftleft+=(int) (-(e.getX() - oldX) ) / 2;        shiftup+=(int) (-(e.getY() - oldY) / 2);        break;    case MotionEvent.ACTION_UP:        break;    case MotionEvent.ACTION_CANCEL:        break;    }    invalidate();    return true;}}</code></pre><p>The problem is how I get a screen centered zoom ? For the moment, the center of the zoom is always the center of the PNG file...I don't know how to modified setBounds in order to get this behaviour... Any idea ?Thanks ;)</p>","264467","","60261","","2010-02-02 16:53:20","2011-04-04 05:04:23","Centered zoom on Android","<android><view><zooming>","0","0","1","",""
"2185776","1","2185803","","2010-02-02 16:37:49","6","2001","<p>For my new released application I use the following url to get it on the Android market</p><blockquote>  <p><a href=""http://market.android.com/details?id=com.kamosoft.happycontacts"" rel=""nofollow"">http://market.android.com/details?id=com.kamosoft.happycontacts</a></p></blockquote><p>From my Android device, when I click on this url, I'm well forwarded to the Market application , on my application page, that's work fine.</p><p>But from a PC with a standard browser, I got <code>404 Error not found</code> ! Why ?</p><p>Any idea ?</p><p>Thanks in advance</p>","231417","","","","","2010-02-02 16:40:30","Android market URLs","<android><google-play>","1","1","1","",""
"2185785","1","","","2010-02-02 16:38:54","4","4511","<blockquote>  <p><strong>Duplicate</strong>: <a href=""http://stackoverflow.com/questions/1755860/"">Is there any form designer available for Google Android?</a></p></blockquote><p>I would like to move a CheckBox, so it displays in a different location than the top-left corner under Absolute Layout inside main.xml, for 'Android'.  I'm using Eclipse to edit my views.  How would I do this?</p><p>On an iPhone they have a tool called Interface builder that allows you to move things in a WYIWYG fashion.Does Eclipse have similar functionality?</p>","","user262122","1777090","","2013-02-14 05:10:47","2013-02-14 05:10:47","WYSIWYG View Editor in 'Android'?","<xml><android><eclipse><editor><wysiwyg>","2","3","","",""
"2185846","1","2185905","","2010-02-02 16:45:51","19","4437","<p>I just uploaded my application in the market, but I'm not able to purchase it (it's a pay app).</p><p>I saw <a href=""http://market.android.com/support/bin/answer.py?hl=en&amp;answer=141659"" rel=""nofollow"">here</a> that it seems to be <em>made by design</em>, but then why the error message is <code>Server Error try again</code> ?</p><p>Is there a way to bypass that ?</p>","231417","","309086","","2014-01-08 11:32:34","2014-01-08 11:32:34","Why I can't purchase my own application on the Android market?","<android><google-play>","5","0","1","2012-07-28 13:56:52",""
"2186035","1","2186156","","2010-02-02 17:08:09","0","2259","<p>I have made an component for Android, which uses two drawables.</p><p>Using static values for the drawables in the code, the component works but now I want to declare the values in the properties (XML) does anyone know how to do this?</p><p>*Edit;Is there a way to do this without using the attrs.xml?</p>","174868","","174868","","2010-02-03 19:00:04","2010-02-03 19:00:04","Android Custom Component Properties","<android><components><widget>","1","2","","",""
"2186317","1","","","2010-02-02 17:47:24","5","8449","<p>I am trying to program a very standard JS behavior for a link using an HREFonClick handler, and I am facing a strange problem caused by what I believe to be focus/touch mode behavior on Android.</p><p>Sometimes when I click on the link, instead of executing the action, it simply becomes selected/focused, with either just a focus rectangle or even also with a filled focus rectangle (selected as opposed to just focused?).</p><p>The pseudo-code right now is</p><pre><code>&lt;a href=""#"" onClick=""toggleDivBelowToShowHide(); return false;""&gt;go&lt;/a&gt;</code></pre><p>I have tried doing something like:</p><pre><code>&lt;a href=""#"" onTouchStart=""toggleDivBelowToShowHide(); return false;""&gt;go&lt;/a&gt;</code></pre><p>But I still get the same pesky problem some of the time.</p>","120237","","166712","","2010-02-02 17:51:47","2011-09-23 08:18:24","In Android Browser link does not always execute onClick causing focus instead","<android><webkit><focus><onclick><webview>","5","6","4","",""
"2186758","1","2186875","","2010-02-02 18:58:13","5","13018","<p>I'm creating my first android application but it does not start at all.</p><p>In my src > android.SampleApp I created a java file named Main.java with:</p><pre><code>public class Main extends Activity {// Will be connected with the buttons via XMLpublic void myClickHandler(View view) {    switch (view.getId()) {    case R.id.btn1:        ((EditText) findViewById(R.id.txtContent)).setText(""Button 1 Clicked"");        break;    case R.id.btn2:        ((EditText) findViewById(R.id.txtContent)).setText(""Button 2 Clicked"");        break;    }}}</code></pre><p>In my res > layout > main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextView  android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""@string/hello"" android:id=""@+id/txtContent""/&gt;&lt;Button android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Button One"" android:id=""@+id/btn1""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Button Two"" android:id=""@+id/btn2""&gt;&lt;/Button&gt;</code></pre><p></p><p>My AndroidManifest.xml content:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""android.SampleApp""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""7"" /&gt;</code></pre><p> </p><p>I get this error:</p><ol><li>[2010-02-02 01:46:26 - SampleApp]Android Launch!</li><li>[2010-02-02 01:46:26 - SampleApp]adb is running normally.</li><li>[2010-02-02 01:46:26 - SampleApp]No Launcher activity found!</li><li>[2010-02-02 01:46:26 - SampleApp]The launch will only sync the application package on the device!</li><li>[2010-02-02 01:46:26 - SampleApp]Performing sync</li></ol><p>Lines 3 and 4 is highlighted red.</p><p>Could someone lead my in the right direction to just get the application to show on the emulator?</p><p>Android 2.1 SDK with Eclipse</p>","400861","","400861","","2010-02-02 19:22:20","2010-02-02 19:22:20","First Android Test Project does not start","<android>","1","0","","",""
"2187152","1","3045896","","2010-02-02 19:50:56","1","395","<p>I've written a test app to read the call log.There are 3 types of field -> <strong><code>incoming, outgoing, missed</code></strong></p><p>In the emulator, I get the type <code>missed</code> after not picking up the phone.If I reject the call, I will get the type <code>incoming</code>.</p><p>On my HTC Hero phone I get always the type <code>missed</code>.On not picking up and if I reject the type field is always <code>missed</code> type.</p><p>Is this a bug in the HTC Hero?</p>","242070","","1904504","","2013-12-24 10:31:34","2013-12-24 10:31:34","CallLog - field type","<android><telephony>","1","2","","",""
"2187202","1","","","2010-02-02 19:59:06","5","5530","<p>I have an app whose main class extends ListActivity:</p><pre><code>public class GUIPrototype extends ListActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final Cursor c = managedQuery(People.CONTENT_URI, null, null, null, null);        String[] from = new String[] {People.NAME};        int[] to = new int[] { R.id.row_entry };        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,R.layout.drawer,c,from,to);        setListAdapter(adapter);        getListView().setTextFilterEnabled(true);    }}</code></pre><p>I have a sliding drawer included in my XML, and I'm trying to get a separate listview to appear in the sliding drawer.  I'm trying to populate the second listview using an inflater:</p><pre><code>View inflatedView = View.inflate(this, R.layout.main, null);ListView namesLV = (ListView) inflatedView.findViewById(R.id.content);String[] names2  = new String[] { ""CS 345"", ""New Tag"", ""Untagged"" };ArrayAdapter&lt;String&gt; bb = new ArrayAdapter&lt;String&gt;(this, R.layout.main, R.id.row_entry, names2);namesLV.setAdapter(bb);</code></pre><p>This compiles, and runs, but the slidingdrawer is completely blank.  My XML follows:</p><p></p><pre><code>&lt;SlidingDrawer    android:id=""@+id/drawer""    android:handle=""@+id/handle""    android:content=""@+id/content""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""    android:layout_gravity=""bottom""&gt;    &lt;ImageView        android:id=""@id/handle""        android:layout_width=""48px""        android:layout_height=""48px"" android:background=""@drawable/icon""/&gt;    &lt;ListView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:id=""@id/content""/&gt;&lt;/SlidingDrawer&gt;</code></pre><p>I feel like I'm missing a vital step.  I haven't found any resources on my problem by Googling, so any help would be greatly appreciated.</p><p>Edit: This was for a problem a long time ago, and the solution I found was to just redesign my layout.  I am unable to accept an answer as I don't have the means to test them.</p>","264676","","264676","","2011-05-17 11:11:24","2011-12-17 22:49:38","Implementing a listview inside a sliding drawer with a listview already present","<android><android-widget>","4","1","1","",""
"2187206","1","2187295","","2010-02-02 19:59:53","2","1557","<p>I tested that it is possible for Android to pass <code>newVersion</code> &lt; <code>oldVersion</code> to <code>SQLiteOpenHelper.onUpgrade()</code> method, ie. it wants the application to downgrade its database. </p><p>I don't want to handle this case, though I would like to notify the user somehow that there exists a newer version of my application (which she apparently had installed previously) and that's the one she should be using.</p><p>Any ideas what would be the best way to achieve this? <code>Toast</code>? <code>AlertDialog</code> (but in what context)?</p>","139298","","","","","2012-02-17 18:42:04","Downgrading DB on Android","<database><android><sqlite3><versioning><downgrade>","2","0","1","",""
"2187464","1","2187961","","2010-02-02 20:32:21","3","1814","<p>My program threw a NullPointerException the other day when it tried to use a Handler created on another thread to send that thread a message. The Handler created by the other thread was not yet created, or not yet visible to the calling thread, despite the calling thread having already called start on the other thread. This only happens very rarely. Almost every test run does not get the exception.</p><p>I was wondering what the best way is to avoid this problem for sure with minimal complication and performance penalty. The program is a game and very performance sensitive, especially once it is running. Therefore I try to avoid using synchronization after setup, for example, and would prefer to avoid spinning on a variable at any time.</p><p>Background:<br>In Android the Handler class may be used to ""enqueue an action to be performed on a different thread than your own"". Documentation here:<br><a href=""http://developer.android.com/intl/de/reference/android/os/Handler.html"" rel=""nofollow"">http://developer.android.com/intl/de/reference/android/os/Handler.html</a></p><p>The Handler must be created on the thread where it will be used. So creating it in the constructor of a thread, which is run by the thread creating that thread, is not an option.</p><p>When the Handler is for a thread other than the UI thread, the Looper class must also be used:<br><a href=""http://developer.android.com/intl/de/reference/android/os/Looper.html"" rel=""nofollow"">http://developer.android.com/intl/de/reference/android/os/Looper.html</a></p><p>The documentation gives this example of using the two classes for this purpose:</p><pre><code>class LooperThread extends Thread {    public Handler mHandler;    public void run() {        Looper.prepare();        mHandler = new Handler() {            public void handleMessage(Message msg) {                // process incoming messages here            }        };        Looper.loop();    }}</code></pre><p>My very ugly workaround currently looks like this:</p><pre><code>public class LooperThread extends Thread {    public volatile Handler mHandler;    public final ArrayBlockingQueue&lt;Object&gt; setupComplete = new ArrayBlockingQueue&lt;Object&gt;(1);    public void run() {        Looper.prepare();        mHandler = new Handler() {            public void handleMessage(Message msg) {                // process incoming messages here            }        };        setupComplete();        Looper.loop();    }    public void waitForSetupComplete() {        while ( true ) {            try {                setupComplete.take();                return;            } catch (InterruptedException e) {                //Ignore and try again.            }        }    }    private void setupComplete() {        while( true ) {            try {                setupComplete.put(new Object());                return;            } catch (InterruptedException e) {                //Ignore and try again.            }                }    }}</code></pre><p>With the code in the creating thread looking like this:</p><pre><code>    LooperThread otherThread = new LooperThread();    otherThread.start();            otherThread.waitForSetupComplete();    otherThread.mHandler.sendEmptyMessage(0);</code></pre><p>Are there any better solutions? Thanks.</p>","244521","","","","","2013-12-12 19:38:27","How do I ensure another Thread's Handler is not null before calling it?","<java><android><multithreading><null>","3","0","3","",""
"2187524","1","","","2010-02-02 20:40:10","1","937","<p>My activity comes into play at screen off. I have logging for anytime it gains or lose focus. I have no indication that it has lost focus, however, I am seeing key events fall on the floor, and in the log the window manager reports- No focus window, dropping: KeyEvent (all the verbose details of what key it was).</p><p>This is only occasionally, so that is making it hard for me to pinpoint a cause. Because this is an event we expect to come in after an indefinite time asleep, I don't want to hold a partial wakelock. Most times everything works correctly.</p><p>Right after the failed key event, my activity does onResume and then the screen on broadcast comes in, and we are simply awake on the activity that's not normally supposed to be sitting on screen, because the key event fell on the floor.</p><p>I am trying to figure out why this happens even when at onCreate I use the TakeKeyEvents(true) which claims that it lets your activity get key events even when it is not the view with focus. I tried moving the command to onPause since issue seems to only appear when I am paused but I very quickly reduplicated the issue after trying that.</p><p>My source for this activity is here:<a href=""http://code.google.com/p/mylockforandroid/source/browse/trunk/myLock/src/i4nc4mp/myLock/Lockscreen.java"" rel=""nofollow"">http://code.google.com/p/mylockforandroid/source/browse/trunk/myLock/src/i4nc4mp/myLock/Lockscreen.java</a></p>","246883","","246883","","2010-02-02 20:56:24","2010-02-02 20:56:24","TakeKeyEvents not working effectively (no focus window error)","<android>","0","2","","",""
"2187550","1","","","2010-02-02 20:45:13","5","549","<p>I have the Android Facebook-Connect library running in my emulator and I'm able to set my status with the Facebook API I have setup. However, I don't know where to go from there? Am I supposed to use the session key that this library allows me to get and make some Facebook API calls? I haven't found any code examples to even see what the proper syntax is.</p><p>Am I better off using another library? I tried fbrocket with limited luck(I get a ""server error 104 - Incorrect signature""). Thanks for any help.</p>","249531","","","","","2011-03-27 09:44:51","Android: Best way/library to write an app that simply gets/sets your Facebook status, sends Facebook messages, and requests friends?","<android><facebook>","1","1","5","",""
"2187567","1","","","2010-02-02 20:47:45","8","30093","<p>I am currently working on a group project to build an Android game. I have been delegated the task of building a PC based level editor (which is all done).</p><p>All I have to do now is decide on the file format for the map that is outputted. At the moment it is just a standard text file with different numbers to represent different tiles; E.G 0=path 1=wall 2=enemy.</p><pre><code>1 1 1 1 1 1 1 11 0 0 0 2 0 0 11 1 1 1 1 1 1 1</code></pre><p>The actual Android game then takes this file and stores the values into a 2D Array. However those who are making the actual game are having difficulty opening a text file, and others have told me it has to be done using an XML file. I have now been asked to find a away to take in this input.</p><p>Could someone tell me how I would read the text file and put the values into a <strong>int</strong> <em>array[][]</em> ? Or if it is easier, use an XML file and tell me how to format that file and read the values into a <strong>int</strong> <em>array[][]</em></p><p>Any help would be appreciated as I didn't learn how to use Android so I find this quite difficult.</p><p>Many thanks/</p>","261800","","","","","2010-02-02 23:41:54","Reading a text file or XML file in Android java","<java><xml><android><file>","2","0","2","",""
"2188049","1","2188513","","2010-02-02 22:03:04","40","61317","<p>I am trying to parse HTML in android from a webpage, and since the webpage it not well formed, I get <code>SAXException</code>.</p><p>Is there a way to parse HTML in Android?</p>","237115","","313758","","2011-03-03 07:15:47","2011-03-24 05:07:49","Parse HTML in Android","<android><html><parsing>","5","2","24","",""
"2188346","1","","","2010-02-02 22:43:49","7","2721","<p>I am writing an Android AR application and have my engine working but it contains a strange behaviour that I can't seem to get fix. I am overlaying an OpenGL surface on the camera image and am placing 3D objects in the view accordingly. If I use dummy data for the location of my AR objects, i.e. LAT 10 LON 10 become x=10 y=10 on the OpenGL surface, then the overlay works perfectly. However, if I use direct GPS coordinates for my LAT and LON (e.g. LAT 12.34567890 LON 100.23456789) then all my objects either move around their location or don't appear at all. I know there are issues around using floating points and the OpenGL framework, but I've been reading around and am still having trouble stopping this behaviour. Has anyone else had this problem? Should I be using a scaling factor between my GPS and openGL surface, if so what values are good? I tried scaling my LAT and LON by 1000000 to eliminate the floating point, but it didn't help and the performance was terrible. </p><p>I'm so close to getting this working, that any help would be much appreciated. </p>","264808","","44729","","2011-05-26 15:45:32","2012-01-09 23:00:53","Augmented Reality - Mapping GPS to OpenGL","<android><opengl-es><augmented-reality>","1","0","1","",""
"2189244","1","","","2010-02-03 02:28:24","0","4575","<p>I have got some times stored in ISO format. Some of these times are flagged to either 1(on) or 0(off) set in another column. I need to set  a reminder at the times flagged to 1, but how would I pass that each date to the reminder class?</p>","264905","","1777090","","2013-02-14 05:14:08","2013-02-14 05:14:08","How to set android reminder/alarm?","<android><android-alarms>","2","2","","",""
"2189569","1","2205392","","2010-02-03 03:54:29","2","817","<p>how to get macid and mobile number only  in android mobile device  not in database</p>","254790","","","","","2010-02-05 06:24:02","how to get macid and mobile number only in android mobile device not in database","<android>","1","0","2","",""
"2189875","1","2194540","","2010-02-03 05:19:46","11","4846","<p>I started reading on OAuth this morning; need suggestions(links et al.) that will help answer the following questions:<br>1. How to implement 3 legged Authentication using OAuth on Android devices? Is there a library that assists in the aforementioned?<br>2. What does it mean when someone says: ""Site/Service ABC supports OAuth""?  </p><p>Thanks!</p>","236128","","","","","2011-02-11 07:18:54","Some questions about OAuth and Android","<android><authorization><oauth>","1","0","12","",""
"2189956","1","2197799","","2010-02-03 05:45:58","1","566","<p>how to get MacID  of mobiledevice in android?</p>","217065","","","","","2010-02-04 06:34:02","how to get MacID of mobiledevice in android?","<android>","1","1","","",""
"2189986","1","2190839","","2010-02-03 05:55:44","15","28971","<p>I want to build the following layout but it is not working.</p><p><img src=""http://toms-toy.de/rowspan.gif"" alt=""alt text""></p><pre><code>&lt;LinearLayout android:orientation=""horizontal""...&gt;  &lt;ImageView ...&gt;&lt;/ImageView&gt;        &lt;TableLayout ...&gt;                        &lt;TableRow..&gt;                              &lt;ImageView ...&gt;&lt;/ImageView&gt;                              &lt;ImageView ...&gt;&lt;/ImageView&gt;                              &lt;ImageView ...&gt;&lt;/ImageView&gt;                        &lt;/TableRow&gt;                         &lt;TableRow..&gt;                              &lt;ImageView ...&gt;&lt;/ImageView&gt;                              &lt;ImageView ...&gt;&lt;/ImageView&gt;                              &lt;ImageView ...&gt;&lt;/ImageView&gt;                        &lt;/TableRow&gt;       &lt;/TableLayout&gt;  &lt;ImageView ...&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre>","216431","","15825","","2010-05-04 13:08:45","2011-11-21 22:09:50","android table layout rowspan","<android><tablelayout><html-table>","3","0","6","",""
"2190126","1","2190184","","2010-02-03 06:31:28","24","7501","<p>I need to know when the user powers off his/her phone.  Are there any broadcasts (or similar) that notify when the user's phone is powered off?</p>","265023","","267702","","2013-06-18 22:37:16","2014-01-09 10:16:02","Is there any way to receive a notification of when a user powers off his/her Android phone?","<android><broadcastreceiver>","3","3","16","",""
"2190346","1","","","2010-02-03 07:32:41","1","1986","<p>I am trying to get my environment setup to develop an android app so I downloaded the SDK (http://developer.android.com/sdk/installing.html).After unpacking the files and running the SDK Setup.exe, the Android SDK and AVD manager opens up.During the installation process, I got an error stating the following:</p><blockquote>  <p>Failed to fetch URL <a href=""https://dl-ssl.google.com/android/repository/repository.xml"" rel=""nofollow"">https://dl-ssl.google.com/android/repository/repository.xml</a>, reason: HTTPS SSL error. You might want to force download through HTTP in the settings.</p></blockquote><p>So then I proceed to the SETTINGS tab and activated the check box which states:</p><blockquote>  <p>Force https://... sources to be fetched using http://</p></blockquote><p>Then click save and apply.  A box flashes on screen, which appears to be the previous box which showed the error, except this time, the progress bar races from 0 to 100% in about a second and then disappears.  So clicking the FORCE option seemed to have worked for that issue.</p><p>Now, I click on the AVAILABLE PACKAGES tab which is where the Android manager actually downloads all the available resources including every ""SDK Platform Android Vx.x"" and every ""Google API by Google Inc., API x, revision x""</p><p>There are green check marks in every check box indicating that I need to download every update.SO I click INSTALL SELECTED.</p><p>The confirmation page comes up.  Again, I click INSTALL ACCEPTED.</p><p>The INSTALLATION ARCHIVES box pops up and this is where I get stuck.  I receive the following errors and I'm not sure what to do from here..</p><blockquote>  <p>Downloading Documentation for Android SDK, API 7, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading SDK Platform Android 2.1, API 7, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Skipping 'Google APIs by Google Inc., Android API 7, revision 1'; it depends on 'SDK  Platform Android 2.1, API 7, revision 1' which was not installed.<br>  Downloading Google APIs by Google Inc., Android API 7, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading SDK Platform Android 2.0.1, API 6, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Skipping 'Google APIs by Google Inc., Android API 6, revision 1'; it depends on 'SDK  Platform Android 2.0.1, API 6, revision 1' which was not installed.<br>  Downloading Google APIs by Google Inc., Android API 6, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading SDK Platform Android 2.0, API 5, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Skipping 'Google APIs by Google Inc., Android API 5, revision 1'; it depends on 'SDK Platform Android 2.0, API 5, revision 1' which was not installed.<br>  Downloading Google APIs by Google Inc., Android API 5, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading SDK Platform Android 1.6, API 4, revision 2<br>  No buffer space available (maximum connections reached?): recv failed<br>  Skipping 'Google APIs by Google Inc., Android API 4, revision 2'; it depends on 'SDK  Platform Android 1.6, API 4, revision 2' which was not installed.<br>  Downloading Google APIs by Google Inc., Android API 4, revision 2<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading SDK Platform Android 1.5, API 3, revision 3<br>  No buffer space available (maximum connections reached?): recv failed<br>  Skipping 'Google APIs by Google Inc., Android API 3, revision 3'; it depends on 'SDK  Platform Android 1.5, API 3, revision 3' which was not installed.<br>  Downloading Google APIs by Google Inc., Android API 3, revision 3<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading SDK Platform Android 1.1, API 2, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading Usb Driver package, revision 3<br>  No buffer space available (maximum connections reached?): recv failed  </p></blockquote><p>I did some googling on ""No buffer space available (maximum connections reached?)"" and apparently it is a socket issue that typically occurs when a database query is called and there are a large number of TCP connections.</p><p>But beyond that I'm completely stuck.  Can't find anything on my issue relating to Android SDK installation and I don't really know where to turn to continue with the SDK installation.</p><p>Thank you in advance!</p><hr><p>Anyone familiar with installing the Android sdk, is there an alternative way of downloading the SDK components OTHER then using the Android SDK management utility??</p><p>Obviously something about my system isn't playing nicely with this manager but I'm completely stuck here and really want to get going..</p><p>Thanks again..</p><p>[Screenshots]Available packages for download:<a href=""http://i45.tinypic.com/9igs48.jpg"" rel=""nofollow"">http://i45.tinypic.com/9igs48.jpg</a></p><p>--</p><p>Installation errors:<a href=""http://i50.tinypic.com/260fxox.jpg"" rel=""nofollow"">http://i50.tinypic.com/260fxox.jpg</a></p>","257863","","1288","","2011-08-16 15:54:37","2011-08-16 15:54:37","Android SDK installation error - ""no buffer space available (maximum connections reached?): recv failed","<sockets><android><installation><buffer-overflow><connections>","0","3","","",""
"2190704","1","2211601","","2010-02-03 08:54:22","3","9256","<p>I have a layout with an image on it (embedded in an ImageView). I need to rotate the image (let's say) 90 degrees CCW.</p><p>I've written code to animate the image rotating...:</p><pre><code>public class MainActivity extends Activity{    private ImageView mImageView = null;    private Animation mRotateAnimation = null;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mImageView = (ImageView) findViewById(R.id.my_image);        mRotateAnimation = AnimationUtils.loadAnimation(this, R.anim.my_rotate_90);    }    @Override    public boolean onTouchEvent(MotionEvent event) {        if (event.getAction() == MotionEvent.ACTION_DOWN) {            mImageView.startAnimation(mRotateAnimation);            return true;        }        return super.onTouchEvent(event);    }}</code></pre><p>The image smoothly rotates 90 degrees, but then snaps back to its original state. This is what the Android documentation says will happen after an animation completes. Presumably, on the notification that the animation has ended, I'm supposed to transform the ImageView (or the underlying drawable), and possibly invalidate it to trigger a redraw.</p><p>All well and good, except that <strong>I can't find a way to do it, and I can't find any examples of anyone else doing it</strong>.</p><p>I tried using <code>getImageMatix</code>/<code>setImageMatrix</code> on <code>mImageView</code>, with no apparent effect. There are subclasses of Drawable that will rotate an image, but there is no setDrawable() method on ImageView, so I don't see how to use one.</p><p>I searched the examples; though a few of them involve animation and rotation (notably LunarLander), none of them are animating an ImageView, and then leaving it in some transformed state.</p><p>Surely I'm missing something simple here... aaaargh, how do you rotate an ImageView within a layout?</p><p>Thanks.</p>","264540","","264540","","2010-02-06 00:44:39","2012-05-22 05:26:13","Rotating an ImageView within a Layout... how?","<android>","1","1","","",""
"2190824","1","2191137","","2010-02-03 09:18:46","2","852","<p>I am able to show the route between two geo points in android using google map. Now i want to know how to guide the user like turn right, take left; likewise should display message. How can we achieve this?</p>","132724","","338479","","2013-05-21 20:17:42","2013-05-21 20:17:42","How to display route information between two points in Android?","<android><navigation>","1","0","","",""
"2191040","1","","","2010-02-03 09:53:42","0","9168","<p>I am developing an application which uses KSOAP2 with Android 2.0. I am getting this error:</p><blockquote>  <p>""org.xmlpull.v1.XmlPullParserException: expected: START_TAG"" </p></blockquote><p>Can anyone tell me why this is happening?</p>","265147","","866022","","2012-05-15 18:45:08","2012-06-13 11:06:50","""org.xmlpull.v1.XmlPullParserException: expected: START_TAG""","<android>","3","0","","",""
"2191052","1","2219859","","2010-02-03 09:55:24","0","1137","<p>I am working on a module that should be able to create, read and write to Excel files.Is there a (recommended?) lightweight Java library for working with excel file that can run on Android?</p><p>Suggestions are welcome.</p><p>Thanks.</p>","236128","","","","","2014-04-14 03:58:29","Working with Excel files on Android","<android><excel>","1","0","1","",""
"2191162","1","","","2010-02-03 10:17:32","2","256","<p>Hey,I am relatively new to Android. I am working on an application whereini want to display digital signals. But the problem is once I occupythe available screen width how to i add a scrolling feature tocontinue viewing the signal. Also i am drawing the signal using usingdrawLine(), so what co-ordinates should i set for drawing the lineswhen scrolling is enabled? Can somebody please give a simple examplewhere a line extends more than the available screen width and you canscroll through to see the remaining line.Thanx in advance. </p>","250822","","","","","2010-02-22 07:55:13","Horizontal scroll problem","<android><layout><scrolling>","1","0","","",""
"2191253","1","","","2010-02-03 10:35:47","1","756","<p>When my application is in landscape mode and I selected an edittext, it is edited in full screen mode. Yet I force activity to Pan and Scan adding android:windowSoftInputMode=""adjustPan"" as an attribute to the Activity element in my xml layout.</p>","164460","","","","","2010-02-03 10:35:47","android pan scan mode","<android><edittext>","0","0","","",""
"2191255","1","2191805","","2010-02-03 10:36:01","1","4304","<p>I want to create the following layout which should be 100% in landscape form as displaying in portrait form.</p><p><img src=""http://www.freeimagehosting.net/uploads/b12bb68569.png"" alt=""alt text""></p><p>here is my code which i tried but not working</p><pre><code>&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:stretchColumns=""0""&gt;&lt;TableRow&gt;    &lt;TableLayout android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;        &lt;TableRow&gt;            &lt;TableLayout android:layout_width=""wrap_content""                android:layout_height=""wrap_content"" android:orientation=""horizontal""&gt;                &lt;TableRow&gt;                    &lt;TextView android:id=""@+id/reviewItemEntityName""                        android:layout_height=""wrap_content"" android:text=""12345""                        android:textColor=""@color/maroon"" /&gt;                    &lt;ImageView android:id=""@+id/reviewItemStarRating""                        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                        android:src=""@drawable/title_1_star"" /&gt;                &lt;/TableRow&gt;            &lt;/TableLayout&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;TextView android:id=""@+id/reviewItemDescription""                android:layout_width=""0dip"" android:layout_height=""wrap_content""                android:text=""Description comes here"" android:textSize=""12sp"" /&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;    &lt;ImageView android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:src=""@drawable/arrow_nxt""        android:layout_gravity=""center_vertical""        android:layout_alignParentRight=""true"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","216431","","","","","2010-02-03 12:31:46","android table layout one for both (landscape and portrait view)","<android><tablelayout>","1","0","","",""
"2191338","1","","","2010-02-03 10:56:07","3","2566","<p>I am trying to make ImageButton for state of pressed, focused and normal. I've read introduction of ImageButton <a href=""http://developer.android.com/reference/android/widget/ImageButton.html"" rel=""nofollow"">here</a></p><p>I've saved selector XML file in /res/drawable/. Also set the <code>android:src=""@drawable/my_selector""</code>. </p><p>my_selector.xml file :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:drawable=""@drawable/btn_unfocus"" /&gt; &lt;!-- default --&gt;    &lt;item android:state_pressed=""true""          android:drawable=""@drawable/btn_onpress"" /&gt; &lt;!-- pressed --&gt;    &lt;item android:state_focused=""true""          android:drawable=""@drawable/btn_onfocus"" /&gt; &lt;!-- focused --&gt;&lt;/selector&gt;</code></pre><p>I think I've done correct ImageButton. But it didn't work for me.</p><p>What is wrong here ?</p><p>Please advice.</p>","227889","","1225413","","2012-12-07 04:12:45","2014-01-09 12:15:58","ImageButton selector doesn't work?","<android><imagebutton>","2","1","1","",""
"2191407","1","","","2010-02-03 11:11:04","17","14040","<p>I have a very simple application with one ImageView and a Button. The first Drawable resource loaded by my <strong>ImageView</strong> is specified with the ""android:src"" tag in the XML Layout, however at runtime i want to <strong>change the picture displayed by it</strong>. To do so i start an Activity for result to pick an image from the sd card (intent sent to MediaStore.Images.Media.EXTERNAL_CONTENT_URI). However when the picture is selected, i try to update the ImageView with the chosen Picture's URI but i get the message ""<strong>java.lang.OutOfMemoryError: bitmap size exceeds VM budget</strong>""</p><p>I'am trying to load pictures taken with the camera (pics size are around 1.1M) of my HTC-Hero but no success, seems to work only with pictures that are less than 500KB.However i need to load pictures taken with the camera. <strong>How can i solve this?</strong> what am I doing wrong. Seem to me that the code is very simple and should work.</p><pre><code>public void onClick(View v){ Intent selectImageIntent=new Intent(Intent.ACTION_PICK ,    android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);   startActivityForResult(selectImageIntent,1);}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data){ super.onActivityResult(requestCode, resultCode, data); if(resultCode==Activity.RESULT_OK){   Uri selectedImageUri = data.getData();   Log.i(TAG,""chosen image: ""+selectedImageUri.toString());   ImageView imageView = (ImageView) this.findViewById(R.id.ImageView01);   imageView.setImageURI(selectedImageUri);//here I get the OutOfMemoryError   imageView.invalidate(); }else{  //canceled }}</code></pre><p>p.s. that is the only thing the App should do, I'm not creating other objects so I will like to point out that I am not using heap space for other stuff besides displaying the image.</p>","265169","","","","","2013-12-20 12:08:26","Changing ImageView content causes OutOfMemoryError","<android><android-widget>","4","0","5","",""
"2191408","1","2254086","","2010-02-03 11:11:15","1","4703","<p>I have few audio files:</p><ul><li>f_1 - length 10 sec</li><li>f_2 - length 3  sec</li><li>f_3 - length 1  sec</li></ul><p>What I need is to find a way to mix(merge) f2 and f3 at particular section in f_1 (i.e. position which is equal to 6 sec)</p><p>I was looking at Audio examples but they don't help me much so any ideas\references\ documentation that might help?</p><p>Many Thanks!</p>","116622","","","","","2010-02-13 00:50:51","Mixing Audio Files","<android><documentation><audio><reference><mixing>","2","10","0","",""
"2191634","1","2202947","","2010-02-03 11:54:44","4","621","<p>Is there a way to force all my network requests to be made through my APN (i.e. over a mobile network data connection) and not through wifi, without having to disable wifi?</p><p>I want to know if it is possible for my Android app to use exclusively the network access point.  </p><p>I'm already able to set the default network APN and to use it but for this I have to disable the Wifi first.</p>","243376","","234938","","2013-05-07 13:50:29","2013-05-07 13:50:29","Route network requests only over mobile data connection","<android><wifi><apn>","1","0","1","",""
"2191690","1","2192211","","2010-02-03 12:07:14","7","632","<p>I am making an app for Android, in my Activity I need to load an array of about 10000 strings. Loading it from database was slow, so I decided to put it directly into one .java file (as a private field). I have about 20 of these classes containing string arrays and my question is, are all the classes loaded into memory after my application is started? If so the Activity in which I need these strings would be loaded quickly, but the application as a whole would have a slow start...Is there other way, how to very quickly load an 10000 string array from a file?</p><p><strong>UPDATE:</strong>Why I need these strings? My Android app allows you to find ""journeys"" in Prague's public transit - you choose departure stop, arrival stop and it finds your journey (have a look <a href=""http://www.androlib.com/android.application.cz-fhejl-pubtran-wwAq.aspx"" rel=""nofollow"">here</a>). My app has a suggestions feature - you enter leter ""c"" as your departure stop and a suggestions ListView appears with stops starting with ""c"". For these suggestions I need the strings. Fetching the suggestions from database is slow (about 400ms on G1).</p>","243225","","243225","","2010-02-03 12:49:41","2011-07-21 17:03:25","Are all .class files in my Java application loaded into memory after appliaction start?","<java><android>","4","4","1","",""
"2192082","1","2193727","","2010-02-03 13:17:40","9","12492","<p>I'm quite new to Android development (started 2 days ago) and have been through a number of tutorials already.  I'm building a test app from the NotePad exercise (<a href=""http://developer.android.com/resources/tutorials/notepad/index.html"">Link to tutorial</a>) in the Android SDK and as part of the list of notes I want to display a different image depending on the contents of a database field i've called ""notetype"".  I'd like this image to appear in the List view before each notepad entry.</p><p>The code in my .java file is:</p><pre><code>private void fillData() {    Cursor notesCursor = mDbHelper.fetchAllNotes();    notesCursor = mDbHelper.fetchAllNotes();    startManagingCursor(notesCursor);    String[] from = new String[]{NotesDbAdapter.KEY_NOTENAME, NotesDbAdapter.KEY_NOTETYPE};    int[] to = new int[]{R.id.note_name, R.id.note_type};    // Now create a simple cursor adapter and set it to display    SimpleCursorAdapter notes =             new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, from, to);    setListAdapter(notes);}</code></pre><p>And my layout xml file (notes_row.xml) looks like this:</p><pre><code>&lt;ImageView android:id=""@+id/note_type""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:src=""@drawable/default_note""/&gt;&lt;TextView android:id=""@+id/note_name""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""/&gt;</code></pre><p>I just really have no clue how I'd go about fetching the right drawable depending on the type of note that has been selected.  At the moment I have the ability to select the type from a Spinner, so what gets stored in the database is an integer.  I've created some images that correspond to these integers but it doesn't seem to pick things up.</p><p>Any help would be appreciated.  If you need more info then please let me know.</p>","265268","","","","","2010-05-05 13:19:24","Android: Changing an ImageView src depending on database field data","<android>","1","0","16","",""
"2192120","1","2192379","","2010-02-03 13:23:08","5","7205","<p>I currently use the AudioTrack and AudioRecord classes in Android.</p><p>I use the pure PCM data but I was wondering what my options are for other codecs?</p><p>From <a href=""http://developer.android.com/intl/fr/guide/appendix/media-formats.html"" rel=""nofollow""><strong>this page</strong></a> it seems I can only encode and decode using AMR narrowband?</p><p>I currently set up the Audio classes as follows:</p><pre><code>arec = new AudioRecord(MediaRecorder.AudioSource.MIC,                     11025,                     AudioFormat.CHANNEL_CONFIGURATION_MONO,                     AudioFormat.ENCODING_PCM_16BIT,                     buffersize);atrack = new AudioTrack(AudioManager.STREAM_VOICE_CALL,                     11025,                     AudioFormat.CHANNEL_CONFIGURATION_MONO,                     AudioFormat.ENCODING_PCM_16BIT,                     buffersize,                     AudioTrack.MODE_STREAM);</code></pre><p>So my question is how do I change the encoding from PCM to one of the other supported codecs?</p><p>When I try to change ENCODING_PCM_16BIT on AudioFormat I only get the options of default or invalid encoding along with the PCM options.</p><p>Any links to tutorials on encoding and decoding audio on Android would be great if anyone knows of any or any help here greatly appreciated.</p><p>Thanks</p><p><strong>EDIT:</strong> I have changed my code to the following:</p><pre><code>arec = new AudioRecord(MediaRecorder.AudioSource.MIC,                     11025,                     AudioFormat.CHANNEL_CONFIGURATION_MONO,                     **MediaRecorder.AudioEncoder.AMR_NB**,                     buffersize);atrack = new AudioTrack(AudioManager.STREAM_VOICE_CALL,                     11025,                     AudioFormat.CHANNEL_CONFIGURATION_MONO,                     **MediaRecorder.AudioEncoder.AMR_NB**,                     buffersize,                     AudioTrack.MODE_STREAM);</code></pre><p>The code runs properly but I'm wondering does it actually encode the Audio as AMR_NB and if this is not a proper way to do it?</p><p>I was getting a buffer overflow when using raw PCM but none have appeared since using the new code with the MediaRecorder.AudioEncoder.AMR_NB used instead of the AudioFormat.PCM</p>","243999","","243999","","2010-02-03 16:12:34","2010-10-28 10:44:47","Android AudioRecord and AudioTrack codec options?","<android><audio><pcm><codec><amr>","1","1","2","",""
"2192403","1","","","2010-02-03 14:01:40","1","794","<p>is there a way to create a tableview in which acell may span over more than one row. As the two ""X"" here?</p><pre><code>1 2 3 4 52 1 X 1 21 2 X 4 5</code></pre>","265315","","","","","2010-03-26 07:00:05","How to I make TableView Cells spanning over multiple rows?","<android><layout><tableview>","1","1","","",""
"2192419","1","2192833","","2010-02-03 14:05:13","0","960","<p>My application has a button that sends the user to the locale setting.I do this with this code:</p><pre><code>startActivity(new Intent(android.provider.Settings.ACTION_INPUT_METHOD_SETTINGS));</code></pre><p>This works fine with some devices, but with the HTC Hero I get:</p><pre><code>02-03 13:59:27.501: INFO/ActivityManager(69): Starting activity: Intent { action=android.settings.INPUT_METHOD_SETTINGS flags=0x10000000 }02-03 13:59:27.531: DEBUG/AndroidRuntime(1916): Shutting down VM02-03 13:59:27.531: WARN/dalvikvm(1916): threadid=3: thread exiting with uncaught exception (group=0x40013140)02-03 13:59:27.531: ERROR/AndroidRuntime(1916): Uncaught handler: thread main exiting due to uncaught exception02-03 13:59:27.611: ERROR/AndroidRuntime(1916): android.content.ActivityNotFoundException: No Activity found to handle Intent { action=android.settings.INPUT_METHOD_SETTINGS flags=0x10000000 }02-03 13:59:27.611: ERROR/AndroidRuntime(1916):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1529)02-03 13:59:27.611: ERROR/AndroidRuntime(1916):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1499)02-03 13:59:27.611: ERROR/AndroidRuntime(1916):     at android.app.Activity.startActivityForResult(Activity.java:2669)02-03 13:59:27.611: ERROR/AndroidRuntime(1916):     at android.app.Activity.startActivity(Activity.java:2713)</code></pre><p>EDIT:SOLUTION!</p><pre><code>Intent intent = new Intent();intent.setAction(Intent.ACTION_MAIN);ComponentName com = new ComponentName(""com.android.settings"", ""com.android.settings.LanguageSettings"");intent.setComponent(com); startActivity(intent);</code></pre><p>The previous code will work on every device :)</p>","119895","","119895","","2010-02-04 23:03:17","2010-02-04 23:03:17","android.settings.INPUT_METHOD_SETTINGS doesn't work with HTC hero","<android><htc-hero>","1","0","","",""
"2192699","1","2197434","","2010-02-03 14:42:19","4","6262","<p>I have tried to find a way to disable the PatternLock screen temporarily. I don't want the lock to be disabled completely, but the user should not need to re-enter his pattern all the time.</p><p>My idea is to write a service which disables the pattern after some user activity and re-enables it after a while. (and even more)</p><p>There are apps on the market that do something like that (i.e. AutoLock or TogglePattern), so there must be a solution.</p><p>I know that I can prevent a lock completely by using:</p><pre><code>getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)</code></pre><p>or </p><pre><code>KeyguardLock.disableKeyguard()</code></pre><p>But that is not what I'm after.</p><p>I saw the class <code>com.android.internal.widget.LockPatternUtils</code> in the android sources which is used by the settings activity, but this class is not (at least as far as I know) accessible by a ""normal"" application. </p><p>Do you have any suggestions?</p>","265320","","151019","","2012-05-28 11:16:06","2013-06-17 10:16:34","Enable or disable the PatternLock screen from code","<android><design-patterns><lockscreen>","2","0","7","",""
"2192965","1","2193136","","2010-02-03 15:17:28","6","1963","<p>I would like to use EditTextPreference to show 2 input fields instead of 1. For instance, a username and password field should be shown. I don't want to use a dialog for each one. How can this be done? In the WiFi settings there is one that does this, when you want connect to a  protected network, a dialog shows to set a password for the credential storage with 2 fields.</p>","265375","","","","","2010-02-03 15:47:21","Using EditTextPreference with 2 user input fields","<android>","1","0","2","",""
"2193457","1","5789916","","2010-02-03 16:21:57","25","14699","<p>I need to know exactly how big the screen is on the device in real units of length so I can calculate the acceleration due to gravity in pixels per millisecond.</p><p>Is there a method somewhere in the Android API for this?</p>","88905","","88905","","2010-02-10 04:32:36","2014-04-19 22:22:52","Is there a way to determine android physical screen height in cm or inches?","<android><screen><resolution><inches>","4","0","16","",""
"2193458","1","2193841","","2010-02-03 16:21:59","7","1593","<p>If I have a large project with many resources, is there anyway to organise them using directories?  I tired adding directories to drawable/ but it didn't work.</p>","248521","","958370","","2012-02-04 17:23:34","2012-03-07 20:05:30","Adding directories to resources folders in Android","<android><android-resources>","1","1","1","",""
"2193664","1","2193764","","2010-02-03 16:52:00","6","1001","<p>When an Android phone receives a call it automatically checks if the call exists in its own contact database. I was wondering if there is a simple way to access that information. I have a <code>PhoneStateListener</code> that performs certain actions during a ringing state, and I want to check if the incoming caller is in the contacts list.</p><p>Is there a way to do this without going through the Contacts <code>ContentProvider</code>?</p>","265455","","166712","","2010-02-03 16:54:40","2010-07-24 09:00:24","Is there a simple way to check if an incoming caller is a contact in Android?","<android><contacts><telephony>","2","3","3","",""
"2193700","1","","","2010-02-03 16:57:48","5","3882","<p>I am new to Android, and I'm struggling to figure out exactly what tools are available to me.I am developing for Android 2.0.1 for now, just because that is what my device runs.</p><p>Specifically, I am writing an app that I would like to upload images to a <a href=""http://en.wikipedia.org/wiki/Picasa"" rel=""nofollow"">Picasa</a> album.  I am almost sure this is supported; for example, the built in (Google?) photo viewer has a 'share' button with a Picasa option, and even a small bit of sample code, including the snippet</p><p><em>[borrowed code! apologies if this is against the rules..]</em></p><pre><code>temp.setComponent(new ComponentName (""com.google.android.apps.uploader"", ""com.google.android.apps.uploader.picasa.PicasaUploadActivity"")); startActivityForResult(temp, PICASA_INTENT) </code></pre><p>which looks like exactly what I want.</p><p>But I can't find any documentation anywhere.  I am in fact quite unclear how to use this type of resource.  From within Eclipse, do I need to include another project, <code>com.google.android.apps.uploader</code>? If so, how do I get it? How do I include it? Is there any working sample code provided for me to peek at?  </p>","","user265447","63550","","2011-06-17 09:15:59","2011-06-17 09:15:59","Picasa access in android: PicasaUploadActivity","<android><picasa><uploader>","2","0","6","",""
"2193716","1","2196413","","2010-02-03 16:59:51","1","413","<p>I want to set up a BroadcastReceiver to handle PACKAGE_REPLACED, but I only want to be notified when my package is replaced.  It works fine if I specify a data tag with scheme=""package"" but then I get notified when any application is reinstalled or upgraded.  I can't figure out how I'm supposed to specify the package name which is in the scheme specific part -- that is, when my BroadcastReceiver gets the intent in onRecieve(), if I do intent.getData().getSchemeSpecificPart(), that's the package name, but is there any way I can filter for only that in my intent-filter?</p>","263664","","","","","2013-01-25 09:13:59","How can I specify the scheme specific part in a data tag for an intent-filter?","<android><broadcastreceiver><intentfilter>","2","0","","",""
"2194672","1","2194721","","2010-02-03 19:08:13","6","7122","<p>I have a LinearLayout, which only contains one button. I want this button to be centered vertically and aligned to the right. I tried many ways, but I couldn't make this button centered vertically. It is always aligned to the top. I also tried to put a button in RelativeLayout, the button can not be centered vertically either. </p><p>The XML is as below. Is there anything wrong with this layout? Thanks.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:background=""#E8E3E4""&gt;    &lt;Button         android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:text=""More"" android:layout_gravity=""right"" /&gt;&lt;/LinearLayout&gt;</code></pre><hr><p>Changing android:layout_gravity=""right"" to android:layout_gravity=""right|center_vertical"" didn't resolve the problem in my question. </p>","256239","","1288","","2012-05-01 13:06:42","2012-05-01 13:06:42","Why button is not centered vertically in LinearLayout?","<android>","3","0","1","",""
"2194808","1","2196397","","2010-02-03 19:26:15","1219","205757","<p>I am using Eclipse Android plugins to build a project, but I amgetting this error in the console window:</p><blockquote>  <p>[2010-02-03 10:31:14 - androidVNC]Error generating final archive:<br/><br/>     Debug certificate expired on 1/30/10 2:35 PM!</p></blockquote><p>How do I fix it?</p>","128983","","654870","","2012-08-01 03:53:45","2014-03-19 07:01:27","""Debug certificate expired"" error in Eclipse Android plugins","<android><eclipse><certificate>","15","2","214","",""
"2194834","1","","","2010-02-03 19:31:32","5","1971","<p>I am doing a little experiment with OpenGL ES on Nexus One. Got a problem about the full screen resolution. It seems like I can never get the real full resolution of Nexus One, which is 480*800. I am using an orthogonal projection and just want to draw a simple triangle with identity model view matrix: </p><pre><code>@Override public void sizeChanged(GL10 gl, int width, int height) {      /*       * Set our projection matrix. This doesn't have to be done       * each time we draw, but usually a new projection needs to       * be set when the viewport is resized.       */               gl.glViewport( 0, 0, width, height);      gl.glMatrixMode(GL10.GL_PROJECTION);      gl.glLoadIdentity();                GLU.gluOrtho2D(gl, 0, width, 0, height);                          } </code></pre><p>The coordinates for the triangle are: </p><pre><code>float[] coords = {            // X, Y, Z            0.0f, 0.0f, 0,            200.0f, 200.0f, 0,            100.0f, 0.0f, 0,    }; </code></pre><p>And I get the result below:</p><p><img src=""http://www.anddev.org/files/device_184.png"" alt=""alt text""></p><p>This result is same on emulator (480*800 res) and Nexus 1. Obviously I didn’t get the full resolution (because the top vertex of the triangle is already close to the right edge, if width is real 480, this should be on the left of the half width). Another strangeness is that in sizeChanged (I am using GLSurfaceView, this is the override method in the renderer required by GLSurfaceView), I always get width = 480 and height = 800 no matter whether I start the app in full screen mode. I was expecting that with app title bar and status bar, the size passed to sizeChanged should be smaller right? I mean if the size passed to this method isn’t the real size I am getting, then how can I setup a correct viewport?</p><p>I also did a quick implementation using GLUT on Windows with the same setup and draw the exact same triangle. I get the result below, which is the expected result. Anyone can help me figure out how to get this same result on the phone? </p><p><img src=""http://www.anddev.org/files/glut_on_win_137.png"" alt=""alt text""></p><p>I have already put </p><pre><code>&lt;supports-screensandroid:largeScreens=""true""android:normalScreens=""true""android:smallScreens=""true""android:anyDensity=""true""/&gt;</code></pre><p>tag in AndroidManifest.xml. In particular, I found that it seems like only android:anyDensity=""true""|”false” matters, as this does change the rendered result. Others don’t change the result at all. Also my project is on SDK 1.6, which is recommended for developing apps that support larger phone screen.</p><p>The original question is also asked here: <a href=""http://www.anddev.org/viewtopic.php?p=34832#34832"" rel=""nofollow"">http://www.anddev.org/viewtopic.php?p=34832#34832</a></p>","265576","","265576","","2010-02-03 21:37:47","2010-02-05 04:09:21","Never got full 480*800 when using 2D orthogonal projection in opengl-es","<android><opengl-es>","4","0","2","",""
"2195264","1","2204065","","2010-02-03 20:38:22","3","13547","<p>I am dealing with a problem discussed on many forums but they all say go to the ""settings"" menu on the ""Android SDK and AVD Manager"" screen.  Yet I have installed in on multiple machines and do not see a Settings menu.   Where is the menu?   I have it installed on Windows XP and Vista.</p><p>ThanxJulian</p>","250161","","","","","2013-11-15 15:05:44","Android SDK and AVD Manager where is Settings menu?","<android><android-emulator>","4","1","","",""
"2195329","1","2195357","","2010-02-03 20:47:12","10","11577","<p>I'm learning Java and writing an android app that consumes a JSON object that is passed by the server.</p><p>I have it all working except the dates. </p><p>I get one of these back</p><pre><code>'SomeKey':'\/Date(1263798000000)\/'</code></pre><p>I am using <code>org.json.JSONObject</code>.</p><p>How do i convert <code>SomeKey</code> into a <code>java.Util.Date</code>?</p>","23528","","","","","2011-11-21 10:45:45","JSON `date(...)` to `java.Util.Date` using `org.json`","<java><android><json>","3","0","2","",""
"2195497","1","2196518","","2010-02-03 21:13:51","4","7216","<p>I'm using the following code to create a <a href=""http://developer.android.com/reference/android/app/ProgressDialog.html"" rel=""nofollow"">ProgressDialog</a> (inside my <a href=""http://developer.android.com/reference/android/app/Activity.html"" rel=""nofollow"">Activity</a>):</p><pre><code>@Overrideprotected Dialog onCreateDialog(int id) {    switch (id) {        case DIALOG_LOOKUP:            return new ProgressDialog(this, ProgressDialog.STYLE_SPINNER);    }    return null;}@Overrideprotected void onPrepareDialog(int id, Dialog dialog) {    switch (id) {        case DIALOG_LOOKUP:            dialog.setCancelable(true);            dialog.setTitle(R.string.dialogLookup_title);            ((ProgressDialog)dialog).setMessage(getResources().getString(R.string.dialogLookup_message));            dialog.setOnCancelListener(new OnCancelListener() {                @Override                public void onCancel(DialogInterface dialog) {                    Toast.makeText(MyActivity.this, ""canceled"", Toast.LENGTH_SHORT).show();                }            });            break;    }}</code></pre><p>The problem is that it isn't actually setting the title and is putting it in some weird double-box.</p><p>It's giving me this:</p><p><img src=""http://imgur.com/6cYrS.png"" alt=""bad progress""></p><p>but I'm expecting something more like this:</p><p><img src=""http://imgur.com/bquUB.png"" alt=""good progress""></p><p>Any ideas?</p>","76835","","76835","","2010-02-03 21:30:14","2010-02-04 01:30:22","Problem using ProgressDialog with onCreateDialog / onPrepareDialog","<android><progressdialog>","1","2","","",""
"2195575","1","2195678","","2010-02-03 21:26:04","6","4566","<p>I'm trying to do something which seems simple.  I want to have a map view, with a menu that slides up from the bottom of the screen where settings (for overlay) can be adjusted.  However when I use a TranslateAnimation to affect the y position of the LinearLayout (which holds the menu), the buttons in the LinearLayout move, but there ""hit area"" stays in the same position as they were before the animation.</p><pre><code>    TranslateAnimation slide = new TranslateAnimation(0,0,0,0); slide.setDuration(300); slide.setFillAfter(true); pullupMenu.startAnimation(slide); mapContainer.startAnimation(slide);</code></pre><p>I've also looked into tweening the view's marginTop value, but haven't even been able to determine how that would be done.</p><p>Any help on either of these directions would be much appreciated.</p>","265669","","878233","","2011-11-08 17:08:35","2012-12-05 16:15:46","Android: Animating View position","<android><android-animation>","1","1","1","",""
"2195688","1","","","2010-02-03 21:42:07","1","5596","<p>I want to buttons of different colors, but I want to do so while usingthe default button background resource in order to preserve theonfocus and onclick states.  This is because I want to use the defaulthighlight color of the OS for my app, which is NOT always orange (HTCSense makes it green).</p><p>I found that adding a color filter to the button's background drawableworks great (in this case, blue):</p><p>myButton.getBackground().setColorFilter(Color.parseColor(this.getString(R.color.button_blue)), Mode.MULTIPLY);</p><p>BUT, when the button is focused or clicked, it turns a nastyorange_blue because it mixes the color filter with the orange of thebackground drawable.</p><p>I want to ONLY set this color filter for the unfocused/unclicked nine-patch drawable within the default button's statelistdrawable.I'm not sure how else to do this.</p><p>I see a similar solution here:<a href=""http://stackoverflow.com/questions/2065430/fixed-android-detecting-fo"">http://stackoverflow.com/questions/2065430/fixed-android-detecting-fo</a>...</p><p>but I have some concerns with that solution, mainly what if the OSchanges the graphic of the default button?  Since the normal unfocused/unpressed graphic is now hardcoded into the app, it would break theflow.</p><p>Maybe can someone comment on whether it would be good or bad practiceto hardcode the default graphic into the app?  What are the chances ofthe OS completely changing the graphic?</p><p>Any help please?  Thanks very much!! </p>","264965","","","","","2013-06-08 16:59:37","Coloring Default Buttons - color filter only on unfocused state","<android><android-widget>","0","1","0","",""
"2195862","1","","","2010-02-03 22:10:19","3","1184","<p>Recorded for posterity.</p><p>I saw only a few posts around the net and all suggest to use HTTP instead of HTTPS and there were several ways to do this.  None of them discussed Windows only Linux.  Well this did not work for me and I could not find any way to get the files downloaded to my Windows Vista 64 machine.</p><p>So after much work I manually downloaded them and got them to work.   I did this by putting it on a machine that did work and reading the repository.xml file and downloading them.</p><p><a href=""https://dl-ssl.google.com/android/repository/google-apis-4_r02.zip"" rel=""nofollow"">https://dl-ssl.google.com/android/repository/google-apis-4_r02.zip</a></p><p>Unzipped it and moved the top directory into</p><p>android-sdk-windows/add-ons</p><p>and</p><p><a href=""https://dl-ssl.google.com/android/repository/android-1.6_r02-windows.zip"" rel=""nofollow"">https://dl-ssl.google.com/android/repository/android-1.6_r02-windows.zip</a></p><p>I then extracted them and renamed the top directory android-1.6 (it is at least one level below the unzipped directory) and moved it to</p><p>the platforms directory</p><p>Then rebooted my machine and it seems to work.</p><p>Hope this helps someone.</p><p>Julian</p>","250161","","","","","2012-03-04 12:05:32","Android SDK and AVD Manager, Stalls and/or never finishes","<android><android-emulator>","2","4","1","",""
"2195929","1","","","2010-02-03 22:24:06","0","693","<p>I'm running an Wikitude application which shows the point if Interest(POIs). When the application starts, I click a button to launch ARView(AUgmented Reality) and there I could see the POI images superimposedon the Live Camera images.</p><p>Now I want to change those images at frequent intervals.</p><p>I'm using :  </p><pre><code>// Need handler for callbacks to the UI thread  final Handler mHandler = new Handler();  // Create runnable for postingfinal Runnable mUpdateResults = new Runnable() {   public void run() {       updateResultsInUi();   }};protected void startLongRunningOperation() {   // Fire off a thread to do some work   Thread t = new Thread() {       public void run() {           Pi.computePi(800).toString(); //Do something for a while           mHandler.post(mUpdateResults); //then update image       }   };   t.start();}</code></pre><p>But nothing is working. I'm sure I'm doing some mistake...</p><p>Thanking you all in advance.</p>","265713","","1288","","2011-09-28 11:13:07","2011-09-28 11:13:07","How to replace POI images in the ARView","<android><image><manipulation><point-of-interest>","2","0","","",""
"2196203","1","2198290","","2010-02-03 23:05:54","7","1507","<p>If I override my main Activity's onDestroy() method in order to recycle a bitmap when the screen is rotated, should I call super.onDestroy() before or after myBitmap.recycle()? Does it matter?</p>","250845","","194894","","2011-09-03 10:13:01","2011-09-03 10:13:01","Android: Order of statements in onDestroy() method","<android><ondestroy>","1","0","","",""
"2196426","1","2196672","","2010-02-03 23:57:00","6","24596","<p>I'm attempting to make a dynamic drop down that will be filled by a SQLite table.  I have a Cursor object which I can pull the data I need from.  I've been able to accomplish loading the values into the drop down with the code below:</p><pre><code>Spinner s = (Spinner) findViewById(R.id.spinner);    ArrayAdapter adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    s.setAdapter(adapter);    try{        Cursor cursor = getAccounts();        int accountnameIndex = cursor.getColumnIndexOrThrow(ACCOUNT_NAME);        if(cursor.moveToFirst()){            do{                adapter.add(cursor.getString(accountnameIndex));            } while(cursor.moveToNext());        }    } finally {        MintLink.close();    }</code></pre><p>My problem is that I need the a selection from the drop down to also contain the RowID of the item selected.  I need to be able to select one item and have access to the value of that item in the back end. For example, think of a drop down in HTML.  Each drop down selection has it's own hidden value that is pulled.  I need this value to be hidden for me to allow me to know which ID they choose.</p>","246639","","","","","2014-04-03 06:38:50","Populating Spinner From SQLite Database Android","<database><android><sqlite><spinner>","4","1","3","",""
"2196499","1","","","2010-02-04 00:14:49","4","4508","<p>I want to display an ordered list inside a TextView, for example:<br> 1) item 1<br> 2) item 2  </p><p>Using the following layout:</p><pre><code>&lt;TextView    android:text=""&lt;ol&gt;&lt;li&gt;item 1\n&lt;/li&gt;&lt;li&gt;item 2\n&lt;/li&gt;&lt;/ol&gt;    /&gt;</code></pre><p>I get:  </p><ul><li>item 1</li><li>item 2</li></ul><p>How can I change the bullets to numbers?</p><p>Thanks.</p>","265792","","","","","2013-06-18 22:01:01","Ordered lists inside an Android TextView","<android><list><textview>","3","0","","",""
"2196582","1","2198342","","2010-02-04 00:35:52","6","15441","<p>What exactly does Clear User Data do? I mean I know it clears the users data from the app, but what data being stored where?</p>","117691","","1777090","","2013-02-14 05:19:59","2013-02-14 05:19:59","""Clear User Data"" android","<android>","2","2","2","",""
"2196624","1","2196986","","2010-02-04 00:49:15","4","9153","<p>I never got this working in a straightforward manner. Sorry if I'm being a little vague. I'll try to elaborate on what I'm trying to do. I am trying to build a listview that grabs its data from a webservice. Once I initialize a listview, I want to keep polling the webserver periodically and update the contents of the listview. For this I am doing something like this:</p><pre><code>public class SampleAutoUpdateList extends Activity {     //Autoupdate handler     private Handler handler = new Handler();     private Runnable updater = new Runnable() {     public void run() {       /*        * Update the list         */       try {          Log.i(""UPDATE"", ""Handler called"");          searchAdapter = getFeed(URL);          searchAdapter.notifyDataSetChanged();          handler.postDelayed(this, Configuration.REFRESH_INTERVAL);       } catch(Exception e) {          Log.e(""UPDATE ERROR"", e.getMessage());       }      }     };     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.linearmode);      this.context = this;      searchAdapter = getFeed(URL);      LinearLayout l2 = (LinearLayout) findViewById(R.id.secondaryLayout);      ListView list = new ListView(context);      l2.addView(list);      // display UI      UpdateDisplay(list);      updater.run();     }     private SearchAdapter getFeed(String URL) {        try        {            SearchHandler handler = new SearchHandler();            URL url = new URL(URL);            String data = convertStreamToString(url.openStream());            data = data.substring(data.indexOf('['), data.length()-1);                    handler.parseJSON(data);            return handler.getFeed();        }        catch (Exception ee)        {            // if we have a problem, simply return null            Log.e(""getFeed"", ee.getMessage());            return null;        }    }    private void UpdateDisplay(View searchView) {        // TODO Auto-generated method stub        // TODO Auto-generated method stub        searchList = (ListView) searchView;        myProgressDialog = ProgressDialog.show(this,                       ""Please wait..."", ""Loading search...."", true);         new Thread() {             public void run() {                 try{                     Thread.sleep(2000);                 } catch (Exception e) {  }                 runOnUiThread(new Runnable() {                     @Override                     public void run() {                         if (searchAdapter == null)                        {                            Log.e(""ERROR"", ""No Feed Available"");                            return;                        }                        searchAdapter.setContext(context);                        searchList.setAdapter(searchAdapter);                        searchList.setSelection(0);                    }                 });                 // Dismiss the Dialog                 myProgressDialog.dismiss();             }         }.start();     }}</code></pre><p>And the SearchHandler class is simple:</p><pre><code>public class SearchHandler  extends DefaultHandler {    SearchAdapter _adapter;    SearchItem _item;    public SearchHandler()    {    }    public SearchAdapter getFeed()    {        return _adapter;    }    public void parseJSON(String data) {        // TODO Auto-generated method stub        _adapter = new SearchAdapter();        JSONArray parseArray;        try {            parseArray = new JSONArray(data);                    for (int i=0; i &lt; parseArray.length(); i++) {                SearchItem item = new SearchItem();                JSONObject jsonUser = parseArray.getJSONObject(i);                item.set_from(jsonUser.getString (""from""));                item.set_msg(jsonUser.getString(""msg""));            }        } catch (JSONException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }}</code></pre><p>No matter what I do, the handler gets called and the new items are fetched, but the list is never refreshed... Any ideas on what could be going wrong?</p>","184046","","184046","","2010-02-04 03:24:01","2010-02-04 03:24:01","Android: How do I make a ListView update itself periodically?","<android><listview><refresh><auto-update>","1","2","1","",""
"2196835","1","","","2010-02-04 01:47:05","2","160","<p>Embed a browser inside the application.When the user navigates to a desired page, he pushes a button to ""set"" this page.</p><p>Now, the application gets the URL of this page!</p><p>How hard is this to do on the Android and iPhone?</p>","179736","","","","","2010-02-04 05:47:43","Is it possible to do this on the Android and iPhone? (for mobile developers)","<iphone><android><url><browser><mobile>","4","0","","2012-07-28 14:47:27",""
"2196851","1","","","2010-02-04 01:50:56","4","1951","<p>I'm having trouble getting eclipse to build an aidl file for android.  It doesn't seem to recognize it and does not call ""aidl"" when building project.</p>","265828","","366898","","2012-12-24 07:16:51","2013-06-12 17:00:24","Eclipse not building aidl file","<java><android><eclipse>","4","1","","",""
"2197033","1","","","2010-02-04 02:50:17","0","800","<p>I've extended android.widget.Chronometer like so:</p><pre><code>public class PausableCountdownTimer extends Chronometer   implements OnChronometerTickListener {</code></pre><p>I would like to be able to add this widget to my UI via main.xml:</p><pre><code>&lt;com.example.myproject.PauseableCountdownTimer.../&gt;</code></pre><p>but I get this error message in Eclipse:</p><blockquote>  <p>ClassNotFoundException:com.example.myproject.PauseableCountdownTimer</p></blockquote><p>Can someone explain what I've done incorrectly? Thx!</p>","265847","","","","","2010-02-12 03:52:31","Android: extended android.widget.Chronometer and main.xml","<android><activity><chronometer>","1","2","","",""
"2197243","1","","","2010-02-04 04:01:58","0","1015","<p>I enabled the Linkify property of a textview as follows:</p><pre><code>txtbox.setAutoLinkMask(Linkify.WEB_URLS);</code></pre><p>But, when there are URLs like bit.ly are present (which is very common nowadays in messages like tweets), it doesn't display them properly. The problem is ""sometimes"" it succeeds and sometimes it fails... The other problem is, if this TextView is part of a custom view for a ListView, then until I actually scroll the list somehow none of the URLs get linkified... </p><p>The other problem is, if there is an image inside a ListView, when I scroll through the list, I can see a different image load before it loads the actual image. I assume this is happening due the recycling of views, but is there any workaround for this?</p>","184046","","1288","","2010-10-27 02:39:45","2010-10-27 02:39:45","Android: Internal Linkify does not work properly, and text, images flicker inside ListView","<android><listview><textview><bit.ly>","1","0","","",""
"2197741","1","2197841","","2010-02-04 06:22:12","181","116802","<p>I am writing an application for the Android.  How do I send email from it?</p>","138030","","56285","","2013-12-16 22:25:47","2014-04-02 10:27:26","How to send email from my Android application?","<android><email>","7","0","91","",""
"2197744","1","2198160","","2010-02-04 06:22:28","45","59409","<p>Can any one tell me whats going wrong with the text, text exceeds then one line not getting wrap to next line going beyond the screen.</p><p><img src=""http://www.freeimagehosting.net/uploads/b555274595.png"" alt=""alt text""></p><p>Following is the code</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:orientation=""horizontal""     android:padding=""4dip""&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:orientation=""vertical""         android:padding=""4dip""&gt;        &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:orientation=""horizontal""             android:padding=""4dip""&gt;            &lt;TextView                 android:id=""@+id/reviewItemEntityName""                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:text=""event/venue""                 android:textColor=""@color/maroon""                android:singleLine=""true""                 android:ellipsize=""end""                 android:textSize=""14sp""                android:textStyle=""bold""                 android:layout_weight=""1"" /&gt;            &lt;ImageView                 android:id=""@+id/reviewItemStarRating""                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:layout_alignParentTop=""true""                android:layout_alignParentBottom=""true""                android:src=""@drawable/title_1_star"" /&gt;        &lt;/LinearLayout&gt;        &lt;TextView             android:id=""@+id/reviewItemDescription""            android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:text=""Description comes here""             android:textSize=""12sp""             android:layout_weight=""1""/&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","216431","","76835","","2010-02-04 06:46:20","2014-03-13 03:39:21","Android TextView Text not getting wrapped","<android><wrap><textview>","15","1","15","",""
"2197889","1","2480564","","2010-02-04 06:52:42","18","19611","<p>I'm trying to use the NDK with C++ and can't seem to get the method naming convention correct. my native method is as follows:</p><pre><code>extern ""C"" {JNIEXPORT void JNICALL Java_com_test_jnitest_SurfaceRenderer_drawFromJni(JNIEnv* env, jclass c){   //}}</code></pre><p>with a header wrapped in extern ""C"" {} aslo. </p><p>Everything compiles fine, creates a .so file and copies to the libs folder under my project, but when I debug and run in Eclipse I keep getting a log cat message that of ""no implementation found for native..."". Is there something i'm missing as all the NDK examples are in C?</p><p>Thanks.</p>","255293","","127893","","2010-02-04 06:54:06","2014-02-07 19:51:37","Android NDK C++ JNI (no implementation found for native...)","<android><android-ndk>","6","1","1","",""
"2198296","1","","","2010-02-04 08:41:24","3","518","<p>In my app, I request location updates and use a LocationListener and the majority of the time everything works well.  When the app starts, it uses getLastKnownLocation while waiting for the first location update. </p><p>I have been doing some tests on getLastKnownLocation and the results are strange... </p><p>If the result of getLastKnownLocation is out-of-date, then I exit the app and run Google Maps and wait for it to pick up my location, then when I re-run my app getLastKnownLocation still returns the old location.  I don't understand why this is happening.  Surely, if GMaps can get a fix then getLastKnownLocation should be up-to-date, right?</p>","139346","","","","","2010-02-04 08:41:24","getLastKnownLocation out-of-date even after other apps find my location!","<android><geolocation>","0","2","1","",""
"2198410","1","2198569","","2010-02-04 09:06:21","59","53998","<p>I am using </p><pre><code>Window w = getWindow();w.setTitle(""My title"");</code></pre><p>to change title of my current Activity but it does not seem to work.</p><p>Can anyone guide me on how to change this?</p>","249991","","2964945","","2014-03-05 10:07:26","2014-03-05 10:07:26","How to change title of Activity in Android?","<android><android-activity>","3","0","7","","2010-02-04 09:06:21"
"2198525","1","2198542","","2010-02-04 09:29:27","10","4419","<p>Can I access the values defined in a java manifest from code?</p>","202020","","202020","","2010-02-04 11:21:03","2013-09-24 13:39:50","Can values defined in MANIFEST.MF be accessed programmatically?","<java><android><jar><manifest>","5","0","2","",""
"2198533","1","2199621","","2010-02-04 09:29:56","14","9196","<p>When I try to run the android emulator it gives me following error:</p><blockquote>  <p>android.process.acore has stopped  unexpectedly force close</p></blockquote><p>I cannot run any application.  Can any one guide me how to resolve this issue?</p>","249991","","20712","","2013-06-27 04:03:42","2013-06-27 04:03:42","android.process.acore has stopped unexpectedly","<android><android-emulator>","2","3","1","2013-03-19 13:59:38",""
"2198788","1","","","2010-02-04 10:09:26","5","11355","<p>in my main view i have</p><pre><code>public class PlayersActivity extends Activity {    ViewFlipper flipper;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.playercontainer);        flipper = (ViewFlipper) findViewById(R.id.flipper);    }}</code></pre><p>with this view</p><pre><code>&lt;ViewFlipper xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/flipper""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;include android:id=""@+id/first""  layout=""@layout/first"" /&gt;    &lt;include android:id=""@+id/second""  layout=""@layout/playerdetailsview"" /&gt;&lt;/ViewFlipper&gt;</code></pre><p>It displays the first view correctly but i want it to be connected to a java class so i created an FirstActivity class where i can control all my components in the first viewbut how do i attach the first.xml layout with the FirstActivity java class ?</p>","62009","","725306","","2012-10-21 06:56:52","2013-12-26 16:21:23","How to connect a layout view with an activity","<android><layout><activity><connect>","4","2","3","",""
"2199118","1","2199203","","2010-02-04 11:07:14","0","2315","<p>I currently have an application that naturally gets pushed to the background when the home key is pressed.</p><p>The activity losses focus but continues running in the background.</p><p>So I want to know is it possible to bring the application back to the foreground when the user presses the green key (call button) on the device?</p>","243999","","","","","2010-03-11 12:40:53","Android - Bringing Activity to Foreground via the Call Button (Green Key)","<android><background><activity><call><foreground>","1","0","","",""
"2199291","1","","","2010-02-04 11:39:31","2","1677","<p>During the installation of my Android SDK, I am getting stuck during the process where the manager goes out and downloads all the revisions of the APIs and the SDKs.</p><p>It is potentially due to a socket issue that typically occurs when a database query is called and there are a large number of TCP connections... according to googling my error (No buffer space available (maximum connections reached?): recv failed )...</p><p>So I just need to know if there is a way, other then using the Android download manager, to download / update my computer with the following Android SDK components:</p><blockquote>  <p>Downloading Documentation for Android SDK, API 7, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading SDK Platform Android 2.1, API 7, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Skipping 'Google APIs by Google Inc., Android API 7, revision 1'; it depends on 'SDK  Platform Android 2.1, API 7, revision 1' which was not installed.<br>  Downloading Google APIs by Google Inc., Android API 7, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading SDK Platform Android 2.0.1, API 6, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Skipping 'Google APIs by Google Inc., Android API 6, revision 1'; it depends on 'SDK  Platform Android 2.0.1, API 6, revision 1' which was not installed.<br>  Downloading Google APIs by Google Inc., Android API 6, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading SDK Platform Android 2.0, API 5, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Skipping 'Google APIs by Google Inc., Android API 5, revision 1'; it depends on 'SDK Platform Android 2.0, API 5, revision 1' which was not installed.<br>  Downloading Google APIs by Google Inc., Android API 5, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading SDK Platform Android 1.6, API 4, revision 2<br>  No buffer space available (maximum connections reached?): recv failed<br>  Skipping 'Google APIs by Google Inc., Android API 4, revision 2'; it depends on 'SDK  Platform Android 1.6, API 4, revision 2' which was not installed.<br>  Downloading Google APIs by Google Inc., Android API 4, revision 2<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading SDK Platform Android 1.5, API 3, revision 3<br>  No buffer space available (maximum connections reached?): recv failed<br>  Skipping 'Google APIs by Google Inc., Android API 3, revision 3'; it depends on 'SDK  Platform Android 1.5, API 3, revision 3' which was not installed.<br>  Downloading Google APIs by Google Inc., Android API 3, revision 3<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading SDK Platform Android 1.1, API 2, revision 1<br>  No buffer space available (maximum connections reached?): recv failed<br>  Downloading Usb Driver package, revision 3<br>  No buffer space available (maximum connections reached?): recv failed </p></blockquote><p>Thank you.</p>","257863","","257863","","2010-02-04 11:47:53","2010-07-06 09:08:02","Is it possible to download Android SDK components without using the Android SDK management utility?","<sockets><android><installation><buffer-overflow><connections>","1","1","","",""
"2199357","1","2401135","","2010-02-04 11:51:06","6","11814","<p>My Android application uses Java OAuth library, found <a href=""http://oauth.googlecode.com/svn/code/java/"">here</a> for authorization on Twitter. I am able to get a request token, authorize the token and get an acknowlegement but when the browser tries the call back url to reconnect with my application, it does not use the URL I provide in code, but uses the one I supplied while registering with Twitter.</p><p>Note:<br>1. When registering my application with twitter, I provided a hypothetical call back url:http://abz.xyc.com  and set the application type as browser.<br>2. I provided a callback url in my code ""myapp"" and have added an intent filter for my activity with Browsable category and data scheme as ""myapp"".<br>3. URL called when authorizing does contain te callback url, I specified in code.</p><p>Any idea what I am doing wrong here?</p><p>Relevant Code:</p><pre><code>public class FirstActivity extends Activity{    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        OAuthAccessor client = defaultClient();        Intent i = new Intent(Intent.ACTION_VIEW);        i.setData(Uri.parse(client.consumer.serviceProvider.userAuthorizationURL + ""?oauth_token=""                + client.requestToken + ""&amp;oauth_callback="" + client.consumer.callbackURL));        startActivity(i);    }    OAuthServiceProvider defaultProvider()    {        return new OAuthServiceProvider(GeneralRuntimeConstants.request_token_URL,                GeneralRuntimeConstants.authorize_url, GeneralRuntimeConstants.access_token_url);    }    OAuthAccessor defaultClient()    {        String callbackUrl = ""myapp:///"";        OAuthServiceProvider provider = defaultProvider();        OAuthConsumer consumer = new OAuthConsumer(callbackUrl,                GeneralRuntimeConstants.consumer_key, GeneralRuntimeConstants.consumer_secret,                provider);        OAuthAccessor accessor = new OAuthAccessor(consumer);        OAuthClient client = new OAuthClient(new HttpClient4());        try        {            client.getRequestToken(accessor);        } catch (Exception e)        {            e.printStackTrace();        }        return accessor;    }    @Override    protected void onResume()    {        // TODO Auto-generated method stub        super.onResume();        Uri uri = this.getIntent().getData();        if (uri != null)        {            String access_token = uri.getQueryParameter(""oauth_token"");        }    }}// Manifest file &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".FirstActivity""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;             &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.VIEW"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;                &lt;data android:scheme=""myapp""/&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt; &lt;/application&gt;</code></pre>","236128","","236128","","2010-02-04 12:41:40","2013-02-13 11:12:34","OAuth + Twitter on Android: Callback fails","<android><twitter><oauth><twitter-client>","4","0","7","",""
"2199403","1","3158257","","2010-02-04 11:58:16","51","53356","<p>I got this error: <code>ERROR/MapActivity(258): Couldn't get connection factory client</code></p><p>Everything worked fine, it's all of a sudden, how come that happens?I know my api key is fine, because one month I've been using it perfectly.How come all of a sudden it doesn't show me the map activity, and posts that error in the logcat?</p>","260511","","2183804","","2013-10-05 20:10:38","2013-10-05 20:10:38","Couldn't get connection factory client","<android><google-maps><google-maps-android-api-1>","4","4","9","",""
"2199889","1","","","2010-02-04 13:16:46","0","334","<p>this is my code.I used one one popup message while clicking on button for that i used Toast after that i want to move next screen</p><pre><code>Button Replybutton = (Button) findViewById(R.id.Reply);        Replybutton.setOnClickListener(new View.OnClickListener()         {          public void onClick(View v)           {               EditText ReplysubjeditText=(EditText)findViewById(R.id.ReplysubjeditText);               EditText ReplymsgeditText=(EditText)findViewById(R.id.ReplymsgeditText);                 String temp_string=ReplysubjeditText.getText().toString();         try              {                ReplysubjeditText.setText("""");                ReplymsgeditText.setText("""");              }              catch(Exception e)              {                Log.v(""Add"",e.toString());              }              Toast.makeText(EmailReply.this, ""Sending...."",                        Toast.LENGTH_SHORT).show();                Intent myNewMail = new Intent(EmailReply.this,EmailForm.class);                myNewMail.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);                 startActivity(myNewMail);          }           });</code></pre>","217065","","996493","","2012-05-01 04:34:44","2012-05-01 04:34:44","how to give time gap between two activities in android?","<android>","1","1","","",""
"2200052","1","","","2010-02-04 13:44:15","1","1388","<p>I have created listview by using arrayadpter i add arraryadapter to listview contaning string array but i m unable to add icon to eatch listitemhelp me out...</p>","266231","","21234","","2010-02-04 13:56:14","2010-02-04 14:09:01","How to add icon/image to listitem of ListView","<android><android-emulator>","1","0","","",""
"2200436","1","4710639","","2010-02-04 14:39:34","-3","7365","<p>I would like my code to update <strong>contact details</strong> (like name, phone number, email, organization details, etc) in the android contact book. I was successful in modifying a few (name, phone number and email to be specific) but not all.</p><p>Whenever I try to update the organization details (Contacts.Organizations.COMPANY and Contacts.Organizations.TITLE) for a contact my app throws an <strong>exception</strong> </p><pre><code>java.lang.UnsupportedOperationException: Cannot update URL: content://contacts/people/69/organizations/69</code></pre><p>the code snippet is as follows:</p><pre><code>Uri baseUri = ContentUris.withAppendedId(People.CONTENT_URI, 69);Uri uri = Uri.withAppendedPath(baseUri, People.Phones.CONTENT_DIRECTORY);Cursor c = this.getContentResolver().query(uri,                 new String[] { Contacts.Organizations._ID, Contacts.Organizations.COMPANY,Contacts.Organizations.TITLE},                 null, null, null);if(c.getCount() &gt; 0) {      uri = ContentUris.withAppendedId(uri, c.getString(0));ContentValues val1 = new ContentValues();val1.put(Contacts.Organizations.COMPANY, ""arw"");val1.put(Contacts.Organizations.TYPE, Contacts.Organizations.TYPE_WORK);val1.put(Contacts.Organizations.TITLE, ""abcdef"");this.getContentResolver().insert(uri, val1);</code></pre>","266272","","603744","","2011-06-24 09:50:49","2012-12-01 11:42:04","update contact details on Android","<android><contacts>","3","2","2","",""
"2200545","1","","","2010-02-04 14:52:08","2","23303","<p>I have downloaded a file from <code>HttpConnection</code> using the <code>FileOutputStream</code> in android and now its being written in phone's internal memory on path as i found it in <code>File Explorer</code></p><p><code>/data/data/com.example.packagename/files/123.ics</code></p><p>Now, I want to open &amp; read the file content from phone's internal memory to UI. I tried to do it by using the <code>FileInputStream</code>, I have given just filename with extension to open it but I am not sure how to mention the file path for file in internal memory,as it forces the application to close.</p><p>Any suggestions? </p><hr><p>This is what I am doing:</p><pre><code>try{                 FileInputStream fileIn;         fileIn = openFileInput(""123.ics"");  InputStream in = null;  EditText Userid = (EditText) findViewById(R.id.user_id);  byte[] buffer = new byte[1024];  int len = 0;  while ( (len = in.read(buffer)) &gt; 0 )           {          Userid.setText(fileIn.read(buffer, 0, len));  }                      fileIn.close();                       } catch (FileNotFoundException e){   e.printStackTrace();}catch (IOException e){       e.printStackTrace();}</code></pre>","257580","","1288","","2011-09-17 01:20:20","2012-05-01 04:33:49","How to read file from phone's internal memory in android?","<android><memory><readfile>","3","2","2","",""
"2200723","1","2200907","","2010-02-04 15:12:50","3","1071","<p>I would like to perform rest calls to Amazon API from Android.Amazon demands that all ws calls will be authenticated using HMAC signatures (Hash-based Message Authentication Code).I'm missing a similar object to Apache Base64 object to sign my request.Is there a simple way to do that in Android, or even better is there an Android client for Amazon web service (Product Advertising API).</p>","251505","","","","","2012-02-20 05:49:55","Amazon rest call via android","<java><android><amazon-web-services>","2","0","1","",""
"2201091","1","","","2010-02-04 16:00:07","0","2466","<p>I just updated my app and I am getting some odd complaints from people who update it. I am only getting complaints from people with non-stock android phones (phones that manufacturers have modified...HTC phones, cliq, pulse, etc), other phones like the Droid, Nexus work fine. My app (Photo Frame Deluxe) has a list in it with a Image View, Text View, View (spacer) and checkbox, all in a row. What happens on the affected phones is that the rows start overlapping and it cuts the top half of everything off. My layout code for this is below, I am pulling my hair out on this, what might I have wrong in this layout.Why does this work on some phones and not on others?  Any help would be appreciated.</p><p>Row Layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""horizontal""&gt;&lt;ImageView    android:id=""@+id/photorowIcon""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_gravity=""center_vertical""    android:paddingTop=""10dp""    android:paddingBottom=""10dp""    android:paddingRight=""5dp""    /&gt;&lt;TextView    android:id=""@+id/photorowText""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_gravity=""center_vertical""    /&gt;&lt;View    android:layout_width=""0px""    android:layout_height=""wrap_content""    android:layout_weight=""1""/&gt;&lt;CheckBox    android:id=""@+id/photorowCheckBox""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_gravity=""center_vertical""    android:focusable=""false""    android:focusableInTouchMode=""false""    /&gt;  &lt;/LinearLayout&gt;</code></pre><p>Layout Row is inserted in:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;&lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:background=""@drawable/title1_gradient""    android:orientation=""vertical""&gt;&lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""Select Photos to Display:""    android:textSize=""20sp""    android:textStyle=""bold""    android:textColor=""#FFFFFFFF""    android:paddingLeft=""5dp""    android:paddingRight=""5dp""    android:paddingTop=""5dp""    /&gt;&lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:id=""@+id/folderName""    android:textSize=""15sp""    android:textStyle=""bold""    android:textColor=""#FFFFFFFF""    android:paddingLeft=""5dp""    android:paddingRight=""5dp""    android:paddingBottom=""5dp""    /&gt;    &lt;View        android:layout_width=""fill_parent""        android:layout_height=""1px""        android:background=""#406C6C6C""/&gt;    &lt;/LinearLayout&gt;&lt;ListView    android:id=""@android:id/list""    android:layout_width=""fill_parent""    android:layout_height=""0px""    android:layout_weight=""1""    android:drawSelectorOnTop=""false""    android:paddingLeft=""5dp""    android:paddingRight=""5dp""    /&gt;&lt;LinearLayout         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""vertical""        android:layout_gravity=""bottom""&gt;        &lt;LinearLayout             android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:orientation=""horizontal""            android:layout_gravity=""bottom""            android:background=""#FF6C6C6C""             android:padding=""5dp""&gt;            &lt;Button                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:id=""@+id/ok""                android:text=""OK""/&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","247304","","","","","2011-01-03 03:02:48","Listview Row Overlap Problem","<android><listview><layout><row>","3","1","","",""
"2201112","1","2203013","","2010-02-04 16:03:05","4","8515","<p>My program is targeting Android 1.5.  I would like to retrieve system information about the device itself.  I have found very few helpful classes by searching the APIs.  the best I've found so far is the <code>Runtime</code> class and a few <code>Build.*</code> system properties.</p><p>I would like to be able to get information like the total amount of memory on the device, the amount of free memory (which I do not know if the <code>Runtime</code> class is acutally giving me, since it specifically refers to memory available to the JVM) along with information about the processor.</p><p>Is this information available, and if so, where can I find it?</p>","261513","","","","","2010-02-04 20:37:33","Retrieving Device Information on Android","<java><android>","1","0","","",""
"2201346","1","2203256","","2010-02-04 16:34:27","2","489","<p>I have an app I am offering for free for now. At some point, I want to be able to change it to a pay app.</p><p>The market doesn't allow a free app to become for-pay and doesn't allow for-pay apps to be priced at 0$.</p><p>So is it possible to just delete the original app and then reupload it as a for-pay app ?It's okay in my case if users aren't notified of updates.</p>","1663292","","","","","2010-05-31 18:09:24","Is it possible in Android Market to delete an existing FREE app and reupload it again as a PAY app?","<android>","3","0","1","2012-07-28 13:56:31",""
"2201351","1","","","2010-02-04 16:35:07","2","1438","<p>I have a problem with my app.  I use the full screen option like so:</p><pre><code>public void setFullscreen() {    requestWindowFeature(Window.FEATURE_NO_TITLE);    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,        WindowManager.LayoutParams.FLAG_FULLSCREEN);}</code></pre><p>But, later during the game, when I show the AlertDialog for Help /Info, the status bar comes back for a fraction of a second anddisappears again creating a flashing or jumping effect. Also, theDialog itself is not centered as it should, almost as if it thoughtthere was a status bar.</p><p>Here is how I display the dialog:</p><pre><code>protected Dialog onCreateDialog(int id) {TextView tv;switch (id) {case MENU_HELP:       tv = new TextView(this);                   tv.setText(R.strings.help_msg);       return new AlertDialog.Builder(BlackJackView.this)       .setIcon(android.R.drawable.ic_menu_help)       .setTitle(""How-To"")       .setView(tv)       .setPositiveButton(""OK"", new DialogInterface.OnClickListener() {                   public void onClick(DialogInterface dialog, int whichButton) {                          /* User clicked OK so do some stuff */                   }       })       .create();  }  ………  }  return null;}</code></pre><p>Does anyone know what may be causing this appearing / disappearing?How do I make it stop this jumping behavior?</p><p>Thanks for all your help.</p>","","user266364","342473","","2012-02-20 10:26:52","2012-02-20 10:26:52","Android: Jumping effect of Status Bar","<java><android><statusbar>","1","1","0","",""
"2201440","1","","","2010-02-04 16:46:04","0","123","<p>Modify Current Home to 9 panels without changing anything else about the Desktop. Is this possible?</p>","266379","","845414","","2013-11-11 09:13:11","2013-11-11 09:13:11","Android Moto Droid 2.0.1 Home Screen","<android><panel>","1","1","","",""
"2201460","1","2228962","","2010-02-04 16:48:51","0","1003","<p>In my application I detect the out going call when a call is dialled from the dialer or contacts.</p><p>This works fine and I then pop up a dialog saying I have detected the call and then the user presses a button to close the dialog which calls finish() on that activity.</p><p>It all works fine except that when I then hold the home key to bring up the recently used apps the dialer icon is there.</p><p>And when it is clicked the dialog is brought back into focus in the foreground when the dialog activity should be dead and gone and not be able to be brought back to the foreground.</p><p>Here is a picture of what I mean.</p><p><img src=""http://img515.imageshack.us/img515/8505/devicev.png"" alt=""Dialer error""></p><p>So two questions arise, why would the dialer icon be getting placed there and why would it be recalling my activity to the foreground?</p><p>Here is the code for that Activity which has a dialog theme:</p><pre><code> public class CallDialogActivity extends Activity{ boolean isRecording; AudioManager audio_service; public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.dialog);      audio_service = (AudioManager) getSystemService(Context.AUDIO_SERVICE);      getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);      Bundle b = this.getIntent().getExtras();      String number = b.getString(""com.networks.NUMBER"");       String name = b.getString(""com.networks.NAME"");       TextView tv = (TextView) findViewById(R.id.voip) ;      tv.setText(name);      Intent service = new Intent(CallAudio.CICERO_CALL_SERVICE);         startService(service);      final Button stop_Call_Button = (Button) findViewById(R.id.widget35);      this.setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);        stop_Call_Button.setOnClickListener(new View.OnClickListener(){  public void onClick(View v){   Intent service = new Intent(CallAudio._CALL_SERVICE);   //this is for Android 1.5 (sets speaker going for a few seconds before shutting down)   stopService(service);   Intent setIntent = new Intent(Intent.ACTION_MAIN);         setIntent.addCategory(Intent.CATEGORY_HOME);   setIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);   startActivity(setIntent);           finish();             isRecording = false;   } });        final Button speaker_Button = (Button) findViewById(R.id.widget36);         speaker_Button.setOnClickListener(new View.OnClickListener(){       public void onClick(View v){        if(true){         audio_service.setSpeakerphoneOn(false);        }        else{         audio_service.setSpeakerphoneOn(true);        }       }      });</code></pre><p>}</p><p>@Override      protected void onResume() {          super.onResume();</p><pre><code>  }  @Override  protected void onPause() {      super.onPause();  }  public void onCofigurationChanged(Configuration newConfig) {    super.onConfigurationChanged(newConfig);    }</code></pre><p>}</p><p>It calls a service that uses AudioRecord to record from the Mic and AudioTrack to play it out the earpiece, nothing in the service to do with the dialler.</p><p>Has anyone any idea why this might be happening?</p>","243999","","243999","","2010-04-08 10:01:23","2010-04-08 10:01:23","Android - dialer icon gets placed in recently used apps after finish()","<android><dialog><activity><icons>","2","1","","",""
"2201917","1","2201999","","2010-02-04 17:51:45","299","195473","<p>How to open an URL from code in the built-in web browser rather than within my application?</p><p>I tried this: </p><pre><code>try {  Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(download_link));  startActivity(myIntent);} catch (ActivityNotFoundException e) {  Toast.makeText(this, ""No application can handle this request,""
    + "" Please install a webbrowser"",  Toast.LENGTH_LONG).show();  e.printStackTrace();}</code></pre><p>but I got an Exception:</p><blockquote>  <p>""No activity found to handle Intent{action=android.intent.action.VIEW data =www.google.com""</p></blockquote>","164460","","2970947","","2013-12-29 05:37:52","2014-04-08 09:19:51","How can I open a URL in Android's web browser from my application?","<android><url><web-browser><android-intent>","9","1","70","",""
"2202524","1","2202632","","2010-02-04 19:24:57","3","4910","<p>I've been able to use the standard ""ProgressDialog"" for android to show that an indeterminate task is running.<img src=""http://imgur.com/1laXA.png"" alt=""alt text""></p><p>But I'd like to use the ""smaller"" progress dialog ""spinner"" that's used for indeterminate tasks in some of the standard Android applications like the android Market (there's a small spinning circle that's actually integrated into the application window (as opposed to floating on top of it).<img src=""http://imgur.com/eiqgm.png"" alt=""alt text""></p><p>Does anyone know how to create the smaller progress dialog (or can someone point me in the right direction)?</p>","141146","","114066","","2010-08-17 08:09:49","2012-08-13 12:40:13","Small ProgressDialog ""spinner"" for android","<android><layout><progressdialog>","3","0","","",""
"2203266","1","2203305","","2010-02-04 21:12:16","0","385","<p>I would like to know if there is a way to track these retweets... I know that there are several applications for full twitter already available, but i would like to follow just a few things and integrate them in my application...The only thing I'm sure of, is that when someone retweet one of my tweets, there is a @my_account mentionned somewhere. But I have know idea of how to deal with it...If you had any lead for me, that would be great.Thank you</p>","263521","","","","","2010-02-04 21:20:57","how to implement a retweet tracker on Android","<android><twitter><tracker>","1","0","1","",""
"2203490","1","","","2010-02-04 21:48:51","6","5407","<p>I am looking for a way to initiate the audio connection between the Android phone and my headset within my application. The idea is to simplify the connection process in such a way that the user doesn't have to go through the different settings menus anymore (Apps -> Settings -> Wireless &amp; Networs -> Bluetooth settings). </p><p>Both devices are supposed to be already paired and the Bluetooth address of the headset to be known. </p><p>As far as I learned, the Bluetooth capabilities (available since version 2.0 of the Android SDK) are restricted to Bluetooth discovery and the connection of RFComm channels (host/client) between the Android phone and a Bluetooth device. Is there another way to request Bluetooth profiles on the Android system to initiate a connection to a known device from an app or is this impossible?</p>","266595","","","","","2013-04-17 07:54:00","Programmatically connect to a Bluetooth headset from an Android application","<android><bluetooth>","2","1","3","",""
"2203495","1","","","2010-02-04 21:49:58","14","38735","<p>How do I use adb to perform some automated tasks on my android phone?  I need to find commands that I can issue from the command line (ideally, using a .bat file) that will be capable of more than simply opening an application or sending an input keyevent (button press).  </p><p>For instance, I want to toggle Airplane Mode on or off from the command line.  Currently, the best I can do is launch the Wireless &amp; network settings menu and then use input keyevents to click Airplane mode:</p><pre><code>adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGSadb shell input keyevent 19 &amp; adb shell input keyevent 23</code></pre><p>There are quite a few drawbacks to this method, primarily that the screen has to be on and unlocked.  Also, the tasks I want to do are much broader than this simple example.  Other things I'd like to do if possible:</p><p>1.Play an mp3 and set it on repeat.  Current solution:</p><pre><code>adb shell am start -n com.android.music/.MusicBrowserActivityadb shell input keyevent 84adb shell input keyevent 56 &amp; adb shell input keyevent 66 &amp; adb shell input keyevent 67 &amp; adb shell input keyevent 19adb shell input keyevent 23 &amp; adb shell input keyevent 21adb shell input keyevent 19 &amp; adb shell input keyevent 19 &amp; adb shell input keyevent 19 &amp; adb shell input keyevent 22 &amp; adb shell input keyevent 22 &amp; adb shell input keyevent 23 &amp; adb shell input keyevent 23</code></pre><p>2.Play a video.  (current solution: open MediaGallery, send keyevents, similar to above)</p><p>3.Change the volume (current solution: send volume-up button keyevents)</p><p>4.Change the display timeout (current solution: open sound &amp; display settings, send keyevents)</p><p>As before, these all require the screen to be on and unlocked.  The other major drawback to using keyevents is if the UI of the application is changed, the keyevents will no longer perform the correct function.  If there is no easier way to do these sort of things, is there at least a way to turn the screen on (using adb) when it is off?  Or to have keyevents still work when the screen is off?</p><p>I'm not very familiar with java.  That said, I've seen code like the following (source: <a href=""http://yenliangl.blogspot.com/2009/12/toggle-airplane-mode.html"">http://yenliangl.blogspot.com/2009/12/toggle-airplane-mode.html</a>) to change a setting on the phone:</p><pre><code>Settings.System.putInt(Settings.System.AIRPLANE_MODE_ON, 1 /* 1 or 0 */);</code></pre><p>How do I translate something like the above into an adb shell command?  Is this possible, or the wrong way to think about it?</p><p>I can provide more details if needed.  Thanks!</p>","266596","","","","","2013-04-02 12:47:54","Adb shell commands to change settings or perform tasks on a phone","<android><adb>","4","0","8","",""
"2203552","1","2203842","","2010-02-04 21:59:52","0","383","<p>I'm lost here.</p><p>I create files using this (stripped) code :</p><pre><code>File dir = getBaseContext().getDir(dirPath, MODE_WORLD_WRITEABLE);try {File file = new File(dir, fileName);FileOutputStream fous = new FileOutputStream(file);fous.write(data);fous.flush();fous.close();long l = file.length();Log.i(""PpCameraActivity"", ""File size : "" + l);} catch (IOException e) {e.printStackTrace();Toast.makeText(getBaseContext(), ""Error while trying to write photo file"",  Toast.LENGTH_LONG).show();}</code></pre><p>I can verify with logcat that my file seems to be created (it has a not null lenght). But I cannot see it when I connect my android device to my PC.So... where is my file ? Is it hidden ? Erased ?</p><p>EDIT : I'm now trying to write on the SDCard specifically, using this :</p><pre><code>File root = Environment.getExternalStorageDirectory();File jpegFile = new File(root.getAbsolutePath() + ""/myApplication/"" + filePath);try {jpegFile.mkdirs();FileOutputStream fous = new FileOutputStream(jpegFile);fous.write(data);fous.flush();fous.close();Log.i(""PpCameraActivity"", ""File written : "" + jpegFile.getAbsolutePath());Toast.makeText(getBaseContext(), ""File written : "" + jpegFile.getAbsolutePath(), Toast.LENGTH_LONG).show();long l = jpegFile.length();Log.i(""PpCameraActivity"", ""File size : "" + l);} catch (IOException e) {e.printStackTrace();Toast.makeText(getBaseContext(), ""Error while trying to write photo file"", Toast.LENGTH_LONG).show();}</code></pre><p>But I get a FileNotFoundException on the FileOutputStream creation...</p>","263525","","263525","","2010-02-04 22:39:52","2010-02-05 07:34:12","Can I access the files I create with USB","<android>","2","3","","",""
"2203806","1","2211998","","2010-02-04 22:44:23","2","1684","<p>I have created an hprof file by inserting the statement <code>Debug.dumpHprofData(""/sdcard/myapp.hprof"");</code> in my app's code; I have then run the hprof file through hprof-conv and opened the converted file in Eclipse.</p><p>Following the advice of the MAT ""Cheat Sheet"" I have obtained an analysis of my app's memory usage by going to ""Leak Identification -> Component Report"" entering ""com.prepbgg.*"" and hitting Finish.</p><p>I know that my app is consuming large amounts of memory: in particular at the stage where I called dumpHprofData it had a one megapixel bitmap object and a canvas that must have consumes several hundred KB. (I also suspect that it is leaking significant amounts of memory because performance degrades severely after the screen has been rotated a few times.)</p><p>However, the Component Report for com.prepbgg.* shows total memory of only 38.7KB. The Histogram view shows for android.graphics.Bitmap (presumably this is the total of all apps including mine) 404 objects and Shallow Heap 12,928. Is that 12,928 bytes?</p><p>Clearly, my app consumes more than 38.7KB and the Bitmap far more than 12,928 bytes. Where am I going wrong? How can I see the total memory consumed by my app?</p>","250845","","","","","2010-02-06 04:05:35","Android: Eclipse MAT does not appear to show all my app's objects","<android><debugging><memory-management>","1","0","","",""
"2203870","1","9933982","","2010-02-04 22:58:24","1","860","<p>When I take a picture with Android's camera app, it is inserted in the gallery with a name identical to it's creation date/time, like ""2010-02-04 16.36.15.jpg""</p><p>In my app i take my own pics, and insert to the gallery them usingandroid.provider.MediaStore.Images.Media.insertImage(   ContentResolver cr, Bitmap source, String title, String description);</p><p>However, in the gallery they appear with a name that seems to be the time stamp of their creation in millis, like ""1265323665851.jpg"" , no matter what i put in the tittle argument.</p><p>I need them to have the same name they would get from Android's camera app, so that they will be properly ordered.</p><p>Is there a way to do so?</p><p>Thanks in advance.</p>","441621","","","","","2012-03-29 21:41:58","How can I change the name of an image when inserting it to the Android gallery?","<android><image><image-gallery>","2","0","","",""
"2203987","1","","","2010-02-04 23:23:36","28","26196","<p>Android uses SQLite database to store data, I need to encrypt the SQLite database, how can this be done?  I understand that application data is private.  However I need to explictly encrypt the SQLite database that my app is using.</p>","121196","","2602984","","2013-11-24 21:42:01","2013-11-26 17:06:55","Android database encryption","<android><database><sqlite><encryption>","6","1","12","",""
"2204086","1","","","2010-02-04 23:45:11","6","3180","<p>I'm trying to develop a 2D game to android using opengl.</p><p>I know how to print images on the screen and animate them. But in my game I have a map and a want to zoom in and out and scroll the map. But I can't figure out the best way of doing it.</p><p>Can anybody help me?</p>","34056","","44729","","2010-11-22 18:36:58","2010-11-22 18:36:58","android opengl game","<java><android><opengl-es>","2","2","","",""
"2204621","1","2204895","","2010-02-05 02:04:14","0","414","<p>When the person opens my app, I want to display a button. The user clicks this button, and it opens a browser (embedded, of course) inside the app, allowing the user to LOGIN through that web page.</p><p>Of course, when the person logs in, it only logs in to that <strong>web server</strong>.  The web service now knows that the user is logged in.</p><p>As the user uses my mobile app, I need to know if he's logged in or not.  How can I know? There's no way for my app to determine if the user is logged into my web service.</p><p>By the way, I am using Django framework for my web service.</p>","179736","","","","","2010-02-05 03:40:54","Connecting the login flow between Android/iPhone app and the web","<iphone><android><django><authentication><mobile>","1","0","","",""
"2204711","1","3754293","","2010-02-05 02:37:00","1","784","<p>I'm trying to write a service for my Android phone that is similar to Google Voice: it will intercept outgoing calls, replacing the originally dialed number with a number that I look up from a web request.</p><p>I know that outgoing calls can be diverted using a BroadcastReceiver that requests the Intent.ACTION_NEW_OUTGOING_CALL broadcast as demonstrated in the android source code here:</p><p><a href=""http://android.git.kernel.org/?p=platform/packages/apps/Phone.git;a=blob;f=src/com/android/phone/ProcessOutgoingCallTest.java"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/apps/Phone.git;a=blob;f=src/com/android/phone/ProcessOutgoingCallTest.java</a></p><p>My question is, how do I politely perform a long-running task like looking up the number for <code>setResultData(...);</code> using a web request?</p><p>Google Voice performs this request, somehow. How? Do they cancel the original outgoing call and use a custom InCallScreen Activity? I don't think so, because the in-call UI when using Google Voice matches the phone's UI (I have tried it on Cliq, MT3G, and Droid).</p>","266737","","","","","2011-03-31 04:35:53","Making an HttpClient request inside a BroadcastReceiver for Intent.ACTION_NEW_OUTGOING_CALL","<android><google-voice>","1","0","","",""
"2204815","1","2204820","","2010-02-05 03:18:56","1","93","<p>Is any Android browser able to process jQuery scripts?</p><p>which will be the 1st when?</p>","118110","","867232","","2012-04-09 09:20:49","2012-04-09 09:20:49","want jQuery on my Driod","<jquery><android>","1","2","","",""
"2204994","1","","","2010-02-05 04:11:30","2","5401","<p>I have a ListActivity with an array adapter declared like <code>arrayAdapter = new ArrayAdapter&lt;String&gt; (this, android.R.layout.simple_list_item_checked);</code> This shows a bunch of rows with checkmarks on the far right. Can you tell me how to get a reference to those checkmarks or how to check/uncheck them?</p>","13069","","","","","2011-09-26 08:57:50","How do you activate checkmarks in list activity?","<android><listactivity><android-arrayadapter><checkmark>","3","0","1","",""
"2205092","1","","","2010-02-05 04:41:25","5","19760","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1964193/android-how-to-set-the-wallpaper-image"">Android - how to set the wallpaper image</a>  </p></blockquote><p>What i'm trying to do is, set the wallpaper using an image URI (no cropping)</p><p>I'm a noob at dev on Android and dev in general.The internet has failed me... on providing code to set the wallpaper.</p><p><em>yes</em> the dev resource site says</p><p><code>public void setStream (InputStream data)</code></p><p>but i don't understand it, some sample code would greatly help me. </p>","266776","","","","","2011-06-04 10:03:40","Android - How to set the wallpaper image?","<android><wallpaper>","2","1","6","2011-06-08 20:57:55",""
"2205128","1","2205176","","2010-02-05 04:50:40","6","6967","<p>I am trying to create HTTP connection using AsyncTask class. </p><p>Is it possible to create HTTP connection ?</p><p>Can you suggest sample source code ?</p><p>Thanks in advance.</p>","164589","","","","","2013-09-05 08:21:06","How to create Http Connection using AsyncTask class?","<android>","2","0","6","",""
"2205246","1","2205300","","2010-02-05 05:30:40","4","11391","<p>Given a contact id, I can obtain various contact details (like name, phone, email-id, etc) by making different queries for a each of these fields. </p><p>But is there a method to obtain all the details associated with this contact id by making a single query?</p>","266272","","418183","","2011-02-06 12:06:20","2011-02-06 12:06:20","How to obtain all details of a contact in Android","<android><contacts>","1","2","7","",""
"2205274","1","2205302","","2010-02-05 05:40:39","1","1226","<p>I have seen a few code examples of 1.0 / 1.1 but since a lot of that is deprecated now I was hoping to find a nice 1.5+ example. I have some code here that I wrote but it doesn't really work properly. Any help would be great, thanks!</p><pre><code>public class collectAccel extends Activity implements SensorEventListener,                                                 OnClickListener{private SensorManager sensorMgr;private TextView xLabel, yLabel, zLabel;private Button StartBtn;private List&lt;Sensor&gt; sensorList;private float x, y, z;private long lastUpdate = -1;// deltas for calibrationprivate float cx, cy, cz;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    xLabel = (TextView) findViewById(R.id.x_label);    yLabel = (TextView) findViewById(R.id.y_label);    zLabel = (TextView) findViewById(R.id.z_label);    StartBtn = (Button) findViewById(R.id.Button1);    StartBtn.setOnClickListener(this);}@Overridepublic void onClick(View arg0) {    if (xLabel.getVisibility() != 1)        xLabel.setVisibility(1);    if (yLabel.getVisibility() != 1)        yLabel.setVisibility(1);    if (zLabel.getVisibility() != 1)        zLabel.setVisibility(1);}@Overrideprotected void onPause() {    super.onPause();    sensorMgr.unregisterListener((SensorEventListener)this, sensorList.get(0));    sensorMgr = null;    cx = 0;    cy = 0;    cz = 0;}@Overrideprotected void onResume() {    super.onResume();    sensorMgr = (SensorManager) getSystemService(SENSOR_SERVICE);    sensorList = sensorMgr.getSensorList(Sensor.TYPE_ACCELEROMETER);    boolean accelSupported = sensorMgr.registerListener((SensorEventListener)this,             sensorList.get(0),            SENSOR_DELAY_UI);    if (!accelSupported) {        // on accelerometer on this device        sensorMgr.unregisterListener((SensorEventListener)this, sensorList.get(0));    }}@Overridepublic void onAccuracyChanged(Sensor arg0, int arg1) {    cx = 0;    cy = 0;    cz = 0;}@Overridepublic void onSensorChanged(SensorEvent arg0) {    if (arg0.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {        long curTime = System.currentTimeMillis();        // only allow one update every 100ms, otherwise updates        // come way too fast and the phone gets bogged down        // with garbage collection        if (lastUpdate == -1 || (curTime - lastUpdate) &gt; 100) {            lastUpdate = curTime;            x = arg0.values[0];            y = arg0.values[1];            z = arg0.values[2];            xLabel.setText(String.format(""X: %+2.5f (%+2.5f)"", (x+cx), cx));            yLabel.setText(String.format(""Y: %+2.5f (%+2.5f)"", (y+cy), cy));            zLabel.setText(String.format(""Z: %+2.5f (%+2.5f)"", (z+cz), cz));        }    }}}</code></pre>","188039","","166712","","2010-02-05 06:07:13","2010-02-05 06:07:13","How can I access the accelerometer properly in Android 1.5?","<android><accelerometer>","1","0","1","",""
"2205314","1","2205482","","2010-02-05 05:58:02","1","289","<p>I have a normal java app that sends the same object to the servlet with no problems, but when I attempt it in an android app using the same code it craps out on me at: </p><pre><code>outputToServlet.writeObject(myobject)</code></pre><p>Throwing the <code>NoSuchMethodException</code></p><p>I'm able to send a String object no problem via the Android app...</p><p>I've seen the ""don't use serialization between architectures"" answer, but I'd like to know why not? </p><p>Any ideas?</p><p>-chief</p>","266785","","166712","","2010-02-05 06:02:47","2010-02-05 06:49:17","Receiving a NoSuchMethodException while trying to transfer a serialized object from Android App to a Servlet","<android><serialization>","3","2","","",""
"2205327","1","2207483","","2010-02-05 06:01:56","8","7285","<p>Anyone has good advise on how to implement one-to-many mapping for <code>SQLite</code> using <code>ContentProvider</code>? If you look at <code>Uri ContentProvider#insert(Uri, ContentValues)</code> you can see that it has <code>ContentValues</code> param that contains data to insert. The problem is that in its current implementation <code>ContentValues</code> does not support <code>put(String, Object)</code> method and class is final so I cannot extend it. Why it is a problem? Here comes my design:</p><p>I have 2 tables which are in one-to-many relationship. To represent these in code I have 2 model objects. 1st represents the main record and has a field that is a list of 2nd object instances. Now I have a helper method in the model object #1 which returns <code>ContentValues</code> generated off the current object. It's trivial to populate a primitive fields with <code>ContentValues#put</code> overloaded methods but I'm out of luck for the list. So currently since my 2nd table row is just a single String value I generate a comma delimited String which then I reparse to String[] inside <code>ContentProvider#insert</code>. That feels yucky, so maybe someone can hint how it can be done in cleaner fashion.</p><p>Here's some code. First from the model class:</p><pre><code>public ContentValues toContentValues() {    ContentValues values = new ContentValues();    values.put(ITEM_ID, itemId);    values.put(NAME, name);    values.put(TYPES, concat(types));    return values;}private String concat(String[] values) { /* trivial */}</code></pre><p>and here's slimmed down version of <code>ContentProvider#insert</code> method</p><pre><code>public Uri insert(Uri uri, ContentValues values) {    SQLiteDatabase db = dbHelper.getWritableDatabase();    db.beginTransaction();    try {        // populate types        String[] types = ((String)values.get(Offer.TYPES)).split(""|"");        // we no longer need it        values.remove(Offer.TYPES);        // first insert row into OFFERS        final long rowId = db.insert(""offers"", Offer.NAME, values);        if (rowId &gt; 0 &amp;&amp; types != null) {            // now insert all types for the row            for (String t : types) {                ContentValues type = new ContentValues(8);                type.put(Offer.OFFER_ID, rowId);                type.put(Offer.TYPE, t);                // insert values into second table                db.insert(""types"", Offer.TYPE, type);            }        }        db.setTransactionSuccessful();        return ContentUris.withAppendedId(Offer.CONTENT_URI, rowId);    } catch (Exception e) {        Log.e(TAG, ""Failed to insert record"", e);    } finally {        db.endTransaction();    }}</code></pre>","135946","","","","","2011-12-02 21:09:17","Android: SQLite one-to-many design","<android><sqlite><one-to-many>","4","0","8","",""
"2205380","1","2205483","","2010-02-05 06:18:52","1","724","<p>I am new to android ,and i have drawn a pie chart and when i see it vertically ,its ok,and when i change the view to horizontally i just get the first half of the chart and i want to scroll it down,how to do it.</p>","138030","","138030","","2010-02-05 06:45:49","2010-02-05 06:48:49","How to make my form scrollable in android","<android>","1","0","","",""
"2205613","1","","","2010-02-05 07:25:07","0","806","<p>The GPS on my Android phone is on, supported by the fact that :</p><pre><code>location_manager.isProviderEnabled(LocationManager.GPS_PROVIDER)</code></pre><p>returns true.</p><p>Yet, the following line :</p><pre><code> Location location = location_manager.getLastKnownLocation(LocationManager.GPS_PROVIDER) ;</code></pre><p>returns null.</p><p>What could be the reason ?</p><p>Thanks.</p>","78351","","","","","2010-02-05 08:23:22","GPS is on, yet LocationManager returns null","<android>","1","0","","",""
"2205685","1","","","2010-02-05 07:46:02","2","503","<p>i am new to android ,i dont have idea of layouts,where to refer?basic of layout desigining,and how to make the form scrollable ,such things etc</p><p>RegardsRakesh shankar.P</p>","138030","","","","","2010-02-05 08:15:49","How to design layouts in android?","<android>","1","0","","",""
"2205885","1","","","2010-02-05 08:30:47","1","9335","<p>I am developing the android application. which is going to update the content from android to the web(php webservice). Can anyone give me the sample code for my reference.</p>","","user261927","153407","","2010-02-09 06:23:38","2013-06-18 12:38:33","connecting PHP webservices with Android","<php><android><web-services>","5","1","4","",""
"2206211","1","2207479","","2010-02-05 09:36:03","2","1239","<p>I am detecting gestures on one of my activities - I am using it to navigate through photos. Every time I am doing a gesture, yellow line is being drawn on the screen. Is there any way to set <a href=""http://developer.android.com/reference/android/gesture/GestureOverlayView.html#attr_android%3agestureColor"" rel=""nofollow"">GestureColor</a> as transparent? </p>","58862","","","","","2014-02-11 00:45:49","Gestures and color drawing","<android>","1","0","","",""
"2206236","1","2206449","","2010-02-05 09:39:21","3","3894","<p>Im trying to add a phone number to an already existing contact on a Droid-phone. Doing it at the same time as I create a contact is trivial, as the backreference I supply simply is 0 when creating a ContentProviderOperation. But trying to find the backreference through querying for a display name like this does not work:</p><pre><code>Cursor rawContactsReferenceCursor =             contentResolver.query(Data.CONTENT_URI,                     new String[]{Data.RAW_CONTACT_ID},                    Data.DISPLAY_NAME+""=\""""+displayName+""\"""", null, null);</code></pre><p>While I do get a raw contact ID, the following code just generates an IndexOutOfBoundException (rawConcactReferenceID is the variable I got from the previous query):</p><pre><code>ArrayList&lt;ContentProviderOperation&gt; op_list =     new ArrayList&lt;ContentProviderOperation&gt;();op_list.add(ContentProviderOperation.newUpdate(Data.CONTENT_URI)    .withValueBackReference(Data.RAW_CONTACT_ID, rawConcactReferenceID)    .withValue(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE)    .withValue(Phone.NUMBER, testNumber)    .withValue(Phone.TYPE, Phone.TYPE_CUSTOM)    .withValue(Phone.LABEL, testLabel)    .build()); ContentProviderResult[] result =    contentResolver.applyBatch(ContactsContract.AUTHORITY, op_list);</code></pre><p>The big challenge is a huge lack of good documentation. I would be very satisfied to just get my hands on some working copypasta to study.</p><p>Cheers,</p>","249871","","249871","","2011-08-24 08:23:12","2011-08-24 08:23:12","Add number to contact on Android 2.0","<android><android-contacts>","3","0","","",""
"2206397","1","3268557","","2010-02-05 10:04:47","8","20213","<p>On the Emulator with a default mail-app all works fine. But I have no attach when I'am receiving a mail which I've sent from my Hero using a Gmail app. The default Mail app on the hero works fine. </p><p>How can I make this code works with Gmail app on Hero?<br/>You can see the code below.</p><pre><code>    private void startSendIntent() {        Bitmap bitmap = Bitmap.createBitmap(editableImageView.getWidth(), editableImageView.getHeight(), Bitmap.Config.RGB_565);        editableImageView.draw(new Canvas(bitmap));        File png = getFileStreamPath(getString(R.string.file_name));        FileOutputStream out = null;        try {            out = openFileOutput(getString(R.string.file_name), MODE_WORLD_READABLE);            bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);            out.flush();        } catch (Exception e) {            e.printStackTrace();        } finally {            try {                if (out != null) out.close();            }            catch (IOException ignore) {}        }        final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);        emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(png));        emailIntent.setType(""image/png"");        startActivity(Intent.createChooser(emailIntent, getString(R.string.send_intent_name)));}</code></pre><p>in Logs I see the following:</p><pre><code>02-05 17:03:37.526: DEBUG/Gmail(11511): URI FOUND:file:///sdcard/DCIM/100MEDIA/IMAG0001.jpg02-05 17:03:37.535: DEBUG/Gmail(11511): ComposeActivity added to message:0 attachment:|IMAG0001.jpg|image/jpeg|0|image/jpeg|LOCAL_FILE|file:///sdcard/DCIM/100MEDIA/IMAG0001.jpg size:002-05 17:03:37.585: INFO/Gmail(11511): &gt;&gt;&gt;&gt;&gt; Attachment uri: file:///sdcard/DCIM/100MEDIA/IMAG0001.jpg02-05 17:03:37.585: INFO/Gmail(11511): &gt;&gt;&gt;&gt;&gt;           type: image/jpeg02-05 17:03:37.585: INFO/Gmail(11511): &gt;&gt;&gt;&gt;&gt;           name: IMAG0001.jpg02-05 17:03:37.585: INFO/Gmail(11511): &gt;&gt;&gt;&gt;&gt;           size: 0</code></pre><p>Thank you for the answer.</p>","227016","","227016","","2010-02-05 14:06:57","2013-05-20 05:54:19","Android: Intent.ACTION_SEND with EXTRA_STREAM doesn't attach any image when choosing Gmail app on htc Hero","<android><email><attachment><android-intent><htc-hero>","3","2","5","",""
"2206596","1","2207427","","2010-02-05 10:46:06","15","22864","<p>I have to make an application which shows the Contact no of the SIM card that is being used in the cell. For that I need to use TelephonyManager class. Can i get details on its usage?</p>","254790","","1252012","","2012-05-04 13:11:33","2014-01-29 06:31:25","How to get  the  mobile number of current sim card in real device?","<android><phone-number>","5","4","12","",""
"2206822","1","2206858","","2010-02-05 11:28:24","38","73336","<p>I am trying to use internet with the Android emulator, but with no success.Any ideas?</p>","243967","","","","","2012-10-28 06:43:19","No internet on Android emulator - why and how to fix?","<android><android-emulator>","11","4","9","2013-03-20 00:16:20",""
"2207631","1","2207742","","2010-02-05 13:56:18","12","5590","<p>What is the default encoding of android system ?</p>","164460","","","","","2014-01-18 18:00:43","android default encoding","<android><encoding>","1","0","2","",""
"2207967","1","2208010","","2010-02-05 14:49:21","0","970","<p>i am working on data manipulation using sqlite.</p><p>how can i insert the datetime value in sqlite</p><p>i implemented the below code in my app.</p><p>it works,</p><pre><code>DateFormat formatter = new SimpleDateFormat(""dd MMM yyyy hh:mm:ss"");String temp=property.getFirstChild().getNodeValue();Date s=formatter.parse(temp.substring(5, temp.length()-5));String pubdate= formatter.format(s);</code></pre><p>but i cant sort by date Crying or Very sad Crying or Very sad Crying or Very sad Crying or Very sad Crying or Very sad Crying or Very sad</p><p>help help help Idea Idea Idea</p>","40933","","","","","2010-02-05 17:11:12","how to insert date value in android?","<android>","1","0","1","",""
"2207975","1","","","2010-02-05 14:50:20","12","20815","<p>I'm writing an application which is able to communicate with my PC. I have used the Bluetooth functionalities of the SDK 2.1.</p><p>I can find devices, get their MAC address, create an <a href=""http://en.wikipedia.org/wiki/Bluetooth_protocols#Radio_frequency_communication_.28RFCOMM.29"">RFCOMM</a> socket, but when I start the connection, I get the following error message.</p><blockquote>  <p>Service discovery failed.</p></blockquote><ol><li>Is it because of the <a href=""http://en.wikipedia.org/wiki/Universally_unique_identifier"">UUID</a> which is not the same on my application and on my PC?</li><li>How can I get the correct UUID on my PC?</li></ol><p>If I write a such application, is my <a href=""http://en.wikipedia.org/wiki/Nexus_One"">Nexus One</a> the client or the server?</p>","267154","","63550","","2011-12-04 00:42:44","2013-04-02 17:51:30","Bluetooth -> service discovery failed","<android><service><bluetooth><arduino><discovery>","6","1","11","",""
"2208062","1","","","2010-02-05 15:01:00","-1","260","<p>I am staring to learn android, I have done everything as mentioned in the guide, and I tried the hello android example.</p><p>but I just can´t open the main.xml file to edit, it give me this error: Could not initialize class java.awt.Font. I am on linus kde. </p><p>I don´t what I should do, and please avoid any solutions that use 'sudo' as I am not authorized to do that as I am using the university PC. </p><p>thanks hope you help me  </p>","267160","","","","","2010-02-05 17:46:13","error opening main.xml file","<java><android>","1","1","","",""
"2208225","1","","","2010-02-05 15:23:30","6","12399","<p>Hey guys my first post here... Im trying to write a custom filter to filter the arraylist in my arrayadapter such that my listview is filtered when i click on the button.</p><p>For instance when i click on my button</p><pre><code>public void onClick(View arg0) {            String abc = ""abc"";            m_adapter.getFilter().filter(abc);        }</code></pre><p>However, when i click on my button, my app terminate unexpectedly. Here is my code for the arrayadapter and filter. Please help me.</p><pre><code>package com.ntu.rosemobile.searchlist;public class ResultsAdapter extends ArrayAdapter&lt;SearchItem&gt; implements Filterable{public ArrayList&lt;SearchItem&gt; subItems;public ArrayList&lt;SearchItem&gt; allItems;private LayoutInflater inflater;private PTypeFilter filter;public ResultsAdapter(Context context, int textViewResourceId, ArrayList&lt;SearchItem&gt; items) {    super(context, textViewResourceId, items);        this.subItems = items;        this.allItems = this.subItems;        inflater= LayoutInflater.from(context);}@Overridepublic Filter getFilter() {    if (filter == null){      filter  = new PTypeFilter();    }    return filter;  }//@Overridepublic View getView(int position, View convertView, ViewGroup parent) {        View v = convertView;        if (v == null) {            v = inflater.inflate(R.layout.listrow, null);        }        SearchItem o = subItems.get(position);        if (o != null) {                TextView pname = (TextView) v.findViewById(R.id.productname);                TextView neg = (TextView) v.findViewById(R.id.negNum);                TextView pos = (TextView) v.findViewById(R.id.posNum);                TextView neu = (TextView) v.findViewById(R.id.neuNum);                WebImageView productPhoto = (WebImageView)v.findViewById(R.id.pPhoto);                if(productPhoto!=null){                    productPhoto.setImageUrl(o.getImageUrl().toString());                    productPhoto.loadImage();                }                if(pname!= null){                    pname.setText(o.getProductName().toString());                }                                    if (neg != null) {                      String a =  """" + o.getNegativeReviews();                      neg.setText(a);                                            }                if(neu != null){                     String a =  """" + o.getNeutralReviews();                     neu.setText(a);                }                if(pos != null){                    String a =  """" + o.getPositiveReviews();                    pos.setText(a);                }        }        return v;}private class PTypeFilter extends Filter{    @SuppressWarnings(""unchecked"")    @Override    protected void publishResults(CharSequence prefix,                                  FilterResults results) {      // NOTE: this function is *always* called from the UI thread.       subItems =  (ArrayList&lt;SearchItem&gt;)results.values;        notifyDataSetChanged();    }    @SuppressWarnings(""unchecked"")    protected FilterResults performFiltering(CharSequence prefix) {          // NOTE: this function is *always* called from a background thread, and          // not the UI thread.           FilterResults results = new FilterResults();          ArrayList&lt;SearchItem&gt; i = new ArrayList&lt;SearchItem&gt;();          if (prefix!= null &amp;&amp; prefix.toString().length() &gt; 0) {              for (int index = 0; index &lt; allItems.size(); index++) {                  SearchItem si = allItems.get(index);                  if(si.getPType().compareTo(prefix.toString()) == 0){                    i.add(si);                    }              }              results.values = i;              results.count = i.size();                             }          else{              synchronized (allItems){                  results.values = allItems;                  results.count = allItems.size();              }          }          return results;    }  }     }</code></pre>","267185","","166712","","2010-02-05 15:40:40","2011-03-04 17:54:47","Android How do i overwrite the filter for my ArrayAdapter?","<android><filter><arraylist><android-arrayadapter>","1","5","5","",""
"2208511","1","","","2010-02-05 16:08:57","1","1624","<p>I am able to display multiple overlayItems on Googlemap, now I want to change icon of any specific overlayItem (to show it is currently selected event). I want to do it through navigation buttons (next, previous) as on Google maps.</p><p>I am using <a href=""http://developer.android.com/intl/fr/reference/android/graphics/drawable/StateListDrawable.html"" rel=""nofollow"">StateListDrawable</a> to display icons for OverlayItems. </p><p>Icon file is</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;item android:state_selected=""true"" android:drawable=""@drawable/selected_icon""/&gt; &lt;item android:drawable=""@drawable/unselected_icon""/&gt;&lt;/selector&gt;</code></pre><p>code for getMarker method of OverlayItem is as follows.</p><pre><code>@Overridepublic android.graphics.drawable.Drawable getMarker(int stateBitset){    Drawable icon;                  icon = this.mapActivity.getResources().getDrawable(R.drawable.film_icon);    icon.setBounds(0, 0, icon.getIntrinsicWidth(), icon.getIntrinsicHeight());    return icon;}</code></pre><p>Now my question is how do I change the state of any overlayItem/Icon on map when user click on one of navigation keys?</p><p>Any help is much appreciated.</p>","254032","","","","","2010-10-02 11:59:57","how to change state of any overlayItem on googlemap?","<android><google-maps><map><overlay>","1","0","","",""
"2208883","1","2209088","","2010-02-05 17:03:29","1","1755","<p>Actually this question applies to any widget that requires data from a remote server.</p><p>The answer would be pure speculation, but how do you think the widget gets its data?  For those that don't know, the widget shows a history of your friends' latest status updates.</p><p>Some answers that I can think of:</p><ol><li>The widget polls the API directly</li><li>The widget grabs data from someservice that's running in thebackground, which polls the server</li><li>Somehow Facebook implemented push onAndroid which I don't think exists</li><li>The widget somehow detects that theuser is using the screen and grabsthe data on demand</li></ol>","135199","","","","","2010-09-13 12:01:00","How does the Facebook for Android app's home screen widget work?","<android><facebook>","4","0","","",""
"2208912","1","","","2010-02-05 17:07:19","9","13259","<p>Can you please tell me how can my activity detect user pressing <kbd>HOME</kbd> key?</p><p>Thank you.</p>","125440","","1306419","","2013-09-13 23:17:55","2014-03-21 04:31:35","How can I detect user pressing HOME key in my activity?","<android>","8","0","8","",""
"2208927","1","","","2010-02-05 17:08:22","0","171","<p>The javax.xml.transform package is not included in the Android SDK, so how to write a dom doc to a file? </p>","164460","","","","","2010-02-05 17:56:47","android xml to file","<xml><android><dom>","2","0","","",""
"2209022","1","","","2010-02-05 17:22:10","0","1078","<p>What is the best documentation for the RelativeLayout layout algorithm? </p><p>In the layout below, the edittext gets rendered on top of the textview. This seems wrong since the EditText has android:layout_below=""@id/textview"". </p><p>If I remove the android:layout_centerInParent=""true"" on the TextView, then the EditText is pushed below the TextView. Can anyone explain the algorithm that causes this to happen? Is this the intended behavior?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/ android""        android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:id=""@+id/main""         &gt;     &lt;RelativeLayout android:layout_width=""wrap_content""                     android:layout_height=""wrap_content""                     android:layout_centerInParent=""true""                     android:id=""@+id/inner""             &gt;         &lt;TextView                 android:id=""@+id/textview""                 android:layout_centerInParent=""true""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                 android:text=""@string/hello""                 /&gt;         &lt;EditText                 android:layout_below=""@id/textview""                 android:id=""@+id/textfield""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                 android:text=""@string/hello""                 /&gt;     &lt;/RelativeLayout&gt; &lt;/RelativeLayout&gt; </code></pre>","","user267278","","","","2010-02-05 19:40:29","Details of RelativeLayout in Android","<android>","2","0","","",""
"2209131","1","2209710","","2010-02-05 17:40:41","0","4970","<p>How can I trigger the software keyboard and add listeners to it's keys?</p>","260511","","114066","","2010-03-03 08:32:53","2013-04-04 07:48:57","How to Trigger the soft keyboard?","<java><android><keyboard>","3","0","0","",""
"2209406","1","2219627","","2010-02-05 18:26:00","8","20999","<p>I have been attempting to implement the 'advanced' <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">tabwidget</a> example from google.  But, when it tries to call <code>tabHost.addTab(spec);</code> I get a stack trace from the debugger.  Sorry, I don't have the stack trace here, but I'm wondering if others have had this same issue (as this code had a number of typo's and missing information that stopped me from even compiling.</p><p>Can anyone point me to a corrected/running version of this code?</p><p>The updated information needed are:</p><pre><code>&lt;activity android:name="".ArtistsActivity""&gt;&lt;/activity&gt;&lt;activity android:name="".AlbumsActivity""&gt;&lt;/activity&gt;&lt;activity android:name="".SongsActivity""&gt;&lt;/activity&gt;</code></pre>","54200","","54200","","2010-02-11 02:30:18","2011-08-17 19:10:50","Issues with Android TabHost Example","<android><android-tabhost>","4","2","7","",""
"2209513","1","2210073","","2010-02-05 18:46:58","29","30733","<p>I have application A defined as below:</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name=""com.example.MyExampleActivity""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;&lt;/application&gt;</code></pre><p>Now in application B, how can I write the code to start the activity in application A? Thanks!</p>","256239","","","","","2014-01-04 23:17:22","How to start activity in another application?","<android>","3","0","9","",""
"2209624","1","2209707","","2010-02-05 19:03:50","6","2270","<p>I'm trying to create a simple map in androi (I want to add GPS coordinates later) in intellij 9.0.1 and I installed the sdk (and android 1.1 - 2.1 sdk platform support and google api 3-7).I created a new android project and I selected android 2.0.</p><p>Now I added  to my AndroidManifest.xml like all the tutorials say, however when I run this class it isn't found.Does anyone know wether I'm doing something wrong or where I can find this package></p>","211992","","","","","2011-04-06 14:34:18","creating android map in intellij","<android><intellij-idea>","2","0","1","",""
"2210289","1","","","2010-02-05 20:44:47","3","576","<p>I'm a young, inexperienced programmer (I've had a year of Java, some MATLAB, and HTML/CSS in school) but I've decided that to get better, I'm making it my goal to produce a simple smartphone app of some kind this year- probably either webOS or Android since I'm on a PC and can't afford a Mac just to write an iPhone app.  </p><p>So my question is, where do I start?  I've read the threads about How to Write for Android and such, but I'm not sure I have enough Java experience to just jump right in.  And then there's webOS which is based on JavaScript, correct?  </p><p>I guess I'd just like some input from more experienced folks.  I have some Barnes and Noble book credit I'm looking to get rid of too, so if there's a guide you think would be useful, feel free to request.</p><p>tl;dr: Programming newbie ultimately wants to build a simple smartphone app.  Where do I start?</p>","267384","","","","","2010-03-19 14:08:54","Looking to eventually build a smartphone app","<android><webos>","5","0","","",""
"2210653","1","2210785","","2010-02-05 21:42:30","8","4717","<p>The Android Market Developer Console shows two numbers for your submitted application; ""total"" and ""active installs"".  What exactly does the ""active installs"" number mean?  Is it affected by application upgrades?  </p><p>For example:</p><ol><li>500 users install v1.0 of an app</li><li>v2.0 of the app is released and all 500 people upgrade via the Market.</li><li>Assume no one uninstalls.</li></ol><p>Does that yield a ""total"" of 1000 because the APK was downloaded 1000 times...but an ""Active Installs"" of 500 (50%) because, in the end, only 500 people are running the app? Does an upgrade get counted as an uninstall followed by an install?</p>","262119","","","","","2012-11-18 05:09:53","How is the ""Active Installs"" count/percentage in the Android ""Developer Console"" calculated?","<android>","3","0","0","2012-07-28 15:11:42",""
"2210668","1","","","2010-02-05 21:44:41","1","508","<p>I wanted to use an intent-filter, such that if a user clicks a URL with a certain domain, they can view the url in my native app (if installed of course). So I have the intent filter looking like this:</p><pre><code>&lt;data android:host=""www.mysite.com"" android:scheme=""http""&gt;&lt;/data&gt;</code></pre><p>is there a way to refine that rule to something like this:</p><pre><code>&lt;data android:host=""www.mysite.com/farm"" android:scheme=""http""&gt;&lt;/data&gt;</code></pre><p>so, I don't want to open my app unless the url is using the subfolder ""farm"". If my app were to get called with just the plain domain, it would have nothing useful to do - it's only useful if the user is clicking a link pointing to the ""farm"" sub folder.</p><p>Thanks</p>","246114","","","","","2013-04-15 14:37:22","intent-filter with a url - how do we limit scope?","<android>","2","0","1","",""
"2210976","1","2211007","","2010-02-05 22:44:24","3","2953","<p>As you can see from the screenshot below, the ""titlebar"" is getting these ugly banding lines across the areas with text that extend the entire width of the screen. It's even more noticeable on a real device.</p><p>Is there any way to work around this?</p><p><a href=""http://imgur.com/clHK1"" rel=""nofollow""><img src=""http://i.imgur.com/clHK1l.png"" alt=""activity""></a></p>","76835","","","","","2013-02-19 18:09:40","Android view dithering","<android><user-interface><dithering>","1","0","2","",""
"2211008","1","2211052","","2010-02-05 22:50:27","1","1303","<p>As you can see from the screenshot below I have a <a href=""http://developer.android.com/reference/android/widget/ListView.html"" rel=""nofollow"">ListView</a> with multiple items in it. No matter what I try I can't seem to make the list item's not be selectable. I've tried all of the follow (in the XML layout for the ListView), but the items are STILL selectable with both a finger and the scroll wheel.</p><pre><code>android:clickable=""false"" android:longClickable=""false"" android:focusable=""false"" android:focusableInTouchMode=""false""</code></pre><p>Any suggestions?</p><p><a href=""http://imgur.com/clHK1"" rel=""nofollow""><img src=""http://i.imgur.com/clHK1l.png"" alt=""activity""></a></p>","76835","","","","","2012-01-25 14:13:09","Disabling ListItem selectability","<android><listview><user-interface>","1","0","0","",""
"2211098","1","2211953","","2010-02-05 23:05:58","0","443","<p>Seems like I must be doing something basic very wrong, but the resultsare strange, and I'm having trouble tracking the problem down.</p><p>This is in my my Activity's onCreate()</p><pre><code>PreferenceManager.setDefaultValues(this, R.xml.metronome_preferences, false);mSharedPrefs=PreferenceManager.getDefaultSharedPreferences(this);</code></pre><p>The following code lives in onStart().</p><pre><code>Map&lt;String,?&gt; map = mSharedPrefs.getAll();boolean t = mSharedPrefs.contains(""tempo_list_pref"");Log.d(logID, ""t= "" + t + "" preferences="" + map.toString());mBPMOption = mSharedPrefs.getLong(""tempo_list_pref"", 100);</code></pre><p>Log cat correctly shows:</p><p>02-05 11:14:27.605: DEBUG/Metronome(16147): t=truepreferences={graphics_list_pref=1, conduct_list_pref=12.0f,tempo_list_pref=140, audio_list_pref=2, meter_list_pref=5}</p><p>mBPMOption is a long. The shared prefs object is apparently valid as I can both retrieve the preferences as a map, and test for the presence of a preferences, butthe call to getLong() causes ClassCastExceptions to be recursively thrown. At least, that'show I'm interpreting what I'm seeing in the debugger. The error objecte contains e.cause, e.cause.cause, ... .</p><p>I'm getting this same error in the emulator and on the Google ION devphone.</p><p>Any thoughts on this would be appreciated.</p>","267257","","","","","2010-02-06 03:53:26","Baffling recursive ClassCastExceptions when reading Android default shared preferences","<android>","1","0","","",""
"2211248","1","2211290","","2010-02-05 23:43:01","7","7940","<p>Is it possible to choose a custom location for the sqlite database file? </p><p>If possible I want to store the database file in the memory card. And if user switches from one memory card to the other I want my application to use whatever version of the database file available on the card. </p>","33885","","","","","2010-02-06 10:24:46","Using custom file for Android sqlite database","<android><sqlite>","2","0","2","",""
"2211390","1","2213025","","2010-02-06 00:20:43","2","801","<p>I have a J2ME CLDC Blackberry app which I need to port to the Android. Some of the features:</p><ul><li>client/server communication using HTTPS</li><li>reading/writing PIMs, files on device memory, SD card</li><li>listeners on PIMs changes</li><li>small UI: login page and simple status screen</li></ul><p>Lines of code: 4000</p><p>Any idea what is the amount of work to do that? Let say if Blackberry app took X days, is the port going to take X/4 days, X/2 days, X days?</p><p>Laurent</p>","160941","","67407","","2010-03-29 07:12:42","2010-03-29 07:12:42","Android - Estimate port of BlackBerry app with PIM and networking","<android><blackberry><porting><estimation>","1","0","0","2012-07-28 15:07:14",""
"2211503","1","","","2010-02-06 00:58:59","0","53","<p>I would like to write an application that would run initially on a Motorola Droid.  The application would retrieve row(s) from a database and display some textual data from the rows as well as an image associated with the record that will be stored on the SD card.</p><p>I really think that the results would be best displayed in a fashion similar to the Calendar app that ships with the Droid - that is the data  and associated image will scrollable left and right by dragging the current ""page"".  </p><p>I assume that some of you will know how this is implemented - I dont' seem to be able to ask the right question when searching.  Any help would be appreciated.</p>","267508","","153498","","2010-02-06 01:00:03","2010-02-06 01:22:46","droid user interface implemenation","<android><user-interface>","1","0","","",""
"2211543","1","2270103","","2010-02-06 01:11:06","3","3007","<p>On the Nexus One (at least in 2.1-update1, and I think in 2.1), there is a setting under Sound &amp; Display: ""Pulse notification light"". This doesn't seem to be present on the ""2.1 with Google APIs"" emulator image. I've not yet checked any other devices.</p><p><img src=""http://chris.boyle.name/images/20100206-pulse-trackball.png"" alt=""Pulse notification light: Pulse trackball light repeatedly for new notifications"" title=""Pulse notification light: Pulse trackball light repeatedly for new notifications""></p><p>I want to set this programmatically without user interaction, in order to make a Locale plugin, so the device can grab my attention when I'm awake at my desk, without having it floodlighting the room when someone spams me at 4am. It's quite bright.</p><p>I didn't see it in <a href=""http://developer.android.com/reference/android/provider/Settings.System.html"" rel=""nofollow"">android.provider.Settings.System</a> where many other things on this screen live, so I had a look in the platform source. There are some relevant parts in NotificationManagerService, in <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/java/com/android/server/NotificationManagerService.java#l748"" rel=""nofollow"">enqueueNotificationWithTag</a> and <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/java/com/android/server/NotificationManagerService.java#l966"" rel=""nofollow"">updateLightsLocked</a>. That goes off into <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/java/com/android/server/HardwareService.java#l292"" rel=""nofollow"">HardwareService</a> which seems well past the point of caring about user settings. I've no idea where this setting is implemented or how I might influence it.</p><p>I fully expect the answer to be ""there is no API for this"" (perhaps related to it being Nexus One specific), and that the best I can do is to schedule (using Locale or something else) an Intent of <a href=""http://developer.android.com/reference/android/provider/Settings.html#ACTION_DISPLAY_SETTINGS"" rel=""nofollow"">ACTION_DISPLAY_SETTINGS</a> to remind me to set the box manually, which would suck. I'm hoping that I've missed something, or that <a href=""http://android-developers.blogspot.com/2009/12/hello-stack-overflow.html"" rel=""nofollow"">a Googler is reading this</a> and can tell me that this is planned for addition to the API?</p>","6540","","","","","2010-02-16 10:40:30","Change ""Pulse notification light"" / trackball light setting on Android (Nexus One only?)","<android><settings><notifications><light><trackball>","1","0","1","",""
"2211689","1","2212803","","2010-02-06 02:02:23","8","13861","<p>I've downloaded one of the open source Android Applications (the music application) from the Android git, and I'm trying to create a new project from the source. Creating a new project using that existing source doesn't work giving me an ""invalid description error"". Any help?</p>","118241","","","","","2011-04-06 00:21:09","Create Eclipse Project from Android Git","<java><android><eclipse><git>","3","0","2","",""
"2211987","1","2212612","","2010-02-06 04:03:43","1","1722","<p>I just uploaded my first app to the Android marketplace and one comments says, ""It force closes on G1"". What version of the Android OS does the G1 use?</p>","267369","","844882","","2012-03-17 05:37:54","2012-03-17 05:37:54","What version of Android is on the G1?","<android>","5","1","","",""
"2212076","1","2212130","","2010-02-06 04:36:16","1","375","<p>I have a very vague questions to ask about a crashing android application.</p><p>Users are reporting to me that my application is crashing when they get something correct.</p><p>Basically it words like this: user answers the question correctly --> Display Toast--> send message to my service --> update screen from information received from the service</p><p>I have tested this on my G1 and have never see this on the emulator even with different screen sizes and resolutions.  I tried putting try catch blocks around all my screen updating code but they are still reporting errors.</p><p>My guess is that the service might be terminating or something.  But that is just a guess.  Any ideas?</p><p>I am trying to get more information from the users but the Android Market commenting system is lacking in this respect.</p>","248521","","","","","2010-02-06 16:17:23","My users are reporting my app is crashing - I never see this in the emulator","<android>","3","0","6","2012-07-28 15:03:58",""
"2212197","1","2212210","","2010-02-06 05:38:45","74","34803","<p>I am writing a custom implementation of a ListAdapter.</p><p>In its constructor, I'm taking in a Context, a resource ID (i.e. R.id.xxx representing the layout file), and a list and a map (these contain the data).</p><p>Now, the problem is that i will need a LayoutInflater to get the View object which is in the separate layout XML file.</p><p>How can I get hold of the LayoutInflater given only the Context?</p><p>Now, why I think this is possible, is that this is quite similar to what is being passed in to the constructor of an ArrayAdapter (context, resource, textViewResourceId, data array), and I figure the ArrayAdapter also has to make use of a LayoutInflater given only a Context.</p><p>But how can it be done?</p>","254959","","645270","","2012-10-29 15:43:56","2013-08-26 13:55:53","How to Get a Layout Inflater Given a Context?","<android><listview><listadapter>","3","0","18","",""
"2212536","1","","","2010-02-06 08:30:38","0","322","<p>So I just learned about jQTouch and others (PhoneGap?) and there seems to be great work being done in this space.  I have a Rails app and would like a single production-quality mobile version that will work across the aforementioned platforms (and others?), with minimal extra development work.</p>","95956","","95956","","2010-02-06 18:23:04","2010-02-06 18:23:04","A single smartphone-compatible (iPhone, Blackberry, Android) mobile version for a Rails app?","<iphone><android>","1","0","1","",""
"2212551","1","2214080","","2010-02-06 08:38:48","0","4211","<p>I'm using <a href=""http://en.wikipedia.org/wiki/IntelliJ_IDEA"" rel=""nofollow"">IntelliJ IDEA</a> 9 (9.0.1) to create a simple map application (or at least trying to).I'm using <a href=""http://en.wikipedia.org/wiki/Android_%28operating_system%29"" rel=""nofollow"">Android</a> 2.0 with Google API's 2.0.</p><p>Manifest:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""          package=""com.example""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".MyActivity""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN""/&gt;                &lt;category android:name=""android.intent.category.LAUNCHER""/&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name="".disaster""/&gt;        &lt;activity android:name="".map"" android:label=""@string/app_name""  android:theme=""@android:style/Theme.NoTitleBar""/&gt;        &lt;uses-library android:name=""com.google.android.maps"" /&gt;    &lt;/application&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;&lt;/manifest&gt;</code></pre><p>Class:</p><pre><code>public class map extends MapActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.map);        Button saveMe = (Button) findViewById(R.id.backBtn);        saveMe.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                Intent myIntent = new Intent(view.getContext(), MyActivity.class);                startActivityForResult(myIntent, 0);            }        });    }    @Override    protected boolean isRouteDisplayed() {        return false;  //To change body of implemented methods use File | Settings | File Templates.    }}</code></pre><p>View:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/map""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/wall""    &gt;        &lt;View android:id=""@+id/mv""       class=""com.google.android.maps.MapView""       android:layout_width=""fill_parent""       android:layout_height=""fill_parent""       android:enabled=""true""       android:apiKey=""08zxVQUd22SOeAuv8AEMS5hBAeOdll4OzDrNYpQ""/&gt;       &lt;Button android:id=""@+id/backBtn""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:text=""@string/backBtn""/&gt;&lt;/LinearLayout&gt;</code></pre><p>This just gives me an empty screen.</p><p>What I'm doing wrong?</p><p>Edit: clarified my OP.</p>","211992","","63550","","2010-02-06 21:46:25","2011-04-07 10:47:01","Android 2.0 SDK map not showing","<android><google-maps><intellij-idea>","4","0","","",""
"2213190","1","","","2010-02-06 13:13:17","11","2154","<p>We would like to enable or disable widgets via code.  When we say ""disable"" we mean that a widget which is registered in an application should not show up in the list of widgets available to the user when they try to add a widget to their home screen. This question has been asked, unfortunately, many times without answer.  </p><p>There was one response by Dianne Hackborn to a separate widget question which suggested that it was possible to use the package manager to disable widgets: </p><pre><code>PackageManager pm = context.getPackageManager(); pm.setComponentEnabledSetting(new ComponentName(""com.example.android.apis"", "".appwidget.ExampleBroadcastReceiver""),     PackageManager.COMPONENT_ENABLED_STATE_ENABLED, // or DISABLED     PackageManager.DONT_KILL_APP); </code></pre><p>This, however, does not work.  The widget component will still appear in the list of widgets.  It may be that the AppWidgetService (located in the Android source's Base.git at \src\base\services\java\com\android \server), which loads the list of available widgets, caches this list of available widgets.  If that were the case, though, then the above code which enables or disables the widget component would work after a device reset because there would be no cache; it does not. </p><p>I have also tried looking into overriding some methods of the AppWidgetProvider, such as filtering out any events.  I don't think this will go anywhere, because the AppWidgetService, which populates the list, uses the Package Manager to find all components which catch the ACTION_APPWIDGET_UPDATE action on startup and when a package is added (i.e. a new app is installed).  The only time that a provider is removed from this list is on a ACTION_PACKAGE_REMOVED broadcast. So given that the providers will always be there, regardless of the enabled/disabled state of the component, I have looked into the actual list activity which is shown from the Launcher app when the user long- clicks the desktop and adds a widget:  AppWidgetPickActivity in Settings.GIT in com.android.settings.  This, unfortunately, populates the list directly from the AppWidgetService, without any filtering for the component's enabled status:     void putInstalledAppWidgets(List items) {         List installed = mAppWidgetManager.getInstalledProviders();         putAppWidgetItems(installed, null, items);     } </p><p>I would love to see if anyone has overcome this hurdle.  Perhaps I am going about it the wrong way.  All I want is to be able to remove a widget from the list of widgets available to the user when they try to add a widget to their home screen. </p>","267728","","1790644","","2012-12-11 23:13:12","2014-03-10 22:52:34","Dynamically enabling or disabling a widget does not work","<android><widget>","3","1","4","",""
"2213949","1","2214044","","2010-02-06 17:25:30","1","1918","<p>I have an Android Activity that uses a class that I developed that extends a View (let's call it FooView).  I'd like to launch a dialog box when a particular event happens in FooView.  It seems from all I've read that the dialog box must be launched from the Activity class using showDialog().  I can't seem to find any example showing how to launch a dialog from a View.</p><p>So I'm wondering how this can be accomplished.  Do I need to send an Intent from FooView to the Activity?  Or register a callback from the Activity that is called by FooView?</p><p>Thanks in advance.</p>","244104","","","","","2010-02-06 17:53:49","Launch an Android dialog box from a View","<android><dialog>","1","0","1","",""
"2214090","1","","","2010-02-06 18:07:19","14","8720","<p>I saw this Google IO session: <a href=""http://code.google.com/intl/iw/events/io/2009/sessions/WritingRealTimeGamesAndroid.html"">http://code.google.com/intl/iw/events/io/2009/sessions/WritingRealTimeGamesAndroid.html</a><br>He says that the draw_texture function is the fastest and VBO is 2nd faster.<br>But I don't understand how to use it(the draw_texture method or the VBO way).  </p><p>Any suggestion?</p>","261377","","44729","","2010-06-18 15:04:33","2012-10-09 02:58:49","What is the easiest way to draw texture with OpenGL ES?","<java><android><opengl-es>","2","6","5","",""
"2214336","1","2214389","","2010-02-06 19:06:27","2","1752","<p>My users are sending unhandled exceptions to me via <a href=""http://code.google.com/p/android-remote-stacktrace/"" rel=""nofollow"">http://code.google.com/p/android-remote-stacktrace/</a></p><p>I am getting the following but have no idea what it means.</p><pre><code>java.lang.IndexOutOfBoundsException: getChars (7 ... 0) has end before start   at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:935)   at android.text.SpannableStringBuilder.getChars(SpannableStringBuilder.java:847)   at android.text.TextUtils.getChars(TextUtils.java:69)   at android.text.SpannableStringBuilder.&lt;init&gt;(SpannableStringBuilder.java:59)   at android.text.SpannableStringBuilder.subSequence(SpannableStringBuilder.java:839)   at android.widget.TextView.extractTextInternal(TextView.java:4541)   at android.widget.TextView.reportExtractedText(TextView.java:4580)   at android.widget.TextView.finishBatchEdit(TextView.java:4723)   at android.widget.TextView.endBatchEdit(TextView.java:4705)   at com.android.internal.widget.EditableInputConnection.endBatchEdit(EditableInputConnection.java:54)   at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:586)   at android.view.inputmethod.BaseInputConnection.commitText(BaseInputConnection.java:174)   at com.android.internal.widget.EditableInputConnection.commitText(EditableInputConnection.java:120)   at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:231)   at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:57)   at android.os.Handler.dispatchMessage(Handler.java:99)   at android.os.Looper.loop(Looper.java:123)   at android.app.ActivityThread.main(ActivityThread.java:4338)   at java.lang.reflect.Method.invokeNative(Native Method)   at java.lang.reflect.Method.invoke(Method.java:521)   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)   at dalvik.system.NativeStart.main(Native Method)</code></pre>","248521","","","","","2011-09-24 03:27:03","java.lang.IndexOutOfBoundsException: getChars (7 ... 0) has end before start","<android>","2","0","","",""
"2214377","1","2218875","","2010-02-06 19:23:01","2","6807","<p>If I run several emulators with -no-window option in one machine. The command ""adb devices"" shows:</p><pre><code>List of devices attachedemulator-5554  deviceemulator-5556  deviceemulator-5558  device...</code></pre><p>However, according to this output, I can't tell the difference between each emulator device at all. I need to know which emulator runs on what AVD, then I can install APKs or send commands to the emulator.</p><p>How can I recognize each emulator device or get the serial number of emulator after it runs?</p>","248557","","248557","","2010-02-07 15:51:17","2013-05-24 14:39:52","How to Get Serial Number or ID of Android Emulator After it Runs?","<android><emulator>","4","0","2","",""
"2214532","1","","","2010-02-06 20:02:22","1","1071","<p>I need to create an Application that can lock the handset at some specific Event.</p><p>either i want to make use of Require Pattern programatically.</p><p>or create a lock application, just like windows mobile in which there are digits to be entered instead of a Pattern.</p><p>please guide me to the path if creating this application is possible.</p><p>regardsAftab Alam</p>","","user267866","","","","2011-04-18 18:05:21","Creating a phone software lock Application for android","<android>","2","0","","2012-07-28 15:01:33",""
"2214623","1","","","2010-02-06 20:38:08","0","2874","<p>I enabled text filtering on my ListView in the expected way; adding <code>android:textFilterEnabled=”true”</code> in resource definition and (as I'm using a SimpleCursorAdapter) setting a FilterQueryProvider that provides a filtered cursor like so:</p><pre><code>public Cursor runQuery(CharSequence constraint) {    Cursor cur = mDba.fetchTrackers(mCurrentGroupId, constraint.toString());    startManagingCursor(cur);    return cur;}</code></pre><p>My question is this: once the user selects a list item, goes off to another activity, and returns to this one, how can I control the state of the filter previously applied?</p><p>What I'm seeing right now is that when I return to the activity, the cursor being used is the unfiltered one set on the filter at creation, but the filter text they typed is still shown (and typing keys causes the filter to be applied).</p><p>What I'd like to do is either clear the filter, or keep the filtered cursor that the activity was left with.</p>","262768","","161201","","2010-02-06 20:39:59","2010-07-15 10:55:40","Returning to a ListView with a text filter","<android><listview><filter>","1","0","1","",""
"2214735","1","2214777","","2010-02-06 21:07:35","3","15348","<p>I want to do an animation with several image-files, and for this the AnimationDrawable works very well. However, I need to know when the animation starts and when it ends (i.e add a listener like the Animation.AnimationListener). After having searched for answers, I'm having a bad feeling the AnimationDrawable does not support listeners..</p><p>Does anyone know how to do frame-by-frame image animation on Android? </p>","267886","","","","","2013-09-17 19:56:00","Android AnimationDrawable and knowing when animation ends","<android>","9","0","7","",""
"2215004","1","","","2010-02-06 22:36:09","2","4126","<p>The Android documentation describes how to disable the search the search feature in Activity:public boolean onSearchRequested() {    return false; }</p><p>This works fine for a short press of the search button on the Nexus One.However, it doesn't disable the long press, which still fires off a voice search.</p><p>How do I disable the long press Voice search?</p><p>Thanks...</p>","267922","","","","","2011-10-04 00:17:07","Android - how to disable long press on Search button (Nexus One)","<android><search>","3","0","3","",""
"2215028","1","2216146","","2010-02-06 22:44:21","0","3472","<p>I am a new comer to Android development so I imagine I have a simple problem, but I can't seem to figure out what's wrong.</p><p>I basically copied the LunarLander game example from the samples, but I tried to to only copy the parts I needed to make a little pong game or something.  But for some reason, onKeyUp and onKeyDown are not getting called.  Part of the problem is I'm still not exactly sure what the debugging methodology for Android is.</p><pre><code>public class PongView extends SurfaceView implements SurfaceHolder.Callback{...    /**      * Standard override for key up.  Used to move the paddles     * @return     */    @Override    public boolean onKeyUp(int keyCode, KeyEvent msg) {            return thread.doKeyUp(keyCode, msg);    }    @Override    public boolean onKeyDown(int keyCode, KeyEvent msg) {        return thread.doKeyDown(keyCode, msg);    }...}</code></pre><p>EDIT SOLUTION:</p><p>I forgot to put this line in my View's constructor.</p><pre><code>    setFocusable(true);</code></pre>","226773","","226773","","2010-02-09 03:52:05","2010-02-09 03:52:05","Android View onKeyUp() not getting called","<android><view>","2","0","","",""
"2215069","1","2215119","","2010-02-06 22:56:26","6","3672","<p>Just a small problem really, I'm wanting to place the current year into the footer of my apps. Each footer is a TextView and is seen on menu screens etc. Is there a way to insert the year into this dynamically?</p><p>Cheers,Laurence</p>","173892","","","","","2010-02-06 23:14:21","Inserting the current year into a TextView","<android><date>","1","0","","",""
"2215307","1","2232623","","2010-02-07 00:12:55","3","1712","<p>I'm trying to make it so that as long as a user is touching the button, it shows one image, and when the user releases the button, it goes back to a default image.</p><p>I'm trying to use a selector to make this happen:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;item android:state_pressed=""true""    android:drawable=""@drawable/record_on"" /&gt;  &lt;item android:state_focused=""true""    android:drawable=""@drawable/record_off"" /&gt;  &lt;item android:drawable=""@drawable/record_off"" /&gt;&lt;/selector&gt;</code></pre><p>I've tried a few things with the selector, but it always produces the same behavior: the button starts out with the default image, then I press it and it changes to the ""record_on"" image and it never goes back to the default image when I let go.</p><p>Is there a way to get this kind of behavior with an ImageButton, or should I be using something different?</p>","267934","","","","","2010-02-09 21:33:57","Android: How do I switch the image of an ImageButton when the user releases the button?","<android><gui><layout><imagebutton>","2","0","","",""
"2215390","1","","","2010-02-07 00:39:54","1","8497","<p>I hate to ask this question; for some reason I can't figure it out on my own.  I have a vertical LinearLayout that contains a custom View that I've defined in my app and and a TextView.  I'd like my custom View to be aligned on the top of the screen and the TextView to be aligned at the bottom of the screen.  Unfortunately, no matter what changes I make to the attributes of the XML file, my custom View always seems to be centered vertically when I run the emulator.  The xml is like the following:</p><pre><code>&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" android:gravity=""top""&gt;    &lt;CustomView     android:id=""@+id/customID""        android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                tileSize=""24""                android:focusableInTouchMode=""true"" android:layout_gravity=""top""/&gt;    &lt;TextView     android:id=""@+id/text""        android:text=""@string/droidtactoe_layout_text""        android:visibility=""visible""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:gravity=""center_horizontal""        android:textSize=""24sp"" android:textColor=""#00000000"" android:layout_gravity=""bottom""/&gt;&lt;/LinearLayout&gt;</code></pre>","267957","","267957","","2010-02-07 00:46:41","2010-05-26 17:00:08","Alignment of View Elements within a LinearLayout","<android>","2","0","","",""
"2215675","1","","","2010-02-07 02:29:21","0","389","<p>Hey guys. I'm trying to make a simple game for Android in which the player drags a space ship with one thumb and fires at enemy ships by tapping empty space with the other thumb. Thing is, to animate the bullets traveling across space, I need the list of points between the user's spaceship, and the end of the screen, the line passing through the place the user tapped. </p><p>I know I have to parametrize the line, and have read some about the subject, but I can't quite grasp it, especially on how to convert it to code. The way I see it, I need to convert the line segment between the user's ship (P1) and the place the user taps (P2) the smallest possible piece, the rate of change between x and y, the slope, I guess. Once I have that I can just multiply the rate of change by the distance from P1 to get the desired point. </p><p>But it ain't quite working. Any help would be appreciated. Thanks.</p><p>EDIT:This is what I was doing. This is all to calculate the rate of change, which I use on the Beam's update method to update it's position by multiplying it by speed...</p><pre><code>Beam(Renderer r, float OX, float OY, float TX, float TY){    super(r);    p.x = (int) OX;    p.y = (int) OY;    paint = new Paint();    paint.setColor(Color.BLUE);    float X = TX - OX;    float Y = TY - OY;    boolean xPositive = X &gt;= 0;    boolean yPositive = Y &gt;= 0;    if(X &lt; Y)    {        RateOfChangeX = Math.abs(X) / Math.abs(Y);        RateOfChangeY = 1;    }    else    {        RateOfChangeX = 1;        RateOfChangeY = Math.abs(Y) / Math.abs(X);    }    if(RateOfChangeX &lt; 0 &amp; xPositive)    {        RateOfChangeX = RateOfChangeX * -1;    }    if(RateOfChangeY &lt; 0 &amp; yPositive)    {        RateOfChangeY = RateOfChangeY * -1;    }}</code></pre>","","user267643","","user267643","2010-02-07 03:23:05","2010-09-07 09:14:16","How do I determine the points in a line, in order, from P1 to P2?","<java><android>","3","0","0","",""
"2215696","1","2217209","","2010-02-07 02:41:44","0","922","<p>if google voice is installed on your phone, when you dial a phone number a context menu pops up asking if you want to dial with or without google voice. I would like to accomplish the same task for dialing a number or sending a text message. Does the API allow you to do that?</p><p>It seems there is a process_outgoing_calls, in the permissions manifest, but is there anything for the SMS?</p>","239375","","239375","","2010-02-07 02:53:50","2010-02-07 15:22:31","Context menu before sending SMS","<android><android-manifest>","2","0","1","",""
"2215719","1","","","2010-02-07 02:59:29","0","823","<p>I have installed NetBeans 6.8 on my Mac OS X (Leopard) system and use the Kenai plugin for this platform to create an Android application.  The trouble is that I cannot run the Android emulator from NetBeans logged in to the Mac as a normal user.  I can run the emulator from the command line and the Eclipse environment when logged in as root.  When I try to run NetBeans as root, it displays a message indicating many of components of the Android plugin cannot be loaded because the root user somehow links to Java 1.5 and the plugin needs Java 1.6.  </p><p>There are 3 solutions to this problem as far as I can see:</p><ol><li>Make the root user environment link to Java 1.6 and use NetBeans as root.</li><li>Coerce NetBeans to su to root before running the Emulator.</li><li>Stick to using Eclipse for Android development.</li></ol><p>If anyone knows how how to do 1 or 2 I would appreciate getting advice from you.  Thanks in advance.</p>","245087","","30461","","2010-08-26 10:33:08","2010-08-26 10:33:08","Is it possible to run the Android emulator as root from NetBeans on the Mac","<android><osx><plugins><netbeans6.8>","1","1","","",""
"2216183","1","2216196","","2010-02-07 06:33:27","0","467","<p>In Python, I use a class called ""urllib"".<br>I'd just  like a simple function where I can download the HTML of a webpage.</p>","179736","","","","","2010-02-07 06:38:50","In Android, how do I download the HTML of a webpage?","<java><html><android><curl>","1","0","1","",""
"2216201","1","2216219","","2010-02-07 06:42:59","22","37607","<p>How can I convert editable text into string in Android ? Any solution?</p>","263325","","63550","","2010-07-30 16:30:11","2012-04-05 13:56:46","Editable text to string","<android>","3","3","4","",""
"2216225","1","2216303","","2010-02-07 07:01:59","3","3486","<p>When the user opens the application, there is a screen with a button on it, which says ""login.""</p><p>The user clicks on the button, and a webview pops up to allow him to log in to the website.</p><p>After logging in (the app would need to know somehow), the webview would disappear, and then a list of usernames will pop up. (ListView?)</p><p>When the user clicks on one of the usernames, a webview of the username's profile will pop up.  Of course, when the user pushes ""back"", it goes back to the list of usernames.</p><p>Can someone explain this to me in terms of <strong>Activity and Views</strong>? Am I using two activities to do this? Do I hide webview or listview when the user clicks between them? </p><p>I did the tutorial (notepad tutorial), but I'm still confused as to what is the best way to develop this.</p><p>Thanks</p>","179736","","","","","2010-02-07 08:03:06","In Android, how would you develop this? (activity and views question)","<java><android><listview><mobile><webview>","3","5","3","",""
"2216463","1","2216483","","2010-02-07 08:53:39","0","878","<p>My application after an update needs to fill its ContentProvider with some data found on the server.I found that starting a service from the ContentProvider.onCreate() method works but I'm not sure if it is a good idea or if it works randomly.</p><p>I don't know the initialization of an application in android. Are the services always already available before the content provider is created?</p>","64475","","","","","2010-02-07 09:24:51","Is it OK to start a service from the ContentProvider.onCreate()?","<android>","2","0","","",""
"2216811","1","2217193","","2010-02-07 13:00:06","5","6685","<p>I have a base view in XML.   </p><p><img src=""http://img513.imageshack.us/img513/7171/contextnotionlevelprefs.jpg"" alt=""http://img513.imageshack.us/img513/7171/contextnotionlevelprefs.jpg""></p><pre><code>&lt;RelativeLayout android:id=""@+id/RelativeLayout01"" android:layout_width=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_height=""wrap_content""&gt;&lt;TextView android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:text=""Family"" android:id=""@+id/Family"" android:textSize=""16px"" android:padding=""5px"" android:textStyle=""bold"" android:gravity=""center_horizontal""&gt;&lt;/TextView&gt;&lt;TextView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_below=""@+id/Family"" android:layout_alignRight=""@+id/Family"" android:text=""@string/context_notion_level_off"" android:id=""@+id/ContextNotionLevel""&gt;&lt;/TextView&gt;&lt;TextView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_toLeftOf=""@+id/Detailed"" android:layout_below=""@+id/Family"" android:layout_alignLeft=""@+id/Family"" android:textStyle=""bold"" android:id=""@+id/Module"" android:text=""Location""&gt;&lt;/TextView&gt;&lt;SeekBar android:layout_height=""wrap_content"" android:id=""@+id/SeekBar01"" android:layout_width=""fill_parent"" android:padding=""5px"" android:saveEnabled=""true"" android:layout_below=""@+id/Module"" android:max=""2""&gt;&lt;/SeekBar&gt;&lt;/RelativeLayout&gt;</code></pre><p>How can I repeat the section X times under, to look like here:<br><img src=""http://img687.imageshack.us/img687/4674/contextnotionleveldraft.png"" alt=""http://img687.imageshack.us/img687/4674/contextnotionleveldraft.png""></p><p>Then, how can I access the seekbar for all items?<br>Please note that I want this to be dynamical to work eg: for 15 times. </p><p>How will be able to give a name(Location), set value(seekbar value), and retrieve value for each group.</p>","243782","","243782","","2010-02-07 13:19:53","2013-02-06 06:42:32","creating dynamic view, multiple a view X times, get/set value for each group","<xml><android><layout>","1","0","6","",""
"2216839","1","","","2010-02-07 13:11:58","2","626","<p>I am developing a telephony tests on Android, I passed to work with Eclair. </p><p>I wish to know how can I work with sim card from code.I write tests that testing a sim card on our platform I has a code that use to work on cap cake and has many errors when transfered to Donut/Eclair. Some apis missing etc. Please help me I would like to get links for code examplesWhat apis (relevant to Eclair ) should I useWhat import to include at the top of my classWhat classes should I use...</p><p>Ilana</p>","268121","","","","","2012-08-07 03:07:22","Access SIM card from code, I look for code eamples","<android>","2","0","","",""
"2216934","1","2216959","","2010-02-07 13:44:09","2","845","<p>I know how to use handlers to update UI elements such as progress bars toasts etc.</p><p>The problem I am having is when the context goes away such as the user pressing the back button or the Activity finishing for some reason.  This causes my application to crash often.</p><p>I tried using getApplicationContext() (Thinking that this would be available throughout my entire application) but this did not work, ever - instead my application crashed!</p><p>I put try catch blocks around all UI update code, this works but is it necessary?</p><p>So...what is the bast way to handle this?</p>","248521","","","","","2010-02-07 13:53:13","Handling UI code from a Thread","<android>","1","0","","",""
"2217156","1","","","2010-02-07 15:04:04","0","1149","<p>Anyone have idea of parsing the ical calendar file with ical4j API for android app using eclipse as development environment.</p><p>I have added ical4j API, to my project, but getting some errors related to API.</p>","257580","","","","","2012-01-04 10:02:03","How to parse ical file(.ics) with ical4j API?","<android><file><parsing>","2","0","1","",""
"2217166","1","2217256","","2010-02-07 15:07:06","1","1168","<p>i just wanna know  is it possible to display the Calendar in the month view using the api available. i am searching for while dint find anything to display the calendar in the Month view . kindly help and let me know is this possible using android sdk1.5 or 1.6 or even 2.0. If not what would be the procedure to generate month view and highlighting the present date. </p><p>thank you for ur help.</p><p>regardsSheik</p>","143434","","","","","2010-02-07 15:41:02","Displaying Calendar in month view","<android><calendar>","1","1","","",""
"2217389","1","","","2010-02-07 16:36:44","1","765","<p>I'm trying to generate a notification which vibrates the phone and plays a sound when the screen is off (cpu turned off). According to the Log messages, the notification is being sent, but the phone doesn't vibrate or play the sound until I turn the screen on again. I tried holding a 2 second temporary wakelock (PowerManager.PARTIAL_WAKE_LOCK), which I thought would be ample time for the notification to be played, but alas, it still doesn't. </p><p>Any pointers to get the notification to run reliably? I'm testing this on an G1 running Android 1.6. </p><p>Code I'm using:</p><pre><code>notif.vibrate = new long[] {100, 1000};notif.defaults |= Notification.DEFAULT_SOUND;notif.ledARGB = Color.RED;notif.ledOnMS = 1;notif.ledOffMS = 0;notif.flags = Notification.FLAG_SHOW_LIGHTS;notif.flags |= NOTIF_FLAGS; //static varif (!screenOn) { //var which updates when screen turns off/on    mWakeLock.acquire(2000); }manager.notify(NOTIF_ID, notif);</code></pre>","268180","","268180","","2010-02-07 17:53:06","2010-03-27 09:00:03","Notifying when screen is off","<android><notifications>","1","1","","",""
"2217420","1","2226300","","2010-02-07 16:50:26","-1","4829","<p>Running XP sp3 when i click SDK Setup.exe command line promt comes up and goes away fast and nothing else happens is there a fix for this ?</p>","268184","","","","","2010-06-10 20:01:06","Android SDK Setup.exe will not run","<android><sdk><android-emulator><setup.exe>","4","19","","",""
"2217491","1","","","2010-02-07 17:10:20","4","4615","<p>I have a GridView, using a custom adapter (myAdapter extends BaseAdapter), where each item in the grid holds an ImageButton. getView() is working fine.</p><p>However, from elsewhere in my code, how can I update the image (setImageResource) for one particular item in the grid based on its position in the GridView?</p><p>So far, I've added this to my adapter class:</p><pre><code>public void changeImage() {        Log.d(TAG, ""Image change"");        this.ImageButton.setImageResource(R.drawable.newImage);}</code></pre><p>And would like to write something like this: <code>mygridview.getItemIdAtPosition(20).changeImage();</code> (doesn't compile).</p>","202807","","202807","","2010-02-21 16:15:00","2011-10-17 03:39:11","Android GridView - update View based on position","<android><gridview>","2","0","3","",""
"2217598","1","","","2010-02-07 17:40:39","3","1549","<p>Yes, I can get sensor update events with SensorEventListener. But this approach has 2 drwwbacks:</p><p>1) For some sensors I have to wait for the state to update. For example, temperature may update after a minute!</p><p>2) In some cases I can get incorrect readings. For example, the phone lies on a flat surface and does not move. I receive first orientation update event after listener registration. When only a part of the orientation vector changes, other parts may be 0. And it is no way to determine, is it a true 0 degree azimuth or just an incomplete vector. If I move the phone a little, the correct non-zero azimuth appears.</p><p>To solve this problems it's possible to create a separate thread that constantly monitors sensors. After some time it will certainly contain true values. But I think that it is an overhead for such simple task.</p><p>Is it any other way to get current sensor data?</p>","268205","","","","","2010-02-07 21:35:36","Android: get current sensor state","<android><sensor>","1","0","3","",""
"2217633","1","2332628","","2010-02-07 17:49:11","2","1631","<p>i'm creating an activity which needs to upload an image to a webservice using their api.</p><p>I found that if i use UrlEncodedFormEntity and send the image data through that. the webservice doesn't receive that. ( at least it will not be able to read that .)</p><p>In fact if i add some vars to send with the image data ( like name of the file, filesize ) they can be read from the webservice but the image data still doesn't appear if i try to read it serverside.</p><p>Right now i'm using UrlEncodedFormEntity with BasicNameValuePair as container for my data.</p>","314407","","","","","2010-02-25 08:33:35","How to send an image through HTTPPost?","<android><apache>","1","0","2","",""
"2217670","1","2218377","","2010-02-07 18:02:26","15","43480","<p>hi guys i'm having problems with implementing the double tap. Well i implemented the ongestureListener and i had the gesturedetector, but i'm not sure where is the problem, here is my code:</p><pre><code> public class home extends TabActivity implements OnGestureListener {    /** Called when the activity is first created. */ private EditText queryText; private ResultsAdapter m_adapter; private ProgressDialog pd; final Handler h = new Handler(); private TabHost mTabHost; private ArrayList&lt;SearchItem&gt; sResultsArr = new ArrayList&lt;SearchItem&gt;(); private String queryStr; private JSONObject searchResponse; private GestureDetector gestureScanner; final Runnable mUpdateResults = new Runnable() {        public void run() {         updateListUi();        }    }; @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button search = (Button)findViewById(R.id.search);        Button testButt = (Button)findViewById(R.id.testbutt);        queryText = (EditText)findViewById(R.id.query);        ListView lvr = (ListView)findViewById(R.id.search_results);      //initialise the arrayAdapter        this.m_adapter = new ResultsAdapter(home.this, R.layout.listrow, sResultsArr);        lvr.setAdapter(this.m_adapter);        lvr.setOnItemClickListener(new OnItemClickListener(){   @Override   public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,     long arg3) {    // TODO Auto-generated method stub         pd = ProgressDialog.show(home.this, null,""Loading products from server"", true, false);   }        });        gestureScanner = new GestureDetector(this,this);        gestureScanner.setOnDoubleTapListener(new OnDoubleTapListener(){             public boolean onDoubleTap(MotionEvent e) {                  //viewA.setText(""-"" + ""onDoubleTap"" + ""-"");          pd = ProgressDialog.show(home.this, null,""Loading products from server"", true, false);                 return false;             }             public boolean onDoubleTapEvent(MotionEvent e) {                 // viewA.setText(""-"" + ""onDoubleTapEvent"" + ""-"");                  return false;             }             public boolean onSingleTapConfirmed(MotionEvent e) {                  //viewA.setText(""-"" + ""onSingleTapConfirmed"" + ""-"");                  return false;             }      });        //initialise tab contents        mTabHost = getTabHost();        mTabHost.addTab(mTabHost.newTabSpec(""tab1"").setIndicator(""Home"").setContent(R.id.homepage));        mTabHost.addTab(mTabHost.newTabSpec(""tab2"").setIndicator(""Search Results"").setContent(R.id.tab2));        mTabHost.setCurrentTab(0);        //sets the respective listeners        testButt.setOnClickListener(new View.OnClickListener() {        public void onClick(View arg0) {         if(mTabHost.getTabWidget().getVisibility()==View.GONE){          mTabHost.getTabWidget().setVisibility(View.VISIBLE);         }         else{          mTabHost.getTabWidget().setVisibility(View.GONE);         }        }     });        search.setOnClickListener(new View.OnClickListener() {        public void onClick(View arg0) {         sResultsArr.clear();         queryStr = ""http://rose.mosuma.com/mobile?query="" + queryText.getText().toString();         pd = ProgressDialog.show(home.this, null,""Loading products from server"", true, false);         goSearch();      }     });    } //updates the listUI whenever after receiving the response from the server public void updateListUi(){      if(sResultsArr.size() &gt; 0){       }    try{     String ptypename;     int count;     LinearLayout ptypebar = (LinearLayout)findViewById(R.id.productCat);     ptypebar.removeAllViews();     JSONArray ptypes = searchResponse.getJSONArray(""ptypes"");      for(int index =0;index &lt; ptypes.length();index++){      JSONObject ptype = ptypes.getJSONObject(index);      count = ptype.getInt(""count"");            ptypename = ptype.getString(""ptypename"");       //add into tab 2's UI      //ImageView icon = new ImageView(this);      TextView t = new TextView(home.this);      t.setText(ptypename + "" ("" + count + "")"");      ptypebar.addView(t);     }    }    catch(JSONException e){    }   //if(m_adapter.getItems() != sResultsArr){    ArrayList&lt;SearchItem&gt; a  = m_adapter.getItems();     a = sResultsArr;   //}      m_adapter.notifyDataSetChanged();     pd.dismiss(); } public void goSearch(){  mTabHost.setCurrentTab(1);  //separate thread for making http request and updating the arraylist  Thread t = new Thread() {           public void run() {            searchResponse = sendSearchQuery(queryStr);            try{             JSONArray results = searchResponse.getJSONArray(""results"");             //this is stupid. i probably have to see how to make a json adapter             for(int index =0;index &lt; results.length();index++){              JSONObject product = results.getJSONObject(index);              //gets the searched products from the json object              URL imgUrl =  new URL(product.getString(""image""));              String productname = product.getString(""productname"");              String ptypename = product.getString(""ptypename"");              int pid = product.getInt(""pid"");              int positive = product.getInt(""pos"");              int negative = product.getInt(""neg"");              int neutral = product.getInt(""neu"");              SearchItem item  = new SearchItem(imgUrl,productname,ptypename,neutral,positive,negative,pid);              sResultsArr.add(item);             }            }            catch(JSONException e){            }            catch(Exception e){               }            //returns back to UI therad            h.post(mUpdateResults);           }       };       t.start(); } //sends a request with qry as URL //and receives back a JSONobject as response public JSONObject sendSearchQuery(String qry){  HttpRequest r = new HttpRequest();  JSONObject response = r.sendHttpRequest(qry);    return response; } @Override public boolean onDown(MotionEvent arg0) {      return gestureScanner.onTouchEvent(arg0);  } @Override public boolean onFling(MotionEvent arg0, MotionEvent arg1, float arg2,   float arg3) {  // TODO Auto-generated method stub  return false; } @Override public void onLongPress(MotionEvent arg0) {  // TODO Auto-generated method stub } @Override public boolean onScroll(MotionEvent arg0, MotionEvent arg1, float arg2,   float arg3) {  // TODO Auto-generated method stub  return false; } @Override public void onShowPress(MotionEvent arg0) {  // TODO Auto-generated method stub } @Override public boolean onSingleTapUp(MotionEvent arg0) {  // TODO Auto-generated method stub  return false; }</code></pre><p>Oh, another question, if my listview has an onItemClickListener, can android detect between single tap or double tap for it?</p>","267185","","1331627","","2014-01-13 12:35:39","2014-04-11 07:09:49","Android: How to detect double-tap?","<android><listview><double-click>","5","2","9","",""
"2217753","1","2218270","","2010-02-07 18:26:17","35","104505","<p>How can I change background color of <code>ListView</code> items on a per-item basis. When I use <code>android:backgroundColor</code> in the <code>ListView</code> item layout I can achieve this, however the list selector is no longer visible. I can make the selector visible again by setting <code>drawSelectorOnTop</code> to true but then the selector overlays the whole item.</p><p>Any ideas how to change those background colors and keep the selector?</p><p>PS I would rather not change the selector itself.</p><p>EDIT: Authors of GMail application have managed to achieve exactly this so it's definitely possible.</p>","139298","","225647","","2012-09-29 23:23:46","2013-08-06 09:50:22","Changing background color of ListView items on Android","<android><listview><colors>","15","0","22","",""
"2217882","1","","","2010-02-07 19:02:20","0","451","<p>I am trying to create an Android service that causes a specific home screen page to open when the Droid is placed in the Car Dock instead of having it open the Car Home application. I cannot find any reference to how to specify a home screen page other than the center page that always gets displayed when pressing the Home button by using CATEGORY_HOME. Does anyone know how I would have my application open a specific page?</p>","1826978","","","","","2012-04-25 02:22:19","Opening a specific Android home screen page","<android>","1","0","1","",""
"2217963","1","","","2010-02-07 19:26:42","-1","460","<p>I am trying to parse the ical file with ical4j, i have added ical4j jar file to project but have problem in adding  iCal4j dependencies in addition to the iCal4j library. As specified in</p><p><code>http://wiki.modularity.net.au/ical4j/index.php?title=FAQ</code></p><p>Any idea how can I do this?</p><p>In addition to this, can anyone provide with ical file parse example ?</p>","257580","","","","","2010-05-26 11:00:18","how to add iCal4j dependencies in addition to the iCal4j library in android?","<android><file><dependencies><icalendar>","1","0","","",""
"2218531","1","2218552","","2010-02-07 21:58:00","2","252","<p>I have this code:</p><pre><code>public class Home extends Activity{    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);            //...            //at some point I have            s.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){              @Override              public void onProgressChanged(SeekBar seekBar, int progress,                      boolean fromUser) {                  ContextNotionLevel ctnl=new ContextNotionLevel(this);// &lt;-- how can I reference Home class here to replace **this**, which as it is points to OnSeekBarChangeListener              }    }}</code></pre>","243782","","114066","","2010-07-14 13:19:32","2010-07-14 13:19:32","how to reference a higher class within an anonymous class","<java><android><class><inner-classes><anonymous-inner-class>","2","0","","",""
"2218633","1","","","2010-02-07 22:29:37","3","367","<p>The project I'm working on requires me to write lots of repetitive code. For example, if I want to load a image file called ""logo.png"" in my code, I would write something like this:Bitmap logoImage;</p><pre><code>...// InitlogoImage = load(""logo.png"")...// UsagelogoImage.draw(0, 0);..// CleanuplogoImage.release();</code></pre><p>Having to write this code to use every new image is a pain, including having to specify that logoImage should load the file ""logo.png"".</p><p>As I'm working on a Java Android game and images are used a lot in inner loops, I really want to avoid slow things like making virtual function calls and e.g. accessing arrays/maps/object fields when I can avoid it. Copying an idea from the Android API (the generated R class), I thought I could run a utility before compiling to generate some of this repetitive code for me. For example, the actual code in the project file would be reduced to just this:</p><pre><code>logoImage.draw(0, 0);</code></pre><p>Using some command-line tools (e.g. grep, sed), I can look for every instance of ""Image.draw(..."" and then generate the other required code automatically i.e. code to load/release the file .png and declare ""Bitmap logoImage"" somewhere. This code could either be added to a new class or I could add placeholders in my code that told the code generator where to insert the generated code.</p><p>To display a new image, all I would need to do is just copy the image file to the right directory and add one line of code. Nice and simple. This avoid approaches like creating an array of images, defining labelled int constants to references the array and having to specify which filename to load.</p><p>Is this a really bad idea? It seems a bit of a hack but I can see no easier way of doing this and it does seem to drastically clean up my code. Are there any standard tools for doing this simple kind of code generation (i.e. the tool doesn't need to understand the meaning of the code)? Does anyone else do things like this to make up for language features?</p>","260693","","","","","2010-02-08 03:04:04","Using a utility to generate Java code to make my project more concise. Good idea?","<java><android><code-generation>","5","6","1","",""
"2218711","1","","","2010-02-07 22:50:48","2","152","<p>I'm working on a Java Android game. Games here generally need to use memory pools to avoid garbage collection.</p><p>For the sake of argument, say I have the following classes:</p><pre><code>// Enemy in the gameclass Enemy { int x; int y; abstract void update(); }// Enemy that just bounces aroundclass Roamer extends Enemy { int direction; ... }// Enemy that chases a playerclass Chaser extends Enemy { Player target; ... }// maybe 20 more enemy types...</code></pre><p>Making use of subclasses is a pain when using memory pools as you need to e.g. say how many Roamer and Chaser objects you want upfront and not just how many Enemy objects you might need. Also, the virtual function calls to update can be slow.</p><p>One alternative I've thought of is to just merge all these classes into one e.g.</p><pre><code>class Enemy{    int direction;    Player target;    int type; // i.e. ROAMER_TYPE, CHASER_TYPE}</code></pre><p>I would then have an update function that checked the ""type"" variable and updated accordingly. This is obviously a more C-like approach. It feels hacky though because e.g. a roamer enemy will have a ""target"" variable it never uses. I'm unlikely to have more than a 100 enemies in memory at a time though so it really isn't a big deal memory wise. I just want some compromise between nice code and speed.</p><p>Does anyone have any comments on how best to structure this? Is merging classes like this going too far? Is this ever a good idea? Should I just use a regular class tree?</p><p>I know there are no right answers to this, but I'd like some different viewpoints.</p>","260693","","","","","2010-02-08 05:17:18","Combining subclasses which have different fields for efficiency?","<java><android><oop>","4","2","","",""
"2218773","1","2218782","","2010-02-07 23:14:08","2","16618","<p>I'm having some issues with the old ""Cannot make a static reference to a non-static method"" error in my Android program. I am creating a sand falling game (similar to the Powder Game) and I created a class called Control to create a Control Bar at the bottom of the screen with a slider for brush size (that works fine) and a button to pop up a Dialog to allow users to pick the selected element. However, when I call DemoActivity.showDialog(2) from my code, it gives the static reference to non-static error (DemoActivity is the main activity of my application). I also tried changing it to just Activity.showDialog(2), but I got exactly the same error! Please help, what am I doing wrong? Here's my code and thanks in advance:</p><pre><code>package sand.falling.opengl;import android.content.Context;import android.util.AttributeSet;import android.util.Log;import android.view.View;import android.widget.ImageButton;import android.widget.LinearLayout;import android.widget.SeekBar;public class Control extends LinearLayout{    private ImageButton control_button;    private SeekBar brush_size_slider;    final CharSequence[] elementslist = {""Sand"", ""Water"", ""Plant"", ""Wall"", ""Fire"", ""Ice"", ""Generator"", ""Oil"", ""Magma"", ""Stone"", ""C4""};    public Control(Context context, AttributeSet attrs)    {        super(context, attrs);    }    @Override    protected void onFinishInflate()    {        control_button = (ImageButton) findViewById(R.id.element_picker_button);        brush_size_slider = (SeekBar) findViewById(R.id.brush_size_slider);        control_button.setOnClickListener            (                    new OnClickListener()                    {                        public void onClick(View v)                        {                            //THIS DOESN'T WORK!!!!                            DemoActivity.showDialog(2); //Run the element picker dialog                        }                    }            );        control_button.setImageResource(R.drawable.palette);        brush_size_slider.setOnSeekBarChangeListener            (                    new SeekBar.OnSeekBarChangeListener()                    {                        public void onProgressChanged(SeekBar seekbar, int progress, boolean fromTouch)                        {                            int p = 32 * progress/100;                            DemoActivity.setBrushSize(p);                            Log.v(""DemoActivity"", ""size:"" + p);                        }                        public void onStartTrackingTouch(SeekBar seekbar) {}                        public void onStopTrackingTouch(SeekBar seekbar) {}                    }            );        brush_size_slider.setProgress((int)400/32);    }}</code></pre><p>EDIT: I fixed it by adding the following to my Control.java code:</p><pre><code>public class Control extends LinearLayout{    private DemoActivity activity;        ...    public void setActivity(DemoActivity act)    {        activity = act;    }        ...        //Set a click listener for the button which should pop up element picker dialog when clicked        control_button.setOnClickListener            (                    new OnClickListener()                    {                        public void onClick(View v)                        {                            activity.showDialog(2); //Run the element picker dialog                        }                    }            );}</code></pre><p>And then calling <code>control.setActivity(this);</code> from my onResume section of DemoActivity.java! Hope it helps those of you with similar issues!!</p>","234256","","234256","","2010-02-08 21:44:17","2011-11-20 00:53:24","""Cannot make a static reference to a non-static method"" in Android","<java><android><static-vs-non-static>","2","0","1","",""
"2218883","1","2218929","","2010-02-07 23:57:05","5","610","<pre><code>&lt;html&gt;    &lt;script language=""javascript""&gt;        /* This function is invoked by the activity */        function wave() {            alert(""1"");            document.getElementById(""droid"").src=""android_waving.png"";            alert(""2"");        }    &lt;/script&gt;    &lt;body&gt;        &lt;!-- Calls into the javascript interface for the activity --&gt;        &lt;a onClick=""window.demo.clickOnAndroid()""&gt;&lt;div style=""width:80px;            margin:0px auto;            padding:10px;            text-align:center;            border:2px solid #202020;"" &gt;                &lt;img id=""droid"" src=""android_normal.png""/&gt;&lt;br&gt;                Click me!        &lt;/div&gt;&lt;/a&gt;    &lt;/body&gt;&lt;/html&gt;</code></pre><p>My question is: What is ""window.demo.clickOnAndroid()""?</p><p><strong>I know that clickOnAndroid is a method in my Android application. But what is window and demo? My file is called demo.html. Is that it?</strong></p>","179736","","","","","2010-02-08 00:16:44","Javascript question--what is ""window""?","<javascript><android><window>","2","1","","",""
"2219074","1","","","2010-02-08 01:01:23","18","9318","<p>Suppose I load a 3rd party URL through webview.</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        webview = (WebView) findViewById(R.id.webview);        webview.setWebViewClient(new HelloWebViewClient());        webview.getSettings().setJavaScriptEnabled(true);        webview.setWebChromeClient(new MyWebChromeClient());        webview.loadUrl(""http://ebay.com"");             }</code></pre><p>Is it possible for me to <strong>inject something into this WebView</strong> to replace the ebay logo with my own?</p>","179736","","","","","2011-06-08 22:04:04","In Android Webview, am I able to modify a webpage's DOM?","<javascript><android><templates><webview>","3","4","14","",""
"2219176","1","4581029","","2010-02-08 01:54:10","3","1414","<p>Apologies if this is a stupid question - I'm an Android and Ant newbie.</p><p>I have utf8 encoded source files that I need to compile with the Android Ant build system. By default, the encoding is set to ascii. I'd be very grateful for a pointer to whatever I need to do to let the build system know that my files are utf8.</p><p>Incidentally, it works fine if I build in Eclipse, but I need to build from the command line.</p><p>Thanks!</p>","268371","","","","","2011-01-02 23:10:48","How do I modify the -encoding argument to javac in the Android Ant build system","<android>","2","0","2","",""
"2219556","1","","","2010-02-08 04:24:11","0","3363","<pre><code>private class HelloWebViewClient extends WebViewClient {        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            view.loadUrl(url);            return true;        }   }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        webview = (WebView) findViewById(R.id.webview);        webview.setWebViewClient(new HelloWebViewClient());        webview.getSettings().setJavaScriptEnabled(true);        webview.loadUrl(""http://mydomain.com"");    }</code></pre><p>This is a very simple webview demo ( I followed a tutorial to write it).  When a user loads up my application, this webview pops up and he's able to go on the internet inside it.</p><p>How do I ""listen"" for an event? </p><ul><li>When a URL contains ""google.com""</li><li>Or, when the HTML contains the word ""google""</li></ul><p>As the user is using my webview to browse the web, I'd like to listen to those things and then call a function when it happens.</p>","179736","","","","","2011-07-05 22:21:08","How do I ""listen"" for something in WebView, Android?","<java><android><uiwebview><webview>","3","0","","",""
"2219660","1","2226176","","2010-02-08 04:53:28","0","247","<p>I have one problem , i want to refer particular file in my system D: from my android emulator,but it throwing Nullpointer Exception, Here is my code</p><pre><code>for (File file : new File(""D:\\vcards"").listFiles())        {            i++;        }Log.i(""I"",""""+i);</code></pre><p>If i run this code in core java application it prints the no of files in the folder,but in android application it gives NUllpointer Exception</p><pre><code>02-08 10:10:09.653: WARN/System.err(439): java.lang.NullPointerException02-08 10:10:09.653: WARN/System.err(439):  at payoda.android.Temp.onCreate(Temp.java:22)02-08 10:10:09.664: WARN/System.err(439):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-08 10:10:09.664: WARN/System.err(439):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)02-08 10:10:09.674: WARN/System.err(439):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)02-08 10:10:09.674: WARN/System.err(439):  at android.app.ActivityThread.access$2200(ActivityThread.java:119)02-08 10:10:09.674: WARN/System.err(439):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)02-08 10:10:09.684: WARN/System.err(439):  at android.os.Handler.dispatchMessage(Handler.java:99)02-08 10:10:09.684: WARN/System.err(439):  at android.os.Looper.loop(Looper.java:123)02-08 10:10:09.694: WARN/System.err(439):  at android.app.ActivityThread.main(ActivityThread.java:4363)02-08 10:10:09.694: WARN/System.err(439):  at java.lang.reflect.Method.invokeNative(Native Method)02-08 10:10:09.694: WARN/System.err(439):  at java.lang.reflect.Method.invoke(Method.java:521)02-08 10:10:09.704: WARN/System.err(439):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-08 10:10:09.704: WARN/System.err(439):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-08 10:10:09.713: WARN/System.err(439):  at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I dont know how to how to get the no of file files in that folder through Android program.If anybody knows the answer please help me.</p>","131062","","","","","2010-02-09 01:35:05","Problem in refering Files from Android emulator?","<android>","3","0","","",""
"2219661","1","2219727","","2010-02-08 04:54:21","0","216","<p>I need to make an installer which will ask for T&amp;C and install the App . But i am not able to find any tutorial related to the same . Any help would be appreciated .Thanks in advance.</p>","95877","","","","","2010-02-08 05:17:23","Installer Android","<java><android>","1","0","","",""
"2220132","1","2226930","","2010-02-08 07:33:31","0","7744","<p>i have ever tried to texture the 3d cube in android using opengl es  according to the example in  c++, but after several times , the result is disappointed! so i wanna know, who have ever done it before? may you give me some suggestions?thanks in advance!</p>","165273","","44729","","2011-05-26 15:45:22","2011-05-26 15:45:22","texture the 3d cube in android","<android><opengl-es><3d>","1","2","1","",""
"2220147","1","2280346","","2010-02-08 07:36:55","1","7161","<p>I am trying to get current long, lat. I am getting a Nullpointer on <code>LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);</code></p><pre><code>    LocationListener myLocationListener = new CurrentLocationListener();     locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1, 1, myLocationListener);    Location currentLocation = locationManager.getLastKnownLocation(""gps"");     Latitude = currentLocation.getLatitude();  -----&gt;&gt;&gt; null pointer exception here    Longitude = currentLocation.getLongitude();public class CurrentLocationListener implements LocationListener{    public void onLocationChanged(Location argLocation) {    }    public void onProviderDisabled(String provider) {    }    public void onProviderEnabled(String provider) {    }    public void onStatusChanged(String provider, int status, Bundle arg2) {    }} </code></pre><p>My manifest file</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt;</code></pre>","249991","","548526","","2013-01-22 03:53:14","2013-01-22 03:53:14","how to solve Null pointer exception on Getting latitude or GPS?","<android><gps>","4","4","2","",""
"2220326","1","2220346","","2010-02-08 08:32:25","1","959","<p>In my application i want to be use advertisements.Let me know which controls are use for displaying the SLIDE OUT AD.</p>","217065","","","","","2010-02-08 08:37:54","how display Advertisements in bottom of the screen in android?","<android>","1","0","1","",""
"2220547","1","2220559","","2010-02-08 09:25:00","84","51882","<p>I want to print something in console so I can debug it.  But for some reason, nothing prints in my Android application.  How do I debug then?</p><pre><code>public class HelloWebview extends Activity {    WebView webview;        private static final String LOG_TAG = ""WebViewDemo"";    private class HelloWebViewClient extends WebViewClient {        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            view.loadUrl(url);            return true;        }    }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        webview = (WebView) findViewById(R.id.webview);        webview.setWebViewClient(new HelloWebViewClient());        webview.getSettings().setJavaScriptEnabled(true);        webview.setWebChromeClient(new MyWebChromeClient());        webview.loadUrl(""http://example.com/"");            System.out.println(""I am here"");    }</code></pre>","179736","","11238","","2011-01-04 11:31:27","2013-02-26 16:31:15","Why doesn't System.out.println work? (in Android)","<java><android><printing><console><system>","4","3","22","",""
"2220560","1","2221285","","2010-02-08 09:27:17","97","52109","<p>When using setDuration for a Toast is it possible to set a custom length or at least something longer than Toast.LENGTH_LONG?</p>","","user268481","447356","","2011-11-17 13:00:20","2014-02-24 21:39:53","Can an Android Toast be longer than ""Toast.LENGTH_LONG""?","<android><toast>","14","3","21","",""
"2220575","1","2220605","","2010-02-08 09:31:56","7","37224","<p>I want to create an Android application that is a client for an Internet radio station. And I want it look native to Android? But im confused with Android API logic and documentation. What i've got is that I need MediaPlayer and MediaController classes. Am I right, and is there any good example of AUDIO player for Android?</p><p>Especially, I'm very interested how to use <code>MediaPlayer</code> and <code>MediaController</code> classes together.</p><p>UPD:</p><p>Finally I've got the code, that does exactly what I want:</p><pre><code>Intent i = new Intent(Intent.ACTION_VIEW);    Uri u = Uri.parse(%file_uri%));    i.setData(u);    startActivity(i);</code></pre>","268532","","674530","","2011-06-30 07:07:37","2012-01-13 09:25:24","How to implement an audio player for Android using MediaPlayer And MediaController?","<java><android><audio><media-player>","2","0","13","",""
"2220725","1","2225291","","2010-02-08 10:02:35","3","815","<p>I was wondering does anyone know how to give an Android application an about box in the application manager?</p><p>So when a user goes to Settings > Applications > Manage Applications and clicks on an app there is an About box there that the user can click and info about the app pops up.</p><p>Like the images below?</p><p><img src=""http://img710.imageshack.us/img710/1638/about1l.png"" alt=""alt text""></p><p><img src=""http://img40.imageshack.us/img40/250/about2r.png"" alt=""alt text""></p>","243999","","","","","2010-02-08 22:16:44","Android - About box in application manager?","<java><android><about-box><application-management>","1","0","1","",""
"2220949","1","2229265","","2010-02-08 10:40:52","27","24481","<p>I have a bunch of image URLs. I have to download these images and display them in my application one-by-one. I am saving the images in a Collection using <code>SoftReferences</code> and also on Sdcard to avoid refetches and improve user experience.</p><p>The problem is I dont know anything about the size of the bitmaps. And as it turns out, I am getting OutOfMemoryExceptions sporadically, when I am using <code>BitmapFactory.decodeStream(InputStream)</code> method. So, I chose to downsample the images using BitmapFactory Options(sample size=2). This gave a better output: no OOMs, but this affects the quality of smaller images.</p><p>How should I handle such cases? Is there a way to selectively downsample only high resolution images?</p>","236128","","321731","","2014-02-08 18:57:19","2014-04-10 21:59:47","Handling large Bitmaps","<android><performance><bitmap>","3","1","26","",""
"2221005","1","2341843","","2010-02-08 10:50:53","1","923","<p>My Android app Transdroid offers several home screen widgets. Every AppWidget has 2 'buttons' (ImageButton), one starts the app and one starts some activity that refreshes the AppWidget content. Pretty simple. <a href=""http://www.transdroid.org/wp-content/uploads/2009/04/transdroid-screenshot-0.13.1-widget.png"" rel=""nofollow"">Here</a> is a screenshot. The widget code is at my Google Code website, but most importantly:</p><pre><code>RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.appwidget_15);views.setOnClickPendingIntent(R.id.widget_action, PendingIntent.getActivity(context, 0, new Intent(context, Transdroid.class), 0));appWidgetManager.updateAppWidget(id, views);</code></pre><p>The problem is: the widget's onUpdate is not called after the Home process is restarted, and hence the PendingIntents used to attach functionality to the buttons is lost.</p><p>It's fairly easy to reproduce.</p><ol><li>Start an emulator</li><li>Add a widget (that uses a PendingIntent to, say, start an activity)</li><li>Click the button to see it actually works</li><li>Force kill the home proces ('adb -e shell kill 96' where 96 is the PID of android.process.acore)</li><li>The widget's button doesn't work any more.</li></ol><p>More precise: no onReceive and thus no onUpdate is called when the android.process.acore Home process is restarted. In turn, no Intent is attached.</p><p>Anyone experienced the same problem and knows how to circumvent this problem?</p>","243165","","","","","2010-02-26 13:22:29","Decoupled AppWidget Intents after Home process restart","<android><appwidget><homescreen>","1","2","","",""
"2221221","1","2221386","","2010-02-08 11:29:16","150","93027","<p>I have frequent problem in android view, <code>Error parsing XML: unbound prefix on Line 2</code>.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:orientation=""vertical"" android:id=""@+id/myScrollLayout"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;    &lt;TextView android:layout_height=""wrap_content"" android:layout_width=""fill_parent""     android:text=""Family"" android:id=""@+id/Family""     android:textSize=""16px"" android:padding=""5px""     android:textStyle=""bold"" android:gravity=""center_horizontal""&gt;    &lt;/TextView&gt;    &lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent"" android:layout_height=""wrap_content""        android:orientation=""vertical"" android:scrollbars=""vertical""&gt;        &lt;LinearLayout android:orientation=""vertical"" android:id=""@+id/myMainLayout""         android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;        &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre>","243782","","243782","","2010-02-08 11:54:07","2014-02-14 08:01:26","frequent problem in android view, Error parsing XML: unbound prefix","<xml><android><eclipse><android-linearlayout>","10","1","26","",""
"2221351","1","","","2010-02-08 11:57:52","1","1359","<p>I have some code for my app that creates a keystore in android, creates some default keys then saves the keystore. </p><p>Later on the code tries to reload the keystore, on the emulator this runs fine however when run on a phone I get an EOFException. Any advice on where I'm going wrong? </p><p>An out take of the code is below: </p><p>In the class I have the following variables </p><pre><code>static KeyStore keyStore; String filenameKeyStore = ""KeyStore.kstore""; </code></pre><p>Then the following two functions </p><pre><code>    public KeyHandler(Context context) {                 if(keyStore == null) {                         Log.d(""KeyStore"", ""Keystore is null so loading"");                         if(initialiseKeyStore(context) == false) {                                 // KeyStore failed to initialise                                 Log.e(""ERROR"", ""Store failed to initialise"");                         }                 }         } private boolean initialiseKeyStore(Context context) {                 FileInputStream input = null;                 try {                         // Get an instance of KeyStore                         keyStore = KeyStore.getInstance(""BKS"");                         // Load the KeyStore file                         try {                                 // Try and open the private key store                                 input = context.openFileInput(filenameKeyStore);                         } catch (FileNotFoundException e) {                                 // If  the file doesn't exist then create the file, a ECDH key and store the key                                 Log.w(""Warning"",""File does not exist, creating new file"");                                 try {                                         // Load the default Key Store                                         keyStore.load(null, null);                                         // Create the file                                         FileOutputStream output = context.openFileOutput(filenameKeyStore, 0);                                         // Reset private key                                         resetPrivateKey(context);                                         // Save the key                                         keyStore.store(output, ""password"".toCharArray());                                         // Close the keystore and set the input stream                                         output.close();                                         input = context.openFileInput(filenameKeyStore);                                         // Reset the keyStore                                         keyStore = KeyStore.getInstance(""BKS"");                                 } catch (FileNotFoundException ee) {                                         Log.e(""ERROR"", ""File not found, even though we just created it"");                                         return false;                                 } catch (NoSuchProviderException e1) {                                         // BC isn't working exit                                         e1.printStackTrace();                                         System.exit(1);                                 } catch (InvalidAlgorithmParameterException e1) {                                         Log.e(""ERROR"", ""The algorithm used for secure algorithm is incorrect"");                                         e1.printStackTrace();                                         return false;                                 }                         }                         // Load the store                         keyStore.load(input, ""password"".toCharArray());                 } catch (KeyStoreException e) {                         // TODO Auto-generated catch block                         e.printStackTrace();                         return false;                 } catch (CertificateException e) {                         // TODO Auto-generated catch block                         e.printStackTrace();                         return false;                 }  catch (EOFException e) {                       // Where the exception is caught                         e.printStackTrace();                         return false;                 } catch (IOException e) {                         // TODO Auto-generated catch block                         e.printStackTrace();                         return false;                 } catch (NoSuchAlgorithmException e) {                         // TODO Auto-generated catch block                         e.printStackTrace();                         return false;                 } catch (NoSuchProviderException e) {                         // Serious error, return                         e.printStackTrace();                         System.exit(1);                 }                 return true;         } </code></pre>","245737","","","","","2010-02-08 11:57:52","KeyStore loading causing EOFException error on Android","<java><android><bouncycastle><keystore>","0","3","","",""
"2221358","1","","","2010-02-08 11:59:05","1","362","<pre><code>private Button.OnClickListener goFirstPage = new Button.OnClickListener() {</code></pre><p>public void onClick(View v)   {   try       {</p><p>Intent i = new Intent(v.getContext(), quizMath.class);       startActivityForResult(i, 0);</p><p>} catch (Exception e)    {    e.printStackTrace();    // TODO: handle exception   }</p><p>} };hi, this is my code, but the problem is that i want to call a function from class quizmath.So is it possible or not?. can we pass integer or string from startActivityForResult?</p>","263325","","243782","","2010-02-08 12:05:27","2010-02-08 12:15:27","passing more data from android view","<java><android>","1","0","1","",""
"2221423","1","","","2010-02-08 12:10:34","1","1562","<p>Does android support reading data from personal health device via USB?If so what are the drivers and interfaces required for developing the same?</p>","268631","","","","","2010-02-08 12:36:41","Android - Reading data from health devices via USB","<android><usb>","1","0","","",""
"2221546","1","2221569","","2010-02-08 12:36:30","18","13541","<p>we are developing the application using the .Net webservice(soap protocal)  for that i need Pass GUID from android class.</p><p>in .Net we have statement like below     Guid myGuid1 = new Guid();</p><p>i need the similar functionality in Android , is there any way to make this kind of functionality in android code?</p><p>Regards,Jeyavel N</p>","212809","","","","","2010-02-08 12:40:45","How to get GUID in android?","<android>","1","0","1","",""
"2221709","1","2221740","","2010-02-08 13:04:53","2","2082","<p>I need to draw some text on my Canvas, and I'd really avoid hardcoding some particular text size.</p><p>Is there some standard way to find a default text size (and other properties) used in the OS?</p><p>So far I found only TextView.setTextAttributes(context, resId) to which I can pass R.android.attr.textAppearance.</p><p>But the thing is that I don't want to create a TextView - I just have a Canvas and i want to draw text in it using default font.</p><p>Is it possible? :)</p>","258848","","","","","2010-02-08 13:10:08","How to get default fonts properties on Android?","<android><text><canvas>","1","0","","",""
"2221716","1","2225347","","2010-02-08 13:06:11","1","1901","<p>I am trying to call a restful webservice (that needs to require authentication) from my android app. I am doing this successfully already with a url that does not require authentication, but am not sure of the correct approach to use if I want to set up a url that does require authentication. I am currently consuming xml using a Sax Parser and calling url.openStream() like this:</p><p>`  </p><pre><code>                    URL url = new URL('MyUnAuthenticatedURL');  SAXParserFactory spf = SAXParserFactory.newInstance();  SAXParser sp = spf.newSAXParser();  XMLReader xr = sp.getXMLReader();  final QuestionHandler myQuestionHandler = new QuestionHandler();  xr.setContentHandler(myQuestionHandler);  xr.parse(new InputSource(url.openStream()));  handler.post(new Runnable() {   public void run() {    recentQuestions = myQuestionHandler.getResultList();    loadQuestions = false;    fillData();   }  });</code></pre><p>`</p><p>I read that I should use org.apache.http.impl.client.DefaultHttpClient in order to take advantage of HTTP Basic Authentication using default session cookies, but I don't understand how this should be done in conjunction with the the Sax Parser.  </p><p>The main goal here is that I want to call a url that requires an authenticated username, and have that url return XML if the username is authenticated with a password.</p><p>Can someone point me in the right direction?  Thanks!</p>","268648","","","","","2010-02-08 22:25:51","Android: How to consume xml from webservice using authentication?","<android><web-services><rest><restful-authentication>","1","0","","",""
"2221734","1","2224885","","2010-02-08 13:09:27","3","4782","<blockquote>  <p><strong>Duplicate:</strong> <a href=""http://stackoverflow.com/questions/2070022/static-options-menu"">static options menu</a></p></blockquote><p>Hi everyone,</p><p>I know how to create a menu in my application with an icon and text on each ""button"" of the menu, but this menu is only visible on the activity where I created it...I would like to know if it is possible to create a global menu which would be accessible from all activities?thank you</p>","263521","","3171","","2010-02-08 13:25:17","2010-02-08 21:07:51","Set a global menu on an Android application","<android><menu><global>","1","3","1","",""
"2221897","1","2222014","","2010-02-08 13:38:41","1","509","<p>I am a C++ programmer interested in developing applications for Android as well as the iPhone platform. I have explored both these platforms by writing simple applications in Java (Android) and Objective-C (iphone). But the fact is that I am not comfortable with either of these languages, and it bothers me that I have to write 2 very different versions of the same application to support both platforms. (And then what do I do to run it on a Nokia phone?)</p><p>Is using web technologies (JavaScript/HTML/CSS) a viable solution forwriting apps which will run on multiple mobile platforms? I have heardof <a href=""http://www.appcelerator.com/"" rel=""nofollow"">Appcelerator</a> and <a href=""http://phonegap.com/"" rel=""nofollow"">PhoneGap</a>, but I am not sure how maturethese products are. I'd appreciate any feedback from folks who haveused web apps as a solution for developing cross platform mobile apps. </p>","253029","","","","","2012-07-13 03:57:22","Web Apps for cross platform mobile software development?","<iphone><android>","5","0","","2012-07-28 15:33:05",""
"2222146","1","2229890","","2010-02-08 14:21:20","3","5515","<p><strong>Problem:-</strong></p><p>I want to control the brightness of screen using a background service in android.</p><p><strong>Existing Solutions:-</strong></p><p>There are similar question posted in the form in below link:-</p><p><a href=""http://stackoverflow.com/questions/1791340/adding-screen-brightness-controls-to-android-application"">http://stackoverflow.com/questions/1791340/adding-screen-brightness-controls-to-android-application</a></p><p><strong>Why existing solution will not work?</strong></p><p>All the solution provided in the link works well with an <strong>Activity</strong>, but I want to write a <strong>Background Service</strong> which controls the brightness of the screen.</p><p>So can you someone please help me find a solution on this issue.</p><p>Thanks in advance</p>","233192","","","","","2010-02-09 14:49:11","Control screen brightness in android using "" Background Service""","<android><android-widget>","1","2","3","",""
"2222199","1","2222455","","2010-02-08 14:27:58","4","10068","<p>I'm using a listview with my own implementation of baseadapter. Before adding the main list items to the listview and setting the Adapter i add a footer, with addFooterView(), to the listview. The footer is a normal listview item with a custom view and two buttons.</p><p>And here comes my problem:</p><p>How can i add a onClick() event to this buttons? i tried it in the getView() method of my baseadapter but that does not work. :/</p><p>I need these two buttons at the bottom of my listview as back and forward buttons, cause i don't want too much items at once in the listview.</p><p>thx</p>","268575","","","","","2010-02-09 00:47:05","Howto add onclick event to button in listview added by addFooterView?","<android>","1","0","","",""
"2222350","1","2224869","","2010-02-08 14:50:48","4","524","<p>I currently have a free application on the market and I'd like to offer a paid version of it as well. Once the paid version is installed, I want to import the db and shared preferences from the free version so users can uninstall it without losing anything. </p><p>The problem is this: in my free version, I don't have a <code>android:sharedUserId</code> set. If I add one, the app's id on the system changes and I can't access the data anymore. Both apps will be signed using the same certificate. How can I import the data without messing up the permissions of the free app?</p>","240251","","334849","","2013-05-21 12:31:21","2013-05-21 12:31:21","Import data from free app db to paid app db","<android><sharing>","1","1","2","",""
"2222396","1","2222659","","2010-02-08 14:56:33","4","2343","<p>I am trying to start an error-reporting activty if unhandled exception detected. The problem is with exceptions thrown from main thread. Is there any way to start an activity if main thread crashed?</p>","62192","","","","","2012-05-11 07:25:53","How to start activity from UncaughtExceptionHandler if this is main thread crashed?","<android><exception-handling><unhandled-exception>","3","0","2","",""
"2222648","1","2222688","","2010-02-08 15:34:04","10","4446","<p>Is there a simple way to change the contents of a dialog box in Android without having to re-create the dialog box?  I know that Activity.onCreateDialog() is only called once when the dialog first needs to be created, and this is where you initially set the dialog's contents.  I need to change the dialog's contents later, so I'm wondering what is the proper way to do this.</p>","244104","","","","","2013-02-05 08:28:36","Change the contents of an Android dialog box after creation","<android><dialog>","2","0","1","",""
"2222890","1","2226590","","2010-02-08 16:04:13","13","22881","<p>I have a simple application, it starts, loads xml feed from the net, you can browse a list of news and then read details for a chosen news item. What I would like to do is have a splash screen, meaning as soon as you click application, it should display an image (app name in my case) and then display news list only after they've loaded.</p><p>I read about similar (I think) problems, and usually people say to use FrameLayout, but I can't really sort it out. I'm not sure if this can be done in the first activity that is launched, maybe I should just display this splash image in one activity and only then call activity displaying my news list?</p><p>I know that on iPhone you can set splash screen in app settings while developing, would be nice to have this functionality in android's app's manifest...</p>","220065","","220065","","2010-02-09 03:24:43","2011-12-29 16:31:57","How to make a splash screen (screen visible when app starts)?","<android><splash-screen>","1","6","13","",""
"2223068","1","2223636","","2010-02-08 16:28:18","8","5361","<p>How can I cancel a loading operation in <code>WebView</code> started by <code>loadData()</code> method?</p>","139298","","","","","2010-02-08 17:46:22","Cancel loading in WebView on Android","<android><webview><cancel>","1","0","","",""
"2223156","1","","","2010-02-08 16:40:15","0","402","<p>Why can't I use the Context of a Service to display an AlertDialog ?</p><p>I can do it with Toast!</p>","248521","","","","","2010-07-09 21:19:42","Why can't I use the Context of a Service to display an AlertDialog","<android>","1","1","","",""
"2223271","1","2223648","","2010-02-08 16:54:34","2","300","<p>As a total noob to android programming I was advised to make use of adapters and handlers in order to update a textview periodically rather than thread/sleep. However, I wonder why! Any suggestions?</p>","268098","","","","","2010-02-08 17:47:52","Thread vs. Adapter for backgroud tasks - which one to prefer and why?","<android><multithreading><adapter>","1","0","1","",""
"2223296","1","2223379","","2010-02-08 16:56:57","3","7513","<p>I am desperate to find the solution so I ask for help!I am a new french programmer. My objective is to create a widget able to show SMS.My problem is that I don't know how create a cursor which select the first SMS in content://sms/inboxExcuse my bad English, I hope you will able to understand my wich.Thank you for your answer.this is my code:</p><pre><code>package sfeir.monwidget;import android.R.string;import android.appwidget.AppWidgetManager;import android.appwidget.AppWidgetProvider;import android.net.Uri;import android.widget.RemoteViews;import android.content.ComponentName;import android.content.ContentResolver;import android.content.Context;import android.content.Intent;import android.database.Cursor;import android.widget.ArrayAdapter;   public class MonWidget extends AppWidgetProvider { public void onUpdate(Context context, AppWidgetManager appWidgetManager,            int[] appWidgetIds) {     Uri uri = Uri.parse(""content://sms/inbox"");    // returns all the results.    Cursor c= getContentResolver().query(uri, null, null ,null,null);     // called by the Activity.    startManagingCursor(c);    String body = null;    String number = null;    if(c.moveToFirst()) { // move cursor to first row       // retrieves the body and number of the SMS       body = c.getString(c.getColumnIndexOrThrow(""body"")).toString();       number = c.getString(c.getColumnIndexOrThrow(""address"")).toString();    }    // when your done, close the cursor.    c.close();  RemoteViews updateViews = new RemoteViews(context.getPackageName(),         R.layout.widget_layout); updateViews.setTextColor(R.id.text, 0xFF000000); updateViews.setTextViewText(R.id.text, (CharSequence) body); ComponentName thisWidget = new ComponentName(context, MonWidget.class); appWidgetManager.updateAppWidget(thisWidget, updateViews); }</code></pre><p>}</p>","268817","","703019","","2012-03-04 01:29:40","2012-03-04 01:29:40","Select first SMS on Android database inbox","<android><sms>","2","1","1","",""
"2223983","1","","","2010-02-08 18:43:00","6","3153","<p>Does anyone know of good documentation for the Skia drawing library used by Android?  </p><p>The main Canvas object has hardly any state, so I'm thinking especially of the objects you can embed into the Paint object.  I've worked out by trial and error how to use some ColorFilters and made a cool effect with ColorMatrixColorFilter.  Now I have the drop shadows I want from the LinearGradient shader also.  I think I understand PathEffects and have some ideas about XferModes.  MaskFilters and Rasterizers are still utterly opaque to me.  But trial and error is not a good way to understand a complicated library.</p><p>Mostly I'm concerned that the Android docs don't discuss 2d graphics and the means of using them at all.  Even the class javadocs often don't explain what the class is doing.  The actual function is all in Skia C code, which I can get, but it also lacks documentation.  I've seen some cool demos but Google explained little about how they were done.</p><p>Is the only way to understand these things experimentation and reading the C code?  What about efficiency and best practices?  The Davlik/Android VM is sensitive to memory allocations and sometimes slow and I'm concerned that I'm not doing things the best way.</p>","8959","","","","","2013-04-14 02:48:46","Skia and Android Paint drawing objects and their use or documentation","<android><graphics><2d><skia>","2","0","1","",""
"2224311","1","2224356","","2010-02-08 19:36:01","2","1537","<p>I am parsing xml using the SAXParser and want to know if this is the right way to implement the characters method.</p><p>Assume there's a class-level String variable named elementValue and it is initialized to """" in the startElement method.</p><p>Here is the characters method:</p><pre><code>@Overridepublic void characters(char[] ch, int start, int length){    String charsToAppend = new String(ch, start, length);    elementValue = elementValue + charsToAppend;    }</code></pre><p>Is it correct that we need to append to the value we have so far and is the append being done correctly?</p><p>Also, why does the characters method give the start index?  Won't it be zero every time?</p><p>Thanks.</p>","250781","","","","","2010-02-26 10:41:33","How to implement characters method using SAXParser on Android","<xml><android><parsing>","1","2","","",""
"2224644","1","","","2010-02-08 20:30:44","12","25942","<p>I'm creating a custom progress bar (positioned under a <code>WebView</code>) and what I would like to draw is a 1dp-wide line between the <code>WebView</code> and the <code>ProgressBar</code>. I'm modifying existing drawable, namely <code>progress_horizontal.xml</code>, and tried something like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;layer-list xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  (...)  &lt;item&gt;    &lt;shape android:shape=""line""&gt;      &lt;stroke android:width=""1dp"" android:color=""#FF000000"" /&gt;    &lt;/shape&gt;  &lt;/item&gt;&lt;/layer-list&gt;</code></pre><p>This line however is vertically centered but I want it to be drawn on top of the drawable. The only idea I could come up with is to use this ""hacky"" gradient below:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;layer-list xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  (...)  &lt;item&gt;    &lt;shape&gt;      &lt;gradient          android:startColor=""#FF000000""          android:centerColor=""#00000000""          android:centerY=""0.01""          android:endColor=""#00000000""          android:angle=""270""      /&gt;    &lt;/shape&gt;  &lt;/item&gt;&lt;/layer-list&gt;</code></pre><p>Do you have better ideas how to draw a single line shape aligned to the top of the drawable defined with <code>layer-list</code>?</p>","139298","","","","","2014-02-24 21:40:01","Drawing top border on a shape on Android","<android><progress-bar><line><border><shape>","4","0","5","",""
"2224676","1","6240320","","2010-02-08 20:35:13","46","40562","<p>I am having some of the following exceptions:</p><pre><code>java.lang.IllegalArgumentException: View not attached to window managerat android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355)at android.view.WindowManagerImpl.updateViewLayout(WindowManagerImpl.java:191)at android.view.Window$LocalWindowManager.updateViewLayout(Window.java:428)at android.app.Dialog.onWindowAttributesChanged(Dialog.java:596)at android.view.Window.setDefaultWindowFormat(Window.java:1013)at com.android.internal.policy.impl.PhoneWindow.access$700(PhoneWindow.java:86)at com.android.internal.policy.impl.PhoneWindow$DecorView.drawableChanged(PhoneWindow.java:1951)at com.android.internal.policy.impl.PhoneWindow$DecorView.fitSystemWindows(PhoneWindow.java:1889)at android.view.ViewRoot.performTraversals(ViewRoot.java:727)at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:4338)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I have googled it and see that it has something to do with popups and turning the screen, but there is no reference to my code.</p><p>The questions are:</p><ol><li>is there a way to find outexactly when this issue ishappening?</li><li>other than turning the screen, is there another event or action that triggers this error?</li><li>how do I prevent this to happen?</li></ol>","237115","","1292203","","2013-03-04 06:49:10","2014-04-18 06:18:23","android View not attached to window manager","<android><exception>","8","2","11","",""
"2224796","1","2224830","","2010-02-08 20:52:33","2","1502","<p>In <a href=""http://snpent.com/images/button.gif"" rel=""nofollow"">this linked image</a> , I see the button on the right quite often in a lot of apps. On my Moto Droid, it is used extensively in the settings app. It is also used as the default AlertDialog icon. Can I use this via a android.r.drawable?</p>","244190","","","","","2010-02-08 21:00:40","Is this a built in drawable?","<android>","2","0","1","",""
"2224844","1","2226048","","2010-02-08 21:00:15","97","57103","<p>I'm trying to get the absolute screen pixel coordinates of the top left corner of a view. However, all methods I can find such as <code>getLeft()</code> and <code>getRight()</code> don't work as they all seem to be relative to the parent of the view, thus giving me <code>0</code>. What is the proper way to do this?</p><p>If it helps, this is for a 'put the picture back in order' game. I want the user to be able to draw a box to select multiple pieces. My assumption is that the easiest way to do that is to <code>getRawX()</code> and <code>getRawY()</code> from the <code>MotionEvent</code> and then compare those values against the top left corner of the layout holding the pieces. Knowing the size of the pieces, I can then determine how many pieces have been selected. I realise I can use <code>getX()</code> and <code>getY()</code> on the <code>MotionEvent</code>, but as that returns a relative position that makes determining which pieces were selected more difficult. (Not impossible, I know, but it seems unnecessarily complicated).</p><p>Thanks!</p><p>Edit: This is the code I used to try to get the size of the holding container, as per one of the questions. <code>TableLayout</code> is the table which holds all the puzzle pieces.</p><pre><code>TableLayout tableLayout = (TableLayout) findViewById(R.id.tableLayout);Log.d(LOG_TAG, ""Values "" + tableLayout.getTop() + tableLayout.getLeft());</code></pre><p>Edit 2: Here is the code I've tried, following more of the suggested answers.</p><pre><code>public int[] tableLayoutCorners = new int[2];(...)TableLayout tableLayout = (TableLayout) findViewById(R.id.tableLayout);tableLayout.requestLayout();Rect corners = new Rect();tableLayout.getLocalVisibleRect(corners);Log.d(LOG_TAG, ""Top left "" + corners.top + "", "" + corners.left + "", "" + corners.right            + "", "" + corners.bottom);cells[4].getLocationOnScreen(tableLayoutCorners);Log.d(LOG_TAG, ""Values "" + tableLayoutCorners[0] + "", "" + tableLayoutCorners[1]);</code></pre><p>This code was added after all the initialisation is done. The image has been divided up into a array of ImageViews (the cells[] array) contained within a <code>TableLayout</code>. Cells[0] is the top left <code>ImageView</code>, and I picked cells[4] as it's somewhere in the middle and most definitely should not have coordinates of (0,0).</p><p>The code shown above still gives me all 0s in the logs, which I really don't understand because the various puzzle pieces are correctly displayed. (I tried public int for tableLayoutCorners and default visibility, both giving the same result.)</p><p>I don't know if this is significant, but the <code>ImageView</code>s are originally not given a size. The size of the <code>ImageView</code>s is determined during the initialisation automatically by the View when I give it an image to display. Could this contribute to their values being 0, even though that logging code is after they have been given an image and have automatically resized themselves? To potentially counter that, I added the code <code>tableLayout.requestLayout()</code> as shown above, but that didn't help.</p><p>I'm stumped... Thanks again to anyone who can help.</p>","235654","","235654","","2014-02-04 18:44:29","2014-04-10 22:04:11","How to get the absolute coordinates of a view","<android><android-tablelayout>","5","3","37","",""
"2225738","1","2225813","","2010-02-08 23:43:27","9","12706","<p>I have a very simple game that consists of only one activity, and I want to add a title screen.</p><p>If the title screen is another activity, what changes do I need to make to my manifest file to make the title screen open first?</p><p>The gameplay activity is called Leeder, and the title screen activity is called LeederTitleScreen</p><p>here is my current manifest file.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""org.nifong.leeder""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name=""Leeder""                  android:label=""@string/app_name""                  android:configChanges=""keyboardHidden|orientation""                  android:screenOrientation=""landscape""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""5"" /&gt;    &lt;uses-permission android:name=""android.permission.WAKE_LOCK"" /&gt;&lt;/manifest&gt;</code></pre>","88905","","","","","2010-02-09 00:21:44","Android app with multiple activities","<android><activity><android-manifest>","1","0","5","",""
"2225989","1","2226245","","2010-02-09 00:49:59","6","2724","<p>I have a Service for my Android app that performs HTTP calls. The Service stores cookies in a CookieStore. I am trying to find a way to persist the CookieStore but I haven't been successful. I don't want the user to log in every time to receive a new CookieStore. </p><p>I tried to use SharedPreferences to store the CookieStore as a string, but I can't re-construct the CookieStore with a String.</p><p>Has anyone else had success in persisting a CookieStore?</p>","236300","","","","","2013-02-16 06:29:50","Saving CookieStore in http client service","<java><android><cookies>","2","0","","",""
"2226648","1","8369033","","2010-02-09 03:57:53","4","4946","<p>In looking at the ApiDemos example in the Android (1.5) SDK, there is a fine example of using an ImageSwitcher, with a Gallery object to provide the ""change image"" actions.</p><p>The application I'm looking to write, starting into Android development, has three images that I want to be able to pane/scroll through, so ImageSwitcher looks like a fine solution.  However, I don't [necesarily] want to have thumbnails in a gallery.  I want either a swipe action, and/or a button, to cause a scroll to the previous/next image in the set.</p><p>The example ImageSwitcher in ApiDemos uses a Gallery, and without that Gallery, doesn't do anything.</p><p>If someone has a suggestion of a way to bind some sort of button controller, or a U/I swipe object, I would appreciate the pointer.</p><p>Sorry to ask such a newbie level question.</p><p>Thanks.</p>","269202","","","","","2012-11-10 23:58:44","How to use an ImageSwitcher without a Gallery","<android>","1","1","1","",""
"2226836","1","","","2010-02-09 04:57:26","4","2614","<p>I'm writing an application with EditText driven widget. and I'd like to create my own copy &amp; paste menu. To replace android default menu on EditText, what should I do?Just overriding long click? or is there another way to implement?Thanks in advance.</p>","258508","","258508","","2010-02-09 05:58:15","2010-05-28 02:36:20","How can I write my own context menu for copy & paste?","<android><android-widget>","2","0","2","",""
"2226863","1","2226965","","2010-02-09 05:03:51","12","6960","<p>I'm an Android Developer and as part of my next app I will need to evaluate a large variety of user created mathematical expressions and equations.  I am looking for a good java library that is lightweight and can evaluate mathematical expressions using user defined variables and constants, trig and exponential functions, etc.</p><p>I've looked around and <a href=""http://www.singularsys.com/jep/"">Jep</a> seems to be popular, but I would like to hear more suggestions, especially from people who have used these libraries before.</p>","131871","","","","","2013-10-15 14:53:21","What's a good library for parsing mathematical expressions in java?","<java><android><math><parsing>","6","0","12","2013-10-15 15:46:59",""
"2227053","1","2227081","","2010-02-09 05:47:48","7","9298","<p>I have been following the Android getting <a href=""http://developer.android.com/resources/tutorials/hello-world.html"">started docs</a> and when I try to run the project I get:</p><pre><code>!MESSAGE An internal error occurred during: ""Launching HelloAndroid"".!STACK 0java.lang.NullPointerException        at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(Unknown Source)</code></pre><p>The application doesn't launch.</p>","77409","","","","","2012-12-25 13:46:56","Running an Android App in Eclipse Causes NullPointerException","<android>","4","0","3","",""
"2227140","1","","","2010-02-09 06:10:41","0","1087","<p>Hi i am trying to write test cases for ""phone"" native application , so i am trying to build that application from the source code...It has some dependency with the Contacts app , i am not able to resolve that . Any help regarding writing test cases for phone app or help on building it is very much helpful.</p><p></p><p>Thanks in Advance.</p>","237577","","","","","2010-03-31 13:00:03","How to build Dialer/Phone application from the source code?","<android>","1","0","1","",""
"2227154","1","2227377","","2010-02-09 06:14:14","5","9683","<p>I read a tutorial, and it uses SQLlite and ""SimpleCursorAdapter"" to fill the list with items.This is the code the tutorial taught me.</p><pre><code>private void fillData() {        // Get all of the notes from the database and create the item list        Cursor c = mDbHelper.fetchAllNotes();        startManagingCursor(c);        String[] from = new String[] { NotesDbAdapter.KEY_TITLE };        int[] to = new int[] { R.id.text1 };        // Now create an array adapter and set it to display using our row        SimpleCursorAdapter notes =            new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to);        setListAdapter(notes);    }</code></pre><p>However...what if I want to fill it with XML data? Is it the same method? Can someone give me an example (in code)? thanks.</p>","179736","","308315","","2011-12-19 04:36:19","2011-12-19 04:36:19","How do I fill a ListView (in Android) with XML or JSON data?","<java><xml><android><listview><activity>","1","0","5","",""
"2227209","1","2229154","","2010-02-09 06:27:34","8","12184","<p>In my application I want to upload the image.</p><p>For that I have to get images from gallery in android device.</p><p>How do I write code that accomplishes this?</p>","1746300","","127880","","2011-09-08 17:06:11","2011-09-08 17:06:11","how to get the images from device in android java application","<android>","1","0","12","",""
"2227270","1","","","2010-02-09 06:42:11","0","1915","<p>Can anybody help me to draw a scalable rectangle around a bitmap    And such that 1) The rectangle should scale based on the size of my bitmap                  2) The colour of my rectangle should change on my input    any help would be appreciated    Thank you</p>","253758","","","","","2012-05-01 08:40:51","Android: Draw a scalable rectangle(Should change colours on my input)around a bitmap","<android>","2","0","","",""
"2227292","1","","","2010-02-09 06:48:15","51","66850","<p>How to get the current Latitude and Longitude of the mobile device in android?</p>","217065","","114066","","2010-03-05 15:03:39","2013-10-02 04:03:58","How to get Latitude and Longitude of the mobiledevice in android?","<java><android><geolocation>","3","0","39","",""
"2227304","1","2229304","","2010-02-09 06:51:17","0","741","<p>I have read this blog entry about using relative layout to optimize layout in ListView:<a href=""http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html"" rel=""nofollow"">http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html</a></p><p>I have used this layout for my ListView Item (with a slight modification of the example):</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""?android:attr/listPreferredItemHeight""    android:padding=""6dip""&gt;    &lt;ImageView        android:id=""@+id/icon""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_alignParentTop=""true""        android:layout_alignParentBottom=""true""        android:layout_marginRight=""6dip""        android:src=""@drawable/icon"" /&gt;    &lt;TextView        android:id=""@+id/secondLine""        android:layout_width=""fill_parent""        android:layout_height=""26dip""         android:layout_toRightOf=""@id/icon""        android:layout_alignParentBottom=""true""        android:layout_alignParentRight=""true""        android:singleLine=""true""        android:ellipsize=""marquee""/&gt;    &lt;TextView        android:id=""@+id/text""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/icon""        android:layout_alignParentRight=""true""        android:layout_alignParentTop=""true""        android:layout_above=""@id/secondLine""        android:layout_alignWithParentIfMissing=""true""        android:gravity=""center_vertical"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>And I have modified the List14.java in APIDemo to use that ListItem View. But when I run it on emulator, I only see the icon, the text is blank. And when I open HierarchyViewer for the text View's height is 0.  Can someone please tell me why?</p><pre><code>public class TestListView extends ListActivity {     private static class EfficientAdapter extends BaseAdapter {            private LayoutInflater mInflater;            private Bitmap mIcon1;            private Bitmap mIcon2;            public EfficientAdapter(Context context) {                // Cache the LayoutInflate to avoid asking for a new one each time.                mInflater = LayoutInflater.from(context);                // Icons bound to the rows.                mIcon1 = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon48x48_1);                mIcon2 = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon48x48_2);            }            /**             * The number of items in the list is determined by the number of speeches             * in our array.             *             * @see android.widget.ListAdapter#getCount()             */            public int getCount() {                return DATA.length;            }            /**             * Since the data comes from an array, just returning the index is             * sufficent to get at the data. If we were using a more complex data             * structure, we would return whatever object represents one row in the             * list.             *             * @see android.widget.ListAdapter#getItem(int)             */            public Object getItem(int position) {                return position;            }            /**             * Use the array index as a unique id.             *             * @see android.widget.ListAdapter#getItemId(int)             */            public long getItemId(int position) {                return position;            }            /**             * Make a view to hold each row.             *             * @see android.widget.ListAdapter#getView(int, android.view.View,             *      android.view.ViewGroup)             */            public View getView(int position, View convertView, ViewGroup parent) {                // A ViewHolder keeps references to children views to avoid unneccessary calls                // to findViewById() on each row.                ViewHolder holder;                // When convertView is not null, we can reuse it directly, there is no need                // to reinflate it. We only inflate a new View when the convertView supplied                // by ListView is null.                if (convertView == null) {                    convertView = mInflater.inflate(R.layout.list_item_icon_text, null);                    // Creates a ViewHolder and store references to the two children views                    // we want to bind data to.                    holder = new ViewHolder();                    holder.text = (TextView) convertView.findViewById(R.id.text);                    holder.icon = (ImageView) convertView.findViewById(R.id.icon);                    convertView.setTag(holder);                } else {                    // Get the ViewHolder back to get fast access to the TextView                    // and the ImageView.                    holder = (ViewHolder) convertView.getTag();                }                // Bind the data efficiently with the holder.                holder.text.setText(DATA[position]);                holder.icon.setImageBitmap((position &amp; 1) == 1 ? mIcon1 : mIcon2);                return convertView;            }            static class ViewHolder {                TextView text;                ImageView icon;            }        }        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setListAdapter(new EfficientAdapter(this));        }        private static final String[] DATA = {                ""Abbaye de Belloc"", ""Abbaye du Mont des Cats"", ""Abertam"",                ""Zanetti Grana Padano"", ""Zanetti Parmigiano Reggiano""};}}</code></pre>","128983","","491044","","2011-03-11 09:13:34","2012-10-26 05:41:44","Need help in using android layout trick #1","<android>","4","0","","",""
"2227434","1","","","2010-02-09 07:25:59","1","2221","<p>I am trying to build an application (which would use the Hindi language and other regional languages) to get speech voice commands.</p><p>I also need text to speech functionality in my application.</p><p>I was wondering if there was any way I could get a speech recognition library on Android? I did a quick Google search and found a couple of libraries for Hindi on the Internet but I am not sure if I can include them in my Android project. Can I?</p>","245120","","12547","","2012-02-14 08:36:40","2014-02-24 07:51:48","Can I get speech recognition in language other than English on Android?","<android><speech-recognition>","2","0","","",""
"2227458","1","2227564","","2010-02-09 07:32:10","1","2430","<p>Working on android application, wanna add twitter feature to it , like after every commute send the twit to the user account . Is it possible to add twitter into the android app without asking for user's twitter account details (user_name and password). I think using Twidroid it is possible but i dont know how to proceed .Please guide .</p><p>thank u,regardsSheik</p>","143434","","","","","2011-06-02 10:06:51","Add twitter feature for android application","<android><twitter><username>","3","0","","","2010-02-09 07:32:10"
"2227604","1","2227636","","2010-02-09 08:07:26","20","8672","<p>Is there some event/receiver or something for handling first execution after installation or directly after installation? Or Do I need it emulate with preferences?</p>","263321","","","","","2012-03-08 14:18:14","Is there on install event in android?","<java><android>","4","0","4","",""
"2227621","1","2237163","","2010-02-09 08:12:57","1","1610","<p>I am very new to OpenGL ES. I am implementing some demo app to load multiple textures on the screen. For demo purpose I have loaded 2 textures in 2 different locations on the screen using glTranslatef() and glBindTextures() twice.</p><p>Now I am able to see 2 different images on the screen. Now I want to move one particular texture across the screen using mouse.</p><p>I know it may be silly topic, but please help me in this..</p><p>Thanks in advance..</p>","269304","","","","","2010-02-10 13:43:26","How to move a particular texture around screen in android using opengl es?","<android><opengl-es>","2","0","0","",""
"2227816","1","2227873","","2010-02-09 08:57:56","20","13955","<p>i want to point out google map location using overlay so for this purpose  latitude ,longitude value to be assigned to geopoint but it only accepts int values.</p><p>how can i assign it double value or any other solution to point out exact location?</p><pre><code>point = new GeoPoint((int)t.getLati(),(int)t.getLongi()) </code></pre><p>any help would be appriciated.</p>","249991","","55093","","2011-11-09 15:10:21","2011-11-09 15:10:21","how to give double value to Geopoint in GoogleMap overlays?","<android><google-maps>","1","0","7","",""
"2227905","1","","","2010-02-09 09:16:43","0","1436","<p>I am an experienced iphone developer and recently taken the plunge into android development as well.i came across this app and i wonder how was it developed on android (Cause it looks so much like an iphone app), see link below<a href=""http://lh5.ggpht.com/_63_i7B_SEMw/SmhfwhjWx2I/AAAAAAAAAI8/OoA40e42clo/s400/NYTimes-app-comes-to-android-market.jpg"" rel=""nofollow"">http://lh5.ggpht.com/_63_i7B_SEMw/SmhfwhjWx2I/AAAAAAAAAI8/OoA40e42clo/s400/NYTimes-app-comes-to-android-market.jpg</a></p><p>anyone have any idea how to accomplish that type of look on android</p>","269352","","","","","2010-02-09 12:31:09","Android Application looks like iphone","<android>","3","2","","",""
"2227997","1","","","2010-02-09 09:32:53","2","2239","<p>First, I want to imitate the effect like ""android.R.layout.simple_spinner_dropdown_item""</p><p>which is TextView+radiobutton</p><p>but either the getView() or getDropDownView only cares about one row at a time, while the whole radiobuttons in spinner is like one RadioGroup, and when dropdown view is opened, the radiobutton with which item is selected before must be checked.</p><p>so how can I imitate the layout like simple_spinner_dropdown_item?</p><p>Second, I want to add different ImageView in each row, so I can't just use the default simple_spinner_dropdown_item, I must redefine the ArrayAdapter.</p><p>So, is there a best way to get through these?</p><p>I like the layout in simple_spinner_dropdown_item, but I also want to add ImageView...</p><p>Please give me any clue at all</p><p>Thanks!!</p>","269342","","","","","2011-03-18 13:04:27","Image+TextView+radiobutton in spinner","<android><radio-button><spinner><imageview><android-arrayadapter>","2","0","1","",""
"2228100","1","","","2010-02-09 09:48:47","-2","623","<p>When a user accesses the map in my app, I want to display his image and name and have them point to his location. How can I make this happen?</p>","1746300","","122607","","2012-02-07 18:41:49","2012-02-07 18:41:49","Map pointer with user's image and name in an Android map","<android>","1","0","","",""
"2228151","1","2551047","","2010-02-09 09:56:32","18","15953","<p>I want to add haptic feedback to my application buttons and control them programatically to show button state (enabled and disabled)The default haptic feedback setter works only for long press. How can i make it work for simple button clicks.</p><p>Amd is there a way to have haptic feedback on events like touch move??</p>","237403","","887427","","2012-02-17 11:58:21","2012-10-31 06:42:56","How to enable haptic feedback on button view","<android><vibrate>","4","0","6","",""
"2228384","1","2228408","","2010-02-09 10:42:16","1","370","<p>Here is my code:</p><pre><code>private Button.OnClickListener gotologinpage3 = new Button.OnClickListener() {    public void onClick(View v) {        try {            Intent ii = new Intent(v.getContext(), login_profile.class);            startActivityForResult(ii,0);        }         catch (Exception e) {            e.printStackTrace();            // TODO: handle exception        }    }};</code></pre><p>Can I pass button id to function makenewProfile from class login_profile?</p>","263325","","3171","","2010-02-09 10:47:22","2010-02-09 10:47:22","passing button id in android","<android>","1","1","","",""
"2228827","1","2230424","","2010-02-09 12:01:53","1","4406","<p>I'm currently using Jain Sip on Android and I'm trying to get a SIP registration working.</p><p>I can put the registration SIP message together ok but after sending the message it seems to just get sent back to my application and my applications processRequest() method is run.</p><p>Here is the code I'm using :</p><pre><code> public void init(TextView tv) throws Exception {    SipFactory sipFactory = null;    sipStack = null;    sipFactory = SipFactory.getInstance();    sipFactory.setPathName(""gov.nist"");    Properties properties = new Properties();    properties.setProperty(""javax.sip.OUTBOUND_PROXY"", getLocalIpAddress()+"":8002"" + ""/""            + ListeningPoint.UDP);    properties.setProperty(""javax.sip.STACK_NAME"", ""Sip Test"");    // Create SipStack object    sipStack = sipFactory.createSipStack(properties);    tv.setText(""sipStack = "" + sipStack);    headerFactory = sipFactory.createHeaderFactory();    addressFactory = sipFactory.createAddressFactory();    messageFactory = sipFactory.createMessageFactory();    lp = sipStack.createListeningPoint(getLocalIpAddress(),            8002, ListeningPoint.UDP);    sipProvider = sipStack.createSipProvider(lp);    sipOnOffFlag = true;    tv.append(""\n jain sip stack started on "" + getLocalIpAddress() + "":"" + myPort + ""/"" + ListeningPoint.UDP);    sipProvider.addSipListener(this);       String fromName = ""019078020"";    String fromSipAddress = ""216.234.148.28"";    String fromDisplayName = ""Donal"";    String toSipAddress = ""216.234.148.28"";    String toUser = ""16784732970"";    String toDisplayName = ""Server"";    // create &gt;From Header    SipURI fromAddress = addressFactory.createSipURI(fromName,            getLocalIpAddress());    Address fromNameAddress = addressFactory.createAddress(fromAddress);    fromNameAddress.setDisplayName(fromDisplayName);    FromHeader fromHeader = headerFactory.createFromHeader(            fromNameAddress, null);    // create To Header    SipURI toAddress = addressFactory            .createSipURI(toUser, toSipAddress);    Address toNameAddress = addressFactory.createAddress(toAddress);    toNameAddress.setDisplayName(toDisplayName);    ToHeader toHeader = headerFactory.createToHeader(toNameAddress,            null);    // create Request URI    SipURI requestURI = addressFactory.createSipURI(toUser,            ""216.234.148.28"");    // Create ViaHeaders    List&lt;ViaHeader&gt; viaHeaders = new ArrayList&lt;ViaHeader&gt;();    String ipAddress = lp.getIPAddress();    ViaHeader viaHeader = headerFactory.createViaHeader(ipAddress,            lp.getPort(),            lp.getTransport(), null);    // add via headers    viaHeaders.add(viaHeader);    // Create ContentTypeHeader    ContentTypeHeader contentTypeHeader = headerFactory            .createContentTypeHeader(""application"", ""sdp"");    // Create a new CallId header    CallIdHeader callIdHeader = sipProvider.getNewCallId();    // Create a new Cseq header    CSeqHeader cSeqHeader = headerFactory.createCSeqHeader(1L,            Request.REGISTER);    // Create a new MaxForwardsHeader    MaxForwardsHeader maxForwards = headerFactory            .createMaxForwardsHeader(70);    // Create the request.    Request request = messageFactory.createRequest(requestURI,            Request.REGISTER, callIdHeader, cSeqHeader, fromHeader,            toHeader, viaHeaders, maxForwards);    // Create contact headers    SipURI contactUrl = addressFactory.createSipURI(fromName, getLocalIpAddress());    contactUrl.setPort(8002);    contactUrl.setLrParam();    // Create the contact name address.    SipURI contactURI = addressFactory.createSipURI(fromName, getLocalIpAddress());    contactURI.setPort(sipProvider.getListeningPoint(lp.getTransport())            .getPort());    Address contactAddress = addressFactory.createAddress(contactURI);    // Add the contact address.    contactAddress.setDisplayName(fromName);    contactHeader = headerFactory.createContactHeader(contactAddress);    request.addHeader(contactHeader);    // You can add extension headers of your own making    // to the outgoing SIP request.    // Add the extension header.    Header extensionHeader = headerFactory.createHeader(""Expires"",        ""0"");    request.addHeader(extensionHeader);    Log.d(""SIP"", """" + request.toString());    // Create the client transaction.    registerTid = sipProvider.getNewClientTransaction(request);    // send the request out.    registerTid.sendRequest();    dialog = registerTid.getDialog();}</code></pre><p>So the message gets built ok but when sendRequest() is run it doesn't appear to get sent to the server but rather back to my application and the applications processRequest method is run.</p><p>Should I be doing something extra with inviteTid or the dialog?</p><p>Do I need to create a socket or something to sent the request out?</p>","243999","","","","","2014-02-03 10:03:33","Android Jain Sip - Sip Registration?","<java><android><registration><sip><jain-sip>","1","3","3","",""
"2228889","1","","","2010-02-09 12:16:08","0","1068","<p>i new to android developer. how connect mysql web server database in android emulator.my web application database is connect by hibernate in struts2 application. so please help me and send some code for struts and android application code</p>","268741","","","","","2010-02-09 13:12:47","how to get the hibernate mysql database connection to android emulator","<android><hibernate><struts2>","1","1","","",""
"2229014","1","2229103","","2010-02-09 12:40:32","0","379","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2220326/how-display-advertisements-in-bottom-of-the-screen-in-android"">how display Advertisements in bottom of the screen in android?</a>  </p></blockquote><p>I want to create the advertisement bottom of the android application. The size of the bottom advertisement place is 20px.  How can I do this?</p>","212809","","1288","","2010-02-09 13:14:51","2010-02-09 13:14:51","How to add advertisment in bottom of android application?","<android>","2","1","","2010-02-09 13:13:44",""
"2229142","1","2229202","","2010-02-09 12:58:58","2","1012","<p>I am using Text to Speech.</p><p>When I set the language using</p><pre><code>mTts = new TextToSpeech(this, this);mTts.setLanguage(Locale.UK)</code></pre><p>I always get an American accent.</p><p>The only way to fix this is by changing the default language setting in the Android system.  What am I doing wrong?</p>","248521","","","","","2010-02-09 13:09:17","Text to Speech setLanguage() does not work","<android>","1","0","","",""
"2230268","1","2230561","","2010-02-09 15:42:10","5","11503","<p>My Android application can be divided into a client UI layer and a API layer. i would like to deploy them as separate ""applications"" so that the API layer can be reused.</p><p>In Eclipse, i write them as 2 separate Android projects. In the client UI project, i declare the API project in its build path (Project -> Properies -> Java Build Path -> Projects).</p><p>When deploying the client UI project through Eclipse (on my actual G1 phone), it automatically deploys the API project (packaged into APK) as well.</p><p>However, when launching the client UI application, i hit this error:</p><pre><code>Uncaught handler: thread main exiting due to uncaught exceptionjava.lang.VerifyError: myapp.android.testuiclient.Main    at java.lang.Class.newInstanceImpl(Native Method)    at java.lang.Class.newInstance(Class.java:1472)    at android.app.Instrumentation.newActivity(Instrumentation.java:1097)    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)    at android.app.ActivityThread.access$2100(ActivityThread.java:116)    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:123)    at android.app.ActivityThread.main(ActivityThread.java:4203)    at java.lang.reflect.Method.invokeNative(Native Method)    at java.lang.reflect.Method.invoke(Method.java:521)    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)    at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Looking around, it <em>seems</em> like i should declare uses-library under application in the manifest file for the UI client.</p><p>Question is, what should i put under android:name for uses-library? Dev guide says ""the name of the library"" but what is the name of the library? (i mean, in my API ""application"", i haven't declared any library name anywhere.)</p>","254959","","","","","2010-02-09 23:31:39","Android: How to Use ""uses-library""?","<android>","1","0","2","",""
"2230280","1","2230510","","2010-02-09 15:43:24","1","5029","<p>I need my activity to handle HOME button press with areceiver programmatically, but the event is not firing.  I can,however, successfully register and capture this intent filter if Ideclare it in a manifest.xml  activity section.  Here's the code forthe receiver that's not working:</p><pre><code>BroadcastReceiver br;br = new BroadcastReceiver() {       @Override       public void onReceive(Context context, Intent intent) {               return;  // I put a breakpoint here to see if this gets called       }};IntentFilter intf = new IntentFilter();intf.addAction(Intent.ACTION_MAIN);intf.addCategory(Intent.CATEGORY_HOME);intf.addCategory(Intent.CATEGORY_DEFAULT);registerReceiver(br, intf);</code></pre><p>Does anyone know why this doesn't capture the home button click?</p><p>By the way, I tried working around this by creating another activityand specifying its intent filter in the manifest.  I set the activityenabled=""false"" in the manifest but I couldn't figure out how toenable that activity at run time.  Bottom line, I only want toregister the home button intent filter for my application only when myapplication is running, and I can't figure out how to do that.</p>","265877","","265877","","2010-02-09 16:01:32","2011-06-24 12:17:11","Capturing HOME intent programmatically","<android><button><android-intent><intentfilter>","2","0","1","",""
"2230389","1","2230594","","2010-02-09 15:56:54","2","3366","<p>I'm writing an application for android. My problem is that I want it to force the connection in GPRS and not use wi fi. I have a solution like below, but this causes the crash of the application at start.</p><pre><code>ConnectivityManager CM =     (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE);CM.setNetworkPreference(ConnectivityManager.TYPE_MOBILE);</code></pre><p>I also added the below setting lines into manifest file.</p><pre><code>uses-permission android:name=""android.permission.WRITE_SETTINGS"" uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE"" uses-permission android:name=""android.permission.CHANGE_NETWORK_STATE""uses-permission android:name=""android.permission.CHANGE_CONFIGURATION"" uses-permission android:name=""android.permission.WRITE_SECURE_SETTINGS"" </code></pre><p>Does anyone know the problem, or an answer to set connection type?</p>","256546","","256546","","2010-02-09 17:51:14","2011-06-13 19:06:37","Android application setting connection type","<android><connection><internet><gprs>","2","2","1","",""
"2230899","1","","","2010-02-09 17:02:16","3","754","<p>I have this simple HTML that I load into an Android WebView (SDK version 1.5)-</p><pre><code>&lt;html&gt;&lt;body onload=""nomethod()""&gt;&lt;h1&gt;Hello World&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;</code></pre><p>Function nomethod() doesn't exist but the LogCat doesn't display any error.<br>It seems that any exception that isn't caught cannot be traced.<br>Any idea how can I handle or trace uncaught exceptions?  </p><p>Thanks!</p>","209622","","209622","","2010-02-09 18:49:48","2012-12-26 12:02:24","Where are JavaScript exceptions displayed when using Android WebView?","<android><exception><webview>","2","0","3","",""
"2230989","1","2231016","","2010-02-09 17:16:20","0","1258","<p>I know Android is better than J2ME, but I need to know what can I do with android but j2me can't? (just about UI), some examples could be...</p>","269671","","839601","","2011-10-11 07:12:39","2011-10-11 07:12:39","Android UI vs J2ME UI","<android><java-me><user-interface><mobile>","2","0","","",""
"2231274","1","","","2010-02-09 18:01:54","5","3493","<p>I am unable to load a GPX file in the DDMS eclipse plugin. When specifying a GPX file, no points are added to the emulator control list. I have tried adding KML files as well, generated in Google earth. </p><p>Is there a way to get these files to work? The content of the file is listed below:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;gpx  version=""1.0""  creator=""RunKeeper - http://www.runkeeper.com""  xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""  xmlns=""http://www.topografix.com/GPX/1/0""  xsi:schemaLocation=""http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd""&gt;&lt;trk&gt;  &lt;name&gt;Running 11/30/09 3:37 pm11/30/09 3:37 pm&lt;/name&gt;  &lt;time&gt;2009-11-30T15:37:08Z&lt;/time&gt;&lt;trkseg&gt;&lt;trkpt lat=""41.811406000"" lon=""-72.521427000""&gt; &lt;ele&gt;37.000000&lt;/ele&gt; &lt;time&gt;2009-11-30T15:37:08Z&lt;/time&gt;&lt;/trkpt&gt;&lt;trkpt lat=""41.811030000"" lon=""-72.522882000""&gt; &lt;ele&gt;38.000000&lt;/ele&gt; &lt;time&gt;2009-11-30T15:37:10Z&lt;/time&gt;&lt;/trkpt&gt;</code></pre>","269697","","1","","2010-05-11 10:59:19","2012-06-19 12:59:36","DDMS plugin not loading GPX files","<android>","3","1","2","",""
"2231318","1","3943917","","2010-02-09 18:09:18","20","10458","<p>The goal: refresh database from XML data</p><p>The process:</p><ul><li><strong>Start transaction</strong></li><li><strong>Delete</strong> all existing rows from the tables</li><li>Per each main element of parsed XML <strong>insert</strong> row into main table and get PK</li><li>Per each child of the main element <strong>insert</strong> record into 2nd table providing FK from the previous step</li><li><strong>Commit transaction</strong></li></ul><p>Pretty standard stuff as far as db operations. The problem is that CRUD operations are not done within <code>ContentProvider</code> but rather using <code>ContentResolver</code> so the insert for example looks like <code>resolver.insert(CONTENT_URI, contentValues)</code>. The ContentResolver API doesn't seem to have anything pertained to transaction and I cannot use <code>bulkInsert</code> since I'm inserting in 2 tables intermittently (plus I want to have <code>delete</code> inside the transaction as well). </p><p>I was thinking of registering my customized <code>ContentProvider</code> as listener by using <code>registerContentObserver</code> but since <code>ContentResolver#acquireProvider</code> methods are hidden how do I obtain the right reference?</p><p>Am I out of luck?</p>","135946","","","","","2013-12-30 07:18:23","Android: SQLite transactions when using ContentResolver","<android><sqlite><transactions><android-contentprovider><android-contentresolver>","4","2","14","",""
"2231438","1","2231554","","2010-02-09 18:25:23","5","18299","<p>this button is shown on my start activity. After pressing it a new activity will be launched but this takes some time cause on initialization of that new activity some data is gathered from the Internet.This works half. The progress dialoge is shown but the progress wheel is not spinning.</p><p>Can somebody tell me why this happens?</p><pre><code>  Button b4 = (Button) findViewById(R.id.Button01);      b4.setOnClickListener(new View.OnClickListener() {          public void onClick (View view) {               final ProgressDialog pd = ProgressDialog.show(pak.this,                          """", ""Working.."", true);            new Thread(new Runnable(){             public void run(){              Intent intent = new Intent();                 intent.setClassName(""sxe.pak"", ""sxe.pak.List"");                 startActivity(intent);                             pd.dismiss();                }           }).start();          }   });</code></pre><p>thx</p>","268575","","","","","2011-04-24 22:00:46","Progress Dialog while starting new activity","<android>","1","0","2","",""
"2231474","1","2231635","","2010-02-09 18:29:44","118","154008","<p>I'm trying to import and existing Android project into my current Eclipse workspace.  I select File->New->Android Project, which brings up the Android project dialog, I then select, ""Create project from existing source"", Location, Build Target and Finish.  </p><p>I get the following error: Invalid project description.  </p><p>Does anybody know how to get past this error?</p>","835","","","","","2014-03-08 19:15:35","How to import existing Android project into Eclipse?","<android><eclipse>","12","1","38","",""
"2231537","1","2328110","","2010-02-09 18:42:06","0","1506","<p>Basically, I have a custom ListView in which each item looks like:</p><p><code>&lt;LinearLayout&gt;</code></p><p><code>&lt;Table&gt; &lt;Row&gt; &lt;TextView/&gt; &lt;Button /&gt; &lt;/Row&gt; &lt;/Table&gt;</code></p><p><code>&lt;ListView /&gt;</code></p><p><code>&lt;/LinearLayout&gt;</code></p><p>The ListView in each item is GONE by default and is set to VISIBLE when the button is clicked.  Everything seems to work fine with the exception that when the ListView is long enough to scroll, it is just kind of truncated.</p><p><a href=""http://img38.imageshack.us/img38/3269/listviewproblem.png"" rel=""nofollow"">http://img38.imageshack.us/img38/3269/listviewproblem.png</a></p><p>Is this a problem with the maximum height of an individual list item? Is there a way to force the list item to expand and force the child listview to expand to show all children?  What am I doing wrong?</p>","155174","","","","","2010-02-24 17:36:56","Android ListView - Making the parent expand to show all children when addingListViews within ListViews","<android><listview><parent-child>","1","4","","",""
"2231624","1","2231647","","2010-02-09 18:55:38","2","1246","<p>I have seen the following two examples of starting activities in Android:</p><p>Example 1</p><pre><code>Intent myIntent = new Intent(CurrentActivity.this, NextActivity.class);CurrentActivity.this.startActivity(myIntent);</code></pre><p>Example 2</p><pre><code>// Calling activityNextActivity.show(this)// In the called activitystatic void show(Context context) {        final Intent intent = new Intent(context, NextActivity.class);        context.startActivity(intent);}</code></pre><p>It seems the obvious difference between the two examples is that you attach the logic of how an activity is created to the implementation of the activity. Are there any other key differences? (e.g. is the calling activity told to wait until the called activity finishes in one case, but not in the other, etc.)</p>","269721","","","","","2011-12-01 07:52:08","Difference Between 2 Ways to Start an Activity?","<android><activity><android-intent>","2","1","1","",""
"2231646","1","2263207","","2010-02-09 18:58:59","7","1757","<p>I am using Eclipse to develop both C and Java. I have an Android phone, and when I connect it to my PC, Eclipse (?) automatically starts adb, even though all the Android projects are closed. Is there a way to prevent this happening?</p><p>Reason: I want to tether my phone using pda-net to my PC, to use as a modem. pda-net cannot connect if another adb process is running.</p>","269750","","14343","","2010-07-14 23:41:18","2010-07-14 23:41:18","Can I turn off adb automatically starting when Eclipse is open?","<android>","1","1","1","",""
"2231787","1","2233442","","2010-02-09 19:17:49","2","2289","<p><br>Is it possible to get android device info (e.g. firmware version) from windows, when device is connected with PC by USB cable?As I understand AT commands are not available. I was trying to use ""adb"", but I cannot see any usefull options. Maybe there is some text file with device info on the filesystem of the phone, so I could use ""adb shell"" to read this file?<br>Regards!</p>","229697","","","","","2010-02-09 23:55:52","Read android device info from windows","<android>","1","0","","",""
"2232074","1","","","2010-02-09 19:50:45","6","7456","<p>I am assuming that using the OpenCV code here: <a href=""http://github.com/billmccord/OpenCV-Android#readme"">http://github.com/billmccord/OpenCV-Android#readme</a> is the best way to use OpenCV on Android, with the NDK. </p><p>I am still stuck as to how i get from the C definitions of functions to the ones i declare in OpenCV.java in my Android project (example: cvFindContours( void*  img,  CvMemStorage*  storage,                 CvSeq**  firstContour, int  cntHeaderSize,                 int  mode,                 int  method, CvPoint offset ) --> findContours(int[] data, int w, int h) ) </p><p>any help/pointers appreciated, even where to start to figure this out. i currently want to use cvHoughCircles, cvHoughCircles(CvArr* image, void* circle_storage,  int method, double dp, double min_dist, double param1 = 100, double param2 = 300, int min_radius = 0, int max_radius = 0};  </p><p>how do i write this in java with ndk for android?? thank you! </p>","269781","","","","","2010-08-02 00:32:11","OpenCV NDK Android help","<android><opencv><jni><android-ndk>","2","0","8","",""
"2232195","1","2232709","","2010-02-09 20:10:03","4","874","<p>My Android main application will consist in a main program, with a few pre-installed modules.<br>Then I want to offer different modules later, best would be as separate files. Modules like: location, weather, agenda. </p><p>How would you accomplish this?</p><p>I want to keep in the database the modules that are installed/present. So I must put sometimes the modules into database, maybe by detecting if there are present at launch time. The main app will work based on these modules.</p><p>How can I build these modules as separate files? They won't be an entry point in my application. So they must not be an application in the navigation menu. </p><p>Is this possible?<br>How do I have to create this using Eclipse?<br>In what format will I offer the modules?<br>How will the user add/remove modules?  </p>","243782","","243782","","2010-02-09 20:31:44","2010-02-09 21:36:28","How to achieve modularity structure of app subcomponents on Android?","<java><android><eclipse><architecture><modularity>","1","0","2","",""
"2232196","1","","","2010-02-09 20:10:05","4","829","<p>I'm writing a client application to connect a bluetooth device.</p><p>I only only know the name of the service of the bluetooth device. How can I connect with the service name and not with an uuid? Or How could I find the server UUID?</p>","269797","","1268895","","2012-05-01 02:38:11","2012-05-01 02:38:11","Connect via Bluetooth service name","<java><android><service><bluetooth>","1","0","1","",""
"2232232","1","","","2010-02-09 20:17:40","0","1439","<p>I want to know how I can use ResourceBundle.getBundle() in an Android application given that I use it in my Java applications.  For example:</p><p>I have a properties file, ""MyOrg.properties"", which I've included in a JAR file named ""MyOrg.jar"".  The path information in the JAR file associated with ""MyOrg.jar"" is ""myorg\"" (this is on a Windows system).  I build my Java application using ""myorg.jar"" and note that the following line of code works as expected, which is that it loads the file ""MyOrg.properties"" from ""MyOrg.jar"" as a java.util.ResourceBundle:</p><pre><code>        ResourceBundle resources = ResourceBundle.getBundle( ""myorg.MyOrg"" );</code></pre><p>Next, I place a modified copy of the file ""MyOrg.properties"" on the file system in the directory ""c:\myorg"", which is on my Java application's class path.  I now rerun my Java application and note that the Resource.getBundle() returns, as expected, a bundle for the modified copy of ""MyOrg.properties"" (the one that is on the file system).</p><p>The behavior I've just described is what I would like to be able to accomplish with an Android application.  However, ResourceBundle.getBundle() throws a MissingResourceException; it fails to find ""MyOrg.properties"" in either the JAR file or as a stand-alone file.</p><p>So I have two questions:</p><p>1) - Is it possible for an Android application to retrieve a resource from a JAR file using ResourceBundle.getBundle() (or any other way for that matter)?</p><p>2) - Is it possible for an Android application to retrieve a resource from a file using ResourceBundle.getBundle()?</p><p>Regarding 2): I'm using the nbandroid plugin with NetBeans 6.7.1 and I've placed copies of ""MyOrg.properties"" on the file system as follows prior to building my Android application:</p><p>MyProject</p><p>--  build</p><p>--  classes</p><pre><code>  myorg (directory contains ""MyOrg.properties"")</code></pre><p>...  src</p><pre><code>  myorg (directory contains ""MyOrg.properties"")</code></pre>","263807","","","","","2010-02-14 04:31:47","What is the proper way to use ResourceBundle.getBundle() in an Android application?","<java><android><netbeans>","1","0","","",""
"2232238","1","2235130","","2010-02-09 20:18:22","22","38257","<p>In Android, I defined an activity ExampleActivity.</p><p>When my application was launched, an instance of this A-Activity was created, say it is <code>A</code>. When user clicked a button in <code>A</code>, another instance of B-Activity, B was created. Now the task stack is B-A, with B at the top. Then, user clicked a button on B, another instance of C-Activity, and C was created. Now the task stack is C-B-A, with C at the top.</p><p>Now, when user click a button on C, I want the application to bring A to the foreground, i.e. make A to be at the top of task stack, A-C-B.</p><p>How can I write the code to make it happen?</p>","256239","","445131","","2013-09-22 03:20:08","2013-09-22 03:20:08","How to bring an activity to foreground (top of stack)?","<android><android-intent><android-activity>","6","0","9","",""
"2232321","1","2232380","","2010-02-09 20:31:24","5","10301","<p>I have an unfinished application, but I want to address now the future update of it.</p><p>Suppose my app was upgraded, so when starts, detects that the database schema is outdated. So for each table has to update according to version number to the new schema while preserving all data.</p><p>I've read somewhere that on Android the SQLite database have some version number, and auto update stuff, but I didn't found an example for this specific issue.</p><p>How can this be accomplished on an Android app, using SQLite databases?</p><p>Is there a specific version number per table stored on Android SQLite databases?  If so, how can I read it, and use for my above purpose?</p>","243782","","","","","2010-02-09 20:40:56","How to update table schema after an app upgrade on Android?","<android><sqlite><upgrade><database>","2","0","2","",""
"2232717","1","2232835","","2010-02-09 21:37:30","4","1611","<p>I'm looking for ways to back up the database of my app on an Android phone. I know that SQLite databases are just files, so I'd expect to be able to just copy the file to SD-card if one is available.</p><p>However, I'm unsure as to how I'd prepare my database/activity for backup/restore.</p><p>When starting, my main activity reads the entries from one table in the database and displays them in a <code>ListView</code>. As shown in the API's ""Notes"" sample, I have a cursor that is automatically notified about changes to that table (<code>ListView</code> is automatically updated when I add/remove/update records in the table).</p><p>So: When I copy the database file to SD-card, I should not have a problem. But what if the user wants to restore a database file? I can't just copy the file back to the data folder, can I (EDIT: ... while a view displays data from the database and thus maybe holds an open connection)?</p><p>What would be ""best practice"" when implementing backup/restore? One approach I've considered is:</p><ol><li>Open a special ""restore"" activitythat holds no open databaseconnections</li><li>Call <code>finish()</code> for themain activity to remove it and closedatabase connections</li><li>Copy back the database file </li><li>Open a new ""instance"" of the main activity </li><li>Call <code>finish()</code> for the ""restore"" activity</li></ol><p>Would that be the way to go? Thanks for any advice!</p>","117362","","117362","","2010-02-10 11:13:31","2010-02-10 11:13:31","Android database backups","<database><android><backup>","1","0","","",""
"2232867","1","","","2010-02-09 22:04:26","1","133","<p>I am trying to start a service in android after it is constructed: </p><pre><code>String ip = ((EditText)findViewById(R.id.ip)).getText().toString();int port = Integer.valueOf( ((EditText)findViewById(R.id.port)).                                          getText().toString() );        try {            IConnectionManager connectionManager =                 new SocketConnectionManager(ip, port);            Alerter alerter = new Alerter(connectionManager);                            **//tell android to start alerter**        } catch (IOException e) {            // show a dialog             e.printStackTrace();        }</code></pre><p>It seems that android insists on instantiating the class it self. Does anyone know a way of injecting the dependencie without resorting to global state?</p>","269871","","166712","","2010-02-09 22:11:44","2010-02-09 22:11:44","DI for android services","<android>","0","3","","",""
"2233049","1","2233418","","2010-02-09 22:38:35","1","1700","<p>I have a standard ListView. It's not displaying the scrollbar track thumb though. Is there some special setting you need to set in order to show the scrollbars? My definition looks like this:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical""   android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;  &lt;ListView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:dividerHeight=""1dip"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>The listview has data, and it has enough items to scroll.</p><p>Thanks</p>","246114","","","","","2010-02-09 23:50:30","Scrollbars not showing on ListView?","<android>","1","0","","",""
"2233292","1","2233312","","2010-02-09 23:24:46","18","15284","<p>I want to build a relatively simple version of my site for mobile phones, but I will definitely need JavaScript and jQuery for many functions.</p><p>Googling didn't help to find an answer. How is compatibility of jQuery with popular browsers in mobile phones? </p><p>I am talking for smartphones. For example, the default browsers for these platforms</p><ul><li><a href=""http://en.wikipedia.org/wiki/Windows_Mobile"" rel=""nofollow"">Windows Mobile</a> 6+</li><li>Android 1.5+</li><li><a href=""http://en.wikipedia.org/wiki/IPhone_3G"" rel=""nofollow"">iPhone 3G</a></li></ul><p>and let's add <a href=""http://en.wikipedia.org/wiki/Opera_Mobile"" rel=""nofollow"">Opera Mobile</a>.</p>","168680","","63550","","2013-06-22 10:51:24","2014-03-19 12:31:42","jQuery and mobile browser compatibility?","<jquery><iphone><android><mobile><jquery-mobile>","7","2","5","",""
"2233602","1","2233673","","2010-02-10 00:38:54","3","677","<p>Web frameworks to develop for Android and iPhone?</p>","128028","","","","","2011-08-12 09:23:56","Web frameworks to develop for Android and iPhone?","<iphone><android><frameworks>","2","0","1","",""
"2233631","1","2233946","","2010-02-10 00:44:23","5","837","<p>I learned that the Android Scripting Environment (ASE) supports python code. Can I take my existing python programs and run them on android?</p><p>Apart from the GUI, what else will I need to adapt? How can I find the list of supported python libraries for ASE? </p>","269931","","16587","","2010-02-10 02:15:49","2010-02-10 02:15:49","Can I port my existing python apps on ASE?","<python><android><ase><android-scripting>","1","0","2","",""
"2233633","1","","","2010-02-10 00:44:31","2","2185","<p>Is there any way I can dynamically generate uplink DTMF tone (ie the receiver hears it)?</p><p>When I looked at the android source code I saw a function called <code>startDTMF()</code> which is exactly what I need, but I couldn't find any API that allows me to access that function...</p><p>I then thought of using ToneGenerator and tried to inject the sound to the mic stream, and again I couldn't find a way to achieve this...</p><p>Any help is appreciated.</p>","269939","","2387010","","2013-09-16 19:41:30","2013-09-16 19:41:30","Uplink DTMF tone generation","<android><dtmf>","2","1","2","",""
"2233810","1","","","2010-02-10 01:26:09","4","4544","<p>I am the beginner for android development. I followed the procedure as specified in developer.google.com . for installing I Tried to create AVD(Android virtual device) through command path. I executed at command prompt.</p><pre><code> android create avd --target 2 --name my_avd</code></pre><p>But the Error is coming ""<code>Error: Target id is not valid. Use 'android.bat list targets' to get the target ids</code>.""</p><p>After executing <code>android.bat</code> list targets is showing blank. I am not able to figure out the problem as I have already set the path also.</p>","224167","","1626878","","2012-12-22 13:09:28","2012-12-22 13:09:28","Issue creating AVD on command prompt in windows XP","<android><eclipse><command-prompt><avd>","4","1","","",""
"2234292","1","3180284","","2010-02-10 03:53:24","22","12802","<p>Creating a Drawable that is completely empty seems like a common need, as a place holder, initial state, etc., but there doesn't seem to be a good way to do this... at least in XML. Several places refer to the system resource <code>@android:drawable/empty</code> but as far as I can tell (i.e., it's not in the reference docs, and aapt chokes saying that it can't find the resource) this doesn't exist.</p><p>Is there a general way of referencing an empty Drawable, or do you end up creating a fake empty PNG for each project?</p>","2963","","","","","2014-01-22 12:13:39","Creating an empty Drawable in Android","<android>","5","0","3","",""
"2234297","1","2237058","","2010-02-10 03:54:53","0","189","<p>When I load my application I also load and Android Service that helps me download files from the internet.</p><p>The user may have 1 or more downloads at any given time, all in their own Thread which is managed by the service.  </p><p>If the user presses the home button I do not destroy the service but instead let it run, however, if the user presses the back button I do stop() the service as I felt this was the right thing to do (the user would not want stray services running). </p><p>This works OK unless there are stray Threads that have not completed yet (this could happen if the internet connection is not active etc.).  </p><p>How could I manage this?  How could I stop all Threads as I have no reference to them...or somehow command android to stop my service once all Threads are complete and my app has closed?</p>","248521","","","","","2010-02-10 13:27:20","Closing down a service that has active Threads","<android>","1","2","","",""
"2234699","1","2234736","","2010-02-10 05:41:15","0","112","<p>I would like to have an application sync itself with some files on a host computer.. Anyone know if this is possible? Eg: When you connect an Android phone to a computer i would like an application on the android system to read some allowed folders on the connected computer. Making it so the user doesn't have to sync files itself.</p><p>I ask possible, because i assume it isn't.. for security.</p>","80943","","","","","2010-02-10 05:58:04","Reading the connected computer's drives from an Android App?","<android>","1","0","","",""
"2234742","1","","","2010-02-10 05:53:15","56","25969","<p>My web application runs in localhost server. In my emulator the URL is <a href=""http://localhost:8080/myaction"">http://localhost:8080/myaction</a></p><p>Is it possible to retrieve the informaion from the server?</p>","268741","","15825","","2010-03-29 10:01:28","2014-01-15 12:09:35","test the localhost in android emulator","<android><struts><localhost>","1","1","15","",""
"2234901","1","","","2010-02-10 06:34:17","3","4053","<p>I intend to use the Android Emulator to send/receive SMS. </p><p>I send SMS to the emulator using the <code>sms send</code> command. I'm aware of emulators being able to converse with each other over SMS but would it possible to receive that the SMS reply sent  from an Android Emulator on a external TCP port?</p><p>Any pointers would be very appreciated.</p><p>Many thanks.</p>","270058","","157880","","2011-12-30 06:41:41","2011-12-30 06:41:41","Android Emulator: Receive SMS sent from emulator on a port","<android><android-emulator><sms>","1","0","","",""
"2235101","1","","","2010-02-10 07:25:40","2","144","<p>I have 2 textviews and one imageview and i want to bind them into a single control so that i can implement horizontalScrollView on them...</p><p>Is there a way to merge different controls so that we can use them???</p><p>Or is there a way to implement horizontalScrollView on multiple controls simulataneously??</p><p>Thanks in advance</p>","270080","","","","","2010-02-10 07:42:30","can we bind 3 controls into a single control in android?","<android>","1","0","","",""
"2235348","1","2286027","","2010-02-10 08:30:15","3","1062","<p>In my android application, I would like to retrieve the birthday field from google.com/contacts, as this field isn't synchronised in the android contacts application.How can I have a read access to google contacts ?</p><p>I saw the <a href=""http://code.google.com/intl/fr-FR/apis/contacts/"" rel=""nofollow"">Google contacts APIs</a>, did I have to use it ? which one ? the <a href=""http://code.google.com/intl/fr-FR/apis/contacts/docs/poco/1.0/developers_guide.html"" rel=""nofollow"">Portable version</a> ?</p><p>Or is there a simple way to read these contacts, as Android does when there is a synchronisation ?</p><p>Thanks in advance</p>","231417","","881229","","2013-12-07 19:41:36","2013-12-07 19:41:36","How to have a read access to google.com/contacts from an android handset?","<android><google-contacts>","2","0","","",""
"2235501","1","2235635","","2010-02-10 08:58:40","14","3926","<p>I am testing a database storage after retrieving data from the internet, I would like to be able to start the emulator with internet working, and then, while it is running, stop internet access to force it using the database as a source to display data.Is that possible?</p>","263521","","881229","","2014-02-12 21:21:08","2014-03-01 11:59:14","Stop Internet access on the emulator android","<android><networking><android-emulator>","2","0","2","",""
"2235657","1","","","2010-02-10 09:25:11","3","6099","<p>Suppose I have a webview open:</p><pre><code>  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    main_webv = (WebView) findViewById(R.id.mainwebview);    main_webv.setWebViewClient(new HelloWebViewClient());    main_webv.getSettings().setJavaScriptEnabled(true);    main_webv.getSettings().setSupportZoom(false);    main_webv.addJavascriptInterface(new HelloJavascriptInterface(),""hello"");    main_webv.setWebChromeClient(new HelloWebChromeClient());    main_webv.loadUrl(SPLASH);       main_webv.setVisibility( 4 );    setContentView(R.layout.main_list);             main_listv = (ListView) findViewById(R.id.mainlistview);    }</code></pre><p>I simply want to create a <strong>ListView</strong> above this webview (covering it up...but sitll allowing the webview to run). I could toggle the views on and off.Thanks.</p>","179736","","179736","","2010-02-10 10:55:24","2010-02-11 12:40:29","How do I display 2 views in 1 activity (android)?","<android><listview><templates><activity><webview>","2","0","3","",""
"2235813","1","2244474","","2010-02-10 09:51:36","2","3210","<pre><code>public class hello extends Activity, ListActivity {    WebView main_webv;      ListView main_listv;    public static final int REFRESHLIST_ID = Menu.FIRST;    private Handler mHandler = new Handler();    private static final String SPLASH = ""http://"";    private static final String LIST_NAMES = ""http://"";    private class HelloWebViewClient extends WebViewClient {        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            view.loadUrl(url);            return true;        }    }    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.main);        main_webv = (WebView) findViewById(R.id.mainwebview);        main_webv.setWebViewClient(new HelloWebViewClient());        main_webv.getSettings().setJavaScriptEnabled(true);        main_webv.getSettings().setSupportZoom(false);        main_webv.addJavascriptInterface(new HelloJavascriptInterface(),""hello"");        main_webv.setWebChromeClient(new HelloWebChromeClient());        main_webv.loadUrl(SPLASH);          main_webv.setVisibility( 4 );        setContentView(R.layout.main_list);                 main_listv = (ListView) findViewById(R.id.mainlistview);        }</code></pre><p>As you can see, I first create a webview.  Then, I want it to immediately disappear.  Then, I want the Listview to come up. But the problem is, I can't do Listview if I don't do ListActivity...but then I can't do Activity...</p>","179736","","179736","","2010-02-25 03:17:05","2011-07-11 09:48:32","How to do a WebView AND ListView in the same Activity onCreate()?","<android><listview><activity><webview>","3","0","1","",""
"2235863","1","2236565","","2010-02-10 09:59:18","0","887","<p>Im trying to make my application show an icon to the top right, next to the clock and battery-icon, <a href=""http://img694.imageshack.us/img694/1372/androidemulator.jpg"" rel=""nofollow"">like this</a>.</p><p>I am unable to find any documentation on this issue. If it is undocumented, i.e. ""API can be changed at any time"", then I dont think I will use it. But otherwise, it would be very neat to indicate that my service is active. </p>","249871","","249871","","2011-09-10 13:29:01","2014-03-13 10:43:29","Adding icon to top right of android home-screen","<android>","2","0","","",""
"2235934","1","2236527","","2010-02-10 10:12:25","0","411","<p>So I'm writing an app. I would like to be able to press the home key to leave the app, do something else for a moment, then come back to the app by picking it from the launcher. I want the app to have exactly the same state as it did when I left it.To this end, I have implimented onSaveInstanceState() to create a bundle, and I use this bundle in onCreate() (checking if it is null, of course).</p><p>This is what I would expect to happen...<br>-I install the app from Eclipse<br>-I launch the app from the launcher<br>-I press the home key<br>-onSaveInstanceState() is caled, I write a bundle<br>-I launch the app again from the launcher<br>-onCreate() is called, I get the bundle I previously wrote<br>-I use that bundle to restore my ui</p><p>This is what happens though...-I install the app-I launch the app from the launcher<br>-I press the home key<br>-onSaveInstanceState() is called, bundle is written<br>-I launch the app again<br>-onCreate() is called WITHOUT my bundle<br>-What appears to have happened is that a new activity has been put onto the stack for this task.<br>-I press the back button<br>-The activity I just launched is destroyed, and the activity i launched first is displayed, with the correct state!<br>-Repeat pressing back until back at the homescreen<br>-The lifecycle now works as expectecd! Even after a reboot, but it fails when I install a new version of the app</p><p>What could possibly be doing this, ONLY after installation!</p>","200426","","","","","2010-02-10 11:51:57","Save activity gui state","<android>","2","0","","",""
"2235951","1","","","2010-02-10 10:15:41","0","1890","<p>how to load the mysql server in android emulator</p><p>i.eClass.forName(""com.mysql.jdbc.Driver"")</p><p>i got the exception java.land.ClassNotFoundException in com.mysql.jdbc.Drive </p><p>please reply me.</p>","268741","","","","","2010-11-16 09:30:51","load the mysql driver in android emulator","<mysql><android><driver><emulator>","3","1","","",""
"2236041","1","","","2010-02-10 10:31:23","4","1926","<p>I have an application that keeps a long-standing network connection to a server.</p><p>I periodically ping the server to know if its still alive.</p><p>I imagine that it affects battery life, but other than trying to wall-clock time the time between charges, I don't have a good way of quantifying this.</p><p>Is there a mechanism for being told when the CPU 'wakes up', or when it wants to go to sleep?</p><p>Is there a standard way of doing long standing connections that minimises power consumption?</p>","15721","","","","","2010-04-16 18:54:48","Tracking power use on Android","<android><optimization>","2","1","4","",""
"2236054","1","2236191","","2010-02-10 10:33:13","3","8880","<p>I keep getting </p><p><code>ADB rejected shell command (ls -l /data):</code></p><p>and the command prompt when running <code>adb shell</code> tells me <code>error: device not found</code> although the emulator is open.</p><p>What I am doing wrong?</p>","243782","","164901","","2010-05-09 19:16:35","2010-05-09 19:16:35","ADB rejected shell command (ls -l /data)","<android><shell><windows-7><emulator><adb>","1","8","","",""
"2236120","1","2236263","","2010-02-10 10:43:00","33","32963","<p>After I start the emulator by hitting Debug in Eclipse, after certain time it disconnects from the ADB, but the emulator stays open. It is responsive, I can navigate and start apps.</p><p>How can I attach back the emulator to ADB, to be able to debug from Eclipse?</p><p>(the current workaround is the terminate the emulator, close Eclipse and restart both of them, which takes 10 minutes as you know the emulator needs time to start up)</p><p><strong>EDIT 1</strong><br>Check out this image:</p><p><img src=""http://i.stack.imgur.com/kesMq.jpg"" alt=""enter image description here""></p><p><strong>EDIT 2</strong></p><p>After I kill and restart server. One emulator process shows up in Devices tab in Eclipse. But that cannot be expanded, and I don't see sub-processes.<br>I can't hit debug already, as it says: Debug already running. (How to I stop the debug?)</p><p>If I managed to start the debugging of another project, It hangs out in the emulator telling me: Waiting for the debugger to attach. Nothing happens.</p>","243782","","1341006","","2012-10-15 11:25:21","2013-11-25 15:40:00","How to attach back the Android emulator to ADB?","<android><eclipse><android-emulator><emulator><adb>","7","0","20","",""
"2236303","1","2237134","","2010-02-10 11:14:31","1","730","<p><img src=""http://www.lboro.ac.uk/it/google/android-images/image002.jpg"" alt=""http://www.lboro.ac.uk/it/google/android-images/image002.jpg""></p><p>I am after the XML view code, just like the E-mail setup.<br>How can I put on that bottom grey bar that Next button, how about a Prev button on left side?</p>","243782","","","","","2010-02-10 13:39:04","Help for basic Android view for a Next/Prev navigation like E-mail setup","<java><xml><android><layout><view>","1","1","","",""
"2236362","1","2237506","","2010-02-10 11:23:23","1","2113","<p>I'm thinking of implementing a HTML welcome panel to our Android app, which presents news and offers on the start-up screen. My question is now, if I present an offer to a specific place (with an <code>id string</code>) can I trigger a callback from the WebView (maybe via Java Script) to the Android app and passing that <code>id string</code> to make it start a new <code>Activity</code> which loads and shows data from a server (JSON) depending on that <code>id string</code>?</p><p>The second part is already implemented and working. My main concern is how to get the <code>id string</code> from the HTML WebView back to the Android app when the user clicks on it.</p><p>We prefer to use a WebView for that specific welcome panel, because it gives us more flexibility to customize by using HTML.</p>","184367","","","","","2011-10-14 22:22:56","Android: click within WebView causes callback to Android application","<android><callback>","2","0","1","",""
"2236413","1","2236542","","2010-02-10 11:31:26","2","6384","<p>i want to redirect to particular URL while clicking on button</p>","217065","","","","","2010-02-18 14:16:14","how to redirect to particular URL while clicking on button in android?","<android>","1","1","","",""
"2236567","1","","","2010-02-10 11:57:10","12","2924","<p>How to play audio from a stream in android???</p><p>I will get input stream  from an online link( like continuous FM).</p><p>I need to cache the stream and play it.</p><p>I searched a lot in sites,,,but didnt get.They show option of playing from a stored file.</p><p>There is no option to play from a stream.</p>","270246","","759866","","2014-02-20 17:43:10","2014-02-20 17:43:10","play audio from a stream in android","<android>","2","0","6","",""
"2236818","1","2236852","","2010-02-10 12:47:23","8","31850","<p>I need to use my phone as emulator/target/virtual device when I run my application.I have installed HTC Sync and the USB driver is in order.I have enabled the USB Debugging in Settings.</p><p>What more do I need to do to make Eclipse AVD Manager to detect my phone?I made it work on anohher coumputer, following the exact same steps I have done now. ""Suddenly"" it just detected the phone. This makes no sense! <em>argh</em></p><p>Help please?</p>","270273","","","","","2013-08-05 12:39:24","Android: AVD manager won't detect my HTC Hero phone as Virtual Device","<android><eclipse><emulator><manager><avd>","8","0","1","",""
"2236905","1","","","2010-02-10 13:01:14","0","536","<p>I am new to Android GPS application development.I have to show multiple location in the map and if user touches any one of the location then it should display the information about that place.Now my problem is i could not able to get the exact location in the touch event.Is there any way to get the exact pointed location of image in the overlay.</p>","132724","","","","","2010-02-10 15:06:44","How to solve this overlay problem in android?","<android>","2","0","","",""
"2237001","1","2237793","","2010-02-10 13:16:00","8","10262","<pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;    &lt;TableLayout android:id=""@+id/TableLayout01""        android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;        &lt;TableRow android:id=""@+id/TableRow01"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content""&gt;            &lt;Button android:layout_width=""wrap_content""                android:layout_height=""wrap_content"" android:text=""Settings""                android:id=""@+id/btnSettings""&gt;&lt;/Button&gt;            &lt;Button android:text=""@+id/Button01"" android:id=""@+id/Button01""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;            &lt;Button android:text=""@+id/Button02"" android:id=""@+id/Button02""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;        &lt;/TableRow&gt;        &lt;TableRow android:id=""@+id/TableRow02"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content""&gt;            &lt;Button android:text=""@+id/Button03"" android:id=""@+id/Button03""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;            &lt;Button android:text=""@+id/Button04"" android:id=""@+id/Button04""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;            &lt;Button android:text=""@+id/Button05"" android:id=""@+id/Button05""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/ScrollView&gt;</code></pre><p>I have a table having 2 rows each row having 3 buttons. How can I make the buttons to fill the space equally. In HTML I would give them 33% width.</p><p>Also do you know any way I can create a view having 4 image buttons in a row as a grid layout, similar to the launcher. </p>","243782","","","","","2012-01-11 21:06:02","Buttons to fill width when using TableLayout","<xml><android><views><tablelayout>","3","0","2","",""
"2237147","1","2415352","","2010-02-10 13:40:42","10","15756","<p>I've found plenty of tutorials / questions on Stackoverflow that deal with copying char arrays from C/JNI side into something like a byte[] in Java, but not the other way around. </p><p>I am using a native C library which expects a byte array. I simply want to get data from a byte[] in java, into preferably an unsigned char[] in C.</p><p>Long story short: What is the best way of copying data from a jBytearray in JNI? Is there any way to detect it's size?</p>","51133","","","","","2014-01-21 03:20:26","Copying a byte buffer with JNI","<android><jni><android-ndk>","2","1","5","",""
"2237190","1","2237850","","2010-02-10 13:46:23","5","1363","<p>I need to copy files to the system partition of the emulator. As it is read only by default, I use the command ""adb remount"" to have write permissions and I can then copy the files.My problem is that when I close the emulator and that I restart it, the copied files were missing. It's very annoying because I must write file permissions that are read at startup of the emulator (platform.xml file in /system/etc/permissions)</p>","164460","","","","","2014-01-07 03:24:36","android emulator copy files in system partition","<android><copy><system><emulator>","2","0","1","",""
"2237265","1","2237866","","2010-02-10 13:58:25","8","3462","<p>I have an image button as defined below.  </p><pre><code>&lt;ImageButton     android:text=""Play""    android:src=""@drawable/playpause""    android:background=""@drawable/opaque""     android:gravity=""center_horizontal""    android:id=""@+id/player_ctrl_btn""    android:layout_width=""fill_parent""     android:padding=""0px""    android:layout_height=""wrap_content"" /&gt;</code></pre><p>I want to set the default state of the button to be selected.  So in code I would say: </p><p><code>playBtn.setSelected(true);</code></p><p>Is it possible to do this in xml?</p>","240566","","","","","2014-02-21 13:12:53","How do I set the selected state of an image button with xml","<xml><android><gui><imagebutton>","2","0","","",""
"2237545","1","2239166","","2010-02-10 14:41:27","11","1447","<p>when providing a user on a mobile, a link to an android application via a web page, it is possible for params from the url to be passed to the app being installed.</p><p>I'm guessing the answer is no - but it doesn't help to ask.</p><p>The reasoning being that it would be handy for some situations to have a generic app that pulls config information from the referrer.</p>","270364","","","","","2011-07-30 11:19:23","Is there a way to pass parameters to the marketplace installer for an app","<android><marketplace>","2","0","1","",""
"2237707","1","2237874","","2010-02-10 15:01:24","5","4599","<p>I was wondering if anyone knows of a way I can Authenticate a Google Apps User in a Android Application? </p><p>One approach I know of is to take could take their username and password in a android view, and use the clientLogin interface (<a href=""http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html"" rel=""nofollow"">http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html</a>).</p><p>However I was wondering if there was a different approach, maybe pushing to a browser window where it would show the google login for that domain, but I would not know how to get the details back to the application, after the authentication is done.</p><p>Any ideas on how it would be done?</p><p>Regards</p><p>Mark</p>","66319","","","","","2010-07-17 15:43:32","Anyway to Authenticate a user using Google Apps in an Android application?","<android><authentication><google-apps>","2","0","3","",""
"2238356","1","2238587","","2010-02-10 16:15:00","3","11095","<p>I know that I can do something like this:</p><pre><code>Preference pref = findPreference(getString(R.string.pref_vibrate_on_key));pref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {        @Override        public boolean onPreferenceChange(Preference preference,                Object newValue) {            LogUtil.d(""Working!"");            return true;        }});</code></pre><p>But I would like to add a Listener to every preference.I tried doing:</p><pre><code>SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);sp.registerOnSharedPreferenceChangeListener(new OnSharedPreferenceChangeListener() {        @Override        public void onSharedPreferenceChanged(                SharedPreferences sharedPreferences, String key) {            LogUtil.d(""working!"");        }});</code></pre><p>but it doesn't work.Is this possible? If so, what am I doing wrong?</p>","119895","","","","","2013-03-11 14:12:39","OnPreferenceChangeListener for every setting","<android><android-preferences>","3","1","2","",""
"2238714","1","2239172","","2010-02-10 17:01:02","3","2639","<p>I currently use AudioRecord to record audio in from the mic of an Android device and then pipe that straight to an AudioTrack that plays it out the Earpiece of an Android device.</p><p>I'm wondering can I do the same but with the MediaPlayer and MediaRecorder classes instead as I need to use the AMR-NB encoding that is available on the Media classes and not the Audio classes.</p><p>My problem with MediaRecorder and MediaPlayer is that it seems like I have to record to a file and then play for that file?</p><p>This is not what I want to do, is there anyway to stream the audio sound from Mic to Earpiece with the Media classes?</p><p>My code using the Audio classes is below, is it possible to do something the same with the MediaPlayer and MediaRecorder?</p><pre><code>public class Record extends Thread {    static final int bufferSize = 200000;    final short[] buffer = new short[bufferSize];    short[] readBuffer = new short[bufferSize];    public void run() {        isRecording = true;      android.os.Process.setThreadPriority      (android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);      int buffersize = AudioRecord.getMinBufferSize(11025,      AudioFormat.CHANNEL_CONFIGURATION_MONO,      AudioFormat.ENCODING_PCM_16BIT);                     arec = new AudioRecord(MediaRecorder.AudioSource.MIC,                                     11025,                                     AudioFormat.CHANNEL_CONFIGURATION_MONO,                                     MediaRecorder.AudioEncoder.AMR_NB,                                     buffersize);                     atrack = new AudioTrack(AudioManager.STREAM_VOICE_CALL,                                     11025,                                     AudioFormat.CHANNEL_CONFIGURATION_MONO,                                     MediaRecorder.AudioEncoder.AMR_NB,                                     buffersize,                                     AudioTrack.MODE_STREAM);                     Log.d(""AUDIO"", ""sample rate = : "" + arec.getSampleRate());                     atrack.setPlaybackRate(11025);                     byte[] buffer = new byte[buffersize];                     arec.startRecording();                     atrack.play();                     while(isRecording) {                             arec.read(buffer, 0, buffersize);                             atrack.write(buffer, 0, buffer.length);                     }      }}</code></pre>","243999","","243999","","2010-02-10 17:32:32","2010-02-10 17:59:36","Android - Can I do this with MediaRecord/MediaPlayer instead of AudioRecord/Track?","<android><audio><media-player><audio-streaming><audio-recording>","1","0","3","",""
"2238760","1","","","2010-02-10 17:06:42","2","4404","<p>Does anyone know how to integrate with the new Gallery3D app (cooliris android gallery)? I want to launch that app so it shows the thumbnails for only a specific folder.</p><p>For example, say my app downloads images from my server and stores them in a folder on the sd-card (/sdcard/myapp/image-cache/someid/*). I'd like to be able to do something like the following:</p><pre><code>// within an activityUri uri = Uri.withAppendedPath(Media.EXTERNAL_CONTENT_URI, ""myapp/image-cache/someid"");Intent intent = new Intent(Intent.ACTION_VIEW, uri);startActivity(intent);</code></pre><p>Thanks.</p>","57663","","","","","2012-11-07 04:20:02","Android cooliris gallery developer documentation","<android><image><gallery><cooliris>","4","2","2","",""
"2238883","1","","","2010-02-10 17:22:34","43","26447","<p>I found that it is possible to set dimensions of my interface elements in XML layouts using DIPs as in following fragment: </p><pre><code>android:layout_width=""10dip""</code></pre><p>But all Java interface takes integer as arguments and there is no way to specify dimensions in DIPs. What is the correct way to calculate this?</p><p>I figured that I have to use property density of <code>DisplayMetrics</code> class but is this a correct way? </p><p>May I rely on this formula being always correct?</p><blockquote>  <p>pixels * DisplayMetrics.density = dip </p></blockquote><p>Is there a utility function for the conversion somewhere in Android?</p>","131115","","418183","","2011-10-10 10:05:09","2014-03-06 10:15:51","What is the correct way to specify dimensions in DIP from Java code?","<android><layout><dip>","4","0","36","","2010-02-10 17:22:34"
"2238938","1","2294635","","2010-02-10 17:29:09","15","22071","<p>I'm trying to programmatically scroll a WebView to the location of a particular element in the DOM tree.  But so far I haven't been able to get the WebView to respond to scroll requests.  I've tried calling JavaScript that uses window.scrollTo(...), but the WebView doesn't respond.  On the Java side, I've tried calling the WebView.flingScroll(...) method.  WebView will respond to flingScroll, but what I need is a scrollTo(...) capability.  Any ideas?</p>","270486","","","","","2010-09-18 08:04:25","How to Programmatically Scroll Android WebView","<android><scrolling><scroll><webview>","2","0","7","",""
"2239077","1","","","2010-02-10 17:44:29","2","3179","<p>I have a vertical LinearLayout. I would like to layout 1 ImageView on top and 1 ImageView at the bottom of that LinearLayout. I tried putting 'android:gravity=""top""' and 'android:gravity=""bottom""' in each of the ImageView, but both ImageView appears at the top of the LinearLayout.  Is there a way to fix it?</p><p>Thank you.</p><pre><code>   &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""&gt;   &lt;ImageView        android:id=""@+id/button1""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@drawable/icon""        android:gravity=""top"" /&gt;   &lt;ImageView        android:id=""@+id/button2""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@drawable/icon""        android:gravity=""bottom"" /&gt;   &lt;/LinearLayout&gt;</code></pre>","114970","","","","","2010-02-10 20:52:26","Layout Question. How can I layout 1 image view on top, 1 image on bottom","<android>","2","0","","",""
"2239115","1","","","2010-02-10 17:50:30","14","1044","<p>I read the <a href=""http://d.android.com/guide/practices/ui_guidelines/icon_design.html"" rel=""nofollow"">UI guidelines for Launcher icons</a> but System Icons in recent Android releases doesn't seem to follow these guidelines (icons are flat instead simplified 3D perspective, as described in document). </p><p>Are they already obsolete and what are the current guidelines?</p>","131115","","377270","","2012-03-18 01:46:18","2012-03-18 06:07:52","Are Icon design UI guidelines still valid?","<android><icons><guidelines>","5","0","","",""
"2239330","1","3945915","","2010-02-10 18:26:26","73","56059","<p>I get this sometimes(not often) for one of my projects, couple of classes only<br> <code>Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE</code></p><p>How do I increase emulator's storage?</p>","243782","","243782","","2010-06-03 08:20:02","2012-12-20 05:51:31","How to increase storage for Android Emulator? (INSTALL_FAILED_INSUFFICIENT_STORAGE)","<android><android-emulator><emulator><avd>","15","2","36","",""
"2239356","1","2239977","","2010-02-10 18:31:03","9","3203","<p>I have a full-screen TextView holding a long Spanned that requires scrolling.  The TextView's getLineCount() gives me the total number of lines used for the entire block of text but I'd like to know how many lines of text are currently visible on the screen.  </p><p>Or, better yet, is there a way to figure out the range of lines currently visible on the screen?  For example, as the view scrolls, can I tell that lines 20-60 are currently visible?</p>","262119","","","","","2014-02-27 18:27:07","Is there a way of retrieving a TextView's visible line count or range?","<android>","2","0","3","",""
"2239442","1","2419207","","2010-02-10 18:45:15","6","6096","<p>I am trying to create a menu that slides up from the bottom.  It starts with the menu's view just visible at the bottom of the screen, and then clicking it causes it to slide up.  I tried using a <code>TranslateAnimation</code>, but although the pixels move, the hit areas of the menu are in the same position as before.  So I think that if I can adjust the menu's margins after the animation is complete, this will accomplish what I want.  However, I can't figure out how to adjust the margins.</p><p>I've tried to create a <code>LinearLayout.LayoutMargins</code> object and then set its margins and apply it to the menu's view (which is a <code>LinearLayout</code>), but this doesn't work.</p><p>Any ideas?</p>","265669","","234270","","2011-10-01 02:18:20","2012-06-12 17:41:34","Android - Animate a View's topMargin/bottomMargin/etc in LinearLayout or RelativeLayout","<android><android-layout><android-animation>","4","2","5","",""
"2239828","1","2240622","","2010-02-10 19:46:39","6","9690","<p>I'm playing around with android, and I'm creating a simple twitter app to test what I've learned so far.  But I've run into a problem that I don't understand.  I created a thread to fetch the tweets, no problems there, but then added a ProgressDialog to show when that thread was running.  Doing so caused a very unusual behavior.  If the user rotates from Vertical orientation, to horizontal orientation, program behaves as expected, no problems, but if he then rotates back, the program crashes saying a window leaked.  </p><p>The problem only happens on a horizontal to vertical layout switch.  I know of the issues of if you try to rotate while the dialog box is running, but I've made sure that the dialog box has finished running and dismissed before rotating and it will still crash.  Heres my code:</p><pre><code>package com.onesmartpuppy.puppytweet;import java.util.ArrayList;import com.github.droidfu.widgets.WebImageView;import winterwell.jtwitter.Twitter;import winterwell.jtwitter.Twitter.Status;import android.app.ListActivity;import android.app.ProgressDialog;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.view.View.OnClickListener;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.TextView;public class PuppyTweet extends ListActivity implements OnClickListener {    private ProgressDialog m_ProgressDialog = null;    private ArrayList&lt;Status&gt; messages = null;    private TweetAdapter m_adapter;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        messages = new ArrayList&lt;Status&gt;();        this.m_adapter = new TweetAdapter(this, R.layout.row, messages);        setListAdapter(this.m_adapter);        setupButtons();        m_ProgressDialog = ProgressDialog.show(this,                 ""Please wait..."", ""Retrieving tweets ..."", true);        Runnable findTweets = new Runnable(){            @Override            public void run() {             try {                messages = new ArrayList&lt;Status&gt;();                Twitter ourTwitter = new Twitter(""*****"", ""******"");                messages = (ArrayList&lt;Status&gt;) ourTwitter.getFriendsTimeline();                Thread.sleep(1000);                Log.i(""ARRAY"", """"+ messages.size());             } catch (Exception e) {                Log.e(""BACKGROUND_PROC"", e.getMessage());             }              handler.sendEmptyMessage(0);                }         };        Thread thread =  new Thread(null, findTweets, ""FindTweets"");        thread.start();    }    private void setupButtons()    {     Button refreshButton = (Button) findViewById(R.id.refresh_button);     refreshButton.setOnClickListener(this);     Button settingsButton = (Button) findViewById(R.id.settings_button);     settingsButton.setOnClickListener(this);     Button tweetButton = (Button) findViewById(R.id.update_button);     tweetButton.setOnClickListener(this);    } @Override public void onClick(View v) {  switch (v.getId())  {  case R.id.settings_button:   break;  case R.id.update_button:   break;  case R.id.refresh_button:   break;  default:   break;  } } private Handler handler = new Handler() {         @Override         public void handleMessage(Message msg) {             if(messages != null &amp;&amp; messages.size() &gt; 0){              m_adapter.clear();                 m_adapter.notifyDataSetChanged();                 for(int i=0;i&lt;messages.size();i++)                  m_adapter.add(messages.get(i));             }             m_ProgressDialog.dismiss();             m_adapter.notifyDataSetChanged();         }  };  private class TweetAdapter extends ArrayAdapter&lt;Status&gt; {      private ArrayList&lt;Status&gt; items;      public TweetAdapter(Context context, int textViewResourceId, ArrayList&lt;Status&gt; items) {              super(context, textViewResourceId, items);              this.items = items;      }      @Override      public View getView(int position, View convertView, ViewGroup parent) {              View v = convertView;              if (v == null) {                  LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);                  v = vi.inflate(R.layout.row2, null);              }              Status o = (Status) items.get(position);              if (o != null) {                WebImageView img = (WebImageView) v.findViewById(R.id.webimage);                                         TextView tt = (TextView) v.findViewById(R.id.toptext);                      TextView bt = (TextView) v.findViewById(R.id.bottomtext);                      if (tt != null) {                            tt.setText(""Name: "" + o.user.name);                            }                      if(bt != null){                            bt.setText(""Status: "" + o.getText());                      }                      if (img !=null) {                       img.setImageUrl(o.getUser().profileImageUrl.toString());                          img.loadImage();                      }              }              return v;      }  }}</code></pre><p>heres the LogCat from where it crashes:</p><pre><code>02-10 16:01:05.237: INFO/ActivityManager(63): Config changed: { scale=1.0 imsi=310/260 loc=ld_US touch=3 keys=2/1/2 nav=3/1 orien=2 layout=18}02-10 16:01:05.344: WARN/UsageStats(63): Something wrong here, didn't expect com.onesmartpuppy.puppytweet to be resumed02-10 16:01:05.384: INFO/WindowManager(63): Setting rotation to 0, animFlags=002-10 16:01:05.394: INFO/ActivityManager(63): Config changed: { scale=1.0 imsi=310/260 loc=ld_US touch=3 keys=2/1/2 nav=3/1 orien=1 layout=18}02-10 16:01:05.504: WARN/UsageStats(63): Something wrong here, didn't expect com.onesmartpuppy.puppytweet to be resumed02-10 16:01:05.704: ERROR/WindowManager(227): Activity com.onesmartpuppy.puppytweet.PuppyTweet has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43af9490 that was originally added here02-10 16:01:05.704: ERROR/WindowManager(227): android.view.WindowLeaked: Activity com.onesmartpuppy.puppytweet.PuppyTweet has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43af9490 that was originally added here02-10 16:01:05.704: ERROR/WindowManager(227):     at android.view.ViewRoot.&lt;init&gt;(ViewRoot.java:227)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.view.Window$LocalWindowManager.addView(Window.java:424)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.app.Dialog.show(Dialog.java:239)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.app.ProgressDialog.show(ProgressDialog.java:107)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.app.ProgressDialog.show(ProgressDialog.java:90)02-10 16:01:05.704: ERROR/WindowManager(227):     at com.onesmartpuppy.puppytweet.PuppyTweet.onCreate(PuppyTweet.java:39)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3573)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.app.ActivityThread.access$2300(ActivityThread.java:119)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1825)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.os.Handler.dispatchMessage(Handler.java:99)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.os.Looper.loop(Looper.java:123)02-10 16:01:05.704: ERROR/WindowManager(227):     at android.app.ActivityThread.main(ActivityThread.java:4310)02-10 16:01:05.704: ERROR/WindowManager(227):     at java.lang.reflect.Method.invokeNative(Native Method)02-10 16:01:05.704: ERROR/WindowManager(227):     at java.lang.reflect.Method.invoke(Method.java:521)02-10 16:01:05.704: ERROR/WindowManager(227):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-10 16:01:05.704: ERROR/WindowManager(227):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-10 16:01:05.704: ERROR/WindowManager(227):     at dalvik.system.NativeStart.main(Native Method)02-10 16:01:06.344: INFO/global(227): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.02-10 16:01:06.624: DEBUG/dalvikvm(227): GC freed 6082 objects / 479568 bytes in 77ms02-10 16:01:07.374: DEBUG/dalvikvm(227): GC freed 11982 objects / 709808 bytes in 83ms02-10 16:01:07.394: INFO/global(227): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.02-10 16:01:07.564: DEBUG/dalvikvm(227): GC freed 95 objects / 79880 bytes in 68ms02-10 16:01:07.704: DEBUG/dalvikvm(227): GC freed 8 objects / 38992 bytes in 65ms02-10 16:01:08.174: DEBUG/dalvikvm(63): GC freed 5407 objects / 257208 bytes in 174ms02-10 16:01:08.194: INFO/ARRAY(227): 2002-10 16:01:08.204: DEBUG/AndroidRuntime(227): Shutting down VM02-10 16:01:08.204: WARN/dalvikvm(227): threadid=3: thread exiting with uncaught exception (group=0x4001b188)02-10 16:01:08.204: ERROR/AndroidRuntime(227): Uncaught handler: thread main exiting due to uncaught exception02-10 16:01:08.214: ERROR/AndroidRuntime(227): java.lang.IllegalArgumentException: View not attached to window manager02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at android.view.Window$LocalWindowManager.removeView(Window.java:432)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at android.app.Dialog.dismissDialog(Dialog.java:280)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at android.app.Dialog.access$000(Dialog.java:73)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at android.app.Dialog$1.run(Dialog.java:109)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at android.app.Dialog.dismiss(Dialog.java:264)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at com.onesmartpuppy.puppytweet.PuppyTweet$1.handleMessage(PuppyTweet.java:104)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at android.os.Handler.dispatchMessage(Handler.java:99)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at android.os.Looper.loop(Looper.java:123)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at android.app.ActivityThread.main(ActivityThread.java:4310)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at java.lang.reflect.Method.invokeNative(Native Method)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at java.lang.reflect.Method.invoke(Method.java:521)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-10 16:01:08.214: ERROR/AndroidRuntime(227):     at dalvik.system.NativeStart.main(Native Method)02-10 16:01:08.244: INFO/Process(63): Sending signal. PID: 227 SIG: 302-10 16:01:08.244: INFO/dalvikvm(227): threadid=7: reacting to signal 302-10 16:01:08.274: ERROR/dalvikvm(227): Unable to open stack trace file '/data/anr/traces.txt': Permission denied02-10 16:01:08.754: DEBUG/dalvikvm(227): GC freed 5986 objects / 372656 bytes in 316ms02-10 16:01:09.829: INFO/ARRAY(227): 2002-10 16:01:09.955: INFO/Process(227): Sending signal. PID: 227 SIG: 902-10 16:01:09.974: INFO/ActivityManager(63): Process com.onesmartpuppy.puppytweet (pid 227) has died.02-10 16:01:10.014: INFO/WindowManager(63): WIN DEATH: Window{43b653e0 com.onesmartpuppy.puppytweet/com.onesmartpuppy.puppytweet.PuppyTweet paused=false}02-10 16:01:10.014: INFO/WindowManager(63): WIN DEATH: Window{43c32b48 Please wait... paused=false}02-10 16:01:10.164: WARN/UsageStats(63): Unexpected resume of com.android.launcher while already resumed in com.onesmartpuppy.puppytweet02-10 16:01:10.314: WARN/InputManagerService(63): Got RemoteException sending setActive(false) notification to pid 227 uid 10023</code></pre>","270568","","270568","","2010-02-10 21:03:50","2010-02-10 21:52:29","Android: Crash on rotation, horizontal to vertical","<java><android><progressdialog>","1","4","1","",""
"2240326","1","2240352","","2010-02-10 21:04:19","42","20252","<p>I have an activity which extends PreferenceActivity.I'm loading preferences from the xml file.But in some cases i need completely hide one of the preferences from the screen based on my app state. There is a setEnabled method, but it's not exactly what i want. I want to remove that preference from the screen completely.Is it possible ?</p>","176761","","596725","","2012-12-19 07:22:15","2013-09-17 16:43:37","Remove/hide a preference from the screen","<android><preferences>","3","1","5","",""
"2240341","1","2240381","","2010-02-10 21:06:13","33","41217","<p>Hi I am developing an application for the android htc hero. I am looking into ways of using the inbuilt camer to read 2D barcodes and extract the string returned from the barcode. I have only recently begun working with the android sdk but I do have a programming background from working on projects with java. I am curious to know what the best way to read the 2D barcode would be. I have some sample applications that read the barcode but they are all .apk files and have no source or library that i can work with. to give you a better idea of what i am trying to accomplish this site allows the generation of 2d barcodes made up of the data you desire  <a href=""http://zxing.appspot.com/generator/"">here</a></p><p>Any replies would be greatly appreciated.</p>","233354","","","","","2013-09-27 08:58:39","Reading barcodes with android","<android><tracking><barcode><barcode-scanner><qr-code>","4","0","28","",""
"2240411","1","2240462","","2010-02-10 21:15:33","5","10179","<pre><code>    lv.setOnClickListener(new OnClickListener(){        public void onClick(View v){        }    });</code></pre><p>Does <code>v</code> refer to the ListView <code>lv</code> or the specific item selected in the list?</p><p>Thanks in advance.</p>","209838","","","","","2012-01-25 19:40:36","Android: When I set an OnClickListener for a ListView","<java><android><user-interface>","4","0","1","",""
"2240894","1","2590927","","2010-02-10 22:44:04","0","290","<p>Assuming that <a href=""http://d.android.com/guide/practices/ui_guidelines/icon_design.html"" rel=""nofollow"">old Icon design guidelines</a> are <a href=""http://stackoverflow.com/questions/2239115/are-icon-design-ui-guidelines-still-valid"">not valid anymore</a>, where can we find information about the guidelines to follow to design ""new-styled"" 2.X launcher icons?</p><p>Should applications provide icons for both icon styles if they work for both versions?</p>","28855","","","","","2014-03-08 15:43:22","Where can I find information about Android 2.x icon design guidelines?","<android><design><icons><guidelines>","1","5","","",""
"2240977","1","","","2010-02-10 23:00:18","1","2424","<p>I have a problem preserving the current scroll position of content loaded in Android's WebView control during orientation changes. The issue currently exist only in Android 2.1 and Android 2.1 Update 1</p><p>The code that I use is based on the default Browser application and looks like this:</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState){  super.onCreate(savedInstanceState);  mWebView = new WebView(this);  setContentView(mWebView);  mWebView.setWebViewClient(mWebViewClient);  if (savedInstanceState != null)  {    final WebBackForwardList list = mWebView.restoreState(savedInstanceState);    if (list == null)      return;    if (savedInstanceState.containsKey(""currentPicture""))    {       final File f = new File(savedInstanceState.getString(""currentPicture""));       mWebView.restorePicture(savedInstanceState, f);       f.delete();    }  }else    mWebView.loadUrl(""http://slashdot.org/""); } @Override protected void onSaveInstanceState(Bundle outState) {   final WebBackForwardList list = mWebView.saveState(outState);   File mThumbnailDir = getDir(""thumbnails"", 0);   if (list != null)   {     final File f = new File(mThumbnailDir, mWebView.hashCode() + ""_pic.save"");     if (mWebView.savePicture(outState, f))        outState.putString(""currentPicture"", f.getPath());   } }</code></pre><p>This code works in Android 1.5, 1.6 and 2.0.1.  In Android 2.1 the same code restores the position for a split second but then the page reloads and scrolls to position 0,0.</p><p>In Android 2.1 Update 1, it not only scrolls back to 0,0, but also changes the Zoom to fit the page width (similar to the browser Overview mode introduced in 2.1) </p><p>Does anyone know of a workaround or has any idea what may cause such behavior?</p>","270678","","","","","2012-12-11 15:40:35","Problem saving WebView scroll position during orientation change in Android 2.1","<android><webview><scroll-position>","2","3","1","",""
"2241049","1","5669098","","2010-02-10 23:12:53","2","1481","<p>For instance, we are in SomeActivity and the activity has a button that invokes moving files from one dir to another (let's call it job).</p><p>On BlackBerry I would:</p><ol><li>push a non-cancellable popup (Dialog screen) saying ""Please wait...""</li><li>start a thread that fulfills the job</li><li>on thread completion close the popup</li></ol><p>This approach 99.99% can guarantee that we stay on the same screen after the task is over, user just sees the popup and waits for job completion. Device rotation or whatever does not break the desired workflow.</p><p>On Android things change. I know there's the AsyncTask that is probably provided to solve my case. There's even a good <a href=""http://code.google.com/p/shelves/source/browse/trunk/Shelves/src/org/curiouscreature/android/shelves/activity/ShelvesActivity.java"" rel=""nofollow"">example</a> of how it should be used. But since there's no guarantee of how long an Activity instance will live the AsyncTask should be cancelled on onSaveInstanceState (and restarted on onRestoreInstanceState). This means using AsyncTask there's no guarantee we are able to fully fulfill the job once started. In some cases as sending an http post request for creating a user I would not want to get in ""user already exists for this login"" trouble on reruning the AsyncTask. This is possible since the AsyncTask can be interrupted while the request is already sent (and the server actually is doing its job - creating a new user), but the AsyncTask is canceled before we got the response.</p><p>Is there any solution on Android to get the BB-like behaviour stated above?</p>","247013","","","","","2011-04-14 20:13:07","How to arrange long (time consuming) actions on Android?","<android><long-integer><task><android-asynctask><running>","3","0","2","",""
"2241293","1","2241329","","2010-02-11 00:03:03","11","567","<p>As a thesis for my graduation I'm going to start an open source project: My idea is to port a complete set of mathematical libraries to Android, to perform numeric and symbolic operations, in the form of a programmable calculator like matlab or sage. </p><p>I want to release this project under GPL, because I believe that ideas need to be free to work, but I also know that i will spend a lot of money to buy multiple device to do debug and fine tuning. </p><p>I thought about selling the prepacked app on the market for 0.99, while giving the source to compile on the site for free. It would be like a small tax on laziness. </p><p>What do you think? How do you think I could fund this project? </p><p>Note: Feel free to correct my poor grammar and remove this note.</p>","269931","","166686","","2010-02-11 00:07:57","2011-01-25 21:16:04","How to fund an open source project?","<android><open-source>","3","1","3","2012-08-07 10:42:12",""
"2241380","1","","","2010-02-11 00:18:29","9","14397","<p>there. I am trying to implement a feature into my app to copy the current database unto the sdcard.  Are there any tutorials or code snippets to achieve this. I've already looked at this site, <a href=""http://mgmblog.com/2009/02/06/export-an-android-sqlite-db-to-an-xml-file-on-the-sd-card/"">http://mgmblog.com/2009/02/06/export-an-android-sqlite-db-to-an-xml-file-on-the-sd-card/</a> ... but I wont be able to import the data with this method.</p>","270722","","","","","2013-02-12 20:40:36","android import export database","<database><android><sqlite><import><export>","2","3","3","",""
"2241525","1","","","2010-02-11 00:57:02","8","1521","<p>I am developing Enterprise applications that need to connect toservers behind the firewall.  Can my app start VPN connectionprogrammatically?</p><p>On 2.0+ platforms, VPN is supported by the platform.  Assuming userhas already setup VPN parameters, can my app start the VPNconnection?  Suppose user has not setup any VPN parameters, can my appsupply those parameters? and start VPN connection?</p>","270740","","","","","2011-01-25 11:57:37","Programmatically start / launch VPN connection","<android>","1","0","1","",""
"2241589","1","","","2010-02-11 01:17:04","2","1613","<p>A button on our screen causes an activity to be shown that has a ""dialog"" theme.  We are having an issue were if you click the button quickly twice in a row, the dialog activity is opened twice.</p><p>Typically I would expect that when a new activity is started, the underlying activity is immediately stopped, and thus accepts no further input.  </p><p>However, since the dialog themed activity does not take over the whole screen, I think the underlying activity is only paused, not stopped and thus the buttons are still accessible.</p><p>Which brings me to my question... Is there a way to force the dialog themed activity into a modal state where the user can't click the buttons on the activity below?</p><p>I could probably manually accomplish this by disabling everything in onPause, and reenabling it in onResume, but this seems like a lot of work!  Anyone have an easier solution?</p>","234039","","","","","2011-12-10 04:38:10","Android: Force dialog themed activity to be modal","<android><dialog>","2","0","","",""
"2241658","1","2241706","","2010-02-11 01:37:35","1","5691","<p>I have a ViewGroup and it has a few children. And one of them is a TextView (""+id/text"").In my code, I would like to know how can I add a new View or ViewGroup which will be positioned vertically aligned and below the TextView (+""id/text"")?</p><h2>Thank you.</h2><p>I have followed the advice below and try to use TableLayout. As a test, I try to layout statically to make sure things are aligned correctly.</p><p>Here is my layout xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout android:id=""@+id/panel"" xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:minHeight=""?android:attr/listPreferredItemHeight""&gt;    &lt;TableRow    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;ImageButton        android:id=""@+id/icon""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:src=""@drawable/icon""        android:layout_column=""0"" /&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""0dip""        android:layout_weight=""1""        android:layout_height=""fill_parent""        android:layout_column=""1""&gt;        &lt;TextView            android:id=""@+id/text""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""                                android:gravity=""left"" /&gt;    &lt;/LinearLayout&gt;   &lt;/TableRow&gt;   &lt;TableRow&gt;    &lt;ImageButton        android:id=""@+id/button1""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:clickable=""true""        android:src=""@drawable/icon""        android:layout_column=""1""/&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>But when i run in on emulator. The ImageButton on the 2nd row, does not align vertically with the textView in 1st row.  Any idea why?</p>","128983","","128983","","2010-02-11 21:44:49","2013-11-19 12:18:57","How can dynamically add a View to a ViewGroup and vertically align with one of its child","<android>","2","0","1","",""
"2242136","1","","","2010-02-11 03:48:06","33","30158","<p>I'm new to Android, and I really need to do it this way (I've considered doing it in another Activity), but can anyone show me a simple code (just the onCreate method) that can do Listview without ListActivity? </p><p>THanks</p>","179736","","","","","2012-07-06 06:07:46","How can I implement a ListView without ListActivity? (use only Activity)","<java><android><listview><activity>","4","1","12","",""
"2242244","1","2242994","","2010-02-11 04:20:32","0","903","<p>I followed the developer guides on the Android website. It is working fine for a Hello World application but when I try and transition between Activities, my application keeps giving an ""The application  () has stopped unexpectedly. Please try again later."" error and the application then quits. <strong>This happens when I click the button in the Subscribe Activity.</strong> </p><p><strong>Subscribe.java</strong></p><pre><code>public class Subscribe extends Activityimplements OnClickListener {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.subscribe);    Button subButton = (Button)findViewById(R.id.subscribe);    subButton.setOnClickListener(this);}public void onClick(View v) {    Intent subIntent = new Intent(Subscribe.this,Subscribed.class);    startActivity(subIntent);    }}</code></pre><p><strong>Subscribed.java</strong></p><pre><code>public class Subscribed extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.subscribed); }}</code></pre><p><a href=""http://www.cise.ufl.edu/~cheenu/logcat.rtf"" rel=""nofollow"">Logcat Log File</a></p>","245120","","245120","","2010-02-11 07:20:27","2010-02-11 07:54:31","Why does my application keep getting ""The application <ClassName> (<package.ClassName>) has stopped unexpectedly. Please try again later."" error?","<android>","2","0","","",""
"2242309","1","2383849","","2010-02-11 04:39:01","0","978","<p>Can you blend Java and native OpenGL calls. For instance having the setup happen in the onSurfaceCreated, but having the onDraw call into native code (or even both)? I'm having trouble getting native code to render, but can't tell if this could be a problem or if I'm throwing c++ exceptions, but they don't bubble up...</p><pre><code>    private static native void drawFromJni();public void onDrawFrame(GL10 gl) {    try{        drawFromJni();       //gl.glDrawArrays... also    }    catch (Exception ex){        ex.printStackTrace();        Log.e(""sv"", ex.getMessage());    }} public void onSurfaceChanged(GL10 gl, int width, int height) {    gl.glViewport(0, 0, width, height);    float ratio = (float) width / height;    gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glLoadIdentity();    gl.glFrustumf(-ratio, ratio, -1, 1, 1, 10);}public void onSurfaceCreated(GL10 gl, EGLConfig config) {    gl.glDisable(GL10.GL_DITHER);     gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);     gl.glClearColor(0,0,0,0);     gl.glEnable(GL10.GL_CULL_FACE);     gl.glShadeModel(GL10.GL_SMOOTH);     gl.glEnable(GL10.GL_DEPTH_TEST);}</code></pre>","255293","","","","","2010-03-05 00:55:38","Android OpenGL using both Java and C++","<android><opengl-es><android-ndk>","1","1","","",""
"2242850","1","2258281","","2010-02-11 07:18:46","0","491","<p>I'll come up with any excuse to get a chance to write my first Android application.  I've never done much with it except for a couple of tutorials.</p><p>I've got a Windows application that controls a device, and the computer isn't necessarily right next to it.  I think it would be great to be able to use my Droid to issue the device commands, but I'm not sure where exactly to start.  I don't have a problem writing the GUI code or Java required to send commands to the PC, but it's the wireless connection to the PC that I don't know how to approach.</p><p>Bluetooth seems like a good choice.  I have a USB-Bluetooth adapter, but no Bluetooth API on Windows.  Can anyone suggest one?  From reading other questions here on SO, it sounds like the 2.0 SDK has some sort of Bluetooth API, so that's good.</p><p>Another option is to use 802.11, and then write a web page / service that would allow the phone to issue commands to the device.</p><p>What have you all done to solve this sort of problem?</p>","214071","","","","","2010-11-16 23:04:52","Using Android app to interact with a Windows application","<.net><wpf><android><bluetooth>","2","0","","",""
"2243057","1","2247369","","2010-02-11 08:12:14","2","1888","<p>While building the android app using ant  am getting the following exception.Couldn't figure out why these exception are thrown!!! </p><pre><code>Execute:Java13CommandLauncher: Executing 'D:\Android-2.0\android-sdk-windows\platforms\android-1.5\tools\aapt.exe' with arguments:'package''-f''-M''E:\manish_test\timetrack\client\static\android\AndroidManifest.xml''-S''E:\manish_test\timetrack\client\static\android\res''-A''E:\manish_test\timetrack\client\static\android\assets''-I''D:\Android-2.0\android-sdk-windows\platforms\android-1.5\android.jar''-F''C:\CLIENT_BUILDS\QA\3.0.9\Android\11-Feb-2010_b1\XoraTimeTrack.ap_'</code></pre><p>The <code>'</code> characters around the executable and arguments arenot part of the command.</p><pre><code>     [null]     (skipping index file 'E:\manish_test\timetrack\client\static\android\res\drawable\Thumbs.db')Class org.apache.tools.ant.Project loaded from parent loader (parentFirst)Finding class com.android.sdklib.internal.project.ProjectProperties$PropertyTypeLoaded from D:\Android-2.0\android-sdk-windows\tools\lib\sdklib.jar com/android/sdklib/internal/project/ProjectProperties$PropertyType.classClass java.lang.Enum loaded from parent loader (parentFirst)Class com.android.sdklib.internal.project.ProjectProperties$PropertyType loaded from ant loader (parentFirst)Finding class com.android.sdklib.internal.project.ProjectPropertiesLoaded from D:\Android-2.0\android-sdk-windows\tools\lib\sdklib.jar com/android/sdklib/internal/project/ProjectProperties.classClass com.android.sdklib.internal.project.ProjectProperties loaded from ant loader (parentFirst)Class java.util.Map loaded from parent loader (parentFirst)Class java.io.OutputStream loaded from parent loader (parentFirst)Class java.io.FileOutputStream loaded from parent loader (parentFirst)Class java.lang.Throwable loaded from parent loader (parentFirst)Class java.lang.AssertionError loaded from parent loader (parentFirst)Class java.lang.Class loaded from parent loader (parentFirst)Class java.util.HashMap loaded from parent loader (parentFirst)Finding class com.android.sdklib.internal.project.ApkConfigurationHelperLoaded from D:\Android-2.0\android-sdk-windows\tools\lib\sdklib.jar com/android/sdklib/internal/project/ApkConfigurationHelper.classClass com.android.sdklib.internal.project.ApkConfigurationHelper loaded from ant loader (parentFirst)Finding class com.android.sdklib.internal.project.ApkSettingsLoaded from D:\Android-2.0\android-sdk-windows\tools\lib\sdklib.jar com/android/sdklib/internal/project/ApkSettings.classClass com.android.sdklib.internal.project.ApkSettings loaded from ant loader (parentFirst)  [antcall] Exiting E:\manish_test\timetrack\build\build-Android-1.0.xml.BUILD FAILEDE:\manish_test\timetrack\build\build-Android-1.0.xml:371: The following error occurred while executing this line:E:\manish_test\timetrack\build\build-Android-1.0.xml:302: java.lang.NullPointerException    at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)    at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)    at org.apache.tools.ant.Task.perform(Task.java:348)    at org.apache.tools.ant.Target.execute(Target.java:357)    at org.apache.tools.ant.Target.performTasks(Target.java:385)    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)    at org.apache.tools.ant.Project.executeTarget(Project.java:1306)    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)    at org.apache.tools.ant.Project.executeTargets(Project.java:1189)    at org.apache.tools.ant.Main.runBuild(Main.java:758)    at org.apache.tools.ant.Main.startAnt(Main.java:217)    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)Caused by: E:\manish_test\timetrack\build\build-Android-1.0.xml:302: java.lang.NullPointerException    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)    at org.apache.tools.ant.Task.perform(Task.java:348)    at org.apache.tools.ant.Target.execute(Target.java:357)    at org.apache.tools.ant.Target.performTasks(Target.java:385)    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)    at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)    at org.apache.tools.ant.Project.executeTargets(Project.java:1189)    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)    ... 17 moreCaused by: java.lang.NullPointerException    at com.android.sdklib.internal.project.ApkConfigurationHelper.getSettings(ApkConfigurationHelper.java:31)    at com.android.ant.AaptExecLoopTask.execute(AaptExecLoopTask.java:137)    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)    ... 24 more--- Nested Exception ---E:\manish_test\timetrack\build\build-Android-1.0.xml:302: java.lang.NullPointerException    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)    at org.apache.tools.ant.Task.perform(Task.java:348)    at org.apache.tools.ant.Target.execute(Target.java:357)    at org.apache.tools.ant.Target.performTasks(Target.java:385)    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)    at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)    at org.apache.tools.ant.Project.executeTargets(Project.java:1189)    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)    at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)    at org.apache.tools.ant.Task.perform(Task.java:348)    at org.apache.tools.ant.Target.execute(Target.java:357)    at org.apache.tools.ant.Target.performTasks(Target.java:385)    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)    at org.apache.tools.ant.Project.executeTarget(Project.java:1306)    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)    at org.apache.tools.ant.Project.executeTargets(Project.java:1189)    at org.apache.tools.ant.Main.runBuild(Main.java:758)    at org.apache.tools.ant.Main.startAnt(Main.java:217)    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)Caused by: java.lang.NullPointerException    at com.android.sdklib.internal.project.ApkConfigurationHelper.getSettings(ApkConfigurationHelper.java:31)    at com.android.ant.AaptExecLoopTask.execute(AaptExecLoopTask.java:137)    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)    ... 24 more--- Nested Exception ---java.lang.NullPointerException    at com.android.sdklib.internal.project.ApkConfigurationHelper.getSettings(ApkConfigurationHelper.java:31)    at com.android.ant.AaptExecLoopTask.execute(AaptExecLoopTask.java:137)    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)    at org.apache.tools.ant.Task.perform(Task.java:348)    at org.apache.tools.ant.Target.execute(Target.java:357)    at org.apache.tools.ant.Target.performTasks(Target.java:385)    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)    at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)    at org.apache.tools.ant.Project.executeTargets(Project.java:1189)    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)    at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)    at org.apache.tools.ant.Task.perform(Task.java:348)    at org.apache.tools.ant.Target.execute(Target.java:357)    at org.apache.tools.ant.Target.performTasks(Target.java:385)    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)    at org.apache.tools.ant.Project.executeTarget(Project.java:1306)    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)    at org.apache.tools.ant.Project.executeTargets(Project.java:1189)    at org.apache.tools.ant.Main.runBuild(Main.java:758)    at org.apache.tools.ant.Main.startAnt(Main.java:217)    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)</code></pre>","270913","","6309","","2010-02-11 08:25:00","2010-05-07 10:37:51","NullPointerException while building android app using ant","<android>","2","0","","",""
"2243335","1","","","2010-02-11 09:10:11","2","16093","<p>in my application  i want to display my own ads for that i want to dispaly my ads in image and it should be animated.So how to display animated images </p>","217065","","","","","2011-11-16 13:51:48","How to display animated images in android?","<android>","4","0","1","2012-07-11 00:30:25",""
"2243360","1","2243529","","2010-02-11 09:14:54","12","18903","<p>How to use TabHost.OnTabChangeListener in android?</p><p>give me some example code... :(</p><p>thanks</p>","267269","","","","","2012-03-21 14:52:27","How to use TabHost.OnTabChangeListener in android?","<android>","2","0","7","",""
"2243388","1","2246306","","2010-02-11 09:19:21","2","8682","<p>Friends,</p><p>can anyone guide me how to create editable spinner in Android?</p><p>any help would be appreciated.</p>","249991","","67097","","2012-05-30 05:24:46","2014-02-19 04:26:25","how to create editable spinner in android?","<android><eclipse><spinner>","4","0","","","2010-02-11 09:19:21"
"2243436","1","","","2010-02-11 09:26:58","1","1250","<p>Is there any definitive source that explains how Android sound mixing really works? I'm getting a really unexpected behavior using SoundPool on STREAM_NOTIFICATION when it mixes with music on STREAM_MUSIC.</p><p>When music is playing, even if its volume is way down, the sounds played by SoundPool are at 50% of the volume than when no music is playing. </p><p>This is roughly the code I'm using:</p><pre><code>SoundPool soundPool = new SoundPool(1, AudioManager.STREAM_NOTIFICATION, 0);</code></pre><p>A couple of those:</p><pre><code>sound_id = soundPool.load(context,                 context.getResources().getIdentifier(""sound1"",                       ""raw"",                       ""com.package.name""),                1);</code></pre><p>And later this:</p><pre><code>final AudioManager manager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);final int volume = manager.getStreamVolume(AudioManager.STREAM_MUSIC);manager.setStreamVolume(AudioManager.STREAM_MUSIC, volume/2, 0);soundPool.play(sound_id, 1f, 1f, 1, 0, 1);new Handler().postDelayed(new Runnable() {       public void run() {           manager.setStreamVolume(AudioManager.STREAM_MUSIC, volume, 0);       }   }, 1000);</code></pre><p>If no music is currently playing, the sounds are at full volume, nice and clear. If music is playing, the music gets attenuated correctly, but the sound still only plays at 50% volume.</p><p>What's the mixing algorithm? Does anyone know anything about this, or a workaround?</p>","","user270934","","","","2010-08-30 23:26:44","How does Android sound mixing really work?","<android><audio>","1","2","0","",""
"2243557","1","2243782","","2010-02-11 09:49:44","1","7504","<p>I'm developing an simple application on Android, where some items are shown on a list. The user may click on one, taking him to a further activity. Basics...</p><p>But my OnItemClickListener does not get called! I've found <a href=""http://stackoverflow.com/questions/1121192/android-custom-listview-unable-to-click-on-items"">this very similar question</a>, but the solution (disallow the list item view to get focus) does not work for me. However, a long click gets catched - my OnItemLongClickListener gets called. Please have a look at the following code and try it yourself. This is a simplified version of my code, showing the buggy behavior. Btw: I'm using Andriod SDK 2.0 with Eclipse 3.5.1.</p><pre><code>package de.sacherkhoudari.listtest;import java.util.LinkedList;import java.util.List;import android.app.ListActivity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;import android.widget.AdapterView.OnItemLongClickListener;public class ListTest extends ListActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        final List&lt;ListEntry&gt; lEntries = new LinkedList&lt;ListEntry&gt;();        for ( int ii = 0; ii &lt; 10; ii++ )            lEntries.add( new ListEntry( ""Entry "" + ii ) );        setListAdapter( new ArrayAdapter&lt;ListEntry&gt;( this, R.layout.list_item, lEntries ) );        ListView lv = getListView();        lv.setTextFilterEnabled(true);        lv.setOnItemClickListener( new OnItemClickListener() {            public void onItemClick( AdapterView&lt;?&gt; parent, View view, int position, long id ) {                Toast.makeText( ListTest.this, ""ItemClick at item "" + lEntries.get(position).toString(), Toast.LENGTH_LONG ).show();            }        });        lv.setOnItemLongClickListener( new OnItemLongClickListener() {            public boolean onItemLongClick( AdapterView&lt;?&gt; parent, View view, int position, long id ) {                Toast.makeText( ListTest.this, ""ItemLongClick at item "" + lEntries.get(position).toString(), Toast.LENGTH_LONG ).show();                return false;            }        });        setContentView(lv);    }}class ListEntry {    private String name;    public ListEntry( String s ) {        name = s;    }    public String toString() {        return name;    }}</code></pre><p>So far the Java code... here comes the layout list_item.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""10dp""    android:textSize=""16sp""    android:focusable=""false"" &gt;&lt;/TextView&gt;</code></pre><p>Note: <code>android:focusable=""false""</code> has no effect.</p><p>Thanks! <br>Sacher</p>","69968","","","","","2010-02-11 11:52:26","android's ListView does not listen on single clicks","<android><listview>","2","0","1","",""
"2243651","1","","","2010-02-11 10:05:57","16","8793","<p>In Eclipse I am developing an application using <a href=""http://code.google.com/android/add-ons/google-apis/index.html"">Google APIs (maps)</a> on a Nexus One.<br> When I launch the application for debugging on the device i get: </p><blockquote>  <p>""Automatic Target Mode: Unable to detect device compatibility. Please  select a target device.""</p></blockquote><p>and the ""Android Device Chooser"" pops up.<br>I can select the Nexus One and everything is ok. It annoys me, however, that i need to select the device every time i want to test something.</p><p>Setting a build target name to any standard android version (not using Google apis) automatically launches my app without showing the Android Device Chooser. But since i need the maps, that is not an option for me.</p><p>Is there a way to force an application using Google apis, to be launched on the attached device without showing the Android Device Chooser?</p>","270964","","130929","","2011-07-19 13:30:16","2012-08-13 09:22:58","Can I set an attached device as default launch target?","<android><eclipse>","5","4","4","",""
"2244177","1","2244199","","2010-02-11 11:51:06","2","893","<p>hi friends i'm using Sax parser for parsing my xml file which i recieve from the internet... The problem is that the normal xml is parsed fine except the xml files which have ""»"" symbol in the attributes...</p><p>everytime i try parsing the file i get the following error </p><pre><code>02-11 16:57:35.547: INFO/System.out(754): org.apache.harmony.xml.ExpatParser$ParseException: At line 9, column 0: not well-formed (invalid token)</code></pre><p>Is there any methid by which i can bypass this character ar handle it myself through java code??? Thanx in advance...</p>","238071","","","","","2010-02-11 11:55:28","android Sax parsing exception for ""»"" character","<android><parsing><special-characters><sax>","1","0","1","",""
"2244194","1","2244522","","2010-02-11 11:54:25","5","14360","<p>I'm trying to make an app with localisation built in, but I want a way that I can create a web link within the text, the URL being defined elsewhere (for ease of maintenance).</p><p>So, I have my links in res/values/strings.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;...    &lt;string name=""link1""&gt;http://some.link.com&lt;/string&gt;    &lt;string name=""link2""&gt;http://some.link2.com&lt;/string&gt;&lt;/resources&gt;</code></pre><p>and my localised text in res/values-en-rGB/strings.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;...    &lt;string name=""sampleText""&gt;Sample text\nMore text and link1\nMore text and link2.&lt;/string&gt;&lt;/resources&gt;</code></pre><p>I've not tested this bit, but from the <a href=""http://developer.android.com/guide/topics/resources/localization.html#strategies"" rel=""nofollow"">localization section of developer.android.com</a> it says that this approach to reducing content duplication should work, although I'm not sure what folder I should put Italian, for example.  Would it be in 'res/values-it-rIT/strings.xml'?  Lets assume that I have various other languages too.</p><p>I'm looking for a way of taking the base localised 'sampleText' and inserting my html links in, and getting them to work when clicked on.  I've tried two approaches so far:</p><p>1,</p><p>Putting some formatting in the 'sampleText' (%s):</p><pre><code>&lt;string name=""sampleText""&gt;Sample text\nMore text and &lt;a href=""%s""&gt;link1&lt;/a&gt;\nMore text and &lt;a href=""%s""&gt;link2&lt;/a&gt;.&lt;/string&gt;</code></pre><p>and then processing the text like this:</p><pre><code>TextView tv = (TextView) findViewById(R.id.textHolder);tv.setText(getResources().getString(R.string.sampleText, getResources().getString(R.string.link1), getResources().getString(R.string.link2)));</code></pre><p>But this didn't work when I click on the link, even though the link text is being put in to the correct places.</p><p>2, I tried to use Linkify but the regular expression route may be difficult as I'm looking at supporting non-Latin based languages.  I tried to put a custom xml tag around the link text and then do something like this:</p><pre><code>Pattern wordMatcher = Pattern.compile(""&lt;span1&gt;.*&lt;/span1&gt;"");String viewURL =    ""content://"" + getResources().getString(R.string.someLink);Linkify.addLinks(tv, wordMatcher , viewURL );</code></pre><p>But this didn't work either.</p><p>So, I'd like to know if there's a way of dynamically adding multiple URLs to different sections of the same text which will link to web content?</p>","264276","","212218","","2012-01-24 16:49:22","2012-12-11 06:28:37","Dynamically setting links to text in strings.xml","<android><text><dynamic><localization><hyperlink>","4","0","5","",""
"2244624","1","2280692","","2010-02-11 13:16:41","0","7465","<p>I am following an expandable list tutorial and the expandable functionality is working fine:<a href=""http://mylifewithandroid.blogspot.com/2008/05/expandable-lists.html"" rel=""nofollow"">http://mylifewithandroid.blogspot.com/2008/05/expandable-lists.html</a></p><p>I don't know which event to implement. I need to handle checkboxes in a list when I click on checkbox when it expands the list. How do I distinguish a list click with checkbox placed in an expandable list?</p><p>Or, kindly refer me to tutorial same as expandablelist view with checkboxes.</p>","249991","","330204","","2011-11-21 21:36:18","2011-11-21 21:36:18","how to create expandablelist view activity with checkboxes?","<android><expandablelistview>","1","0","","",""
"2244781","1","","","2010-02-11 13:46:23","0","2540","<p>Create a sample application with two launcher icons.  For example, two components such as:</p><pre><code>&lt;application ...&gt;   &lt;activity ... android:name=""TestActivity01""&gt;     &lt;intent-filter&gt;       &lt;action android:name=""android.intent.action.MAIN"" /&gt;       &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;     &lt;/intent-filter&gt;   &lt;/activity&gt;   &lt;activity ... android:name=""TestActivity02""&gt;     &lt;intent-filter&gt;       &lt;action android:name=""android.intent.action.MAIN"" /&gt;       &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;     &lt;/intent-filter&gt;   &lt;/activity&gt; &lt;/application&gt; </code></pre><p>Either install the application via downloading from the Marketplace, or via AppInstaller.  When the message box asks you if you would like to run the application, an exception is thrown:</p><blockquote>  <p>02-03 16:42:44.270: ERROR/AndroidRuntime(395):   android.content.ActivityNotFoundException: Unable to find explicit activity   class {com.xxx.xxx/com.android.internal.app.ResolverActivity}; have you   declared this activity in your AndroidManifest.xml?  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1  480)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.app.Instrumentation.execStartActivity(Instrumentation.java:1454)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.app.Activity.startActivityForResult(Activity.java:2660)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.app.Activity.startActivity(Activity.java:2704)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   com.android.packageinstaller.InstallAppDone.onClick(InstallAppDone.java:105  )  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.view.View.performClick(View.java:2344)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.view.View.onTouchEvent(View.java:4133)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.widget.TextView.onTouchEvent(TextView.java:6504)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.view.View.dispatchTouchEvent(View.java:3672)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEv  ent(PhoneWindow.java:1712)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneW  indow.java:1202)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.app.Activity.dispatchTouchEvent(Activity.java:1987)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(P  honeWindow.java:1696)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.view.ViewRoot.handleMessage(ViewRoot.java:1658)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.os.Handler.dispatchMessage(Handler.java:99)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.os.Looper.loop(Looper.java:123)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   android.app.ActivityThread.main(ActivityThread.java:4203)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   java.lang.reflect.Method.invokeNative(Native Method)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   java.lang.reflect.Method.invoke(Method.java:521)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:  791)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)  02-03 16:42:44.270: ERROR/AndroidRuntime(395):     at   dalvik.system.NativeStart.main(Native Method)</p></blockquote><p>The crash happens because <code>com.android.internal.app.ResolverActivity</code> is trying to find a (single) component which resolves the following intent:</p><pre><code>  &lt;action android:name=""android.intent.action.MAIN"" /&gt;   &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt; </code></pre><p>Please note that this has been tested BOTH with the AppInstaller, and the actual Marketplace on a real device.</p>","267728","","137380","","2010-02-11 13:53:00","2010-04-20 19:32:00","After downloading an application with two Launcher components from the Marketplace, clicking ""Open"" will cause a crash","<android><marketplace><app-launcher>","2","0","2","",""
"2244886","1","","","2010-02-11 14:06:31","4","2941","<p>Are <a href=""http://en.wikipedia.org/wiki/OMA_DRM"" rel=""nofollow"">OMA DRM</a> v1 and v2 supported on Android?</p><p>If no, is it planned?</p><p>is there any third party library that implements OMA DRAM v1 &amp; v2?</p>","271115","","76835","","2010-02-12 03:41:40","2010-10-28 01:08:11","OMA DRM v1 & v2 support on Android","<android>","2","0","1","",""
"2244965","1","2245054","","2010-02-11 14:15:34","6","1954","<p>I would like to know if it is possible to have several DbOpenHelper in the same app Android but to use them to write and read in the same database?because I'm trying to create tables from 2 different OpenHelper (with different names) and only the first one seems to create. when I try to run the 2nd one, i get an error...</p>","263521","","","","","2012-07-04 14:55:04","Having several SQLiteOpenhelper in one appli Android","<android><sqlite>","2","0","4","",""
"2245067","1","2245104","","2010-02-11 14:30:21","2","221","<pre><code>public static final int NOTIFY_FAILED = 1;private final Notification displayErrorNotification = new Notification(R.drawable.notification, ""Communication Error"", System.currentTimeMillis());private void displayNotificationError(String message) {    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(), 0);    displayErrorNotification.number++;    displayErrorNotification.setLatestEventInfo(getApplicationContext(), ""Failed x (""+displayErrorNotification.number+"")"", message, contentIntent);    notificationManager.notify(NOTIFY_FAILED, displayErrorNotification);}</code></pre><p>In this example I have used 1 for failed notifications but what if other programs also use the number 1 for their notifications.</p><p>What would happen when I do this: </p><pre><code>notificationManager.cancel(NOTIFY_FAILED);</code></pre>","248521","","248521","","2010-02-11 14:43:08","2011-03-23 05:39:32","What ID numbers to use for Notifications","<android>","2","0","1","",""
"2245122","1","","","2010-02-11 14:38:17","1","147","<p>in android 2.1, there is a default meteo/news widget (I think it Genie Widget) If you open the widget , you have an application which have several tabs.When you slide on the content area under the tab, you switch the tab.</p><p>Do you know which View component it uses to have this mechanism of switching tabs by sliding the content?</p>","271115","","","","","2010-02-11 14:38:17","View component in Meteo/news widget","<android>","0","0","","",""
"2245432","1","2245611","","2010-02-11 15:23:00","0","468","<p>I would like to explain me better. In android once you receive an email on gmail you would get notified almost in realtime. How does it work?</p><p>Thinking about an answer i had 1 idea:</p><blockquote>  <p>Android is connected to a gmail server which does not send anything untill it has new mails</p></blockquote><p>This solution , which is the only one i can think about, is a little bit expensive, in term of battery consumption. </p><p>Do you have further ideas ? </p><p>If not do you know some opensource server that will accomplish my idea ?</p><p>Bests, Andrea</p>","314407","","","","","2010-02-11 15:47:37","How can i create a protocol similar to gmail in android?","<android><gmail>","2","0","","",""
"2245545","1","","","2010-02-11 15:38:42","37","33772","<p>How do you access the user's Google Account Id / username in code?  I am building an application that will call a web service to store data and I want to identify the identity of the person submitting the data.</p>","258055","","238886","","2011-12-29 03:42:44","2014-04-14 12:51:26","Accessing Google Account Id /username via Android","<android><google-account>","4","0","25","",""
"2245654","1","","","2010-02-11 15:53:09","3","537","<p>Is there any way to know if my application is running on the emulator or on the device ?</p>","164460","","","","","2013-08-27 11:41:10","android execution in emulator or device?","<android><android-emulator><device>","2","0","2","",""
"2246012","1","2246095","","2010-02-11 16:45:11","4","1298","<p>I am in need to write an application for Android devices that needs to access a large (~200MB) database.What would be the best way to do this? Can I just stick the database in the assets folder? I have read of various limitations that apply to the entire application size and to individual resources within, especially on some devices... What are exactly these limits?</p><p>Is there any way to do this apart from a post-installation download from an external server?</p>","271207","","114066","","2010-07-19 12:19:15","2010-07-19 12:19:15","Deploying large database with Android application","<android><application-size>","1","0","","",""
"2246584","1","","","2010-02-11 18:14:35","1","1636","<p>I would like to know the best way to copy a file in the filesystem? (android java function )</p><p>(sdcard/video/test.3gp -----> sdcard/video_bis/test2.3gp)</p><p>Is there an example somewhere? </p><p>Regards</p>","271280","","","","","2010-02-12 10:09:21","How to copy a file in filesystem?","<android>","4","0","","",""
"2246781","1","2247025","","2010-02-11 18:41:00","0","566","<p>Suppose, you have a larger database of customers, such as 5000 records. Using a simple select query it can take 2-5 seconds on a mobile application to populate a listview with all thousands of customers available.  </p><p>But the user only needs to select one, so what is the best way to select the customer?If you have a few records eg: 50 customers a scroll list for select is the best way doing this, but what are you doing to satisfy display for selecting from thousands?</p><p>How would you put this question to display inventory items to include them on an invoice?<br>This differs from the customer situation as you will repeatedly add inventory items to the invoice?</p><p><strong>EDIT 1</strong><br>I refer with client to a database of clients / database of customers</p>","243782","","243782","","2010-02-11 20:06:58","2010-02-12 12:38:16","Best way for a mobile app to display records from thousands available?","<iphone><android><user-interface><mobile>","5","6","","",""
"2247129","1","","","2010-02-11 19:29:50","0","232","<p>I have an Activity that contains several views.  One of which is a GLSurfaceView.  This GLSurfaceView displays pretty 3D effects based on what is selected in my Activity's other views (ListViews, EditTexts, etc).  The issue I am having is that I don't know when my GLSurfaceView has been fully initialized from the Activity.</p><p>I began by simply attempting to pass my graphics data to my GLSurfaceView in my Activity's onCreate() method shortly after the setContentView() method.  This worked fine on the emulator but on several devices this fails with null pointer exceptions from attempting to access objects that had not even been constructed yet.  I assumed it was because my view had not been inflated yet and perhaps inflating views just takes longer on my devices.</p><p>I scattered some logging just to see the order of things and I found that my GLSurfaceView's onSurfaceCreated method is called well after the GLSurfaceView's onFinishInflate method.</p><p>So now I am looking for a good way to determine in my Activity when my GLSurfaceView's onSurfaceCreated method has been called so that I can safely tell my GLSurfaceView what to draw.</p>","271332","","","","","2010-02-11 21:17:30","How do I know when a GLSurfaceView is fully initialized from the Activity?","<android>","1","0","","",""
"2247293","1","","","2010-02-11 19:54:59","6","839","<p>I'm making a Java shoot em up game for Android phones. I've got 20 odd enemies in the game that each have a few unique behaviors but certain behaviors are reused by most of them. I need to model bullets, explosions, asteroids etc. and other things that all act a bit like enemies too. My current design favors composition over inheritance and represents game objects a bit like this:</p><pre><code>// Generic game objectclass Entity{  // Current position  Vector2d position;  // Regular frame updates behaviour  Behaviour updateBehaviour;  // Collision behaviour  Behaviour collideBehaviour;  // What the entity looks like  Image image;  // How to display the entity  Renderer renderer;  // If the entity is dead and should be deleted  int dead;}abstract class Renderer { abstract void draw(Canvas c); }abstract class Behaviour { abstract void update(Entity e); }</code></pre><p>To just draw whatever is stored as the entity image, you can attach a simple renderer e.g.</p><pre><code>class SimpleRenderer extends Renderer{  void draw(Canvas c)  {    // just draw the image  }}</code></pre><p>To make the entity fly about randomly each frame, just attach a behavior like this:</p><pre><code>class RandomlyMoveBehaviour extends Behaviour{  void update(Entity e)  {    // Add random direction vector to e.position  }}</code></pre><p>Or add more complex behaviour like waiting until the player is close before homing in:</p><pre><code>class SleepAndHomeBehaviour extends Behaviour{  Entity target;  boolean homing;  void init(Entity t) { target = t; }  void update(Entity e)  {    if (/* distance between t and e &lt; 50 pixels */)    {      homing = true;      // move towards t...    }    else    {      homing = false;    }  }}</code></pre><p>I'm really happy with this design so far. It's nice and flexible in that you can e.g. modularize the latter class so you could supply the ""sleep"" behavior and the ""awake"" behavior so you could say something like new WaitUntilCloseBehaviour(player, 50/<em>pixels</em>/, new MoveRandomlyBehaviour(), new HomingBehaviour()). This makes it really easy to make new enemies.</p><p>The only part that's bothering me is how the behaviors and the renderers communicate. At the moment, Entity contains an Image object that a Behaviour could modify if it chose to do so. For example, one behavior could change the object between a sleep and awake image and the renderer would just draw the image. I'm not sure how this is going to scale though e.g.:</p><ul><li><p>What about a turret-like enemy that faces a certain direction? I guess I could add a rotation field to Entity that Behavior and Renderer can both modify/read.</p><ul><li><p>What about a tank where the body of the tank and the gun of the tank have separate directions? Now the renderer needs access to two rotations from somewhere and the two images to use. You don't really want to bloat the Entity class with this if there is only one tank.</p></li><li><p>What about an enemy that glows as his gun recharges? You'd really want to store the recharge time in the Behaviour object, but then the Renderer class cannot see it.</p></li></ul></li></ul><p>I'm having trouble thinking of ways to model the above so the renderers and the behaviors can be kept somewhat separate. The best approach I can think of is to have the behavior objects contain the extra state <em>and</em> the renderer object then the behavior objects call the renderers draw method and pass on the extra state (e.g. rotation) if they want to.</p><p>You could then e.g. have a tank-like Behaviour object that wants a tank-like Renderer where the latter asks for the two images and two rotations to draw with. If you wanted your tank to just be a plain image, you would just write a subclass Renderer that ignored the rotations.</p><p>Can anyone think of any alternatives? I really want simplicity. As it's a game, efficiency may be a concern as well if e.g. drawing a single 5x5 enemy image, when I have 50 enemies flying around at 60fps, involves many layers of function calls.</p>","260693","","","","","2010-02-18 20:08:34","How to model game object rendering and behavior in modular way?","<java><android><oop>","3","0","3","",""
"2247316","1","4340632","","2010-02-11 19:58:44","0","1206","<p>Good afternoon,</p><p>i write in order to ask a question about the use of the API KEY. I'm developing an application for Android, so i use the service provided for www.nutiteq.com for using the api maps.But the problem is the following:</p><p>when i use the code proposed by nutiteq:</p><pre><code>    mapComponent = new BasicMapComponent(""115f89503138416a242f40fb7d7f338e4b73e583e8e343.19717285"",             ""TouristEye"", ""TouristEye"", 1, 1,            new WgsPoint(mCenter.getLong(), mCenter.getLat()), 10);    mapComponent.setMap(new CloudMade("" 24c1c76c612248f7acd23978088bfb3a"", 64, 1));</code></pre><p>the API Key i ask for Cloud Made doesn't work correctly and i can't use the maps. I selected mobile use when i get the Api key and have passed more than hour since i asked for it.</p><p>Hope you can help me.</p>","258863","","","","","2010-12-02 22:26:23","CloudMade + Android","<android><cloudmade>","1","2","","",""
"2247968","1","2247988","","2010-02-11 21:48:00","6","3835","<p>I'm trying to get a sliding drawer to pull down from the top in my application, but I can't figure out a way to do it. Any help?</p>","118241","","629555","","2012-06-11 00:51:38","2013-07-12 00:01:55","Sliding Drawer From Top","<android>","3","0","2","",""
"2247998","1","","","2010-02-11 21:52:21","149","78894","<p>I'm having a problem trying to run an Android app which, up until adding a second external library to its build path, was working fine. Since having added the scoreninja jar, I now get a <strong>NoClassDefFoundError</strong> when I try to run the app.</p><p>Here's the message:</p><pre><code>02-11 21:45:26.154: ERROR/AndroidRuntime(3654): java.lang.NoClassDefFoundError: com.scoreninja.adapter.ScoreNinjaAdapter</code></pre><p>As all of the build scripts are generated by the Android tools (?), I'm not sure what else I can do other than cleaning and rebuilding or restarting eclipse (I have already tried all three). Does anyone know how I can amend this?</p>","209838","","50776","","2012-07-27 17:15:19","2014-02-01 00:17:16","NoClassDefFoundError - Eclipse and Android","<java><android><eclipse><ant><build>","24","4","36","",""
"2248147","1","4266906","","2010-02-11 22:12:18","3","9532","<p>has any one been able to connect to a soap server using ksoap2 android via https?</p><p>I keep getting the error that ""Hostname &lt;###>was not verified""</p><p>I'm doing</p><pre><code>AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport (URL);androidHttpTransport.call(SOAP_ACTION, envelope);</code></pre><p>apparently looking back at other ksoap which isn't for android your ment to us a different call to connect via https, but i can't find a way to do it in the android version.</p><p>Anyone found a way about or know the call im ment to use?</p><p>thanks for you help </p>","187133","","338479","","2013-05-21 04:13:36","2013-05-21 04:13:36","Android ksoap2 via https","<java><android><soap><ksoap2>","3","2","2","",""
"2248350","1","","","2010-02-11 22:42:47","1","1091","<p>I am developing an application that download the schedule calendar file of specific user to the phone memory and shows to the user in different user friendly formats.</p><ol><li>Get the user's ID entered in the UI</li><li>Generate the user's unique calendar URL</li><li>Retrieve the calendar file over HTTP</li><li>Save the file locally</li><li>Display the calendar data to the user    Read the file from disk that you saved directly from the web    Parse the data with iCal4j and display in whatever UI format you like</li></ol><p>I have downloaded file to the phone memory , the file is <code>.ics</code> file that contains some header,time zone,tags link html and original schedule information.Now I need to parse this ical file with ical4j.I have added the <code>ical4j JAR API</code> and also the dependent APIs to my project. But still finding it difficult to work on it. I used information from link below and tried to add the sample project code but it seems to have errors</p><p><code>http://wiki.modularity.net.au/ical4j/index.php?title=Android</code></p><p>So is there any way to parse the ical file with <code>ical4j</code>?and i can use it to re Can anyone provide me with some sample code so that I can learn how to use this <code>API</code>? Or do you have any idea like how can I do it?</p><p>Hope to get answer today, I need your help badly.</p><p>Thanks </p><p>Rob</p>","257580","","","","","2012-08-03 10:45:39","How to Parse ical file (.ics) with the ical4j API in Android?","<android>","1","0","","",""
"2248510","1","2248530","","2010-02-11 23:14:27","9","3863","<p>Say I have mapview control in my Android app. If I know a landmark exists at a certain latitude and longitude, how can I determine if that landmark is currently viewable on the user's screen? Is there a method for getting the coordinates for the top left and bottom right corners of the visible area?</p>","116982","","","","","2014-04-07 13:14:06","How can I determine if a geopoint is displayed in currently viewable area?","<android><android-mapview>","4","1","8","",""
"2248519","1","","","2010-02-11 23:16:55","1","8497","<p>I have to make a dedicated image viewer app for Android 2.x.</p><p>There are too many jpeg image files: about 2000~ jpegs, over 100MB.</p><p>I want access the image files with their file names,but I couldn't find such an example.</p><p>By the way, is it okay to put many image files in /res/drawable folder?</p><p>I heard that the android application cannot be installed on sdcard and</p><p>the program repository is very small so 100MB app cannot be installed generally.</p><p>I found some examples which download the large data files on sdcard online,</p><p>but I cannot run a web server to host the data files,</p><p>and I must upload the fully packaged program on Android Market. (Should I build one apk file?)</p><p><strong>What are the best practices for managing too many resource images (or something) in Android?</strong></p>","2556909","","","","","2012-04-13 09:08:38","Many image files in res/drawable, How to access in Android?","<android><image><resources><google-play>","5","0","1","",""
"2248706","1","2248740","","2010-02-12 00:01:10","1","1870","<p>Is it possible to tell Eclipse to use some extra arguments for aapt (-0 in specific)?</p><p>I have been looking for past couple of hours and the best hack I came up with was to create a wrapper for the aapt tool to inject the argument to the command line. The trouble with this approach is that whenever I should lose that wrapper, then I'll be quietly introducing a bug into my application.</p>","188083","","","","","2012-11-01 00:46:45","Passing custom arguments to aapt in Eclipse","<android>","2","0","1","",""
"2248759","1","","","2010-02-12 00:12:26","22","8292","<p>Can you please tell me if there is a way to layout textaround an image?Like this:</p><pre><code>------  text text text|    |  text text text-----   text text texttext text text texttext text text text</code></pre><p>I have gotten a response from an android developer about this question. But I am not sure what he means by doing my own version of TextView? Thank for any tips.</p><p>On Mon, Feb 8, 2010 at 11:05 PM, Romain Guy  wrote:</p><blockquote>  <p>Hi,</p>    <p>This is not possible using only the supplied widgets and layouts. You  could write your own version of TextView to do this, it shouldn't be  hard.</p></blockquote>","114970","","","","","2013-11-12 18:55:52","How to layout text to flow around an image","<android>","5","2","19","",""
"2249174","1","9825620","","2010-02-12 01:54:30","3","1273","<p>I have an appwidget application and would like to enable users to create skins which can be applied at runtime. My preferred solution is to use apk files with nine patch png images that stretch to fit the ImageView's of widget, however its starting to look like I might have to use another packaging technique (e.g. zip files).</p><p>What I've tried:Importing nine patch resources as Drawable with  context.getResourcesForApplication(my.app).getResources..., converting them to bitmaps using a canvas and setting the bitmap to the RemoteView using setImageViewBitap.This didn't work because I needed to specify the size of the resulting view (myBitmap.setBounds(..,..)) during conversion and some of the widths/heights in my appwidget aren't fixed. Perhaps there is a way to get the heights etc that I missed.</p><p>Importing resources directly to the RemoteView using setImageViewUri()This doesn't work because the function doesn't seem to read android.resource:// Uri's anymore (I poked around in the ImageView source and it only seems to read files paths and content:// Uri's)</p><p>Importing resources directly to the RemoteView using setImageViewResource() which didn't work because the id retrieved from the external package obviously doesn't include a package reference.</p><p>What I'm trying to avoid is hard coding all my appwidget width's and height's, or using a separate packaging scheme. </p><p>Has anyone implemented appwidget skins nicely and want to share the knowledge? Alternately there might be a hole in my logic somewhere that can be pointed out.</p><p>I can provide code if required though I don't have any here right now.</p>","272304","","","","","2012-03-22 15:37:24","Looking for an elegant appwidget skin solution","<android><appwidget>","2","1","2","",""
"2249227","1","","","2010-02-12 02:09:48","4","927","<p>I want to know if its possible/legal(not against terms of service) to use the google checkout api for an android app to support in app purchases. The types of items being purchased would be something like extra coins where they can be purchased multiple times.</p><p>I know that this would require getting the user's credentials or pointing them to the checkout page or something. I want to know if its possible to do this within the app by opening a webview to the checkout process, and then getting a callback to a custom url on my server that will allow the app to see that the purchase was successful. Something like what the android market does for app purchases.</p><p>Thanks for any responses. I don't currently have code to show as I am researching into this before devoting time to create something I won't be able to use. Also maybe android will support native in-app purchases in newer versions of the sdk.</p>","271531","","","","","2012-02-29 11:32:31","Android and Checkout API for in app purchases","<android>","2","1","4","",""
"2249547","1","2249655","","2010-02-12 03:46:04","4","1211","<p>During android app development, I do the following very often:</p><ol><li>Run ""ant reinstall"" to compile and upload an app to the emulator.</li><li>Switch to the emulator window.</li><li>Click on the package I just uploaded to run and test it.</li></ol><p>Is there any way I can tell the emulator phone to run the package I just uploaded? Perhaps an ""adb"" command I can send to it after I've run my compile script? As a last resort, I guess I could run something that simulates the mouse click for me.</p>","271566","","","","","2010-02-12 04:27:05","Automatically launch Android app after uploading it to phone?","<java><android>","1","1","4","",""
"2249633","1","2250212","","2010-02-12 04:14:26","2","148","<p>I am new to both Android and Stack Overflow. I have started developing and Android App and I am wondering two things:</p><p>1) Is it possible to parametrize a TextView? Lets say I want to render a text message which states something like: ""The user age is 38"". Lets suppose that the user age is the result of an algorithm. Using some typical i18n framework I would write in my i18n file something like ""The user age is {0}"". Then at run time I would populate parameters accordingly. I haven't been able to figure out how to do this or similar approach in Android.</p><p>2) Let's suppose I have a complex object with many fields. Eg: PersonModel which has id, name, age, country, favorite video game, whatever. If I want to render all this information into a single layout in one of my activities the only way I have found is getting all needed TextViews by id and then populate them one by one through code.I was wondering if there is some mapping / binding mechanism in which I can execute something like: render(myPerson, myView) and that automatically through reflection each of the model properties get mapped into each of the TextViews.If someone has ever worked with SpringMVC, Im looking for something similar to their mechanism to map domain objects / models to views (e.g. spring:forms).</p><p>Thanks a lot in advanced for your help. Hope this is useful for somebody else =)bye!</p>","271569","","","","","2010-02-12 07:22:47","Android TextViews. Is parametrization possible? Is binding to model possible?","<android><binding><parameters><models>","1","0","","",""
"2249652","1","","","2010-02-12 04:20:38","0","112","<p>What is ""best practice""? Should each view have its own Activity? Never 2 views in 1 Activity?</p>","179736","","","","","2010-02-12 07:13:29","Should only 1 view go in 1 Activity, in Android?","<android>","2","1","","2012-02-08 16:25:58",""
"2250112","1","2250280","","2010-02-12 06:46:28","164","71895","<p>Why doesn't <a href=""http://developer.android.com/guide/developing/tools/logcat.html"">logcat</a> show anything in my Android (while developing apps with Eclipse)?</p><p>It just doesn't print anything. It's empty.</p>","179736","","334451","","2014-02-26 06:19:19","2014-02-26 06:19:19","Why doesn't logcat show anything in my Android?","<android><eclipse><logcat>","15","1","27","",""
"2250455","1","","","2010-02-12 08:30:56","36","5751","<p>Once <code>ACTION_NEW_OUTGOING_CALL</code> has been broadcasted, I need to capture the following event of the other party answer. Could you advice on how to achieve that please? I know it is possible as the android dialer app changes the green android icon to the person's photo excatly when they pick up. Thanks!</p><p>UPDATED: I've had a look at the source of the app on Android handling the outgoing calls. I noticed the following method in <code>ContactsUtils</code>:</p><pre><code>/** * Kick off an intent to initiate a call. */ public static void initiateCall(Context context, CharSequence phoneNumber) {     Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,             Uri.fromParts(""tel"", phoneNumber.toString(), null));     context.startActivity(intent); }</code></pre><p>I guess my answer is in the activity listening for <code>Intent.ACTION_CALL_PRIVILEGED</code>. So to reprhase my question: Does anyone know which activity handles <code>Intent.ACTION_CALL_PRIVILEGED</code>? Thank you in advanced</p>","224956","","52444","","2012-08-23 09:05:06","2014-02-16 09:21:13","Detect if an outgoing call has been answered","<android><android-intent><telephony>","4","7","9","",""
"2250524","1","2251657","","2010-02-12 08:45:25","0","231","<p>I have a strange doubt:<br>Is it possible to intercept key presses of the hands free mic/headset(whatever it is called) of an Android mobile device?</p><p>Thanks.</p>","236128","","","","","2010-02-12 12:10:52","Can signals/events from handsfree accessory of Android phone be intercepted?","<android>","1","0","","",""
"2250533","1","","","2010-02-12 08:47:25","-2","422","<p>in my application, i need a static image to be rotated in HTML. Please help me for that</p>","271684","","","","","2010-02-12 08:50:39","How to rotate an static image in HTML","<android><static><html5><rotation>","1","2","","",""
"2250597","1","","","2010-02-12 08:58:48","2","27420","<p>I have a problem. I want to find latitude and longitude of my current location in an android application.  I just need it when I am stable with my phone.</p><p>My code is:</p><pre><code>LocationManager locationManager;    locationManager = (LocationManager)getSystemService    (Context.LOCATION_SERVICE);    Location location = locationManager.getLastKnownLocation    (LocationManager.GPS_PROVIDER);    locationManager.requestLocationUpdates(                             LocationManager.GPS_PROVIDER,0,0,(LocationListener) this);    updateWithNewLocation(location);    }    private void updateWithNewLocation(Location location) {    TextView myLocationText = (TextView)findViewById(R.id.myLocationText);    String latLongString;    if (location != null) {    double lat = location.getLatitude();    double lng = location.getLongitude();    latLongString = ""Lat:"" + lat + ""\nLong:"" + lng;    } else {    latLongString = ""No location found"";    }    myLocationText.setText(""Your Current Position is:\n"" +    latLongString);    }</code></pre><p>After running it on emulator i always find ""no location found"".  Why this is so?</p>","271694","","618728","","2012-06-25 05:43:45","2013-07-25 12:26:10","find current location latitude and longitude","<android>","4","2","7","",""
"2250644","1","2250655","","2010-02-12 09:08:20","1","3214","<pre><code>  public static void parseit(String thexml){         SAXParserFactory factory = SAXParserFactory.newInstance();         SAXParser saxParser;        try {            saxParser = factory.newSAXParser();            DefaultHandler handler = new DefaultHandler() {                public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {                }                public void endElement(String uri, String localName, String qName)throws SAXException {                }                public void characters(char ch[], int start, int length) throws SAXException {                }             };                  saxParser.parse(thexml, handler);            } catch (SAXException e) {                e.printStackTrace();            } catch (IOException e) {                e.printStackTrace();            }catch (ParserConfigurationException e) {                e.printStackTrace();                }        }</code></pre><p>This is my code for parsing an XML document. However, it always goes into IOException e, and I have no idea why. Can someone tell me how to view that error? </p><p>LogCat? How would I log that though?</p>","179736","","","","","2010-02-12 09:10:16","In Android, how do I view the error that was received in the try/catch block?","<java><android><debugging><exception><try-catch>","1","0","","",""
"2250677","1","","","2010-02-12 09:13:52","0","279","<p>I am trying to write a code for an SMS widget. I wrote something that I can compile, and print on screen my first SMS. When I click on next, nothing happened.This is my code:</p><pre><code>package android.MySMSwidget;import android.appwidget.AppWidgetManager;import android.appwidget.AppWidgetProvider;import android.net.Uri;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.RemoteViews;import android.content.ComponentName;import android.content.Context;import android.database.Cursor;import android.app.*;public class MySMSwidget extends AppWidgetProvider implements View.OnClickListener {private Button Bnext;private int sms_id=0;public class MyActivity extends Activity {     protected void onCreate(Bundle icicle) {         super.onCreate(icicle);         setContentView(R.layout.widget_layout);            final Button button = (Button) findViewById(R.id.next);             button.setOnClickListener(new View.OnClickListener() {                 public void onClick(View v) {                     if (v==Bnext){sms_id=sms_id+1;}                 }             });     }  } public void onUpdate(Context context, AppWidgetManager appWidgetManager,            int[] appWidgetIds) {    Cursor c = context.getContentResolver().query(Uri.parse(""content://sms/""), null, null ,null,null);    String body = null;    String number = null;    String date = null;    c.moveToPosition(sms_id);    body = c.getString(c.getColumnIndexOrThrow(""body"")).toString();    number = c.getString(c.getColumnIndexOrThrow(""address"")).toString();    date = c.getString(c.getColumnIndexOrThrow(""date"")).toString();    c.close();    RemoteViews updateViews = new RemoteViews(context.getPackageName(),            R.layout.widget_layout);    updateViews.setTextColor(R.id.text, 0xFF000000);    updateViews.setTextViewText(R.id.text,date+'\n'+number+'\n'+body);    ComponentName thisWidget = new ComponentName(context, MySMSwidget.class);    appWidgetManager.updateAppWidget(thisWidget, updateViews); }public void onClick(View v) {         if (v==Bnext){sms_id=sms_id+1;} } }</code></pre><p>If someone can explain to me where and why I'm wrong, I will be grateful.Thanks for reading me.</p>","271704","","1373545","","2014-03-31 13:28:09","2014-03-31 13:28:09","Creation of buton in an Android widget","<android><button><widget>","1","0","","",""
"2250770","1","2250849","","2010-02-12 09:31:07","143","131352","<p>I want to refresh an Android <code>ListView</code> after adding/deleting dynamic data.</p><p>Can any one tell me how to achieve this?</p>","249991","","779408","","2013-04-06 17:39:04","2014-02-28 11:06:00","How to refresh Android listview?","<android><listview><refresh>","13","2","44","",""
"2250917","1","2251691","","2010-02-12 09:56:39","10","5917","<p>Is it possible to pass a JavaScript object from JavaScript to Java using addJavascriptInterface()? Something along these lines:</p><pre><code>var javaScriptObject = {""field1"":""string1"", ""field2"":""string2""};JavaScriptInterface.passObject(javaScriptObject);</code></pre><p>How would such a call be captured on the Java side? I have no problem setting up the interface to send a string, but when I send an object, I receive null on the Java end.</p>","264257","","","","","2012-06-05 04:47:14","Passing a JavaScript object using addJavascriptInterface() on Android","<java><javascript><android>","3","0","","",""
"2251061","1","2252621","","2010-02-12 10:22:56","0","342","<p>I am having Samsung Galaxy phone and i am trying it to connect to my Vista ,I have installed the Samsung PC suite . When i start the USB debugging on it asks for new driver , i give the path for sdk but still it never worked .The firmware version of phone is 1.5 .I am having sdk 1.6.I have done some changes in inf file but still no luckWhat wrong i am doing ?</p><p>Thanks in advance.</p>","95877","","","","","2010-02-12 14:55:11","Debug on the Samsung Galaxy I7500 Android Phone","<java><android>","1","1","","",""
"2251099","1","","","2010-02-12 10:31:26","0","442","<p>How to Highlight the Layout in Android?</p>","271750","","1065190","","2012-07-02 13:04:51","2012-07-02 13:04:51","Android Layout Highlight?","<android>","2","1","","2012-07-03 13:31:27",""
"2251247","1","","","2010-02-12 10:57:59","7","8748","<p>Hi    I want to use SFTP in my android project.    Can anybody tell me if android [code]already have SFTP library?? Or i have to implement    it.    If anybody have already done SFTP client in android then please guide me.Thanks in Advance.</p>","271769","","","","","2010-06-23 07:49:44","SFTP in android","<android><sftp>","2","0","1","",""
"2251384","1","2251889","","2010-02-12 11:19:57","1","969","<p>i'm developing an Android application and i have a problem running a new thread in background.</p><p>I make a class with this code:</p><pre><code>public class Downloader implements Runnable {private Vector &lt;DownloadRequest&gt;messages = new Vector&lt;DownloadRequest&gt;(); static final int MAXQUEUE = 5; ApiRequest mApi;public void run() {     try {         while ( true ) {             getMessage();         }     }      catch( ErrorException e ) { } } private synchronized void getMessage() throws ErrorException{     try {        notify();         Log.d(""DOWNLOADER"", ""empiezo a coger los mensajes"");        while ( messages.size() == 0 )             wait();         DownloadRequest dr = messages.firstElement();         mApi.setMethod(dr.getRequest());        try {            mApi.executeRequest();        } catch (ErrorException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        Object o = dr.getObject();        o.notify();        return;    }catch(InterruptedException e) {        throw new ErrorException();    }</code></pre><p>The purpose is wait for receive a new message and call the api.</p><p>This object is running in a new thread in this Activity </p><pre><code> public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.view);    mDownloader = new Downloader(new ApiRequest());    Thread thread = new Thread(mDownloader);    thread.start();    DownloadRequest dr = new DownloadRequest(this,TRIPS_METHOD);    try {        mDownloader.putMessage(dr);</code></pre><p>But when thread.start() is called the UI remains blocked. I thinks this shouldn't happen becasue is a new thread.</p><p>Can anyone help me?</p><p>Thanks</p>","258863","","","","","2010-02-12 12:58:46","Android thread in backgorund","<android><multithreading><background>","1","0","","",""
"2251481","1","4477117","","2010-02-12 11:39:44","1","1817","<p>My application I'm using Geocoder class for retrieve the location latitude and longtude</p><p>My code is :</p><pre><code>addressInput = street+"",""+city+"",""+pin+"",""+country; List&lt;Address&gt; foundAdresses = gc.getFromLocationName(addressInput, 5);</code></pre><p>First time it is throwing exception like this</p><blockquote>  <p>java.io.IOException:Unable to parse response from server</p>    <p>ERROR/ProtoRequestListener(566): com.google.common.async.WatchdogException</p></blockquote><p>Plese resolve it and if you have any code retrieve the location latitude and longitude send me</p>","1746300","","368070","","2012-06-02 09:05:48","2012-06-02 09:06:13","Geocoder class is not working properly in android","<android>","1","0","2","",""
"2251645","1","","","2010-02-12 12:08:33","5","1148","<p>In a Listview I want create a square button that is as wide as the list item is heigh.I don't want to set fixed width and height as it should work for different resolutions. Is is possible? </p>","243599","","","","","2010-02-12 18:08:39","How to create a square button that adjusts to list item height?","<android>","2","0","","",""
"2251714","1","2285722","","2010-02-12 12:21:57","65","75968","<p>In my android application I want the standard/basic title bar to change color.</p><p>To change the text color you have <code>setTitleColor(int color)</code>, is there a way to change the background color of the bar?</p>","174868","","950912","","2012-07-27 19:35:27","2013-04-05 12:02:06","Set title background color","<android><title><titlebar>","7","1","62","",""
"2251795","1","","","2010-02-12 12:39:12","0","1027","<p>I am getting this exception at start of every screen ,irrespective of giving height.java.lang.RuntimeException: Binary XML file line #25: You must supply a layout_height attribute.</p>","95877","","","","","2013-08-28 15:45:09","RuntimeException during start of intent","<java><android>","2","1","1","",""
"2251806","1","2252214","","2010-02-12 12:40:42","1","2428","<p>When using ThreadPoolExecutor can I use AsyncTask as the Runnable in my queue?  Or does this defeat the purpose?</p><pre><code>//A holder for various tasksprivate final LinkedBlockingQueue&lt;Runnable&gt; queue = new LinkedBlockingQueue&lt;Runnable&gt;(5);//Thread Pool Executorprivate final ThreadPoolExecutor tpe = new ThreadPoolExecutor(3, 3, 10, TimeUnit.SECONDS, queue);</code></pre>","248521","","","","","2012-07-02 22:55:11","Using ThreadPoolExecutor and AsyncTask","<java><android>","2","0","","",""
"2251985","1","2253949","","2010-02-12 13:18:23","8","9305","<p>Is is possible to send an object to an Android Service through an Intent without actually binding to the service?  Or maybe another way for the Service to access Objects...</p>","248521","","248521","","2010-02-12 15:08:44","2013-08-01 11:51:39","Sending an object to a service through Intent without binding","<android>","4","0","3","",""
"2252402","1","","","2010-02-12 14:24:52","1","1492","<p>I have a 3 horizontal views - an image on the left which is a thin vertical handle-type bar and an image to its right followed by a textview. What I'm trying to achieve is a sliding animation, activated with a click on the handle, so that the center image slides in and out to the left (and so disappearing when fully left) with the textview following this animation smoothly. The effect will be the handle remains in place (hence I can't use the SlidingDrawer), the image comes and goes and the textview is always present but slides into the space where the image went. Its just collapsing the image really.</p><p>The problem is if I apply android.R.anim.slide_in_left/android.R.anim.slide_out_left to the image and the textview simultaneously I see they slide completely to the left edge of the screen, temporarily overwriting the handle. Is there a way to still animate but not go all the way to the screen edge?</p>","250340","","1023783","","2012-08-08 03:36:49","2012-08-08 03:36:49","Android slide animation problem","<android><animation>","0","0","","",""
"2252451","1","","","2010-02-12 14:31:27","0","135","<p>Ive developed some app for Android,the Weirdthing that on the emulator it's pretty stable, but when i tryied on real device of a friend(nexus), it crushes times to times, cant finger on a specific case when exaclly it happens.i realy want to distribute the app asap, but i cant find any leaks in my emulator.. what I should do? how can i debug my app and find the reasons for it to get crush on real device.. </p><p>Thanks,Idan</p>","260511","","","","","2010-02-13 15:31:42","App is not stable","<android><android-emulator>","2","0","","",""
"2252897","1","2254426","","2010-02-12 15:35:46","4","2479","<p>is there a way for an app to get notified when a new email has been received? My goal is, to rise an alert (play a sound, vibrate, whatever) if an email with a specific topic gets received (think of it like an ""filter"" or a ""rule""), but I dont want to check the email server by myself. I think I'm searching for something like  ""android.telephony.PhoneStateListener"" but for Email.</p>","1462","","","","","2013-01-07 21:27:28","Notification on new Email with Android","<android><email><notifications>","1","0","1","",""
"2253061","1","","","2010-02-12 15:57:06","29","34273","<p>I have a pretty basic helper class that I'm using to do all my Http Get/Post stuff.  I'm using HttpGet, HttpPost, and HttpClient from the org.apache.http library.  All of my stuff works fine over HTTP, but as soon as I tried to consume a service that works over HTTPS, I get a ClientProtocolException when executing the request.  The only message in the exception is ""The server failed to respond with a valid HTTP response"".</p><p>To test, I sent the exact same payload from a browser using a simple html form and Fiddler2 using the RequestBuilder.  I've sent invalid and empty payloads and even sent all of the above with and without headers to see if there was something funky about the way the objects were building the request.</p><p>Everything I've used in testing gives me a valid 200 status HTTP response.  The service just gives me a structure describing the error if I give it something other than what it expects.</p><p>Is there something special I need to add to the HttpPost or HttpClient object(s) to tell it to use HTTPS?  Do I have to explicitly tell it to use a different port?</p><p><strong>EDIT:</strong></p><p>I indeed registered the wrong socket factory for https communication.  Here is the updated method that I use to create my HttpClient object with the correct socket factory just in case someone searches this kind of problem in the future:</p><pre><code>private HttpClient createHttpClient(){    HttpParams params = new BasicHttpParams();    HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);    HttpProtocolParams.setContentCharset(params, HTTP.DEFAULT_CONTENT_CHARSET);    HttpProtocolParams.setUseExpectContinue(params, true);    SchemeRegistry schReg = new SchemeRegistry();    schReg.register(new Scheme(""http"", PlainSocketFactory.getSocketFactory(), 80));    schReg.register(new Scheme(""https"", SSLSocketFactory.getSocketFactory(), 443));    ClientConnectionManager conMgr = new ThreadSafeClientConnManager(params, schReg);    return new DefaultHttpClient(conMgr, params);}</code></pre>","53501","","53501","","2010-02-12 16:35:14","2012-04-09 16:42:27","Secure HTTP Post in Android","<java><android><post><https><security>","2","2","29","",""
"2253088","1","2253275","","2010-02-12 16:00:53","0","5419","<p>In my app ive got a non-activity object which it's role is being a manager class.many times i need to pass ""source activity"" to methods as parameter to that manager class in order to make some operations on that activity.</p><p>for example let's assume we have MyActivity which gotta do some toast.so i have this manager class called MyManager, and i have this method in it</p><pre><code>raiseToast(Activity sourceActivity) {  Toast.makeText(sourceActivity, demo, Toast.LENGTH_LONG).show();}</code></pre><p>and from Myactivity class we calling that method this way:</p><pre><code>MyManager manager=new MyManager();manager.raiseToast(MyActivity.this);</code></pre><p>it works fine.</p><p>what I'm asking here, is this a proper way to pass an Activity as parameter to a non-activity object?I'm having a memory leaks on real device(not the emulator), I wonder if this could also causing any reason for that?</p><p>Thanks Idan.</p>","260511","","96963","","2010-12-29 23:00:19","2010-12-29 23:00:19","Passing Activity to non-activity object properly","<android><android-emulator>","1","0","2","",""
"2253732","1","","","2010-02-12 17:26:16","2","3099","<p>I'd like to know whether it's possible to have phone numbers convertedinto international format when a call is outgoing.</p><p>For instance, if a french user (sorry it's the only format i know iwon't make a mistake :-) try to call with the national format :01.47.12.34.56 then a method will convert it into international formatlike this : +33.1.47.12.34.56</p><p>I've looked into the doc of the PhoneNumberUtils but i don't know ifthere is a method doing what i want. </p>","164460","","","","","2013-06-27 22:06:52","android Convert phone number in International Format","<android><telephone>","2","1","","",""
"2253811","1","","","2010-02-12 17:38:44","3","1117","<p>I have two versions of the same application.</p><p>When people upgrade from the free version to the paid version I'd like the free database to be copied to the pro database location.</p><p>Is there a way I can access the database file itself if it belongs to another application?<br>Does the file even belong to the application or is it generally accessible through the filesystem?  </p><p>Finally, how do I get the path to the database file without hardcoding it?</p>","131871","","","","","2010-02-12 20:53:55","Duplicate Android database from another application?","<database><android><sqlite>","2","1","0","",""
"2254045","1","2254184","","2010-02-12 18:12:27","0","328","<p>My application can be installed and run on android,<br>in two different places:  </p><pre><code>""/data/MyApplication""  </code></pre><p>and  </p><pre><code>""/system/MyApplication"".</code></pre><p>I need to know where at the moment is my application installed,<br>if it is in ""/data/"" or if it is in ""/system"".  </p><p>Can anyone help?  </p><p>Thank you very much</p>","243376","","","","","2014-02-13 22:39:58","Is my app in /system?","<android><system>","5","0","","",""
"2254246","1","2254356","","2010-02-12 18:41:37","1","805","<p>For some reason the allocation tracker is disabled in my ddms.. i can see the logcat.. also i can see the proccess, but for some weird reason the proccess are shown as '?' in their name.</p><p>what could be the reason?Thanks,ray.</p>","260511","","","","","2010-03-17 13:42:35","Allocation tracker disabled","<android><android-emulator>","2","0","","",""
"2254408","1","","","2010-02-12 19:07:27","2","1008","<p>Suppose I have a view inside TableLayout, like this:</p><pre><code>TableLayout tableLayout;View view = (View)tableLayout.findViewById(R.id.control);</code></pre><p>How can I find out the view's row/column within the TableLayout?</p>","114970","","14048","","2010-02-12 19:36:12","2012-04-11 22:18:02","How can I find out the row /column of a view inside table layout","<android><tablelayout>","3","0","","",""
"2254523","1","2258695","","2010-02-12 19:26:35","1","3364","<p>How can I reference the <code>Activity</code> <code>View</code> from within the <code>onCreate()</code> method so I can use <code>view.setKeepScreenOn()</code>.</p>","244190","","80425","","2013-04-15 13:01:36","2013-04-15 13:01:36","How To setKeepScreenOn()","<android>","2","0","1","",""
"2254558","1","2274683","","2010-02-12 19:32:31","6","11306","<p>I'm developing a mobile version of a website. I'm currently using this Javascript to detect and redirect the user:</p><pre><code>if((navigator.userAgent.match(/iPhone/i)) ||                 (navigator.userAgent.match(/Android/i)) ||                (navigator.userAgent.match(/iPod/i)))         {         window.location = ""http://sitename.com/m/"";    }</code></pre><p>Works fine with iPhone and iPod, but no success with Android. I'm using the Android Emulator within Eclipse. I don't have an Android gadget to actually test it.</p><p>Am I doing something wrong? Anyone having the same issue?</p>","241044","","166712","","2010-02-12 19:40:18","2013-01-14 22:20:45","Android emulator browser detecting","<android><browser><android-emulator>","3","0","2","",""
"2254648","1","2255091","","2010-02-12 19:47:33","0","350","<p>i think a simple question but i did not find anything about doing it right.</p><p>I want to start a mediaplayer from my app and send that player a file to play(stream).</p><p>Would be nice to automatically choose the player associated with the mime type of the file i process to the player.</p><p>The only way to start an app is this one. But i wonder if there is a android native way.</p><pre><code>Runtime r = Runtime.getRuntime();    try {        if(child != null) {            child.destroy();            child = null;        }        child = r.exec(""player"");    } catch (Exception e) {        Log.e(TAG, ""error: "" + e.getMessage(), e);    }</code></pre><p>thanks</p>","268575","","","","","2010-02-12 21:28:41","How to start a different program?","<android>","2","0","","",""
"2254683","1","2435493","","2010-02-12 19:52:50","3","3192","<p>Hey all, what would be best practice for clipping the bottom borders of a Bitmap? Just manipulate the Bitmap itself or overlay an alpha mask drawable or ...?</p><p><em>The whole story:</em></p><p>I've a Listview which looks like the iPhone's grouped UITableView style. I would like to display a Bitmap in the last row, but for now the Bitmap overlaps my custom background drawable of the Listview cell.</p><p>Thx in advance!</p>","272089","","","","","2011-11-29 15:21:10","Round bottom corners on Android Bitmap?","<android><listview><bitmap>","3","0","2","",""
"2255020","1","2255592","","2010-02-12 20:48:58","0","2736","<p>According to the <a href=""http://developer.android.com/reference/android/location/Geocoder.html"" rel=""nofollow"">Geocoder documentation</a>, the class provides methods into a backend service which may or may not exist on the device.  If the geocoder doesn't exist on the device, theoretically a geocode request will return no results.  However, how can one differentiate between no results due to there being no backend geocoder service vs. there being no results because the location makes no sense?</p><p>My app already requires the Google Maps API, so perhaps this is a moot point; as a secondary question, does the Google Maps API <strong>always</strong> include a Geocoder?</p>","60261","","","","","2011-10-27 07:10:11","How can you tell when an Android device has a Geocoder backend service?","<android><google-maps><geocoding>","2","0","1","",""
"2255275","1","2255309","","2010-02-12 21:34:03","1","543","<p>I can't find this in the docs - isn't there a way to specify a View to use for a ListView if the adapter is empty? </p><p>Thanks</p>","246114","","","","","2010-02-12 21:41:45","Specify view to use when ListView is empty?","<android>","1","0","","",""
"2255441","1","2255725","","2010-02-12 22:06:40","4","3261","<p>I've tried to implement the <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">Google Map View</a> tutorial on the Android developer site, but I keep running into a problem when trying to display an AlertDialog when I click on the overlay image.  The problem is that mContext is null when calling</p><pre><code>AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);</code></pre><p>in HelloItemizedOverlay's onTap method because the constructor</p><pre><code>public HelloItemizedOverlay(Drawable defaultMarker, Context context) {    super(boundCenterBottom(defaultMarker));    mContext = context;}</code></pre><p>is never called (that I can tell) which initializes mContext.  When I replace</p><pre><code>HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable);</code></pre><p>with</p><pre><code>HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable,                 this.getApplicationContext());</code></pre><p>in HelloGoogleMaps's onCreate method in order to initialize the context, I get an exception</p><p>android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application</p><p>when I try to display the AlertDialog like so:</p><pre><code>dialog.show();</code></pre><p>I assume this tutorial has been successfully implemented by thousands of people, so I'm at a loss why no one else has run into this problem... have I missed an important step from the tutorial?</p>","244104","","","","","2010-12-15 16:36:25","Context problem in Android example ""Google Map View""","<android><google-maps>","2","0","2","",""
"2256082","1","2257291","","2010-02-13 01:05:59","6","6138","<p>I am making an Android application. Since it is so simple, I first thought I could simply eliminate the need for Java application on the server which acts as a middleware. I tried directly connecting to the database using the JDBC driver for MySQL but my program is crashing so I'm not sure if Android ""supports"" the JDBC driver for MySQL.</p><p>So I am thinking of how to implement the application. Basically the application writes some data from a remote MySQL database and retrieves some data from a remote MySQL database.</p><p>Do I connect to a Java server program using sockets (or some other method of communication)? Or could I implement a direct connection to the MySQL database from the client application?</p>","245120","","","","","2010-02-13 11:23:05","Best way to implement Client <-> Server <-> Database architecture in an Android application?","<java><mysql><android>","1","1","3","",""
"2256451","1","2264245","","2010-02-13 04:20:32","3","4617","<p>I have a class (below) that I want to send to a Service Class through an Intent.  I have implemented the Parcelable interface but am unsure how to actually send and retrieve the entire object including the current state of the object.</p><p>In particular     </p><pre><code>@Override public void writeToParcel(Parcel dest, int flags) {      //I need this to send the entire state of the object}</code></pre><p>And</p><pre><code>public UrlParamsHelper(Parcel in) {    //I need this to unpack the state of the object}</code></pre><p>Here is the actual class</p><pre><code>/*  * A holder class for URL parameters  */ public static class UrlParamsHelper implements Parcelable {  private final HttpClient httpClient;  private final HttpParams params = new BasicHttpParams();  private final SchemeRegistry registry = new SchemeRegistry();  private final ThreadSafeClientConnManager manager;  private final Uri.Builder uri = new Uri.Builder();  final HttpHost host;  final String urlPath;  final String hostname;  /*   * @param hostname the hostname ie. http://www.google.com   * @param urlPath the path to the file of interest ie. /getfiles.php   */  public  UrlParamsHelper(final String hostname, final String urlPath) {   HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);   HttpProtocolParams.setContentCharset(params, ""UTF-8"");   registry.register(new Scheme(""http"",PlainSocketFactory.getSocketFactory(), 80));   manager = new ThreadSafeClientConnManager(params, registry);   httpClient = new DefaultHttpClient(manager, params);   host = new HttpHost(hostname, 80, ""http"");   uri.path(urlPath);   this.urlPath = urlPath;   this.hostname = hostname;  }  public UrlParamsHelper(Parcel in) {   //unpack the state  }  public void addQueryString(String key, String value) {   uri.appendQueryParameter(key, value);  }  public HttpGet buildGetQuery() {   return new HttpGet(uri.build().toString());  }  public HttpClient getHttpClient() {   return httpClient;  }  public HttpHost getHttpHost() {   return host;  }   @Override  public int describeContents() {   return 0;  }  @Override  public void writeToParcel(Parcel dest, int flags) {   //Parcel the entire state of the object  }  //Constructs the parcel again - REQUIRED      public static final Parcelable.Creator&lt;UrlParamsHelper&gt; CREATOR = new Parcelable.Creator&lt;UrlParamsHelper&gt;() {       public UrlParamsHelper createFromParcel(Parcel in) {           return new UrlParamsHelper(in);       }       public UrlParamsHelper[] newArray(int size) {        throw new UnsupportedOperationException();           //return new UrlParamsHelper[size];       }   }; }</code></pre>","248521","","248521","","2010-02-13 08:03:37","2012-10-27 13:48:09","How to use the Parcelable class properly in Android","<android>","1","0","1","",""
"2256584","1","","","2010-02-13 05:22:42","-1","377","<p>I have a list view having several items and it is multichoice list.I want to display the checked item of list view.how i can do this.can anyone help me??? </p>","271694","","","","","2010-02-13 06:18:40","display item of listview","<android>","1","1","","",""
"2256651","1","","","2010-02-13 06:01:59","1","2407","<p>How can I get the principal name, session and ideally check if the principal is authenticated with the Spring Security context inside a CXF JAX-RS webservice method receiving a call from an Android client?  This is the code I am currently working with. I have commented where and what I am trying to get.</p><p>Android code to call webservice:</p><pre><code>httpclient.getCredentialsProvider().setCredentials(          new AuthScope(""192.168.1.101"", 80),           new UsernamePasswordCredentials(""joesmith"", ""mypasswd"")); HttpGet httpget = new HttpGet(WEBSERVICE_URL+""/makePayload"");  httpget.setHeader(""User-Agent"", userAgent);  httpget.setHeader(""Content-Type"", ""application/xml"");  HttpResponse response;  try {      response = httpclient.execute(httpget);      HttpEntity entity = response.getEntity();      ... parse xml from response      }</code></pre><p>CXF, Spring webservice code:</p><pre><code>@GET@Path(""/getPayload"")@Produces(""application/XML"")public Response makePayload(@Context Request request){         //Get user principal name         //Get session?         //Get Spring security context?         Payload payload = new Payload();         payload.setUsersOnline(new Long(200));         return Response.ok().entity(payload).build(); }</code></pre>","268648","","","","","2010-09-21 20:52:58","How to get principal name from HTTPRequest in CXF JAX-RS webservice method called from android app","<android><web-services><cxf>","1","0","","",""
"2256678","1","2260536","","2010-02-13 06:13:34","2","5506","<p>I'm writing a simple caesar-encryption-activity. Two EditTexts on screen, one clear-text, one crypted. Here's an example for the crypted EditText - the cleartext one is similar.</p><pre><code>&lt;EditText     android:layout_below=""@id/Caesar_Label_CryptText""    android:layout_height=""wrap_content""     android:layout_width=""fill_parent""    android:id=""@+id/Caesar_Text_CryptText""     android:hint=""Enter crypted text""    android:maxLines=""2""     android:lines=""2""     android:minLines=""2""    android:inputType=""text|textMultiLine|textVisiblePassword""    android:scrollbars=""vertical""     android:gravity=""top"" /&gt;</code></pre><p>Now when entering cleartext I have an TextChangedListener running that programatically crypts and fills that crypto-EditText. So far, so good.</p><p>When the cleartext entered gets really long, the cleartext-EditText scrolls with my imput, but the crypto-EditText stays at the top of the text. I'd really like the crypto-EditText to scroll so that it always shows the bottom line of its content.</p><p>How can that be done, preferably from the onTextChanged()-Method of the TextWatcher?</p>","269462","","76835","","2010-02-13 09:01:19","2010-02-14 08:39:05","Programatically scrolling an EditText","<android><android-widget><edittext>","2","1","","",""
"2256774","1","2256842","","2010-02-13 07:04:21","4","3156","<p>I'm trying to create an application for Android that uses encryption to save user information and I cannot figure out what I'm doing wrong. I'm trying to create an instance of the SecretKeyFactory using the ""PBKDF2WithHmacSHA1"" algorithm, but the application keeps on throwing exceptions at that point in the program (it doesn't matter if it's in the emulator or on real hardware).</p><p>Code:</p><pre><code>SecretKeyFactory secretFactory = SecretKeyFactory.getInstance(""PBKDF2WithHmacSHA1"");</code></pre><p>Exception:</p><blockquote>  <p>java.security.NoSuchAlgorithmException:  SecretKeyFactory PBKDF2WithHmacSHA1  implementation not found ...</p></blockquote><p>Here's the weird thing... if I take this code and compile it as a regular Java application, it works... no exceptions are thrown and I can create encrypted files (and decrypt them) without errors. </p><p>I have also tried entering other algorithms (e.g. AES, PBEWithHmacSHA1AndDESede, PBEWithMD5AndDES, etc.) and they all produce the same error/exception at that line in the code (when compiling for Android).</p><p>I have the latest version of Java installed (JDK 1.6.0.18) , all updates applied to Eclipse and plug-ins, and the latest version of the Android SDK. I'm also running Windows 7 64-bit.</p><p>Please help, I have not found an answer to this in two days of Internet searching.Thanks.</p>","272302","","272302","","2010-02-13 08:33:35","2010-11-18 11:11:18","Android SecretKeyFactory problems. Implementation not found?","<java><android><encryption>","3","0","2","",""
"2256884","1","2496833","","2010-02-13 07:53:20","64","108692","<p>I'm using Eclipse + ADT, and my physical device (listed below) is unlisted on Android Device Chooser. I have updated Eclipse and all of the Android packages. My phone is running Android OS 1.6, which corresponds to the target version listed in the Eclipse Project. </p><p>Also, the reason I decided to try testing on a real device is because the emulator doesn't seem to be working right anymore when I run my project. The emulator launches, but the program never does. Any ideas?</p><p>(using windows 7/t-mobile mytouch 3g)</p>","94751","","2039292","","2014-02-14 03:58:49","2014-03-16 07:57:34","Android Device Chooser -- device not showing up","<android><eclipse><eclipse-plugin><devices><android-debug-bridge>","28","0","14","",""
"2256905","1","","","2010-02-13 08:09:08","0","10675","<p>How to get the MySQL database connection in android emulator? I try to connect using <code>java.sql.*</code> package like this</p><p>I get the exception: <code>java.sql.SQLException:no suitable drive</code></p><p>How can I use sql packages in android mobile?</p>","268741","","17343","","2010-02-13 08:27:08","2011-05-02 05:31:03","how to get mysql database connection in android emulator","<mysql><android><emulator>","3","2","","",""
"2257026","1","2257135","","2010-02-13 09:06:12","8","10860","<p>I am loading a URL whose datatype is String in a <code>WebView</code>. Using something like:</p><pre><code>webview.loadUrl(string_variable);</code></pre><p>but it is automatically redirected to the browser.</p><p>I got this in my LOGCAT,</p><pre><code>02-13 14:11:08.586: INFO/ActivityManager(5Cool: Displayed activity com.example.brown/.Bru_Press_MostRecent_ArticleView: 2583 ms (total 2583 ms)02-13 14:11:09.376: INFO/ActivityManager(5Cool: Starting activity: Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=http://mobile.twitter.com/brownuniversity/statuses/8681812931 cmp=com.android.browser/.BrowserActivity (has extras) }02-13 14:11:09.506: INFO/ActivityManager(5Cool: Start proc com.android.browser for activity com.android.browser/.BrowserActivity: pid=285 uid=10014 gids={3003, 1015}</code></pre>","267269","","76835","","2010-02-13 09:33:26","2011-11-28 02:45:55","webview.loadUrl() problem in android?","<android>","3","0","1","",""
"2257059","1","","","2010-02-13 09:22:50","2","725","<p>I have not found any convinient way to create something like a jaxws wrapperclass for an existing Soap Webservice - like in full Java.Jaxws is unfortunately not avaliable in the sdk.</p><p>Is there any was to do this without using any external libs?Are there any external libs at all yet?</p>","272343","","","","","2010-02-17 11:12:50","Accessing a SOAP WebService","<android><soap><web-services>","2","1","","",""
"2257075","1","2260324","","2010-02-13 09:28:18","19","18240","<p>I'm trying to figure out how to write an app that can decode audio morse code on the fly. I found <a href=""http://developer.android.com/guide/topics/media/index.html#capture"">this document</a> which explains how to record audio from the microphone in Android. What I'd like to know is whether it's possible to access the raw input from the microphone or whether it has to be written/read to a file.</p><p>Thanks.</p>","76835","","253056","","2010-02-13 09:32:23","2013-05-26 21:42:50","Real-time audio processing in Android","<android><audio><real-time>","4","1","24","",""
"2257197","1","","","2010-02-13 10:41:22","2","1094","<p>I have to send requests to a server in xml format.I did this using DefaultHttpClient and HttpPost(i have to do post request) using StringEntity to send the xml request but i got ""401 Authorisation required"" errror.I searched and i found out that  authentication is required(i have username and password),but how to do is a problem for me.Currently, i am using ""UsernamePasswordCredentials"" and ""BasicCredentialsProvider"" but it throws ""ClientProtocolException"".I am not able to figure out what is wrong? Also, i have read that authentication are of different types-basic and digest.How do i know what my server supports? And how to implement them in Android.I am very new to this stuff,please help.!</p><p>Thanks </p>","272355","","","","","2010-10-22 07:40:24","Authentication Problem in Android","<android><authentication><httpclient>","1","0","","",""
"2257502","1","2258256","","2010-02-13 12:37:32","0","381","<p>Iam trying to make my Activity List more effective.I have an Activity List in my app, on every call its going to the database collecting some information and show it on the screen(as List).</p><p>so basiclly everytime you finish and re-call that list, it's calling onCreate.. again and again..my problem here is with the allocation i am trying to reduce!</p><p>for example i have an Arraylist which is being allocated every time on the onCreate Method of my activity list, and many more allocations which i do onCreate. </p><p>i find it slowing my program very much, my program is very un-stable, and i try to reach to some performances... any idea how can i avoid this onCreate everytime i re-call my Activity List? mybe another technics to reduce re-allocations?Thanks,Idan.</p>","260511","","","","","2011-01-05 16:08:08","Effective activity List","<android>","2","5","","",""
"2257786","1","2261056","","2010-02-13 14:05:04","3","4003","<p>when i load a url in a webview. it loads perfectly.</p><p>but i touch anything in that webview its redirected to the browser by default.</p><p>how to set that link will load in the same webview itself.</p><p>thanks.</p>","267269","","554801","","2013-02-04 21:47:00","2013-02-04 21:47:00","how to make links load or refresh within a webview in android?","<android>","1","0","1","",""
"2257905","1","2306490","","2010-02-13 14:47:13","0","1026","<p>I want to add an ItemizedOverlay to a MapView that always keeps oneOverlayItem as the selected one. I indicate this by using aStateListDrawable with two different marker drawables.</p><p>But right now, whenever I tap on the map and not hitting a marker, thelast selected item will get deselected. But I always want to keep thelast item selected until a new one is hit.</p><p>I already tried to intercept e.g. onTap, but this only lets mecompletely disable the tap handling. This means now I can't even select another marker anymore.</p><p>Any suggestions what to do about this?</p>","272425","","","","","2012-05-15 14:22:39","Android MapView Overlay that does always keeps an OverlayItem selected?","<android><overlay><android-mapview>","1","0","","",""
"2257963","1","","","2010-02-13 15:01:58","90","90828","<p>I've been trying to show a ""Do you want to exit?"" type of dialog when the user attempts to exit an Activity.  </p><p>However I can't find the appropriate API hooks.  <code>Activity.onUserLeaveHint()</code> initially looked promising, but I can't find a way to stop the Activity from finishing.</p>","272434","","435093","","2012-10-25 12:02:40","2014-01-16 09:05:15","How to show a dialog to confirm that the user wishes to exit an Android Activity?","<android><android-activity><android-dialog><activity-finish>","5","4","35","",""
"2258373","1","2261048","","2010-02-13 17:14:27","1","2917","<p>i have a tabactivity with two tabs.</p><p>in this tabactivity i have edittext and button to search the local database.</p><p>i have a listactivity class as a tabcontent. it shows by the framelayout.</p><p>i want to refresh that listactivity based on the text entered in edittext which is in the tabactivity.</p><p>how to do that?</p><p>i created a method in a listactivity :</p><pre><code>public void search(String temp) {String val=temp;try{c=BruTube_Videos.this.getContentResolver().query(Constants.CONTENT_URI, null, Constants.TITLE+"" like '%""+val+""%'"", null, ""DATETIME(""+Constants.PUBLISHED+"") DESC"");}catch(Exception e){Log.v(TAG, ""exp in cursor"");}show(c);}</code></pre><p>invoke this method in a tabactivity like this:</p><pre><code>EditText et1=(EditText) findViewById(R.id.EditText01);String temp=et1.getText().toString();BruTube_Videos vdo_obj=new BruTube_Videos();vdo_obj.search(temp);</code></pre><p>it shows an exception in logcat:</p><p>02-12 16:58:26.623: VERBOSE/BruTube_Videos(227): Exception in brutube search:java.lang.IllegalStateException: System services not available to Activities before onCreate()</p><p>how can i manage it?</p><p>thanks.</p>","267269","","","","","2010-02-14 12:36:13","tab content handling.... how in android?","<android><android-emulator><android-widget>","1","0","","",""
"2258986","1","","","2010-02-13 20:44:18","2","560","<p>How do you access the user's Google Account Id / username in code (pre-2.0)? I am building an application that will call a web service to store data and I want to identify the identity of the person sumitting the data.</p><p>If no user identity information available (pre 2.0) how about the ability to access phone identity (pre 2.0).</p><p>Thanks in advance.</p>","258055","","","","","2010-07-30 16:46:08","Accessing Google Account Id /username via Android (pre 2.0)","<android><identity><username>","1","1","","",""
"2259059","1","2259262","","2010-02-13 21:07:20","1","83","<p>I am looking the R.java file and I saw this under the app_name 0x7f040001. I know that is some kind of encryption because it displays hello world i believe. There are other ones there but I was just wonder what encryption that is.</p><p>Thanks for any help</p>","160463","","","","","2010-02-13 22:10:21","android developer question","<android><layout>","2","0","","",""
"2259110","1","2792952","","2010-02-13 21:21:33","1","3878","<p>I have a Spring Security (form based authentication) web app running CXF JAX-RS webservices and I am trying to connect to this webservice from an Android app that can be authenticated on a per user basis. Currently, when I add an @Secured annotation to my webservice method all requests to this method are denied.  I have tried to pass in credentials of a valid user/password (that currently exists in the Spring Security based web app and can log in to the web app successfully) from the android call but the request still fails to enter this method when the @Secured annotation is present. The SecurityContext parameter returns null when calling getUserPrincipal().</p><p>How can I make a request from an android app that can enter a Spring Security secured webservice method?</p><p>Here is the code I am working with at the moment:</p><p>Android call:</p><pre><code>httpclient.getCredentialsProvider().setCredentials(          //new AuthScope(""192.168.1.101"", 80),           new AuthScope(null, -1),         new UsernamePasswordCredentials(""joeuser"", ""mypassword""));  String userAgent = ""Android/"" + getVersion();        HttpGet httpget = new HttpGet(MY_URI);  httpget.setHeader(""User-Agent"", userAgent);  httpget.setHeader(""Content-Type"", ""application/xml"");  HttpResponse response;  try {      response = httpclient.execute(httpget);      HttpEntity entity = response.getEntity();      ... parse xml</code></pre><p>Webservice Method:</p><pre><code>@GET@Path(""/payload"")@Produces(""application/XML"")@Secured({""ROLE_USER"",""ROLE_ADMIN"",""ROLE_GUEST""})public Response makePayload(@Context Request request, @Context SecurityContext securityContext){         Payload payload = new Payload();         payload.setUsersOnline(new Long(200));            if (payload == null) {                return Response.noContent().build();            }            else{                 return Response.ok().entity(payload).build();            } }</code></pre>","268648","","","","","2010-05-11 18:31:14","How to make a request from an android app that can enter a Spring Security secured webservice method?","<android><web-services><spring-security><cxf>","1","1","","",""
"2259234","1","2259346","","2010-02-13 22:03:18","6","2208","<p>I am writing an application that initially will be developed as web (probably Silverlight) and Android application. I found on Android <a href=""http://developer.android.com/reference/android/database/sqlite/package-summary.html"" rel=""nofollow"">website</a> that SQLite is supported, but I plan to release the same app for Windows Mobile, Palm Web OS and iPhone as well.</p><p>Could you please advice me on which database would be the best to work with for all platforms?</p><p>EDIT:Maybe I should add that I would want all applications (mobile/desktop) to connect to a main server when internet connection is detected and synchronize all data that's changed.</p>","102274","","102274","","2010-02-14 01:33:26","2010-02-14 01:33:26","Best database for mobile phone development","<iphone><database><android><windows-mobile><mobile-phones>","3","0","1","",""
"2259407","1","2261037","","2010-02-13 22:49:18","10","5969","<p>I want to have a View pop in at the bottom of the page exactly likethe software keyboard view does in the compose section of the Mms app. It slides in from the bottom, as if it's being added to a verticallyoriented LinearLayout, only making the ListView smaller.  It becomes apart of the current layout instead of popping up over the top of it.I'd like to to this exact thing with my own custom View.</p><p>Does the question make sense at all?</p>","238849","","","","","2010-02-14 12:32:25","Android: Have an arbitrary View slide under another View like the software keyboard does","<android>","1","0","5","",""
"2259417","1","2259661","","2010-02-13 22:52:49","5","2976","<p>I'm trying to connect my Samsung Galaxy to PC but ddms tool does not recognize my phone. USB debugging is enabled. What can cause a problem? </p><p>PS. I'm using Ubuntu 9.10 OS.</p><p>Thanks.</p>","108826","","108826","","2010-02-13 23:32:13","2010-02-14 14:21:07","How to connect Android to PC","<android><ddms>","3","0","2","",""
"2259438","1","","","2010-02-13 22:59:02","4","5071","<p>I have a simple Java client application (Android app). I have to write a PHP server application which receives a request from the Java client application to write some data to a MySQL database or read some data from the MySQL database. It should respond with a status message (Write failed/success) or the data requested respectively.</p><p>How would I get the Java client send a request and receive the reply from the PHP program and how would the PHP program receive the request and send the reply? I have googled about SOAP and REST architectures, but looking for a simple tutorial which will allow me to implement this simple program.</p><p>Thanks.</p>","245120","","","","","2010-02-13 23:10:53","How to implement communication between Java client application (Android) and PHP server application?","<java><php><android><client-server>","2","0","5","",""
"2259480","1","2259498","","2010-02-13 23:10:34","5","5993","<p>Does the <code>instanceof</code> keyword bear with it a relatively heavier impact on the Android platform (and more speciffically the mobile phones running the Dalvik VM?</p>","261259","","119895","","2013-03-22 15:04:38","2013-03-22 15:04:38","Impact of 'instanceof' in Android Java code","<android><performance><garbage-collection><dalvik><instanceof>","2","5","","",""
"2259647","1","2259767","","2010-02-14 00:13:09","1","1104","<p>I am building a pyramid of buttons and want the size of the pyramid to be able to change dynamically.  To accomplish this, I have extremely basic XML files representing the activity, each row of the activity, and each button.  I am modeling the solution from the accepted response to <a href=""http://stackoverflow.com/questions/2216811/creating-dynamic-view-multiple-a-view-x-times-get-set-value-for-each-group/2216844#2216844"">this question</a>.  The pyramid constructs correctly, but the 50dip button width is not being adhered to.  Any ideas why?  Is there a better way of doing this?</p><p>main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/pyramid""     android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:gravity=""center_horizontal""/&gt;</code></pre><p>row.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/row""          android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:orientation=""horizontal""        android:gravity=""center_horizontal""/&gt;</code></pre><p>btn.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;Button xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/button""         android:layout_width=""50dip""         android:layout_height=""wrap_content""/&gt;</code></pre><p>Main Activity:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    inflate();    }private void inflate() {    LinearLayout pyramidLayout = (LinearLayout) findViewById(R.id.pyramid);    for (int row = 1 ; row &lt;= mSize; ++row) {        View rowView = getLayoutInflater().inflate(R.layout.row, null);        LinearLayout rowLayout = (LinearLayout) rowView.findViewById(R.id.row);        for (int column = 1; column &lt;= row; ++column) {            View btnView = getLayoutInflater().inflate(R.layout.btn, null);            Button btn = (Button) btnView.findViewById(R.id.button);            btn.setId(row*10 + column);            rowLayout.addView(btnView);        }        pyramidLayout.addView(rowView);     }}</code></pre>","252631","","","","","2010-03-12 17:13:30","Android LayoutWidth being disregarded by cascaded use of LayoutInflater","<android>","2","0","1","",""
"2259802","1","","","2010-02-14 01:19:35","0","1528","<p>I've got ListActivity and I am using custom CursorAdapter.</p><p>In each item of the list I've got also checkbox...</p><p>Now I have in my list screen a perm button, when you press on it, </p><p>It should find all the checkboxes which are 'checked' and do some operations on the item which it's checkbox is 'checked'.</p><p>How can I retrieve all the checked ones?</p><p>I've done focusable:false, so I can use OnClickListener, but I don't know how farther then this..Thanks,</p><p>some code:This is in my ListActivity class:</p><pre><code> final String columns[] = new String[] { MyUsers.User._ID,                MyUsers.User.MSG, MyUsers.User.LOCATION };          int[] to = new int[] { R.id.toptext,   R.id.bottomtext,R.id.ChkBox,                R.id.Location};          Uri myUri = Uri.parse(""content://com.idan.datastorageprovider/users"");          Cursor cursor = getContentResolver().query(myUri, columns, null, null, null);            startManagingCursor(cursor);             ListCursorAdapter myCursorAdapter=new ListCursorAdapter(this,R.layout.listitem, cursor, columns, to);           this.setListAdapter(myCursorAdapter);</code></pre><p>and this is my Custom Cursor adapter class:</p><pre><code>public class ListCursorAdapter extends SimpleCursorAdapter{         private Context context;    private int layout;    public ListCursorAdapter(Context context, int layout, Cursor c,            String[] from, int[] to)    {        super(context, layout, c, from, to);        this.context = context;        this.layout = layout;    }    @Override    public View newView(Context context, Cursor cursor, ViewGroup parent)    {        Cursor c = getCursor();        final LayoutInflater inflater = LayoutInflater.from(context);        View v = inflater.inflate(layout, parent, false);                   return v;          }@Override    public void bindView(View v, Context context, Cursor c)    {        TextView topText = (TextView) v.findViewById(R.id.toptext);        if (topText != null)        {            topText.setText("""");        }        int nameCol = c.getColumnIndex(MyUsers.User.MSG);        String name = c.getString(nameCol);        TextView buttomTxt = (TextView) v.findViewById(R.id.bottomtext);        if (buttomTxt != null)        {            buttomTxt.setText(""Message: ""+name);        }        nameCol = c.getColumnIndex(MyUsers.User.LOCATION);        name = c.getString(nameCol);        TextView location = (TextView) v.findViewById(R.id.Location);        if (locationLinkTxt != null)        {            locationLinkTxt.setText(name);        }        }</code></pre>","260511","","560952","","2012-07-10 11:48:20","2012-07-10 11:48:20","Retrieve checked CheckBoxes's items in Listview","<android><checkbox><android-listview>","1","2","","",""
"2259803","1","2259840","","2010-02-14 01:20:32","9","2690","<p>In the Adapter for the ListView, I return a LinearLayout, in which I add a Checkbox, a ImageView and a TextView. This basically constructs a ListView, in which each item contains a Checkbox, a ImageView and a TextView. However the strange thing is that if I don’t add the Checkbox, then ListView receives onItemClick event correctly, as long as I add the Checkbox, onItemClick of the ListView never gets fired again, as if the Checkbox eats all the OnClick event passed to ListView.</p><p>Any ideas how can I solve this? I want the user to be able to check/uncheck the Checkboxes and at the same time be able to click on these ListView items as well if they click on area for the ListView item other than the checkbox.</p>","265576","","265576","","2010-02-14 01:25:40","2012-05-13 10:17:51","Adding a CheckBox to ListView item prevents it from being able to receive ItemClick","<android><listview><android-linearlayout>","1","0","","",""
"2259807","1","2260085","","2010-02-14 01:22:06","0","5164","<p>I am still pretty new to Android development, and I have not been able to find any examples of how to do this.</p><p>In my Activity, I use ""setContextView(new myViewClass)"" to designate a View-extended class as the one to load.  Everything works fine in terms of loading the view, where I create various elements (LinearLayouts, buttons, etc.) based on a number of conditions.  Unfortunately, I cannot get any of these elements to actually appear on the screen.  </p><p>I guess my question goes to a greater understanding of Views.  All of the examples I've seen concern setting an xml file as the base view and then altering it within the code.  Is there some alternative to this?  </p><p>Thanks.</p><p>Here is an example code I've been trying to make work.  There are other things going on, but this is the relevant info.  For program context, this class is substantiated with the <code>setContextView(new createView(this))</code>:</p><pre><code>public createView(Context c){    super(c);    // Create a simple layout    LinearLayout layout = new LinearLayout(top.getContext());    layout.setOrientation(LinearLayout.VERTICAL);    // Create test text    TextView mTestText = new TextView(c);    mTestText.setText(""This is a test"");    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(            LinearLayout.LayoutParams.FILL_PARENT,            LinearLayout.LayoutParams.WRAP_CONTENT);    lp.setMargins(10, 10, 10, 10);    layout.addView(mTestText, lp);}</code></pre>","248568","","833622","","2011-08-17 07:49:56","2011-08-17 07:49:56","Creating a layout within a View-extended class","<android><uiview><view>","1","0","","",""
"2259821","1","2259907","","2010-02-14 01:27:40","1","1174","<p>Assuming I didn't start in debug mode, is there a way to make the eclipse debugger automatically start if my app throws an exception inside the emulator? </p><p>Alternatively, is there a way to get a more useful error message out of the emulator (something more useful than ""Sorry, your app terminated unexpectedly""). </p>","65295","","","","","2010-02-16 02:17:21","Is there a way to break into the debugger on exception in Android emulator?","<android><exception><android-emulator>","3","0","","",""
"2259827","1","","","2010-02-14 01:31:24","5","1800","<p>A REST XML (not JSON!) Web Service should exchange XML Schema specified XML between a Google App Engine and an Android app.</p><p>I wanted to use XStream for both, however, I could not get it to work for the Google App Engine, therefore to me Apache XMLBeans is the next best choice (JAXB does not work on both).However, with Google App Engine there is no problem, but on Android, I get several severe exceptions (eg. due to the usage of the Stax API with its javax.xml.* packages).</p><p>So, </p><ol><li>Is there any other XML-binding possibility to stream XML documents on GAE and Android?</li><li>If not, is it possible to patch Apache XMLBeans to work with Android?</li></ol><p>Thanks!</p>","157229","","","","","2011-05-23 14:47:37","Android and Google App Engine: supported XML Binding Tool available?","<android><google-app-engine>","5","0","2","",""
"2260118","1","4398830","","2010-02-14 04:13:31","14","29639","<p>I am running Windos 7 and Eclipse 3.5 and I don't know why I keep getting this error. When I try run the program it gives me:</p><pre><code>[2010-02-13 23:09:41 - HelloAndroid]The connection to adb is down, and a severe error has occured.[2010-02-13 23:09:41 - HelloAndroid]You must restart adb and Eclipse.[2010-02-13 23:09:41 - HelloAndroid]Please ensure that adb is correctly located at 'C:\Users\Mohit\Documents\AndroidSDK\tools\adb.exe' and can be executed.</code></pre><p>I even tried runing Eclipse and adb.exe as admin. What is going on? How can I fix this and start making Android apps?</p>","200477","","","","","2014-01-22 19:23:38","Failed to parse the output of 'adb version'?","<android><eclipse><windows-7><adb>","9","2","2","",""
"2260189","1","2260453","","2010-02-14 04:58:36","3","2665","<p>On Android settings, under Wireless controls->Mobile networks there is a setting ""Use only 2G networks"". </p><p>In the Android SDK reference, under <code>android.telephony.TelephonyManager</code>, there doesn't seem to be anything to control the network type.</p><p>What APIs does this setting actually call?</p>","185986","","166712","","2010-02-14 05:37:50","2010-02-14 07:41:55","Android 3G/2G control API?","<android>","1","0","","",""
"2260897","1","2260927","","2010-02-14 11:31:23","0","410","<p>Are there precompiled samples from SDK available anywhere? Or is there any way to quickly compile all samples from given SDK version?</p><p><strong>UPDATE</strong>: it looks like everyone needs to compile examples by itself</p>","7162","","7162","","2010-02-17 12:48:01","2010-02-17 12:48:01","Android - are there precompiled samples from SDK available anywhere?","<android><sdk><sample><precompiled>","2","0","","",""
"2260940","1","2260950","","2010-02-14 11:46:20","0","405","<p>I've always developed application for personal use on command line. Now I have to develop an app for android for a broad audience.</p><p>If I start now I would make and awful GUI.  I need first to educate myself on the matter of building clear, efficient and usable GUI on a touch interface.</p><p>Any advice?</p>","269931","","","","","2010-02-14 17:02:29","How to develop a good touch GUI?","<android><gui>","2","0","","",""
"2261126","1","6945188","","2010-02-14 13:00:44","9","6426","<p>I'm writing a simple application for Android.</p><p>I have 2 tables - one called 'grous' and another called 'group_items'.</p><p>I want to use expandable list to display data from both tables.</p><p>What is the best way to do it? Is it possible to map data by using SimpleCursorTreeAdapter? I couldn't find any usefull examples.</p><p>I saw the examples creating expandable lists using ArrayAdapter, so should I convert data to array first and then create an expandable list with it or there is the way to do it directly?</p><p>I don't need a full working example - just an advice on what is the correct and most efficient way to do it.</p><p>Leonti</p>","219449","","","","","2014-03-08 07:52:12","Android ExpandableListActivity and SimpleCursorTreeAdapter?","<android><sqlite><expandablelistview>","1","3","4","",""
"2261288","1","","","2010-02-14 13:56:49","1","657","<p>I have HTC Hero, and i see that TimePickerDialog and DatePickerDialog were changed by HTC (they look different than those in the emulator). </p><p>My question is how can i change such system level dialogs?</p>","19868","","","","","2010-02-14 13:59:57","Changing system-level dialogs: TimePicker, DatePicker","<android><gui>","1","0","","",""
"2261539","1","2261684","","2010-02-14 15:20:03","0","377","<p>I developed a timer application but some people noticed that the notification never stops on their Samsung Galaxy or Spica.</p><p>I have these flags attached to my notification :</p><p><code>notification.flags = Notification.FLAG_AUTO_CANCEL | Notification.FLAG_INSISTENT;</code></p><p>I'm not really sure this is the issue but I can't think of any other thing to cause this (and I don't have any samsung phone to test it)...</p><p>Do you have any idea why would it bug especially on Samsung phones ?How could I make the notification sound to loop without using this <code>Notification.FLAG_INSISTENT;</code> ?</p><p>Thanks a lot !</p>","257559","","","","","2010-02-14 16:03:25","Samsung phones and Notification.FLAG_INSISTENT bug?","<android>","1","0","","",""
"2261604","1","2261771","","2010-02-14 15:41:03","0","1003","<p>I am researching for my next android app project. ( My wife and I created the Mayan Calendar Countdown 2012 App ) I want to create a phone answering machine for android phones that have all the capabilities of a normal home phone answering machine. The recording of a message to answer with seems relatively easy but I am unsure how to play that message back to the incoming caller.</p><p>Is this app possible without some hack that will make it unacceptable for android market?I have a lot of c++ experience and have setup the ndk etc.</p><p>BTW stackoverflow is great. I am very impressed with the knowledge here.</p>","246240","","26428","","2010-07-25 22:17:17","2011-03-16 18:53:04","Is it possible to create a phone answering machine program on android phones?","<android><telephony>","1","2","1","",""
"2261652","1","","","2010-02-14 15:54:37","0","11844","<p>i think ive tried everything(made focusable:false!!)and i cant capture in anyway the selected checkbox on my list item.even  OnItemClickListener, doesnt respond to any click.</p><p>how can i retrieve checked checkboxes in my list item?my list item inclused: image view, 4 textviews and the checkbox</p><p>some code:</p><p>this is in my ListActivity class:</p><pre><code>final String columns[] = new String[] { MyUsers.User._ID,         MyUsers.User.MSG, MyUsers.User.LOCATION }; int[] to = new int[] { R.id.toptext, R.id.bottomtext,R.id.ChkBox, R.id.Location};Uri myUri = Uri.parse(""content://com.idan.datastorageprovider/users""); Cursor cursor = getContentResolver().query(myUri, columns, null, null, null);               startManagingCursor(cursor);   ListCursorAdapter myCursorAdapter=new ListCursorAdapter(this,         R.layout.listitem, cursor, columns, to);  this.setListAdapter(myCursorAdapter); </code></pre><p>and this is my Custom Cursor adapter class:</p><pre><code>public class ListCursorAdapter extends SimpleCursorAdapter{ private Context context;  private int layout;  public ListCursorAdapter(Context context, int layout, Cursor c,     String[] from, int[] to) {    super(context, layout, c, from, to);    this.context = context;    this.layout = layout; } @Override public View newView(Context context, Cursor cursor, ViewGroup parent) {    Cursor c = getCursor();    final LayoutInflater inflater = LayoutInflater.from(context);    View v = inflater.inflate(layout, parent, false);            return v; } @Overridepublic void bindView(View v, Context context, Cursor c) {     TextView topText = (TextView) v.findViewById(R.id.toptext);     if (topText != null)     {         topText.setText("""");     }     int nameCol = c.getColumnIndex(MyUsers.User.MSG);     String name = c.getString(nameCol);     TextView buttomTxt = (TextView) v.findViewById(R.id.bottomtext);     if (buttomTxt != null)     {         buttomTxt.setText(""Message: ""+name);     } nameCol = c.getColumnIndex(MyUsers.User.LOCATION); name = c.getString(nameCol); TextView location = (TextView) v.findViewById(R.id.Location); if (locationLinkTxt != null) {     locationLinkTxt.setText(name); } </code></pre><p>I will appreciate any help! it's really depressing, I've tried many ways. many listeners, can't figure how to capture listener to my checkboxes.</p><p>The data I am binding to the list items from the database, isn't concered about the checkbox.. only the textviews.. there isn't any connection between the database and the checkbox I have in the list's item.</p><p>Thanks,idan. </p><pre><code>     &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;     &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent"" android:layout_height=""100sp""android:focusable=""false"" android:focusableInTouchMode=""false""&gt;android:padding=""6dip""&gt;&lt;ImageView android:layout_width=""wrap_content""    android:layout_height=""fill_parent"" android:src=""@drawable/icon""    android:id=""@drawable/icon"" android:layout_marginLeft=""6dip""    android:focusable=""false"" android:focusableInTouchMode=""false""&gt;&lt;/ImageView&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""    android:orientation=""vertical"" android:layout_width=""1sp""    android:layout_height=""fill_parent"" android:layout_weight=""1""    android:focusable=""false"" android:focusableInTouchMode=""false""&gt;    &lt;TextView android:id=""@+id/toptext"" android:layout_weight=""1""        android:gravity=""center_vertical"" android:text=""OrderNum""        android:singleLine=""true"" android:layout_height=""0dp""        android:layout_width=""wrap_content"" android:focusable=""false""        android:focusableInTouchMode=""false""&gt;    &lt;/TextView&gt;    &lt;TextView android:id=""@+id/bottomtext"" android:layout_height=""wrap_content""        android:layout_width=""wrap_content"" android:focusable=""false""        android:focusableInTouchMode=""false"" android:text=""TweetMsg""&gt;    &lt;/TextView&gt;    &lt;TextView android:id=""@+id/twittLocation""        android:layout_weight=""1"" android:text=""location"" android:singleLine=""true""        android:layout_width=""fill_parent"" android:layout_height=""0dip""        android:focusable=""false"" android:focusableInTouchMode=""false""&gt;    &lt;/TextView&gt;    &lt;TextView android:layout_weight=""1"" android:id=""@+id/twittLocationlink""        android:text=""locationlink"" android:gravity=""fill_horizontal""        android:layout_width=""fill_parent"" android:layout_height=""0dip""        android:focusable=""false"" android:focusableInTouchMode=""false""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;CheckBox android:id=""@+id/deleteTwittChkBox"" android:text=""Delete""    android:layout_width=""wrap_content"" android:layout_marginRight=""2dp""    android:focusable=""false"" android:checked=""false""    android:focusableInTouchMode=""false"" android:layout_height=""fill_parent""&gt;&lt;/CheckBox&gt;</code></pre><p></p>","260511","","631","","2010-11-02 15:09:36","2010-11-12 10:10:49","Checkbox in listview with Custom SimpleCurser binding","<android>","3","0","1","",""
"2261870","1","","","2010-02-14 16:49:51","3","4638","<p>I am fairly new to Android (find it most fun, btw) and I was wondering...</p><p>How can I create an Android CheckBox with the label to the left and the checking button/box aligned to the right (pretty much a switch of the way this widget is drawn by default)? Like the way a checkbox preference normally looks like...</p><p>I am looking for the most elegant/short-coded version possible, if there is one. I mean other than creating your own View/ViewGroup with layouts, empty-labeled CheckBoxes and TextViews, etc...</p><p>Thanks &amp; Regards,</p>","272939","","","","","2011-11-25 03:10:24","Android CheckBox with right-aligned checking button/box","<android><android-widget>","2","0","1","",""
"2261914","1","2262020","","2010-02-14 17:02:37","6","18633","<p>How can i catch a phone keypress with the android SDK? i've been looking around for hours without finding anything..</p><p>For example:</p><p>In some cases, i want to catch the message when a user presses the ""hang up"" button on the phone, and then discard the message before it reaches the OS.</p><p>Is this possible?</p>","265990","","","","","2011-07-28 09:07:57","Catch keypress with android","<android><key><message><keypress>","1","0","0","",""
"2262023","1","","","2010-02-14 17:35:21","0","617","<p>I wish to know if Android 2.1 SDK support APIs for changing network settings such as bluetooth on/off, wifi on/off , airplane mode on/off. Thank you!</p>","272968","","","","","2010-02-14 18:41:29","Does Android 2.1 SDK support APIs for changing network settings?","<android>","2","1","","",""
"2262294","1","","","2010-02-14 18:48:05","0","6047","<p>Good Afternoon...</p><p>I recently bought the book ""Android Application Development"" from O'reilly and I'm at a section where it asked me to download MJAndroid Code and import into Eclipse... </p><p>Here is the link <a href=""http://examples.oreilly.com/9780596521509/"" rel=""nofollow"">http://examples.oreilly.com/9780596521509/</a></p><p>I was able to downloaded / import it but now I'm stuck...</p><p>Here is what it saids...""You can install the file into the emulator by simply starting the emulator from a terminal window</p><p>$emulator</p><p>$adb install MJAndroid-1.0.0apk</p><p>Now I'm running Windows and I'm guessing it wants me to run in dos but where do I point it to so I can install it correctly.</p><p>When I try running it I get the following error....</p><p>""Your project contains errors please fix them before running your application""</p><p>Console Error ""[2010-02-14 12:40:02 - MJAndroid]Project has no target set. Edit the project properties to set one.""</p><p>I hope I explained myself correctly....  </p><p>Thanks again</p><p>Junior BisonoFuture Android Developer......</p>","","user272162","","","","2011-04-08 09:40:04","Android Application Development O'reilly MJAnddroid Example Code","<android><console><download><emulator>","2","0","1","",""
"2262313","1","","","2010-02-14 18:54:08","1","435","<p>I implemented a highscore list with a table, however this is cumbersome since all TextViews have their own id etc. Is there a widget/control which is more suitable for this purpose? I wanna show two columns. Both columns should have their column header.</p><p>Can you give me some recommendations on how to make this really an Android thingy?</p><p>Help is very much appreciated.</p><p>Jasper</p>","241217","","","","","2010-02-14 20:12:16","HighScore list gui problem","<android>","2","0","","",""
"2262412","1","2262502","","2010-02-14 19:22:03","2","3995","<p>its me again. I tried the last hours, how to change content of a spinner.ok, lets start from the beginning.</p><p>I have three spinners. They all have initial values. The first spinner is the main spinner and the other two spinners depend on the vale chosen in the first one. So i want to update the last two spinners after making a selection in spinner one. *edit: All spinners are on the same activity.</p><p>How can i achieve this? My problem is that i can only make changes in the spinners onitemselectadapter but thats a whole new class. I cannot reach the activity where my other spinners are.</p><p>thx</p>","268575","","268575","","2010-02-14 23:45:03","2010-03-25 17:53:56","Update content after selecting item in spinner","<android>","1","0","","",""
"2262670","1","2262812","","2010-02-14 20:39:44","7","511","<p>I have a textfield for a filter customers action on a mobile device.I am wondering if I should wait for a few milliseconds before launching my code when the user typed in less then 3 chars, and only execute the code if the text is longer or equal than 3 chars.</p><p>The executed code takes longer(sql like syntax on a larger database), and the user sees hang-outs on the listview.</p><p>What do you think?</p>","243782","","166712","","2010-02-14 20:52:28","2010-02-15 00:16:48","Is it worth waiting a couple of milliseconds on a TextChanged event?","<c#><iphone><android><windows-mobile><mobile>","5","0","1","",""
"2262753","1","2785653","","2010-02-14 21:03:10","1","1685","<p>I'm writing an AppWidget where I first have a configure screen where the user makes a selection. Then I want to pass that data on to the actual widget. This must be really simple but I just can't figure out how to do it.</p>","272736","","1692590","","2012-11-23 21:22:33","2012-11-23 21:22:33","Widget: Get data from configure Activity to AppWidgetProvider","<android>","2","0","","",""
"2263451","1","","","2010-02-15 00:27:13","0","979","<pre><code>public class Profile extends Activity{    WebView prof_webv;      private String selected_username;    private static final String INDEX = ""http://14.143.227.140"";public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    setContentView(R.layout.main);    prof_webv = (WebView) findViewById(R.id.mainwebview);    prof_webv.getSettings().setJavaScriptEnabled(true);    prof_webv.getSettings().setSupportZoom(false);    prof_webv.loadUrl(INDEX);}@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if ((keyCode == KeyEvent.KEYCODE_BACK) ) {        finish();        return true;    }    return super.onKeyDown(keyCode, event);}}</code></pre><p>This is my new Activity for a WebView. When the user clicks back, I simply want to close this Activity and return to my previous one. Notice, I put ""onKeyDown"" -> Finish.</p><p>However, it's not working.  Instead, I click ""back"", a blank white screen comes up.. (it doesn't even hit that onKeyDown Statement when I try to debug it)!</p><p>When I hit ""back"" <strong>the second time</strong>, then it will go back to my previous Activity.</p>","179736","","","","","2011-01-25 00:56:11","My main Activity launches a new Activity (WebView). It's just a page. But when I click the ""Back"" button...a white screen appears?","<java><android><webview><android-intent>","1","0","","",""
"2263579","1","","","2010-02-15 01:27:29","0","1380","<p>i got ListActivity, each item has 2 textviews image and CheckedTextView. i am trying to implement simple multichoiselist...i have two problems:1.</p><pre><code>     @Override      protected void onListItemClick(android.widget.ListView l, View v,        int position, long id)             {                ...              }</code></pre><p>doesnt respond at all ive tried it with the debugger and when i press on any list item it doesnt stop there. and ive tried all kind of things (like focusable:false)</p><p>two:.           i cant toggle the CheckedTextView anyhow.</p><p>here is my xml:</p><pre><code>            &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;       &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent"" android:layout_height=""100sp""android:focusable=""false"" android:focusableInTouchMode=""false""&gt;android:padding=""6dip""&gt;&lt;ImageView android:layout_width=""wrap_content""    android:layout_height=""fill_parent"" android:src=""@drawable/icon""    android:id=""@drawable/icon"" android:layout_marginLeft=""6dip""    android:focusable=""false"" android:focusableInTouchMode=""false""&gt;&lt;/ImageView&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""    android:orientation=""vertical"" android:layout_width=""1sp""    android:layout_height=""fill_parent"" android:layout_weight=""1""    android:focusable=""false"" android:focusableInTouchMode=""false""&gt;    &lt;TextView android:id=""@+id/toptext"" android:layout_weight=""1""        android:gravity=""center_vertical"" android:text=""OrderNum""        android:singleLine=""true"" android:layout_height=""0dp""        android:layout_width=""wrap_content"" android:focusable=""false""        android:focusableInTouchMode=""false""&gt;    &lt;/TextView&gt;    &lt;TextView android:id=""@+id/bottomtext"" android:layout_height=""wrap_content""        android:layout_width=""wrap_content"" android:focusable=""false""        android:focusableInTouchMode=""false"" android:text=""TweetMsg""&gt;    &lt;/TextView&gt;    &lt;TextView android:id=""@+id/twittLocation""        android:layout_weight=""1"" android:text=""location"" android:singleLine=""true""        android:layout_width=""fill_parent"" android:layout_height=""0dip""        android:focusable=""false"" android:focusableInTouchMode=""false""&gt;    &lt;/TextView&gt;    &lt;TextView android:layout_weight=""1"" android:id=""@+id/twittLocationlink""        android:text=""locationlink"" android:gravity=""fill_horizontal""        android:layout_width=""fill_parent"" android:layout_height=""0dip""        android:focusable=""false"" android:focusableInTouchMode=""false""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;CheckedTextView android:id=""@android:id/text1""  android:text=""Delete""    android:layout_width=""wrap_content"" android:layout_marginRight=""2dp""    android:layout_height=""fill_parent""    android:checkMark=""?android:attr/listChoiceIndicatorMultiple""    android:focusable=""false""&gt;&lt;/CheckedTextView&gt;&lt;/LinearLayout&gt;</code></pre><p>any idea what's the problem?thanks.</p>","260511","","","","","2012-07-31 09:33:53","onListItemClick and CheckedTextView not respoding","<android>","1","4","","",""
"2263913","1","","","2010-02-15 03:23:08","1","3534","<p>I am writing a program and I am able to get the light sensor value and current battery level, but only the light value changes and when the battery level changes.  Is there a way to get these two values anytime?  Like when a user runs my program, I would like to grab the current values right away instead of having to wait for them to change.</p>","273213","","","","","2013-10-15 21:51:25","How to get light sensor value and battery level anytime for android?","<android><battery><sensor>","2","0","1","",""
"2264038","1","","","2010-02-15 04:27:31","2","1447","<p>I'm trying to create an application for Android that uses encryption to save user information and I cannot figure out what I'm doing wrong. I'm trying to create an instance of an AES cipher but the application keeps on throwing ""InvalidKeyExceptions."" Consider the following code:</p><pre><code>public static final byte[] IV = new byte[]{ 0x04, 0x08, 0x15, 0x16, 0x23, 0x42, 0x00, 0x00, 0x00, 0x00,0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};protected final IvParameterSpec params = new IvParameterSpec(IV);protected Cipher myCipher;public AESEncryptor(String passwd, InputStream source, String destinationFile){    try    {                   myCipher = Cipher.getInstance(""AES/CBC/PKCS5Padding"");        Log.d(""System.out.println"", ""Block Size: ""+myCipher.getBlockSize());        myCipher.init(Cipher.ENCRYPT_MODE, AESEncryptor.generateSecretKeyFromPassword(passwd),params);    }    catch (Exception e)    {        e.printStackTrace();    }}</code></pre><p>I get this exception:</p><blockquote>  <p>java.security.InvalidKeyException:  initialisation vector must be the same  length as block size..</p></blockquote><p>The myCipher.init(...) line triggers this exception.</p><p>I understand what it's saying but according to myCipher.getBlockSize() the IV byte array should hold 16 bytes, and it does, but it doesn't work. I have also tried byte arrays of length 0-128, and nothing in that range works either. </p><p>Oh also, if I take this code, unaltered, and add it to a regular Java application, I get no errors. Compiling for Android seems to be causing this error.</p><p>Please help.Thanks,Ryan</p>","272302","","","","","2010-02-17 04:18:48","Android Cipher problems. InvalidKeyException?","<java><android><encryption>","1","2","0","",""
"2264042","1","2264102","","2010-02-15 04:29:50","0","899","<p>I want to transfer a file into android dev's SD memory and read the file for parsing it.But i don't know how to transfer a file into the emulators SD Card.</p><p>Also I don't know which api is to be used to browse for the file from the application.This app provides the user to show it where he has kept the file which the app has to parse.Which api does android provide for file management using a UI.</p><p>Please help.Thanks in advance.</p>","132347","","","","","2010-02-15 05:00:45","How to select a file from android memory to do some action on it","<android><file><file-upload>","1","0","","",""
"2264051","1","2264791","","2010-02-15 04:33:06","2","316","<p>i have developed the android application screen resolution is 320x480 Px but i want to run same application without any code modification with Droid Mobile(480x854 px).</p><p>i have installed android application with droid mobile but it's displaying only half of the page in droid mobile( i am using the android 2.0 SDK device).</p><p>is there any way to resolve this kind of issues?</p><p>Regards,Jeyavel N</p>","212809","","","","","2010-02-16 09:49:29","How to match android application with droid mobile?","<android><android-emulator><android-widget>","1","1","","",""
"2264072","1","","","2010-02-15 04:50:35","39","53176","<p>How can you detect that a user swiped his finger in some direction over a web page with JavaScript?</p><p>I was wondering if there was one solution that would work for websites on both the iPhone and an Android phone.</p>","175798","","","","","2014-03-25 18:17:26","Detect a finger swipe through JavaScript on the iPhone and Android","<javascript><iphone><android><swipe>","6","0","9","",""
"2264350","1","2264832","","2010-02-15 06:34:23","0","2165","<p>i have created the launcher icon(48x48 px) for 320x480 screen resolution and it's working fine. but while using same icon in WVGA854(480x854 px) it's displaying small compare to other default launcher icon.</p><p>i want to know, what is the size of High Density WVGA854 launcher icon? </p><p>Regards,Jeyavel N</p>","212809","","","","","2010-02-15 09:02:55","what is the size of High Density WVGA854 launcher icon?","<android><android-widget>","1","0","1","",""
"2264502","1","","","2010-02-15 07:33:22","0","2149","<p>This not work:</p><pre><code>try {    Context mmsContext = context.createPackageContext(""com.android.mms"", Context.CONTEXT_IGNORE_SECURITY);    mmsContext.grantUriPermission(context.getPackageName(),     Uri.parse(""file:///data/data/com.android.mms/shared_prefs/com.android.mms_preferences.xml""),     Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);    SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(mmsContext);    Editor editor = settings.edit();    editor.putBoolean(""pref_key_enable_notifications"", false);    editor.commit();} catch (NameNotFoundException e1) {    e1.printStackTrace();}</code></pre><p>Error: ""Attempt to read preferences file /data/data/com.android.mms/shared_prefs/com.android.mms_preferences.xml without permission""Help, please!</p>","273295","","","","","2010-09-13 14:43:59","How to disable SMS notification programmatically?","<java><android>","2","0","","",""
"2264528","1","","","2010-02-15 07:41:04","0","1374","<p>We've a mpeg4 source that we would like to play in the media player. Our source is not in a file or on an rtsp server. It is hand coded to generate mpeg4 source on the fly. Imagine the data is coming from an unix pipe stream instead of rtsp or a file. How can I use that stream in media player?</p>","","user273291","574131","","2011-08-26 09:28:53","2011-12-21 11:07:47","How to play media player with non-file and non-rtsp source?","<android><media-player><rtsp><mpeg>","2","0","","",""
"2264572","1","2276682","","2010-02-15 07:53:55","5","1129","<p>I'm trying to do some testing with a QVGA emulator and I find that it looks for an image resource in the mentioned order.</p><p>drawable-mdpi 1st<br/>drawable-hdpi 2nd<br/>drawable-ldpi 3rd<br/>(it does get found only after I change the name of the image in the other two dirs for testing)</p><p>I would expect it to be ldpi first.</p><p>When running other emulators (HVGA and WVGA) they use their appropriate drawable dirs... it's only QVGA. The only code that I see could affect this is here (based on the docs)</p><p></p><p>I have tested this with a 2.0 emulator and a 1.6, I get the same result.</p><p>Any ideas? Thank you very much.</p>","273312","","703019","","2012-03-06 02:06:35","2012-03-06 02:06:35","Why is Android looking for QVGA resources in the wrong order mdpi > hdpi > ldpi?","<android><resources><resolution>","2","0","1","",""
"2264622","1","","","2010-02-15 08:05:07","47","34871","<p>I've been working on Android program to send email with an attachment (image file, audio file, etc) using Intent with <code>ACTION_SEND</code>. The program is working when email has a single attachment. I used <code>Intent.putExtra(android.content.Intent.EXTRA_STREAM, uri)</code> to attach the designated image file to the mail and it is working fine, the mail can be delivered through the Gmail. However, when I tried to have multiple images attached to the same mail by calling <code>Intent.putExtra(android.content.Intent.EXTRA_STREAM, uri)</code> multiple times, it failed to work. None of the attachment show up in the email.  </p><p>I searched the SDK documentation and Android programming user group about email attachment but cannot find any related info. However, I've discovered that there's another intent constant <code>ACTION_SEND_MULTIPLE</code> (available since API level 4) which might meet my requirement.  Based on SDK documentation, it simply states that it deliver multiple data to someone else, it works like <code>ACTION_SEND</code>, except the data is multiple. But I still could not figure out the correct usage for this command. I tried to declare intent with <code>ACTION_SEND_MULTIPLE</code>, then  call <code>putExtra(EXTRA_STREAM, uri)</code> multiple times to attach multiple images, but I got the same erroneous result just like before, none of the attachment show up in the email.  </p><p>Has anyone tried with <code>ACTION_SEND_MULTIPLE</code> and got it working with multiple email attachment?</p>","273321","","648313","","2011-10-07 11:56:24","2013-12-06 20:18:31","Android multiple email attachments using Intent","<android><email><android-intent><attachment>","4","1","37","",""
"2264626","1","2264736","","2010-02-15 08:05:42","0","1657","<p>I need to obtain time from my AnalogClock as a String and pass it as argument in a method. Wonder whats the method of AnalogClock to return current Time.</p><p>Thank you.</p>","2355649","","21234","","2010-02-15 08:07:23","2011-04-20 07:46:17","How to return time from AnalogClock/DigitalClock in Android","<android><clock>","2","1","","",""
"2264789","1","","","2010-02-15 08:52:03","1","232","<p>In my application I write the code for fetching latitude and longitude of current location.  But it is frequently changing while my device is not moving.</p><p>How can I resolve this problem?</p>","271694","","23897","","2010-02-15 08:59:42","2010-02-15 08:59:42","How to resolve frequent changes in latitude and longitude","<android><gps>","1","0","","",""
"2264799","1","","","2010-02-15 08:56:19","0","1829","<p>I have next situation:After installing application it has to init settings from server. And while itis not has right preferences it has to wait. I have several receivers and service - I dont want to check for initialization in every action in these components - I think there have to be better solution. Can somebody help me with it? :)</p>","263321","","45935","","2010-02-26 06:07:33","2010-02-26 06:33:42","Android - first run preference initialization","<java><android>","3","0","","",""
"2264818","1","2264857","","2010-02-15 08:59:37","4","732","<p>I get about 50 of these coming from my users each day.</p><p>I realise that this is a Motorola Droid bug - <a href=""http://code.google.com/p/android/issues/detail?id=5164"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=5164</a></p><p>Is there anyway I can catch this error in my code?</p>","248521","","","","","2011-06-20 12:41:25","Handling that annoying ""java.lang.IndexOutOfBoundsException: getChars (5 ... 0) has end before start"" bug","<android><android-widget>","1","0","","",""
"2264851","1","","","2010-02-15 09:05:39","0","1422","<p>I've developed a GPS app in which i record the user routes and show it on the map.  But panning around on the map when reviewing my route is painfully slow, it takes at least 4 or 5 seconds for the map to respond the finger swipes.</p><p>I've overridden the onDraw() method and drawing the lines to show the routes whenever we zoom on the map, the lat-long is again drawn by calling onDraw()(Overridden) method, which has the geopoints with lat-lon values, and thus it becomes very slow to display the map. Is there any better way to do this so that panning becomes faster as in the application ""MyTracks""?</p><p>Following is the code to draw the routes on map.  Please look into it and show me how I can make it more efficient so that the panning and zooming works well.</p><pre><code>class PathOverlay extends Overlay{  public PathOverlay() {        // TODO Auto-generated constructor stub        geopoints=new ArrayList&lt;GeoPoint&gt;();        c.moveToFirst();        for (int i = 0; i &lt;c.getCount() ; i++){            if(c.getDouble(c.getColumnIndex(""latitude"")) != 0.0 ||                    c.getDouble(c.getColumnIndex(""longitude""))!=0.0) {                geopoints.add(getPoint(c.getDouble(c.getColumnIndex(""latitude""))                        , c.getDouble(c.getColumnIndex(""longitude""))));                gps_status.add(Boolean.parseBoolean(c.getString(c.getColumnIndex(""gps"") )));                avgeSpeed_points.add(c.getFloat(9));            }            c.moveToNext();        }    }    private GeoPoint getPoint(double lat, double lon) {        return(new GeoPoint((int)(lat*1000000.0),(int)(lon*1000000.0)));    }    @Override    public void draw(Canvas canvas, MapView mapView, boolean shadow) {    //  super.draw(canvas, mapView, shadow);        mapView.getDrawingCache();        Paint paint_Line=new Paint();        //paint_Line.setColor(Color.RED);        paint_Line.setARGB(255, 255, 0, 0);        paint_Line.setStrokeWidth(3);        paint_Line.setDither(true);        paint_Line.setStyle(Style.FILL);        paint_Line.setAntiAlias(true);        paint_Line.setStrokeJoin(Paint.Join.ROUND);        paint_Line.setStrokeCap(Paint.Cap.ROUND);        mapView.postInvalidateDelayed(6000);        for(int i=0;i&lt;geopoints.size()-1;i++) {            Point p1=new Point();            Point p2=new Point();            if((geopoints.get(i).getLatitudeE6()!=geopoints.get(i+1).getLatitudeE6())                    &amp;&amp; (geopoints.get(i).getLongitudeE6()!=geopoints.get(i+1).getLongitudeE6())                    &amp;&amp; gps_status.get(i+1)){            paint_Line.setColor(Color.BLUE);            mapView.getProjection().toPixels(geopoints.get(i), p1);            mapView.getProjection().toPixels(geopoints.get(i+1),p2);            canvas.drawLine(p1.x,p1.y,p2.x,p2.y,paint_Line);           }                mapView.getProjection().toPixels(geopoints.get(i),p1);            if(i==0){                canvas.drawBitmap(start, p1.x-2, p1.y-start.getHeight()+2, null);            }            if (i+1==geopoints.size()-1) {                canvas.drawBitmap(finish, p1.x-2, p1.y-finish.getHeight()+2, null);            }           }    }}</code></pre>","143434","","23897","","2010-02-15 09:11:49","2010-05-16 16:00:06","Zooming on android dev - google maps becomes slower","<android><google-maps><zoom>","1","0","1","","2010-02-15 09:05:39"
"2264869","1","2267593","","2010-02-15 09:11:48","0","501","<p>I've got a widget on the Android market called DigiClock widget, and after the last update i've been having some extremely rare and random problems on rooted Motorola Droids ( there may be other handsets with the problem, but the only responses i've had are from rooted droid users ). The problem occurs when an activity is launched that runs an AsyncTask that retrieves all the installed applications from the device while showing a ProgressDialog ( Horizontal style ). The applicable java code file can be found here:</p><p><a href=""http://code.google.com/p/android-digiclockwidget/source/browse/trunk/src/com/davidgoemans/simpleClockWidget/LauncherChooser.java"" rel=""nofollow"">http://code.google.com/p/android-digiclockwidget/source/browse/trunk/src/com/davidgoemans/simpleClockWidget/LauncherChooser.java</a></p><p>If you wish to diff the changes made between a working and non-working version, that can be found here:</p><p><a href=""http://code.google.com/p/android-digiclockwidget/source/diff?spec=svn10&amp;old=7&amp;r=9&amp;format=side&amp;path=/trunk/src/com/davidgoemans/simpleClockWidget/LauncherChooser.java"" rel=""nofollow"">http://code.google.com/p/android-digiclockwidget/source/diff?spec=svn10&amp;old=7&amp;r=9&amp;format=side&amp;path=/trunk/src/com/davidgoemans/simpleClockWidget/LauncherChooser.java</a></p><p>What seems to happen on the droid is:* Progress box pops up* Progress box dismisses before it's finished running* Empty list shows up</p><p>It seems like the AsyncTask that fetches the applications is getting killed. Is this possible?</p><p>Thanks,David</p><p><strong>EDIT</strong>:</p><p>Found the problem, turns out that in Android 2.0 ( NOT 2.1 or 1.6 )</p><p>List packages = getPackageManager().getInstalledPackages(PackageManager.GET_ACTIVITIES);</p><p>crashes in my situation, but</p><p>List packages = getPackageManager().getInstalledPackages(0);</p><p>doesn't.</p>","25893","","25893","","2010-02-15 17:06:02","2010-02-15 17:31:38","Problem with AsyncTask on rooted Droid","<java><android><root>","2","2","","",""
"2264874","1","2271141","","2010-02-15 09:13:56","91","70041","<p>My users can change the Locale within the app (they may want to keep their phone settings in English but read the content of my app in French, Dutch or any other language ...)</p><p>Why is this working perfectly fine in 1.5/1.6 but NOT in 2.0 anymore ???</p><pre><code>@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch(item.getItemId()) {    case 201:        Locale locale2 = new Locale(""fr"");         Locale.setDefault(locale2);        Configuration config2 = new Configuration();        config2.locale = locale2;        getBaseContext().getResources().updateConfiguration(            config2, getBaseContext().getResources().getDisplayMetrics());        // loading data ...        refresh();        // refresh the tabs and their content        refresh_Tab ();        break;     case 201: etc...</code></pre><p>The problem is that the MENU ""shrinks"" more and more everytime the user is going through the lines of code above ... </p><p>This is the Menu that gets shrunk:</p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    menu.add(0, 100, 1, ""REFRESH"").setIcon(android.R.drawable.ic_menu_compass);    SubMenu langMenu = menu.addSubMenu(0, 200, 2, ""NL-FR"").setIcon(android.R.drawable.ic_menu_rotate);        langMenu.add(1, 201, 0, ""Nederlands"");        langMenu.add(1, 202, 0, ""Français"");    menu.add(0, 250, 4, R.string.OptionMenu2).setIcon(android.R.drawable.ic_menu_send);    menu.add(0, 300, 5, R.string.OptionMenu3).setIcon(android.R.drawable.ic_menu_preferences);    menu.add(0, 350, 3, R.string.OptionMenu4).setIcon(android.R.drawable.ic_menu_more);    menu.add(0, 400, 6, ""Exit"").setIcon(android.R.drawable.ic_menu_delete);    return super.onCreateOptionsMenu(menu);}</code></pre><p>What should I do in API Level 5 to make this work again ?</p><p>HERE IS THE FULL CODE IF YOU WANT TO TEST THIS :</p><pre><code>import java.util.Locale;import android.app.Activity;import android.content.res.Configuration;import android.os.Bundle;import android.view.Menu;import android.view.MenuItem;import android.view.SubMenu;import android.widget.Toast;public class Main extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    @Override    public boolean onCreateOptionsMenu(Menu menu) {        SubMenu langMenu = menu.addSubMenu(0, 200, 2, ""NL-FR"").setIcon(android.R.drawable.ic_menu_rotate);            langMenu.add(1, 201, 0, ""Nederlands"");            langMenu.add(1, 202, 0, ""Français"");        return super.onCreateOptionsMenu(menu);    }    @Override    public boolean onOptionsItemSelected(MenuItem item) {        switch(item.getItemId()){        case 201:            Locale locale = new Locale(""nl"");             Locale.setDefault(locale);            Configuration config = new Configuration();            config.locale = locale;            getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());            Toast.makeText(this, ""Locale in Nederlands !"", Toast.LENGTH_LONG).show();            break;        case 202:            Locale locale2 = new Locale(""fr"");             Locale.setDefault(locale2);            Configuration config2 = new Configuration();            config2.locale = locale2;            getBaseContext().getResources().updateConfiguration(config2, getBaseContext().getResources().getDisplayMetrics());            Toast.makeText(this, ""Locale en Français !"", Toast.LENGTH_LONG).show();            break;          }        return super.onOptionsItemSelected(item);    }}</code></pre><p>AND HERE IS THE MANIFEST :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""          package=""com.cousinHub.ChangeLocale""          android:versionCode=""1""          android:versionName=""1.0""&gt;        &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;            &lt;activity android:name="".Main""                      android:label=""@string/app_name""&gt;                &lt;intent-filter&gt;                    &lt;action android:name=""android.intent.action.MAIN"" /&gt;                    &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;                &lt;/intent-filter&gt;            &lt;/activity&gt;        &lt;/application&gt;        &lt;uses-sdk android:minSdkVersion=""3"" /&gt;     &lt;/manifest&gt;</code></pre><p><strong>THIS IS WHAT I FOUND :</strong></p><pre><code>&lt;uses-sdk android:minSdkVersion=""5"" /&gt;</code></pre><p>=> IT WORKS JUST FINE ...</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" /&gt;</code></pre><p>=> Menu shrinks every time you change the locale !!!</p><p>as I want to keep my application accessible for users on 1.5, what should I do ??</p>","116573","","356895","","2014-03-18 09:01:29","2014-03-18 09:01:29","Changing Locale within the app itself","<android><menu><locale>","6","5","108","",""
"2264888","1","2264905","","2010-02-15 09:17:37","1","82","<p>What should I look at to get started?</p><p>Is it Timer? <a href=""http://developer.android.com/reference/java/util/Timer.html"" rel=""nofollow"">http://developer.android.com/reference/java/util/Timer.html</a></p><p>Or am I missing something else?</p>","179736","","","","","2010-02-15 09:23:38","I want my app to run things in the background, even when the user is donig other things on his Android","<java><android>","1","0","","",""
"2264980","1","","","2010-02-15 09:40:07","10","5078","<p>I get the Failed binder transaction error in the logcat when returning the image taken with the camera from the camera intent back to the parent intent (as a byte[] using putExtra). I don't understand why, its not like its a big bitmap or anything. It only happens when i take pictures with lots of light, because then the byte[] is bigger. The error occurs when leaving the camera intent. Does anyone see a mistake in my code? </p><p>Here is the code of the camera intent:</p><pre><code>package example.imaging.ape;import java.io.IOException;import java.util.Iterator;import java.util.Set;import android.app.Activity;import android.content.Intent;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.PixelFormat;import android.hardware.Camera;import android.hardware.Camera.AutoFocusCallback;import android.os.Bundle;import android.util.Log;import android.view.MotionEvent;import android.view.SurfaceHolder;import android.view.SurfaceView;import android.view.View;import android.view.Window;import android.view.WindowManager;import android.view.View.OnTouchListener;public class TakePicture extends Activity implements SurfaceHolder.Callback{     Camera mCamera;     Boolean mPreviewRunning = false;     int imageLayoutHeight;     int imageLayoutWidth;     @Override     public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          //setup camera surface          getWindow().setFormat(PixelFormat.TRANSLUCENT);          requestWindowFeature(Window.FEATURE_NO_TITLE);          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);          setContentView(R.layout.cameralayout);          SurfaceView mSurfaceView = (SurfaceView) findViewById(R.id.hist_surface_camera);          SurfaceHolder mSurfaceHolder = mSurfaceView.getHolder();          mSurfaceHolder.addCallback(this);          mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);          Bundle extras = getIntent().getExtras();          imageLayoutHeight = extras.getInt(""layoutHeight"");          imageLayoutWidth = extras.getInt(""layoutWidth"");          OnTouchListener touchListener = new View.OnTouchListener() {               public boolean onTouch(View v, MotionEvent e) {                    System.out.println(""MAKING PICTURE"");                    mCamera.autoFocus(cb);                                 return false;               }          };          //setup touch listener          mSurfaceView.setOnTouchListener(touchListener);     }     AutoFocusCallback cb = new AutoFocusCallback() {          public void onAutoFocus(boolean success, Camera c) {               c.takePicture(null, null, mPictureCallback);          }        };     Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() {          public void onPictureTaken(byte[] imageData, Camera c) {               System.out.println(""Picture taken, now returning"");                             Intent resultIntent = new Intent();               resultIntent.putExtra(""cameraImage"", imageData);               System.out.println(""put Extra"");               setResult(Activity.RESULT_OK, resultIntent);               finish();                     }     };     //initialize camera     public void surfaceCreated(SurfaceHolder holder) {          mCamera = Camera.open();     }     public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {          if (mPreviewRunning) {               mCamera.stopPreview();          }          Camera.Parameters p = mCamera.getParameters();          p.setPreviewSize(h, w);          System.out.println(""PreviewSize: "" + h + "","" + w);          p.setPictureSize(h*3,w*3); // is around 1200x900          p.set(""rotation"", 90);          mCamera.setParameters(p);          try {               mCamera.setPreviewDisplay(holder);          } catch (IOException e) {               e.printStackTrace();          }          mCamera.startPreview();          mPreviewRunning = true;     }     public void surfaceDestroyed(SurfaceHolder holder) {          mCamera.stopPreview();          mPreviewRunning = false;          mCamera.release();     }}</code></pre><p>And here is the code that calls the camera intent:</p><pre><code>Intent intent = new Intent(Example.this, TakePicture.class);intent.putExtra(""layoutWidth"",layoutWidth);intent.putExtra(""layoutHeight"",layoutHeight);                   startActivityForResult(intent,0);</code></pre>","273382","","140176","","2010-02-15 09:42:18","2012-12-03 06:40:18","Failed Binder Transaction when returning camera image","<android>","3","1","1","",""
"2264986","1","2265450","","2010-02-15 09:41:14","0","10012","<p>i have to set the simpleCursorAdapter into a listView.</p><p>how can i achieve that?</p><p>thanks.</p>","267269","","","","","2012-07-03 14:29:24","how to set the simplecursoradapter to a listview in android?","<android><android-widget>","2","0","","",""
"2264992","1","","","2010-02-15 09:42:19","-1","440","<p>How can I remove private data (such as contacts, calendar items and media) from an Android phone programatically?</p>","273376","","122607","","2012-02-07 18:44:50","2012-02-07 18:44:50","Removing private data from an Android phone programatically","<android>","1","0","1","2012-02-08 16:25:18",""
"2265003","1","","","2010-02-15 09:44:29","0","144","<p>I want to create a program. Part of its gui is similar to mindmapping or yahoo-pipes (you got the idea). And I want to be able to port this program to Windows, Linux and Android (don't really care about Macs).</p><p>So can you help me to choose a cross-platform library for drawing and operating such GUI?</p><p>I haven't chosen the language yet. I prefer .NET, but there can be problems with cross-platforming (have anyone tried android-mono?). Sometime I do C/C++, so it's also an option; I'm learning Erlang now, so if there is something brilliant for Erlang, I'd like to hear about it.</p><p>I understand that Android is mainly Java platform, so I'm ready to implement everything for PCs in C# or whatever language and then, with that experience, write a port to Android in Java (or participate in androidmono :).</p><p>Thanks.</p>","145357","","","","","2010-04-09 10:34:47","engine for cross-platform layouts like these ones for mindmapping","<android><layout><cross-platform><mindmapping>","1","0","","",""
"2265020","1","","","2010-02-15 09:47:26","14","9783","<p>I created a new class called HelloService.I added this to the Android manifest.xml.</p><pre><code>public class HelloService extends Service {    private Timer timer = new Timer();    private long INTERVAL = 5000;    public void onCreate() {        super.onCreate();        startservice();    }    private void startservice() {        timer.scheduleAtFixedRate( new TimerTask() {            public void run() {                Log.d(""servy"", ""This proves that my service works."");            }        }, 0, INTERVAL);    ; }    private void stopservice() {        if (timer != null){            timer.cancel();        }    }    @Override    public IBinder onBind(Intent arg0) {        return null;    }}</code></pre><p>My other activity calls it like this:</p><pre><code>    Intent helloservice = new Intent(this, HelloService.class);    startService(helloservice);</code></pre><p>For some reason, I put a breakpoint in my new HelloService...but it's not even hitting.  It's not logging either.</p><p><strong>Edit:""Unable to start service Intent { cmp = com.examples.hello/.HelloService }: not found""</strong> </p><p>What does that mean? ... I created HelloService.java in the same place as everything else...</p><hr><p>Solved. I fixed my manifest file.Thanks Nikola Smiljanic</p><pre><code>&lt;service android:name="".HelloService""/&gt;</code></pre><p>to:</p><pre><code>   &lt;service android:name=""HelloService""&gt;&lt;/service&gt;</code></pre>","179736","","10936","","2011-07-18 10:13:22","2012-09-09 13:11:41","Why doesn't my Service work in Android? (I just want to log something ever 5 seconds)","<java><android><service><timer>","5","4","4","",""
"2265089","1","2265447","","2010-02-15 09:56:46","15","13026","<p>I've written a game for Android, and I've tested it on the Dev Phone 1.  It works perfectly, the speed is just right.  However, I'm sure phone CPU's are getting faster.  They may already be faster than the dev phone.</p><p>How do I make sure that my game runs at the exact same speed no matter what the device or how fast it runs?  Do you know of any techniques?  Should I check some kind of timer at the top of the loop each time?</p><p>I guess I'm referring to frame rate - but mostly the speed at which my game runs through the main game loop.</p><p>Any theory or experience would be great!  Thank you.</p>","179518","","","","","2010-02-15 11:06:48","Android game loop, how to control speed and frame rate","<android><cpu-speed>","1","1","10","",""
"2265127","1","2265204","","2010-02-15 10:02:55","0","1137","<p>i want to read file in dialog</p><p>can any one guide me how to achieve this?</p><p>when i use </p><p>SharedPreferences preferences = getSharedPreferences(PREF_FILE_NAME, MODE_PRIVATE);in dialog it gives me error ""method is undefined""</p>","249991","","","","","2011-11-08 23:34:25","how to getSharedPreferences in dialog?","<android><dialog>","2","0","","",""
"2265217","1","2265228","","2010-02-15 10:20:16","0","2339","<pre><code>Intent helloservice = new Intent(this, HelloService.class);startService(helloservice);...stopService(helloservice);</code></pre><p>Why won't this work?  It just keeps running.  Am I missing some Binds or something?</p><p>By the way, this is my service:</p><pre><code>public class HelloService extends Service {    private Timer timer = new Timer();    private long INTERVAL = 1000;    public void onCreate() {        super.onCreate();        startservice();    }    private void startservice() {        timer.scheduleAtFixedRate( new TimerTask() {            public void run() {                Log.d(""service"", ""This proves that my service works."");            }        }, 0, INTERVAL);    ; }    @Override    public IBinder onBind(Intent arg0) {        return null;    }}</code></pre>","179736","","","","","2010-02-15 10:52:13","Why can't I stop a service in Android?","<java><android><service><debugging>","2","0","","",""
"2265220","1","","","2010-02-15 10:20:20","4","2379","<p>If I want to create custom address book (which overrides my phone's default address book), and if I want it to be used by <strong>all</strong> applications, what should be my <code>intent-filter</code>? Does Android allow me to do such a thing considering the fact that such a third-party app could potentially be malicious?! </p><p>And, if I want to have yet another address book application, I suppose the second app also has same <code>intent-filter</code>, isn't it? How does the framework decide which app to pick if I click on Contacts button when making a call? In other words, how does the framework resolve intents in case,there is a conflict between multiple <code>intent-filters</code>?</p>","273397","","683261","","2012-01-30 09:20:12","2012-01-30 09:20:12","Intent resolution in Android","<android><android-intent><conflict>","2","0","0","",""
"2265486","1","","","2010-02-15 11:15:21","2","4079","<p>I want to play music from an online mp3 link.</p><p>I am reading the music data into a stream and trying to play it using audio track.</p><p>But it's giving only noise. I can't hear any music</p><p>This is my code.</p><pre><code>int  intSize = android.media.AudioTrack.getMinBufferSize(8000,                    AudioFormat.CHANNEL_CONFIGURATION_MONO,                    AudioFormat.ENCODING_PCM_16BIT);AudioTrack oTrack = new AudioTrack(AudioManager.STREAM_MUSIC, 8000,                    AudioFormat.CHANNEL_CONFIGURATION_MONO,                    AudioFormat.ENCODING_PCM_16BIT, intSize,                    AudioTrack.MODE_STREAM);oTrack.play();oTrack.write(buffer, 0, buffer.length);</code></pre><p>Here buffer is the audio data I am reading into.</p><p>Same buffers I can play in MediaPlayer, but I could not play in audiotrack.</p><p>What could I be doing wrong?</p>","270246","","11410","","2011-09-15 08:48:07","2012-06-19 23:14:26","playing audio from audio track in android","<android><audio>","2","1","1","",""
"2265502","1","2265549","","2010-02-15 11:17:46","1","2099","<p>I read some tutorials online, and found that LocationManager does this.This is the code I found online.  However, I don't get it.  Why can't I just get the long/lat? Why go through all the ""change"" location things...</p><pre><code>lm=(LocationManager)this.getSystemService(LOCATION_SERVICE);  lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 10, 10, new LocationListener(){        @Override        public void onLocationChanged(Location location) {                                       Log.d(""a"",""onLocationChanged: lat=""+location.getLatitude());             Log.d(""a"",""onLocationChanged: lat=""+location.getLongitude());                         }        @Override        public void onProviderDisabled(String provider) {             Log.d(""a"",""onProviderDisabled: "" +provider);          }        @Override        public void onProviderEnabled(String provider) {             Log.d(""a"",""onProviderEnabled: "" +provider);        }        @Override        public void onStatusChanged(String provider, int status,Bundle extras) {             Log.d(""a"",""onStatusChanged: "" +provider + status);           }    }); </code></pre><p>By the way, this code doesn't work.  When I run it in a timer...nothing happens. Nothing gets logged. I just want the longitude latitude!! </p>","179736","","30316","","2010-02-15 11:54:40","2010-02-22 10:42:26","How can I get longitude, latitude of phone in Android?","<java><android><gps><location>","1","0","","",""
"2265608","1","4223262","","2010-02-15 11:39:27","1","1127","<p>I got a huge problem with the Android Development Tools ADT running in Eclipse Galileo (3.5.1) on Ubuntu 9.10, 64bit.<br><strong>[Edit: as well on Ubuntu 10.10 and Eclipse Helios up to the latest 3.6.2!]</strong></p><p>On this platform, I do not manage to see any property edit dialogs for layout properties. E.g. the one where you can select a string resource ID for text fields, or a drawable ID for image fields or backgrounds.</p><p>Whenever I click on the <code>...</code> button next to the property value - nothing happens, except this button disappears.Properties with a list of possible values, e.g. ""wrap_content"" or ""fill_parent"" are displayed in a dropdown box directly in the properties field.</p><p>On a different system I work in a Windows environment with Eclipse 3.4 and the same ADT: no problems whatsoever, everything works fine, the dialogs come perfectly.</p><p>Does anyone know what to do here? Where's the problem? Why does Eclipse not tell me that something goes wrong?</p><p>Thanks!</p><p><strong>NEW DISCOVERIES:</strong> I found out that it might not even be an Android problem, but a general Eclipse problem that I can see with <strong>all</strong> version (Ganymede, Galileo, Helios) on my Linux (Ubuntu) system. It must be a simple UI problem: the button with <code>...</code> next to the values does not receive the mouse click!! I managed to see the appropriate dialogs to edit the property values by <strong>doubleclicking</strong> the button - crazy, strange, ugly behavior! But why on earth does nobody else know about this problem - I cannot find anything else on the net about it! Could it be related to this strange ""GDK native window problem"" on Gnome? HELP!</p>","273456","","273456","","2011-03-02 15:28:18","2011-03-02 15:28:18","Android Plugin in Eclipse 3.5 / 3.6 on Ubuntu 64bit got problems with properties","<android><linux><eclipse-plugin><gnome>","2","2","","",""
"2265661","1","2265712","","2010-02-15 11:48:50","41","48121","<pre><code>ArrayList&lt;MyClass&gt; myList = new ArrayList&lt;MyClass&gt;();ListView listView = (ListView) findViewById(R.id.list);ArrayAdapter&lt;MyClass&gt; adapter = new ArrayAdapter&lt;MyClass&gt;(this, R.layout.row,    to, myList.);listView.setAdapter(adapter);</code></pre><h2>Class: MyClass</h2><pre><code>class MyClass {    public String reason;    public long long_val;}</code></pre><p>I have created row.xml in layouts, but don't know how to show both reason and long_val in the ListView using ArrayAdapter.</p>","132347","","61654","","2013-03-23 17:25:13","2014-02-05 12:42:55","How to use ArrayAdapter<myClass>","<android><arraylist>","5","0","23","",""
"2265765","1","","","2010-02-15 12:06:57","1","207","<p>I'm trying to port a CLI app to Android. This app depends on several dynlibs which we already ported, but haven't tested yet. We built an .apk that provides an simple app, the libs and the executable. The app opens the .apk, extracts the libs and the executable and that's it. We took all this ideas from the Mono port to Android[3]. We also copied their way to run such an app: as the linker only loads libs from <code>/lib</code> (which doesn't exist) and <code>/system/lib</code> (which is in a read-only partition), we have to <code>ldopen()</code> the dynlibs by hand. This works if we compile the libs and app for Linux.</p><p>Under the Android cupcake emulator we get this error:</p><pre><code>bionic/linker/linker.c:1126| ERROR:  2112 cannot locate '(null)'...bionic/linker/linker.c:1641| ERROR: failed to link /data/data/fr.inria.hop/lib/libbigloogc-3.3b.so</code></pre><p>All of this, of course, has been compiled with the compilers that are provided with Android's source code[1][3], so the resulting libs should be correct. Given the nature of the dynlibs we cannot use (yet?) the NDK infrastructure to compile dynlibs and executables[2], so we had to rely on <a href=""http://github.com/tmurakam/droid-wrapper/"" rel=""nofollow"">this wrapper</a>.</p><p>As for the error above, I found in <code>vprintf()</code>'s code that that's the way to represent string parameters whose pointer is actually <code>NULL</code>. This means that there is at least one symbol whose name is not even an empty string, so I guess somehow the dynlib is not correct.</p><p>The question, then, is: what tools can I use to debug such a situation, short of trying to recompile the linker with the debug flags enabled (<code>bionic/linker/linker_debug.h</code>) or try to understand the linker's code, analyze the <code>.so</code> file and figure it out? It would be great to at least have precompiled versions with debug enabled...</p><hr><p>[1] I know that I could use the compilers provided in the NDK, but so far we wanted to stick to the whole source code. See next footnote.</p><p>[2] most of the source code is actually Scheme code which is given to a compiler that translates it to C and uses a C compiler to produce the final dynlib or executable.</p><p>[3] I cannot post more that 1 link, so if you want the links just ask for them.</p>","273492","","","","","2010-02-16 18:08:49","error loading dynlib with ldopen() -- no symbol name?","<android>","1","0","","",""
"2265809","1","2280624","","2010-02-15 12:19:29","0","827","<p>i am facing issue that when i click on edittext its width gets changed i want to fix its width according to screen so that it covers whole screen and then button at right side of it.</p><p>here is the code</p><p>  </p><p></p><p></p><p> </p>","249991","","","","","2010-02-17 12:42:42","onclick EditText Stretch problem!","<android><layout>","2","2","","",""
"2266065","1","2266158","","2010-02-15 13:04:36","6","1748","<p>I want to display Battery level stats in my app. How can we obtain such information like Battery Power, Battery Voltage, etc.?</p>","2355649","","418613","","2012-06-08 12:29:59","2012-06-08 12:29:59","How to obtain Battery Stats in Android at runtime?","<android><power-management>","2","1","3","",""
"2266181","1","","","2010-02-15 13:24:18","14","9089","<p>My Android Java Application needs to record audio data into the RAM and process it.This is why I use the class ""AudioRecord"" and not the ""MediaRecorder"" (records only to file).</p><p>Till now, I used a busy loop polling with ""read()"" for the audio data. this has been working so far, but it peggs the CPU too much.Between two polls, I put the thread to sleep to avoid 100% CPU usage.However, this is not really a clean solution, since the time of the sleep isnot guaranteed and you must subtract a security time in order not to loose audiosnippets. This is not CPU optimal. I need as many free CPU cycles as possible fora parallel running thread.</p><p>Now I implemented the recording using the ""OnRecordPositionUpdateListener"".This looks very promising and the right way to do it according the SDK Docs.Everything seems to work (opening the audio device, read()ing the data etc.)but the Listner is never called.</p><p>Does anybody know why?</p><p>Info:I am working with a real Device, not under the Emulator. The Recording using a Busy Loop basically works (however not satifiying). Only the Callback Listener is never called.</p><p>Here is a snippet from my Sourcecode:</p><pre><code>public class myApplication extends Activity {  /* audio recording */  private static final int AUDIO_SAMPLE_FREQ = 16000;  private static final int AUDIO_BUFFER_BYTESIZE = AUDIO_SAMPLE_FREQ * 2 * 3; // = 3000ms  private static final int AUDIO_BUFFER_SAMPLEREAD_SIZE = AUDIO_SAMPLE_FREQ  / 10 * 2; // = 200ms  private short[] mAudioBuffer = null; // audio buffer  private int mSamplesRead; // how many samples are recently read  private AudioRecord mAudioRecorder; // Audio Recorder  ...  private OnRecordPositionUpdateListener mRecordListener = new OnRecordPositionUpdateListener() {    public void onPeriodicNotification(AudioRecord recorder) {      mSamplesRead = recorder.read(mAudioBuffer, 0, AUDIO_BUFFER_SAMPLEREAD_SIZE);      if (mSamplesRead &gt; 0) {        // do something here...      }    }    public void onMarkerReached(AudioRecord recorder) {      Error(""What? Hu!? Where am I?"");    }  };  ...  public void onCreate(Bundle savedInstanceState) {  try {      mAudioRecorder = new AudioRecord(          android.media.MediaRecorder.AudioSource.MIC,           AUDIO_SAMPLE_FREQ,          AudioFormat.CHANNEL_CONFIGURATION_MONO,          AudioFormat.ENCODING_PCM_16BIT,            AUDIO_BUFFER_BYTESIZE);    } catch (Exception e) {      Error(""Unable to init audio recording!"");    }    mAudioBuffer = new short[AUDIO_BUFFER_SAMPLEREAD_SIZE];    mAudioRecorder.setPositionNotificationPeriod(AUDIO_BUFFER_SAMPLEREAD_SIZE);    mAudioRecorder.setRecordPositionUpdateListener(mRecordListener);    mAudioRecorder.startRecording();    /* test if I can read anything at all... (and yes, this here works!) */    mSamplesRead = mAudioRecorder.read(mAudioBuffer, 0, AUDIO_BUFFER_SAMPLEREAD_SIZE);  }}</code></pre>","273501","","1534123","","2012-10-26 15:53:01","2013-04-05 08:32:54","Android: AudioRecord Class Problem: Callback is never called","<android><audio><callback><recording><android-audiorecord>","4","0","6","",""
"2266354","1","","","2010-02-15 13:55:31","5","2587","<p>I am looking for a UI view that imitates the functionality of theGoogle Maps directions screen UI control where it allows the user topick the type of directions allowed, either Car, Transit or Walking.</p><p>Like this --> <a href=""http://snapplr.com/50rh"">http://snapplr.com/50rh</a></p><p>The widget is essentially three buttons laid out horizontally withrounded corners only on the left of the first and right of the thirdbutton.  </p><p>I can't see a standard way to do this, although it seems like it wouldbe a common widget.  Is there some other standard way of presenting amulti-choice grouping in a horizontal layout as a ""single"" layoutobject. </p><p>Thanks for your help,</p><p>Wouter </p>","188119","","1292730","","2012-04-30 18:55:36","2012-04-30 18:55:36","android button bar toggle","<android><button><user-interface><toggle>","4","2","4","",""
"2266437","1","","","2010-02-15 14:10:54","0","550","<p>I have a <a href=""http://developer.android.com/reference/android/app/ListActivity.html"" rel=""nofollow"">ListActivity</a> binding to a database with a Custom <a href=""http://developer.android.com/reference/android/widget/SimpleCursorAdapter.html"" rel=""nofollow"">SimpleCursorAdapter</a>.in each of my list items I have 4 texts, image and checkbox (each one is set to focusable:false).</p><p>In the list itself I have a long button so when I press on it, I want it to delete all therows which thire checkboxes are 'checked'.</p><p>Now, I have tried many techniques in order to achieve a simple operation (click listeners, CheckedtextView as shown in the tutorial) but was not successful. </p><p>There is also another weird phenomenon occurring, after I @Override <a href=""http://developer.android.com/reference/android/app/ListActivity.html#onListItemClick%28android.widget.ListView,%20android.view.View,%20int,%20long%29"" rel=""nofollow"">onListItemClick</a>, also i dont get any calls at all while I am pressing on any of the list's rows.</p><p>Does anybody have any idea how to solve these issues? Thanks.</p><p>Thanks,</p><p>Moshic.</p>","273550","","83446","","2011-03-11 03:33:37","2013-02-12 11:32:14","Delete all list items which are checked","<android><android-widget>","2","3","","",""
"2266756","1","2266977","","2010-02-15 15:03:07","0","4559","<p>I am fiddling around with a dialog that pops up and displays an alarm information. (I know, it has been documented that in Android it's ""better"" style to use notifications instead, but just like the alarm clock I want it to display a dialog on top of whatever you do to really get the users immediate attention - as the user expects this behavior I don't think it's bad style!)</p><p>Now - the only easy way I found is using the <code>RingtoneManager.getRingtone()</code> function to get a <code>Ringtone</code> object for the type ""alarm"".</p><p>Well, I can play that sound now using <code>Ringtone.play()</code> - but it plays the sound only once and I cannot figure out how to let it play endlessly until the user reacts, e.g. by touching the dialog anywhere or dismissing it using Cancel button provided.</p><p>Does anyone know how this can be accomplished easily?Thanks!</p>","273456","","","","","2010-02-15 15:34:46","Android: Looking for an easy way to play notification sounds in a loop manually","<android><loops><ringtone>","1","0","0","",""
"2266762","1","2266796","","2010-02-15 15:03:37","1","2299","<p>What libc implementation is used in Android platform? What malloc implementation is used (ptmalloc or tcmalloc or anything other)? </p>","196561","","196561","","2010-02-18 00:57:17","2012-01-04 02:44:22","Android libc version and malloc implementation","<android><malloc><libc><bionic>","1","0","","",""
"2266952","1","2267590","","2010-02-15 15:30:24","2","1944","<p>Today I am looking for a way to mimic the behavior I know from my HTC Hero's lock screen: the calendar and alarm clock can put text &amp; drawables there to inform about an upcoming event or an expired alarm. The lock screen remains there in that it must be dragged down to dismiss the shown event and there might also be a Snooze button.</p><p>But, first question: is this default Android stuff or HTC Sense specific only??Second question: If it is a common Android thing, why can't I find anything in Google's Android documentation for the topics ""lockscreen"" or ""lock screen"" that comes close to my question? Where's the API for it?</p><p>My problem is: I want to inform the user immediately - even if I try a standard notification, the user with a locked screen will have to unlock it and drag down the notifications list to see &amp; clear what's going on. <em>sigh</em> Putting an endlessly playing notification sound there is a hassle as it takes at least two swipes down to stop the sound playing!</p><p>Any hints on this?Thanks!</p>","273456","","","","","2010-08-07 06:55:53","How to access programmatically what is displayed in an Android lock screen","<android><htc><htc-hero><lockscreen>","2","0","2","",""
"2266979","1","2267087","","2010-02-15 15:35:02","2","677","<p>Usually, I putExtra inside an Intent to transfer stuff between Activities.</p><p>But it seems like I can't do this with a Service?</p><pre><code>Bundle extras = getIntent().getExtras();</code></pre><p>That doesn't work for a android Service.  How do I send a string from an Activity to a Service then?</p>","179736","","","","","2010-02-15 15:53:41","How do I send some data (eg. a String) from my Activity to a Service ...in Android?","<java><android><data><service><activity>","1","0","1","",""
"2266989","1","","","2010-02-15 15:36:36","0","1751","<p>i have a little trouble with the android mapview. It simply crashes every time i try to open the app!Code:</p><pre><code>package com.jappapps.android.travelbuddy;import android.os.Bundle;import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;public class TravelBuddy extends MapActivity {   /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.main); // changed to lowercase       MapView mapView = (MapView) findViewById(R.id.mapview); // match id in main.xml       mapView.setBuiltInZoomControls(true);    }    @Override    protected boolean isRouteDisplayed() {        return false;    }</code></pre><p>Manifest</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""com.jappapps.android.travelbuddy""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;&lt;activity android:name="".TravelBuddy""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;      &lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;uses-library android:name=""com.google.android.maps"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;  &lt;/manifest&gt; </code></pre><p>Main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;com.google.android.maps.MapViewxmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/mapview""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:clickable=""true""android:apiKey=""0QrW-CcUIzU_fxIS_9O-BkFnuPC-rTj-7t3Q0xw""/&gt;&lt;TextView  android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""@string/hello""/&gt;&lt;/LinearLayout&gt;</code></pre>","273532","","","","","2010-02-15 15:44:17","MapView not working [android]","<java><android><google-maps><android-mapview>","1","0","","",""
"2267111","1","","","2010-02-15 15:57:46","0","1028","<p><strong>UPDATE: See self-answer, ""fixed, need to channge the where clauses""</strong></p><p>I have set a content provider, for some reason I am able to to delete a row this way:</p><pre><code>getContentResolver().delete(myUri, ""_id="" + ""3"", null);</code></pre><p>but i am not able to delete a row that way:</p><pre><code>getContentResolver().delete(myUri, ""NAME="" + ""chris"", null);</code></pre><hr><p>getting this error:</p><p><code>02-15 15:48:08.197: ERROR/AndroidRuntime(3043): android.database.sqlite.SQLiteException: no such column: chris: , while compiling: DELETE FROM User WHERE NAME=chris</code></p><hr><p>I have checked my database file, and it is there.. but for some reason i can delete columns from my database only by the _id column,</p><p>how can i fix this?</p><p>error:</p><p><code>02-15 15:48:08.197: ERROR/AndroidRuntime(3043): android.database.sqlite.SQLiteException: no such column: idanmoshik1: , while compiling: DELETE FROM User WHERE USER_NAME=idanmoshik1</code></p><p>*<code>User</code> is the name of my table.</p><p>thanks,</p><p>Moshik</p>","273550","","398670","","2012-08-24 15:18:41","2012-08-24 15:18:41","SQLite, can't delete columns","<android><sqlite>","3","0","0","",""
"2267118","1","2267602","","2010-02-15 15:58:02","1","1261","<p>I have a string array and was trying to style certain parts of the text with tags like &lt; b>, &lt; i>, ... but it doesn't work.The array looks like this:</p><pre><code>&lt;resources&gt;    &lt;array name=""hour1""&gt;                                         &lt;item&gt;blabla\n&lt;b&gt;blabla&lt;/b&gt;&lt;/item&gt;&lt;/array&gt;</code></pre><p></p><p>The text is displayed in the textview like this:</p><pre><code>tTitel.setText(Html.fromHtml(Text[ii]));</code></pre><p>I tried it without Html.fromHtml too but this had no effect. The styling tags do work if i use them directly in the code, like: </p><pre><code>tTitel.setText(Html.fromHtml(""blabla&lt;b&gt;blabla&lt;/b&gt;"");</code></pre><p>Any ideas how to style the text in an array??</p><p>Cheers,Chris</p>","273624","","273624","","2010-02-15 16:07:00","2010-02-15 17:09:34","How to style text in a string array?","<android><arrays><coding-style>","1","2","2","",""
"2267336","1","2378852","","2010-02-15 16:29:57","0","750","<p>I am having an issue with my app, soley on the Moto DEXT.  I have tried to reproduce on my Hero and the 1.5 emulator with no luck.</p><p>The exception (see logcat snippet below) seems to be coming from within the system code, so I may be out of luck.</p><p>Rough jist is, user presses the button, new MapActivity loads, they see the grid start then get a force close.  On loading the MapActivity loads up a customised MyLocationOverly (very little changed, mostly a kludge to allow a map click to be caught).</p><p>Has anyone else experienced anything similar, and can point out if I am going wrong.</p><pre><code>02-12 18:21:18.587 I/ActivityManager(   83): Displayed activity uk.me.cpearson.runningLate/.LocationMap: 1589 ms02-12 18:21:19.807 I/Maps.MyLocationOverlay( 2094): Running deferred on first fix: uk.me.cpearson.runningLate.LocationMap@4338bfe802-12 18:21:19.907 W/dalvikvm( 2094): threadid=3: thread exiting with uncaught exception (group=0x4000ff28)02-12 18:21:19.907 E/AndroidRuntime( 2094): Uncaught handler: thread main exiting due to uncaught exception02-12 18:21:19.957 E/AndroidRuntime( 2094): java.lang.ClassCastException: android.graphics.drawable.BitmapDrawable02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.google.android.maps.MyLocationOverlay.getLocationDot(MyLocationOverlay.java:180)02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.google.android.maps.MyLocationOverlay.drawMyLocation(MyLocationOverlay.java:561)02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.google.android.maps.MyLocationOverlay.draw(MyLocationOverlay.java:511)02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:45)02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.google.android.maps.MapView.onDraw(MapView.java:471)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.View.draw(View.java:5838)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.drawChild(ViewGroup.java:1486)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.drawChild(ViewGroup.java:1484)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.View.draw(View.java:5841)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.widget.FrameLayout.draw(FrameLayout.java:352)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.drawChild(ViewGroup.java:1486)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.drawChild(ViewGroup.java:1484)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.View.draw(View.java:5841)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.widget.FrameLayout.draw(FrameLayout.java:352)02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1904)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewRoot.draw(ViewRoot.java:1239)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewRoot.performTraversals(ViewRoot.java:1049)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewRoot.handleMessage(ViewRoot.java:1518)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.os.Handler.dispatchMessage(Handler.java:99)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.os.Looper.loop(Looper.java:123)02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.app.ActivityThread.main(ActivityThread.java:3977)02-12 18:21:19.957 E/AndroidRuntime( 2094): at java.lang.reflect.Method.invokeNative(Native Method)02-12 18:21:19.957 E/AndroidRuntime( 2094): at java.lang.reflect.Method.invoke(Method.java:521)02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)02-12 18:21:19.957 E/AndroidRuntime( 2094): at dalvik.system.NativeStart.main(Native Method)02-12 18:21:22.927 I/ActivityManager(   83): Process uk.me.cpearson.runningLate (pid 2094) has died.02-12 18:21:22.937 I/WindowManager(   83): WIN DEATH: Window{43687060 Toast paused=false}02-12 18:21:22.947 I/WindowManager(   83): WIN DEATH: Window{43677f00 uk.me.cpearson.runningLate/uk.me.cpearson.runningLate.Home paused=false}02-12 18:21:22.947 I/WindowManager(   83): WIN DEATH: Window{43682890 uk.me.cpearson.runningLate/uk.me.cpearson.runningLate.LocationMap paused=false}02-12 18:21:23.007 I/ActivityManager(   83): Start proc uk.me.cpearson.runningLate for activity uk.me.cpearson.runningLate/.Home: pid=2105 uid=10063 gids={3003}</code></pre>","238174","","","","","2011-01-11 15:32:25","Motorola dext and Google maps","<android><maps>","1","1","","",""
"2267429","1","","","2010-02-15 16:41:47","1","495","<p>The cloneNode() method in the following minimal example works on java 1.6 but throws an DOMException with code 14 under android 5.</p><p>Code 14 according to sdk docs means:""NAMESPACE_ERRIf an attempt is made to create or change an object in a way which is incorrect with regard to namespaces.""</p><p>Has anybody an idea why this might be?Thank you in advance!</p><pre><code>public class M{ public static void main(String[] args) {  try  {             DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();             DocumentBuilder builder = factory.newDocumentBuilder();             String text = new String(""&lt;blub&gt;&lt;/blub&gt;"");             Document document = builder.parse(new InputSource( new StringReader(text) ));             document.getDocumentElement().cloneNode(true);  }  catch(DOMException e)  {}  catch(ParserConfigurationException e)  {}  catch(IOException e)  {}  catch(SAXException e)  {} }}</code></pre>","273659","","","","","2012-03-07 11:19:04","DOMException while cloning XML Node","<xml><android><exception><dom>","1","4","1","",""
"2267513","1","2555929","","2010-02-15 16:53:54","9","20941","<p>I've been working with PhoneGap and it's been great, but I've run into a problem with getting location on a Verizon Droid w/ 2.0.1 (works as expected on a G1 w/ 1.6).</p><p>GeoLocation API Support was added to Android in 2.0 (Eclair) and it works in the default browser on a Verizon Droid (on 2.0.1).  That is, if I visit a website that calls navigator.geolocation.getCurrentPosition(success_callback, error_callback), the device prompts that the current domain ""wants to know your location"" in a dialog with options to ""Share location"" or ""decline"".  If I select ""Share location"", success_callback eventually gets called with location data.</p><p>If I visit the same website in a WebView, the call to navigator.geolocation.getCurrentPosition does not generate a javascript error, but the ""share your location"" dialog is not displayed and neither callback ever gets called.  In logcat, I see what seems to be a related error: ""02-15 10:37:00.413: ERROR/geolocationService(16871): Caught security exception registering for location updates from system. This should only happen in DumpRenderTree.""  </p><p>It seems to me that the WebView is failing to register for location updates because it does not have the required permission, which in turn is a result of not prompting the user for the permission.  Although there were several methods and objects added to the Webkit package in Android 2.0 related to GeoPermissions, I haven't been able to use any of them to cause WebView to display the GeoPermission dialog.</p><p>The following is based on the Hello, WebView example from the Android Developer's Guide but it adds some of the calls and objects that were added in 2.0 related to GeoPermissions. *Updated with an appropriate url (with permission from <a href=""http://maxheapsize.com/2009/04/11/getting-the-browsers-geolocation-with-html-5/"">the author - thanks Oliver</a>!).</p><p>Has anyone been able to get this working?  Any feedback would be great, thanks!</p><pre><code>package com.example.android.helloactivity;import android.app.Activity;import android.os.Bundle; import android.webkit.GeolocationPermissions;import android.webkit.WebChromeClient;import android.webkit.WebView;import android.webkit.GeolocationPermissions.Callback;public class HelloActivity extends Activity implements GeolocationPermissions.Callback{WebView webview;String geoWebsiteURL = ""http://maxheapsize.com/static/html5geolocationdemo.html"";public HelloActivity() {}/** * Called with the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.hello_activity);    webview = (WebView) findViewById(R.id.webview);    webview.getSettings().setJavaScriptEnabled(true);    webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);    webview.getSettings().setGeolocationEnabled(true);  //seems like if i set this, the webview should prompt when I call navigator.geolocation.getCurrentPosition    GeolocationPermissions geoPerm = new GeolocationPermissions(); //added in API Level 5 but no methods exposed until API level 7    GeoClient geo = new GeoClient();    webview.setWebChromeClient(geo);            String origin = """"; //how to get origin in correct format?    geo.onGeolocationPermissionsShowPrompt(origin, this);  //obviously not how this is meant to be used but expected usage not documented    webview.loadUrl(geoWebsiteURL);        }public void invoke(String origin, boolean allow, boolean remember) {}final class GeoClient extends WebChromeClient {@Overridepublic void onGeolocationPermissionsShowPrompt(String origin,Callback callback) {// TODO Auto-generated method stubsuper.onGeolocationPermissionsShowPrompt(origin, callback);callback.invoke(origin, true, false);}}}</code></pre>","273628","","273628","","2010-02-15 19:54:58","2013-12-18 18:31:21","Using navigator.geolocation.getCurrentPosition in WebView on Android 2.0+ (PhoneGap related)","<android><geolocation><webview><phonegap>","3","0","8","",""
"2267958","1","","","2010-02-15 18:10:01","2","1229","<p>Is it possibe to have your app start automatically when the device is placed in the car doc? Like Google Maps, I know it utilizes the magnet in the dock. Where do I look in the API to accomplish this?</p><p>Thanks</p><p>Patrick</p>","244190","","","","","2010-02-15 18:14:42","Open App on Car Dock?","<android>","1","0","2","",""
"2268039","1","2268158","","2010-02-15 18:22:50","3","1384","<p>Can I use my own resource names in <code>themes.xml</code>? For example:</p><pre><code>&lt;item name=""headerBackground""&gt;@drawable/header&lt;/item&gt;</code></pre><p>In this example, <code>headerBackground</code> is not a valid resource (<code>No resource found that matches the given name...</code>, says Eclipse).</p><p>Where should I create/declare these resources? Is this a bad idea?</p>","125967","","1046057","","2013-03-11 22:46:50","2013-03-11 22:46:50","How do I create my own resource names?","<android>","1","0","1","",""
"2268154","1","","","2010-02-15 18:41:15","0","846","<p>I'm a student trying to dive into the world of ""complex web-enabled applications"" for Android.I had good tries making Android applications that call php functions, have JSON or XML responses and results, serialize objects and so on...</p><p>It really can work for simple projects, IMHO. For projects that require an increased complexity and control, I really would like to try something else.</p><p>Since Android apps are made in Java, I'm thinking it could be great if I could work with Java objects in Android and storing/retrieving Java objects in the server side too. Java Server Pages could be an answer, since I can embed Java code into HTML pages/HTTP services.</p><p>Is possible (and comfortable) to achieve this? Can I work with ""local objects"" in my Android app and with ""remote objects"" in my JSP app storing them, for example, in a remote database?</p><p>What could be an alternative?</p><p>I hope I've been clear. Thank you!</p>","252711","","","","","2013-09-23 02:29:13","Android and JSP - Working with objects","<android><jsp><service>","1","2","","",""
"2268180","1","2268229","","2010-02-15 18:45:35","0","527","<p>give me some simple example for streaming video player.</p><p>i got a error in api demo.</p><p>Error is:</p><pre><code>Command PLAYER_INIT completed with an error or info PVMFErrCorrupt android</code></pre><p>thanks...</p>","267269","","","","","2010-02-15 18:55:21","Videoplayer in Android?","<android><android-emulator><android-widget>","1","0","","",""
"2268183","1","","","2010-02-15 18:46:13","35","18041","<p>In our Android project, our code is JavaDoc'd and that generates everything properly. However, any reference to the Android API classes/functions results in a JavaDoc error and a link to the relevant information is not generated. Instead we get plaintext class names. How can we set up Eclipse to turn these into links to the online Android API reference (preferably) or a local copy (if necessary)?</p>","266588","","","","","2013-07-28 20:44:35","JavaDoc in an Eclipse Android Project","<android><eclipse><javadoc>","3","0","8","",""
"2268239","1","2268256","","2010-02-15 18:57:58","148","39432","<p>I'm debugging my Android application using the AVD (Android Virtual Device).  When I try to enter text in a text field, my characters are being interpreted as Chinese in the IME.</p><p>I don't know how I got into this mode or how to get out of it (I just want to enter alphabetic keys)?</p><p>Here's a screen shot:</p><p><img src=""http://i.stack.imgur.com/KAtNu.jpg"" alt=""http://u.go2.me/3cn""></p>","178521","","71421","","2011-08-11 00:27:14","2012-10-03 00:44:54","Why is my Android emulator keyboard in Chinese character mode?","<android><android-emulator>","4","0","25","",""
"2268365","1","","","2010-02-15 19:23:13","3","5318","<p>I have a Bluetooth service that I programmed for .Net on a Windows machine and I would like my Android 2.1 phone to connect to it. The server is listening for the same UUID which the Android is using to connect. But the connection is failing.</p><p>When I try to connect to devices that are not listening for that UUID, I get an exception with the message ""Service discovery failed"", but when I try to connect to the server that is listening for the right UUID a message box pops up saying:</p><p>""There was a problem pairing with bluetooth device.""</p><p>And I get an exception with the message ""Connection timed out."" So it looks like the server and the Android are communicating, but there is some sort of failure during handshaking. I know that the Android requires that the server is paired with the phone and also encrypts the communication channel. Does anyone know which specifications are used to do this? I would love to get my server to respond properly to the connection attempt.</p><p>Thanks!</p>","260342","","164901","","2010-04-27 03:51:03","2010-12-07 05:30:45","Android Bluetooth Cross Platform Interoperability","<android><cross-platform><bluetooth>","4","0","0","",""
"2268569","1","2268811","","2010-02-15 20:02:51","12","19742","<p>I've been messing around with this for a few days now, hopefully someone here can lend me a hand.</p><p>I have a simple two-column layout, the left side is a navigation bar with buttons, the right side is a content panel.  When the user taps one of the buttons (say, the third one down), I'd like to have a floating view aligned to the right of this button but floating on top of the content pane.  Here's a picture to illustrate what I mean:<img src=""http://imgur.com/GQzCv.jpg"" alt=""Layout""></p><p>Everything I've tried shoves the floating menu inside the navigation bar or inside the content panel, which is not what I want.  Any ideas?  Here's basically what I have so far:</p><pre><code>&lt;RelativeLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""horizontal""&gt;    &lt;LinearLayout        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:orientation=""vertical""        android:layout_alignParentLeft=""true""        android:id=""@+id/navigation_bar""    &gt;        &lt;FrameLayout             android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_weight=""0.14""        &gt;            &lt;ImageButton                 android:id=""@+id/button1_btn""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:background=""@drawable/icon""                android:layout_gravity=""center""            /&gt;        &lt;/FrameLayout&gt;        &lt;FrameLayout            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_weight=""0.14""        &gt;            &lt;ImageButton                 android:id=""@+id/button2_btn""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:background=""@drawable/icon""                android:layout_gravity=""center""            /&gt;        &lt;/FrameLayout&gt;    &lt;/LinearLayout&gt;    &lt;FrameLayout        android:id=""@+id/content""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_weight=""0.14""        android:layout_toRightOf=""@id/navigation_bar""    &gt;    &lt;/FrameLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","87316","","501932","","2011-10-15 21:03:35","2012-11-09 11:20:36","Android floating view (over other views)","<java><android><mobile><android-layout>","2","1","5","",""
"2268873","1","2268903","","2010-02-15 21:02:04","0","167","<p>i have a question. I'm developing an Android Application. Actually, i have a thread in background that makes request to an external API in order to get data when the users clicks in different parts of the app.My doubt is if this ""thread"" would be better if i implemented it as a service instead of a Runnable class. </p><p>Thanks</p>","258863","","","","","2010-02-16 00:54:06","Android Services","<android><service>","3","0","","",""
"2268895","1","2268921","","2010-02-15 21:06:21","6","4824","<p>I am writing a little screen-scraping app that consumes some XHTML - it goes without saying that the XHTML is invalid: ampersands aren't escaped as <code>&amp;amp;</code>.</p><p>I am using Android's <code>XmlPullParser</code> and it spews out the following error upon the incorrectly encoded value:</p><pre><code>org.xmlpull.v1.XmlPullParserException: unterminated entity ref (position:START_TAG &lt;a href='/Fahrinfo/bin/query.bin/dox?ld=0.1&amp;n=3&amp;i=9c.0323581.1266265347&amp;rt=0&amp;vcra'&gt;@55:134 in java.io.InputStreamReader@43b1ef70) </code></pre><p>How do I get around this? I have thought about the following solutions:</p><ol><li>Wrapping the <code>InputStream</code> in another one that replaces the ampersands with entity refs</li><li>Configuring the Parser so it magically accepts the incorrect markup</li></ol><p>Which ones is likely to be more successful?</p>","99022","","99022","","2010-02-15 21:27:22","2012-03-15 21:23:48","Parsing invalid ampersands with Android's XmlPullParsers","<android><xml-parsing><invalid-characters>","2","1","1","",""
"2269092","1","","","2010-02-15 21:34:04","1","1051","<p>i would like to know if it's possible check connectivity in android without having a Context, because the thread i have running in background doesn't know the context. if there's no way, is a best practice passing to the thread the context?</p><p>thanks</p>","258863","","","","","2010-02-15 22:58:22","Android check connection without context","<android><connection>","2","2","","",""
"2269579","1","","","2010-02-15 23:06:39","4","6237","<p>I'm using Windows 7 Ultimate 64 bit edition and Eclipse 3.5 with the Android plugin. Every time I create a new project and try to publish it, I get an error like this:</p><pre>[2010-02-15 22:48:10 - EPG3]Uploading EPG3.apk onto device 'emulator-5554'[2010-02-15 22:48:15 - EPG3]Failed to upload EPG3.apk on device 'emulator-5554'[2010-02-15 22:48:15 - EPG3]java.io.IOException: Unable to upload file: timeout[2010-02-15 22:48:15 - EPG3]Launch canceled!</pre><p>The emulator is working perfectly, adb can see it, I can even logcat from it, but it can't push or pull anything from it. Nothing appears in logcat to suggest the emulator even received any command. It doesn't matter if I have the Firewall on or off, or if I try invoking adb install to bypass the plugin. Nothing works even with a blank app.</p><p>Any ideas?</p>","273924","","234938","","2010-02-15 23:19:26","2012-02-16 04:49:59","IOException everytime I try to upload anything to android emulator","<android><android-emulator>","6","4","4","",""
"2269915","1","2272621","","2010-02-16 00:31:47","0","1804","<p>I have list of checkboxes in list binded by Custom <code>simpleCursorAdapter</code>.In my custom <code>simpleCursorAdapter</code>, I've overridden <code>newView</code> and <code>bindView</code> with my modifications.I've managed somehow to do multichoice.The wierd thing is, after I delete any item from my list, the first item's checkbox is being checked all of a sudden. How does that happen? How can I solve it?</p><p>My <code>SimpleCursorAdapter</code> class:</p><pre><code>public class MyListCursorAdapter extends SimpleCursorAdapter{    private Context context;    private int layout;    public MyCursorAdapter(Context context, int layout, Cursor c,            String[] from, int[] to)    {        super(context, layout, c, from, to);        this.context = context;        this.layout = layout;    }    @Override    public View newView(Context context, Cursor cursor, ViewGroup parent)    {        Cursor c = getCursor();        final LayoutInflater inflater = LayoutInflater.from(context);        View v = inflater.inflate(layout, parent, false);        CheckBox chkBoxBtn = (CheckBox) v.findViewById (R.id.deleteTwittChkBox);        if (chkBoxBtn != null)        {            chkBoxBtn.setChecked(false);        }        return v;    }    @Override    public void bindView(View v, Context context, Cursor c)    {        --binding view to my textsview in my items        //now it's the importat part:            CheckBox chkBoxBtn = (CheckBox) v.findViewById(R.id.deleteTwittChkBox);    if (chkBoxBtn != null)    {        chkBoxBtn.setId(Integer.valueOf(c.getString(c                .getColumnIndex(MyUsers.User._ID))));        chkBoxBtn.setOnClickListener(new OnItemClickListener(chkBoxBtn, v));        chkBoxBtn.setChecked(false);    }    }    //i couldnt find another way of doing this, but this is how i set listeners to my checkboxses    static ArrayList&lt;String&gt; checkedItemsList = new ArrayList&lt;String&gt;();    private class OnItemClickListener implements OnClickListener    {        private int mPosition;        private CheckBox chkBox;        OnItemClickListener(CheckBox mChkBox, View v)        {            chkBox = mChkBox;            chkBox.setChecked(false);        }        @Override        public void onClick(View v)        {            if (chkBox.isChecked())            {                checkedItemsList.add(String.valueOf(chkBox.getId()));            }            else            {                checkedItemsList.remove(String.valueOf(chkBox.getId()));            }        }    }}</code></pre><p>Here is the code part from the <code>ListActivity</code> class which describes the button that deletes the checked box items:</p><pre><code>OnClickListener btListener = new OnClickListener(){    public void onClick(View view)    {        // long[] items = listView.getCheckItemIds();        int x = 0;        Uri myUri = Uri        .parse(""content://com.idan.datastorageprovider/users"");        String where = ""_id"" + ""=?"";        //here i am tatking all checkboxes which ive added from the  adapter class        ArrayList&lt;String&gt; checkedItemsList =   MySimpleCursorAdapter.checkedItemsList;        for (String itemID : checkedItemsList)        {            getContentResolver()            .delete(myUri, where, new String[] { itemID});            checkedItemsList.remove(itemID);        }    }};</code></pre>","273550","","387076","","2011-08-04 11:02:09","2011-08-04 11:02:09","checkbox in List being checked unexpectedly","<android><android-contentprovider><simplecursoradapter>","3","2","","",""
"2270130","1","2270153","","2010-02-16 01:39:56","1","676","<p>My code is based on the BluetoothChat sample from the API. I connect to another device just fine and I can read and write to the connection no problem. But then if I turn the device the orientation of the UI changes automatically. After this, if I try to write to the Bluetooth connection, my application crashes!</p><p>It seems weird that the orientation of the screen somehow affects the Bluetooth. I am new to Android, and I am not yet sure about stuff like when I should be saving and reloading the application's state. Is this one of those times? Does changing the orientation of the screen somehow reset the application's state?!</p><p>Thanks!</p>","274004","","","","","2010-02-16 01:45:21","Android Bluetooth crashes after orientation change","<android><bluetooth><screen><state><orientation>","1","0","1","",""
"2270325","1","2270712","","2010-02-16 02:43:39","4","4984","<p>Hi i've been researching the alarm manager in android and was wondering if there how to set a specific time for an alarm (or could use notification manager)to go off at a specific time for example 12pm tomorrow . The code below sets the alarm for 5 seconds from now so to set it for something like 12 pm could you do something like 12:00:00 or something? </p><pre><code> Intent intent = new Intent(this, OnetimeAlarmReceiver.class);    PendingIntent pendingIntent = PendingIntent.getBroadcast(context, REQUEST_CODE, intent, 0);AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + (5 * 1000), sender);Toast.makeText(this, ""Alarm set"", Toast.LENGTH_LONG).show();</code></pre>","264905","","82156","","2010-02-16 04:49:32","2012-11-20 07:19:57","Android alarm manager","<java><android><datetime>","2","0","5","",""
"2270612","1","","","2010-02-16 04:22:58","0","969","<p>I have connected my Android application to a Windows desktop machine via Bluetooth. The application interacts with the machine. At the end of the interaction the application on the desktop closes the socket that was opened between the Android and the desktop application. </p><p>Right when socket.close() is called on the Windows machine my Android app pops open a dialog saying that the application has stopped unexpectedly and then it quits. I have a breakpoint on the line in the ConnectedThread (like in the BluetoothChat sample) where I read the InputStream on the Android and that is not hit. I also have a breakpoint in the catch statement for the try surrounding the place where I read the InputStream. That one also does not get hit. So I have no idea how I can catch this error. Is this a bug?</p><p>Can anyone give me a hand? Thanks!</p>","274004","","","","","2010-03-03 17:51:49","Android Bluetooth Crashes Application When Remote Device Closes Socket","<android><sockets><crash><bluetooth>","1","0","","",""
"2270649","1","","","2010-02-16 04:31:27","0","2911","<p>I am doing one small GPS application. I have to show multiple palces . I can able to show multiple places using custom overlay method.Now i have to show route between two points , while showing route i have to show only that two points. remaining all points should disappear but i dont know how to disappear the other points.</p>","132724","","","","","2012-07-11 00:36:17","How to clear the mapview overlay drawing in android?","<android>","3","0","","",""
"2270663","1","2273565","","2010-02-16 04:34:28","0","586","<p>My Motorola Droid shows up just fine in this configuration and appears as a deployment target. Works like a snap. How do I get the HTC Eris Droid to show up as a deployment target? Is there some special driver needed for the Eris?</p>","246887","","","","","2010-08-30 14:36:32","How to get HTC Eris to show up as a device target on Eclipse 3.5 running on Mac OS X?","<android><eclipse><osx><htc>","1","0","","",""
"2270665","1","2270698","","2010-02-16 04:35:40","0","494","<p>I have several images present in different folders in my sdcard. I would like to display a list of thumbnails. So what I have done is while rendering any row in the list I read the file in an input stream, get the byte array, decode it to obtain a bitmap and set it in an imageview. </p><p>So far so good. But when I scroll the list, the list scrolls in jerks. I believe this is because decoding a bitmap from byte array takes some time. What I would like to know is that, is there any optimization which I can do to improve the performance, or better still is there any better method to achieve what I want ? </p>","266272","","","","","2010-04-13 20:00:04","Displaying thumbnails of images (present at different locations in the sdcard) in a listview","<android><image><bitmap>","1","3","","",""
"2270751","1","2318528","","2010-02-16 04:57:17","6","18857","<p>I guess this is kind of an odd question but i have tried setting onClicklistener on an ImageView and it has worked. But the problem is that the user cannot sense the click. I mean if some of u have worked on other mobile environs(like apple iphone) then wen we click on a Image in other environs then it gives an effect on the image so that the user can understand that the image has been clicked.</p><p>I have tried setting alpha using ""setalpha"" method but it doesnt work. Though the same thing is working fine on onFocusListener implementation. Can some1 suggest a different way to modify the image on click...</p><p>I am new to android so havent learnt the nuances of simple animation also... if there is any simple animation i can use for the same then plzz plzzz let me know...</p><p>Thanx...</p>","238071","","238071","","2010-07-02 04:14:22","2011-12-02 08:19:50","android imageview onClick animation","<android><animation><onclick><imageview>","3","0","2","",""
"2270842","1","2270947","","2010-02-16 05:19:26","0","4033","<p>I have a small project in which i download images from internet in the form of drawable and use them in Imageview for which i have provided functionality similar to an Imagebutton but without the gray edges. </p><p>The question is that is there any functionality in Android(similar to iphone) by which we can crop the drawable from edges to make them rounded edged drawable... </p><p>Even if its a ""not-tested-neither-recommended"" method, do let me know... i would like to work on this a bit... thanx in advance folks...</p>","238071","","569101","","2013-07-04 11:48:27","2013-07-04 11:48:27","android cropping drawable","<android><drawable><crop><rounded-corners>","1","0","1","",""
"2270927","1","","","2010-02-16 05:47:22","2","5235","<p>How can I delete a file from an Android application? Can I do it the same way I would for deleting a file in Java?</p>","263325","","122607","","2012-02-07 18:39:30","2014-02-20 02:25:03","How to delete a file from an Android application","<android>","3","0","1","",""
"2271008","1","","","2010-02-16 06:15:44","3","3501","<ol><li>I installed Windows USB Android SDKdriver for the Android Dev Phone 1</li><li>I enabled all the debugging modes and stuff on the phone.</li><li>It even says...USB debugging connected.</li><li>When I type adb devices , it shows me only my emulator , and not my phone. </li></ol><p>It doesn't seem to recognize my Android Phone as an <strong>adb device</strong>. Why is that?</p>","179736","","","","","2014-01-01 20:49:18","adb cannot find my device for Android debugging. Why?","<java><android><debugging>","5","0","2","",""
"2271023","1","","","2010-02-16 06:21:33","2","2785","<p>I'm fairly new to Android and have gone through the basic tutorials.  I thought I'd dig a little deeper and downloaded the source code to some of the ""native"" Android apps, like IM, Email, Voice Dialer, etc.</p><p>In importing the source of these native apps into Eclipse, I found that they reference classes that are not in the 2.1 API, i.e. classes such as android.content.Entity, android.net.http.DomainNameChecker, etc.  As a result, I can't compile and play with this code.</p><p>So is there is a ""hidden"" API that the native apps use that is not available to the regular app developers?  Is there a ""native"" SDK I can use to import these classes?</p><p>David</p>","274106","","","","","2012-01-18 04:11:17","How to use non-standard (hidden) API classes?","<android>","2","0","","",""
"2271109","1","2271573","","2010-02-16 06:55:00","9","7105","<p>I am using 3 italic textviews with different colors</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content""            android:orientation=""horizontal"" android:id=""@+id/submittedBy"" android:paddingTop=""10dip""&gt;            &lt;ImageView android:id=""@+id/subByImg""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                android:gravity=""left"" android:layout_gravity=""bottom"" android:src=""@drawable/submitted_by_arrow""/&gt;            &lt;TextView android:id=""@+id/submitLabel""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                android:gravity=""left"" android:text=""Submitted by""  android:textStyle=""italic""                android:textSize=""12sp"" android:textColor=""@color/gray"" android:paddingLeft=""5dip""/&gt;            &lt;TextView android:id=""@+id/submitName"" android:textStyle=""italic""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                android:textSize=""12sp"" android:textColor=""@color/maroon_dark"" android:paddingLeft=""10dip""/&gt;                &lt;TextView android:id=""@+id/submitByDate"" android:textStyle=""italic""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                android:gravity=""left""                android:textSize=""12sp"" android:textColor=""@color/gray"" android:paddingLeft=""10dip""/&gt;            &lt;/LinearLayout&gt;</code></pre><p>I wonder every last character is not displaying properly specially name displayed in the middle is ""Dan Buckland"" and it it is missing last character looks like ""Dan Bucklano""</p><p>Also tell me pls how can have textview italic and bold both..</p><p><img src=""http://www.freeimagehosting.net/uploads/953d573113.jpg"" alt=""alt text""></p>","216431","","","","","2014-04-01 12:20:23","Android Textview Italic and wrap_contents","<android><textview><bold><text-styling><italics>","3","0","1","",""
"2271131","1","2271305","","2010-02-16 07:02:47","58","145503","<p>How do I display the current date and time in an Android application?</p>","263325","","63550","","2012-07-03 17:26:37","2013-09-24 12:10:22","Display the current time and date in an Android application","<android>","11","0","18","",""
"2271248","1","","","2010-02-16 07:31:04","42","133274","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/424752/any-good-graphing-packages-for-android"">Any good graphing packages for Android?</a>  </p></blockquote><p>I want to draw charts like pie charts to display stats in my Android app. As Android doesn't support Swing and AWT, i wonder how can i draw charts in Android? Please note that i don't want to use a third party tool.</p>","2355649","","1109930","","2013-02-19 08:34:10","2013-02-19 08:34:10","How to draw charts in Android?","<android><graph><charts>","3","4","42","2011-10-03 11:07:45",""
"2271359","1","2274273","","2010-02-16 07:58:15","0","3108","<p>How can I get the album art from MediaStore? I try something like:</p><pre><code>String[] projectionImages  = new  String[]{MediaStore.Audio.Albums.ALBUM_ART, MediaStore.Audio.Albums.ALBUM_KEY};Cursor c = contentResolver.query(MediaStore.Audio.Albums.INTERNAL_CONTENT_URI, projectionImages, null, null, null);if(c != null){      c.moveToFirst();      Log.e(TAG, ""am gasit "" + c.getString(0) + "" "" + c.getString(1));  } else{      Log.e(TAG, ""No image""); }</code></pre><p>but is not working.. I retrive just null for every entry!</p><p>Thank you!</p>","217360","","470322","","2011-04-07 14:11:22","2013-03-12 10:46:12","How can i get the album art from MediaStore?","<android>","2","1","","",""
"2271532","1","","","2010-02-16 08:44:11","1","5762","<p>I am building an app which contains an input form and a WebView.The project is available at <a href=""http://code.google.com/p/android-sap-note-viewer/"" rel=""nofollow"">http://code.google.com/p/android-sap-note-viewer/</a></p><p>The WebView will render a website based on the input and this page has a DIV with the main contents (could be hundreds of lines). I have no control of the contents on the website.</p><p>Android WebKit doesn't seem to do any scrolling in a DIV, ref <a href=""http://www.gregbugaj.com/?p=147"" rel=""nofollow"">http://www.gregbugaj.com/?p=147</a>. Therefore, only parts of the DIV is shown to the user, with no method of retrieving the rest of the text. <strong>My challenge is to find a way that all the text of the DIV is shown</strong>.</p><p>My view is defined as the following:        </p><pre><code>    &lt;LinearLayout android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;TextView android:layout_width=""wrap_content""            android:textAppearance=""?android:attr/textAppearanceMedium""            android:layout_height=""wrap_content""             android:text=""@string/lblNote"" /&gt;        &lt;EditText android:id=""@+id/txtNote""           android:layout_width=""wrap_content""            android:layout_height=""wrap_content""             android:layout_weight=""1""            android:numeric=""decimal""            android:maxLength=""10""            /&gt;        &lt;Button android:id=""@+id/bView""           android:text=""@string/bView""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""              /&gt;    &lt;/LinearLayout&gt;        &lt;WebView     android:id=""@+id/webview""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:isScrollContainer=""false""    android:keepScreenOn=""false""    android:minHeight=""4096px""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>Here I've tried to hardcode the WebView to a large height in order to make sure the DIV is stretched out and shows all the text, and also force the LinearLayout to do the scrolling.</p><p>However, the WebView is always adapting to the screen size (which would be good in most cases, but not this).</p><p><strong>Any ideas on how to solve this problem?</strong></p><p>(only solution I see now is to fetch the HTML myself, remove the DIV and send it to the WebView)</p>","250787","","21028","","2010-02-17 10:28:33","2011-11-06 10:33:55","Android: Forcing a WebView to a certain height (or triggering scrolling for a div)","<android><webview><android-widget>","2","3","1","",""
"2271570","1","2271955","","2010-02-16 08:52:44","17","40732","<p>I have an activity MyActivity that extends from MapActivity. In the .xml file containing the layout I can only include the MapView</p><pre><code>&lt;com.google.android.maps.MapView    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/trail_map_view""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:clickable=""true""    android:apiKey=""key""/&gt;</code></pre><p>However I do need to find another view that is located in another .xml file.Unfortunately, findViewById returns null.How can I get the view I am looking for?</p><p>Thanks a lot!</p>","271569","","-1","","2013-12-15 09:58:45","2013-12-15 09:58:45","Android: findviewbyid: finding view by id when view is not on the same layout invoked by setContentView","<android><layout>","3","1","5","",""
"2271900","1","2272689","","2010-02-16 09:52:57","1","2967","<ol><li>Activity 1 starts a Service, using the standard Intent.</li><li>Activity 1 starts Activity 2. Then, Activity 1 gets finished().</li><li>Now, there's only Activity 2. </li></ol><p>How does Activity 2 kill the Service, since that Intent was generated in Activity 1? I don't want to pass the Intent everywhere...</p>","179736","","155670","","2010-02-16 10:26:32","2010-11-30 23:35:27","How to kill a Service by another Activity?","<java><android><service><activity><android-intent>","2","0","","",""
"2271928","1","2272213","","2010-02-16 09:56:44","1","191","<p>I want to store some additional data for each contact on Android.<br>I would have in mind creating my own database table for it, and then bind them to the real contact via a unique id.</p><p>I am wondering if Android has built in functionality to store additional data against contacts?</p><p><strong>EDIT 2</strong><br>Is there a defined field for birthday of the contact?How do I store a date field?</p>","243782","","243782","","2010-03-04 11:29:16","2010-03-04 11:29:16","How can I store data against specific contact ID?","<xml><android><database><contacts>","1","0","","",""
"2271936","1","2271968","","2010-02-16 09:58:12","3","9330","<p>I want to ask the user if he agrees to continue launching a task, how do I issue a confirm window having Yes, No buttons?</p>","243782","","","","","2010-02-16 10:02:09","How to issue a confirm (yes/no) message of a Android task?","<xml><android><views><confirm>","1","1","","",""
"2271949","1","","","2010-02-16 10:00:03","0","1278","<p>how to change the inner color of my xml file.It has default color as black only.how to change to other color.i have gn by xml file below .xml file is used for creating border,but i cant change the background color.Need help on this</p><p>RegardsGomathi sankar</p>","274245","","274245","","2010-02-16 10:07:01","2010-02-16 10:10:48","How to change background color of custom xml file in android","<android>","1","0","","",""
"2272168","1","2272584","","2010-02-16 10:37:49","1","2667","<p>is it possible somehow to listen to the events of the ActivityManager, e.g. when activities are started? Does the ActivityManager send broadcasts? I havn't found anything indicating that it does.</p><p>What I basically need to do: I want my app to launch one of my activities whenever a certain (thirdparty) app is launched/takes focus. Problem is this needs to happen before the thirdparty app is actually displayed.</p><p>What I have tried so far as workarounds:</p><ol><li>Logcat output: I query logcat every 0.8s (filtered to show ActivityManager events only) but this eats up to many ressources</li><li>getRunningTasks: Slows down the phone a lot too and is not very safe, as an activity might be running but not currently in focus</li></ol><p>Any ideas?Thanks!</p><p>Christian</p>","273624","","","","","2012-05-12 08:45:43","Listen to ActivityManager events?","<android><activity><logcat>","3","2","1","",""
"2272193","1","2272470","","2010-02-16 10:40:43","1","7736","<pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""?android:attr/listPreferredItemHeight""    android:padding=""6dip""&gt;    &lt;ImageView        android:id=""@+id/icon""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_marginRight=""6dip""        android:src=""@drawable/icon"" /&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""0dip""        android:layout_weight=""1""        android:layout_height=""fill_parent""&gt;        &lt;TextView            android:id=""@+id/toptext""            android:layout_width=""fill_parent""            android:layout_height=""0dip""            android:layout_weight=""1""            android:gravity=""center_vertical""            android:textStyle=""bold""        /&gt;        &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""0dip""            android:layout_weight=""1""            android:id=""@+id/bottomtext""            android:singleLine=""false""        /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>This is my current row.  If I created a .JPEG, and I want that to be for each item...how would I change this .xml file?  Where would I put the image? In Assets?</p>","179736","","","","","2010-02-16 11:28:27","How do I set a background image for each item of ListView in Android?","<java><android><listview><templates>","2","0","","",""
"2272335","1","","","2010-02-16 11:04:23","-2","10337","<p>in my application i want to change button text for every 3 sec.</p>","217065","","","","","2012-10-17 00:44:44","how to change button text dynamically for every 3 sec in android?","<android>","4","0","2","2012-08-28 02:58:54",""
"2272378","1","2272460","","2010-02-16 11:14:54","3","7173","<p>I have the folowing method in a Service in my appplication:</p><pre><code>public void switchSpeaker(boolean speakerFlag){        if(speakerFlag){        audio_service.setSpeakerphoneOn(false);        }        else{        audio_service.setSpeakerphoneOn(true);        }    }</code></pre><p>So my question is whats the best and most effective way to be able to use this method in an Activity like follows</p><pre><code>final Button speaker_Button = (Button) findViewById(R.id.widget36);            speaker_Button.setOnClickListener(new View.OnClickListener(){                public void onClick(View v){                    switchSpeaker(true); //method from Service                }            });</code></pre><p>Do I have to do an AIDL or is there a simpler way?</p>","243999","","","","","2012-05-29 13:03:44","Android - Using method from a Service in an Activity?","<android><service><activity><aidl>","3","0","4","",""
"2272539","1","2272626","","2010-02-16 11:39:25","3","2017","<p>The default Messaging app in Android (tested against version 2.1) appears to put the soft keyboard in a special mode, where the return key is replaced with an ""emoticon key"". When you press it you get a selection of emoticons to insert into your message.</p><p><img src=""http://mos.futurenet.com/techradar/Review%20images/TechRadar/Gadgets/T-Mobile%20Pulse%20images/Screen%20shots/Text%20input%20QWERTY%20android%20landscape-420-90.jpg"" alt=""Example screenshot of the keyboard in this mode""></p><p>How do I instruct the soft keyboard to appear in this mode in my app?</p>","43662","","","","","2010-02-16 11:52:55","How can I switch to the Android keyboard ""SMS"" mode","<android>","1","0","1","",""
"2272936","1","","","2010-02-16 12:49:18","2","1167","<p>An Android app I'm writing involves quite a lot of downloading of content (think podcatcher/RSS).</p><p>I would like to be able to give the user an indication of how many bytes they've downloaded, so they can make the decision whether they want to use Wifi or not. </p><p>To this end, I have found a way of counting the number of bytes <strong>read</strong> by the app, by wrapping an <code>InputStream</code> in a simple <code>CountingInputStream</code>. </p><p>However, this does not take into consideration basic things like packet headers and HTTP headers. More importantly, it does not take into consideration any compression that content may be encoded with.</p><p>So, <strong>how many bytes did my application download over the network</strong>? I'm not so interested in the number of bytes uploaded, but if know how, don't be shy.</p><p>I have gone down a fairly low level approach as I am feeding the input stream into an XML PullParser. I will also be needing to do a similar exercise with dumping bytes (images in this case) straight onto the SD Card.</p><p>Is this the best approach? What am I missing?</p>","4737","","4737","","2010-02-17 00:00:55","2013-01-19 10:05:59","On Android/Java, how many bytes has a connection downloaded?","<java><android><inputstream><billing><urlconnection>","4","0","1","",""
"2273111","1","2295666","","2010-02-16 13:19:24","5","1655","<p>How to redirect logging on device to file?</p><p>My application is hang on device but works great on emulator - I want to see logging on my device without sdk and its tools.</p>","263321","","","","","2011-12-24 13:57:48","Logging on device to file","<java><android><logging>","5","0","4","",""
"2273228","1","2273356","","2010-02-16 13:39:43","4","400","<pre><code>Intent nnn = new Intent(Hello.this, NewActivity.class);startActivity(nnn);finish();</code></pre><p>This would start a new activity, and then close the current Activity <strong><em>forever</em></strong>, right?</p>","179736","","","","","2012-01-04 12:41:30","Is this the correct way to start an Activity?","<java><android><activity><android-intent>","2","0","","",""
"2273735","1","2273778","","2010-02-16 14:55:42","4","3868","<p>when i run my program, logcat shows a lot of activity with GC</p><p>like</p><pre><code>GC freed 10324 objects/ 510376 bytes in 103 msGC freed 10324 objects/ 510376 bytes in 103 msGC freed 10324 objects/ 510376 bytes in 103 msGC freed 10324 objects/ 510376 bytes in 103 msGC freed 10324 objects/ 510376 bytes in 103 ms</code></pre><p>with diff in obj, bytes and ms values...</p><p>is it because of some bad practice of coding ?</p>","132347","","","","","2010-02-16 21:17:04","Android GC - LogCat always showing GC activity","<android><garbage-collection>","2","0","1","",""
"2274042","1","","","2010-02-16 15:42:57","4","268","<p>Does anyone have good web tutorials or resources for learning 2D application development using a SurfaceView (Or something better if it exists).  I am intending on using it for a 2D game but have little experience in this area.</p><p>It would be good if it had</p><ol><li>Creating the Surface View</li><li>Creating movable graphical objects</li><li>Collision Detection</li><li>Basic Game Engine</li></ol>","248521","","","","","2010-02-16 18:09:55","good web resources for learning SurfaceView","<android>","0","0","","2013-09-30 22:46:05",""
"2274284","1","","","2010-02-16 16:11:04","11","9210","<p>I have an updated apk - tested successfully on various devices and simulator instances - with the following manifest:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.myCompany.appName""      android:versionCode=""2""      android:versionName=""1.0.1""&gt;          &lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""5"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;supports-screens          android:largeScreens=""true""          android:normalScreens=""true""          android:smallScreens=""true"" /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/icon_name"" android:debuggable=""false""&gt;        &lt;activity android:name="".myActivity"" android:configChanges=""keyboardHidden|orientation""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre><p>When I post to Android Marketplace as an upgrade to my existing 1.0 app, I get the aforementioned ambiguous message:</p><blockquote>  <p>""The server could not process your  apk. Try again.""</p></blockquote><p>I've searched elsewhere for this message in hopes of finding out what might be happening, to no avail. (A popular suggestion is to move the <strong>uses-sdk</strong> element to the top of the manifest, but as you can see it's <em>already</em> at the top.)</p><p>Clues welcome/appreciated.</p><p><strong>Update:</strong> I just tried to upload the same file again. Now I get a new message:</p><blockquote>  <p>The new apk's versionCode (2) in  AndroidManifest.xml must be higher  than the old apk's versionCode (2).  The server could not process your apk.  Try again.</p></blockquote><p>Soooo Marketplace <em>did</em> get my upgraded apk after all? (The very first accepted apk's versionCode was 1, so this update was of course bumped to 2.) Confused …</p><p>Bumping it up to 3 and trying again. Surprise surprise, I get the original ""could not process"" error all over again. Going in circles. Hmm ... :(</p><p><strong>Nuther Update:</strong> If I exit and re-enter the Marketplace page, now it shows that the app has been uploaded! Except there's no app icon. Curiouser and curiouser ... and this is all happening with a cache-cleared (standards-friendly) browser to boot.</p><p>So - do I trust the upload? Or start over ... with versionCode=""4""? All I want is to get a solid ""Upload successful, here's the icon, ready to publish"" type of response.</p>","126660","","126660","","2010-02-16 16:52:25","2013-02-25 12:39:07","Android Marketplace Error: ""The server could not process your apk. Try again.""","<android><marketplace>","9","6","2","",""
"2274641","1","2274799","","2010-02-16 16:55:55","5","1589","<p>I have a service that listens to a socket. When receiving certain input it is to create an activity. When receiving other input, it is to kill this activity. I have struggled for a while to make the service communicate with the activity through AIDL (http://developer.android.com/guide/developing/tools/aidl.html), but this seems to not be effective. I think AIDL is only effective when the process that is to be talked to is a service, not when it is an activity? I would love some directions or suggestions on how to solve my problem.</p><p>Cheers,</p>","249871","","","","","2010-02-16 17:15:19","Best way for Service that starts Activity to communicate with it","<android><aidl>","1","0","","",""
"2274881","1","","","2010-02-16 17:26:53","1","1036","<p>I've got an activity, call it A, that when initially opened I would like to programmatically open a another dialog theme activity, B, over the top.  The user would select some info from the dialog activity and return to activity A.  When resuming to activity A at some later point the data set would be available, so the dialog would not need to be shown.</p><p>The problem is attempting to start the dialog activity from activity A's onResume or onCreate methods causes strange and undesirable behaviour.  The task appears to kind of freezes for a good few seconds and then the dialog is displayed correctly, but activity A isn't shown behind.</p><p>ThanksPeter</p>","272434","","","","","2012-03-28 21:14:21","Opening dialog activity on creating another activity","<android><activity>","1","2","1","",""
"2274910","1","","","2010-02-16 17:30:52","0","2999","<p>Got some errors following the tutorial for MapView when i was going to integrate overlays.</p><p>TravelBuddy.java</p><pre><code>package com.jappapps.android.travelbuddy;import java.util.List;import android.graphics.drawable.Drawable;import android.os.Bundle;import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;import com.google.android.maps.Overlay;public class TravelBuddy extends MapActivity {List&lt;Overlay&gt; mapOverlays;Drawable drawable;Overlays itemizedOverlay;/** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.main); // changed to lowercase       MapView mapView = (MapView) findViewById(R.id.mapview); // match id in main.xml       mapView.setBuiltInZoomControls(true);       mapOverlays = mapView.getOverlays();       drawable = this.getResources().getDrawable(R.drawable.androidmarker);       itemizedOverlay = new Overlays(drawable);   }    @Override    protected boolean isRouteDisplayed() {        return false;     }  }</code></pre><p>Overlays.java</p><pre><code> package com.jappapps.android.travelbuddy; import java.util.ArrayList; import android.graphics.drawable.Drawable; import com.google.android.maps.ItemizedOverlay; import com.google.android.maps.OverlayItem; public class Overlays extends ItemizedOverlay {public Overlays(Drawable arg0) {    super(arg0);    Object overlayitem;    ItemizedOverlay.addOverlay(overlayitem);    Object itemizedoverlay;    ArrayList&lt;OverlayItem&gt; mapOverlays;    mapoverlays.add(itemizedOverlay);}private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;();super(boundCenterBottom(defaultMarker));public void addOverlay(OverlayItem overlay) {    mOverlays.add(overlay);    populate();}    @Override    protected OverlayItem createItem(int i) {      return mOverlays.get(i);    }    @Override    public int size() {        return 0;    }  }</code></pre><p>Sorry if i look like a complete newbie, but i am trying to learn and i got an awesome app idea which needs mapview, webview, overlays and tabs.</p>","273532","","","","","2011-07-24 07:24:09","Overlays not working in Google MapView Tutorial Android","<java><android><google-maps><overlays>","2","2","","",""
"2275025","1","","","2010-02-16 17:48:27","0","729","<p>Can you please tell me if/how can I use TextView to display an 'anchor' (a blue underline for text)?</p><p>Thank you.</p>","114970","","1406","","2011-07-27 18:14:41","2011-07-27 18:14:41","Android TextView to display anchor","<android>","1","0","","",""
"2275232","1","2277241","","2010-02-16 18:20:28","20","50985","<p>Im pulling a list of product objects from a database call and I want to build a ListView of the data in my activity with a non-scrolling header and footer. Each row will consist of a product thumbnail, some data and a button arranged horizontally. I understand that using the ListView I can inflate each row using a separate layout.</p><p>Most of the examples Ive seen using ListView just show a simple array of strings that fill the whole view of the activity, but most real-world examples will be more complex and I can't find any good examples that explain how all these pieces fit together.</p><p>Does anyone have any pointers to sample code with a good explanation ?</p>","246793","","387076","","2012-03-12 13:24:28","2012-05-23 06:56:26","Complex ListView example with complex data and complex layout of each row?","<android><listview><layout>","3","0","16","",""
"2275417","1","2275530","","2010-02-16 18:48:05","2","933","<p>In my app, I am persisting a CookieStore by writing it out to a file as a long String using SharedPreferences. When reading this String back in, I parse each cookie and its attributes (name, value, domain, path, version, expiry date) from the String using regexps. As I parse these attributes, I reconstruct a CookieStore by making a new BasicClientCookie object for each cookie that is parsed, then add each one to a new CookieStore. </p><p>My issue comes up when I am parsing the expiry date as follows:</p><pre><code>CookieStore cs = new CookieStore();SimpleDateFormat sdf = new SimpleDateFormat( ""EEE MMM d HH:mm:ss zzz yyyy"" );//name, value, domain, path, expiry, and version are cookie attribute strings that I have parsed//for(each cookie)BasicClientCookie bcc = new BasicClientCookie( name, value );bcc.setDomain(domain);bcc.setPath(path);bcc.setVersion(version);bcc.setExpiryDate( sdf.parse(expiry) );cs.addCookie(bcc);</code></pre><p>This works fine in OS 1.5: the SimpleDateFormat object is able to parse expiry dates with the following format: [expiry: Fri Apr 02 11:23:38 PDT 2010]</p><p>However, in OS 2.0 and above, the expiry dates are formatted differently: [expiry: Fri Apr 02 11:28:21 America/Los_Angeles 2010]</p><p>The timezone formatting differs in OS 2.0+ so the sdf.parse() method throws:W/System.err(10134): java.text.ParseException: Unparseable date: Fri Apr 02 11:35:34 America/Los_Angeles 2010</p><p>Now according to <a href=""http://developer.android.com/reference/java/text/SimpleDateFormat.html"" rel=""nofollow"">this</a>, I can parse timezones like ""America/Los_Angeles"" using the ""v"" format specifier. So I try an sdf object with ""EEE MMM d HH:mm:ss vvv yyyy"" format string but it does not recognize the ""v"" format specifier.</p><p>E/AndroidRuntime(10194): java.lang.IllegalArgumentException: Unknown pattern character - 'v'E/AndroidRuntime(10194):    at java.text.SimpleDateFormat.validateFormat(SimpleDateFormat.java:379)</p><p>I am building my project w/ the 1.5 SDK and my Java version is 1.6. I have not been able to find out why the ""v"" format specifier is not recognized. I am importing java.text.SimpleDateFormat. Is that the wrong one? Does anyone see a better approach to this?</p>","236300","","","","","2010-02-16 19:02:17","Cookie parsing issue w/ date in Android","<java><android>","1","0","1","",""
"2275712","1","2275781","","2010-02-16 19:33:36","3","6827","<p>Is there any way to retrieve the current cellular Signal Strength (RSSI) on Android 1.5?</p><p>I know there's a way to listen for signal strength updates through the <code>TelephonyManager</code>, but this seems to only give a ""state,"" not a numeric value.  </p><p>Is using the RSSI field on a neighboring cell fairly accurate?  I'm guessing not, but I'm running out of ideas.</p>","261513","","114066","","2010-02-17 10:33:34","2010-06-02 05:42:19","Get Cell RSSI(Network Signal Strength) on Android 1.5","<java><android><signal-strength>","3","0","","",""
"2275938","1","2276135","","2010-02-16 20:07:13","0","885","<p>I am making an android application that shows a list with users, I would like to add the image,name,status,and a button in every row of the list, just like in the androids 1.6 native caller-> favorites tab.Until know I have managed to add the image and name using an ListActivity but when I try to add the button the list becomes unselected.So I have 2 questions, first is the list mentioned above listviews or listactivities? also is this possible using listActivity? and second, what is the difference of the above mentioned classes? any link to tutorials would be apreciated.thanks in advanced maxsap.</p>","234898","","","","","2010-02-16 20:36:16","Making a list view like the favorite tab on native dialer in android","<android><listview><listactivity>","1","0","","",""
"2275980","1","2288342","","2010-02-16 20:13:13","4","2825","<p>I want to have my own Launcher Application for Android</p><p>in other words , I want my own Application to run directly after booting , instead of the Launcher app as I am not running Android on a Mobile phone , and I don't want Android's Home GUI</p><p>also I want to change the app in the source code , before compilation </p><p>I have tried to Simply replace files under ""/packages/apps/Launcher"" with my HelloWorld Appthen running this command ""mmm packages/apps/Launcher""but It didn't work</p><p>So any book/tutorial/advice that covers this point ??Thanks in advance</p>","234998","","","","","2010-02-18 11:54:21","Replacing Android's Launcher App before compilation","<android>","2","2","2","",""
"2276317","1","2361949","","2010-02-16 21:02:26","0","2027","<p>I want to obtain the current Local Area Code of the Cell the handset is currently loged in to. How do I get this information?</p>","114066","","","","","2011-06-16 14:02:21","How to obtain the current Local Area Code (LAC) of the handset in Android?","<android>","3","0","","",""
"2276438","1","2276590","","2010-02-16 21:20:25","1","1763","<p>I need button that has a replicated background pattern and normal button text on top - how to specify this in layout XML?</p>","246793","","918414","","2012-06-30 04:35:39","2012-06-30 04:35:39","Is it possible to have a Button with a background image with text on top?","<android><button><imageview>","2","0","","",""
"2276527","1","","","2010-02-16 21:33:26","0","64","<p>I need to install a program on the Droid.  I can get it onto the memory chip.  I can't get the droid to find it.  TIA.</p>","236414","","28098","","2010-02-16 21:39:49","2010-02-17 00:03:34","Independent program","<android><installation-package>","3","1","","",""
"2276533","1","2276878","","2010-02-16 21:35:07","0","161","<p>this is my first question and I've been messing around with android for just a couple of days now.</p><p>The problem arose when I tried to follow an example code to experiment with the MapView class (<a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a>).</p><p>I installed the Google APIs add-on in my SDK and did everything just as stated in the tutorial and the AVD ran the code perfectly, except for the fact that I got an empty grid instead of the actual map I thought I was supposed to see.</p><p>It looks like my debug key is wrong or something, but again here, I did everything just as stated in the tutorial. In fact, here's the line in my main.xml where the api key is specified:</p><pre><code>    android:apiKey=""48:C6:36:64:4A:DA:92:EF:D7:9E:BA:CD:26:45:EB:0D""</code></pre><p>I got this key using the keytool command just like this:</p><pre><code>    $ keytool -list -alias androiddebugkey -keystore /home/nelson/.android/debug.keystore -storepass android -keypass android</code></pre><p>I tried the built in map application that comes with the AVD when you install the google API and it works perfectly, so there must be something wrong with my application, but I just have no idea of what. Any help?</p><p>Thanks in advance</p><p>Nelson R. Perez</p>","274434","","","","","2010-02-16 22:28:58","Can't seem to download the tiles for my map application","<android><google-maps>","1","0","","",""
"2276597","1","2276930","","2010-02-16 21:46:36","1","1845","<p>i have a service running in background. I start it from an Activity, but i want to recovery an instance of that service from other activity (in the same app) in order to call one method.Is it possible?</p><p>Thanks</p>","258863","","","","","2010-02-16 22:37:25","Android: Get an instance from a service running","<android><service>","1","0","","",""
"2276641","1","","","2010-02-16 21:52:34","15","6421","<p>I'm developing an android word game app that needs a large (~250,000 word dictionary) available. I need:</p><ul><li>reasonably fast look ups e.g. constant time preferable, need to do maybe 200 lookups a second on occasion to solve a word puzzle and maybe 20 lookups within 0.2 second more often to check words the user just spelled.</li></ul><p>EDIT: Lookups are typically asking ""Is  in the dictionary?"". I'd like to support  up to two wildcards in the word as well, but this is easy enough by just generating all possible letters the wildcards could have been and checking the generated words (i.e. 26 * 26 lookups for a word with two wildcards).</p><ul><li>as it's a mobile app, using as little memory as possible and requiring only a small initial download for the dictionary data is top priority.</li></ul><p>My first naive attempts used Java's HashMap class, which caused an out of memory exception. I've looked into using the SQL lite databases available on android, but this seems like overkill.</p><p>What's a good way to do what I need?</p>","271566","","271566","","2010-02-16 22:17:20","2010-03-18 13:19:37","Way to store a large dictionary with low memory footprint + fast lookups (on Android)","<java><android><algorithm><data-structures><complexity-theory>","6","2","8","",""
"2276695","1","","","2010-02-16 22:03:00","5","2558","<p>I have activities that are create and launched from menu options. However Ive noticed that this may mean that sometimes there are two or more copies of the same activity. So Im wondering if there's a way to see if another activity is already instantiated and then have the application switch to it or create a new one if its not instantiated.</p>","246793","","","","","2012-08-10 10:21:19","Re-use previous activities?","<android><activity><switch><reusability>","3","0","1","",""
"2276797","1","2336704","","2010-02-16 22:18:34","3","2751","<p>I'm trying to debug an android app that call native code to do some GL rendering.  The native code is existing code that I'm trying to port (and that I don't really know that well).  I've got the existing code compiling, linking, and installing correctly, and I've got some native functions that call in to that code that are being correctly called from my Java code.  I'm getting a segfault that I'm trying to track down, and having some problems getting gdb to set a breakpoint in the program.  This is on windows XP with Cygwin - and I should probably mention I'm still learning gdb.</p><p>I started with the directions at <a href=""http://honeypod.blogspot.com/2008/01/debug-native-application-for-android.html"" rel=""nofollow"">http://honeypod.blogspot.com/2008/01/debug-native-application-for-android.html</a>; here's what I'm currently doing.</p><p>Start the app in the emulator.</p><p>In a cmd prompt:</p><pre><code>&gt; adb forward tcp:1234 tcp:1234&gt; adb shell# gdbserver localhost:1234 --attach 2120gdbserver localhost:1234 --attach 2120Attached; pid = 2120Listening on port 1234</code></pre><p>In a cygwin shell:</p><pre><code>arm-eabi-4.2.1/bin/arm-eabi-gdb.exe out/apps/app-android/libDM.soGNU gdb 6.6Copyright (C) 2006 Free Software Foundation, Inc.GDB is free software, covered by the GNU General Public License, and you arewelcome to change it and/or distribute copies of it under certain conditions.Type ""show copying"" to see the conditions.There is absolutely no warranty for GDB.  Type ""show warranty"" for details.This GDB was configured as ""--host=i686-pc-cygwin --target=arm-elf-linux""...(gdb) target remote localhost:1234Remote debugging using localhost:1234warning: shared library handler failed to enable breakpoint0xafe0da04 in AppRefCounted::unref () at ../../stlport/stl/_iosfwd.h:3939      class basic_ostream;Current language:  auto; currently c++(gdb) b Java_com_app_AppRenderer_onCreateBreakpoint 1 at 0xafff1b1a: file apps/app-android/../../../app-Android/jni/DMJNI/DMInterface.cpp, line 75.(gdb) cContinuing.Warning:Cannot insert breakpoint 1.Error accessing memory address 0xafff1b1a: Input/Output error.</code></pre><p>So it looks like the breakpoint gets set ok, and that the symbols are ok, but maybe the address is wrong when it tries to insert the breakpoint.  I've tried several variations of different commands from the webpage referenced above, but so far, no luck.</p><p>Any ideas what's going on?</p><p>Thanks</p>","1322","","1322","","2010-02-22 21:18:16","2010-02-25 18:47:32","gdb Input/Output error remote debugging to Android","<c++><android><gdb><android-ndk>","1","0","1","",""
"2277202","1","","","2010-02-16 23:31:20","1","1265","<p>The ContentProvider doc says to make ONE entry in the AndroidManifest for your ContentProvider class. If your class supports multiple sub-tables then there must be one CONTENT_URI constant declared for each. How? You can't do that unless you sub-class for each sub-table. Why not just have multiple providers?</p><p>Do you implement the sub-table providers as descendants? With multiple sub-tables, there is still only ONE ContentProvider class? </p><p>As you can see, I'm confused by the documentation. It reads:</p><blockquote>  <p>Define a public static final Uri named  CONTENT_URI. This is the string that  represents the full content: URI that  your content provider handles. You  must define a unique string for this  value. The best solution is to use the  fully-qualified class name of the  content provider (made lowercase). So,  for example, the URI for a  TransportationProvider class could be  defined as follows:</p></blockquote><pre><code>public static final Uri CONTENT_URI =                Uri.parse(""content://com.example.codelab.transporationprovider"");</code></pre><p>If the provider has subtables, also define CONTENT_URI constants for each of the subtables. These URIs should all have the same authority (since that identifies the content provider), and be distinguished only by their paths. For example:</p><pre><code>content://com.example.codelab.transporationprovider/train content://com.example.codelab.transporationprovider/air/domestic content://com.example.codelab.transporationprovider/air/international</code></pre><p>So, how many classes do we create to handle train, air/domestic and air/international?</p>","274835","","21234","","2010-02-16 23:52:49","2010-02-17 00:17:18","Class structure for a ContentProvider having multiple sub tables","<android><android-contentprovider>","1","0","3","",""
"2277371","1","2277563","","2010-02-17 00:06:59","1","2184","<p>is there any way to leave a thread in background when i close the app in android? I read about a Service but implementing it is too much than i need. Thanks</p>","258863","","","","","2010-02-17 18:02:28","Android: running a thread in background","<android><multithreading>","2","0","3","",""
"2277641","1","","","2010-02-17 01:03:09","2","1752","<p>I have a view that I am drawing to a bitmap, saving to disk and then putting in an ImageView via setImageURI. However, when the image is displayed in the ImageView it is not being shown at the correct size. It is about 1/3 smaller than it should be. I'm guessing that this is a density issue, but I can't figure out what's going wrong (my emulator is WVGA). Ideas anyone?</p>","13181","","","","","2013-01-10 14:55:00","Android ImageView.setImageURI scales image","<android>","3","4","1","",""
"2277732","1","2277819","","2010-02-17 01:29:45","6","8237","<p>When I created a button view, Android always create some extra space between this button and other views below it.</p><p>In this example below, there is a button above the second button. You can see the gap between these two buttons. How can I get rid of this gap? Thanks.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;Button android:id=""@+id/up""        android:layout_width=""fill_parent"" android:layout_height=""28dip""        android:textSize=""9sp"" android:gravity=""center"" android:text=""Hide sth""        android:layout_marginBottom=""0"" android:paddingBottom=""0"" /&gt;    &lt;Button android:id=""@+id/down""        android:layout_width=""fill_parent"" android:layout_height=""28dip""        android:textSize=""9sp"" android:gravity=""center"" android:text=""Show sth"" /&gt;   &lt;/LinearLayout&gt;</code></pre>","256239","","","","","2011-09-12 07:03:52","How to get rid of the extra gap between a button and other views?","<android>","2","1","2","",""
"2277877","1","","","2010-02-17 02:08:31","0","281","<p>I would like to ask for your advice,I have a list of items which r binded to database, and i want to serialize those items(through my database) to file, and in the future to deserialize them.now as we know, i have to go through all the rows in my database and create new object to each row and serialize the ""object packadge"" to the file.the prob is that if we have 10000 rows in my database, then it's 10000 allocations of objects..any idea how to avoid it?</p><p>thanks,ray.</p>","260511","","","","","2010-02-17 02:37:53","Serializing list to file","<android>","1","3","","",""
"2278200","1","","","2010-02-17 03:54:23","1","1059","<p>The object passing between an Android service and the remote binder is happening through serialization of the object.  If the service needs to return a very large collection, it seems very inefficient to use this. What is the recommended way to deal with this? </p><p>Thanks.</p>","274926","","","","","2010-02-17 09:28:04","How to pass complex data structures (example: a vector with many elements) between service and the remote binder?","<android>","1","0","","",""
"2278359","1","2283922","","2010-02-17 04:41:22","17","11205","<p>I am creating a game using the irrlicht c++ 3D graphics engine port to android platform. The graphics engine is written in c++. I need to be able to load meshes and textures etc from c++ code. My current plan is to place all the game asset files in either the res/raw directory or the assets directory then on startup copy these files to the sdcard so they are accessable from the irrlicht c++ code.Is this the best way to make the game media files accessable from c++?</p>","246240","","","","","2010-06-22 14:19:29","Android: How to make game asset files readable from c++ code using ndk","<android><file-io><android-ndk>","2","0","5","",""
"2278433","1","","","2010-02-17 05:01:25","3","2549","<p>Why doesn't this work??</p><p><code>db.execSQL(""INSERT INTO PARTIES (PARTY_NAME, PARTY_COUNT) SELECT DISTINCT(PARTY), COUNT(PARTY) FROM ? WHERE (Year=?) GROUP BY PARTY ORDER BY PARTY ASC"", new Object[] { ""Election"", ""2004"" });</code></p><p>It works perfectly in rawQuery!!</p>","274959","","243782","","2010-03-04 20:18:35","2012-10-20 01:00:58","execSQL SQLiteException near ""?""","<android><sqlite>","2","1","","",""
"2278625","1","2386301","","2010-02-17 05:53:39","2","3447","<p>i am working on displaying an image and placing an icon on top of it... clicking the icon will show an enlarged version of the image...</p><p>though putting the imageview holding the image in a LinearLayout scales the image to the width of the dialog, the problem is that i need to display the image in a dialog but the image is very high resolution and hence is far bigger than the width of the dialog...</p><p>I need to show the actual image with scrolling for both ways to see the whole image... But whenever i try putting the imageView in a scrollview the top of my imageview is blank... and again though image scrolls downwards the width is scaled to the width of the dialog...</p><p>Helppppppppp guys....</p>","238071","","21234","","2011-01-14 23:43:12","2011-01-14 23:43:12","android imageview scrolling to display full high quality image","<android><scrolling><imageview>","2","0","1","",""
"2278860","1","","","2010-02-17 06:57:36","0","70","<p>I have an android app. I added an intent filter to one of my activities, so that if a url is clicked in the browser app, my activity can be launched. Looks like this:</p><pre><code>&lt;data android:host=""www.mysite.com"" android:scheme=""http""&gt;&lt;/data&gt;</code></pre><p>this works well. The problem is that every time my activity is launched from the browser, a new instance of the activity is created, inside the browser app's task, instead of recycling any existing instance that may be in the system already.</p><p>This is a problem for me because this activity uses a singleton. If I allow more than one instance of this activity to exist, I can get into some weird situations where the two instances are in conflict when they try to share the singleton. I checked and can see that although the activity instances may be in separate tasks, they do share the same singleton instance.</p><p>An ideal solution for me would be if I could somehow bring a pre-existing instance of my application to the foreground, and launch or resume the target activity within whatever pre-existing instance of my app happens to be running.</p><p>So I tried this:</p><ol><li>Register above filter to point to dummy activity which is just a catcher.</li><li>Dummy activity creates a broadcast intent, and tries to broadcast 'create me' message to system.</li><li>Real target activity is set to listen for this broadcast message. Hopefully if there is already an instance of the activity in the system, it will come to the foreground. If no instance yet, that's ok, allow creation in the browser task.</li></ol><p>Not sure if this makes sense. My basic goal is to limit the activity to one instance in the system. The app is just social media app which has a login state that needs to be preserved. The singleton mentioned above preserves that login state, so I want to have only one around in the system, instead of allowing multiple login instances running around which would be a headache for the user.</p><p>Thanks</p>","246114","","","","","2010-02-17 07:07:57","Breaking the task barrier","<android>","1","0","","",""
"2278945","1","2281789","","2010-02-17 07:20:56","0","614","<p>As I am writing a Webservice client to deal with the webservices for my application in android, I am bit confused about the approaches among KSOAP2 and Android default HTTPCLient, Which one would be more relevant to use in Android</p><p>Suggestions Welcome.Thank you.</p>","28557","","","","","2010-11-04 08:25:17","When dealing with WebServices in Android which approach would be better KSOAP2 or Android default HTTPClient","<android><web-services><rest>","2","0","","",""
"2279082","1","2279132","","2010-02-17 07:50:59","1","1687","<p>Can you please let me know on various possibilities or best options for handling navigation on android application. Links to sample will be very much helpful, if possible. Its to do the following:</p><p>Application starts with a splash screen.The splash screen ends to display the following choices:</p><ul><li>Post a Quote </li><li>List my Quotes </li><li>List all Quotes </li><li>Search for Quotes</li></ul>","234405","","","","","2010-02-17 08:38:58","android menu navigation options","<android><menu><navigation>","2","0","","",""
"2279400","1","","","2010-02-17 09:07:01","2","1177","<p>How do I create a shared directory with read/write permissions to all applications installed on my phone and that is not on the sdcard?I tried that : </p><pre><code>File f = new File(""/tmp"");f.mkdir();</code></pre><p>but it is not working.</p>","164460","","186636","","2012-04-11 00:44:58","2012-04-11 00:44:58","android shared directory with read and write access","<android><directory><shared>","1","0","","",""
"2279579","1","3102599","","2010-02-17 09:42:15","3","4444","<p>The only thing I found is <a href=""http://www.kbrandt.com/2009/06/how-to-cross-compile-the-bash-shell-for-android-15.html"" rel=""nofollow"">to cross compile bash</a>. Is there another way to have tab completion in the Android shell?</p>","243238","","","","","2011-04-27 19:27:40","Tab completion in adb shell","<android>","3","0","3","",""
"2279647","1","2279827","","2010-02-17 09:55:51","166","125967","<p>I want to get longitude and latitude in Android emulator for testing.</p><p>Can any one guide me how to achieve this?</p><p>How do I set the location of the emulator to a test position?</p>","249991","","40867","","2013-10-24 21:51:12","2014-04-07 05:40:08","How to emulate GPS location in the Android Emulator?","<android><testing><android-emulator><geolocation>","16","0","87","",""
"2279690","1","","","2010-02-17 10:03:07","4","6281","<p>Preferably, I'd like a somewhat fancy bevel . I'd like the picture to have some depth on it..so it doesn't look so plain and old-fashion :)</p>","179736","","","","","2013-02-21 13:04:08","How do I set a border around an image in Android?","<java><android><image><coding-style>","2","0","","",""
"2279954","1","2280765","","2010-02-17 10:45:37","1","574","<p>Is there a way to change notification settings in the native email app (possibly also gmail)? </p><p>I'm thinking about locale plugin which would allow to change notification settings in each app independently. For example disable sound notifications in email app and leave in gmail... </p>","58862","","","","","2010-02-17 13:01:26","Changing notification settings in native email app","<android>","1","1","","",""
"2279978","1","2766399","","2010-02-17 10:49:03","55","15879","<p>I am giving the following method call to my webview client embedded in my layout<br><code>wv.loadData(""&lt;html&gt;&lt;body bgcolor=\""Black\""&gt;&lt;/body&gt;&lt;/html&gt;"",""text/html"", ""utf-8"");</code>  </p><p>when i run this on the device, it shows a white vertical bar on the right side. I fixed the white thing by using <code>webview.setBackgroundColor(Color.BLACK);</code> but i want to remove it completely</p><p>Following is my layout xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;    &lt;WebView android:id=""@+id/wv1""            android:layout_height=""fill_parent""            android:layout_width=""fill_parent""            /&gt;&lt;/LinearLayout&gt;</code></pre><p>Any suggestions??</p>","237403","","237403","","2010-02-17 11:45:02","2013-12-27 09:59:37","webview showing white bar on right side","<android>","4","1","31","",""
"2280060","1","2285509","","2010-02-17 11:07:46","2","1596","<p>The <a href=""http://developer.android.com/reference/android/widget/AbsoluteLayout.html"" rel=""nofollow"">AbsoluteLayout</a> class is deprecated but still can write it in code and it works. Will there be any problems if I use this class? Will the application work correctly after I deploy it on a phone? </p><p>Thanks </p>","235123","","76835","","2010-02-18 00:29:14","2013-01-23 06:17:52","Using the deprecated AbsoluteLayout class in Android?","<android><absolutelayout>","2","2","","",""
"2280079","1","2468479","","2010-02-17 11:11:48","12","2137","<p>I've just started debugging my first three line long android app and I can't seem to use the debug tool like I want to.Here's my code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  int a = 1 / 0;}</code></pre><p>Now I expect the debugger to halt the thread and show me the line number of statement where the division by zero occurs. No, instead it shows some <a href=""http://pastebin.com/f78b9d8af""><em>other</em> method</a> internal to the system for which I have no source. To make the matters worse, there is no exception message either.</p><p>Prior to this app, I created one which would do something when a button was pressed. If any exception was raised, again no useful line number or exception message would be shown.</p><p>As of right now, there is no way to debug my app. Any ideas?</p><p>I'm using the latest SDK along with Eclipse ADT plugin and debugging on a real device (Nexus One).</p>","319954","","","","","2010-03-18 08:57:47","Seemingly useless debugging environment for Android","<android><debugging>","3","4","3","",""
"2280298","1","2280776","","2010-02-17 11:50:38","1","2499","<p>How can I retrieve the java script function value from a web page loaded withing a webview component??</p>","237403","","","","","2010-02-17 13:03:09","How to retreive java script function value in webview component","<android><javascript-events>","1","0","","",""
"2280345","1","2280426","","2010-02-17 11:57:51","5","11977","<p>I am getting this exception in database Leak Found</p><p>my LOGCAT Shows this:</p><pre><code>02-17 17:20:37.857: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.example.brown/.Bru_Bears_Womens_View (has extras) }02-17 17:20:38.477: DEBUG/dalvikvm(434): GC freed 1086 objects / 63888 bytes in 119ms02-17 17:20:38.556: ERROR/Database(434): Leak found02-17 17:20:38.556: ERROR/Database(434): java.lang.IllegalStateException: /data/data/com.example.brown/databases/BRUNEWS_DB_01.db SQLiteDatabase created and never closed02-17 17:20:38.556: ERROR/Database(434):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1694)02-17 17:20:38.556: ERROR/Database(434):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:738)02-17 17:20:38.556: ERROR/Database(434):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:760)02-17 17:20:38.556: ERROR/Database(434):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:753)02-17 17:20:38.556: ERROR/Database(434):     at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:473)02-17 17:20:38.556: ERROR/Database(434):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)02-17 17:20:38.556: ERROR/Database(434):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)02-17 17:20:38.556: ERROR/Database(434):     at com.example.brown.Brown_Splash.onCreate(Brown_Splash.java:52)02-17 17:20:38.556: ERROR/Database(434):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-17 17:20:38.556: ERROR/Database(434):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)02-17 17:20:38.556: ERROR/Database(434):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)02-17 17:20:38.556: ERROR/Database(434):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)02-17 17:20:38.556: ERROR/Database(434):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)02-17 17:20:38.556: ERROR/Database(434):     at android.os.Handler.dispatchMessage(Handler.java:99)02-17 17:20:38.556: ERROR/Database(434):     at android.os.Looper.loop(Looper.java:123)02-17 17:20:38.556: ERROR/Database(434):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-17 17:20:38.556: ERROR/Database(434):     at java.lang.reflect.Method.invokeNative(Native Method)02-17 17:20:38.556: ERROR/Database(434):     at java.lang.reflect.Method.invoke(Method.java:521)02-17 17:20:38.556: ERROR/Database(434):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-17 17:20:38.556: ERROR/Database(434):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-17 17:20:38.556: ERROR/Database(434):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>how can i solve it???</p><p>thanks in advance...</p>","267269","","1288","","2011-03-25 14:12:09","2011-03-28 10:03:24","Sqlite Database LEAK FOUND exception in android?","<android><memory-leaks>","3","0","3","",""
"2280361","1","2283487","","2010-02-17 12:00:20","17","7668","<p>I am facing exactly the problem mentioned in these links:</p><p><a href=""http://code.google.com/p/android/issues/detail?id=2373"">http://code.google.com/p/android/issues/detail?id=2373</a></p><p><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/77aedf6c7daea2ae/da073056831fd8f3?#da073056831fd8f3"">http://groups.google.com/group/android-developers/browse_thread/thread/77aedf6c7daea2ae/da073056831fd8f3?#da073056831fd8f3</a></p><p><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/2d88391190be3303?tvc=2"">http://groups.google.com/group/android-developers/browse_thread/thread/2d88391190be3303?tvc=2</a></p><p>I have a simple root activity with the LAUNCHER and MAIN intents and <em>nothing else</em>. I start another activity with has <em>no flags or anything extra</em> in the manifest whatsoever.</p><p>I launch the app (root activity) and from there start the 2nd activity. On pressing the Home button the task goes to the background. On launching the app again (from Launcher or from holding the Home button for recent apps) it starts a new instance of the root activity on top of the existing stack.</p><p>If I press the back button, the new ""root"" activity closes and the old 2nd activity is visible, which means its launching the root activity in the same task instead of bring the task to the foreground.</p><p>To counter this I made the root activity's launch Mode <em>singleTask</em>. Now when I press home and launch the app again, it clears the activities above the old root task and brings the old root task to the foreground instead of just bringing the entire old task with the 2nd activity on top to the front. Note that the old root task still retains its application state, which means it wasn't a new instance, but the the higher activities had been killed.</p><p>Why isn't the problem fixed by now? It's been almost a year! It even occurs on other applications downloaded from the market. The manual install method has no effect for me, it still launches the same way.</p>","274972","","300836","","2012-04-20 06:23:52","2012-07-02 17:46:23","App always starts fresh from root activity instead of resuming background state (Known Bug)","<android><activity><resume><task>","2","2","8","",""
"2280392","1","","","2010-02-17 12:06:05","2","369","<p>I'm trying to use ACTION_IMAGE_CAPTURE  to get an image from Camera. What places is safe to use as the EXTRA_OUTPUT ?</p><p>The only one i've found myself is sdCard, but it seems unconvinient to me (i need a permission, and user has to have an sdCard). Is there another place, i can use? </p>","275213","","","","","2012-11-09 04:42:23","What's safe to use as EXTRA_OUTPUT","<android><camera>","1","0","","",""
"2280548","1","","","2010-02-17 12:32:31","0","5353","<p>Hi all in my application by using web service i get the data from database and stored that data in hash table.I took that  data from  hast table to array.this array data can be displayed in button.My array contains 10 elements.For animation i used view flipper.Now i want to do is display that array elements on button one after another for every 10sec.But in Updater method i didn't get all array elements.How to solve this one</p><p>i am sending my code//in on create method i wore this one</p><p>user_advertise is the hash table</p><pre><code>                     System.out.println(""""+user_advertise.size());             array=new String[user_advertise.size()];            e= user_advertise.keys();            int i = 0;            int j=0;            for(i=user_advertise.size();;i++){            array[j]=e.nextElement().toString();            LinearLayout layout = (LinearLayout) findViewById(R.id.LinearLayout01);             LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(                                 LinearLayout.LayoutParams.FILL_PARENT,                                 LinearLayout.LayoutParams.WRAP_CONTENT                         );             Button buttonView = new Button(this);              buttonView.setText("""" +array[i]);            Timer timing = new Timer();            timing.schedule(new Updater(buttonView), 3000, 3000);             ViewFlipper flipper = new ViewFlipper (this);              flipper.addView(buttonView);             layout.addView(flipper,p);             flipper.startFlipping();             flipper.setClickable(true);             flipper.setFlipInterval(10000);             flipper.setInAnimation(AnimationUtils.loadAnimation(this,R.anim.push_left_in));             flipper.setOutAnimation(AnimationUtils.loadAnimation(this,R.anim.push_left_out));            }             }catch(Exception e)            {                Log.v(""Add"",e.toString());            }    }private class Updater extends TimerTask {    private final Button buttonView;    public Updater(Button buttonView) {        this.buttonView = buttonView;    }    public void run() {        buttonView.post(new Runnable() {            public void run() {                int k=0;                    buttonView.setText("" "");                    buttonView.setText(""""+array[k].toString()+"""");                if(array[++k]!= null)                {                    k++;                }            } </code></pre>","217065","","","","","2010-02-17 13:27:11","How to get elements from array list in android","<android>","1","0","","",""
"2280699","1","","","2010-02-17 12:53:11","4","288","<p>In one Activity, I am doing this:</p><ul><li>Every minute, I update the GPS location to the cloud.</li><li>Then, after the location is updated, I download a list of 10 people and their icons...and update them in the list. (each icon is 80x80 and about 2Kb)</li></ul><p>This is done every minute, over and over.</p><p>My problem is: It seems to be a little slow?  Sometimes when I swipe down the list, it's slow? And when I click, the response is not immediate...and may require a little hold.</p><p>Do you think I can fix this with multiple ""threads"" or something? Please advise. Thanks.</p><p><strong>Edit: When it's loading the names and user-icons into the list...it's practically unusable. The list freezes...and you can't swipe up or down.</strong> And when it's not loading ...the list swipes very slowly.</p>","179736","","179736","","2010-02-17 13:05:16","2010-02-17 14:04:05","Any advice on how to speed up this in Android?","<java><android><multithreading><optimization><listview>","3","0","","",""
"2280822","1","5610477","","2010-02-17 13:09:01","4","3489","<p>I am having problem with setting a new Drawable to my ProgressBar. </p><p>If I use the setProgressDrawable() inside onCreate() method it works great. But when I try to call the same method inside a Handler post callback it doesn't work and the progressbar disapears.</p><p>Can someone explain this behaviour? How can I solve this problem?</p>","275251","","65863","","2011-12-02 01:35:35","2013-04-08 06:26:46","How to use setProgressDrawable() correctly?","<android><progress-bar>","3","3","1","",""
"2280845","1","","","2010-02-17 13:11:59","2","1340","<p>Suppose I have an Activity that's a list. It calls a Service when this Activity starts.  The Service will do background stuff--download, parse, and fill the list.</p><p>My question is this: How can the <strong>Service communicate with the Activity</strong>?How can I call a method in the Activity, from the Service? (I'm new to OOP)</p><p>The Service is started like this:</p><pre><code>hello_service = new Intent(this, HelloService.class);startService(hello_service);</code></pre><p>One of the things my service does is download and parse an XML. After that, it needs to fill a list! So, I want to pass the parsed stuff back to the Activity, and call a method in the Activity to fill that list.</p>","179736","","179736","","2010-02-17 13:24:49","2012-12-31 09:58:32","How does a Service communicate with its Activity? How can a Service call a method in the Activity, which started that Service?","<java><android><service><activity>","2","0","","",""
"2281046","1","","","2010-02-17 13:41:33","0","713","<p>i am trying to do some simple animation, i have list with items, those items include  also checkboxes on a checkbox button click i want to show with animation some button from the buttom, something like this:</p><p>private int mPosition;        private CheckBox chkBox;</p><pre><code>    OnItemClickListener(CheckBox mChkBox, View v)    {        chkBox = mChkBox;        chkBox.setClickable(false);        chkBox.setChecked(false);        chkBox.setClickable(true);    }    @Override    public void onClick(View v)    {        if (chkBox.isChecked())                        {                                  animation = AnimationUtils.loadAnimation(context,                R.layout.animation_slide_in);                animation.setDuration(500);                animation.setInterpolator(new  AccelerateInterpolator());                btDeleteItms.startAnimation(animation);                btDeleteItms.setVisibility(btDeleteItms.VISIBLE);                        }</code></pre><p>now the wierd thing, that after i click the checkboxbutton, the animation does work fine,but the state of the triggering checkbox button, is being uncheck unexpectdly?how come? does animation resetting states somehow?</p><p>Thaks,</p><p>ray.</p>","260511","","","","","2011-02-02 03:51:26","Animation resetting view state?","<android>","1","0","","",""
"2281317","1","2281332","","2010-02-17 14:15:00","2","2374","<p>how to get MapView API in android?</p><p>thanks</p>","267269","","","","","2012-05-02 09:50:01","how to get MapView API in android?","<android><android-mapview>","3","1","1","",""
"2281321","1","2281794","","2010-02-17 14:15:17","2","2858","<p>I want to send an intent to my service everytime the state of Wifi connectivity changes.</p><p>So when I currently use a broadcast receiver to listen for the state changes in Wifi, so when this recieves an intent I want to be able to send this info on to my service.</p><p>Is this possible and if so the correct way to do it?</p>","243999","","","","","2010-07-11 06:05:33","Android - Can I send an intent on Wifi state change to a service?","<android><android-intent><broadcastreceiver>","1","0","1","",""
"2282067","1","2286945","","2010-02-17 15:46:19","0","2700","<p>I am trying to create a tab widget with two tabs to open two different activities and written following layout to achieve this but it is giving me a <code>NullPointerException</code>. </p><p>Where is my mistake?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/tabhost""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;     &lt;LinearLayout         android:orientation=""vertical""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""&gt;         &lt;TabWidget             android:id=""@android:id/tabs""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content"" /&gt;         &lt;FrameLayout             android:id=""@android:id/tabcontent""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""&gt;         &lt;/FrameLayout&gt;     &lt;/LinearLayout&gt; &lt;/TabHost&gt;</code></pre><p>In the Java class which is extending <code>TabWidget</code> I have the following code in the <code>onCreate</code> method:</p><pre><code>setContentView(R.layout.more);TabHost mTabHost = (TabHost) this.findViewById(R.id.tabhost);mTabHost.setup();Intent intent;intent = new Intent().setClass(this, Settings.class);mTabHost.addTab(mTabHost.newTabSpec(""tab_test1"").setIndicator(                        ""Calculator"",                         getResources().getDrawable(R.drawable.tab01)).setContent(intent));intent = new Intent().setClass(this, Post.class);                mTabHost.addTab(mTabHost.newTabSpec(""tab_test2"").setIndicator(                        ""YouTube"",                         getResources().getDrawable(R.drawable.tab02)).setContent(intent));</code></pre>","249991","","3171","","2010-02-17 16:02:09","2010-02-18 07:33:23","TabWidget NullpointerException?","<android><tabwidget>","2","3","0","",""
"2282278","1","","","2010-02-17 16:12:17","0","836","<p>I have 3 classes.</p><p>Class AddText(extends Activity), Grafitti(extends MapActivity) and MarkerOverlay.</p><p>Grafitti calls AddText, and AddText opens a new Activity that gets an input from user (EditText), then when that is successful Grafitti calls MarkerOverlay.</p><p>The problem is I can't access the input in AddText. I need to use that input in MarkerOverlay, I tried creating a setter and getter but it won't work. (error)</p><p>I've tried searching the web and I think the solution is Bundle. I'm having a hard time understanding how Bundle works. Is there any other way? or any code snippet on how to use Bundle.  A code snippet would really help me a lot.  </p>","245385","","","","","2010-02-17 23:22:54","pass value from one class to another","<android>","2","0","","",""
"2282359","1","","","2010-02-17 16:20:31","7","32607","<p>This is the code in my Activity. Initiate an <strong>Intent</strong>, then a <strong>Connection</strong>, right?</p><pre><code>hello_service = new Intent(this, HelloService.class);hello_service_conn = new HelloServiceConnection();bindService( hello_service, hello_service_conn, Context.BIND_AUTO_CREATE);</code></pre><p>But my question is...what goes inside the Connection?</p><pre><code>   class HelloServiceConnection implements ServiceConnection {        public void onServiceConnected(ComponentName className,IBinder boundService ) {        }        public void onServiceDisconnected(ComponentName className) {        }    };</code></pre><p>Can someone tell me what code I put into <strong>onServiceConnected</strong> and <strong>onServiceDisconnected</strong>?</p><p>I just want a basic connection so that my Activity and Service can talk to each other.</p><p>Edit: I found a good tutorial, and I can actually close this question, unless someone wants to answer. <a href=""http://www.androidcompetencycenter.com/2009/01/basics-of-android-part-iii-android-services/"">http://www.androidcompetencycenter.com/2009/01/basics-of-android-part-iii-android-services/</a></p>","179736","","","","","2012-11-20 19:02:55","How do I bind this service in Android?","<java><android><service><activity><android-intent>","2","0","4","",""
"2282395","1","2282468","","2010-02-17 16:24:59","0","980","<p>cause the android build in downloadmanager is not reachable by sdk applications i have to implement one by myself. Before starting i want to get feedback how to make it the best way. So here we go:</p><p>Requirements:</p><p>basic:Listview with one download per rowbutton to cancel active downloadsprogress view of the downloads(and so on)(no questions so far)</p><p>I have to reach the downloadmanager from my main activity, start a download -> change to downloadmanager activity and then change back to the main activity but the downloadactivity should stay in the background downloading.</p><p>So whats the best way implementing this? Is it possible to keep an activity active in the background, then i could use asynctask to download the files. If not, is it better to use a service and reach that service by the downloadmanager activity so i can close the activity while downloading.</p><p>Would be nice to get some input from the experts cause i'm still a beginner.</p><p>Thank you</p>","268575","","","","","2010-02-17 16:35:49","Downloadmanager Concept","<android>","1","0","","",""
"2282435","1","2480440","","2010-02-17 16:31:45","13","14749","<p>Maybe it's easy, but I couldn't really figure this out right so far... I got a <code>BroadcastReceiver</code> waiting to get triggered by the AlarmMangager - this works fine.</p><p>Now: because the event, if it occurs, needs to refresh some elements on screen of the main Activity, I would like to send an Intent from that background BroadcastReceiver to my Activity - <strong>but only</strong> if it is currently in the foreground, aka active.</p><p>If it is not running or not visible, I don't care - and the last thing I want to do is start the Activity by my intent! I handle repainting of the views in my onResume() method, so I don't care at all.</p><p>Any hints on how to do that?Thanks!</p><p><strong>EDIT:</strong> my BroadcastReceiver is waiting for alarms that must be notified to the user. So, it must be there and declared in the manifest. The problem is: it will have to decide whether the mentioned Activity is currently up in front or not.</p>","273456","","273456","","2011-09-13 11:57:02","2011-09-13 11:57:02","Inform Activity from a BroadcastReceiver ONLY if it is in the foreground","<android><broadcastreceiver>","2","0","17","",""
"2282553","1","2282759","","2010-02-17 16:44:35","3","9783","<p>when i extends the MapActivity class it shows an error. </p><p>error is:cant resolved datatype. why?</p><p>how to add a maps.jar in my project?</p><p>thanks.</p>","267269","","56763","","2010-02-17 16:46:13","2012-09-19 06:56:20","MapActivity class in android?","<android><android-emulator>","3","0","","",""
"2282949","1","2324298","","2010-02-17 17:32:10","1","1762","<p>Which types of mutex does bionic libc support? </p><ul><li>recursive</li><li>timed</li><li>adaptive</li><li>errorchecking</li></ul>","196561","","539542","","2012-01-15 06:08:04","2012-01-15 06:08:04","bionic (android libc) mutex variants","<android><pthreads><mutex><libc><bionic>","1","0","2","",""
"2283208","1","2283354","","2010-02-17 18:07:41","8","2544","<p>I'm a developer looking to create an Android application to record phone calls. This spawned out of my own personal need to record phone calls for my own purposes and for my records. </p><p>Is it possible to do this? Is it possible to get access to the microphone and what's coming through the speaker? </p><p>I'm kind of new to Android development, so bear with me :) I assume that I could probably record into WAV and then at the end of the call, transcode it into MP3 using LAME or something. This may kill the battery, but this seems like a good project for me to get used to Android with. I'm looking to use Android 2.X. </p>","128967","","","","","2011-11-29 14:25:04","Is it possible to record phone calls via an Android App?","<android><audio><audio-recording>","1","0","","",""
"2283398","1","2285542","","2010-02-17 18:35:07","39","29340","<p><code>02-18 00:02:08.432: ERROR/PackageManager(57): Package com.example.brown requires unavailable shared library com.google.android.maps; failing!</code></p><p>I got this exception in logcat.</p><p>Can anyone guide me?</p>","267269","","646806","","2012-06-23 11:54:33","2014-02-02 17:05:25","Shared library missing in android.","<android><android-mapview>","8","1","7","",""
"2283444","1","2283993","","2010-02-17 18:42:48","54","76125","<p>How can i create a button with no text and an image centered horizontally ? I don't want to use an ImageButton because I want to define a different backgound image </p>","164460","","","","","2013-05-31 20:17:08","android image button","<android><image><button>","4","0","9","",""
"2283621","1","","","2010-02-17 19:09:07","7","2591","<p>Can the Android JVM run on a PC also?</p><p>or is it limited to working on a mobile device only?</p><p>From what I understand, when you develop using eclipse it is emulated, not running the actual jvm correct?</p>","275475","","14343","","2010-07-14 23:42:52","2014-02-28 21:44:15","Can the android JVM run on a PC also?","<java><android>","5","3","1","",""
"2283632","1","2283678","","2010-02-17 19:12:03","2","6152","<p>i am working on mapactivity.</p><p>map.jar file in sdk\add-ons path.</p><p>how to add it in my project??</p><p>thanks..</p>","267269","","129688","","2010-02-17 21:21:33","2013-12-19 17:20:16","how to add map.jar into myproject in android?","<android><eclipse><google-maps><android-emulator><android-mapview>","2","1","","",""
"2284312","1","2372721","","2010-02-17 20:54:13","4","565","<p>Is it possible for me to build my own version of android and put it on my samsung galaxy spica lite?I would suspect that Samsung needs to put their drivers into open source since android is open source?</p>","4189","","","","","2010-03-03 15:52:59","How do I build my own android for the samsung galaxy","<android>","2","0","","",""
"2284405","1","2284462","","2010-02-17 21:06:52","0","513","<p>i have a question about Services in Android.I have a application with two Services A and B.Is it possible that Service A can stop Service B?I dont want to do it through a Activity, cause the Application will be in Background. If some special Event happen in Service A, then it should tell Service B to stop. How can i do that? </p>","275595","","","","","2010-02-17 21:14:49","Service stopping another Service","<android>","1","0","0","",""
"2284545","1","2284563","","2010-02-17 21:31:03","1","839","<p>The <a href=""http://developer.android.com/reference/android/widget/AbsoluteLayout.html"" rel=""nofollow"">AbsoluteLayout</a> class is deprecated but still can write it in code and it works. Will there be any problems if I use this class? Will the application work correctly after I deploy it on a phone? </p><p>Thanks </p>","235123","","76835","","2010-02-18 00:27:12","2010-11-12 18:08:00","Using the deprecated AbsoluteLayout class in Android?","<android><absolutelayout>","2","4","","",""
"2284677","1","2285591","","2010-02-17 21:52:59","0","834","<p>Can you please tell me how can I place an background image to a the left upper corner of TextView in android? I would like the image not to be scaled by android.</p><p>I have tried </p><p>Resources res = getResources(); setCompoundDrawables(res.getDrawable(R.drawable.icon48x48_1), null, null, null);</p><p>Nothing is shown.</p><p>And I have triedsetBackground(R.drawable.icon48x48_1); </p><p>But it stretches the image.</p><p>Thank you for any help.</p>","128983","","","","","2010-02-18 00:55:11","How can I place an background image to a the left upper corner of TextView in android","<android>","3","0","","",""
"2284836","1","2285217","","2010-02-17 22:18:45","4","3518","<p>Here's scenario:</p><ol><li>I have 2 activities and one service</li><li>First activity is a landing view/search page. Second activity displays search results</li><li>Search is always executed against internal SQLite db</li><li>Periodically (say daily) db needs to be updated from the remote source which is a long process</li><li>If user performs the search during the update I want to wait until the update is over while displaying ""Please wait"" progress alert. I don't want to query and display search results until refresh is fully done.</li><li>The db update is triggered by AlarmManager and executed by service which puts ""UPDATING"" status into db while update is in progress</li><li>I can easily query the status but how do I wait and periodically re-query the database? I'm using AsyncTask to process search results and my knee-jerk reaction was to put a loop with wait() into <code>AsyncTask#doInBackground</code> method but that's dangerous and simply doesn't work since I'm not controlling the UI thread so I end up with <code>IllegalMonitorStateException</code>.</li></ol><p>What would be a ""right"" way to properly wait (may be even with status update) in this case?</p><p>P.S. I placed the ""wait"" code into a Runnable and executing it even before I get to my AsyncTask. It works e.g. <code>Thread.sleep(2000)</code> still I'm not sure that's the way to do it safely. Does anyone have any experience with <code>FutureTask</code>?</p>","135946","","135946","","2010-02-18 19:02:18","2010-02-18 19:02:18","Android: how to properly wait on service process completion","<android><background><notifications><updates>","2","0","2","",""
"2284851","1","2299774","","2010-02-17 22:21:27","15","7076","<p>When I take a picture with Androids camera app, it detects the phone's orientation and saves the pic accordingly. So if i take a picture of a building, the roof will be on the topside, whether I hold the phone in landscape position or portrait.</p><p>However, when i use </p><blockquote>  <p>Intent imageCaptureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);</p></blockquote><p>to get a picture, the camera app doesn't react to orientation.If i hold the phone vertically (portrait), the resulting pic will be rotated, with said building's roof to the left of the screen.</p><p>How can I set the intent so that the camera will take orientation into account?</p><p>Or can I deduce in some way in what orientation the pic was taken and rotate it myself afterward?</p><p>Or any other suggestion will be greatly appreciated.</p><p>~Thanks in advance, best regards.</p>","441621","","","","","2013-12-06 18:08:33","How can i find the orientation of a picture taken with Intent MediaStore.ACTION_IMAGE_CAPTURE?","<android><camera><android-intent>","2","0","1","",""
"2285150","1","2285441","","2010-02-17 23:10:27","8","5028","<p>Im using a LinearLayout to put two buttons horizontally side-by-side, but I want to each button to size itself to use 50% of the horizontal space. I thought layout_weight of ""1"" for each button would do the trick, but maybe my layout_width needs to be changed?</p>","246793","","","","","2010-02-18 00:16:32","Layout buttons so each divides up the space equally","<android><layout><button><sizing>","2","0","1","",""
"2285210","1","2285487","","2010-02-17 23:22:18","2","4403","<p>i have a problem with bindService. In my Activity i have the following code:</p><pre><code>private ServiceConnection mConnection = new ServiceConnection() {        public void onServiceConnected(ComponentName className,            IBinder service) {        mService = IPrimary.Stub.asInterface(service);    }    public void onServiceDisconnected(ComponentName className) {        mService = null;    }};public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mContext = this;    requestWindowFeature(Window.FEATURE_NO_TITLE);    setContentView(R.layout.login);    mApi = new ApiRequest(SIGNIN_METHOD);    boolean isConnected = bindService(new Intent(IPrimary.class.getName()),            mConnection, Context.BIND_AUTO_CREATE);</code></pre><p>But isConnected is equals to false every time.</p><p>In my manifest file i have:</p><pre><code>        &lt;service android:name="".DownloaderService""&gt;  &lt;intent-filter&gt;&lt;action android:name="".IPrimary"" /&gt;</code></pre><p>  </p><p>si i don't understand the problem. In logcat appears: </p><p>I/ActivityManager(   52): Displayed activity com.touristeye.code/.LogIn: 485918 ms (total 913151 ms)</p><p>Thank you</p>","258863","","","","","2011-11-06 02:09:21","Android bindService problem","<android><service>","2","0","","",""
"2285216","1","2285473","","2010-02-17 23:22:52","4","2247","<p>I uploaded my application to Market and then downloaded it to my phone. Now I'm unable to use debug keystore which is used by default by Eclipse ADT Plugin (<em>Re-installation failed due to different application signatures</em>) and when I'm trying to setup own keystore in Eclipse->Windows->Android->Build->CustomDebugKeystore, I'm unable to enter password or accept keystore and type password later.</p><p>Is there anything I can do or only way do debug app on device is to uninstall market version and deal with default debug keystore?</p>","7162","","","","","2010-09-13 21:22:35","Android: debug app on device with Eclipse and password-protected keystore?","<android><default><signing><keystore>","2","0","","",""
"2285305","1","","","2010-02-17 23:40:32","3","946","<p>Is there any way (e.g. with the command-line) I can upload an APK to an android phone wirelessly (wifi or Bluetooth) and launch it on the phone from a desktop machine?</p><p>I can do this things with <code>abd</code> from the command line when a USB cable is attached but I'd like to know if I can do this without having to mess around with cables.</p>","271566","","76835","","2010-02-18 00:19:07","2012-03-27 13:13:24","Upload and launch apk on phone wirelessly from desktop for developing","<android>","3","0","","",""
"2285351","1","2291723","","2010-02-17 23:53:45","0","1835","<p>I am using following code to send sms message:</p><pre><code>SmsManager sms = SmsManager.getDefault();sms.sendTextMessage(phoneNo, null, message, null, null);</code></pre><p>But when this code is executed two sms messages are sent.Does anybody have idea what can be a problem?</p><p>I am using HTC Tattoo with android 1.6I have tested this code on HTC Hero and everything is OK (only one message is sent).</p>","100814","","","","","2010-02-18 19:51:23","Android dev, SmsManager and double SMS","<android>","2","1","1","",""
"2285522","1","4437350","","2010-02-18 00:36:24","7","4186","<p>I have a task where the user can select an image from a GridView representing a photo album, and from this I start a new activity which displays a Gallery widget to show the images of the photo album. However, I can't seem to get the Gallery widget to show the contents of the photo album with a given image as the starting point. Ideally I would like a Gallery#setStartingImage(int position) or something similar.</p><p>Any ideas would be greatly appreciated.</p>","204468","","204468","","2010-07-10 23:10:40","2010-12-14 08:49:24","Set Android Gallery widget to show specific starting image","<android><android-widget><gallery>","1","3","0","",""
"2285536","1","","","2010-02-18 00:42:00","2","2334","<p>I created a Gallery that contains buttons.</p><p>Example code is below:</p><pre><code>public class Adapter extends BaseAdapter {    private Context mContext;    public ImageAdapter(Context c) {        mContext = c;    }    public int getCount() {        return 10;    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {        Button but = new Button(mContext);        return but;    }}</code></pre><p>The gallery view is displayed well. The problem is that this gallery is not scrollable any more. If I replace Button with ImageView in the getView method, the gallery view scroll well. Then, how can I make the gallery containing buttons to scroll?</p><p>Thanks.</p>","256239","","","","","2011-04-21 07:04:31","Question on creating a Gallery view containing buttons?","<android>","1","0","1","",""
"2285680","1","","","2010-02-18 01:17:47","18","6959","<p>Can someone tell me the <strong>TRUE</strong> difference?</p>","179736","","","","","2011-08-19 09:59:33","I don't know when to use a Service or AsyncTask or Handler","<java><android><service><handler><android-asynctask>","5","0","19","",""
"2285843","1","2288513","","2010-02-18 02:07:24","4","1235","<p>My app needs to send some data to a server when the device is connected.</p><p>I have been reading about native Android Broadcast actions. I was willing to find a way to use one as gmail does when the device connects to the Internet. (The ""loading"" icon on the top while it syncs mails)</p><p>Is it <a href=""http://developer.android.com/reference/android/content/Intent.html#ACTION_SYNC"" rel=""nofollow"">ACTION_SYNC</a> what I am looking for?</p><p>If not, how does gmail knows when the device connects to internet?</p>","119895","","","","","2010-02-18 12:23:44","Sending data to a server when the device is connected to Internet","<android>","1","0","2","",""
"2285917","1","2286800","","2010-02-18 02:36:25","0","587","<pre><code>private class ExecuteLocations extends AsyncTask&lt;String, Void, Void&gt;{    private final ProgressDialog dialog = new ProgressDialog(ListProfiles.this);    protected void onPreExecute() {        //this.dialog.setMessage(""Starting pre-execute..."");        //this.dialog.show();    }    @Override    protected Void doInBackground(String... arg0) {        check_profiles_lm=(LocationManager) ListProfiles.this.getSystemService(LOCATION_SERVICE);          myLocListen = new LocationListener(){            @Override            public void onLocationChanged(Location location) {                HashMap params = new HashMap();                params.put(""lat"", Double.toString(location.getLatitude()));                params.put(""long"", Double.toString(location.getLongitude()));                postData(""http://mydomain.com"",params);            }            @Override            public void onStatusChanged(String provider, int status,Bundle extras) {             }            @Override            public void onProviderDisabled(String provider) {             }            @Override            public void onProviderEnabled(String provider) {            }        };              check_profiles_lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 30000, 0, myLocListen);        return null;    }    protected void  onPostExecute(final Void unused) {        if (this.dialog.isShowing()) {            //this.dialog.dismiss();        }        //Do something else here     }}</code></pre><p>Basically, my objective is:</p><ol><li>Constantly post the latitude/longitude to my website every minute or so.</li><li>Of course, I want to do this in another thread, so it doesn't mess up my UI thread. This AsyncTask is supposed to solve that...but it's bringing up an error and I don't know why.</li></ol><p>What can you do to accomplish my objective? It's very simple...just scan location and post to web every minute, in the background.</p><p>By the way, my onCreate method is like this. That's basically it.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);            new ExecuteLocations().execute();            setContentView(R.layout.main_list);    }</code></pre>","179736","","","","","2012-02-10 06:52:55","I have one Activity. In this Activity, I executed a AsyncTask , but it's not working","<java><android><geolocation><activity><android-asynctask>","2","0","","",""
"2286078","1","","","2010-02-18 03:21:41","3","348","<p>I am confused about activity lifecycle usage in the notepad example,notepad example use ""edit in place"" user model,inserting new record in onCreate method,saving persistent state in onPause method,and save away the original text in onSaveInstanceState method.I am a J2EE programer,I can not understand the logic described above. why not make things simple as following:</p><p>1.Not inserting new record in onCreate method.2.When user pressing BACK,it is equal as pressing save button in the editorform,so execute inserting or updating in onPause method if activity.isFinishing() is true.  don't persiste use data if activity.isFinishing() is not true.3.Not save the original text in onSaveInstanceState method,It is no necessary.If the activity is killed and back,restore user inputing data in the editorForm is adequately.</p><p>I think this logic is more traditional and natural.Maybe I not understand the essence of the activity lifecycle.Please air your's opinion.</p><p>Thanks</p><p>L.J.W</p>","275756","","","","","2010-02-20 03:23:27","Confused about activity lifecycle usage in the notepad example","<android>","1","0","2","",""
"2286184","1","","","2010-02-18 03:54:30","0","528","<p>How can I start an activity from a servlet? I have an i-Jetty server installed and a servlet that responds to HTTP request.  I would like to start an activity from the servlet, does any body have any idea on how to do this?</p>","1129084","","","","","2010-02-18 06:38:59","Android: How can I start an activity from a regular java class? the java class is servlet","<android>","1","0","","",""
"2286315","1","","","2010-02-18 04:31:43","49","24516","<p>I have an activity which launches another activity, via a button click. By default, on newer OS versions of android, the OS will animate the new activity sliding in from right to left.</p><p>Is there a way to disable this animation? I just want the new activity to appear without any sort of animation.</p>","246114","","2680216","","2013-12-07 00:34:07","2014-01-07 07:36:04","Disable activity slide-in animation when launching new activity?","<android>","4","0","18","",""
"2286409","1","2290505","","2010-02-18 04:58:30","0","1403","<p>I hope can get the layout like this:</p><p>-----Search bar(EditTextview)---</p><p>-----Listview(Rows)--------</p><p>-----Bottom bar(Contain many buttons)---</p><p>Pls give many samplesThanks very muchI paste my xml file here.Pls help me check it:                                        </p>","275788","","","","","2010-02-18 16:59:19","Layout :How to get the bottom bar under listview","<android>","2","0","","",""
"2286547","1","2286576","","2010-02-18 05:38:40","1","2317","<p>i'm new with android.</p><p>I'm working on an application using xml layouts.I wish to know which is better: 1. Use few activities and change its contentview 2. Use an activity for each 'view' needed</p><p>If both works, in which case which option would be better?</p><p>thx a lot</p>","269671","","","","","2011-02-26 09:26:50","Android - Should I use multiple activities or multiple content views","<xml><android><layout><activity>","1","1","","",""
"2286621","1","2286727","","2010-02-18 05:57:40","5","1689","<p>i have a program that shows a splash screen.But the problem is whenever i refresh same page again it appears.Is there any method to stop splash screen again and again.I want it just comes at first time not again and again.Thank you</p>","263325","","991737","","2012-01-12 18:57:27","2012-08-23 10:59:19","android splash screen","<android><screen>","3","0","2","",""
"2286871","1","","","2010-02-18 07:12:46","6","4480","<p>I'd like to implement drill down view in Android. Currently, onListItemClick, I refillthe same list view with different data. </p><p>questions:</p><ol><li>any other suggestions? Something like the way it is done using UITableView on iPhone?</li><li>is it possible to animate (push left or right) the listview fill operation? </li></ol>","160261","","2454753","","2011-02-06 13:06:22","2013-08-03 08:26:10","How do I implement drill down (list)view?","<android><listview><drilldown>","3","1","4","",""
"2287367","1","","","2010-02-18 09:03:25","2","2122","<p>I am Working on a project to develop an application to perform OCR on English Text on an Android mobile phone.</p><p>I am hoping to use an existing open source OCR engine. like tesseract for example.</p><p>Can anyone please help me? point me in the right direction? this is my first ever project.</p>","275911","","1626878","","2013-01-10 07:55:52","2013-01-10 07:55:52","OCR Application for Android","<java><c++><android><open-source><ocr>","1","1","0","2012-11-02 22:59:23",""
"2287482","1","2288969","","2010-02-18 09:23:40","2","2089","<p>I have downloaded ""android-sdk_r04-windows"", after unzip I tried to install  ""SDK Setup.exe"", but i got following error and nothing was installed.</p><p>Downloading Android SDK Tools, revision 4Download finished with wrong checksum. Expected 1357f66cb935fc6ae31ba656024a81fe787349c9, got 54a9ee4a067aaa03a6703e0e46d64b62e68ed994.Skipping 'SDK Platform Android 2.1, API 7, revision 1'; it depends on 'Android SDK Tools, revision 4' which was not installed.</p><p>Downloading SDK Platform Android 2.1, API 7, revision 1Download finished with wrong checksum. Expected b04453e6f0f0d0df16740e360114c559092dfaf4, got 992f81247809b37ac0ccc2434474aa628763baef.Skipping 'SDK Platform Android 2.0.1, API 6, revision 1'; it depends on 'Android SDK Tools, revision 4' which was not installed.</p><p>Downloading SDK Platform Android 2.0.1, API 6, revision 1Download finished with wrong checksum. Expected 255781ebe4509d9707d0e77edda2815e2bc216e6, got 27a1c8bc9d2ce5e1cc4b2547114e6e64f70cbabb.Skipping 'SDK Platform Android 2.0, API 5, revision 1'; it depends on 'Android SDK Tools, revision 4' which was not installed.</p><p>Downloading SDK Platform Android 2.0, API 5, revision 1Download finished with wrong checksum. Expected aeb623217ff88b87216d6eb7dbc846ed53f68f57, got 797384e01074c8a6446731143f7987fd6a6fc64b.</p><p>can anyone please help me ? </p><p>Thanks in advance...</p>","177571","","","","","2011-10-06 22:01:54","How can i install android sdk set up revision 4 and launch emulator","<android><android-emulator>","4","0","","",""
"2287974","1","","","2010-02-18 10:52:44","0","88","<p>I've developed a Facebook application for Android.For further development, I would like to know whether I can enhance it  to add gaming features of Facebook in it. Is there a flash player that I can use for it? Please reply ASAP....</p>","","user275978","","","","2010-02-18 13:31:53","Gaming in Facebook for Android","<android><facebook><gaming>","1","2","","",""
"2287987","1","2288014","","2010-02-18 10:54:56","5","4696","<p>I'm implementing a game loop with constant FPS. I'm thinking about 25-30 FPS should be enough.Any ideas from your own experience? Should I even restrict FPS at all?</p>","116622","","213269","","2012-02-05 01:38:21","2012-02-05 01:38:21","Android game with constant FPS?","<android><fps><game-loop>","3","0","3","",""
"2288094","1","2288452","","2010-02-18 11:12:11","4","1627","<p>According to Androids documentation I get the impression, that Android only supports ISO 8601 week number calculation (this is good for me as I live in Austria).</p><p>So, I think that an ""Android Week"" alway starts on Monday. This is important for me, because I want to read/write Androids calendar and the recurrence rules are encoded with the rfc2445 standard. The field in question is ""WKST"" </p><blockquote>  <p>The WKST rule part specifies the day  on which the workweek starts.</p></blockquote><p>As long my application is used in Europa there is no problem with assuming that Monday is the first day of week. But what about other countries (USA)?</p><p>Is my assumption correct?</p><p>References:</p><p><a href=""http://www.ietf.org/rfc/rfc2445.txt"" rel=""nofollow"">http://www.ietf.org/rfc/rfc2445.txt</a></p><p><a href=""http://developer.android.com/reference/android/text/format/Time.html"" rel=""nofollow"">http://developer.android.com/reference/android/text/format/Time.html</a></p>","178517","","","","","2012-02-01 08:30:58","First weekday on android phones","<android><datetime>","2","0","1","",""
"2288113","1","3084213","","2010-02-18 11:14:41","0","1880","<p>i have list of Latitude &amp; Longitude of google map</p><p>now i want to animate to center of these all co-ordinates can any one guide me how to achieve this.</p><p>in other words i want to calculate middle distance or lat,long positions so that user could see most of the overlay points.</p><p>it seems to be quite confusing for me.</p><p>any help would be appriciated.</p>","249991","","","","","2014-02-01 22:56:15","how to calculate center point of different latitude and longitude in google map android?","<android><google-maps>","1","0","","",""
"2288183","1","2295140","","2010-02-18 11:27:01","1","5640","<p>i am implemented this code image upload device only how can retrieve bitmap uri Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);                    photoPickerIntent.setType(""image/*"");                    startActivityForResult(photoPickerIntent, ACTIVITY_RESULT_IMAGE_SELECTED);</p><pre><code> protected void onActivityResult(int requestCode, int resultCode, Intent intent,Intent data, CharSequence Uri)  {     super.onActivityResult(requestCode, resultCode, intent);     if (requestCode == ACTIVITY_RESULT_IMAGE_SELECTED)     {             if (resultCode == RESULT_OK) {                     Uri uri = intent.getData();                     Object mBitmap = MediaStore.EXTRA_OUTPUT; //Media.//getBitmap(this.getContentResolver(),uri);                     //EditText images=(EditText) findViewById(R.id.EditTextImages);                   //  mImageUploadAdapter.addImage(uri);                    // mImageUploadGridView.invalidateViews();             }     } i am implementing this code</code></pre>","275791","","275791","","2010-02-19 05:39:12","2010-02-19 09:21:28","how to get bitmap uri in android mobile device using java","<android>","1","4","4","",""
"2288244","1","","","2010-02-18 11:36:15","1","311","<p>Question, I have a HTC Hero with Android 1.5.</p><p>The buggy (speed &lt;= 10 kb) network driver bothers me since a long time.(I saw it can serve 50 kb/s or more, but only temporarely, but then, after a few seconds,  it slows down to &lt; 5kb/s and takes about an hour to come back to 50 kb/s...)Now HTC is working on 2.1, but whatever... I don't know what takes soooo long.</p><p>Basically, what I would need to do is just cross-compile the android kernel for ARM and maybe some installed native apps wouldn't work anymore afterwards.</p><p>Is it possible (without big riscs) to compile my own custom android?<br />Or will I be unable to use the phone afterwards if anything goes wrong ?</p>","155077","","155077","","2010-03-10 11:28:18","2010-09-07 23:53:19","Customize android?","<android><linux><linux-kernel>","2","2","","",""
"2288507","1","2293293","","2010-02-18 12:22:17","4","1448","<p>while the map is in loading state i want to put a progressbar at the center of mapview.</p><p>how to get the progress?? and how to do??</p><p>give me some example..</p><p>thanks.</p>","267269","","","","","2010-02-19 00:28:10","how get the progress status of loading mapview in android?","<android><android-emulator><android-mapview>","1","0","1","",""
"2289362","1","2290272","","2010-02-18 14:40:19","0","475","<p>I have a database in my application that is used as a ContentProvider.</p><p>It holds settings values for the application, and when I install the application Iwant it to add a hardcoded set of values just once.</p><p>This is how I am trying to do it at the minute.</p><pre><code> if(settings.size()&lt;= 0){   Settings s = new Settings(""voipusernameTa"", ""xxxxxxxxx"", ""xxxxx"",   ""displayNameTa"", ""sip.networks.com"", ""sip.networks.com"", ""siprealmTa"", 120);  addNewSettings(s); }</code></pre><p>And this is the addNewSettings method:</p><pre><code>private void addNewSettings(Settings _settings) {   ContentResolver cr = getContentResolver();   String w = CiceroSettings._ID + "" = "" + _settings.get_Id();   Log.d(""ADDNEW SETTINGS"", ""new setting id ="" + _settings.get_Id());   Cursor c = cr.query(CiceroSettings.CONTENT_URI, null, w, null, null);   Log.d(""CURSOR"", ""cursor created"");   int dbCount = c.getCount();   c.close();   if (dbCount == 0){     ContentValues values = new ContentValues();     values.put(Settings._ID, _settings.get_Id());     values.put(Settings.VOIPUSERNAME, _settings.getVoipUserName());     values.put(Settings.VOIPAUTHID, _settings.getVoipAuthId());     values.put(Settings.PASSWORD, _settings.getPassword());     values.put(Settings.VOIPDISPLAYNAME, _settings.getVoipDisplayName());     values.put(Settings.SIPPROXYSERVER, _settings.getSipProxyServer());     values.put(Settings.SIPREGISTRAR, _settings.getSipRegistrar());     values.put(Settings.SIPREALM, _settings.getSipRealm());     values.put(Settings.EXPIRESTIME, Integer.toString(_settings.getExpiresTime()));     Log.d(""CURSOR"", ""Values assigned"");     cr.insert(CiceroSettings.CONTENT_URI, values);     Log.d(""CURSOR"", ""Values inserted"");   } }}</code></pre><p>This works however each time the app starts it adds a new settings object and I only want it to app ONE object at the install of the application and thats it no more.</p><p>Has anyone a better solution for this? Or a reason why my code is flawed?</p>","243999","","","","","2010-02-18 16:35:44","Android - How to populate Content Provider only once on App install?","<android><arrays><settings><android-contentprovider>","1","8","1","",""
"2289712","1","2289794","","2010-02-18 15:24:40","2","32653","<p>Trying to connect to Facebook to make a statusupdate through my Android application.Got the whole thing running but I need API key + secret. Where can I create/get a hold of these? </p><pre><code>private static final String apiKey = ""&lt;YOUR API KEY&gt;"";private static final String apiSecret = ""&lt;YOUR SECRET KEY&gt;"";</code></pre><p>Tried the same thing with Twitter and then I just ""created"" an application and recieved ""ConsumerKEY"" and ""ConsumerSECRET"", but what is the deal with Facebook?</p>","270273","","527702","","2013-05-19 01:40:01","2013-05-19 01:40:01","Where do I find API key and API secret for Facebook?","<android><facebook><api><keyboard><api-key>","3","2","1","",""
"2289730","1","2289770","","2010-02-18 15:26:48","4","5764","<p>I'll preface this with, I've just started learning Android so be gentle.I come from an ASP.NET / Silverlight background so I was looking for something along the lines of controls.</p><p>I want to reuse a layout (a ListView item template) in other layouts.</p><p>Such that in my other layouts I can just add <code>&lt;myListItem /&gt;</code> to show it.</p><p>Is this, or anything like it possible? or are there better ways?</p>","29553","","","","","2011-06-07 16:13:20","Android Layout: Is reusable component UI possible?","<android><layout><code-reuse>","2","0","1","",""
"2289745","1","2290266","","2010-02-18 15:28:41","4","2088","<p>I have an app with a two threads - main and data loader. When data loader finishes it posts a Runnable object to the main thread (as described in the DevGuide), but it never gets delivered and run.</p><p>Here's the basic code:</p><pre><code>class MyApp extends Application{   public void onCreate()   {         LoaderThread t = new LoaderThread();         t.start();   }   private class LoaderThread extends Thread   {        public void run()        {             SystemClock.sleep(2000);             boolean res = m_handler.post(m_runnable);             if(res)                Log.d(TAG, ""Posted Runnable"");        }   }   private final Handler m_handler = new Handler();   private final Runnable m_runnable = new Runnable() {             public void run()             {                 Log.d(TAG, ""Hey, i'm runnable!"");             }        }}</code></pre><p>Also it maybe important to note that I ran this code as a unit-test derived from an ApplicationTestCase:</p><pre><code>class MyAppTest : public ApplicationTestCase{     public MyAppTest()     {          super(MyApp.class);     }     public void testLoading()     {          createApplication();          // few asserts follow here...     }}</code></pre><p>So this fails. Runnable never gets run() called, although the log indicates that it has been posted successfully.I also tried to send simple messages instead of posting runnable (m_handler.sendEmptyMessage(1) for example) - they never get delivered to handler's callback in the main thread.</p><p>What do I miss here?</p><p>Thanks in advance :)</p>","258848","","","","","2011-09-29 07:14:47","Handler fails to deliver a message or a Runnable to the main thread","<android><gui><multithreading>","3","0","1","",""
"2289803","1","","","2010-02-18 15:35:00","0","302","<p>If I have a web application that also services requests for iphone/android applications, what is the best way to go about designing the application?</p><p>i am using <code>spring mvc</code>.</p><p>Would it be possible (or advisable) to use the same controller action to service both web and mobile requests, or would I have to duplicate things with another set of controllers?</p>","275475","","275475","","2010-02-18 16:37:22","2010-02-18 18:41:10","Advice on SOA to drive spring mvc pages, and service iphone/android requests also","<java><iphone><android><spring>","1","0","1","",""
"2289919","1","","","2010-02-18 15:49:24","1","11770","<p>I do have a question in using ADB command in console. I know that user doesn't have a permission to access /system in shell without root permission as a default. But when I execute ""adb pull /system/app /myApps"" in a window console, not shell mode, it works properly. I mean, all apk files is copied into my desktop location without any problem.</p><p>Is it normal case? I got a root permission using exploit before. So, I'm not sure that 'pull' command is always able to copy system files with normal permission. </p><p>I'm thinking about to make ADB GUI application to be supportable for every android user. I need to know If it's possible without rooting! Please help me!</p><p>Thank you in advance!</p>","276226","","","","","2010-03-02 15:47:08","ADB pull command permission","<android><android-emulator><adb>","2","0","","",""
"2290000","1","5858547","","2010-02-18 16:00:53","5","1952","<p>I have an Android app where users can add items to a list, and I'd like them to be able to re-order the items in the list however they want (as opposed to just offering them different sort orders). It's easy enough to add a position setting for the items (they come from the DB) but what kind of UI elements are available for the user to indicate the desired ordering?</p><p>Is there a pattern anyone has seen implemented for this? I have not seen anything on Android that does anything like this, except the home screen which is similar but looks a little bit beyond my expertise at this point. The best I can think of is to use a long click and context menu to ""move up"" or ""move down"".</p>","262768","","155670","","2010-02-18 16:02:20","2011-05-02 14:42:18","How can I allow a user to re-sort items in a list?","<android><sorting><listview><user-interface>","2","0","4","",""
"2290548","1","","","2010-02-18 17:04:18","2","6290","<p>I have implemented a slideshow in my Android app using . This works well except that I want to scroll to next image on a scroll gesture (now it just scrolls past few images before decelerating). I have couldn't find a appropriate way to do this, should I be using a FrameLayout instead ? How do I scroll to the next (or previous) image on scroll gesture ? </p>","123926","","73488","","2010-11-03 08:13:29","2011-04-17 20:47:30","Android HorizontalScrollView scroll by page","<android><android-widget><slideshow>","3","0","1","",""
"2290596","1","2291357","","2010-02-18 17:10:11","2","272","<p>I have to parse a string and capture some values:</p><blockquote>  <p>FREQ=WEEKLY;WKST=MO;BYDAY=2TU,2WE</p></blockquote><p>I want to caputre 2 groups:</p><pre><code>grp 1: 2, 2grp 2: TU, WE</code></pre><p>The Numbers represents intervals. TU, WE represents weekdays. I need both.</p><p>I'm using this code:</p><pre><code>private final static java.util.regex.Pattern regBYDAY = java.util.regex.Pattern.compile("".*;BYDAY=(?:([+-]?[0-9]*)([A-Z]{2}),?)*.*"");String rrule = ""FREQ=WEEKLY;WKST=MO;BYDAY=2TU,2WE"";java.util.regex.Matcher result = regBYDAY.matcher(rrule);if (result.matches()){    int grpCount = result.groupCount();    for (int i = 1; i &lt; grpCount; i++)    {        String g = result.group(i);        ...    }}</code></pre><p>grpCount == 2 - why? If I read the java documentation correctly (that little bit) I should get 5? 0 = the whole expression, 1,2,3,4 = my captures 2,2,TU and WE.</p><p>result.group(1) == ""2"";</p><p>I'm a C# Programmer with very little java experience so I tested the RegEx in the  ""Regular Expression Workbench"" - a great C# Program for testing RegEx. There my RegEx works fine.</p><p><a href=""http://code.msdn.microsoft.com/RegexWorkbench"" rel=""nofollow"">http://code.msdn.microsoft.com/RegexWorkbench</a></p><p>RegExWB:</p><pre><code>.*;BYDAY=(?:([+-]?[0-9]*)([A-Z]{2}),?)*.*Matching:FREQ=WEEKLY;WKST=MO;BYDAY=22TU,-2WE,+223FR  1 =&gt; 22  1 =&gt; -2  1 =&gt; +223  2 =&gt; TU  2 =&gt; WE  2 =&gt; FR</code></pre><p>As I already said - I'm a C# programmer. There is something I'm doing totally wrong.</p><p>Thanks for help.</p>","178517","","178517","","2010-02-18 18:43:27","2010-02-19 03:24:30","Don't know whats wrong with this RegEx","<java><android><regex>","3","2","","",""
"2290945","1","","","2010-02-18 18:02:20","27","56858","<p>Given an instance of <code>org.w3c.dom.Document</code>, how do I save its contents to a file/stream?</p><p>EDIT:As CommonsWare pointed out, there's no such possibility using classes from Android SDK prior to Android 2.2 (API 8). Can you recommend then a third-party library for saving <code>Document</code> contents to a file/stream?</p>","139298","","564626","","2012-02-23 21:46:28","2012-02-23 21:46:28","Writing XML on Android","<xml><android><serialization>","5","3","21","",""
"2291038","1","14522179","","2010-02-18 18:17:00","1","2380","<p>I am using Eclipse on Mac with Android SDK.  I have the emulator working with my code and today I borrowed an Android that I would like to test on.</p><p>I have run 'adb devices' from the command line, but I think the problem is more fundamental at the USB hardware detection level.</p><p>What tools do I use to troubleshoot this?</p>","157804","","","","","2013-01-25 12:51:02","How do I switch from Android AVD to real hardware on Mac Eclipse-SDK?","<android><eclipse><osx><adb><avd>","3","0","","",""
"2291118","1","2291587","","2010-02-18 18:26:45","5","1404","<p>In android, when I press on a TextView, the text changes color (from white to grey).Can you please tell me how can I disable that functionality?</p><p>Thank you.</p>","128983","","","","","2013-04-22 08:10:14","Color of the text in TextView changes color","<android>","1","0","1","",""
"2291136","1","","","2010-02-18 18:29:59","2","2103","<p>I have 2 binary files that i would like to package with my apk. (/res/raw)</p><p>i need to copy these 2 files to /sdcard when the application is run</p><p>how can i do this?</p>","276359","","","","","2011-03-31 19:46:18","How can I package binary files with my APK, and copy them to sdcard","<android>","3","0","1","",""
"2291182","1","","","2010-02-18 18:36:43","5","6426","<p>I am writing an Android app that uses an AutoCompleteTextView just like the API example.  The problem is that my text is too long and needs to wrap when the dropdown occurs.  I have a custom list_item.xml, but only one line of text displays.  The list_item.xml layout wraps to 2 lines if used with a spinner, but not with the AutoCompleteTextView.</p><p>main.java</p><pre><code>public class main extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete_country);        ArrayAdapter&lt;String&gt; adapter  = new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, COUNTRIES);        textView.setAdapter(adapter);    }          static final String[] COUNTRIES = new String[] {            ""This is the first line that is too long and it needs to wrap content"",          ""Albania"", ""Algeria"", ""American Samoa"", ""Andorra"",          ""This is a second line that also needs to wrap its content"",              ""Bahrain"", ""Bangladesh"", ""Barbados"", ""Belarus"", ""Belgium""        };}</code></pre><p>main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:orientation=""horizontal""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:padding=""5dp""&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Country"" /&gt;    &lt;AutoCompleteTextView android:id=""@+id/autocomplete_country""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_marginLeft=""5dp""/&gt;        &lt;/LinearLayout&gt;</code></pre><p>list_item.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:padding=""10dp""    android:textSize=""16sp""    android:textColor=""#000""        &gt;&lt;/TextView&gt;</code></pre>","158757","","1071942","","2011-11-29 19:12:37","2014-01-17 09:25:41","Android: Make AutoCompleteTextView dropdown wrap to 2 lines or more","<android><autocomplete><drop-down-menu>","2","1","4","",""
"2291189","1","","","2010-02-18 18:38:38","0","632","<p>Hi i've got a custom listview with a text view and a button in each row.Im having trouble trying to use the buttons . Each button will fire a different intent. This is the xml file for the list view rows.</p><pre><code>    &lt;?xml version=""1.0"" encoding=""UTF-8""?&gt; &lt;RelativeLayoutandroid:id=""@+id/widget28""android:layout_width=""wrap_content""android:layout_height=""wrap_content""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;Buttonandroid:id=""@+id/widget29""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Remind me""android:layout_alignParentRight=""true""/&gt;&lt;TextView android:id=""@+id/text12""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:background=""#ff99ccff""  android:text=""Text view"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Then i have another xml file which simply contains the list view in a linear layout.</p><p>This is my custom array class.</p><pre><code>public class customArray extends ArrayAdapter&lt;String&gt; { int resource; public customArray(Context cont, int _resource, List&lt;String&gt; items) {      super (cont, _resource,items);      resource = _resource; } @Override public View getView(int position, View convertView, ViewGroup parent) {      RelativeLayout rl;     String prod = getItem(position);      if (convertView == null) {           rl = new RelativeLayout(getContext());           LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);           vi.inflate(resource, rl, true);      } else {           rl = (RelativeLayout)convertView;      }     TextView t1 = (TextView)rl.findViewById(R.id.text12);     t1.setText(prod);      Button b1 = (Button)rl.findViewById(R.id.widget29);       return rl; }</code></pre><p>}</p><p>Then the final class which gets the data from a database and uses the custom adapter to display the information. Does anyone know how i would call each button?</p><pre><code>`public class SatMain extends Activity {    /** Called when the activity is first created.      * @param cont */    @Overridepublic void onCreate(Bundle savedInstanceState){    List&lt;String&gt; results = new ArrayList&lt;String&gt;();     super.onCreate(savedInstanceState);    setContentView(R.layout.satmain);    dbAdapter db = new dbAdapter(this);     // button.setOnClickListener(m);    //---get all titles---    db.open();      db.InsertData();    Cursor c =  db.getSat1();    if (c.moveToFirst())    {        do {                       String pub =  c.getString(c.getColumnIndex(db.KEY_Artist));             String pub1 =  c.getString(c.getColumnIndex(db.KEY_Time));          results.add(pub + pub1 );        } while (c.moveToNext());    }    db.close();   ListView listProducts;    customArray ca = new customArray(this, R.layout.button, results);   listProducts = (ListView)findViewById(R.id.list1);   listProducts.setAdapter(ca);    ca.notifyDataSetChanged();      }}`</code></pre>","264905","","","","","2011-04-29 08:46:20","Android custom listview","<android>","1","0","","",""
"2291530","1","2291890","","2010-02-18 19:22:17","0","442","<p>I have a horizontal LinearLayout, inside which I have 2 TextViews. Let's say that the LinearLayout's width is 320px. If the TextViews don't fit into the LinearLayout (they are together wider than 320px), I want to somehow achieve this:</p><ul><li>The <strong>second</strong> TextView is fully displayed and is at the right edge of the LinearLayout</li><li>The <strong>first</strong> TextView is only shown partially, only first x characters are visible</li></ul><p>What I mean:</p><p>[TextView1|TextView2_<strong><em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__</strong>] // this is normal</p><p>[VeryVeryL...|VeryVeryLongTextView2] // VeryVeryLongTextView1 is not fully visible</p>","243225","","","","","2010-02-18 20:15:53","How to create layout like this?","<android>","2","0","","",""
"2291531","1","","","2010-02-18 19:22:23","1","1153","<p>Android's <code>soundpool.play</code> [documentation][1] says ""<em>The playback rate allows the application to vary the playback rate (pitch) of the sound. A value of 1.0 means play back at the original frequency. A value of 2.0 means play back twice as fast, and a value of 0.5 means playback at half speed.</em>"".</p><p>However, when I set the rate to 1.49f, I hear silence. 1.485f renders correctly (it's ogg file). Is this specific to my handset, is the documentation wrong, or am I being foolish in some other way?</p><p>[1]: <a href=""http://developer.android.com/reference/android/media/SoundPool.html#play(int"" rel=""nofollow"">http://developer.android.com/reference/android/media/SoundPool.html#play(int</a>, float, float, int, int, float)</p>","202807","","","","","2010-11-23 04:13:51","Android soundpool rate range?","<android><frequency><soundpool>","1","0","","",""
"2291604","1","2314573","","2010-02-18 19:33:44","2","879","<p>Long story short, I have a LaunchActivity which is always called by LAUNCHER (i.e. the home screen).  It then starts LoginActivity and then closes itself.</p><p>This is the flow:</p><ol><li>User launches app</li><li>LaunchActivity starts, startsLoginActivity and then callsfinish() on itself (At this pointLoginActivity is the only Activityon the stack)</li><li>User press ""Home"" button, stoppingLoginActivity</li><li>User launches the app again</li></ol><p>When the app is launched for the 2nd time, two things can happen:</p><ol><li>LaunchActivity starts, finishesitself and then STARTS LoginActivity</li><li>LaunchActivity starts, finishesitself and then CREATESLoginActivity, so there are now twoLoginActivitys on the stack.</li></ol><p>(2) seems to happen when I restart Eclipse and the simulator (yeah I know, black magic).</p><p>Some extra info: I'm not using any start flags and my manifest doesn't have any launchModes defined.</p>","135199","","135199","","2010-02-18 19:47:59","2010-02-22 23:19:08","How does startActivity decide whether to start a stopped activity or create a new one?","<android>","2","0","2","",""
"2291607","1","","","2010-02-18 19:33:57","3","3402","<p>I have three tabs in my Application. On an event under one Tab, i want to change the title of an another existing Tab. This is the title that we provide while adding the tabs to the TabHost. </p><p>Eg: TabHost.addTab(tabHost.newTabSpec(""Tab2"")).setIndicator(""I need to be Changed dynamically"").setContent....</p><p>In the above example, the title of the tab2 that i provided under setIndicator(), should be changed dynamically.</p><p>Is there any way to accomplish this.</p>","276411","","","","","2013-04-14 15:14:26","How to change the title of the Tab Dynamically","<android>","3","0","0","",""
"2292086","1","2292459","","2010-02-18 20:48:46","14","29886","<p>In my android app I have a WebView to display html data from our website. Sometimes the page will have youtube embed objects. This doesn't show up properly in the app. Is there any way to show/play youtube videos in WebView ? Thanks.</p>","123926","","","","","2014-03-25 08:34:48","play youtube video in WebView","<android><android-widget>","6","1","15","",""
"2292277","1","","","2010-02-18 21:21:07","3","4772","<p>Under the 'Accounts &amp; Sync' settings graphical OS menu, there are listings of user-configured Google accounts.</p><p>Please could someone point me in the right direction to programmatically change the sync settings associated with one of these accounts?</p><p>Thanks</p>","276486","","","","","2012-01-12 16:59:07","How to edit accounts & sync settings for a specific account","<android>","3","0","1","",""
"2292416","1","","","2010-02-18 21:41:42","20","27054","<p>When I import a new existing project into Eclipse, I get the following error message when attempting to execute as an Android project:</p><blockquote>  <p>Project has no target set. Edit the  project properties to set one</p></blockquote><p>Any help is appreciated.</p>","276503","","21234","","2010-02-18 21:42:34","2014-03-30 22:55:19","Project has no target set. Edit the project properties to set one","<android><eclipse>","6","0","1","",""
"2292820","1","2292869","","2010-02-18 22:46:31","3","11339","<p>What, if any, support is there for CSS3 in mobile browsers? The specific browsers I'm curious about are the ones used in the iPhone, Android, and Blackberry phones. Any links to relevant resources would also be greatly appreciated.</p>","13281","","","","","2012-08-23 10:42:08","CSS3 support in mobile browsers","<iphone><android><blackberry><mobile><css3>","5","1","1","",""
"2292870","1","","","2010-02-18 22:56:19","1","1875","<p>I've created an application that show around 250 images in ImageView. Images are loaded one after another, 15-30 images per second. Basically the whole thing gives an illusion of a rotating 3D object, at least it should.The problem is next, app hangs when loading certain images(i.e. I see a few seconds of fluid animation and then animation hangs, jump 10-15 frames(images) ahead and continues. It always happens at the same places in animation cycle.I though that Android might not have enough resources to handle something like this, so I've resized images to half their size, but it did't help. I've tried buffering images but that did't help either(actually, maybe a little, I think that animation looks a little bit smoother).And now the weirdest thing. I use the touch screen to allow users to ""rotate"" the 3D object on those images, and while rotating I again experience those hangs at exactly the same places as with the animation.</p><p>All images are in .png format and their size vary from 15kB to 40kB.</p><p>I use the following code for the animation:</p><pre><code>new Thread(new Runnable() {   @Override   public void run() {    while (!stopStartupAnimation &amp;&amp; li &lt; images_360.length) {     final int fli = li;     handler.post(new Runnable() {      @Override      public void run() {       //Bitmap b = BitmapFactory.decodeResource(getResources(), R.drawable.icon);       //imageCanvas.setImageResource(images_360[fli]);       imageCanvas.setImageBitmap(imageStackNext.pop());       System.out.println(""rawX = "" + fli);      }     });     int ti = fli +25;     if(ti &gt; images_360.length-1){      ti = ti - images_360.length;     }     imageStackNext.push(BitmapFactory.decodeResource(getResources(), images_360[ti]));     synchronized (this) {      try {       wait(1000 / 25);      } catch (InterruptedException e) {       e.printStackTrace();      }     }     li++;     li++;     if (li &gt;= images_360.length) {      li = 0;     }    }   }  }).start();</code></pre>","276552","","12707","","2010-02-18 22:58:16","2010-02-18 23:34:19","Android loading and showing a lot of images in ImageView(frame by frame animation) hangs in certain moments","<android>","1","0","","",""
"2293488","1","3199825","","2010-02-19 01:21:45","1","2111","<p>I am using a custom adapter for my ListView as per the efficient adapter sample by Romain Guy.</p><p>In the getView() method of my adapter I am assigning an ImageView a jpg image stored on SD using the following code :</p><pre><code>File f=new File(MovieThumbs.get(position));if(f.length() &gt; 0) {    holder.thumb.setImageBitmap(BitmapFactory.decodeFile(MovieThumbs.get(position)));}</code></pre><p>When flicking through a list of some 200 items using this method the app suffers from bad stuttering as it tries dealing with the images.</p><p>Is there a more efficient solution for this?</p>","74751","","","","","2010-07-08 00:12:51","Improve ListView efficiency when loading images from SD into the ListView","<android><listview>","2","0","2","",""
"2293529","1","","","2010-02-19 01:32:46","0","221","<p>My record: (ID, name, count)</p><p>(1, 1, 2)<br>(2, t, 10)</p><p>It works: myDbHelper.updateCount(""1"", 100);</p><p>It didn't work: myDbHelper.updateCount(""t"", 100); It gave android.database.sqlite.SQLiteException:no such column: t: , while compiling: ...</p><p>Here is the code for updating records:</p><pre><code>public int updateCount(String name, int count) {    ContentValues args = new ContentValues();     args.put(KEY_COUNT, count);    return mDb.update(DATABASE_TABLE, args, KEY_NAME + ""="" + name, null);    }</code></pre>","276620","","276620","","2010-02-19 01:39:19","2012-03-15 02:14:42","SQLiteException while updating record with string comparision","<android>","1","0","","",""
"2293642","1","","","2010-02-19 02:10:25","0","197","<p>I have a basic calculator app I'm making. Two activities, the main one and ResultView.</p><p>I've made it where I click a button on activity A to go to activity B. The log says activity B is started and ""displayed"" successfully, the title for the new activity loads, but the body does NOT show. I added a simple Text view with static text.. see the result.xml at the bottom. I also tried inserting information programmatically, but that didn't do.</p><p>When I debug the program, I tried putting breakpoints as the activity is called with startActivity() as well as on the first line of the onCreate method within the ResultView class (my activity ""B"") but the program never hits the second breakpoint. In fact, it looks as if Looper.class is called in the end.  </p><p>This bit of code is placed in the button handler on acitivity A:</p><pre><code>i.putExtra(""test1"",34);i.putExtra(""test2"",35);this.startActivity(i);</code></pre><p>This in the onCreate function in activity B:</p><pre><code>public void OnCreate(Bundle      savedInstanceState){      super.onCreate(savedInstanceState);      setContentView(R.layout.result);}</code></pre><p>The activity is in the manifest, within the ""application"" tag:</p><pre><code>&lt;activityandroid:name=""ResultView""&gt;&lt;/activity&gt;</code></pre><p>If I didn't supply enough info, let me know.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/llParent""    android:orientation=""vertical""    android:padding=""10dip""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_marginTop=""10dip""        android:text=""HELLO WORLD""    /&gt; &lt;/LinearLayout&gt;</code></pre><p>If more info is needed, let me know...in short, ""HELLO WORLD"" does not display at all.</p>","276636","","","","","2010-02-19 12:43:07","Simple activity switch not working. No Errors","<android>","2","0","","",""
"2293729","1","2308360","","2010-02-19 02:32:15","1","869","<p>I have a small issue.</p><p>I need to enlarge(Zoom) Textures when I hold&amp;drag at the corners.</p><p>I am using glOrtho() to setup ModelView.</p><p>gl.glOrthof(0.0f, screen_width, -screen_height, 0, -1.0f, 1.0f); //Map exact pixel to World Co-od</p><p>I am able to do hit-test and detect corners of the images(Textures) on the screen.</p><p>Now I need to enlarge(zoom) the image(texture). I have offset values, means how far I moved on the screen in X,Y directions.</p><p>If I need to use glScalef(), it will accept values in percentage(I think). How can I map the offset values to this percentage value.</p><p>or is there any other way to zoom(ie by enlarging the background polygon vertices, so that the mapped texture will automatically get zoomed) ? In this method, I am fixing the polygon sides at time of Surface Creation.</p><p>Please help me in this.</p><p>Thanks in advance. Your help is really appreciated.</p>","269304","","","","","2010-02-22 02:06:59","Enlarging Textures in Android OpenGL ES?","<android><opengl-es>","1","0","","",""
"2293800","1","2293807","","2010-02-19 02:56:34","2","617","<p>I have an application that sets the user's background.  Is it possible to remove the wallpaper if my app is uninstalled?</p>","87316","","","","","2010-02-19 02:58:52","Are android wallpapers persistent?","<android><mobile><wallpaper><persistent>","1","0","","",""
"2294100","1","2294113","","2010-02-19 04:40:05","2","91","<p>Variables in Android sources are prefixed with <code>m</code>, like <code>mStream</code> or <code>mHeaderValueIndex</code>. What's the rationale behind Hungarian notation here?</p>","15187","","","","","2010-02-19 05:41:41","mSomeVar names - where from and why?","<java><android><naming-conventions>","2","0","","",""
"2294115","1","2296226","","2010-02-19 04:45:07","11","5840","<p>Say I have a <a href=""http://developer.android.com/reference/android/widget/TextView.html"">TextView</a> of a particular size (doesn't really matter what... fill_parent, 20dip, whatever). Is it possible to tell the text to shrink/grow in size to fit the available space without doing a lot of math?</p>","76835","","76835","","2010-02-23 19:22:48","2013-07-30 11:37:52","Scaling textSize in a TextView","<android><textview>","4","0","9","",""
"2294249","1","","","2010-02-19 05:24:55","0","256","<p>I had a working database. I just added one more column in a table. It keeps saying no that column. So I changed the table name. Now it says that no that table name. Then I changed the database name. it still gave error. it works fine after I changed back the table name and remove the extra column I added. Could you please help me figure out what's wrong? How do I run my code on a clean emulator? How do I verify that the code that creates the table is getting executed? How do I get the sqlite db off the emualtor and look at it using a sqlite database browser to check that the table does actually exist?</p><p>Many thanks!Tong</p>","276620","","236247","","2011-06-28 13:43:00","2011-11-17 12:36:39","Android Sqlite Database: it couldn't recognize the new column or new table I added in an exsiting database ","<android>","3","0","","",""
"2294293","1","","","2010-02-19 05:37:30","0","1960","<p>I ask somthing about static library..</p><p>"" how to create executable static library in android?""</p><p>and </p><p>""How to connect static library in eclipse?"" </p><p>Static library is a binary file, How to understand static library in jni? </p><p>I wondering static library operation method in android.. (such as static library in vc++)  </p><p>I'm exptected your reply. </p><p>Thanks a lot ! </p>","276713","","","","","2012-03-09 10:43:37","how to create executable static library in android?","<android><static>","1","0","","",""
"2294438","1","2294536","","2010-02-19 06:14:34","0","183","<p>I am move from one intent to another intent,the another intent collects the data from  our own data base so,it takes so much time for appearing .In that idle time I want to display a animation like progerss dialogue etc.pleae give me the suggestions</p>","454808","","","","","2010-02-19 06:42:42","code for please wait the values are loading statement is appearing when we move from one intent to another intent","<android>","1","0","","",""
"2294569","1","2295017","","2010-02-19 06:51:51","2","9666","<p>i have a code like thisBitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.correct);newImg = (ImageView)findViewById(R.id.rwans);newImg.setImageBitmap(bm);</p><p>but i want after a second, image should fade out or it display nothing or as previous state.thank you</p>","263325","","","","","2013-12-28 16:45:21","show hide image in android","<android>","1","1","","",""
"2294621","1","","","2010-02-19 07:09:13","0","214","<p>so i was wondering if its possible to for an application that i would write to be constantly running in the background and alter regular phone operations.  For example this could be something like as soon as you receive a text from anyone you forward it automatically to another number.  Is something like this at all possible?</p><p>Just to be clear I don't want to solve that particular problem through some other means, just want to know if apps can accomplish that.</p><p>Also if that is possible is it possible for an app that i write to alter more immediate and instant things, like an incoming call.  </p><p>thanks all for reading this, and hopefully a  helpful response :)</p>","276750","","","","","2010-02-19 10:04:28","android apps that alter normal phone operations","<android>","1","0","","",""
"2294699","1","2295001","","2010-02-19 07:29:34","2","745","<p>Is there any way to hide a image after a second or given time in android application?thank you</p>","263325","","","","","2010-02-19 08:53:26","how to hide image after a second in android","<android>","1","0","","",""
"2294736","1","2295885","","2010-02-19 07:38:22","0","862","<p>Im planning to build my own custom layout manager.  </p><p>What i wanted to know was if there is any other way to build one apart from extending the <code>View</code> class, coz this is the only approach i know for now and would like to know if there is any other way to do it??</p>","237403","","","","","2010-02-19 11:28:48","custom layout manager","<android>","1","3","","",""
"2294799","1","2297085","","2010-02-19 07:55:41","0","510","<p>friends,</p><p>i have problem in calling notifydatasetchanged();it is giving me exception source not found can any one guide me what mistake am i doing?if i assign data on create it works fine. but in case of updating list it wont.</p><p>any help would be appriciated.</p><pre><code>private static EfficientAdapter adap; //global variable @Override      public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);        setContentView(R.layout.listsearched);if(filevalue== ""true""){    adap = new EfficientAdapter(this);setListAdapter(adap);}}  private static void RefreshList()      {        data = new String[DalMapSearch.MyPassableObject.size()];        TitleString=new String[DalMapSearch.MyPassableObject.size()];        DetailString=new String[DalMapSearch.MyPassableObject.size()];        int i=0;        for (DalMapSearch t : DalMapSearch.MyPassableObject)         {            data[i]= t.getAd_id();            TitleString[i]= t.getAd_text();            DetailString[i]=t.getLocation();            i=i+1;         }        adap.notifyDataSetChanged();      }</code></pre>","249991","","249991","","2010-02-19 13:01:05","2010-02-19 14:45:44","notifyDataSetChanged(); source not found exception?","<android><listactivity>","1","0","","",""
"2294971","1","2295044","","2010-02-19 08:44:39","33","23368","<p>I need to receive broadcasts for network actions like network connected, disconnected etc. I am using a broadcast receiver for this purpose. Can anyone please tell me which intent action I need to capture for network events, right now as per my search on internet I am using <strong>android.net.ConnectivityManager.CONNECTIVITY_ACTION</strong>. </p><p>Here is my broadcast receiver class:</p><pre><code>import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;public class NetworkStateReceiver extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent intent) {    // TODO Auto-generated method stub    if (intent.getAction().equals(            android.net.ConnectivityManager.CONNECTIVITY_ACTION)) {        // do something..    }}}</code></pre><p>and I have also added permission for accessing network state:</p><pre><code>&lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE"" /&gt;</code></pre><p>here is how I have declared this class in manifest file</p><pre><code>&lt;receiver class="".NetworkStateReceiver"" android:name="".NetworkStateReceiver""&gt;    &lt;intent-filter&gt;            &lt;action android:name=""android.net.ConnectivityManager.CONNECTIVITY_ACTION"" /&gt;    &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>Please suggest me the right intent action if I am wrong OR if there is any other way to catch network events.</p>","152867","","114066","","2010-12-15 10:03:25","2012-10-05 11:39:07","Intent action for network events in android sdk","<android><intentfilter><android-networking>","2","0","18","",""
"2295135","1","2295602","","2010-02-19 09:20:18","0","905","<p>I have this Broadcast receiver registered</p><pre><code>public class NotifyAlarmBroadcast extends BroadcastReceiver{    public Context context;    public static final String NOTI = ""android.intent.action.MAIN"";// actually i want NOTI = ""com.sumit.timekeeper.NotifyAlarm""// this too is not working// help me here please@Overridepublic void onReceive(Context _context, Intent intent) {    context = _context;    Uri data = intent.getData();    String reason = intent.getStringExtra(""alarm_reason"");    Intent intentalarm = new Intent(NOTI, data);    intentalarm.putExtra(""reason"", reason);    context.startActivity(intentalarm);}</code></pre><p>}</p><p>and the manifest</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".TimeKeeperStartActivity""        android:screenOrientation=""portrait"" android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".NotifyAlarm""        android:screenOrientation=""portrait"" android:theme=""@android:style/Theme.Dialog""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.sumit.timekeeper.NotifyAlarm""&gt;            &lt;/action&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;receiver android:name="".NotifyAlarmBroadcast""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.sumit.timekeeper.NotifyAlarmBroadcast"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;&lt;/application&gt;</code></pre><p>but when the line reaches       context.startActivity(intentalarm);the application crashes</p><p>may be it is where we pass first parameter to Intent, i'm not clear aboutplease help me.</p>","132347","","132347","","2010-02-19 09:34:40","2010-02-19 10:35:48","Android : Why BroadcastReceiver crashing?","<android><android-manifest>","1","8","","",""
"2295289","1","2298006","","2010-02-19 09:46:31","1","970","<p>So I am trying to simulate that the phone is receiving a call. I have successfully extracted the phones ring tone and played it. Now I want to simulate the vibration. While I can make the phone vibrate, I want to emulate the exact pattern that the phone vibrates with as when it receives a call. Is there some setting or class that I can use to extract this pattern, and also detect if vibration is turned on?</p><p>Cheers,</p>","249871","","","","","2010-03-24 17:26:11","Simulating vibration as when receiving a call","<android><vibrate>","2","0","1","",""
"2295352","1","2297503","","2010-02-19 09:55:02","3","15259","<p>I am having an issue with using TabHost in a new Intent of type TabActivity which I hope you can point me in the right direction. Funnily it works fine when I try to view it in the original Intent : setContentView(R.layout.main) </p><p>I get a ""forced closed"" and within logcat, I get the following error even though my Tabhost id = ""@android:id/tabhost"": </p><blockquote>  <p>02-18 22:23:11.937:  ERROR/AndroidRuntime(5944): Caused by:  java.lang.RuntimeException: Your  content must have a TabHost whose id  attribute is 'android.R.id.tabhost'</p></blockquote><p>I have declared the second intent in the Manifest.xml file: XML:</p><pre><code>&lt;activity android:name="".NextActivity"" android:label=""@string/app_name"" &gt; </code></pre><p>Within the first activity (MainActivity), I start the second intent (NextActivity), with extras, as follows: </p><pre><code>Intent nextActivity = new Intent(MainActivity.this,NextActivity.class); Bundle b_next=new Bundle(); b_next.putString(""s_string"", myString); nextActivity.putExtras(b_next); </code></pre><p>In my NextActivity.java file, I get the extras and try to display the TabHost View: </p><pre><code>public class NextActivity extends TabActivity {      @Override      public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         String myString;         Bundle b_initial;         b_initial = getIntent().getExtras();         myString = b_initial.getString(""s_string"");      setContentView(R.layout.main);         } }</code></pre><p>I get the same error with using the TabHost example on the Android Developer site (Hellow View): </p><p>Main.xml: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@android:id/tabhost""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;     &lt;LinearLayout         android:orientation=""vertical""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""&gt;         &lt;TabWidget             android:id=""@android:id/tabs""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content"" /&gt;         &lt;FrameLayout             android:id=""@android:id/tabcontent""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""&gt;             &lt;TextView                 android:id=""@+id/textview1""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:text=""this is a tab"" /&gt;             &lt;TextView                 android:id=""@+id/textview2""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:text=""this is another tab"" /&gt;             &lt;TextView                 android:id=""@+id/textview3""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:text=""this is a third tab"" /&gt;         &lt;/FrameLayout&gt;     &lt;/LinearLayout&gt; &lt;/TabHost&gt;</code></pre><p>Thanks in advance folks...</p><p>CLARIFICATION:This is what I really get from LogCat:</p><blockquote>  <p>java.lang.NullPointerException<br>       at android.widget.TabHost.dispatchWindowFocusChanged(TabHost.java    285)       at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java  640)       at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java  640)       at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java  640)       at android.view.ViewRoot.handleMessage(ViewRoot.java 1645)       at android.os.Handler.dispatchMessage(Handler.java   99)       at android.os.Looper.loop(Looper.java    123)       at android.app.ActivityThread.main(ActivityThread.java   3948)       at java.lang.reflect.Method.invokeNative(Native  Method)<br>       at java.lang.reflect.Method.invoke(Method.java   521)       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java    782)       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java   540)       at dalvik.system.NativeStart.main(Native  Method)</p></blockquote>","","user276856","","user276856","2010-02-19 16:46:46","2012-11-15 07:51:09","Issue with displaying TabHost Layout in new Intent","<android><android-widget><android-intent><android-tabhost>","9","1","","",""
"2295420","1","","","2010-02-19 10:08:32","0","716","<p>Is it possible to replace com.android.internal.policy.impl.PhoneWindowManager with my own implementation (actually I would like to make a small modification on the current one)?</p>","276865","","","","","2010-02-19 10:18:22","How to replace PhoneWindowManager","<android>","1","0","","",""
"2295488","1","2295635","","2010-02-19 10:18:12","1","539","<p>I want to do some data processing (in a thread) right after my main Activity starts. For that data processing to be started I also need to know a visible size of my main View (which is a LinearLayout currently, but whatever).</p><p>I wonder how to do that. I.e. I wonder what is the entry point (callback?) I should use to be sure that my main View has been layed out, so i can use view.getWidth/getHeight?</p><p>Is creating a custom View and reimplementing it's onSizeChanged() - the only way? In this case how should I properly describe it in my xml layout file? (it will contain some child views)</p><p>Thanks in advance.</p>","258848","","","","","2010-02-19 10:40:49","How to determine the View size right after Activity has been started","<android><layout><view>","1","0","","",""
"2295878","1","2296368","","2010-02-19 11:27:35","1","2813","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2506876/how-to-change-position-of-toast-in-android"">how to change position of Toast in android?</a>  </p></blockquote><p>Is there any method to align toast message in application.By default it always appears at the bottom of application.i did it like this...Toast.makeText(this, ""hello !"", Toast.LENGTH_LONG).show();Thank you </p>","263325","","","","","2012-04-02 10:59:01","How to align toast in android","<android>","2","0","","2011-10-03 11:59:16",""
"2295987","1","","","2010-02-19 11:46:42","1","1029","<p>I mean, is there any way to</p><ul><li>add more functionality</li><li>add/remove events</li><li>synchronize with other then Google calendars/formats (authorized)</li></ul>","17980","","","","","2010-02-19 12:03:44","How can I extend Calendar on Android?","<android>","1","0","0","",""
"2295998","1","2296247","","2010-02-19 11:48:32","7","5580","<p>For checking internet access on device I use requestRouteToHost function, but it's second argument has integer type - what i has to put in it? Is it int-view of IP like [1] function makes? I think there is more simple way by using default android functions. Can somebody tell me?</p><p>[1] --></p><pre><code>public static Long ipToInt(String addr) {        String[] addrArray = addr.split(""\\."");        long num = 0;        for (int i=0;i&lt;addrArray.length;i++) {            int power = 3-i;            num += ((Integer.parseInt(addrArray[i])%256 * Math.pow(256,power)));        }        return num;    }</code></pre><p>Thanks.</p>","263321","","","","","2010-02-19 12:35:05","requestRouteToHost IP argument","<android>","1","0","2","",""
"2296063","1","","","2010-02-19 11:57:49","0","248","<p>is it possible to show any animation when i call a function in same class in android?In my application, i called a function ""doAddition"" so many times.And i want whenever i call this function, it shows some animation.Thank you</p>","263325","","","","","2010-02-22 02:15:27","Showing animation to call function in android","<android>","3","0","","",""
"2296377","1","2296416","","2010-02-19 12:57:48","40","40712","<p>How might I obtain the city name in Google Maps if I have latitude and longitude coordinates of a town or area?</p><p>I tried using the latitude, longitude and I got country but I don't know how to get city name.</p>","249991","","","user1521536","2013-03-26 10:56:34","2014-03-12 07:06:22","How to get city name from latitude and longitude coordinates in Google Maps?","<android><google-maps><reverse-geocoding>","4","0","23","",""
"2296453","1","","","2010-02-19 13:11:17","1","74","<p>i am developing an application which find current latitude and longitude.but this latitude and longitude is varying frequently while my device is static.how i can remove this issue?</p>","271694","","","","","2010-02-19 13:23:27","lat long varies frequently","<android>","1","3","","",""
"2296816","1","","","2010-02-19 14:05:48","0","130","<p>i`am asking a  new question, since the previouse one was in another purpose(the one on serializing)</p><p>I have a list of items which r binded to database, and i want to serialize the database rows to file (on runtime!!), and in the future to deserialize them. now as we know, i have to go through all the rows in my database and create new object to each row and serialize it to the file. the prob is that if we have 10000 rows in my database, then it's 10000 allocations of objects which eventually will be serialized.. any idea how to avoid this mass-allocation?</p><p>Thanks!</p>","273550","","6583","","2011-02-22 07:41:57","2011-02-22 07:41:57","serializing to file on-the-fly effectively","<android>","1","0","","",""
"2296905","1","2297153","","2010-02-19 14:19:32","6","5118","<p>I've been digging for awhile into the source of the <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=tree"">Contacts app</a> on Android to find out which Activity handles <code>Intent.ACTION_CALL_PRIVILEGED</code>. Unfortunately, I couldn't find its source code. Does anyone know how it's called, or even better where I can find it's source? Thank you!</p>","224956","","","","","2012-09-12 05:39:23","Which activity handles Intent.ACTION_CALL_PRIVILEGED?","<android><activity><android-intent>","1","0","5","",""
"2297348","1","","","2010-02-19 15:20:01","3","777","<p>Is it possible to find dynamically what are the languages supported by the application?For example, I have strings for the following languages: English, French, Dutch and German.They are defined in their corresponding res directories: values, values-fr, values-nl and values-de.I want to give the user the possibility to choose between them and for this I want to load them. But I don't want to hard-code the choices. I tried to use:    getApplication().getResources().getAssets().getLocales()But this method returns all the locales the phone supports. </p><p>Do you have any other idea?</p>","277068","","139010","","2010-02-19 15:27:33","2010-02-19 19:28:01","Getting the available languages of the application dynamically","<android><string><resources><locale>","1","2","1","",""
"2297601","1","21751407","","2010-02-19 15:55:57","13","7859","<p>Just wondering how you handle the following problem: a result is calculated depending on two spinners' selected items. To handle the UI things, i.e. a user picks a new item in one of the spinners, I install a listener using <code>setOnItemSelectedListener</code> for the spinner in my <code>onCreate()</code> method of the activity.</p><p>Now: that works, of course, fine. The listener's work is to trigger a new calculation of the result.</p><p>The problem: because I intercept <code>onPause()</code> <code>onResume()</code> to save/restore the last state, I got a method that <strong>sets</strong> these two spinners' selected item programmatically like in here:</p><pre><code>startSpinner.setSelection(pStart);destSpinner.setSelection(pDest);</code></pre><p>These two calls invoke the listeners, too! My calculation method for the result plus the notification of a new result set is invoked twice here!</p><p>A stupid direct approach for this would be to have a boolean variable <strong>disabling</strong> whatever the listener does inside, setting it before setting the selected items and resetting it afterwards.Okay. But is there a better method??</p><p>I don't want listeners to be called by code - actions, only by user actions! :-(</p><p>How do you do it?Thanks!</p>","273456","","","","","2014-02-13 10:23:38","How to disable onItemSelectedListener to be invoked when setting selected item by code","<android><listener><spinner>","6","0","2","",""
"2297739","1","2298413","","2010-02-19 16:12:52","0","596","<p>I added a BroadCastReceiver to my application.I want to call my inputMethod's method but I can't find a way to access it's instance.</p><p>I read I can get an InputMethodManager by:</p><pre><code>InputMethodManager manager = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);</code></pre><p>but I couldn't find a way to get the the InputMethod instance from the InputMethodManager.</p><p>Is doing a singleton the only way to access it?</p>","119895","","","","","2010-02-19 17:41:54","Calling an inputMethod's method when a BroadcastReceiver gets called","<android>","1","0","1","",""
"2298140","1","2298380","","2010-02-19 17:02:21","1","675","<p>I've got a common use-case wherein a user selects one item out of many (say, on a spinner or autocomplete list), then enters the data.  For example, let's say the user selects a country.  Ultimately, the data I want is the country code, not the country name; but the users will want to select based on name, not code.  To put it another way, user's will select ""United States"", but I ultimately want that to translate into ""US"".</p><p>There are a lot of countries.  Is there an easy way to setup a mapping in Android to hash from the name to the code?  I've thought of a few solutions, none of them are quite satisfactory in my mind:</p><ol><li><p>A database containing country/code, which I can query on.</p></li><li><p>Setting up all countries as strings in <code>strings.xml</code>, then retrieving the resource by name.</p></li><li><p>Creating a huge Map in code and using that.  (This is the least satisfactory answer).</p></li></ol><p>Anyone have any cleverer solutions?</p>","60261","","","","","2010-02-19 18:57:55","Is there an Android utility for storing a static map?","<android>","2","0","","",""
"2298208","1","2299813","","2010-02-19 17:12:35","406","163547","<p>I would like to know how I can find the memory used on my Android application, programmatically.</p><p>I hope there is a way to do it. Plus I would like to understand how to get the free memory of the phone too.</p>","314407","","1589880","","2012-10-03 06:07:18","2014-01-31 22:06:07","How to discover memory usage of my application in Android","<java><android><memory><memory-management>","6","0","423","",""
"2298580","1","2298949","","2010-02-19 18:13:43","1","1858","<p>My app has 5 different relative layouts that it can switch between by using a set of buttons that is at the bottom of the screen. 3 of the layouts contain only TextViews and ImageViews. The other 2 both have a ListView in them. On the 2 views that contain lists when the soft keyboard appears the buttons that are along the bottom move up to on top of the soft keyboard. But on the other 3 views the buttons get hidden by the keyboard. The buttons all have the attribute android:alignParentBottom=""true"" does anyone know why they'd be behaving differently when one of these two are the active layout at the time? </p>","277215","","","","","2010-08-05 20:26:28","Android Layout question","<android><layout>","1","0","1","",""
"2298646","1","","","2010-02-19 18:27:52","3","1020","<p>I assume that when I do a read on the inputstream, it blocks until it gets more data to read.I also assume that when the connection is closed, the read throws an IOException.</p><p>The problem is that sometimes when I change the connection from carrier to WiFi or from WiFi to carrier, the read just gets stuck and never throws the IOException.</p><p>The SDK is 1.5 and the phone a HTC Hero.</p><p>This behavior is quite ugly for me because I need to stay always connected.Does someone else have ever seen this problem ? Is it a bug or am I the bug ?</p><p>Thanks</p>","179872","","","","","2010-06-28 15:58:12","Android SSL socket blocks on read while changing connection","<java><android><sockets>","2","4","1","",""
"2298711","1","2298728","","2010-02-19 18:38:41","3","8257","<p>I am working on an Android application which does http request and download contents etc. I want to test such cases on Android Simulator. I am using Android SDK 1.6.As my computer(Mac OS X) has Internet connectivity via Wifi, i'm trying to activate Wifi connectivity in Android Simulator as well, so that my code can get data connection access to download the data from http server. But when i try to connect it, it says 'Unable to start Wi-Fi' in the simulator wireless settings. If i try to browse in emulator browser, it says 'page not available, check connection etc'. Can you please tell me how to have internet connection on Android Emulator?I don't know how to set Wifi settings in Android simulator. Could someone help me on this?</p><p>System: Mac OS XAndroid SDK: 1.6Editor: Eclipse IDE for Java developers.Internet connectivity on Mac system: via WiFi</p><p>Please give me step by step procedure to have internet connectivity on Android Emulator as i didn't find anything from anywhere.</p><p>Thanks.</p>","187532","","","","","2012-08-07 06:55:18","Android: how to set Wifi settings to access Internet connection in Android simulator?","<android>","2","0","","",""
"2298784","1","2299512","","2010-02-19 18:51:52","3","1437","<p>Does anyone know if there is a way to identify (in code, not LogCat) when the GC has run?  Perhaps an intent is fired?  I could analyze the LogCat output, but it would be ideal if I could determine when the GC has run from my code.</p>","150771","","114066","","2010-08-16 16:01:33","2010-08-16 16:01:33","Determine when the Android GC runs","<android><garbage-collection>","2","0","3","",""
"2298816","1","2299074","","2010-02-19 18:58:22","1","1034","<p>I want to create multiple instances of an activity in the same process. Should I use FLAG_ACTIVITY_NEW_TASK flag like the code below?</p><pre><code>                Intent i = new Intent();                i.setClass(this, A.class);                i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);                 startActivity(i);</code></pre><p>This code is executed in class A to create another instance of activity A.</p><p>This question, will this code create another task? As I understand is a process can only have one task. Does it mean the two activities will exist in different tasks? That's what I want. I want the two activities to be in the same process.</p><p>Thanks.</p>","256239","","","","","2010-02-19 19:38:53","How to create multiple instances of an activity?","<android>","1","1","","",""
"2298817","1","","","2010-02-19 18:58:27","1","2083","<p>All I want to do is simply control background music in my app through a service so I am able to start it and stop it from any activity.</p><p>I have everything set up perfectly when I tell the service to Toast when it is started and destroyed but as soon as I put the media playin in there instead It starts fine and starts playing the music but as soon as a click a button to stop the service I get an error and a force close.</p><p>PLEASE someone help me see what I am doing wrong.. I am pretty new to android developing I'm guessing it's going to be something easy.</p><p>Here is my code:</p><pre><code>import android.app.Service;import android.content.Intent;import android.media.MediaPlayer;import android.os.IBinder;import android.widget.Toast;publicclass MyService extends Service {private MediaPlayer player;@Overridepublic IBinder onBind(Intent intent) {returnnull;}@Overridepublicvoid onCreate() { super.onCreate(); Toast.makeText(this, ""Service Started"", Toast.LENGTH_SHORT).show();MediaPlayer player = MediaPlayer.create(MyService.this, R.raw.oceanwavestest);player.start();player.setLooping(true);}@Overridepublicvoid onDestroy() {super.onDestroy();player.stop();Toast.makeText(this, ""Service Stopped"", Toast.LENGTH_SHORT).show();} } </code></pre>","277247","","243782","","2010-02-19 19:01:24","2011-01-06 11:43:10","Problem With My Android Service Please Help!","<java><android><service><media-player>","2","1","0","",""
"2298889","1","","","2010-02-19 19:11:08","4","4203","<p>In Android, you need to implement the following Activity methods so your application can be restored to its previous state if the OS decides to destroy then recreate your activity:</p><pre><code>public void onSaveInstanceState(Bundle savedInstanceState)public void onRestoreInstanceState(Bundle savedInstanceState)</code></pre><p>The examples I've seen of implementing these methods is to use put/getBoolean, put/getInt etc. on the Bundle object (i.e. primitive objects only) to save the application state. This seems hugely error prone way to save your state for a start and I cannot see how this scales to storing complex objects without writing lots of code.</p><p>What options do I have for storing/restoring state in a robust and easy to implement fashion? </p><p>In case it's important, my application (a game) needs to store about 50 objects, which each store maybe 5 float variables and some store references to other objects. I don't particularly want to have to write save/restore methods for every class and subclass (maybe about 15 of these) I use. It would be ideal if I could just stick all my state relevant objects in an object called ""state"" and then just call save/load on ""state"" to handle everything.</p><p>Is using Java serialization an option? I've heard it's very slow, but is that a problem for save/restoring? Could I just write my data to the SD card? To a database?</p>","271566","","","","","2011-10-13 09:26:54","Robust+easy way to save/restore Android app instance state","<java><android><serialization><software-engineering>","2","0","1","",""
"2298946","1","","","2010-02-19 19:19:46","5","10576","<p>All I want to do is simply control background music in my app through a service so I am able to start it and stop it from any activity.</p><p>I have everything set up perfectly when I tell the service to Toast when it is started and destroyed but as soon as I put the media playin in there instead It starts fine and starts playing the music but as soon as a click a button to stop the service I get an error and a force close.</p><p>PLEASE someone help me see what I am doing wrong.. I am pretty new to android developing I'm guessing it's going to be something easy.</p><p>Here is my code:</p><pre><code>import android.app.Service;import android.content.Intent;import android.media.MediaPlayer;import android.os.IBinder;import android.widget.Toast;public class MyService extends Service {    private MediaPlayer player;    @Override    public IBinder onBind(Intent intent) {        return null;    }    @Override    public void onCreate() {        super.onCreate();        Toast.makeText(this, ""Service Started"", Toast.LENGTH_SHORT).show();        MediaPlayer player = MediaPlayer.create(MyService.this, R.raw.my_music);        player.start();        player.setLooping(true);    }    @Override    public void onDestroy() {        super.onDestroy();        player.stop();        Toast.makeText(this, ""Service Stopped"", Toast.LENGTH_SHORT).show();    }}</code></pre>","277247","","212275","","2011-01-31 01:31:46","2013-08-23 14:33:27","Android Service controlling MediaPlayer","<android><service><media-player>","2","2","","",""
"2299017","1","2299038","","2010-02-19 19:29:23","10","7481","<p>I'm just about to launch my first Android app, and it runs on the Android 1.1 platform, API Level 2, but is this what I should officially sign and launch the app as?  Does it affect performance at all or is it simply for Android to know which devices it works on?</p><p>The only problem I see is that I can't specify &lt;supports-screens&gt; in the Manifest, which I would like to do, but it appears I'd have to launch at 1.6 at least for this to work.</p><p>Would I be missing a huge number of phones by launching at 1.6 instead of 1.1?</p><p>Thank you!</p>","179518","","19750","","2010-02-19 19:47:43","2012-02-16 16:03:26","Which Android platform and API to target?","<android><backwards-compatibility><platform>","5","4","4","",""
"2299909","1","2299954","","2010-02-19 21:57:59","0","1106","<p>The xml files that contains the Activity layouts can be rendered by Eclipse.</p><p>How do I get that Eclipse screen area to have vertical orientation, not horizontal (inside Eclipse - it correctly shows as vertical in the emulator)?</p><p>Peter </p>","253661","","","","","2010-02-19 22:05:34","How to change orientation of xml ""layout"" area in Eclipse","<android><eclipse><layout><orientation>","1","0","","",""
"2299943","1","","","2010-02-19 22:03:45","3","7047","<p>I'm currently running automation tests using an app that uses multiple Activity for displaying each screen.</p><p>Is there anyway to go back to a previously launched Activity while running an Instrumentation test? Currently, when I use sendKeyDownUpSync( KeyEvent.KEYCODE_BACK);, this forces my test to exit, rather than go back to the previous Activity.</p><p>Any help with this is greatly appreciated.</p><p>Jin</p>","277359","","","","","2013-01-11 06:22:18","Android Instrumentaion: How do I go back to a previously launched Activity?","<android><activity><instrumentation>","4","0","","",""
"2299956","1","2300012","","2010-02-19 22:05:45","1","476","<p>I am trying to create an option in my code to change layouts using preferences. I already have the two layouts created in XML, but I can't figure out how to swap between the two during runtime. I would like to cause it to check during onResume() since it is called directly after returning from the Preferences screen and when starting up, however I can't figure out the code necessary. I tried just using setContentView() a second time, but it didn't seem to work. What can I do? Thanks in advance!</p>","234256","","","","","2011-01-30 03:02:10","How can I swap LinearLayouts from XML during runtime (Android)?","<xml><android><android-linearlayout>","2","0","","",""
"2299991","1","","","2010-02-19 22:12:59","1","239","<p>The scene: I have a directory structure like the following:</p><pre><code>mkdir -p foo/bar  touch foo/bar/test.txt</code></pre><p>What I want to do is to add test.txt to a .apk under the directory foo/bar, so that uncompressing or listing the apk returns the same directory structure.</p><p>This worked fine under the 1.6 SDK:</p><pre><code>aapt add test.apk foo/bar/test.txt</code></pre><p>I could list and uncompress test.apk and all was well. Under 2.1, however, test.txt is added to the root of test.apk, which isn't what I want.</p><p>I just tested this under the 2.1 SDK on my desktop and the older 1.6 version on my laptop, and I've confirmed that it used to work and now doesn't.</p><p>I've looked at the aapt command line options, and if there's a --keep-the-files-i-add-in-their-subdirectories option then I'm just not seeing it. :/ Googling is also not returning anything useful.</p><p>Would really appreciate help with this. I need to store third-party .properties files in my Android application so they're on the classpath, and my inability to find the right command line incantations is the only blocker keeping this app off of 2.1. :)</p><p>Thanks a bunch.</p>","277144","","","","","2011-05-04 08:51:50","Different aapt behavior for subdirectories between 1.6 and 2.1?","<android>","2","2","","",""
"2299994","1","","","2010-02-19 22:13:23","4","8415","<p>I have a webview, if the user clicks on a link, it opens in the same webview (I controll that with shouldOverrideUrlLoading()) but if it is a video link (mp4, 3gp) it does not launch the media player to reproduce the video (as it does in the normal browser app).How o force the media player to launch when a video link is clicked inside a webview?</p><p>Thanks!</p>","277377","","","","","2012-05-22 22:43:32","Android launch mediplayer for videos from a webview?","<android><webview>","5","1","3","",""
"2300019","1","4218384","","2010-02-19 22:19:11","5","2632","<p>I need to take a picture with the camera and, if depending on the picture size, rotate it before saving it into the gallery.</p><p>I'm using </p><blockquote>  <p>Intent imageCaptureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);     imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri);     startActivityForResult(imageCaptureIntent, IMAGE_CAPTURE);</p></blockquote><p>To take the pic and save it to a temporary file.</p><p>Then </p><blockquote>  <p>Bitmap bmp = BitmapFactory.decodeFile(imagePath);<br>     String str = android.provider.MediaStore.Images.Media.insertImage(cr, bmp, name, description);</p></blockquote><p>To save it.</p><p>This is the code i have tried to use to rotate the bitmap</p><blockquote>  <p>Matrix matrix = new Matrix();<br>     matrix.postRotate(180);<br>     Bitmap x = Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix,    true);<br>     android.provider.MediaStore.Images.Media.insertImage(cr, x, name, description);  </p></blockquote><p>The problem is I'm getting an OutOfMemoryException.</p><p>Is there a better way to handle the bitmaps to avoid breaking the memory?</p><p>~Thanks in advance, regards</p>","441621","","","","","2013-05-10 14:37:54","How to work with large bitmap. Rotating and inserting to the gallery","<android><image><memory><camera>","1","0","","",""
"2300029","1","2300413","","2010-02-19 22:20:23","4","2122","<p>I'm trying to build a valid junit testing suite on android. </p><p>Since i'm new to Junit i can't figure out how to use the ServiceTestCase class. </p><p>I can't figure it out how to get the getService() method working. it ever returns me null . So i decided to start it via startService. It does not work. </p><p>Could you please help me ?</p><p>Thanks</p>","314407","","427763","","2012-01-20 15:54:27","2012-01-20 15:54:27","ServiceTestCase<T>.getService?","<java><android><servicetestcase>","1","1","4","",""
"2300122","1","2306621","","2010-02-19 22:38:46","8","1491","<p>Has anyone used Robotium or Calculon for testing Android apps?  Are they useful? Any recommendations on which is better?</p>","67674","","","","","2010-02-21 20:48:26","Has anyone used Robotium or Calculon for testing Android apps?","<android><unit-testing><testing><acceptance-testing>","1","0","3","",""
"2300169","1","2301284","","2010-02-19 22:50:38","42","237612","<p>I tried to do this</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    t=new TextView(this);     t=(TextView)findViewById(R.id.TextView01);     t.setText(""Step One: blast egg"");    try {        Thread.sleep(10000);    } catch (InterruptedException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    t.setText(""Step Two: fry egg"");</code></pre><p>but for some reason, only the second text shows up when I run it.  I think it might have something to do with the <code>Thread.sleep()</code> method blocking. So can someone show me how to implement a timer ""asynchronously""?</p><p>Thanks.</p>","270811","","1278949","","2013-03-02 18:06:08","2013-07-24 08:44:46","how to change text in Android TextView","<android><textview>","6","0","17","",""
"2300538","1","2300560","","2010-02-20 00:29:13","2","898","<p>Is there a way to specify in your layout which widgets will shift and move when the software keyboard appears?  In some layouts, It will shrink the innermost scrolling area automatically, just making your layout smaller, but there doesn't seem to be a rhyme or reason to when it does this.  How can I tell it which widgets to shrink, etc?</p>","238849","","","","","2011-12-13 01:17:51","Android: How can you specify where in your layout the software keyboard will appear?","<android>","3","0","1","",""
"2300575","1","","","2010-02-20 00:44:14","1","251","<p>Is there a way to query if the OpenGL ES implementation on android supports non-power of two textures?</p>","277450","","","","","2011-01-16 08:34:26","Can we dynamically check if npot is supported in android?","<android>","1","1","","",""
"2300642","1","2342158","","2010-02-20 01:14:22","0","317","<p>My Android app has a ContactsList activity in which I simply display a list of contacts that are on the phone. </p><p>Only recently I noticed that my activity only displays contacts synced with my main Google account. I have two Google accounts on my test phone and ideally I want my activity to display the contacts for both accounts (or multiple accounts).</p><p>How do I query across multiple accounts?</p><p>This is how I setup my cursor currently</p><pre><code>Cursor c = getContentResolver().query(Phones.CONTENT_URI, null,            queryString, null, Phones.DISPLAY_NAME + "" ASC"");    startManagingCursor(c);</code></pre><p>On a side note, I know android.provider.contacts.phones is deprecated and I should be using ContactsContract but I need to build my app with SDK 1.5, which doesn't have ContactsContract</p>","236300","","","","","2010-02-26 14:13:59","Querying Contacts DB w/ multiple synced accounts in Android","<android><cursor><google-contacts>","1","0","","",""
"2300654","1","2300673","","2010-02-20 01:18:42","2","318","<p>Sometimes you want to start an Activity by pressing a Button.</p><p>Is there a way to express that in XML?  I.e. to tag the Button xml with the Activity to render when it is clicked?  That would certainly be a lot quicker and slicker and shorter than writing the equivalent Java code to handle the event.</p><p>Peter</p>","253661","","","","","2010-02-20 01:29:59","Can you connect Views to eventhandlers using XML?","<xml><android><events><handling>","1","0","0","",""
"2300807","1","","","2010-02-20 02:34:48","4","3872","<p>In my app, I access my sqlite database at the following hard-coded location in my code:</p><p><strong>/data/data/</strong> com.mydomain.appname/databases/database.db</p><p>If I turn ON copy protection in the Market Place, will my app still have access to this location?</p><p>Or will I have to change it to something like:</p><p><strong>/data-private/data/</strong> com.mydomain.appname/databases/database.db</p><p>(or something like this)</p><p>Since I have a Dev phone only, I have no way of testing to see if my app still functions normally after turning on copy protection.</p><p>Thank you! </p><p>[edit: this question was rephrased for clarity]</p>","179518","","179518","","2010-04-02 18:24:27","2010-04-02 18:24:27","Android app copy protection and data files","<android><copy-protection><google-play>","2","0","1","",""
"2300884","1","","","2010-02-20 03:13:25","1","956","<p>Is there a way run an intent from packageinfo? I've been searching and I don't find it.</p><p>I tried like that </p><pre><code>Intent i = new Intent(); i.setAction(Intent.ACTION_MAIN);i.addCategory(Intent.CATEGORY_LAUNCHER);i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);i.setComponent(new ComponentName(p.applicationInfo.packageName,p.applicationInfo.name));startActivity(i);</code></pre><p>but it doesn't work because <code>p.applicationInfo.name</code> is always null.</p>","277490","","750987","","2011-06-17 02:09:04","2014-01-15 14:34:57","Starting activity from packageinfo","<android><android-intent>","2","0","1","",""
"2301057","1","11593475","","2010-02-20 04:31:26","2","16998","<p>I am starting a service using <strong>startService(Intent intent)</strong> method. When i call this function it reaches the <strong>onCreate</strong> of service but it is unable to call <strong>onStartCommand</strong>. Here is my code--</p><pre><code>@Overridepublic void onReceive(Context context, Intent intent) {    // Send a text notification to the screen.    Log.e(""mudit"", ""Action: "" + intent.getAction());    try {        ConnectivityManager connManager = (ConnectivityManager) context                .getSystemService(Context.CONNECTIVITY_SERVICE);        NetworkInfo info = connManager.getActiveNetworkInfo();        Log.e(""mudit"", ""getType: "" + info.getType());        Log.e(""mudit"", ""isConnected: "" + info.isConnected());        if (info.isConnected()) {            Intent newinIntent = new Intent(context, service.class);            context.startService(newinIntent);        }    } catch (Exception e) {        e.printStackTrace();        Intent newinIntent = new Intent(context, service.class);        context.stopService(newinIntent);    }}</code></pre><p>Service Code -- </p><pre><code>package com.android.service;import android.app.Service;import android.content.Intent;import android.os.IBinder;import android.widget.Toast;public class service extends Service {    @Override    public IBinder onBind(Intent arg0) {        // TODO Auto-generated method stub        return null;    }    @Override    public void onCreate() {        super.onCreate();        Toast.makeText(this, ""Service created..."", Toast.LENGTH_LONG).show();    }    @Override    public void onDestroy() {        super.onDestroy();        Toast.makeText(this, ""Service destroyed ..."", Toast.LENGTH_LONG).show();    }    public int onStartCommand(Intent intent, int flags, int startId) {        Toast.makeText(this, ""onStartCommand..."", Toast.LENGTH_LONG).show();        return 1;    }}  </code></pre><p>Manifest.xml --</p><pre><code>&lt;receiver class="".AReceiver"" android:name="".AReceiver""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.net.conn.CONNECTIVITY_CHANGE"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;    &lt;service class="".service"" android:name="".service""        android:enabled=""true"" android:icon=""@drawable/icon""&gt;    &lt;/service&gt;</code></pre>","152867","","254477","","2013-05-30 13:03:46","2013-05-30 13:03:46","Starting a service on android platform","<android><android-service>","5","1","2","",""
"2301257","1","","","2010-02-20 06:02:33","19","9071","<p>I'm interested in the following features:</p><ol><li>Writing an app for Android Market that is written completely in C++ (a port of existing product actually).</li><li>Use fast screen-buffer pixel pushing (or rather using OpenGL ES for this).</li><li>Grab user input and direct it to C++ code.</li></ol><p>Is it legal to write such an app for Market? Is Market policy somehow strict to such things?</p>","277526","","89847","","2010-02-20 08:07:50","2011-01-21 14:40:52","Can I make a rather native C++ app with Android?","<c++><android><opengl-es><pixels>","7","0","6","",""
"2301453","1","","","2010-02-20 07:33:12","1","127","<p>I have to develop an application which do payment transfer.i have to send some important data from android to web using url.but data should not shown in url for security purpose .how i can do this?</p>","271694","","","","","2010-02-20 10:17:58","authorized net payment","<android>","1","0","","",""
"2301606","1","2302390","","2010-02-20 08:44:10","1","272","<p>I am learning android developing. Well, my appwidget failed at this line:</p><pre><code>Cursor cursor = context.getContentResolver().query(Contacts.CONTENT_URI,                new String[] {Contacts.DISPLAY_NAME},                Contacts.STARRED + ""=0"", null, null);</code></pre><p>May I know why? Thanks.</p><p>Added: I have tried a few ways I used in Java to debug this line, all I got was ""stop unexpectedly"".</p>","277569","","277569","","2010-02-21 07:22:19","2010-02-21 07:50:33","Problem using ContactsContract.Data when query","<android>","1","1","","",""
"2302326","1","2302632","","2010-02-20 13:28:25","1","180","<p>I am doing a keyboard for Android.I am willing to have a plugin structure to allow users to improve the prediction engine.</p><p>The prediction engine is done with Android NDK and it was coded in C. I have a wrapper class that calls the C code. An instance of this wrapper class is a field in the InputMethodService.The prediction engine gets updated by sending complete sentences. Something like:</p><pre><code>public void updateEngine(String sentence);</code></pre><p>Plugins should be calling that method.An example of the plugin can be a .txt parser. You select a txt file and the plugin will start sending to the main app all sentences.I would like plugins to be customizable, e.g.: They might have an screen where you can choose max sentence to send, to run on background, etc.The UI (don't know if it should be on the main app or the plugin, check my questions below) should have the possibility to ask the plugin how many sentence it can send (to do a progress bar).</p><p>My questions are:</p><ul><li>Should I use Intents or IPC?</li></ul><p>I think I should use Intents since I just use primitive types.</p><ul><li>Should my operations be atomic or send an array of sentences?</li></ul><p>I am willing to start with atomic operations but I am worried about performance.</p><ul><li>The plugins must be activities or Services?</li></ul><p>They should be Activities and if necessary (""process on background"" on) launch a service. Or perhaps they are just services and the main app takes care of the UI.</p><ul><li>Who should save information about the last execution. Plugin or the mainApp?</li></ul><p>e.g. When was the last time the plugin was used.</p>","119895","","119895","","2010-02-20 14:26:27","2010-06-26 23:15:21","Updating an application information using other applications (plugins)","<java><android><plugins>","2","2","0","",""
"2302460","1","2302557","","2010-02-20 14:13:39","0","1503","<p>How do I import the fbconnect-android.zip into my project in eclipse?</p><p>Thanks.</p>","267269","","834063","","2012-11-16 00:05:17","2012-11-16 00:18:24","How to get Android Facebook Api","<android><facebook>","2","0","","",""
"2302858","1","2304598","","2010-02-20 16:41:57","0","4723","<p>i am doing facebook app in my project.</p><p>i followed this step the sample app in this link.</p><p><a href=""http://code.google.com/p/fbconnect-android/downloads/list"" rel=""nofollow"">http://code.google.com/p/fbconnect-android/downloads/list</a></p><p>now i got this exception in my Logcat.</p><pre><code>02-20 22:02:29.020: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.example.brown/.Brown_FaceBook }02-20 22:02:29.409: ERROR/dalvikvm(236): Could not find class 'com.codecarpet.fbconnect.FBPermissionActivity', referenced from method com.example.brown.Brown_FaceBook.askPermission02-20 22:02:29.418: WARN/dalvikvm(236): VFY: unable to resolve const-class 78 (Lcom/codecarpet/fbconnect/FBPermissionActivity;) in Lcom/example/brown/Brown_FaceBook;02-20 22:02:29.418: DEBUG/dalvikvm(236): VFY: replacing opcode 0x1c at 0x000202-20 22:02:29.428: DEBUG/dalvikvm(236): Making a copy of Lcom/example/brown/Brown_FaceBook;.askPermission code (125 bytes)02-20 22:02:29.438: INFO/dalvikvm(236): Could not find method com.codecarpet.fbconnect.FBSession.getUid, referenced from method com.example.brown.Brown_FaceBook.checkPermission02-20 22:02:29.448: WARN/dalvikvm(236): VFY: unable to resolve virtual method 124: Lcom/codecarpet/fbconnect/FBSession;.getUid ()Ljava/lang/Long;02-20 22:02:29.448: DEBUG/dalvikvm(236): VFY: replacing opcode 0x6e at 0x000902-20 22:02:29.457: DEBUG/dalvikvm(236): Making a copy of Lcom/example/brown/Brown_FaceBook;.checkPermission code (112 bytes)02-20 22:02:29.469: ERROR/dalvikvm(236): Could not find class 'com.codecarpet.fbconnect.FBFeedActivity', referenced from method com.example.brown.Brown_FaceBook.publishFeed02-20 22:02:29.469: WARN/dalvikvm(236): VFY: unable to resolve const-class 75 (Lcom/codecarpet/fbconnect/FBFeedActivity;) in Lcom/example/brown/Brown_FaceBook;02-20 22:02:29.478: DEBUG/dalvikvm(236): VFY: replacing opcode 0x1c at 0x000202-20 22:02:29.478: DEBUG/dalvikvm(236): Making a copy of Lcom/example/brown/Brown_FaceBook;.publishFeed code (68 bytes)02-20 22:02:29.497: WARN/dalvikvm(236): Unable to resolve superclass of Lcom/example/brown/Brown_FaceBook$FBSessionDelegateImpl; (81)02-20 22:02:29.497: WARN/dalvikvm(236): Link of class 'Lcom/example/brown/Brown_FaceBook$FBSessionDelegateImpl;' failed02-20 22:02:29.507: ERROR/dalvikvm(236): Could not find class 'com.example.brown.Brown_FaceBook$FBSessionDelegateImpl', referenced from method com.example.brown.Brown_FaceBook.onCreate02-20 22:02:29.521: WARN/dalvikvm(236): VFY: unable to resolve new-instance 95 (Lcom/example/brown/Brown_FaceBook$FBSessionDelegateImpl;) in Lcom/example/brown/Brown_FaceBook;02-20 22:02:29.528: DEBUG/dalvikvm(236): VFY: replacing opcode 0x22 at 0x001502-20 22:02:29.528: DEBUG/dalvikvm(236): Making a copy of Lcom/example/brown/Brown_FaceBook;.onCreate code (292 bytes)02-20 22:02:29.537: WARN/dalvikvm(236): Unable to resolve superclass of Lcom/example/brown/Brown_FaceBook$FBSessionDelegateImpl; (81)02-20 22:02:29.537: WARN/dalvikvm(236): Link of class 'Lcom/example/brown/Brown_FaceBook$FBSessionDelegateImpl;' failed02-20 22:02:29.547: ERROR/dalvikvm(236): Could not find class 'com.example.brown.Brown_FaceBook$FBSessionDelegateImpl', referenced from method com.example.brown.Brown_FaceBook.onCreate02-20 22:02:29.558: WARN/dalvikvm(236): VFY: unable to resolve new-instance 95 (Lcom/example/brown/Brown_FaceBook$FBSessionDelegateImpl;) in Lcom/example/brown/Brown_FaceBook;02-20 22:02:29.558: DEBUG/dalvikvm(236): VFY: replacing opcode 0x22 at 0x007e02-20 22:02:29.570: DEBUG/AndroidRuntime(236): Shutting down VM02-20 22:02:29.577: WARN/dalvikvm(236): threadid=3: thread exiting with uncaught exception (group=0x4001b188)02-20 22:02:29.587: ERROR/AndroidRuntime(236): Uncaught handler: thread main exiting due to uncaught exception02-20 22:02:29.597: ERROR/AndroidRuntime(236): java.lang.NoClassDefFoundError: com.example.brown.Brown_FaceBook$FBSessionDelegateImpl02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at com.example.brown.Brown_FaceBook.onCreate(Brown_FaceBook.java:80)02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at android.os.Handler.dispatchMessage(Handler.java:99)02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at android.os.Looper.loop(Looper.java:123)02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at  android.app.ActivityThread.main(ActivityThread.java:4363)02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at java.lang.reflect.Method.invokeNative(Native Method)02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at java.lang.reflect.Method.invoke(Method.java:521)02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-20 22:02:29.597: ERROR/AndroidRuntime(236):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>thanks.</p>","267269","","","","","2013-10-15 19:23:51","could not find class exception facebook on android app.how?","<android><facebook><fbconnect>","3","0","0","",""
"2302867","1","2302929","","2010-02-20 16:44:18","5","1886","<p>I have a <code>TextView</code> with an <code>OnTouchListener</code>. What I want is the character index the user is pointing to when I get the <code>MotionEvent</code>. Is there any way to get to the underlying font metrics of the <code>TextView</code>?</p>","6583","","","","","2011-04-28 10:13:09","Android: How to determine character index of a touch event's position in TextView?","<android><textview><fontmetrics><ontouchlistener>","2","0","4","",""
"2302880","1","2303117","","2010-02-20 16:48:45","6","7137","<p>I'm looking for a widget that behaves similar to the gallery widget but scrolls vertically instead of horizontally. I googled all around and apparently the answer is no such pre-made widget exists.</p><p>So I said myself, oh well, I'll look at the gallery class in the android source and modify that to scroll vertically instead. Not so easy. The android SDK hides a lots away (understandably for framework maintenance), but it also makes it very hard to extend the widgets. The gallery class, for example, use a lots of member variable from its parent, AbsSpinner (mSelectedPosition, etc.etc.), and its parent's parent, etc... which are not at all accessible from the app-developer's standpoint. Without access to those member variable, I cannot use similar code from gallery class for my own use.</p><p>Short of moving up the inheritance chain and put the source code of those parent classes all in my project, or writing the widget all from scratch without using the existing framework widgets that already solved the problem, I can't find a way to get a vertical scrolling gallery. </p><p>Is there a better way around? Why does the android framework make extending widget so difficult?</p>","45383","","","","","2011-03-28 20:36:14","Android: a vertical gallery?","<android><android-widget>","1","1","1","",""
"2303170","1","","","2010-02-20 18:27:01","2","589","<p>i tried to figure out whats my problem, the last 3 hours! but without luck. Maybe someone else can help me.</p><p>My app does the following:</p><p>Activity1 starts Activity2Acitivity2 starts a ServiceThe Service uses a AsyncTask to download a file</p><p>in the AsyncTask i have a piece of code like this:</p><pre><code>while ((status == 0)) {            byte buffer[];            if (size - downloaded &gt; MAX_BUFFER_SIZE) {                buffer = new byte[MAX_BUFFER_SIZE];            } else {                buffer = new byte[size - downloaded];            }            int read = stream.read(buffer);            if (read == -1)                break;            file.write(buffer, 0, read);            downloaded += read;  }</code></pre><p>Everything works like expected. With the <code>status</code> variable i can start and stop my download depending on its value.</p><p>BUT, when i close Activity2 and start it again (the service keeps running), i cannot stop the download, what means the variable <code>status</code> is not read correctly. I checked the variable, the value is ok but the Asynctask does not recognize it.</p><p>So my question is, how can i get back control over my AsyncTask?</p><p><strong>EDIT1:</strong></p><p>I made some more tests but this time with a thread, to make sure its not a failure how i handle the AsyncTask. I did it this way:</p><p>Activity2 starts the Service (i did not changed any coder here)The Service creates an <code>Download</code> Object what downloads the file using a Thread.</p><p>The Structure looks like this:</p><pre><code>in the Serviceprivate Download dl = new Download();private final DMInterface.Stub mBinder = new DMInterface.Stub() {    public void downloadFile() throws DeadObjectException {        try {            dl.start(url) // This starts a thread and the download        } catch (IndexOutOfBoundsException e) {            Log.e(getString(R.string.app_name), e.getMessage());        }    }    public void stop() throws DeadObjectException {        dl.cancel(); //This stops the download    }};</code></pre><p>And again, everything works until i disconnect from the service. So whats the problem? I'm not far away from getting insane. :) Why am i only able to control the Thread when i don't disconnect from the service?</p><p><strong>EDIT2:</strong></p><p>Here is the code how i start/bind the service to Activity2:(only they important parts)</p><pre><code>public class Activity2 extends ListActivity {  private DMInterface dmInterface;  public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        this.bindService(new Intent(Activity2.this, DMService.class), mConnection, Context.BIND_AUTO_CREATE);  }    private ServiceConnection mConnection = new ServiceConnection() {        public void onServiceConnected(ComponentName className, IBinder service) {            dmInterface = DMInterface.Stub.asInterface(service);            //do some stuff        }        public void onServiceDisconnected(ComponentName className) {            dmInterface = null;        }    };}</code></pre><p>There ar two scenarios. In the first on i get an error in the second one not (but nothing else happens).When an error is raised depends on, where i initialize the Thread e.g. the Object that starts the Thread.</p><p><em>Scenario 1:</em></p><p>When i do it like described in EDIT1 i get no error but nothing happens.</p><p><em>Scenario 2:</em></p><p>In the Service:</p><pre><code>private Download dl;private final DMInterface.Stub mBinder = new DMInterface.Stub() {    public void downloadFile() throws DeadObjectException {        try {            dl = new Download();            dl.start(url) // This starts a thread and the download        } catch (IndexOutOfBoundsException e) {            Log.e(getString(R.string.app_name), e.getMessage());        }    }    public void stop() throws DeadObjectException {        dl.cancel(); //This stops the download    }};</code></pre><p>I get this error: <a href=""http://omploader.org/vM241cg/pasta"" rel=""nofollow"">http://omploader.org/vM241cg/pasta</a></p><p>When i try to reach other parts of the service (setting a variable or something like that) everything works ok.</p><p>Thank you</p>","268575","","53653","","2011-02-02 08:15:47","2011-02-02 08:24:31","AsyncTask not accessible in Service","<android>","1","5","","",""
"2304086","1","2304794","","2010-02-20 22:58:00","13","8803","<p>i want to know what es the best place in an Activity to bind to a service?I saw examples doing it in <code>onResume()</code> and also in <code>onCreate()</code>. I was asking myself if it is not a problem putting it into <code>onCreate()</code>, cause in <code>onPause()</code> i will do a unbind to the service, so i dont get a serviceConnectionLeak, if i leave the activity. Now if i press the Home-Button and then switching to the HomeScreen, the Activity will unbind from the service, when i go back to the Activity from the Taskmanager, then <code>onCreate()</code> will not be called and if the Code is trying to access a function from the service i will get a null-pointer exception. If i bind and unbind only in <code>onResume()</code> and <code>onPause()</code> i dont have this problem. Am i right?</p>","275595","","275595","","2010-02-21 01:02:25","2010-02-21 04:44:03","Binding to Service in onCreate() or in onResume()","<android>","3","1","7","",""
"2304716","1","2304739","","2010-02-21 04:02:53","1","2090","<p>I'm working on an activity which other 3rd parties want to use in their own apps, via intents.</p><p>Right now this activity is catching urls via an intent filter, like this:</p><pre><code>&lt;activity android:name="".MyActivity""&gt;  &lt;intent-filter&gt;     &lt;action android:name=""android.intent.action.VIEW""&gt;&lt;/action&gt;    &lt;category android:name=""android.intent.category.DEFAULT""&gt;&lt;/category&gt;    &lt;category android:name=""android.intent.category.BROWSABLE""&gt;&lt;/category&gt;    &lt;data android:host=""www.mysite.com"" android:pathPrefix=""/test/"" android:scheme=""http""&gt;&lt;/data&gt;  &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>The above works, whenever a user clicks a link in my app like:</p><p>""mysite.com/test/blah.html""</p><p>my app comes up as a choice, along with the browser, to open the link.</p><p>Now if a third party wants to use my app, I think they can use the above like this:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(""http://mysite.com/test/somedata""));startActivity(intent); </code></pre><p>While this would work, this probably won't give them the desired effect of jumping directly to my activity from theirs - the android chooser dialog will appear, asking if they want to open the intent data with the browser, or my app.</p><p>How can I let 3rd parties call my activity directly without broadcasting the intent like this? I'd like to make them still pass the same exact data scheme to me, but just let them open my activity directly.</p><p>Thank you</p>","246114","","","","","2011-09-13 09:31:53","Letting a third party app start my activity directly?","<android>","2","0","0","",""
"2304735","1","2368298","","2010-02-21 04:13:32","7","5447","<p>I'm using intents to launch Google Navigation:</p><pre><code>Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(""google.navigation:q="" + location)); startActivity(i);</code></pre><p><code>location</code> is a string with GPS coordinates.</p><p>Google Navigation pops up nicely and plots the route. Can they return some type of callback when the user has reached their destination? Any way of implementing <code>startActivityForResult()</code>?</p><p>If not, what would be my best bet? I've been considering running a service in the background that keeps tabs on the location and ending Google Navigation and returning to my app when the GPS registers that it's near the destination (because I know the latitude/longitude).</p><p>Thanks folks</p>","205229","","","","","2010-11-13 14:28:01","Google Navigation (Android 1.6) intent callback","<android><gps>","1","2","5","",""
"2305035","1","","","2010-02-21 06:15:37","1","1497","<p><strong>Amendment:</strong> This appears to be a problem with the particular audio file I was using.  Other applications on the droid such as the Astro file manager also fail to play it, and if I replace it in the package with an AAC file, it plays it without error.  I encoded the problematic audio file to MP3 format from a WAV file, using LAME on ubuntu.  It would be good to know the limitations of the android media player.  mplayer seems to have no problem playing the file on ubuntu.  I suppose I should submit a bug report.</p><p><strong>Original question:</strong> The following code crashes when I try to play it on my droid.  The error message given in the log is ""<code>Command PLAYER_INIT completed with an error or info PVMFErrNoResources.</code>"" Then an IOException is raised on the <code>mp.prepare()</code> line. There is a file <code>res/raw/bell.mp3</code> in my project directory, which I assume corresponds to <code>R.raw.bell</code> in the code below.  I am building with ""<code>ant debug</code>"".  In case it's relevant, when I created the project directory with ""<code>android create</code>"", I set the target number to 4, corresponding in my system to ""android 2.0.""</p><p>What am I doing wrong, here?</p><pre><code>    import java.io.IOException;    import android.app.Activity;    import android.os.Bundle;    import android.media.MediaPlayer;     import android.util.Log;    public class testapp extends Activity     {        /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState)         {            super.onCreate(savedInstanceState);     try {         MediaPlayer mp = MediaPlayer.create(this, R.raw.bell);         mp.prepare();         mp.start();     } catch (IOException e) {         Log.v(getString(R.string.app_name), e.getMessage());     }        }}</code></pre>","1941213","","1941213","","2010-02-21 17:13:48","2010-02-21 17:13:48","Problem playing audio on android","<java><android><audio>","1","2","1","",""
"2305395","1","","","2010-02-21 09:04:26","131","105689","<p>I'm trying to achive the following programmatically (rather than declaratively via XML):</p><pre><code>&lt;RelativeLayout...&gt;   &lt;TextView ...      android:id=""@+id/label1"" /&gt;   &lt;TextView ...      android:id=""@+id/label2""      android:layout_below: ""@id/label1"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>In other words, how do I make the second TextView appear below the first one, but I want to do it in code:</p><pre><code>RelativeLayout layout = new RelativeLayout(this);TextView label1 = new TextView(this);TextView label2 = new TextView(this);...layout.addView(label1);layout.addView(label2);setContentView(layout);</code></pre><h3>Update:</h3><p>Thanks, TreeUK. I understand the general direction, but it still doesn't work - ""B"" overlaps ""A"". What am I doing wrong?</p><pre><code>RelativeLayout layout = new RelativeLayout(this);TextView tv1 = new TextView(this);tv1.setText(""A"");TextView tv2 = new TextView(this);tv2.setText(""B"");RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(        RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.FILL_PARENT);lp.addRule(RelativeLayout.RIGHT_OF, tv1.getId());layout.addView(tv1);        layout.addView(tv2, lp);</code></pre>","278028","","1288","","2011-02-06 16:51:18","2014-03-15 12:47:39","Laying out Views in RelativeLayout programmatically","<android><layout><view><relativelayout>","6","2","36","",""
"2305449","1","","","2010-02-21 09:28:48","2","435","<p>I would like to know if it is possible to launch my application whenever a new entry is written to phone call log (i.e. out-going, in-coming or missed call).</p><p>I wrote an application to manage the call log entries as per user preferences by listening to the publication of <strong>android.intent.action.PHONE_STATE</strong> events. My application is working fine as long as its process is running. However if the user has stopped my application with a task-killer application, then the log entries can not be managed as my app itself was not running. I need a way to make sure that my application is launched in the background if it is not already running when the <strong>android.intent.action.PHONE_STATE</strong> occurs.</p><p>Or is it possible to launch my application as a service that always runs?</p><p>Thanks in advance.Bala</p>","278034","","21234","","2010-02-21 09:30:19","2010-02-21 13:21:18","Can my android application be launched from built-in Phone Call Log application?","<android>","2","0","","",""
"2305463","1","2305499","","2010-02-21 09:34:42","2","245","<p>Is someArray[index] a faster way to get to a value than someObject.field?</p><p>E.G.:</p><p>if(intArray[i] == 42) {//do stuff}</p><p>VS</p><p>if(someObject.x == 42) {//do stuff}</p><p>I will try to test it soon and post the results; just wondering if you all had any thoughts. </p>","261259","","","","","2010-02-21 09:52:06","Array index lookup versus Instance field lookup","<android><performance>","1","0","","",""
"2306055","1","","","2010-02-21 13:47:17","0","1637","<p>My code tries to play an MP3 file from res/raw.</p><p>Code:</p><pre><code>FileDescriptor fd = appContext.getResources().openRawResourceFd(R.raw.ringtone)                    .getFileDescriptor();player = new MediaPlayer();            try            {                player.setAudioStreamType(AudioManager.STREAM_RING);                player.setDataSource(fd);                player.prepare();                       }            catch (IllegalArgumentException e)            {                // TODO Auto-generated catch block                e.printStackTrace();                player = null;                return;            }            catch (IllegalStateException e)            {                // TODO Auto-generated catch block                e.printStackTrace();                player = null;                return;            }            catch (IOException e)            {                // TODO Auto-generated catch block                e.printStackTrace();                player = null;                return;            }            player.setLooping(true);            player.start();</code></pre><p>The log shows:</p><p>02-21 15:18:18.360: ERROR/PlayerDriver(51): Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported02-21 15:18:18.380: ERROR/MediaPlayer(693): error (1, -4)02-21 15:18:18.390: WARN/PlayerDriver(51): PVMFInfoErrorHandlingComplete</p><p>After player.prepare() is called.</p><p>I really don't have a hint.I won't use MediaPlayer.create() because I need player.setAudioStreamType(AudioManager.STREAM_RING );</p><p>Would appreciate any help on this...</p>","278111","","","","","2011-12-04 08:13:54","Unexplained error from MediaPlayer","<android>","2","2","1","",""
"2306072","1","","","2010-02-21 13:53:32","1","543","<p>I'm getting very low framerate with OpenGL ES. If the model is far from the camera I get like 35 fps, but if it fills entire screen (say, a skybox) I'm getting 6-8 fps. It even happens when rendering a skybox alone and nothing else. </p><p>Is that actually an issue with the emulator? I'm using Windows XP SP3 on a AMD Athlon 64 Dual Core 3800 2Ghz, with 1 Gb RAM.</p>","278112","","278112","","2010-02-21 14:07:27","2010-02-21 14:46:17","Fillrate Issues on Android Emulator","<android><opengl-es><android-emulator>","1","1","","",""
"2306322","1","","","2010-02-21 15:22:13","7","16966","<p>Running Vista, tried starting adb from shell as admin get daemon not running starting it<br> now ADB server didn't ACk failed to start daemon. </p><p>Any help for this? </p>","278147","","68805","","2011-11-11 09:08:03","2014-03-03 01:48:12","Adb won't start","<android>","11","1","2","",""
"2306503","1","","","2010-02-21 16:27:05","71","68693","<p>I can create and display a custom alert dialog just fine but even so I have <code>android:layout_width/height=""fill_parent""</code> in the dialog xml it is only as big as the contents.</p><p>What I want is dialog that fills the entire screen except maybe a padding of 20 pixel.Then the image that is part of the dialog would automatically stretch to the full dialog size with fill_parent.</p><p>Thanks a lot, Fabian</p>","272425","","580677","","2012-02-25 18:05:40","2014-01-24 09:51:09","How to make an alert dialog fill 90% of screen size?","<android><dialog>","10","2","35","",""
"2306732","1","4319624","","2010-02-21 17:39:05","3","2129","<p>I'm using <strong>ActivityInstrumentationTestCase2</strong> to do automated black-box testing on my GUI. Is there a way to click on a dialog, or get Views belonging to the Dialog in unit tests?</p><p>The only way I could come up with is to keep a reference to the dialog and have my Activity implement a getter method to let testcases access the dialog. Is there a better way that doesn't require changing my production code?</p>","16622","","","","","2012-04-18 07:08:56","Accessing AlertDialog in AndroidTestCase","<android><unit-testing><testing><automated-tests><instrumentation>","1","0","2","",""
"2306793","1","2307427","","2010-02-21 17:58:47","17","15949","<p>Do you know any tile based game framework for android like <a href=""http://hge.relishgames.com/"">HGE</a> for PC or at least some good examples of tile based engine for Android</p>","31207","","","","","2011-08-27 13:08:42","Is there any Android game framework ready to use","<android><frameworks>","3","0","7","2012-02-14 14:41:15",""
"2306955","1","","","2010-02-21 18:43:16","2","1170","<p>Looking to create a menu toggle that switches between two possible arrays for a spinner. For example, if the spinner is set to show array A, then when I press this menu button, I want the spinner to be set to array B. If I press it again, I want it to be set back to array A.</p><p>I can handle the if/then statements and all, but how do I call the spinner's array adapter? I know how to call its value using getSelectedItemPosition(); but is there a similar method for retrieving WHICH array it is currently set to?</p>","278220","","932225","","2012-07-13 10:33:43","2012-07-13 10:33:43","How do you retrieve the array adapter currently set for a spinner? Android OS, Droid","<android><arrays><spinner><android-adapterview>","2","0","","",""
"2306983","1","2307092","","2010-02-21 18:49:53","0","434","<p>Hi ive got a custom listview and im trying to start a new activity on a button click however an occur occurs when i try to set an intent , i guess this is because my custom array class does not extend activity. The buttons trigger an alarm to be set. Is there any way i can get an intent to work in this class?</p><p>Below is my code for the class.</p><pre><code>public class customArray extends ArrayAdapter&lt;String&gt; {SatMain sm = new SatMain();int resource;public customArray(Context cont, int _resource, List&lt;String&gt; items) {    super(cont, _resource, items);    resource = _resource;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    RelativeLayout rl;    String prod = getItem(position);    if (convertView == null) {        rl = new RelativeLayout(getContext());        LayoutInflater vi = (LayoutInflater) getContext().getSystemService(                Context.LAYOUT_INFLATER_SERVICE);        vi.inflate(resource, rl, true);    } else {        rl = (RelativeLayout) convertView;    }    TextView t1 = (TextView) rl.findViewById(R.id.text12);    t1.setText(prod);    final Button b1 = (Button) rl.findViewById(R.id.widget29);    b1.setText(""efwrf"");    if (position == 2) {        b1.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                 Intent intent = new Intent(customArray.class, SatMain.class);                    startActivity(intent);                b1.setText(""alarm set"");            }        });    }    if (position == 0) {        b1.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {            }        });        b1.setText(""number 0"");    }    return rl;}</code></pre><p>}</p>","264905","","","","","2010-02-21 19:15:22","Android Custom Listview","<android>","1","2","","",""
"2307034","1","","","2010-02-21 19:00:52","2","818","<p>I'm having problem with creating AlertDialog. </p><p>I would like that AlertDialog appears when i click on one button, so i put all code for creating dialog in that button listener...the same code works outside that listener but inside listener doesn't work...it doesn't call any errors but when i start emulator written is something about this: ""Aplication has terminated unexpectedly""....</p><p>This is my code for that:</p><pre><code>btsenddata.setOnClickListener(new Button.OnClickListener() {       public void onClick (View v){         AlertDialog.Builder alt_bld = new AlertDialog.Builder(getApplicationContext() ); // I've tried with ""activity1.this"" instead ""getApplicationContext()"" but it is the same result        alt_bld.setMessage(""Do you want to close this window ?"")        .setCancelable(false)        .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int id) {        // Action for 'Yes' Button        }        })        .setNegativeButton(""No"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int id) {        // &amp;nbsp;Action for 'NO' Button        dialog.cancel();        }        });        AlertDialog alert = alt_bld.create();        // Title for AlertDialog        alert.setTitle(""Title"");        // Icon for AlertDialog        alert.setIcon(R.drawable.icon);        alert.show();      }});}</code></pre><p>.... i've heard that method getApplicationContext() is creating some problems but i've tried replace it with activity.this and it doesn't work anyway...If anyone knows the reason for this or more about alertdialogs pleade answer.Thanks.</p>","278231","","13070","","2010-02-21 22:52:37","2011-05-04 07:40:45","Problem with AlertDialog","<android>","3","0","","",""
"2307374","1","","","2010-02-21 20:30:16","3","1582","<p>I have the following problem:</p><p>suppose that until now, I am using  R.drawable.img to set the image in some imageviewswith</p><pre><code>imgView.setImage(aProduct.getImgId());</code></pre><hr><p>the simplified product class look like this:</p><pre><code>class Product{        int imgId;        ....        public void setImgId(int id){        this.imgId=id;        }        public int getImgId(){        return this.imgId        }        ...    }</code></pre><p>my application is now ""evolved"" because the user can add customized productstaking the img from the camera and getting the Uri of the picture.and to set the image on the ImageView imgView.setImgURI(Uri)</p><p>Now my question is:what would be the best approach to have a mixed int/Uri image resources ambient?can I obtain the Uri of a ""R.drawable.img""?</p><p>I'm not sure if my question is clear, I mean:</p><p>I have to check, before to set the imageview, if my product has an Uri or an int Id,and then make an ""if"" to call the appropriate method, or there is a simpler solution?</p><p>Thank you for reading, and sorry for my english.</p><p>Regards.</p>","246435","","","","","2010-10-05 21:37:41","Need suggestion about a mixed ""Uri / int id"" images ambient","<android>","1","3","1","",""
"2307389","1","","","2010-02-21 20:35:02","4","17831","<p>I've tried the <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">Tab Layout example</a>, and I've also fixed the few typos in the example (and added all the activities to the manifest).  However, when I run it on the emulator I get a NullPointerException on the first line that says</p><blockquote>  <p>tabHost.addTab(spec);</p></blockquote><p>So my question, of course, is.  What is wrong with the example that would cause this exception? I'm using Eclipse Galileo and set the target package as Android 1.5.  So far I've had no other problems with the other examples on the android dev site.</p><pre><code>package com.example.hellotabwidget;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;public class HelloTabWidget extends TabActivity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) throws RuntimeException {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Resources res = getResources(); // Resource object to get Drawables    TabHost tabHost = getTabHost();  // The activity TabHost    TabHost.TabSpec spec;  // Reusable TabSpec for each tab    Intent intent;  // Reusable Intent for each tab    // Create an Intent to launch an Activity for the tab (to be reused)    //final Context context = getApplicationContext();    intent = new Intent().setClass(this, ArtistsActivity.class);    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""artists"").setIndicator(""Artists"",            res.getDrawable(R.drawable.ic_tab_artists))            .setContent(intent);    tabHost.addTab(spec); //******** NullPointerException after running this line    // Do the same for the other tabs    intent = new Intent().setClass(this, AlbumsActivity.class);    spec = tabHost.newTabSpec(""albums"").setIndicator(""Albums"",            res.getDrawable(R.drawable.ic_tab_artists))            .setContent(intent);    tabHost.addTab(spec);    intent = new Intent().setClass(this, SongsActivity.class);    spec = tabHost.newTabSpec(""songs"").setIndicator(""Songs"",            res.getDrawable(R.drawable.ic_tab_artists))            .setContent(intent);    tabHost.addTab(spec);    tabHost.setCurrentTabByTag(""artists"");}}</code></pre><p>main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@android:id/tabhost""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""5dp""&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:padding=""5dp"" /&gt;&lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre>","278280","","278280","","2010-02-22 02:25:32","2012-09-13 22:33:30","Problem running android HelloTabWidget example - NullPointerException on addTab()","<android><android-tabhost>","12","4","1","",""
"2307476","1","","","2010-02-21 21:14:55","6","3058","<p>I use a custom Parcelable to carry some data to a BroadcastReceiver. Here is what i do:</p><p>I register my intent and set the extra Parcelable on it along with an extra classloader (intent.setExtraClassLoader(..)). Next i schedule the execution of the broadcast via an AlarmManager.</p><p>So when the AlarmManager fires it looks at my intent with its parcel which it can not process since it doesn't use the supplied classloader (as it seams).</p><p>I think the classloader gets lost when Inten.fillIn copys the intent to a new one (see stack trace). </p><pre><code>02-21 21:09:25.214: WARN/Intent(52): android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.company.project.MyParcelable02-21 21:09:25.214: WARN/Intent(52):     at android.os.Parcel.readParcelable(Parcel.java:1822)02-21 21:09:25.214: WARN/Intent(52):     at android.os.Parcel.readValue(Parcel.java:1713)02-21 21:09:25.214: WARN/Intent(52):     at android.os.Parcel.readMapInternal(Parcel.java:1947)02-21 21:09:25.214: WARN/Intent(52):     at android.os.Bundle.unparcel(Bundle.java:169)02-21 21:09:25.214: WARN/Intent(52):     at android.os.Bundle.putAll(Bundle.java:242)02-21 21:09:25.214: WARN/Intent(52):     at android.content.Intent.fillIn(Intent.java:4530)02-21 21:09:25.214: WARN/Intent(52):     at com.android.server.am.PendingIntentRecord.send(PendingIntentRecord.java:185)02-21 21:09:25.214: WARN/Intent(52):     at android.app.PendingIntent.send(PendingIntent.java:400)02-21 21:09:25.214: WARN/Intent(52):     at com.android.server.AlarmManagerService$AlarmThread.run(AlarmManagerService.java:636)</code></pre><p>So is there any way around that problem? Any help would be appreciated.</p><p>Thanks</p>","271877","","286204","","2011-11-13 16:04:21","2014-01-15 15:44:08","ClassNotFoundException when using custom Parcelable","<android>","2","0","3","",""
"2307569","1","2307614","","2010-02-21 21:41:14","7","5460","<p>I'm trying to create a drawable in xml, a rectangle with one gradient on the top half, and another on the bottom half.  This is NOT the way to do it, apparently:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;layer-list xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item&gt;        &lt;shape android:shape=""rectangle""&gt;                &lt;gradient                        android:startColor=""#5a5a5a88""                        android:endColor=""#14141488""                        android:angle=""270"" android:centerX=""0.25""/&gt;        &lt;/shape&gt;    &lt;/item&gt;    &lt;item&gt;        &lt;shape android:shape=""rectangle"" android:top=""80px""&gt;                &lt;gradient                        android:startColor=""#5aff5a88""                        android:endColor=""#14ff1488""                        android:angle=""270"" android:centerX=""0.25""/&gt;        &lt;/shape&gt;    &lt;/item&gt;&lt;/layer-list&gt;</code></pre><p>How can I do this, preferably in a way that makes it stretchable to any height?</p>","238849","","","","","2012-07-13 10:02:04","Creating a drawable rectangle in xml with one gradient on the top half and another on the bottom half","<android>","2","0","1","",""
"2307655","1","2307979","","2010-02-21 22:12:38","5","10603","<p>I'm trying to get listview row to look like the following:</p><pre><code>| Text-Text-Text                        &lt;ImageButton&gt; |</code></pre><p>With the imagebutton snapped to the right edge. How can I do this? Here's the current layout code I'm using. What am I doing wrong?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/layercontainer""  android:orientation=""horizontal""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:background=""#699""&gt; &lt;LinearLayout   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:layout_weight=""1""   android:layout_gravity=""left""&gt;   &lt;TextView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""YO HOW SI IT GOESSDA"" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:layout_weight=""1""   android:layout_gravity=""right""&gt;   &lt;ImageButton    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:src=""@drawable/trash"" /&gt; &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>My code currently produces this:<img src=""http://img685.imageshack.us/img685/7673/ss20100221171306.png"" alt=""grrr""></p><p>Thanks.</p>","118241","","469983","","2011-03-23 11:48:35","2011-03-23 11:48:35","Align Layout to the right in a ListView row?","<android><android-layout><android-xml>","1","0","1","",""
"2307688","1","","","2010-02-21 22:21:59","31","10336","<p>I'm watching content updates on a ListActivity using a ContentObserver as follows:</p><pre><code>protected void onCreate(Bundle savedState)   {        super.onCreate(savedState);        ContentResolver cr = getContentResolver();        Cursor cursor = cr.query(TrackHeader.CONTENT_URI, sTrackListProjection, null, null, null);        startManagingCursor(cursor);        this.mAdapter = new TrackHeaderDataAdapter(this, R.layout.track_list_item, cursor, sTrackListProjection, null);        setListAdapter(mAdapter);        Handler handler = new Handler();        mTrackHeaderObserver = new ContentObserver(handler) {             @Override              public boolean deliverSelfNotifications() {                  return false;             }             @Override             public void onChange(boolean selfChange) {                 super.onChange(selfChange);                 ContentResolver cr = getContentResolver();                 mAdapter.changeCursor(cr.query(TrackHeader.CONTENT_URI, sTrackListProjection, null, null, null));              }         };      getContentResolver().registerContentObserver (TrackHeader.CONTENT_URI, true, mTrackHeaderObserver);  }</code></pre><p>This content observer seems to be ok -- it gets called back on the UI thread but I am getting the following random crash pretty predictably on the underlying ListView:</p><pre><code>02-21 14:06:00.440: ERROR/AndroidRuntime(739): java.lang.NullPointerException02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at  android.widget.AbsListView.obtainView(AbsListView.java:1276)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.ListView.makeAndAddView(ListView.java:1668)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.ListView.fillDown(ListView.java:637)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.ListView.fillSpecific(ListView.java:1224)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.ListView.layoutChildren(ListView.java:1499)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.AbsListView.onLayout(AbsListView.java:1113)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.view.View.layout(View.java:6830)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.view.View.layout(View.java:6830)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.view.View.layout(View.java:6830)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.view.View.layout(View.java:6830)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.view.View.layout(View.java:6830)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.view.View.layout(View.java:6830)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.view.View.layout(View.java:6830)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.view.View.layout(View.java:6830)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.view.ViewRoot.performTraversals(ViewRoot.java:996)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.os.Handler.dispatchMessage(Handler.java:99)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.os.Looper.loop(Looper.java:123)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at java.lang.reflect.Method.invokeNative(Native Method)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at java.lang.reflect.Method.invoke(Method.java:521)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-21 14:06:00.440: ERROR/AndroidRuntime(739):     at dalvik.system.NativeStart.main(Native Method)02-21 14:09:56.159: ERROR/AndroidRuntime(749): ERROR: thread attach failed02-21 14:09:59.480: ERROR/AndroidRuntime(760): ERROR: thread attach failed02-21 14:12:19.449: ERROR/AndroidRuntime(778): ERROR: thread attach failed02-21 14:12:22.779: ERROR/AndroidRuntime(789): ERROR: thread attach failed02-21 14:12:26.479: ERROR/gralloc(51): [unregister] handle 0x3f13b8 still locked (state=40000001)</code></pre><p>Anyone seen anything like this before -- been stumped on this one for a few days...</p><p>Tim</p>","278318","","367677","","2011-05-28 20:32:32","2014-03-26 12:05:51","Crash in ListView at AbsListView.obtainView for ListActivity","<android><listview>","4","3","5","",""
"2307944","1","2308176","","2010-02-21 23:39:08","0","479","<p>Need some advice from you experts out there.  I've just started with Androidprogramming and while I finally got what I want my ""Hello World"" to do, I feelas if I'm bludgening my way through rather than grasping concepts.</p><p>I created three EditText boxes.  Below those I created three Spinners.  Pick anumber in the Spinner and it will show up in the corresponding EditText box. Spinner 1 correlates to EditText 1, Spinner 2 to EditText 2 and Spinner 3 toEditText 3.  I had a hell of a time getting this to work.  I do have somecleaning up to do.</p><p>In my startup class I:</p><pre><code>    EditText [] pick_nums = new EditText[3];    pick_nums[0] = (EditText) findViewById(R.id.r1c1);    pick_nums[1] = (EditText) findViewById(R.id.r1c2);    pick_nums[2] = (EditText) findViewById(R.id.r1c3);    Spinner test1 = (Spinner) findViewById(R.id.spin_pick_num1);    Spinner test2 = (Spinner) findViewById(R.id.spin_pick_num2);    Spinner test3 = (Spinner) findViewById(R.id.spin_pick_num3);</code></pre><p>//I created a class to initialize the spinners.</p><pre><code>Context g = getApplicationContext();    Initialize_stuff spin1 = new Initialize_stuff(test1, g);    Initialize_stuff spin2 = new Initialize_stuff(test2, g);    Initialize_stuff spin3 = new Initialize_stuff(test3, g);</code></pre><p>//I created a class to put the number in the corresponding EditText box.I wanted to avoid having the user press a button to do the populatingand once three numbers are in I'll do something with them without having topress a button. </p><pre><code>Handle_Picks hp = new Handle_Picks(g, pick_nums);</code></pre><p>//Here's where I think it get kludgy and awkward.  To make Handle_Picks workcorrectly I created a method to set the context, an array of EditTexts, andthe reference to the class Handle_Picks hp.</p><pre><code>Spinner_Listener listen = new Spinner_Listener();    listen.set_context(g, pick_nums, hp);test1.setOnItemSelectedListener(listen);test2.setOnItemSelectedListener(listen);test3.setOnItemSelectedListener(listen);</code></pre><p>//In the Spinner_Listener class</p><pre><code>public class Spinner_Listener implements OnItemSelectedListenerstatic Handle_Picks hp1;  //set in a methodprivate String num;String v;String spin_id;int vv;public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos,        long id){    //To make this work I had to find the name of the spinner that was    //used so I could correlate it with the right EditText     vv = parent.getId();     v = parent.getResources().getResourceName(vv);     spin_id = parent.getResources().getResourceEntryName(vv);     setNum(parent.getItemAtPosition(pos).toString());}public void setNum(String s){    num = s;    hp1.handle_nums(spin_id, num);}</code></pre><p>//finally in class Handle_Picks I:</p><pre><code>public class Handle_Picks extends Activity{  static Context theContext;  EditText [] et;  String spin_num;// constructor  Handle_Picks(Context f, EditText[] array){    theContext = f;    et = array;}public void handle_nums(String id, String aNumber){    spin_num = id;    if (spin_num.equalsIgnoreCase(""spin_pick_num1""))        et[0].setText(aNumber);    else if (spin_num.equalsIgnoreCase(""spin_pick_num2""))        et[1].setText(aNumber);    else if (spin_num.equalsIgnoreCase(""spin_pick_num3""))        et[2].setText(aNumber);}</code></pre><p>Is there a better way to pass or reference resources around various classes? Having to pass the Context and and array of EditText to class Handle_Picksbefore I could use Handle_Picks from class Spinner_Listener doesn't seem right. Seems kind of dangerous. </p><p>What's the better way?</p>","278350","","","","","2012-01-06 23:50:00","What's the better way to pass resources?","<android><android-widget>","1","0","","",""
"2308610","1","","","2010-02-22 03:22:31","1","137","<p>I'm trying to find a website or a list of websites that I can reference when trying to integrate some of the built-in Android resources into my applications and I'm wondering what everyone else uses.</p><p>For instance, I want to find a site that lists all the different animations in ""android.R.aim"" and shows what each animation does to a view/layout/etc (by visual examples... e.g. before and after images for each animation). Or maybe another site that shows what each style in ""android.R.style"" looks like when applied to a layout with different types of views.</p><p>So far I have only been able to find a visual reference for the items in ""android.R.drawable"": <a href=""http://darshancomputing.com/android/1.5-drawables.html"" rel=""nofollow"">http://darshancomputing.com/android/1.5-drawables.html</a> </p><p>Thanks</p>","272302","","","","","2010-02-22 08:27:36","Visual Resource(s) for android.R.*?","<java><android>","1","0","","",""
"2308628","1","","","2010-02-22 03:30:18","0","3383","<p>I have a basic app with text inputs, a spinner input, and a second spinner input whose array depends on a setting changed in the Options menu.</p><p>Currently, when I press Home or press Return while in my app, I either return to the desktop or cycle back through old inputs i put in recently.</p><p>How can I prevent my app from opening multiple instances of itself so that there is only one instance running at any given time, and then how can I save the data entered into inputs, and the settings chosen in my option menu?</p><p>I'm a bit new to Java, so I apologize if this is a simple problem.</p>","278220","","","","","2010-02-22 07:06:01","How do you save your Activity's state when exiting? Android","<java><android><save><multiple-instances>","1","0","","",""
"2308720","1","","","2010-02-22 04:03:46","1","563","<p>I have two names which suppose to get two different string value. Why S0 and S1 all get ""ABC""? </p><p>DF=""""</p><p>DWF=""ABC""</p><p>Alarm.putExtra(com.Md.AlarmReminder.D0, DF);Alarm.putExtra(com.Md.AlarmReminder.D1, DWF);</p><p>In another activity:Bundle extras = getIntent().getExtras();</p><p>s0 =extras.getString(com.Md.AlarmReminder.D0);s1 =extras.getString(com.Md.AlarmReminder.D1);</p>","276620","","","","","2010-02-22 06:37:39","My intent putExtra into two different names with different value. But I get same value in another activity?","<android>","1","0","","",""
"2308850","1","4828938","","2010-02-22 04:44:31","4","4223","<p>I'm creating an Android app that involves multiple short sound clips. At the moment, I'm using <code>SoundPool</code> to load my sound clips once a 2nd activity is begun by the menu activity. The problem I seem to be having is that once this secondary activity begins, the loading of the sound clips causes multiple heap size overflows and then after a bit the activity actually loads (the emulator never gives an error or a force quit). Would using the <code>MediaPlayer</code> help me here and keep these heap size overflows from occuring? </p><p>Also, at the moment, the menu activity starts the 2nd activity waiting for a result (using the <code>startActivityForResult()</code> function). Does this mean that the menu activity is being held in memory as well as loading the 2nd activity into memory? If so, could I help my memory issues by calling <code>finish()</code> on the menu activity once the 2nd one is started (then restarting the menu activity when the user wishes to go back to the menu or would this bring up a whole new set of issues?)?</p>","278447","","","user1521536","2012-08-05 06:09:04","2013-03-11 04:55:39","Heap size overflow issues with sound clips","<android><memory-management><soundpool>","1","3","","",""
"2308897","1","2332251","","2010-02-22 04:58:57","2","7134","<p>I have a requirement to implement IP camera's for my client's  Organization(May be 5 or more). I need to provide facility to view these camera's preview in their Android mobiles. I found an application already available in Android Market(IP Cam Viewer) and it is what exactly my Client asking.</p><p>Can anyone suggest me the best IP camera(It should be operated by their mobile i.e moving it up and down, as well as left and right)?</p><p>And how can I implement this functionality in Android(i.e Viewing live video from the IP Camera)?</p><p>Thanks &amp; Regards,Raghavendra K.</p>","179043","","","","","2013-01-20 01:10:16","IP Camera implementation in Android(View live video from IP Camera)","<android><video-streaming><ip-camera>","3","0","4","",""
"2308942","1","","","2010-02-22 05:11:22","8","3380","<p>I've an design issue in implementing different types of launchmode for different activities. I've 5 Activities.</p><ol><li><p>VideoList</p></li><li><p>VideoDetail</p></li><li><p>FavoritesList</p></li><li><p>VideoSearch</p></li><li><p>VideoPlayer</p></li></ol><p>When the user starts the app it goes to VideoList that displays list of videos. Clicking on any of the Videos take them to VideoDetails.There are two button in that page. Play Button and Add to Favorites Button. I've a Footer bar on all the pages. Footer bar contains three image button. </p><p>1 HOME - Takes the user to first page- video list page</p><p>2 FAVORITES LIST - Show the list of favorites video. Clicking on any one of the videos takes the user to video details</p><p>3 VIDEO SEARCH - user can search video by artist name. Clicking on any one of the videos takes the user to video details</p><p>My question is , if I set all the activities to standard, it eats lot of memory. Because user can open new activity from each page. </p><p><strong>1. What are my choices?</strong> </p><p><strong>2. Can I use SingleInstance / SingleTop (on all activities or only some activity )?</strong></p><p><strong>3. I tried to SingleTop on all activities. It works fine on most of the cases. Except for one.</strong></p><p>a. User opens the app.</p><p>b. Click on one of the item in video list page. It opens a new activity - VideoDetail</p><p>c. From VideoDetail page, user clicks the favorites list image button which  opens a new activity FavoritesList.</p><p>d. When the user clicks the one of the videos from favorites, its not opening a new video detail, its closing the favorites list and goes back to detail page. </p><p>Please help</p><p>Thanks in advance</p><p>RM</p>","278445","","278445","","2010-03-03 19:50:03","2012-06-12 14:34:19","Android singletop singleinstance and singletask","<android><singleinstance>","1","2","2","",""
"2309117","1","","","2010-02-22 06:05:45","7","2121","<p>I'm creating a dialog as follows:</p><pre><code> @Override protected Dialog onCreateDialog(int id) {  switch (id) {  case DIALOG_1:   return new AlertDialog.Builder(this)   .setTitle(R.string.s_dlg1)   .setPositiveButton(android.R.string.ok, this)   .create();  case DIALOG_2:   ...   ...  }  return null; } @Override public void onClick(DialogInterface dialog, int whichButton) {  if (dialog == ???) {   ...  }  else if (dialog == ???){   ...  } }</code></pre><p>How do I identify which dialog triggered the onClick method? I can't declare the interface methods as in-line when creating the dialog because I want to access variables in my class. Every other interface passes some sort of id to its methods to identify which object called the method, but I can't seem to do anything with 'DialogInterface dialog'.</p>","274972","","","","","2012-01-15 11:30:32","Identify which AlertDialog triggered onClick(DialogInterface dialog, int which)","<android><events><dialog><onclick><identify>","2","1","1","",""
"2309587","1","","","2010-02-22 08:15:25","0","253","<p>I am writing a program for an Android phone (Which uses Java as the programming language)</p><p>I am writing a game that needs objects to - move around - other objects.  For example:  if an object was to move from point A to point B and there was another game object in the way, it would move around it.</p><p>I also need to detect collisions with object, for example if an object hits another object.</p><p>Any good resources for this stuff?</p>","248521","","22656","","2010-02-22 08:18:27","2010-02-22 08:33:41","Detecting collisions and and walking around obects","<java><android>","2","2","1","",""
"2309811","1","2311208","","2010-02-22 09:06:31","9","4072","<p><strong>WARNING: this question is now obsolete, as Android Market includes much more countries and such services as <a href=""https://www.x.com/community/ppx/xspaces/mobile/mep"" rel=""nofollow"">PayPal Mobile Payments Library</a> are available.</strong></p><p>Hi! I'd like to sell my Android application, but I live in Poland and in my country* Android Market supports only free apps (we cannot sell and we cannot buy too).</p><p>What is the best way to sell application in such situation? I can accept PayPal money transfers, but I don't know how to distribute APK package without exposing it to getting pirated. Did someone tried it already and succeeded?</p><p><strike>*) you may be surprised, paid apps are supported only in 12 countries worldwide.</strike></p><p><strong>WARNING: this question is now obsolete, as Android Market includes much more countries and such services as <a href=""https://www.x.com/community/ppx/xspaces/mobile/mep"" rel=""nofollow"">PayPal Mobile Payments Library</a> are available.</strong></p>","7162","","21234","","2011-02-22 14:06:25","2011-02-22 14:06:25","Android: how distribute paid application when paid Market is not available in my country (OBSOLETE)","<android><apk><google-play>","3","0","5","",""
"2309950","1","","","2010-02-22 09:34:07","4","2364","<p>What is the best (most proper) location to install the Android SDK on Mac?</p><p>I've seen in some posts that somewhere in the Home directory is advantageous.  Some seem to have placed the SDK in the Applications directory.  </p><p>Thanks very much.</p><p>Prembo.</p>","24376","","","","","2011-02-17 20:06:48","Proper location to install Android SDK on Mac","<osx><android><installation>","1","1","","",""
"2310036","1","","","2010-02-22 09:53:10","0","226","<p>I want to change setting in native application (i.e. SMS) by pointing it to different content location. </p><p>Ex - At given fraction of time, native application is pointing to list of SMS (<code>com.android.providers.telephony.databases.mmssms.db</code>).</p><p>I want to point to different location, that might be <code>com.android.providers.telephony.databases.mmssms1.db</code></p>","193583","","21234","","2010-02-22 09:59:49","2010-02-22 10:28:03","How to change DB location for content","<android><native>","1","0","","","2010-02-22 09:53:10"
"2310146","1","","","2010-02-22 10:13:29","0","206","<p>How can I change the content of all or certain SMSes in my inbox?</p>","193583","","122607","","2012-02-07 18:33:50","2012-02-07 18:34:07","How to modify SMSes in an Android inbox","<android>","1","0","","",""
"2310209","1","2310291","","2010-02-22 10:22:20","5","25493","<p>I'm having trouble creating a simple rounded rectangle using XML. Every time I try to add the ""corners"" element to the custom shape I get:</p><blockquote>  <p>java.lang.UnsupportedOperationException    at  android.graphics.Path.addRoundRect(Path.java:514)    at  android.graphics.drawable.GradientDrawable.draw(GradientDrawable.java:314)    at  android.view.View.draw(View.java:6520)          ...</p></blockquote><p>res/dawable/rounded_rectangle.xml:</p><pre><code> &lt;shape xmlns:android=""http://schemas.android.com/apk/res/android"" android:shape=""rectangle""&gt;         &lt;solid android:color=""#ffffff""/&gt;            &lt;stroke android:width=""3dp""                android:color=""#ff000000""/&gt;        &lt;padding android:left=""1dp""                 android:top=""1dp""                 android:right=""1dp""                 android:bottom=""1dp""/&gt;         &lt;corners android:bottomRightRadius=""7dp"" android:bottomLeftRadius=""7dp""          android:topLeftRadius=""7dp"" android:topRightRadius=""7dp""/&gt;     &lt;/shape&gt;</code></pre><p>simple layout.xml using the above shape:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""fill_parent""     android:layout_width=""fill_parent""&gt;&lt;View android:id=""@+id/View01""     android:background=""@drawable/rounded_rectangle""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;&lt;/View&gt;&lt;/RelativeLayout&gt;</code></pre><p>Fyi, I'm trying to compile for Android 2.1 and I have all the latest updates installed to Eclipse and the Android SDK. This shape is a direct copy of something I saw on another website, but for some reason It doesn't want to work for me.</p><p>Thanks.</p>","272302","","1029552","","2012-09-22 06:50:15","2012-09-22 06:50:15","Android - Can't create simple rectangle shape... UnsupportedOperationException?","<java><android>","1","1","1","",""
"2310310","1","2324168","","2010-02-22 10:42:21","0","1649","<p>I have a small issue.</p><p>Is it possible to enable or disable HSDPA connection programatically in Android?</p><p>If so, how to do that? I didn't find any API in TelephonyManager.</p><p>Please help me in this..</p><p>Thanks in advance...</p>","269304","","338479","","2013-05-21 20:36:58","2013-05-21 20:36:58","How to enable HSDPA programmatically in Android?","<android>","1","2","","",""
"2310375","1","","","2010-02-22 10:56:01","2","1236","<p>I want to develop an application which does payment processing through authorize.net</p><p>But everytime I get unknown error.</p><p>First I fill all the textboxes and use these values on a button click event.<br>My code is:</p><pre><code>txtAmount=Double.parseDouble(Amount.getText().toString());txtFName = FName.getText().toString();txtLName=LName.getText().toString();txtAddress=Address.getText().toString();txtCity=City.getText().toString();txtState=State.getText().toString();txtzipcode=zipcode.getText().toString();txtEmail=Email.getText().toString();txtCreditCard=CreditCard.getText().toString();txtCVV2=CVV2.getText().toString(); drpMonth=selectedmonth;drpYear=selectedyear;date= drpMonth.concat(drpYear);try {    URL post_url = new URL(""https://test.authorize.net/gateway/transact.dll"");    Hashtable post_values = new Hashtable();    // the API Login ID and Transaction Key must be replaced with valid values    post_values.put (""x_login"", ""8SX5gkJb46g"");    post_values.put (""x_tran_key"", ""8Wx295Gr4hd9Y5kd"");    post_values.put (""x_version"", ""3.1"");    post_values.put (""x_delim_data"", ""TRUE"");    post_values.put (""x_delim_char"", ""|"");    post_values.put (""x_relay_response"", ""FALSE"");    post_values.put (""x_type"", ""AUTH_CAPTURE"");    post_values.put (""x_method"", ""CC"");    post_values.put (""x_card_num"", txtCreditCard);    post_values.put (""x_exp_date"", date);    post_values.put (""x_amount"", txtAmount);    post_values.put (""x_description"", ""Sample Transaction"");    post_values.put (""x_first_name"",txtFName);    post_values.put (""x_last_name"",txtLName);    post_values.put (""x_address"", txtAddress);    post_values.put (""x_city"", txtCity);    post_values.put (""x_state"",txtState);    post_values.put (""x_zip"", txtzipcode);    post_values.put (""x_email"", txtEmail);    // Additional fields can be added here as outlined in the AIM integration    // guide at: http://developer.authorize.net    // This section takes the input fields and converts them to the proper format    // for an http post.  For example: ""x_login=username&amp;x_tran_key=a1B2c3D4""    StringBuffer post_string = new StringBuffer();    Enumeration keys = post_values.keys();    while( keys.hasMoreElements() ) {        String key = URLEncoder.encode(keys.nextElement().toString(),""UTF-8"");        String value = URLEncoder.encode(post_values.get(key).toString(),""UTF-8"");        post_string.append(key + ""="" + value + ""&amp;"");    }    // Open a URLConnection to the specified post url    URLConnection connection = post_url.openConnection();    connection.setDoOutput(true);    connection.setUseCaches(false);    // this line is not necessarily required but fixes a bug with some servers    connection.setRequestProperty(""Content-Type"",""application/x-www-form-urlencoded"");    // submit the post_string and close the connection    DataOutputStream requestObject = new DataOutputStream(connection.getOutputStream());    requestObject.write(post_string.toString().getBytes());    requestObject.flush();    requestObject.close();    // process and read the gateway response    BufferedReader rawResponse = new BufferedReader(new InputStreamReader(connection.getInputStream()));    String line;    String responseData = rawResponse.readLine();    rawResponse.close();                         // no more data    // split the response into an array    String [] responses = responseData.split(""|"");    // The results are output to the screen in the form of an html numbered list.    for(Iterator iter=Arrays.asList(responses).iterator(); iter.hasNext();) {        result=""\n""+ iter.next() +""&amp;nbsp"";        tv.setText(result);        //out.println(""&lt;LI&gt;"" + iter.next() + ""&amp;nbsp;&lt;/LI&gt;"");    }    setContentView(tv);} catch(Exception e) {    tv.setText(e.getMessage());    setContentView(tv);}</code></pre><p>Can anyone help me?</p><p>through setContentView I am showing my splited result and I get only unknown error exception. No other description is shown. Is my method wrong or there is any other method to implement payment processing ?</p>","271694","","3322955","","2014-02-19 05:05:53","2014-02-19 05:05:53","Implementing authorize.net in android","<java><android><authorize.net>","2","1","1","",""
"2310619","1","","","2010-02-22 11:46:07","0","801","<p>i am trying to put Autocomplete text view in dialog but getting error on adaptori have created new class extended by dialog and written following code.</p><pre><code>AutoCompleteTextView textViewCountry = (AutoCompleteTextView) findViewById(com.example.FindItNear.R.id.autocomplete_radius);            ArrayAdapter adapter = new ArrayAdapter&lt;String&gt;(this,com.example.FindItNear.R.layout.list_item, RADIUS);    --&gt; error here no constructor found         textViewCountry.setAdapter(adapter);    static final String[] RADIUS = new String[]  {    ""1"",    ""5"",    ""10"",    ""25"",    ""100"",    ""125"",    ""200"",    ""250"",    ""500"",    ""750"",    ""1000"",    ""1250"",    ""1500""    };</code></pre><p>but when i run same code on activity it works fine but in dialog it wont.any help would be appriciated.</p>","249991","","","","","2012-03-05 18:20:25","AutoCompleteTextView problem in Dialog?","<android><dialog>","1","1","","",""
"2311041","1","2311106","","2010-02-22 13:15:16","1","264","<p>I want to show a notification when a call is active.<br>I have done the first easy part.  Notification starts when my call intent starts.<br>Now to the tricky part,   how can I tell my Notification that the call has ended?  </p>","270421","","","","","2010-02-22 13:28:58","Notification question","<android><notifications>","1","0","","",""
"2311111","1","2312891","","2010-02-22 13:30:21","2","2877","<p>I need to run unit tests for code that references SQLiteDatabase for my Android code; however all my attempts to instantiate this object outside the emulator (on my desktop machine) have failed. JDBC on Android is not being recommended on the Net, hence it's out of the question (I could have provided mock objects very easily that way). So, any ideas?</p>","278711","","114066","","2010-07-21 08:57:19","2011-11-15 00:55:22","Unit testing SQLiteDatabase code - how do I instantiate a DB instance outside the emulator","<java><android>","2","5","","",""
"2311717","1","","","2010-02-22 15:04:56","3","3562","<p>Well, the title says it.</p><p>It would also be handy to know how many memory is still available.I am writing a memory hungry application that tends to crash randomly (in native Code),and my suspicion is that it gets out-of-memory.</p>","273501","","","","","2010-02-25 08:59:04","How to find out the memory footprint of my Android App?","<android><memory><android-ndk>","5","0","2","",""
"2312004","1","2313295","","2010-02-22 15:44:01","0","2140","<p>How do you include add, remove, and back buttons in ListActivity .pl?</p>","1746300","","364708","","2012-12-20 16:09:03","2012-12-20 16:09:03","add buttons to ListActivity","<android>","2","0","","",""
"2312321","1","2312352","","2010-02-22 16:25:28","3","1774","<p>Mi problem is that I need to implement Contact List in my application for both android 1.5, 1.6 and 2.x.</p><p>I did it using the old <a href=""http://developer.android.com/intl/de/reference/android/provider/Contacts.html"" rel=""nofollow"">Contacts</a> API, not <a href=""http://developer.android.com/reference/android/provider/ContactsContract.html"" rel=""nofollow"">ContactsContract</a> because of backwards compatibility with 1.x series. But when displaying my app on 2.x the contact list is not complete. In some devices it's shown as empty, and in some devices it only displays some of the contacts in the device.</p><p>I know that using <a href=""http://developer.android.com/intl/de/reference/android/provider/Contacts.html"" rel=""nofollow"">Contacts</a> API on 2.x series it will show only main account contacts, but this is not the case. It looks like only recently updated contacts are shown but that's not the case either.</p><p>So the question is: How to correctly implement contact list for both 2.x and 1.x android version?</p><p>Thanks in advance</p>","75928","","","","","2010-02-22 16:30:46","How to use contacts API for Android 1.x and 2.x simultaneously?","<android>","1","0","3","",""
"2312370","1","3482789","","2010-02-22 16:33:11","1","1289","<p>I have created some aidl files for IPC in my Android project.</p><p>They compile and run file however in the generated .java files I am getting warnings of un-used imports as follows:</p><pre><code>The import android.os.Binder is never used  EngineInterface.java    /gen/com//phone/engine  line 10 Java Problem</code></pre><p>Now I presume that they are there for a reason and since the generated file is not supposed to be modified that adding a suppress warning is not a good idea?</p><p>So how do I get rid of the warnings? I know they can be left and it doesn't affect the running of the project but I would like a clean as possible project so if its at all possible to remove this errors I would like to know how to do it.</p><p>Thanks</p>","243999","","","","","2014-03-01 22:05:06","Android - AIDL gen files causing warnings?","<java><android><build><warnings><aidl>","3","0","","",""
"2312379","1","","","2010-02-22 16:33:58","8","21671","<p>I found a tool for Instrumentation Testing called Robotium.It is easy and simple for black box testing of android applications.We can use it as follows:</p><pre><code>    solo.clickOnText(""Other"");    solo.clickOnButton(""Edit"");    assertTrue(solo.searchText(""Edit Window""));    solo.enterText(1, ""Some text for testing purposes"")    solo.clickOnButton(""Save"");    assertTrue(solo.searchText(""Changes have been made successfully""));    solo.clickOnButton(""Ok"");    assertTrue(solo.searchText(""Some text for testing purposes""));</code></pre><p>Can any body have more idea about it? Can any one please tell how can we use it for webviews and listviews etc.</p>","277116","","648313","","2011-09-30 08:42:57","2012-12-06 14:25:39","Examples for Robotium","<android><testing><instrumentation><robotium>","5","0","7","",""
"2312542","1","","","2010-02-22 16:55:44","2","2141","<p>I need to be able to stream audio from a custom file format on the C++ side of the Android system.  I am working on porting a custom media player and need to be able to open a custom file and stream audio from it.  This is important as I do not think porting the whole player to JAVA is feasible from a performance stand point and moving the audio buffers through the JNI interface I believe will be too slow to keep a decent frame rate.  I can handle the video on the NDK side through OpenGL ES, but the Audio I have no idea how to make this happen.  </p>","278857","","","","","2010-09-10 16:34:29","Android play raw Audio from C++ side","<c++><android><video><audio><android-ndk>","2","0","1","",""
"2312683","1","5720141","","2010-02-22 17:18:26","11","13020","<p>I am currently trying to use a ListView inside of a ScrollView.  I know from what I've read that this is looked down upon, but I'm trying to get the ListView to expand completely by showing all of its rows so there is no need for it to scroll.  I've been struggling, however, with how to tell the ListView to completely expand to show all of its rows since it needs a defined height.  Does anyone know of a way to calculate the height of a fully expanded ListView before it is drawn?</p><p>This problem mainly stems from the fact that you can't put a scrollable view inside of another scrollable view.  I am okay with the fact that the ListView won't be able to scroll as long as I can make it expand to show all of its rows.  I cannot do this, however, without being able to give it a defined height, which it seems I would need to calculate.</p><p>See the url below for a sketch (I'm a new user so I'm not allowed to post one).  It shows that my full layout is too big for the ""physical"" screen and needs to scroll in order to show the rest of the list and buttons at the bottom.  I'm trying to get across that the ""virtual"" screen is too big to fit on one screen even without the ListView there.</p><p><a href=""http://img51.imageshack.us/img51/7210/screenmockup.png"">http://img51.imageshack.us/img51/7210/screenmockup.png</a></p>","278861","","278861","","2010-02-22 20:09:36","2013-10-06 14:19:36","Calculate the size of a list view or how to tell it to fully expand","<android>","9","4","9","",""
"2312996","1","","","2010-02-22 18:08:27","1","133","<p>Can you please tell me how can I configure list view so that it canput focus to a focusable item within a list item?Android by default puts focus on the whole list item. Can I change itso that it can put focus to a focusable item within that item (e.g. abutton)?</p><p>Thank you.</p>","125440","","","","","2010-02-22 18:08:27","How can I configure list view so that it can put focus to a focusable item within a list item","<android>","0","0","","",""
"2313148","1","","","2010-02-22 18:29:29","4","17458","<p>is related to:</p><p><a href=""http://stackoverflow.com/questions/2307374/need-suggetsion-about-a-mixed-uri-int-id-images-ambient"">http://stackoverflow.com/questions/2307374/need-suggetsion-about-a-mixed-uri-int-id-images-ambient</a></p><p>now my problem is that:</p><pre><code>ImageView imgView=(ImageView)findViewById(R.id.imgView);Uri imgUri=Uri.parse(""android.resource://my.package.name/""+R.drawable.image);imageView.setImageURI(imgUri);</code></pre><p>does NOT work . why?</p><p>i know that</p><pre><code>imgView.setImageDrawable(Drawable.createFromStream(                    getContentResolver().openInputStream(imgUri),                    null));</code></pre><p>work.</p><p>but that does NOT solve my problem. because I want to set the image with an uri independenty if this come from a resource or come from the camera ACTION_PICK intent...</p><p>any suggestions are welcome.Thank you.Regards</p>","246435","","246435","","2010-02-22 19:06:14","2012-01-31 13:59:00","ImageView.setImageURI does NOT work when trying to assign a R.drawable.X Uri","<android>","2","2","1","",""
"2313522","1","","","2010-02-22 19:28:31","2","1089","<p>I wondered if anyone had any ideas about how to simulate low power conditions on Android (ie the pop-up notification that occurs) on the G1, say. </p><p>The adb am command lets you broadcast intents but, I think, maybe not system ones. Anyway,</p><p>$ am broadcast -a android.intent.action.BATTERY_LOW<br>Broadcasting: Intent { act=android.intent.action.BATTERY_LOW }</p><p>doesn't help.</p><p>Any ideas? Do the performance test cases help?</p><p>Thanks in advance....Ewan</p>","278934","","","","","2010-02-22 19:30:19","How to test the low power condition on Android","<android>","1","1","0","",""
"2313555","1","","","2010-02-22 19:34:57","0","425","<p>I want to create a very simple rest-like web service to be used by an android application.  The web service just needs to offer a way to add user entries to a simple database and retrieve other users' entries.</p><p>What would you recommend as a platform to accomplish this? </p><p>I was thinking google app engine might be a good way to get this going without worrying about hosting but asp.net mvc or django are other possibilities.</p>","233613","","","","","2010-02-22 19:36:39","Web service platform for communicating with android app","<android><web-services>","1","0","","",""
"2313579","1","","","2010-02-22 19:39:05","0","4060","<p>All I am trying to do is read a contact off of my emulator and display it to the screen. I can't seem to resolve this error.  Both of my packages (com.msi.ibm.tutorial and .MobileServiceCallContacts) have the permission READ_CONTACTS set in their manifest xml files. </p><p>So any ideas as to what I've got wrong ?</p><p>Here is the error message from eclipse console if it helps, it's not helping me, but I'm a little rusty at this and completely new to Android development.</p><pre><code>MobileServiceCallContacts]Starting activity com.msi.ibm.tutorial.MobileServiceCallContacts on device MobileServiceCallContacts]ActivityManager: Starting: Intent { cmp=com.msi.ibm.tutorial/.MobileServiceCallContacts }MobileServiceCallContacts]ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.msi.ibm.tutorial/.MobileServiceCallContacts } from null (pid=-1, uid=-1) requires android.permission.READ_CONTACTS</code></pre>","257079","","","","","2012-04-19 00:30:17","Android Permission Issue android.permission.READ_CONTACTS","<android><eclipse>","3","2","","",""
"2313585","1","2320643","","2010-02-22 19:39:55","2","1115","<p>On Android, for a content provider that requires the FINE_LOCATION permission, how do I create a LiveFolder?</p><pre><code>&lt;provider    android:authorities=""gpstracker""    android:name="".db.GPStrackingProvider""    android:permission=""android.permission.ACCESS_FINE_LOCATION"" &gt;&lt;/provider&gt;</code></pre><p>The LiveFolder keeps crashing in the at <code>com.android.launcher.LiveFolderAdapter.query(LiveFolderAdapter.java:58)</code> from a <code>java.lang.SecurityException: Permission Denial</code>.</p><p>I keep on searching on how to grant the LiveFolder permission, but am unable to find this.</p>","16352","","116895","","2010-02-22 20:04:43","2010-02-24 12:51:07","On Android, how do I grant a LiveFolders the required permission of my ContentProvider?","<android><permissions><android-contentprovider>","1","0","3","",""
"2313849","1","2315256","","2010-02-22 20:17:24","1","926","<p>I want to design a mobile application/tool for recovering deleted messages/pictures/files from the phone. I have the choice to do that using Android or Symbian. what do you think is more easier provided that I have to use some operating system concepts to solve the problem and recover deleted messages. Also what are the concepts that I can use for recovery ?</p>","278973","","","","","2010-03-04 12:48:40","Recovering deleted messages and data on a mobile phone","<android><security><mobile><operating-system><symbian>","3","1","","2012-07-30 13:26:16",""
"2313872","1","2314111","","2010-02-22 20:20:55","2","432","<p>If a listview is not given any items, how is it rendered? Will it still expand to fill the space in the layout allotted to it?</p>","246793","","","","","2010-02-22 20:55:54","How is an empty listview rendered?","<android><listview><layout>","1","0","","",""
"2314139","1","2314288","","2010-02-22 20:59:00","6","2278","<p>I would like the users of my android app to have the option to email me the stacktrace of any uncaught exception that crashes my app.  Originally I thought I would just wrap every entry point to my app in a try/catch block, but there are far too many of these even in my tiny app for this to be reasonable.</p><p>So what I am really looking for is a way to specify some method to be the default handler for any uncaught exceptions.  Any suggestions?</p>","267542","","","","","2011-07-13 10:28:14","is it possible to replace the default ""Force Close"" dialog in Android?","<java><android><exception>","2","2","8","",""
"2314230","1","","","2010-02-22 21:12:09","2","5136","<p>I'm trying to get a custom dialog with a transparent background doing this way:</p><pre>this.getWindow().setBackgroundDrawableResource(R.drawable.transparent);</pre><p>(where ""R.drawable.transparent"" is a reference to the color ""#00000000"")</p><p>The weird issue on this is that I can't align my dialog window. It's always aligned to the left, even if I implicit set the Gravity of the window using:</p><pre>this.getWindow().setGravity(Gravity.CENTER);</pre><p>And if I just comment the line which set the transparent background, the alignment works fine.</p><p>Any help would be much appreciated!</p><p>Thanks.</p>","267779","","","","","2012-10-23 04:30:34","Transparent Dialog Alignment","<android>","2","0","2","",""
"2314781","1","","","2010-02-22 22:29:06","1","7405","<p>I have a class which sets an alarm but I need to set around 10 more of these alarms. Instead of duplicating classes, is there a way I can just make a new instance of the class and set the alarm time?</p><p>Here's my code.</p><pre><code>  import java.util.Calendar;import java.lang.String;import android.app.Activity;import android.app.AlarmManager;import android.app.ListActivity;import android.app.PendingIntent;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.content.Intent;import android.widget.Button;import android.widget.Toast;public class Alarm extends Activity {    /* for logging - see my tutorial on debuggin Android apps for more detail */    private static final String TAG = ""SomeApp "";     protected Toast mToast;     @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);     setAlarm();    }   public void setAlarm() {        try {           Calendar cal = Calendar.getInstance();        cal.add(Calendar.DAY_OF_YEAR, 0);        cal.set(Calendar.HOUR_OF_DAY, 9);        cal.set(Calendar.MINUTE, 01);        cal.set(Calendar.SECOND, 0);        Intent intent        = new Intent(Alarm.this, Alarm1.class);        PendingIntent sender = PendingIntent.getBroadcast(this, 1234567, intent, 0);        PendingIntent sende2 = PendingIntent.getBroadcast(this, 123123, intent, 0);        AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);        am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender); // to be alerted 30 seconds from now        am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sende2); // to be alerted 15 seconds from now        /* To show how alarms are cancelled we will create a new        Intent and a new PendingIntent with the        * same requestCode as the PendingIntent alarm we want to cancel. In this case, it is 1234567.            * Note: The intent and PendingIntent have to be the same as the ones used to create the alarms.            */        Intent intent1        = new Intent(Alarm.this, Alarm1.class);        PendingIntent sender1 = PendingIntent.getBroadcast(this, 1234567, intent1, 0);        AlarmManager am1 = (AlarmManager) getSystemService(ALARM_SERVICE);        am1.cancel(sender1);        } catch (Exception e) {            Log.e(TAG, ""ERROR IN CODE:""+e.toString());        }    }};    b1.setOnClickListener(new View.OnClickListener() {                    public void onClick(View v) {                    //  Intent i = new Intent(getContext(),Alarm.class);//Code below is from another class which is where im calling the alarm application                       // ctx.startActivity (i);// start the Alarm class activity (class)public void onClick(View v) {                        Alarm a = new Alarm ();                        a.setAlarm();                        b1.setText(prod);                    }                });</code></pre><p>The above code is from another class and on the button click the user can set a reminder (the buttom invokes the alarm class, the only to get it to work is using an intent. I simply tried to call the setAlarm method but that didn't work.Maybe I could make a new instance of calendar and set the time in the button handler. Then I would have to pass that instance to the alarm class. Do you know if that would be possible?</p>","264905","","26428","","2010-07-25 21:56:21","2010-07-25 21:56:21","Android alarm class","<android><alarm>","2","0","2","",""
"2314886","1","2334977","","2010-02-22 22:50:29","92","78745","<p>I'm working on a project that involves Raphaeljs. Turns out, it doesn't work on Android. It <em>does</em> on the iPhone.</p><p>How the heck to I go about debugging something on the Android browser? It's WebKit, so if I know the version, will debugging it on that <em>full</em> version of WebKit produce the same results?</p>","25330","","","","","2014-04-19 07:27:56","How can I debug javascript on Android?","<android><debugging><webkit>","7","0","27","",""
"2314958","1","","","2010-02-22 23:02:42","33","19149","<p>If you want to use the built-in camera activity which uses the native Android camera, simply do the following.</p><pre><code>Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);           this.startActivityForResult(camera, PICTURE_RESULT);</code></pre><p>You want to get the images back from the nifty camera you displayed -- but how?</p>","279076","","844882","","2012-07-02 04:00:29","2012-07-02 04:00:29","Using the camera activity in Android","<java><android><camera><android-activity>","1","2","20","",""
"2314969","1","","","2010-02-22 23:03:43","39","34223","<p>I have implemented a BroadcastReceiver which is triggered by the AlarmManager. The AlarmManager is initialized on BOOT_COMPLETED. So i have to declare the receiver in the manifest.</p><p>My problem is that i want the BroadcastReceiver only to do something when none of my own activities are in the foreground (aka the user is not interacting with my application). I pull information from a remote server and don't want to notify the user if he is currently in my application anyways.</p><p>So far i have not managed to find a way to determine if my application is in the foreground. Is there a way to do such thing? The ActivityManager tells me if my application is running but not whether it is in the foreground. </p><p>The problem is pretty much the same as described here: <a href=""http://stackoverflow.com/questions/2282435/inform-activity-from-a-broadcastreceiver-only-if-it-is-in-the-foreground"">Inform Activity from a BroadcastReceiver ONLY if it is in the foreground</a></p><p><strong>SOLUTION:</strong></p><p>After evaluating several solutions i want to quickly outline what i think is the best method to deal with activities in the background/foreground.</p><p>The preferred way is to register a broadcast receiver in the onResume method of your activity and to deregister it on the activities on onPause. Any service or other background element will than need to send a broadcast intent with a specific action that your activity will intercept.</p><p>If your activity is in the foreground it will have its intent receiver registered and is able to directly deal with the intent send from your service. If it is not in the foreground it will not receive the intent but the service that invokved the broadcast will know that nobody intercepted its broadcast intent and will be able to deal with that itself. Eg it could than launch the desired activity, show a notification etc.</p>","271877","","271877","","2012-03-16 09:39:14","2012-05-08 14:39:46","How to determine if one of my activities is in the foreground","<android><broadcastreceiver>","6","1","25","",""
"2315203","1","2348797","","2010-02-22 23:54:15","14","14834","<p>What would be a sensible way to add <code>DISTINCT</code> and/or <code>GROUPBY</code> to <code>ContentResolver</code>- based queries. Right now I have to create custom URI for each special case. Is there a better way?(I still program for 1.5 as lowest common denominator)</p>","135946","","135946","","2010-02-23 00:42:59","2013-07-31 06:27:17","Android: Distinct and GroupBy in ContentResolver","<android><distinct><group-by><android-contentresolver>","7","0","6","",""
"2315319","1","2315932","","2010-02-23 00:24:34","0","5343","<p>I'm trying to learn how to make video games on Android, and therefore I'm needing to get some decent tutorials going on how to make graphics on Anroid using the SurfaceView object.  However every single graphics tutorial I've tried (mainly SurfaceView stuff) has failed.  Please note that I don't want to use XML, as it is out of my element, and Google just wants to sell that technique on the advertisement of neatness, which I can do programmatically.</p><p>One major problem I've run into is that there are many tutorials, both from Google and from third parties, with code that uses the import android.opengl.GLSurfaceView command, or either imports a subset GLSurfaceView, and that never works on my IDE.  Every time I try to import either one of those, Eclipse wants to say that it basically doesn't recognize that package.  The strange thing is that I CAN import android.opengl.*, although that still causes some of the code in those packages to be referring to unrecognized types and/or methods.</p><p>After trying to fool around with the first problem for a while, I noticed that the Lunar Lander example didn't try to import either one of those two problem libraries.  So I pulled the code and referenced resources for that into one of my infant projects, leaving everything else in that project unused.  Of course I did change which package the Lunar Lander code was in and changed the class name in LunarLander.java or whatever, but that should not matter.  I was able to get the thing to build in Eclipse.  However when I went to run it, it would do nothing but crash.  Without showing any Lunar Lander graphics or anything, the emulator would just give me this error message basically saying that my App has stopped working unexpectedly and makes me close the App.</p><p>1) What's the deal with the issues with the opengl.GLSurfaceView package?2) What's the deal with the Lunar Lander example?3) Where's a good, firm tutorial on how to make video games for Android</p><p>Thanks.</p>","279112","","1228","","2013-08-16 15:32:55","2013-08-16 15:32:55","I am having trouble with every Android graphics/SurfaceView tutorial","<android><graphics><surfaceview>","1","1","","",""
"2315792","1","17008636","","2010-02-23 02:36:33","8","1413","<p>I would like to have the color of the progress bar (specifically the secondary progress that is updated with <a href=""http://developer.android.com/reference/android/widget/ProgressBar.html#setSecondaryProgress%28int%29"">setSecondaryProgress</a>) to change dynamically at runtime when it crosses a certain point.</p><p>I am already able to substitute my own drawable into the bar during my Activity's onCreate function (changing color from yellow to green) by calling setProgressDrawable and substituting a resource I've copied from the default Android version of a horizontal progress (SDK/platforms/android-2.1/data/res/drawable/progress_horizontal.xml).  However, updating this at runtime (yes, from the UI thread via an AsyncTask) causes the entire progress bar except for the thumbtab to go black or transparent.</p>","279175","","","","","2014-02-10 09:50:09","How can you dynamically update the color of a SeekBar?","<android>","3","2","1","",""
"2316369","1","2316429","","2010-02-23 05:42:01","1","515","<p>I am designing a Game and have a large background.  The background it a lot bigger than the phone display so the user will only have a small ""View"" of the background.  They will be able to move around by scrolling with their finger.  </p><p>How do i go about this?</p>","248521","","","","","2010-02-23 06:00:08","Creating a large background and moving it with your finger","<android>","1","0","1","",""
"2316445","1","2316508","","2010-02-23 07:37:53","5","13340","<p>I have an API in the form of a JAR that I would like to use in my Android app. Not sure if it should be part of the project in Eclipse or kept separate and added to the project properties. This JAR also needs to be packaged with the application, so how is that done for Android apps?</p>","246793","","","","","2013-06-23 19:59:33","How to use and package a JAR file with my Android app?","<android><eclipse><jar><package><apk>","2","0","4","",""
"2316465","1","6404130","","2010-02-23 07:44:17","67","18752","<p>I have been trying for a few days now to make my layouts more efficient by converting from using several levels of nested <code>LinearLayouts</code> to one <code>RelativeLayout</code> and have come across a few problems that I haven not been able to find a workaround for...</p><p>I have searched the Android beginners group and this site and have not been able to find anything that would help me solve the problem.</p><p>I read on one of the blogs that you can combine layouts with merge and include tags. So what I have is a main layout file with a <code>RelativeLayout</code> root element.  Inside of that I have 5 include tags that reference 5 different xml layout files that each have a merge element for the root (all of my merge files are the same except for the ids in them). </p><p>I am running into two problems, which I will explain after posting a simplified version of my layout code:</p><p><strong>Sample Main Layout File:</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/translucent_gray"" &gt;    &lt;include         android:id=""@+id/running_gallery_layout_id""        layout=""@layout/running_gallery_layout"" /&gt;    &lt;include         android:id=""@+id/recent_gallery_layout_id""         layout=""@layout/recent_gallery_layout""        android:layout_below=""@id/running_gallery_layout_id"" /&gt;    &lt;include        android:id=""@+id/service_gallery_layout_id""        layout=""@layout/service_gallery_layout""        android:layout_below=""@id/recent_gallery_layout_id"" /&gt;    &lt;include        android:id=""@+id/process_gallery_layout_id""        layout=""@layout/process_gallery_layout""        android:layout_below=""@id/service_gallery_layout_id"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p><strong>Sample included merge file:</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;merge xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;TextView         style=""@style/TitleText""        android:id=""@+id/service_gallery_title_text_id""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:gravity=""left""        android:text=""@string/service_title"" /&gt;    &lt;Gallery        android:id=""@+id/service_gallery_id""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""        android:layout_below=""@id/service_gallery_title_text_id"" /&gt;    &lt;TextView         style=""@style/SubTitleText""        android:id=""@+id/service_gallery_current_text_id""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/service_gallery_title_text_id""        android:layout_above=""@id/service_gallery_id"" /&gt;&lt;/merge&gt;</code></pre><p>I am running into two problems:</p><p>1) The <code>android:layout_*</code> attributes seem to be ignored when used in the include tag and all of the merged layouts are displayed on top of each other.  According to this post (<a href=""http://developer.android.com/resources/articles/layout-tricks-reuse.html"">http://developer.android.com/resources/articles/layout-tricks-reuse.html</a>) ""any <code>android:layout_*</code> attribute can be used with the <code>&lt;include /&gt;</code> tag""</p><p>2) Since I couldn't get this working I decided to try adding an <code>android:layout_below</code> attribute to the first <code>TextView</code> item in each merge layout file, meaning that each merge file would be referencing an id from another merge layout file... For the most part this actually worked and my layout looks fine.  However, I get an error on one of the <code>android:layout_below</code> attributes saying that it can't find the id I specified... I have double and triple checked the ids to make sure they were correct.  The weirdest part is that I used the <code>AutoFill</code> feature to put the id in the attribute in the first place.</p><p>If anyone has any suggestions or workarounds I will be more than happy to try them out.  Also, if anyone can think of a way for me to just have one merge xml layout file instead of 5 that would be greatly appreciated.  I couldn't find a way to do that because I need to have access to each item in the merge layout files at runtime...</p><p>Thanks in advance!</p>","249412","","885464","","2012-02-17 15:11:10","2014-04-01 20:54:40","How to get RelativeLayout working with merge and include?","<android><android-layout><merge><include><relativelayout>","6","0","25","",""
"2316766","1","2316938","","2010-02-23 08:45:56","4","13803","<p>Im using a web service, so I want to use an async thread for the HTTP authentication request and another thread later to make additional service requests while my main thread runs.</p><p>Would like to see a good example of how to do this and how to show busy messages somehow in main app. How does the main app know when the thread finished? And what if my thread encounters exceptions, how do I deal with that?</p><p>HTTP requests are sent later, use the same cookies setup up by the first auth request, so will the later requests pick up the same cookies and just work?</p>","246793","","","","","2013-04-13 01:54:03","Need an example showing how to do async HTTP requests","<android><http><multithreading><asynchronous><task>","3","0","2","",""
"2316897","1","","","2010-02-23 09:09:22","1","553","<p>Does anyone know the solution to this problem in android?</p><ol><li>Can we get any event when a user delete SMS from Android messaging application.</li><li>If yes, then how will we intercept Android messaging application.</li></ol><p>Please share your suggestions on these issues.   </p>","193583","","1288","","2010-03-03 13:37:28","2010-03-03 13:37:28","How to stop deleting SMS from messaging app of android OS?","<android><sms><excercises>","1","0","","",""
"2316947","1","","","2010-02-23 09:21:04","3","361","<p>I'm writing a game for Android. I'd like to target as many devices as possible. I'm aware that Droid owners buy about 50% of the apps and the rest are a mixture of G1 and HTC devices.</p><p>So far, I've been testing my app in the emulator set to model the Droid phone (where I get about 40 fps) as well as on an actual Droid phone (where I get about 60 fps). </p><p>I'd like to know how fast my app runs on slower devices such as the G1. Is there any way I can do this besides getting a G1 myself or asking people with G1s to test it for me?</p><p>For example, is there any way I can use the emulator to get a rough idea how well it will run on the G1? </p>","279296","","","","","2010-04-27 10:29:45","Checking speed of Android apps without needing physical devices?","<java><android><optimization><mobile><profiling>","2","1","1","",""
"2316952","1","","","2010-02-23 09:22:12","1","2129","<p>My application needs to establish a new Wi-Fi connection to a secured network. The catch is that the application does not know the password/key/passphrase or whatever it is called for WEP/WPA. And it should not know! </p><p>In such case, I would like my application to invoke the system ""Connect to"" dialog. Only the system WifiManager should remember this password, and the fact that my application is not involved should be obvious to the end user.</p><p>Is this possible? I thought that it should be similar to using Intent() for android.content.Intent.ACTION_SEND to send a picture with another applications.</p>","192373","","192373","","2010-02-23 10:45:13","2010-02-23 11:24:13","How to invoke system dialog for ""Connect to"" secured network?","<android><wifi>","1","0","1","",""
"2316966","1","2316999","","2010-02-23 09:25:32","7","4485","<p>I'm starting to develop an application for Google Android and heavily relying on a web API that can deliver data in a restful way via json or xml. I now have to decide which library to choose. </p><p>I saw that google includes org.json classes in the API but haven't tested them yet. </p><p>How are your experiences? What library/API should I use and why?</p>","114066","","","","","2010-02-23 11:47:38","Should I use XML or JSON as a data format in Android Applications?","<xml><android><json>","1","0","1","",""
"2317003","1","2321262","","2010-02-23 09:32:07","1","100","<p>When building desktop or web apps, its easy to add fake hosts file entries so apps will connect to dev servers instead of production ones - is something similar possible for Android apps?</p>","246793","","1288","","2010-02-23 16:04:25","2010-02-23 19:59:40","Is it possible to set Android apps to connect to dev servers?","<android><dns><testing><resolve>","1","0","","",""
"2317167","1","7167568","","2010-02-23 10:01:32","15","32401","<p>I''m trying android SDK for the first time.I'm starting with the HelloAndroid tutorial. followed exactly each step but the emulator launches without my app. eclipse console says:</p><pre><code>[2010-02-23 11:47:55 - HelloAndroid]------------------------------[2010-02-23 11:47:55 - HelloAndroid]Android Launch![2010-02-23 11:47:55 - HelloAndroid]adb is running normally.[2010-02-23 11:47:55 - HelloAndroid]Performing com.example.helloandroid.HelloAndroid activity launch[2010-02-23 11:47:55 - HelloAndroid]Automatic Target Mode: Preferred AVD 'my_avd' is not available. Launching new emulator.[2010-02-23 11:47:55 - HelloAndroid]Launching a new emulator with Virtual Device 'my_avd' [2010-02-23 11:48:09 - HelloAndroid]New emulator found: emulator-5554[2010-02-23 11:48:09 - HelloAndroid]Waiting for HOME ('android.process.acore') to be launched...</code></pre><p>I see the emulator, the ''Android'' text on it but nothing else happens. can someone help please? thanks!</p>","258429","","3171","","2010-02-24 15:13:18","2014-04-02 02:09:51","HelloAndroid emulator problem","<android><android-emulator>","8","1","12","",""
"2317280","1","2333595","","2010-02-23 10:23:22","3","3803","<p>I'm working on a <code>webview</code>. If I click anything in my <code>webview</code>, it redirects to another link by using <code>webviewclient</code> class.</p><p>Now I put a footer contains <code>back</code> and <code>forward</code> button,  to do the functionality which in ordinary browser.</p><p>I can work about to <code>back</code> and <code>forward</code> of <code>webview</code>. It works fine.</p><p>Now I want to set a buttons in the footer are initially should be not focused and it should work clickable and not clickable dynamically.</p>","267269","","759866","","2013-12-07 19:34:20","2013-12-07 19:34:20","back and forward button for webview in android. how?","<android><android-emulator><webview>","1","2","0","",""
"2317333","1","","","2010-02-23 10:34:08","0","90","<p>I want create android application which has application icon to show a main screen with three touchable areas. How can I do this?</p>","279352","","1341006","","2012-11-14 07:08:53","2012-11-14 07:08:53","Android icon for touch screen Java","<android>","1","0","","2012-11-14 08:13:51",""
"2317428","1","2318356","","2010-02-23 10:48:18","143","59232","<p>I need to add a shake feature that will refresh my Android application.</p><p>All I find of documentation involves implementing the SensorListener, but Eclipse tells me it's deprecated and suggest SensorEventListener. </p><p>Anybody that has a nice guide to how I go about creating this <em>shake controller</em>?</p>","270273","","52444","","2012-08-17 08:30:49","2014-03-18 09:39:37","Android: I want to shake it","<android><accelerometer><shake>","14","3","114","",""
"2317454","1","2317470","","2010-02-23 10:52:57","1","877","<p>I'm trying to use a custom class (be.myname.rssreader.util.Global) extending android.app.Application, but when I try to use its accessors, I get the following exception:</p><blockquote>  <p>02-23 11:42:12.973:  ERROR/AndroidRuntime(2050):  java.lang.RuntimeException: Unable to  start activity  ComponentInfo{be.myname.rssreader/be.myname.rssreader.view.RSSReader}:  java.lang.NullPointerException</p></blockquote><p>Before you ask, yes, it's in my manifest, as follows:</p><pre><code>&lt;application android:name="".util.Global"" android:icon=""@drawable/icon""        android:label=""@string/app_name"" android:debuggable=""true""&gt;</code></pre><p>The code where the exception is thrown is this:</p><pre><code>global.setService(new FeedService(getApplicationContext()));</code></pre><p>It's placed in the onCreate of my main Activity, immdiately after the calls to super.onCreate and setContentView.</p><p>Any ideas why this keeps throwing that exception?</p><p>Thanks.</p>","279363","","","","","2010-02-23 15:32:14","RuntimeException when trying to use android.app.Application","<android>","2","0","1","",""
"2317544","1","2317573","","2010-02-23 11:08:33","5","12270","<p>I was wondering is it possible to register a broadcast receiver to receive two intents?</p><p>My code is as follows:</p><pre><code>sipRegistrationListener = new BroadcastReceiver(){    @Override    public void onReceive(Context context, Intent intent) {        String action = intent.getAction();         if (SIPEngine.SIP_REGISTERED_INTENT.equals(action)){            Log.d(""SETTINGS "", ""Got REGISTERED action"");        }           if (SIPEngine.SIP_UNREGISTERED_INTENT.equals(action)){            Log.d(""SETTINGS "", ""Got UNREGISTERED action"");        }       }};context.registerReceiver(sipRegistrationListener, new IntentFilter(SIPEngine.SIP_REGISTERED_INTENT));context.registerReceiver(sipRegistrationListener, new IntentFilter(SIPEngine.SIP_UNREGISTERED_INTENT));</code></pre><p>I get the REGISTERED Intent everytime I send it but I never get the UNREGISTERED Intent when I send it.</p><p>Should I set up another Broadcast receiver for the UNREGISTERED Intent?</p>","243999","","2683","","2012-07-13 18:29:20","2012-07-13 18:29:20","Android - Registering a broadcast receiver for two intents?","<android><android-intent><broadcastreceiver><intentfilter>","1","0","3","",""
"2317617","1","","","2010-02-23 11:23:02","3","12381","<p>i want to display text on image view.</p>","217065","","","","","2013-07-25 13:39:07","how to keep text on imageview in android?","<android>","9","3","","",""
"2317871","1","2317957","","2010-02-23 11:59:42","2","456","<p>I know it will sound dumb or people will just say: read the documentations available. But i can't get to understand how Context works. Yes, android.content.Context</p><p>Can someone help me?? </p><p>thanks</p>","2443607","","42106","","2010-02-23 12:23:52","2010-02-23 12:23:52","How does context work on Android?","<android>","1","0","","",""
"2317897","1","","","2010-02-23 12:03:17","0","727","<p>I want to get the hashtable object from non activity class to activity class an android</p><p>please reply to me</p><p>thanks </p>","268741","","","","","2010-02-23 12:20:14","how to get the hashtable object form a class to activity in android","<android><hashtable>","1","0","0","",""
"2318310","1","","","2010-02-23 13:12:49","17","28373","<p>Normally I am getting Wi-Fi setting screen on the emulator by clicking on the <code>Settings &gt; Wireless controls &gt; wifi settings</code>. I need to go directly to the Wi-Fi settings screen from my program when pressing on the Wi-Fi button which I have created. Contacts, call Logs we can handle by using Intent.setData(android.provider.contacts...........). Is there any way to open settings sub menus/menu from an android program ?<br>Please give me advise or sample code on this.</p>","279487","","281545","","2013-07-16 22:37:32","2013-09-04 15:47:30","How can i call Wi-Fi settings screen from my application using Android","<android><wifi>","5","0","9","",""
"2318313","1","2318736","","2010-02-23 13:13:14","9","10394","<p>I've got a class called <code>PhoneContact</code> with 3 properties:<code>Title</code>, <code>Description</code> and <code>PhoneNumber</code></p><p>If I have a collection of these, how would I go about binding these to a ListView containing a TextView for each property?</p>","29553","","29553","","2010-02-23 14:01:12","2011-08-12 19:04:13","Android - How do you bind a ListView to a collection of custom objects?","<android><data-binding><listview>","1","0","1","",""
"2318324","1","","","2010-02-23 13:15:02","1","2047","<p>I'm done creating an android program that adds a marker to a location.But I need to show CURRENT MY LOCATION in the MAP. I know this is done thru location based services but I don't know how to incorporate it into my program</p><p>Here is my onCreate command<pre><code>  public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><pre><code>    //map    mapView = (MapView) findViewById(R.id.mapView);    //zoom    LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);      View zoomView = mapView.getZoomControls();     zoomLayout.addView(zoomView,         new LinearLayout.LayoutParams(            LayoutParams.WRAP_CONTENT,             LayoutParams.WRAP_CONTENT));     mapView.displayZoomControls(true);    //Philippines coordinate    mc = mapView.getController();    String coordinates[] = {""10.952566007"", ""121.78921587""};    double lat = Double.parseDouble(coordinates[0]);    double lng = Double.parseDouble(coordinates[1]);    p = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));    mc.animateTo(p);    mc.setZoom(6);     mapOverlay = new MapOverlay();    listOfOverlays = mapView.getOverlays();    listOfOverlays.clear();    listOfOverlays.add(mapOverlay);      mapView.invalidate();}</code></pre><p></pre></code></p><p>I have an onTouchEvent that places the marker. So no problem there, the problem is I need to display my location at the start of the program. It should show a mark that says, ""You are here"" or something like that in the map. </p><p>p.s: I think I need to change the hardcoded point to my current location point, but i don't know how to do that :|  </p>","245385","","245385","","2010-02-23 13:22:45","2011-08-08 21:06:10","get current location","<android><google-maps>","2","0","3","",""
"2318775","1","2319167","","2010-02-23 14:20:50","12","28625","<p>I am using following code to display button at the bottom of activity.</p><pre><code>&lt;RelativeLayout         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_alignParentBottom=""true""         android:layout_centerHorizontal=""true""          &gt;    &lt;Button android:id=""@+id/btnGetMoreResults""    android:layout_height=""wrap_content""     android:layout_width=""wrap_content""          android:text=""Get more""       /&gt;       &lt;/RelativeLayout&gt; </code></pre><p>and listview above it. when i display more data in listview this button pannel is moved down.can any one guide me how can i fix it at the bottom of activity?</p><p>any help would be appreciated.  </p>","249991","","905093","","2011-10-01 21:19:19","2013-09-27 18:39:55","How to create fixed footer in android layout?","<android><layout>","3","0","7","",""
"2318784","1","2319426","","2010-02-23 14:22:03","5","23854","<p>I already have a sqlite database. And i put it in the ""assets"" folder of my project.Then what's the path of this databse. I read the document form adnroid. It said all the database in android,the path is data/data/pack_name/database_name.It make me confuse. I just place it in the ""assets"" folder. So the path is data/data/assets/database_name?Pls help .Thanks you very much</p>","275788","","12113","","2011-09-30 15:19:42","2013-05-02 14:43:55","How does android access a sqlite database included in the assets folder","<android><sqlite>","5","1","2","",""
"2319485","1","4492177","","2010-02-23 15:48:38","9","14388","<p>I've been trying to implement the tab UI described in this tutorial: <a href=""http://developer.android.com/intl/de/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">http://developer.android.com/intl/de/resources/tutorials/views/hello-tabwidget.html</a></p><p>I follow all the steps described in the process but I keep getting a runtime exception which I believe has something to do with the fact that nowhere in the tutorial I added the extra activities (songs, artists and albums) related to the content of each tab into the android manifest file.</p><p>Am I correct? is this tutorial (like many others) faulty or incomplete?</p><p>Best regards</p><p>Nelson</p>","274434","","1228","","2013-08-16 15:32:54","2013-08-16 15:32:54","Tab Layout tutorial incomplete?","<android><android-tabhost><manifest>","3","2","1","",""
"2319602","1","2319670","","2010-02-23 16:02:10","1","664","<p>I have been looking into android development for some time and would really like to create a networked game.  I also think this would be an excellent oppurtunity to familiarize myself with the app engine framework, but it seems more app engine applications are built around browser services. </p><p>This is not nessecarily a problem for me, but I do not want this to appear as a browser based game (I want live chat, more dynamic interaction/movement/combat).  I have been looking into AJAX/Java as a possible solution, but I am having trouble visualizing how i will actually connect the app to the server, since all tutroials I have found seem to be hosted web applications.  Are there any resources for android applications hooking transparently into App Engine services?</p><p>Or maybe there is a better service similar to app engine I should look into.  </p><p>Thanks! (if i was unclear about anything let me know)</p>","279159","","","","","2010-03-04 00:45:52","Developing Android networked game, is it feasible to use App Engine for a server","<android><google-app-engine>","3","2","1","",""
"2319735","1","","","2010-02-23 16:15:06","16","7729","<p>I've used the voice recognition feature on Android and I love it.  It's one of my customers' most praised features.  However, the format is somewhat restrictive.  You have to call the recognizer intent, have it send the recording for transcription to google, and wait for the text back.</p><p>Some of my ideas would require recording the audio within my app and then sending the clip to google for transcription.</p><p>Is there any way I can send an audio clip to be processed with speech to text?</p>","131871","","","","","2014-04-17 21:22:31","Voice recognition on android with recorded sound clip?","<android><speech-recognition><voice><voice-recognition>","3","3","8","",""
"2319907","1","","","2010-02-23 16:37:42","0","1767","<p>I have made an application that records from the phones microphone using the AudioRecord and 16-bit encoding, and I am able to playback the recording. For some compatibility reason I need to use 8-bit encoding, but when I try to run the same program using that encoding I keep getting an Invalid Audio Format. my code is :</p><pre><code>int bufferSize = AudioRecord.getMinBufferSize(11025, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_8BIT);AudioRecord recordInstance = new AudioRecord(MediaRecorder.AudioSource.MIC, 11025, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_8BIT,bufferSize);</code></pre><p>Any one knows what is the problem? According to the documentation AudioRecord is capable of 8-bit encoding.</p>","234898","","759866","","2014-02-15 16:34:48","2014-02-15 16:34:48","Using AudioRecord with 8-bit encoding in android","<android><android-audiorecord>","1","5","","",""
"2320042","1","2320072","","2010-02-23 16:54:13","0","454","<p>I worked in a tabactivity, I set the gravity for tabs as bottom. If I change the screen from portrait to landscape, I can't see the tabs.<br />How can I do it? I need an example please.</p><p>Thanks.</p>","267269","","57095","","2010-02-23 16:57:21","2010-02-23 16:58:50","how to track the screen in landscape or portrait view in android?","<android>","1","0","","",""
"2320373","1","2320538","","2010-02-23 17:41:24","6","5382","<p>How can the landscape screen orientation be restricted in android?</p>","267269","","34813","","2010-02-23 17:52:14","2011-11-29 05:40:08","How can the landscape screen orientation be restricted in android?","<android>","2","1","1","",""
"2320937","1","2321031","","2010-02-23 19:08:54","12","8016","<p>I'm a relative newbie to web and mobile development and especially to security so obvious answers are still appreciated.</p><p>I want my android app to be able to log in to a simple web service with a username and password.</p><p>What's the best way to send this information securely and keep the user logged in for an entire session? </p>","233613","","186035","","2010-02-23 20:01:01","2010-02-24 04:00:01","Securing communication from android to a web service","<android><web-services><security><authentication>","2","0","13","",""
"2321001","1","2321084","","2010-02-23 19:20:32","8","2353","<p>Does the Android platform lend itself well to a particular style of UI programming like MVC or MVP?  Most of my UI experience is with spaghetti code on a very old embedded device or in GWT with MVP so I do not know where to start.</p>","97901","","","","","2010-10-07 15:00:56","Does Android UI development lend itself well to a particiular design pattern?","<android><model-view-controller><design-patterns><mvp>","2","0","4","",""
"2321332","1","2321423","","2010-02-23 20:08:11","41","44120","<p>I have a <a href=""http://developer.android.com/reference/android/widget/ListView.html"">ListView</a> that will allow the user to long-press an item to get a context menu. The problem I'm having is in determining which <code>ListItem</code> they long-pressed. I've tried doing this:</p><pre><code>myListView.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {  @Override public void onCreateContextMenu(ContextMenu menu, final View v, ContextMenuInfo menuInfo) {   menu.add(""Make Toast"")    .setOnMenuItemClickListener(new OnMenuItemClickListener() {     @Override public boolean onMenuItemClick(MenuItem item) {      String toastText = ""You clicked position "" + ((ListView)v).getSelectedItemPosition();      Toast.makeText(DisplayScheduleActivity.this, toastText, Toast.LENGTH_SHORT).show();      return true;     }    });  }  });</code></pre><p>but it just hangs until an <a href=""http://en.wikipedia.org/wiki/Application_not_Responding"">ANR</a> pops up. I suspect that after the menu is created the <code>ListItem</code> is no longer selected.</p><p>It looks like you could monitor for clicks or long-clicks then record the clicked item there:</p><pre><code> mArrivalsList.setOnItemLongClickListener(new OnItemLongClickListener() {  @Override public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {   // record position/id/whatever here   return false;  } });</code></pre><p>but that feels majorly kludgey to me. Does anyone have any better solutions for this?</p>","76835","","13070","","2010-02-23 20:44:34","2013-12-24 22:18:07","Detecting which selected item (in a ListView) spawned the ContextMenu (Android)","<android><listview><contextmenu>","7","0","20","",""
"2321829","1","3802487","","2010-02-23 21:22:39","23","14185","<p>I have a very simple AsyncTask implementation example and have problem to test it using Android JUnit framework. It works just fine when I instantiate and execute it in normal application. However when it's executed from any of Android Testing framework classes (i.e. <em>AndroidTestCase</em>, <em>ActivityUnitTestCase</em>, <em>ActivityInstrumentationTestCase2</em> etc) it behaves strangely: - It executes <em>doInBackground()</em> method correctly - However it doesn't invokes any of its notification methods (<em>onPostExecute()</em>, <em>onProgressUpdate()</em>, etc) -- just silently ignores them without showing any errors.</p><p>This is very simple AsyncTask example</p><pre><code>package kroz.andcookbook.threads.asynctask;import android.os.AsyncTask;import android.util.Log;import android.widget.ProgressBar;import android.widget.Toast;public class AsyncTaskDemo extends AsyncTask&lt;Integer, Integer, String&gt; {AsyncTaskDemoActivity _parentActivity;int _counter;int _maxCount;public AsyncTaskDemo(AsyncTaskDemoActivity asyncTaskDemoActivity) {    _parentActivity = asyncTaskDemoActivity;}@Overrideprotected void onPreExecute() {    super.onPreExecute();    _parentActivity._progressBar.setVisibility(ProgressBar.VISIBLE);    _parentActivity._progressBar.invalidate();}@Overrideprotected String doInBackground(Integer... params) {    _maxCount = params[0];    for (_counter = 0; _counter &lt;= _maxCount; _counter++) {        try {            Thread.sleep(1000);            publishProgress(_counter);        } catch (InterruptedException e) {            // Ignore                   }    }}@Overrideprotected void onProgressUpdate(Integer... values) {    super.onProgressUpdate(values);    int progress = values[0];    String progressStr = ""Counting "" + progress + "" out of "" + _maxCount;    _parentActivity._textView.setText(progressStr);    _parentActivity._textView.invalidate();}@Overrideprotected void onPostExecute(String result) {    super.onPostExecute(result);    _parentActivity._progressBar.setVisibility(ProgressBar.INVISIBLE);    _parentActivity._progressBar.invalidate();}@Overrideprotected void onCancelled() {    super.onCancelled();    _parentActivity._textView.setText(""Request to cancel AsyncTask"");}}</code></pre><p>This is a test case. Here <em>AsyncTaskDemoActivity</em> is a very simple Activity providing UI for testing AsyncTask in mode:</p><pre><code>package kroz.andcookbook.test.threads.asynctask;import java.util.concurrent.ExecutionException;import kroz.andcookbook.R;import kroz.andcookbook.threads.asynctask.AsyncTaskDemo;import kroz.andcookbook.threads.asynctask.AsyncTaskDemoActivity;import android.content.Intent;import android.test.ActivityUnitTestCase;import android.widget.Button;public class AsyncTaskDemoTest2 extends ActivityUnitTestCase&lt;AsyncTaskDemoActivity&gt; {AsyncTaskDemo _atask;private Intent _startIntent;public AsyncTaskDemoTest2() {    super(AsyncTaskDemoActivity.class);}protected void setUp() throws Exception {    super.setUp();    _startIntent = new Intent(Intent.ACTION_MAIN);}protected void tearDown() throws Exception {    super.tearDown();}public final void testExecute() {    startActivity(_startIntent, null, null);    Button btnStart = (Button) getActivity().findViewById(R.id.Button01);    btnStart.performClick();    assertNotNull(getActivity());}}</code></pre><p>All this code is working just fine, except the fact that AsyncTask doesn't invoke it's notification methods when executed by within Android Testing Framework. Any ideas?</p>","209310","","365188","","2013-08-21 12:22:49","2014-03-21 17:48:03","Android AsyncTask testing with Android Test Framework","<android><junit>","4","0","19","",""
"2322234","1","2322494","","2010-02-23 22:26:39","73","120703","<p>I need to use a unique ID for an Android app and I thought the serial number for the device would be a good candidate. How do I retrieve the serial number of an Android device in my app ?</p>","246793","","648313","","2012-09-10 09:10:46","2014-01-15 16:22:10","How to find serial number of Android device?","<android><serial-number>","13","2","52","",""
"2322390","1","2323085","","2010-02-23 22:54:24","16","8560","<p>I have a listView, where each row has a button in the row layout. However, this seems to make the row itself unclickable. How can I make both the button and row clickable? </p><p>Thanks.</p>","118241","","","","","2013-06-14 07:38:42","Android Row becomes Unclickable with Button","<java><android>","4","0","12","",""
"2322643","1","2322958","","2010-02-23 23:44:36","7","5451","<p>I am doing a Battery Consuming research on the Android phone. I want to run a Battery Check every 10 min till the battery totally dies. I have been having problems to make it work.</p><p>At my first try, I use a timer in a service class, and schedule the battery check every 10 mins. But soon I found that the service got paused when the screen goes off.</p><p>Then I try to use AlarmService, I use a alarm call to wake my service every 10 mins and to check the battery level and save the data to a file on the sdcard. It works with the screen off. However, I only got data of 9 hours...it seems that the AlarmService stop at some point after several hours. I don't know why it is like this, has the system killed it for memory issues?</p><p>So my question is, has anyone written some service to run (like forever) in the background before? How do you do it and I'd appreciate very much for a sample code? </p><p>I am currently reading some posts saying that there's a partial wake lock I can use to keep the service alive.. is this the correct way to do it?</p><p>Thanks a lot and I hope I can get some useful answers here.</p>","279937","","1064959","","2011-12-08 03:01:15","2011-12-08 03:01:15","Run a service in the background forever..? Android","<android>","2","0","7","",""
"2322820","1","2323854","","2010-02-24 00:22:25","1","1198","<p>My app uses an API from an external JAR file. This JAR file has been added into my project and added in the build path. My project builds and runs just fine, but now I need to update the JAR file (some code in those classes has changed). I created a new JAR and copied it into my project after removing the old one. Do I need to ""re-import"" the JAR file or is there some way for Eclipse to refresh/re-examine the JAR file Im removed and re-added ?</p>","246793","","","","","2010-02-24 07:04:08","Update JAR used by Android app in Eclipse","<android><eclipse><jar><refresh>","2","0","","",""
"2323021","1","","","2010-02-24 01:15:38","0","1129","<p>My Android app is using a database through an API packaged in an external JAR. Since the JAR is opening/updating/closing the SQLite database file, do I need to make sure it uses its own package name instead of my own? Im getting errors where it fails to open the database file and Im guessing its because the package name Im telling it to use is incorrect: should it be using the package name in the JAR file?</p><p>Code that is opening the database:</p><pre><code>    public AndroidSQLiteDataStore() throws SQLiteException {        Logger logger = LoggerFactory.getDefaultInstance();        logger.information(TAG, ""OPEN CONNECTION TO DATABASE "" + Config.BN_ANDROID_DB_PATH);        try {            this.db = SQLiteDatabase.openDatabase(Config.ANDROID_DB_PATH, null, SQLiteDatabase.CREATE_IF_NECESSARY | SQLiteDatabase.OPEN_READWRITE);        } catch (SQLiteException e) {            logger.error(TAG, e.toString());            throw e;        }    }</code></pre><p>Also tried poking around with the shell:</p><pre><code>$ adb shell$ lssqlite_stmt_journalscachesdcardetcsystemsyssbinproclogo.rleinit.sapphire.rcinit.rcinit.goldfish.rcinitdefault.propdatarootdev$ cd data$ lsopendir failed, Permission denied$ </code></pre>","246793","","246793","","2010-02-24 23:01:11","2010-02-24 23:01:11","Correct path to sqlite database used by JAR imported into my Android app?","<database><android><sqlite><path>","1","1","","",""
"2323270","1","2325127","","2010-02-24 02:28:28","0","477","<p>iam trying to locate the database files on my nexus device.. is there anyway of doing it without rooting the device?</p><p>thanks</p><p>ray.</p>","260511","","129688","","2010-02-24 02:49:42","2010-02-24 10:15:02","where is database file in the device","<database><android><sqlite>","2","1","","",""
"2323532","1","","","2010-02-24 03:42:20","1","2674","<p>Hi    I have a ImageView that needs to be slide in from the bottom. Remain there for 5 sec. And then slide out. How do I do that? There is no user intervention.</p><p>ThanksRajesh Muthu</p>","278445","","267269","","2010-04-20 14:46:25","2010-04-20 14:46:25","Automatic animation","<android><animation><android-animation>","2","0","1","",""
"2323617","1","2324739","","2010-02-24 04:12:31","31","48274","<p>I have been trying long to send an HttpPost request and retrieve response but even though I was able to make a connection I don't yet get how to get the string message which is returned by the request-response</p><pre><code> HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(""http://www.myurl.com/app/page.php""); // Add your data    List &lt; NameValuePair &gt; nameValuePairs = new ArrayList &lt; NameValuePair &gt; (5); nameValuePairs.add(new BasicNameValuePair(""type"", ""20"")); nameValuePairs.add(new BasicNameValuePair(""mob"", ""919895865899"")); nameValuePairs.add(new BasicNameValuePair(""pack"", ""0"")); nameValuePairs.add(new BasicNameValuePair(""exchk"", ""1"")); try {     httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));     Log.d(""myapp"", ""works till here. 2"");     try {         HttpResponse response = httpclient.execute(httppost);         Log.d(""myapp"", ""response "" + response.getEntity());     } catch (ClientProtocolException e) {         e.printStackTrace();     } catch (IOException e) {         e.printStackTrace();     } } catch (UnsupportedEncodingException e) {     e.printStackTrace(); } </code></pre><p>I'm sorry, I sound very naive because I'm new to java. Please help me.</p>","132347","","758104","","2013-02-08 10:00:42","2013-02-08 10:00:42","Android HttpPost: how to get the result","<java><android><http>","5","2","23","",""
"2323642","1","","","2010-02-24 04:19:16","1","48","<p>When i try running the simple Hello Android program i get the following message in consoleemulator-5554 disconnected! Cancelling 'com.android.hello.HelloAndroidAs a result the program does not run.</p><p>Can any one help me out of this...</p><p>Thanks in Advance..sandeep</p>","280036","","","","","2010-04-06 21:00:03","emmulator-5554 issue","<android>","1","0","","",""
"2323722","1","2334386","","2010-02-24 04:46:46","5","4305","<p>I'm using the <code>android.hardware.Camera</code> class to take pictures and i'm finding that no exif data is stored in the images at all. If i use the camera application on my DROID all of the exif data is being saved.</p><p>I've tried setting the rotation with Set() and SetRotation() to see if I can get some exif data to show up.  When I view the images on my laptop with an exif reader it tells me the image has NO exif data.</p><p>I've seen some similar posts, but I have not found a solution to this. Has anyone seen this issue with other phones?</p><p>I'm using the Android 2.0.1 SDK</p>","67605","","","","","2011-08-03 22:06:31","Using the Android SDK i'm not seeing any EXIF in my JPEG's","<android>","3","2","2","",""
"2323747","1","","","2010-02-24 04:51:07","0","1571","<p>i want to add 4 imageviews to flipper at a time.Please provide some sample code</p><p>my code is</p><pre><code>    final ImageView imageview=new ImageView(this);    imageview.setBackgroundResource(R.drawable.img1);           final ImageView imageview1=new ImageView(this);    imageview.setBackgroundResource(R.drawable.img2);    final ImageView imageview2=new ImageView(this);    imageview.setBackgroundResource(R.drawable.img3);    final ImageView imageview3=new ImageView(this);    imageview.setBackgroundResource(R.drawable.img4);</code></pre><p>I want to add these images to flipper on by one.</p>","217065","","1045074","","2012-02-16 11:59:11","2012-02-16 11:59:11","how to add 4 image view to flipper in android?","<android>","1","0","","",""
"2323981","1","4687652","","2010-02-24 05:53:53","3","1760","<p>I've got a problem. </p><p>I wish to add rows dynamically to a <code>TableLayout</code>.  When adding these rows I need to be able to get the size of the View, so I attempt to perform this during <code>onSizeChanged()</code> but the new rows don't display.  So I tried <code>onFinishInflate()</code>, but then I don't have access to the size <code>(getMeasuredHeight returns 0)</code>.</p><p>Output of the following codes shows two rows <code>initial row</code> + <code>onFinishInflate getMeasuredHeight=0</code>.  But if i use hierarchyviewer from the sdk and press <code>load view hierarchy</code> then i suddenly see 3 rows in the emulator <code>initial row</code> + <code>onFinishInflate getMeasuredHeight=0</code> + <code>onSizeChanged getMeasuredHeight=270</code>!.</p><blockquote>  <p>Note: This is using emulator 2.1 hvga landscape, code built with  latest sdk, targeting android1.5.</p></blockquote><hr><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.steelbytes.android.TableHeightTest.TestLinLay     xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;TableLayout        android:id=""@+id/table1""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        &gt;        &lt;TableRow                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                &gt;                &lt;TextView                    android:text=""initial row""                /&gt;            &lt;/TableRow&gt;        &lt;/TableLayout&gt;&lt;/com.steelbytes.android.TableHeightTest.TestLinLay&gt;</code></pre><hr><pre><code>package com.steelbytes.android.TableHeightTest;import android.app.Activity;import android.os.Bundle;public class TableHeightTest extends Activity{    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }}</code></pre><hr><pre><code>package com.steelbytes.android.TableHeightTest;import android.content.Context;import android.util.AttributeSet;import android.widget.LinearLayout;import android.widget.TableLayout;import android.widget.TableRow;import android.widget.TextView;public class TestLinLay extends LinearLayout{ Context mContext; public TestLinLay(Context context, AttributeSet attrs) {  super(context, attrs);  mContext = context; }    private void addRow(String funcName)    {        TableLayout tl = (TableLayout)findViewById(R.id.table1);        TableRow tr = new TableRow(mContext);        TextView tv = new TextView(mContext);        tv.setText(funcName+"" getMeasuredHeight=""+tl.getMeasuredHeight());        tr.addView(tv);        tl.addView(tr);    }    @Override    protected void onFinishInflate()    {        super.onFinishInflate();        addRow(""onFinishInflate"");    }    @Override    protected void onSizeChanged(int w, int h, int oldw, int oldh)    {        super.onSizeChanged(w,h,oldw,oldh);        addRow(""onSizeChanged"");    }}</code></pre><hr>","252871","","944657","","2012-10-11 07:01:28","2012-10-11 07:01:28","problems with adding TableRow dynamically vs getMeasuredHeight/getHeight","<android><tablelayout>","2","1","","",""
"2324016","1","2416317","","2010-02-24 06:03:26","4","891","<p>In my <code>searchable.xml</code> in my android project, I get to specify a hint that appears in the edittext, when no text is written. Is there any way to dynamically set this?</p><p>In my action, I have two search buttons, that are calling <code>startSearch</code> passing their own parameters. I would like to set hints that reflect the selected action, based on which button was clicked - say ""search movie titles"", ""search actors"".</p><p>The way I see it, this could potentially be achievable by passing parameters to <code>startSearch</code>, or using a localization approach, just as I could place one hint in <code>values-fr\strings.xml</code>, there might be an alternative search resource file to target for when another button has been clicked? <em>Or</em> if the <code>searchable.xml</code> could be made into a selector, so that I could have it act differently in different states, somehow, that would also be fine... Problem is I haven't been able to find a means of achieving any of these.</p><p>The real reason I want to be doing this, is because the way I see it, it's the best way of communicating that the <em>default</em> action, when the device search button is pressed, is the first option, title search.</p><p><strong>UPDATE</strong></p><p>To avoid confusion, I'm happy with any declarative <em>or</em> programmatic approach of changing the hint in the EditText <code>mSearchTextField</code> in <a href=""http://www.netmite.com/android/mydroid/frameworks/base/core/java/android/app/SearchDialog.java"" rel=""nofollow""><code>SearchDialog</code></a>. What I'm unclear about is how to reference that EditText. The comments in the code linked to says ""This is still controlled by the SearchManager ..."" but I can't find any reference to how it can be controlled from the SearchManager either.</p>","133802","","133802","","2010-02-24 08:21:28","2012-06-25 18:17:29","Variable search hint","<android><searchable>","4","0","1","",""
"2324197","1","","","2010-02-24 06:48:07","2","1642","<p>Is there anyway to read data from an attachment through the USB port on an Android device? In particular, an EKG. Most the work can be done by the hardware of the device to simplify the output to a single number, a voltage reading. If its not possible, what about modifying an accessory that can already communicate with an android device? Thinking of devices that attach to android phones, what about sending the data as an audio signal to be read as the microphone from a headset and then analyzing the audio signal to convert it to a number that can be used to display a value.</p><p>Any ideas on how to make this work?</p>","280102","","","","","2012-08-27 05:41:58","Read data from an Android USB attachment","<android>","3","0","","",""
"2324418","1","2324441","","2010-02-24 07:52:34","10","5353","<p>I try to force the locale in my app to one the user specified. As this may be used to demonstrations, I want to change the language/locale in the app and not anytime for the whole device.</p><p>I looked around SO and tried to use every hint I found here. The result: I can restart my test activity with the new language, but if I change the orientation, the locale will always be reseted to the device one.</p><p>I <a href=""http://martin.cyor.eu/TestProject.zip"">uploaded a minimalistic project</a> so you can reproduce my issue. Please ignore the shrinking of the UI, its not important :)</p>","180538","","","","","2013-01-30 18:45:47","Android - Forced locale resetted on orientation changes","<android><locale><orientation>","3","0","1","",""
"2324500","1","","","2010-02-24 08:12:29","8","3599","<p>I'm still checking everything out.</p><p>I'm wondering what the limitations are if we develop the app using Titanium.What cannot be done using Titanium, for iPhone and for Android?What things can only be done using only the the native tools?</p><p>I heard that performance could be an issue. How bad is this going to be?</p><p>Thank you in advance. :)</p>","272624","","","","","2010-10-01 09:37:27","Titanium vs The Native Tools","<iphone><android><cross-platform><titanium><appcelerator>","4","0","2","",""
"2324537","1","2326128","","2010-02-24 08:22:23","10","16773","<p>Doesn't seem to be covered in the books Ive looked at.</p>","246793","","","","","2010-02-24 13:03:15","How to do 'busy' animation in Android?","<android><animation><busy-cursor><busyindicator>","2","1","1","",""
"2324551","1","","","2010-02-24 08:25:26","1","3422","<p>Hy everyone, I have two questions</p><p>1) I have not been able to find out in which units Location.distanceBetween receivs the latitude and longitude. Is it degrees or microdegrees? Whats the unit for the distance returned?Sorry for this noob questions but I have not been able to find anything on the documentation.</p><p>2) In windows XP using Eclipse 3.3.2. Emulator does not send coordinates properly. Either it by hand or by loading a gpx file the locationListener is not invoked. This same code I have tried it in Ubuntu and works fine. Does someone know how can I solve this? In the office there is no linux installed and I can take my personal laptop.</p><p>Thanks a lot in advanced!</p>","271569","","","","","2012-11-11 09:58:43","Android: Location.distanceBetween units and emulator not sending coordinates properly","<android><geolocation><gps><location><emulator>","2","0","1","",""
"2324701","1","2333564","","2010-02-24 08:56:21","4","18464","<p>I do have one service running in the background. Whenever it starts I store in memory the starting time in milliseconds:  </p><pre><code>startingTime = new Date().getTime();</code></pre><p>I want to display a chronometer that starts counting when the service starts and never stops until the user presses a button. I want to allow the user to leave the activity rendering the chronometer, do some stuff and then return. But the idea is that when the user returns I dont want the chronometer to go to 0:00 again. Insted I want it to show the exact time that has passed ever since the service has started.  </p><p>I can calculate elapsedTime every time the user return to the chronometer activity:</p><pre><code>elapsedTime =  new Date().getTime() - startingTime;</code></pre><p>The thing is that i dont know how to tell the chronometer to start counting from that time!</p><p>Setting it as the chronometer base does not work. Can someon explain what exactly ""base"" means or how to accomplish this?</p><p>thanks a lot!BYE</p>","271569","","41983","","2010-02-25 11:26:46","2014-04-03 12:38:46","Android: chronometer as a persistent stopwatch. How to set starting time? What is Chronometer ""Base""?","<android><chronometer>","5","0","1","",""
"2324737","1","2339012","","2010-02-24 09:01:46","1","3950","<p>I am trying to connect to a standalone desktop tcp server(java) from tcp client application in android device.</p><p>But I am not able to connect to that.</p><p>I tried to write a desktop tcp client and tried to connect to server(remote server). It is working fine.</p><p>But When I am trying to connecting from android, I am getting a IOException while creating Socket instance.</p><p>Can anyone help me in this ? Thanks in advance....</p>","269304","","","","","2011-08-08 14:14:01","Connecting to tcp server from client running in android device","<android><networking><network-programming>","2","0","2","",""
"2324847","1","2326191","","2010-02-24 09:22:05","1","3065","<p>What is the best way to launch an app and calculate its launch time in android(if it can be done with some code,then its better)</p>","237388","","","","","2013-12-06 11:49:51","Launch Time of an app","<android><performance><launching-application>","3","2","1","",""
"2325022","1","2325098","","2010-02-24 09:53:02","0","2125","<p>i created the database like this</p><pre><code>db.execSQL(""CREATE TABLE ""+TABLE_NAME+"" (""     +_ID+"" INTEGER PRIMARY KEY AUTOINCREMENT,""     + TITLE+"" TEXT UNIQUE,""     + PUBLISHED+"" DATETIME,""     + CONTENT+"" TEXT,""     + RATERS+"" TEXT,""
    + VIEWCOUNT+"" TEXT,""
    + THUMBNAIL+"" TEXT,""
    + FAVCOUNT+"" TEXT,""
    + FAVSTAT+"" INTEGER,""
    + LINKWEB+"" TEXT);"");</code></pre><p>i got an exception when i try to insert the values in the table??</p><pre><code>02-24 15:57:37.802: ERROR/DatabaseUtils(283): Writing exception to parcel02-24 15:57:37.802: ERROR/DatabaseUtils(283): android.database.sqlite.SQLiteException: table bru_tube has no column named linkweb: , while compiling: INSERT INTO bru_tube(content, favstat, title, thumbnail, linkweb, raters, viewcount, published, favcount) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?);02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteProgram.native_compile(Native Method)02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:110)02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:59)02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteStatement.&lt;init&gt;(SQLiteStatement.java:41)02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1026)02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1412)02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.database.sqlite.SQLiteDatabase.insertOrThrow(SQLiteDatabase.java:1307)02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at com.brownuniv.brutube.BruTube_Provider.insert(BruTube_Provider.java:82)02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.content.ContentProvider$Transport.insert(ContentProvider.java:150)02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:140)02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at android.os.Binder.execTransact(Binder.java:287)02-24 15:57:37.802: ERROR/DatabaseUtils(283):     at dalvik.system.NativeStart.run(Native Method)</code></pre><p>how to solve it??? any idea?</p>","267269","","267269","","2010-02-24 10:29:35","2010-11-26 12:22:41","getting sqlite exception when insert ? how to?","<database><android><sqlite><insert>","5","0","","",""
"2325242","1","2326147","","2010-02-24 10:30:43","2","2174","<p>As above, How do i put 2 views inside one cell in a <code>tablerow</code>?I created a Table Layout and by code i am adding rows.</p><p>Below is my code,: </p><pre><code>    TableLayout v = (TableLayout)inflater.inflate(R.layout.featureitem2, null);//  v.setColumnStretchable(0, true);    //adds each productname to the table    if(productName.size()&gt;1){        TableRow pnamesRow = new TableRow(t);        pnamesRow.addView(new View(t));        for(int j=0;j &lt; productName.size();j++){            LinearLayout wrap = new LinearLayout(t);            LayoutParams params = new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT,TableRow.LayoutParams.FILL_PARENT);            wrap.setLayoutParams(params);            wrap.setOrientation(LinearLayout.HORIZONTAL);            wrap.setVisibility(View.VISIBLE);            ImageView remove = new ImageView(t);            remove.setTag(j);            remove.setClickable(true);            remove.setImageDrawable(t.getResources().getDrawable(R.drawable.remove));               remove.setOnClickListener(new OnClickListener(){                @Override                public void onClick(View arg0) {                    int deletePosition = (Integer)arg0.getTag();                    Log.v(""pos"",""pos=""+deletePosition);                    removeChild(deletePosition);                    notifyDataSetChanged();                }            });            TextView pname = new TextView(t);            pname.setText(productName.get(j));            pname.setGravity(Gravity.CENTER);        //  wrap.addView(pname);            wrap.addView(remove);            wrap.setLayoutParams(params);            pnamesRow.addView(pname);        //  pnamesRow.addView(pname);        //  pnamesRow.addView(remove,j+1);            //tbIndex++;        }        v.addView(pnamesRow);    }    for(int z =0;z &lt; children.get(groupPosition).size();z++){        TableRow tr2 =new TableRow(t);         Feature f = (Feature) children.get(groupPosition).get(z);        TextView feature = new TextView(t);        feature.setText(f.getFeaturename());        feature.setTextColor(Color.BLACK);        feature.setGravity(Gravity.CENTER);        tr2.addView(feature);        for(int k =0;k &lt; f.getNumFeatures();k++){            TextView value = new TextView(t);            value.setText(f.getVal(k));            value.setTextColor(Color.BLACK);            //value.setGravity(Gravity.CENTER);            value.offsetLeftAndRight(20);            tr2.addView(value);            v.setColumnShrinkable(k+1, true);            tr2.setPadding(5, 5, 5, 5);            tr2.offsetTopAndBottom(50);        }        v.addView(tr2);    }</code></pre><hr><p>I think i have found the answer, thanks to commonsWare,</p><p>I should set the <code>layoutparams</code> to the <code>linearlayout</code> only after i add the items into the <code>linearlayout</code>.</p>","280229","","491243","","2012-10-11 09:24:19","2012-10-11 09:24:19","How can i add more than 1 Views in one cell in TableRow?","<android><tableview><tablerow>","1","0","0","",""
"2325419","1","","","2010-02-24 11:03:58","5","1585","<p>With the latest SDK release, and the ability to download separate platforms releases into the SDK, the hardware resources required to develop for Android have increased significantly. Assuming that the developer targets all currently available seven platforms - that could take your dev machine to its knees. Taken alone the 'Android SDK Content Loader' takes nearly two minutes on a dual-core machine with 2GB memory.</p><p>As the title suggest the reason for creating this wiki is for everyone to list their development hardware configurations, and thus determine what is a well-suited machine for Android development. </p><p>The secondary reason for the wiki is that I'm trying to get my employer to provide me with a decent machine for development as I'm currently forced to work on a nearly 4 year old randomly-built machine, and expected to deliver great results. However, the reality is that my system keeps running out of memory, and I can hardly get a chance to write a few lines of code in between the numerous crashes. </p><p>Hope this grows well enough so it helps out beginners to decide whether or not an upgrade on their existing configurations will improve their productivity! Of course, I hope it will serve me as a good evidence to show to my employer that I do need an upgrade too! </p><p>Thanks!</p>","224956","","224956","","2010-02-24 17:24:45","2011-06-17 08:51:33","Android Development Machine","<android>","6","0","1","","2010-02-24 11:18:39"
"2325547","1","2325594","","2010-02-24 11:27:20","3","10883","<p>How can a translation service be called in an Android app?  Can we have an app that can translate multiple languages into another?</p>","2355649","","3171","","2010-02-24 11:36:01","2011-12-13 09:17:19","How to have a translation service in android app","<android><translate>","3","0","4","",""
"2325699","1","","","2010-02-24 11:53:27","-1","686","<p>In my Application the camera preview is working properly in both in potrait and in landscape mode .No crashes are occuring.but the users are complainting that the crashes are occuring when they are using the same. what is the problem with this? please anyone help me to solve this issue</p>","244540","","","","","2012-02-12 14:53:46","Camera Preview Issue?","<android>","3","2","","",""
"2326146","1","","","2010-02-24 13:05:36","0","1090","<p>The code I am trying to implement includes a service and an application. When the application is first launched, it starts the service using the startService(svc_name) call. Here svc name is an intent pointing to the class that runs the service. </p><p>I want to share a resource(file/socket connection) between the service and the application. For example one writes to a file and another reads from it. I am unable to get proper sync between the service and app. </p><p>Could you please let me know how this can be achieved? Thanks in advance. </p>","280340","","","","","2010-02-25 09:58:07","Sharing resources between service and application in android","<android>","2","1","1","",""
"2326451","1","2326500","","2010-02-24 13:57:32","0","347","<p>In the emulator, it shows me the infomation: The application my_app_name (process pack_name) has stoped unexpectedly.Pls try againWhat is the problem?</p><p>Because i just add many field in the layout.xml file?</p><p>I am a newbie in Android development. Thanks you for your help</p>","275788","","8014","","2010-02-24 14:06:28","2011-01-26 20:41:49","Android application stops unexpectedly","<android>","2","0","","",""
"2326496","1","2326986","","2010-02-24 14:03:20","1","544","<p>I am developing a GPS enabled application on Android. There is no problem with the map display, but I want to test how my code would react to the situation in which the user enters a room, basement or a cave, so that the device would stop receiving any signal. My question is whether I can simulate this programatically or by using the DDMS, and if so, then how? </p><p>P.S. The point is to test it all on the emulator, not a real device.Thank you.</p>","247927","","","","","2010-02-24 15:08:53","Android emulator: disconnect GPS device from provider","<android><gps><emulator><signals><simulate>","1","0","","",""
"2326523","1","","","2010-02-24 14:07:20","2","4870","<p>I would like to be able to capture the video from an android phone camera, and then process this video. Processing involves adding a layer of AR to the live stream. Is this possible on android? Pretty sure it should be. </p><p>I have looked at the android site [http://developer.android.com/guide/topics/media/index.html] but this seems to be concerned with video capture and storage. I would like to be able to play with the video pre-storage. </p><p>Thanks,</p>","280379","","","","","2013-03-27 18:03:13","Android video stream capture for AR","<android><video-streaming><augmented-reality><android-video-player>","2","1","2","",""
"2326611","1","2327055","","2010-02-24 14:20:26","1","600","<p>I have a Website class that has 3 get,set properties ID, Name, URL.</p><p>For other hand i have a method that gets from database websites, and return a List</p><p>I would like to bind this List into a Spinner.</p><p>My questions are two:</p><ul><li><p>Its possible to add these websites list into a Spinner ?</p></li><li><p>As my website class has the property ID and Name, is possible that after a item of the spinner is selected, have the ID and Name of the item website selected ? </p></li></ul><p>Thanks a lot in advance.</p><p>Best Regards.</p><p>Jose.</p>","79919","","","","","2010-02-24 15:18:40","Android - Add typed objects to spinner widget","<android><android-widget>","1","0","1","",""
"2326622","1","2327027","","2010-02-24 14:22:13","16","9828","<p>So I am currently showing a notification. When the user clicks this noticiation, the application is started. The notification persists, to indicate that the service is running in the background.</p><pre><code>Intent notificationIntent = new Intent(context, LaunchActivity.class);PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);mNotificationManager.notify(1, notification);</code></pre><p>However, I have detected a case where a bug appears. If the user starts the application through clicking the normal icon, and while the activity is running clicks the notification, then a new activity is started without the earlier one exiting, the later being on top of the earlier. And that is not all: Further clicks on the notification will create additional activities and place them on top of those already running. How can I prevent this? Is there a nice check to do to see if a certain activity is currently being shown or is loaded?</p>","249871","","","","","2014-01-05 22:48:46","Starting Activity through notification: Avoiding duplicate activities","<android>","3","0","13","",""
"2326706","1","2328055","","2010-02-24 14:32:52","4","6244","<p>I have a scenario, for example, a EditText in acitivity  instead of using Textview as a label of it i want to put text ""UserName"" inside EditText and if user clicks on it.it should disappear and EditText should get empty to enter data in it.</p><p>How can I achieve this?</p>","249991","","114066","","2010-02-24 14:54:23","2011-01-01 10:58:44","how to Remove text onfocus of EditText in android?","<android><edittext>","3","0","","",""
"2326767","1","2326816","","2010-02-24 14:42:20","43","36053","<p>I want to check the internet connectivity in each activity. If it is lost a message should be displayed.</p><p>Can any one guide me how to achieve this?</p>","249991","","560600","","2011-10-07 08:50:07","2014-03-14 05:29:04","How do you check the internet connection in android?","<android><activity><network-state>","8","0","33","",""
"2327141","1","2348143","","2010-02-24 15:30:54","2","958","<p>i need to parse this php xml response in android:</p><pre><code>&lt;?phpxml version=""1.0"" encoding=""utf-8""?&gt; &lt;SmsResponse&gt;&lt;version&gt;1&lt;/version&gt;    &lt;result&gt;0&lt;/result&gt; &lt;resultstring&gt;failure&lt;/resultstring&gt; &lt;description&gt;error&lt;/description&gt;    &lt;endcause&gt;&lt;/endcause&gt;&lt;/SmsResponse&gt;</code></pre>","279560","","279560","","2010-02-24 15:37:22","2010-02-27 16:54:27","php xml response gave me this after android sax parsing: XML or text declaration not at start of entity","<php><xml><android><parsing>","1","2","1","",""
"2327813","1","2327837","","2010-02-24 16:57:37","6","1055","<p>I am currently developing an application that receives GPS data gathered using and android phone. I need to analyze that data in terms of speed, acceleration, etc...</p><p>My question is: Can I trust the speed values returned by the phone? Or should I use the difference in position and time between two points to get the values I want? Also, is there any ""standard"" method for filtering input data? Or any library (python welcomed) that does that kind of task?</p><p>Thank you in advance! :)</p>","280509","","","","","2011-03-01 14:23:51","How to best use GPS data?","<python><android><gps><filtering>","1","3","3","",""
"2327943","1","2328179","","2010-02-24 17:13:34","0","1291","<p>I am currently firing an Intent to a Broadcast Receiver which in turns starts an Activity.</p><p>Then from the same Service another Intent is fired to a Broadcast Receiver thats in the Activity.</p><p>The problem is that the Activity isn't getting the Intent meant for it because it is fired before it is alive and the Broadcast Reciever is registered.</p><p>I was wondering is there anyway to make sure an Activity is alive before sending an Intent?</p><p>Or any other solution to this?</p>","243999","","","","","2010-02-24 17:44:48","Android - Make sure activity is alive before firing Intent?","<android><activity><android-intent><broadcastreceiver>","1","2","","",""
"2328105","1","","","2010-02-24 17:36:22","0","2157","<p>Basically I am using kSoap2 classes for Android. The client app is consuming a web service. If required I can post the code.</p><p>I surfed around to figure this out. I get following error messageexpected: START_TAG{http://schemas.xmlsoap.org/envelope/}Envelope(posiiton:START_TAG@1:6 in java.io.InputStreamReader@437b40f0) when androidHttpTransport.call(SOAP_ACTION, envelope); is called.</p><p>What I gathered so far is ""The xml is not parsed correctly or there was no response from the webservice server."" Any suggestions?</p><p>Also, When I tried other external webservice: <a href=""http://www.deeptraining.com/webservices/GetWeather"" rel=""nofollow"">http://www.deeptraining.com/webservices/GetWeather</a>, I received: IOException on androidHttpTransport.call(SOAP_ACTION, envelope);</p><p>IOException message: Host is unresolved, any idea how to solve this, here I didn't get the XmlPullParserException (may be it will show up once this is fixed).</p><p>Thanks and I appreciate your insight and time.</p><p>Anjana.</p>","","user280530","","","","2011-01-25 23:57:46","XmlPullParserException when androidHttpTransport.call(SOAP_ACTION, envelope); is called","<android><web-services><ksoap2>","1","0","","",""
"2328459","1","2328710","","2010-02-24 18:28:21","21","22591","<p>I'm looking for a sample web page (html code) with a link that will install an apk file directly on my phone by clicking on the link.</p>","164460","","","","","2013-02-16 20:29:33","apk installation from web page","<android><installation><apk>","3","0","7","",""
"2328650","1","","","2010-02-24 18:54:20","18","8178","<p>I'm creating an Android app that searches for items based on the visible area of the MapView. Is there a way to set up a listener on my MapView to detect when a map has been panned or zoomed?</p>","116982","","","","","2014-02-07 04:05:02","How can I detect if an Android MapView has been panned or zoomed?","<android><android-mapview>","6","1","7","",""
"2328801","1","","","2010-02-24 19:22:44","6","4516","<p>Hi   I don't know how to position the progress dialog(the one with the rotating image). When my application starts its display an full screen image and a progress dialog box. I need to moved the progress dialog box a little lower.</p><p>ThanksRajesh</p>","278445","","","","","2011-04-07 22:51:03","Android Positioning Progress Dialog or Custom Progress Dialog","<android><progressdialog>","2","1","1","",""
"2328954","1","","","2010-02-24 19:43:48","1","822","<p>I'm interested in capturing media to use in my activity in two ways:<br>1) capturing immediately from the supplied app. (like <a href=""http://stackoverflow.com/questions/2314958/using-the-camera-activity-in-android"">http://stackoverflow.com/questions/2314958/using-the-camera-activity-in-android</a>)</p><blockquote>Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);           this.startActivityForResult(camera, PICTURE_RESULT);</blockquote><p><br>2) browse a picture/video/audio gallery and pick from the list.<br>I notice I can call up for the photo gallery</p><blockquote>Intent intent = new Intent(Intent.ACTION_VIEW, target); <br>startActivity(intent);</blockquote><p><br>But how about for video only?  audio only?  How will I get the URI from any of them?<br></p>","280641","","","","","2010-12-10 18:07:35","How do I use the android media services to return that media to my activity?","<android><activity><android-intent><mediastore>","1","0","","",""
"2329132","1","","","2010-02-24 20:12:57","0","605","<p><br>Avoiding having to create a whole camera app myself, I am calling up:<br></p><pre><code>Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);this.startActivityForResult(camera, PICTURE_RESULT);</code></pre><p>However, the camera is very advanced and beautiful :) but not for my purposes.  :(<br>Is there a way to restrict the camera to control size, resolution, disable setup button, flash, face recognition, etc...?</p>","280641","","19750","","2010-03-29 00:01:09","2010-03-29 00:01:09","Restricting Android camera","<android><camera><android-intent>","1","0","","",""
"2329224","1","2329507","","2010-02-24 20:24:52","0","176","<p>I am thinking of making a move to Net Beans but one thing I cant figure out is how to take a snapshot of the screen. I know eclipse has this capability.</p>","280653","","","","","2010-02-24 21:04:31","Screencapture in NetBeans for Android","<android><netbeans>","1","2","","",""
"2329246","1","","","2010-02-24 20:29:03","1","1132","<p>I'm searching for a forum software which offers  REST like API. It should be able to respond to simple calls like retrieve-post, add-new-post etc. and return the result set in JSON or XML format.</p><p>Those that immediately come to mind are phpBB, Vanilla, and/or vBulletin. But I don't know if they have REST API. Also I don't intend to deploy the forum for a website. I intend to integrate a forum like feature inside the Android and iPhone apps. </p><p>Edit: I don't intend to host the server on mobile. Just access it from the mobile app.</p><p>thanks</p>","240410","","240410","","2010-02-25 18:18:14","2010-10-01 01:59:00","forum software with a simple RESTful API support","<iphone><android><rest><forum>","0","4","","",""
"2329950","1","2451740","","2010-02-24 22:02:22","1","416","<p>I have the following XML layout for a ListActivity.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;</code></pre><p>  <br>  </p><p></p><pre><code> &lt;ListView android:id=""@+id/android:list"" android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" /&gt; &lt;TextView android:id=""@+id/android:empty""  android:layout_width=""fill_parent"" android:layout_height=""fill_parent""  android:text=""No Contacts"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>My problem is that if I have focus on any of the header <code>ImageButton</code>s then when pressing down with the dpad the list <b>get focus on its 7th row</b> (depending on row height), <b>and not on the first row</b>. I've seen the same behavior on Fring application, under Contacts.</p><p>I tried by listening for the OnKey event for the <code>KeyEvent.KEYCODE_DPAD_DOWN</code> and triggering a implicit focus on the first item of the list, but I don't know how to do it either.</p><p>Do you have any idea on how to focus the first row of the List when getting the focus with a  KeyEvent?</p>","75928","","75928","","2010-03-16 02:23:38","2010-03-16 02:25:01","Problem when receiving focus on a list (Android)","<android>","1","0","","",""
"2329992","1","2330204","","2010-02-24 22:09:39","0","1216","<p>I see that the minimum screen diagonal size for Android is listed as 2.6"". I am looking at custom building a device with screen size 2.2"" to 2.4"" and resolution 320X240. Want to know if Android works on smaller screens. Do I need to write any display drivers to support the smaller screens? Does physical size really matter?  </p>","280740","","","","","2010-02-24 22:40:54","Android screen size","<android>","1","0","","",""
"2330496","1","2334283","","2010-02-24 23:31:15","7","3772","<p>I experienced OutOfMemory exception in my code, so I am reviewing the code.</p><p>I have a question, does View.removeAllViews() release the memory that were used by the child views that were previously added into this the parent view?</p><p>Thanks.</p>","256239","","","","","2011-06-14 00:27:44","Does View.removeAllViews() release memory?","<android>","2","0","2","",""
"2331014","1","","","2010-02-25 01:43:11","4","4138","<p>We are undertaking an Android project but need to connect to postgreSQL server which we use throughout our other projects.Any suggestions on a starting point for this?Is there anything out there (paid or unpaid) that will allow us to achieve this?</p><p>I realize that this is a pretty general question, and although we have extensive experience with writing desktop client/server apps, we have little experience with programming for mobile devices.  </p>","280836","","","","","2010-02-25 02:12:55","Android OS and postgreSQL","<android><postgresql>","3","0","","",""
"2331992","1","2332121","","2010-02-25 06:03:46","1","1054","<p>Here I update my world to include the canvas size</p><pre><code>world.getViewPort().updateViewPortSize(width,height);</code></pre><p>Is there a better way to do this?  Is there a way that I can automatically update my world object without having to manually call it in the setSurfaceSize method but instead call it from My world class?</p><p>My guess is that I can use some sort of callback, but I don't understand them!</p><pre><code>/* Callback invoked when the surface dimensions change. */public void setSurfaceSize(int width, int height) {    // synchronized to make sure these all change atomically    synchronized (mSurfaceHolder) {        mCanvasWidth = width;        mCanvasHeight = height;        world.getViewPort().updateViewPortSize(width,height);    }}</code></pre>","248521","","","","","2010-02-25 06:37:28","How to use callbacks in my own code","<android>","1","0","2","",""
"2332059","1","2334085","","2010-02-25 06:20:31","0","196","<p>I have a Android project for SDK1.5 and now I want to convert it for SDK2.1 with some constant changes for the UI. Should I create a complete new Project or the existing project can be manipulated for including the lastest changes. I'm using Eclipse for Development. </p>","92039","","","","","2010-02-25 12:58:47","Creating different Builds for the same Android Source Code","<android><porting>","1","0","","",""
"2332162","1","2334667","","2010-02-25 06:42:56","2","1914","<p>I've got a TabActivity with 4 tabs in it.  I have a service that is running - this service runs even after my TabActivity has been destroyed.</p><p>When the Service receives an event, I create a notification.  The TabActivity may, at this time, be destroyed, or just running in the background.  </p><p>How can I create a Notification/PendingIntent that will bring either launch the TabActivity if it is not currently running, or bring it to the front if it already is, and focus a specific tab based on the event?</p><p>I've thought about registering a broadcast receiver programmatically from within the TabActivity, and with this I'll be able to focus the tab, but how would I make the TabActivity the active Activity?</p>","238849","","","","","2012-01-06 01:32:56","Selecting a specific Tab in a TabActivity from a PendingIntent sent from a Notification","<android>","2","0","","",""
"2332262","1","2332336","","2010-02-25 07:05:05","0","5890","<p>I have an android app that listens for json commands over a socket.  I am wondering how I can implement this as a background service.  The service would receive the commands and depending on which commands they are, notify the user, or update data within the main program.  Some code examples would be great if anyone has them.  I've got an example of how to build a background service however it uses timers.  I'd like for socket to always be listening.</p>","280980","","","","","2011-10-18 23:40:38","How to implement a background socket listener for Android?","<java><android>","1","0","1","",""
"2332320","1","","","2010-02-25 07:20:05","0","247","<p>in my applcation i am using the map overlays when i click on overlay image it should display android Dialog from that dialogue user choose the options please help me </p><p>Thakq</p><p>Aswan</p>","1746300","","","","","2010-02-25 09:18:51","show dialogue in map overlays","<android>","1","0","","",""
"2332416","1","","","2010-02-25 07:42:51","1","1048","<p>If I have a checkable item in a Context Menu or ordianry Menu, how do I prevent the menu from closing when the item is selected?</p>","274972","","321731","","2013-12-10 17:36:07","2013-12-10 17:36:07","Prevent Context Menu from closing on clicking item (specifically checkbox item)","<android><menu><menuitem><android-context>","2","0","","",""
"2332500","1","2333128","","2010-02-25 08:07:11","2","3292","<p>Is there any API available for dictionary service for android like that of Maps, Weather,etc.?How we can have a dictionary service in android apps?</p>","2355649","","21234","","2010-02-25 08:15:26","2010-02-25 10:03:10","How can we have a dictionary service in android apps?","<android><dictionary>","1","2","","",""
"2332762","1","","","2010-02-25 09:02:48","0","2345","<p>I have written a simple app which has an 'About' screen (activity) that is shown when the user selects the 'About' item in the Options Menu from the main activity. The 'About' screen has a button named 'Close' on it. </p><p>The behaviour I want is that when the user clicks the 'Close' button, she/he should be taken to the previous activity (i.e. the activity from which the About activity was launched). For this I launch the About activity (TFTAbout) from the main activity (TFT) using <code>startActivityForResult();</code> then in <code>TFTAbout.java</code> I invoke <code>setResult()</code> and <code>finish()</code>, which should in turn invoke <code>onActivityResult()</code> in the main activity when I click 'Close'.</p><p>What actually happens is that when I click 'Close' the main activity (TFT) is not called. </p><p>From the logs it appears that the activity TFTAbout does execute <code>setResult()</code> and <code>finish()</code>. However, at this very point, onDestroy is called for the main activity. So, my guess is that since there is no launching activity to return to, <code>onActivityResult()</code> is not being called. Am I right? </p><hr><p>Please refer to Logcat output below (without timestamps for better readabiliy):</p><pre><code>DEBUG/TFT(816): onOptionsItemSelected: 'About' item selected.INFO/ActivityManager(563): Starting activity: Intent { action=android.intent.action.GET_CONTENT type=text/plain comp={com.wirel.tft/com.wirel.tft.TFTAbout} }DEBUG/TFTAbout(816): onCreate: STARTDEBUG/TFTAbout(816): onCreate: ENDINFO/ActivityManager(563): Displayed activity com.wirel.tft/.TFTAbout: 3880 msDEBUG/TFT(816): onDestroy: BEGINDEBUG/TFT(816): onDestroy: ENDDEBUG/dalvikvm(606): GC freed 672 objects / 36656 bytes in 90msDEBUG/TFTAbout(816): onClick: 'Close' button pressed... Returning to calling activity.WARN/ActivityManager(563): Activity pause timeout for HistoryRecord{4370efe0 {com.wirel.tft/com.wirel.tft.TFTAbout}}WARN/ActivityManager(563): Activity destroy timeout for HistoryRecord{4370efe0 {com.wirel.tft/com.wirel.tft.TFTAbout}}DEBUG/TFTAbout(816): onClick: Activity is finishing? true</code></pre><hr><p>Code of the lauching activity (TFT):</p><pre><code>@Overridepublic boolean onOptionsItemSelected( MenuItem mi ) {    int item_id = mi.getItemId();    switch ( item_id )    {        case R.id.mi_about:        {            Log.d( LOG_TAG, ""onOptionsItemSelected: 'About' selected."" );            /* Start the activity to display the About page. */            Intent i = new Intent( Intent.ACTION_GET_CONTENT,                                   TFTMetadata.ABOUT_TEXT_URI );            i.setType( ""text/plain"" );            startActivityForResult( i, 0 );            break;        }        .... }@Override    protected void onActivityResult        ( int request_code, int result_code, Intent i ){    Log.d( LOG_TAG, ""onActivityResult: START."" );    super.onActivityResult( request_code, result_code, i );    /* Use the request code to select between multiple child activities we may have started. Here there is only one thing we launch. */    if ( request_code == Activity.RESULT_FIRST_USER )    {        Log.d( LOG_TAG, ""onActivityResult: 'About' activity has returned."" );    }} </code></pre><p>Code of the launched activity (TFTAbout):</p><pre><code>@Overridepublic void onCreate( Bundle savedInstanceState ){    Log.d( LOG_TAG, ""onCreate: START"" );    super.onCreate( savedInstanceState );    /* Set what to do when the user presses a key but the key press is     not handled by the application. */    setDefaultKeyMode( DEFAULT_KEYS_DISABLE );    /* Connect the appropriate resource to this activity. */    setContentView( R.layout.about );    /* Define the click listener for the Close button. */    Button b = (Button) findViewById( R.id.bt_close );    b.setOnClickListener( this );      }public void onClick(View v) {    Log.d( LOG_TAG, ""onClick: 'Close' button pressed... Returning to calling activity."" );    setResult( RESULT_OK, (new Intent()).setAction(""About activity has finished!"") );    finish();    ComponentName cn = this.getCallingActivity();    if ( cn != null )    {        Log.d( LOG_TAG, ""onClick: calling activity = "" + cn.getClassName() );    }    Log.d( LOG_TAG, ""onClick: Activity is finishing? "" + String.valueOf( this.isFinishing() ) );    return;}</code></pre><p>Could somebody please explain to me why my main activity might be getting destroyed, and whether what I am doing is correct?</p>","189785","","569101","","2013-01-03 06:54:29","2014-01-09 19:12:36","onActivityResult in the main activity is not called even though the sub-activity executes setResult() and finish()","<android>","1","1","1","",""
"2332797","1","2333155","","2010-02-25 09:08:50","5","12294","<p>I have been developing my app for around two months, in the last week i have started getting the following error when trying to compile and run the app from Eclipse:</p><pre><code>java.io.IOException: Unable to upload file: No space left on device</code></pre><p>The APK comes out at 3.6Mb and the emulator is a recently created fresh one with 512Mb SD card and other specs identical to the G1.</p><p>Can anyone suggest a reason this might be happening?</p>","192065","","","","","2013-07-14 16:46:45","No space left on Android Emulator","<android><android-emulator>","6","2","2","",""
"2332847","1","","","2010-02-25 09:18:51","31","10482","<p>I want to create a customized ListView (or similar) which will behave like a closed (circular) one:</p><ol><li>scrolling down - after the last item was reached the first begins  (.., n-1, n, 1, 2, ..)</li><li>scrolling upward - after the first item was reached the last begins (.., 2, 1, n, n-1, ..)</li></ol><p>It sounds simple conceptually but, apparently, there is no straightforward approach to do this.Can anyone point me to the right solution ?Thank you !</p><p>I have already received an answer (from Streets Of Boston on Android-Developers google groups), but it sounds somehow ugly :) - </p><blockquote>  <p>I did this by creating my own  list-adapter (subclassed from  BaseAdapter).</p>    <p>I coded my own list-adapter in such a  way that its getCount() method returns  a HUUUUGE number.</p>    <p>And if item 'x' is selected, then this  item corresponds to adapter  position='adapter.getCount()/2+x'</p>    <p>And for my adapter's method  getItem(int position), i look in my  array that backs up the adapter and  fetch the item on index:      (position-getCount()/2) % myDataItems.length</p>    <p>You need to do some more 'special'  stuff to make it all work correctly,  but you get the idea.</p>    <p>In principle, it is still possible to  reach the end or the beginning of the  list, but if you set getCount() to  around a million or so, this is hard  to do :-)</p></blockquote>","281076","","1711796","","2013-09-16 18:56:10","2013-09-16 18:56:10","How to create a closed (circular) ListView?","<android><listview><customization><circular-buffer>","6","2","26","",""
"2332948","1","","","2010-02-25 09:33:37","3","5669","<p>I would like to run android emulator from cmd line - unlock it and control it. Is this possible ?</p><p>I know how to operate from eclipse?</p>","264123","","","","","2011-01-04 20:33:13","unlock android emulator from cmd line","<android><emulator>","2","2","5","",""
"2333273","1","","","2010-02-25 10:32:52","23","21857","<p>When I start my android emulator it takes some times then it will show the emulator-5554 disconnected message. Can anyone tell me what the problem is?</p>","268741","","220986","","2012-04-04 19:27:26","2014-02-21 20:39:31","Why do I get a emulator-5554 disconnected message","<android><emulator>","8","1","13","",""
"2333295","1","2333516","","2010-02-25 10:37:37","1","1826","<p>i have a custom adapter for an arraylist.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:orientation=""horizontal""&gt;    &lt;ProgressBar android:id=""@+id/downloadprogress""    style=""?android:attr/progressBarStyleHorizontal""    android:layout_width=""200dip""    android:layout_height=""wrap_content""    android:max=""100""    android:progress=""50""    android:secondaryProgress=""75"" /&gt; &lt;TextView android:id=""@+id/tripsname""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre><p>but when i try to access to the progress bar in the adapter</p><pre><code>  private class MyAdapter extends ArrayAdapter&lt;Trip&gt; {    int resource;     public MyAdapter(Context context, int resource, ArrayList&lt;Trip&gt; items) {         super(context, resource,items);         this.resource=resource;     }     @Override     public View getView(int position, View convertView, ViewGroup parent) {         LinearLayout tripListItemView;         final Trip t = getItem(position);         String name = t.getName();        boolean offline = t.isOffline() ;        if(convertView==null) {             tripListItemView = new LinearLayout(getContext());             String inflater = Context.LAYOUT_INFLATER_SERVICE;             LayoutInflater vi;             vi = (LayoutInflater)getContext().getSystemService(inflater);             vi.inflate(resource, tripListItemView, true);         }         else {             tripListItemView = (LinearLayout) convertView;         }         setProgressBarVisibility(true);        View v = findViewById(R.id.downloadprogress);        ProgressBar progressHorizontal = (ProgressBar) findViewById(R.id.downloadprogress);</code></pre><p>it always return null, like it doesn't find the progress bar. However, the progress bar is shown in the list, but i need to access to it inside the adapter.</p><p>Anybody knows the solution?</p><p>Thanks</p>","258863","","11721","","2010-06-17 14:28:52","2010-06-17 14:28:52","Android Custom Adapter with Bar Progress","<android><progress-bar><android-arrayadapter>","1","0","","",""
"2333561","1","","","2010-02-25 11:24:58","2","3852","<p>I have a front screen with a button which opens a second screen. The second screen can take a few seconds to load so I want to display a dialog while loading. My problem is the dialog does not display while loading second screen, but it displays when I return to first page from the second page. If I comment out the ""startActivity"" to open second page the dialog shows fine. I'm fairly new to android programming - I guess it has something to do with threads.</p><pre><code>//code snippet from inside onCreate:NewGame.setOnClickListener(new View.OnClickListener() {         public void onClick(View arg0) {//does not get displayed before 2nd page opens           showDialog(DIALOG2_KEY); //shows fine if next 2 lines commented out             Intent i = new Intent(screen1.this, SudukuXL.class);            startActivity(i);</code></pre><p>I've dealt with the dialog showing on returning to the front screen using onPause(). I've tried using threads to seperate the dialog from the startActivity but I've had no luck. Any help would be appreciated.</p><p>I used code from Android examples to create dialog. I include below for reference:</p><pre><code>protected Dialog onCreateDialog(int id) {   switch (id) {       case DIALOG2_KEY: {           ProgressDialog dialog = new ProgressDialog(this);           dialog.setMessage(""Loading..."");           dialog.setIndeterminate(true);           dialog.setCancelable(true);           return dialog;       }   }   return null;}</code></pre>","281165","","331473","","2011-11-26 02:42:23","2013-10-21 00:03:49","Show dialog while loading new screen","<android><dialog>","2","0","","",""
"2333680","1","","","2010-02-25 11:47:21","5","1889","<p>To make some action for some time I found that there are several choices:</p><ol><li>use AlarmManager</li><li>use ScheduledExecutorService</li><li>use Handler's method postDelayed</li></ol><p>What is big difference of all this? What is the best practice of making schedule action?</p>","263321","","","","","2010-02-25 12:11:01","Android schedule action","<android>","2","1","4","",""
"2333899","1","","","2010-02-25 12:25:49","1","753","<p></p><pre><code>&lt;RelativeLayout     xmlns:android           = ""http://schemas.android.com/apk/res/android""    android:id          = ""@+id/widget""    android:layout_width        = ""fill_parent""    android:layout_height       = ""fill_parent""     android:background      = ""@drawable/widget_background""     android:layout_gravity      = ""left""    &gt;        &lt;SeekBar            android:layout_width        = ""fill_parent""            android:layout_height       = ""wrap_content""        /&gt;&lt;/RelativeLayout&gt;</code></pre><p>I get ""Problem loading widget""Why this layout doestn't work?</p><p>02-25 15:16:20.904: WARN/ResourceType(57): Resources don't contain package for resource number 0x7f060000</p><p>02-25 15:16:21.003: WARN/ResourceType(57): Resources don't contain package for resource number 0x7f060001</p><p>02-25 15:16:21.664: WARN/ResourceType(57): Resources don't contain package for resource number 0x7f060000</p><p>02-25 15:16:21.673: WARN/ResourceType(57): Resources don't contain package for resource number 0x7f060001</p><p>02-25 15:16:21.753: WARN/ResourceType(57): Resources don't contain package for resource number 0x7f030000</p><p>02-25 15:16:32.083: WARN/AppWidgetHostView(102): Error inflating AppWidget AppWidgetProviderInfo(provider=ComponentInfo{myPackage.myApp/myPackage.myApp.MyClass}): android.view.InflateException: Binary XML file line #15: Error inflating class android.widget.SeekBar</p>","","user281183","266159","","2010-02-25 12:29:33","2012-02-04 13:40:20","Why i get errors, putting SeekBar on widget layout?","<xml><android>","1","2","","",""
"2333996","1","2334558","","2010-02-25 12:43:25","3","3506","<p>Is it possible to create a button with a custom xml layout?  </p><p>I have this layout:  </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:padding=""1dp""  android:background=""#7e7e7e""&gt; &lt;RelativeLayout   xmlns:android=""http://schemas.android.com/apk/res/android""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:padding=""10dp""   android:background=""#f9f9f9""&gt; &lt;TextView  android:id=""@+id/TextView01""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""  android:layout_alignParentLeft=""true""  android:text=""ButtText""  android:textColor=""#000000""&gt; &lt;/TextView&gt; &lt;ImageView   android:id=""@+id/ImageView01""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:background=""@drawable/arrow""  android:layout_alignParentRight=""true""&gt; &lt;/ImageView&gt; &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Now I want to use this on a button.  Anyone know how I can do this?<br>I was thinking if I had Button.java file that extended Button. And then setView(R.layout.mylayout.xml);   ...  but that was to easy, and it clearly not working  </p><p>Regards Martin  </p>","270421","","1470567","","2012-07-19 15:47:25","2012-07-19 15:47:25","Button with custom XML layout","<android><xml><button>","2","0","","",""
"2334010","1","","","2010-02-25 12:45:27","1","1206","<p>I need to filter the required information from list of data. I am really looking to use combobox for it</p><p>Does the android provide a way to make a combobox to filter the data? I have read on android developer forum that you can build custom components but I don't have any idea how does it work for combobox?</p>","257580","","","","","2013-12-15 20:40:36","Filtering data using combobox in android?","<android><combobox>","1","0","","",""
"2334244","1","2334379","","2010-02-25 13:26:09","7","4724","<p>For a Computer Science Information Warfare class a few years ago I wrote a python script that ran on libpcap promiscuous packet capture files to parse out facebook chat traffic (earlang tuples passed in clear text), and thought an interesting project would be to port the program to Android.  </p><p>I would like to rewrite it in Java but can't find any information about packet capturing directly on the handset.  </p>","279159","","166949","","2011-11-29 21:49:37","2011-11-29 21:49:37","Is there any way to put Android WIFI (droid handset) into promiscuous monitoring mode?","<android><wireless><libpcap><tcpdump>","1","1","4","",""
"2334375","1","2334433","","2010-02-25 13:51:19","0","1403","<p>when i call webservice on clicking button</p><p>it waits to load records on new activity and shows activity blank during that time period</p><p>can any one guide me how to show progress during that time period?</p><p>any help would be appriciated.</p>","249991","","","","","2010-02-25 14:00:03","how to show Progress control or gif in android?","<android><progress-bar><activity>","1","0","1","",""
"2334461","1","2334529","","2010-02-25 14:05:52","0","3700","<p>I put my sqlite database file in the ""assets"" folder And i write a DAO calss to get data from database,But the information from log.e means i can not open the database. </p><p>public class GetData {</p><pre><code> private static String DB_PATH = ""/data/data/com.SGMalls/databases/mallMapv2.sqlite"";private static SQLiteDatabase myDataBase;public static ArrayList&lt;Mall&gt; getMall(){   ArrayList&lt;Mall&gt; mallArrayList=new ArrayList&lt;Mall&gt;();    String queryString=""select id,title from malls order by title"";    myDataBase = SQLiteDatabase.openDatabase(DB_PATH,      null,SQLiteDatabase.OPEN_READONLY);    Cursor cursor=myDataBase.rawQuery(queryString, null);  if(cursor!=null){    cursor.moveToFirst();    while(!cursor.isLast()){     Mall mall=new Mall();     mall.setMallid(cursor.getInt(0));     mall.setMallname(cursor.getString(1));                mallArrayList.add(mall);cursor.moveToNext();   } } myDataBase.close(); return mallArrayList;}}</code></pre>","275788","","275788","","2010-02-25 14:12:00","2010-02-25 14:40:48","Open sqlite database failed ","<android>","2","0","0","",""
"2334465","1","2335363","","2010-02-25 14:06:40","3","3871","<p>my VoiP-client would like to block all incoming calls to the phone while my own call is taking place. Is it possible to do this somehow?</p>","249871","","","","","2012-02-06 07:19:05","Block incoming calls","<android><call>","2","0","2","",""
"2334955","1","2335628","","2010-02-25 15:02:52","2","11832","<p>In my app i have an activity from which i want to start an Service Can any body help me?</p>","281307","","48317","","2010-02-25 15:14:18","2013-07-18 11:38:15","Start a Service from activity","<android>","5","0","1","",""
"2335136","1","","","2010-02-25 15:24:27","2","376","<p>I have a separate class that includes the database, a cursor, and all the accessor methods for database information. I import the cursor into all the classes that update or use the database. However, I get a runtime error whenever I try to start an intent that uses the database. Any ideas on what might be happening?</p>","264427","","","","","2010-02-25 19:46:09","ANDROID: Accessing information from SQLiteDatabase in other classes?","<database><android><sqlite>","1","3","","",""
"2335560","1","2335800","","2010-02-25 16:16:41","1","2914","<p>I'm looking for a view that I can put on an activity that displays as a gauge, with tickmarks, and allows me to set a value to change where the needle is pointing. Just like a speedometer! </p><p>Thanks!</p>","268803","","","","","2010-06-11 21:36:20","How do I create a gauge in Android?","<android><view><activity>","1","1","","",""
"2335813","1","2336047","","2010-02-25 16:47:51","56","104774","<p>I have a layout defined in XML. It contains also: </p><pre><code>&lt;RelativeLayout    android:id=""@+id/item""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""/&gt;</code></pre><p>I would like to inflate this RelativeView with other XML layout file. I may use different layouts depending on a situation. How should I do it? I was trying different variations of </p><pre><code>RelativeLayout item = (RelativeLayout) findViewById(R.id.item);item.inflate(...)</code></pre><p>But none of them worked fine. Heeelp ;)</p>","58862","","","","","2014-03-01 11:53:41","How to inflate one view with an layout","<android>","5","0","17","",""
"2336136","1","","","2010-02-25 17:29:46","4","901","<p>I have an icon that is loaded from the app manager.  It is normally small, usually 48x48.  I save this icon and load it back later on.</p><p>Some users are reporting problems when I try to load the saved icon.  This occurs for different icons for different users and the only common denominator is that they all have phones running Android 1.5 (Sprint Hero, Sprint Moment, Droid Eris).</p><pre><code>//Returns a valid drawable 100% of the timeDrawable drawable = activityInfo.loadIcon(manager);//Creates a bitmap 100% of the timeBitmap bitmap = ((BitmapDrawable) drawable).getBitmap();//This drawable can always be displayed (so you know the bitmap is good here.Drawable testDrawable = new BitmapDrawable(bitmap);//There are no errors thrown from these lines but in ALL cases if it fails the length of the byte[] array b is 48. //When it succeeds the length is much bigger 1000+.ByteArrayOutputStream out= new ByteArrayOutputStream(); bitmap.compress(CompressFormat.PNG, 0, out);byte[] b = out.toByteArray();</code></pre><p>I can easily tell that the users icon failed to load because you cannot create a valid bitmap back from the 48 length byte array.</p><p>What can I change in the 3 lines that create my byte array to fix the problem?I have also tried, with nochange:</p><p><code>bitmap.compress(CompressFormat.PNG, 100, out); </code></p>","242904","","242904","","2010-02-25 17:35:58","2012-04-05 12:48:30","Problem on some phones when encoding a bitmap to a byte[] array","<android>","2","0","0","",""
"2336138","1","","","2010-02-25 17:29:54","-1","4108","<p>I'm compiling the android platform on my desktop.</p><p>But, i have a problem: </p><blockquote><pre><code>============================================ PLATFORM_VERSION_CODENAME=AOSPPLATFORM_VERSION=AOSPTARGET_PRODUCT=genericTARGET_BUILD_VARIANT=engTARGET_SIMULATOR=TARGET_BUILD_TYPE=releaseTARGET_ARCH=armHOST_ARCH=x86HOST_OS=linuxHOST_BUILD_TYPE=releaseBUILD_ID=MASTER============================================/bin/bash: bison: command not foundChecking build tools versions...************************************************************You are attempting to build with the incorrect version of java.Your version is: java version ""1.6.0"".The correct version is: 1.5.   Please follow the machine setup</code></pre>    <p>instructions at          <a href=""http://source.android.com/download"" rel=""nofollow"">http://source.android.com/download</a><br>      <strong><em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em></strong>      build/core/main.mk:111: *</em>* stop.  Stop.</p></blockquote><p>I don't know exactly how to compile it.</p><p>my environment is Centos5.</p><p>If it can't use java 1.6, how to be parallel between java1.6 and java1.5?</p>","213971","","114066","","2010-09-21 07:41:44","2012-12-11 21:30:42","Android platform compile problem","<android><compilation>","8","0","","2012-12-14 02:00:06",""
"2336427","1","","","2010-02-25 18:06:52","1","2857","<p>When I try to set the Alert using ArrayAdaptor to display a set of items, the list is displayed but the items' characters are invisible. If the item is selected, then the characters are visible.  Scratching my head on why.  Appreciate any advice.  Below is the code and the screenshot from the emulator. </p><pre><code>public class MessageTest extends Activity implements View.OnClickListener {         public final static String debugTag = ""MessageDemo::"";         Button alert;         Button toast;         String[] items={""item1"", ""item2"", ""item3"", ""item4"", ""item5"" };         @Override         public void onCreate(Bundle icicle) {                 super.onCreate(icicle);                 setContentView(R.layout.message);                 alert=(Button)findViewById(R.id.alert);                 alert.setOnClickListener(this);         }         public void onClick(View view) {                 if (view==alert) {                         ArrayAdapter&lt;String&gt; aa = new ArrayAdapter&lt;String&gt;(this,                                         android.R.layout.simple_list_item_single_choice, items);                         new AlertDialog.Builder(this)                                 .setTitle(""MessageTest"")                                 .setSingleChoiceItems(aa, 0, new DialogInterface.OnClickListener() {                                         public void onClick(DialogInterface dlg, int which) {                                              Log.d(MessageDemo.debugTag, ""DialogInterface.OnClickListener::onClick() is called -&gt; which = ""+which);                                         }                                 })                                 .setIcon(android.R.drawable.ic_dialog_alert)                                 .setPositiveButton(""OK"", new DialogInterface.OnClickListener() {                                         public void onClick(DialogInterface dlg, int sumthin) {                                              Log.d(MessageDemo.debugTag, ""OK button is clicked -&gt; sumthin = ""+sumthin);                                         }                                 })                                 .setNeutralButton(""Close"", new DialogInterface.OnClickListener() {                                         public void onClick(DialogInterface dlg, int sumthin) {                                              Log.d(MessageDemo.debugTag, ""Close button is clicked -&gt; sumthin = ""+sumthin);                                                 // do nothing -- it will close on its own                                         }                                 })                                 .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {                                         public void onClick(DialogInterface dlg, int sumthin) {                                              Log.d(MessageDemo.debugTag, ""Cancel button is clicked -&gt; sumthin = ""+sumthin);                                         }                                 })                                 .show();                 }         } </code></pre>","266361","","12707","","2010-02-25 18:08:31","2012-07-24 08:22:05","AlertDialog doesn't display items from ListAdapter Hide options","<android>","2","1","2","",""
"2336488","1","2337255","","2010-02-25 18:15:54","34","8103","<p>Anyone know of any good resources to get me started with test driven development on the Android platform?</p>","233613","","477415","","2012-04-04 15:54:20","2013-03-17 10:14:12","Resources for TDD on Android","<android><unit-testing><tdd><android-testing>","3","1","43","",""
"2336490","1","2336512","","2010-02-25 18:16:23","0","762","<p>I'm building a mobile website. I use regular html for the dropdown like below. If I select the dropdown on Android and click on ""Category"", it tries to submit the form. But iPhone doesn't do anything which is the desired behavior I want. I found a <a href=""http://stackoverflow.com/questions/867518/how-to-make-an-android-spinner-with-initial-text-select-one"">similar post here</a>, but I'm not building an app. Some websites use links instead of dropdown, but it's not an option for me. Any suggestion or way around it? Thanks!</p><pre><code>&lt;select onchange=""document.form.submit();""&gt;   &lt;option&gt;Category&lt;/option&gt;   &lt;option value=""1""&gt;1&lt;/option&gt;   &lt;option value=""2""&gt;2&lt;/option&gt;&lt;/select&gt;</code></pre>","10318","","12707","","2010-02-25 18:19:04","2010-02-25 18:20:14","How to prevent dropdown on Android submit form when the first value is selected","<html><android><select><form-submit>","1","0","","",""
"2336537","1","2337290","","2010-02-25 18:24:14","1","1154","<p>Hopefully the title wasn't to confusing but what I meant was the following:</p><p>Lets say activity A starts activity B by calling:</p><pre><code>Intent myIntent = new Intent(Activity_A.this, Activity_B.class);Activity_A.this.startActivity(myIntent);</code></pre><p>Could I save/free up some memory by finishing Activity_A after Activity_B is begun (if thats even possible). Maybe through the following:</p><pre><code>Intent myIntent = new Intent(Activity_A.this, Activity_B.class);Activity_A.this.startActivity(myIntent);Activity_A.finish();</code></pre><p>Or would Acitivty_A call startActivity() and wait for Activity_B to finish before it called finish()?</p><p>The idea would then be that when the users end with Activity_B, it would just restart Acitivity_A (and finish itself in a similar fashion)? Would this create too much overhead? Thanks for any answers and I apologize if the formatting of this post isn't correct.</p>","278447","","","","","2010-02-25 20:17:13","Is it possible to free up memory by finishing an activity after calling another?","<android>","2","1","1","",""
"2336866","1","","","2010-02-25 19:17:27","11","4947","<p>Short version: What is the best way to get data encoded in an MP3 (and ideally in anAAC/Ogg/WMA) into a Java array or ByteBuffer that I can thenmanipulate?</p><p>I'm putting together a program that has slowing down and speeding upsound files as one of its features.  This works fine for WAV files,which are a header plus the exact binary data that needs to be sent tothe speaker, and now I need to implement it for MP3 (ideally, thiswould also support AAC, Ogg, and WMA, but since those are less popularformats this is not required).  Android does not expose an interfaceto decode the MP3 without playing it, so I need to create thatinterface.</p><p>Three options present themselves, though I'm open to others:</p><p>1)  Write my own decoder.  I already have a functional frame detectorthat I was hoping to use for option (3), and now should only need toimplement the Huffman decoding tables.</p><p>2)  Use JLayer, or an equivalent Java library, to handle thedecoding.  I'm not entirely clear on what the license ramificationsare here.</p><p>3)  Connect to the libmedia library/MediaPlayerService.  This is whatSoundPool does, and the amount of use of that service make me believethat while it's officially unstable, that implementation isn't goinganywhere.  This means writing JNI code to connect to the service, butI'm finding that that's a deep rabbit hole.  At the surface, I'mhaving trouble with the sp&lt;> template.</p>","281519","","281519","","2010-03-02 19:56:25","2013-05-03 06:29:29","Decoding Encoded Audio Data (MP3s, etc) on Android Without Playing It","<android><audio><mp3><decoding>","2","2","5","",""
"2336910","1","","","2010-02-25 19:23:39","1","1752","<p>I am trying to implement a shoutcast client on android, but simply parsing a .pls and supplying the stream link to the android mediaplayer does not work. Can anyone please suggest a way I can go about this? If I have to implement something like a proxy server and buffer the stream data manually, can someone please describe what needs to be done?Thanks,vamsi</p>","873980","","","","","2013-08-27 13:15:16","shoutcast client on android","<android>","1","2","1","",""
"2336938","1","2338481","","2010-02-25 19:27:27","11","5705","<p>I have a custom control that is doing a lot of 2D drawing straight to the <code>canvas</code>.</p><p>Some of this drawing is text, so I am using the <a href=""http://developer.android.com/reference/android/graphics/Canvas.html#drawText%28java.lang.String,%20int,%20int,%20float,%20float,%20android.graphics.Paint%29""><code>Canvas.drawText()</code></a> method.</p><p>I want to draw the text within some bounds - a top-left, certain maximum width, and a maximum number of lines.  After drawing the text, I want to know how many lines it took.</p><p>Is there a built-in function to draw text within bounds doing the splitting sensibly?</p><p>If not, is there a standard recipe for doing so?</p>","15721","","522448","","2013-01-03 06:35:27","2013-01-03 06:35:27","Wrapping long text on an Android Canvas","<android><canvas><2d>","2","0","3","",""
"2337674","1","2348027","","2010-02-25 21:17:00","1","2019","<p>Hi i have a problem updating a progress bar. </p><p>First i have a custom adapter in which i create a row for each item with a textview and a progress bar. (i have a item_row.xml in where i define the layout for each row)</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) { .....     ProgressBar progressHorizontal = (ProgressBar)tripListItemView.findViewById(R.id.downloadprogress);        if (offline) {            progressHorizontal.setVisibility(View.VISIBLE);            progressHorizontal.setProgress(t.getDownloaded());        } else            progressHorizontal.setVisibility(View.INVISIBLE);        TextView itemName  =(TextView)tripListItemView.findViewById(R.id.tripsname);</code></pre><p>Ok, now i have a service downloading in background data from an external API, and i want when to update the progress bar every second with the progress of the download.</p><p>For that, i have a timer task made with a handler (<a href=""http://developer.android.com/intl/fr/resources/articles/timed-ui-updates.html"" rel=""nofollow"">reference</a>)</p><p>but the problem is how can i access again to the progress bars created in my adapter in order to update the progress?</p><p>Thanks</p>","258863","","","","","2010-02-27 16:25:28","Android Update a Progress Bar which is set inside custom ArrayAdapter","<android><progress-bar><android-arrayadapter>","1","0","","",""
"2337739","1","2337929","","2010-02-25 21:26:24","2","2183","<p>I need help coming up with a way of executing the following sequence using some type of view or layout combination in Android:</p><p>I have 3 image objects... say object A, B, and C...</p><p>[all objects invisible and layered, one on top of the other... A/B/C, like in a RelativeLayout]-->[fade in object A]-->[display A for 200ms]-->[simultaneously fade out object A and fade in object B]-->[display object B for 200ms]-->[simultaneously fade out object B and fade in object C]-->[object C remains on the screen indefinitely]</p><p>I have tried every combination of Threads, AsyncTasks, Handlers, custom layouts, AnimationListeners, etc. but everything I've tried has failed.</p><p>If only the ViewSwitcher could take more than 2 views... Please help.</p><p>Ryan</p>","272302","","272302","","2010-02-25 22:55:49","2010-02-26 00:06:46","Android -- How to switch views with 3 ImageViews?","<java><android><multithreading>","2","0","1","",""
"2337874","1","5266194","","2010-02-25 21:43:47","147","102707","<p>When adding an activity to an existing Android project, I manually create a new class - is that the best / preferred way? How do others handle that?</p>","246793","","844882","","2012-07-02 03:59:14","2013-11-03 08:38:27","Best way to add Activity to an Android project in Eclipse?","<android><eclipse><ide><android-activity>","8","1","59","",""
"2337887","1","2338173","","2010-02-25 21:45:53","1","3308","<p>What's the best way to record a video showing things running on the Android Emulator? I want to record little demo videos of stuff running so I can put it on YouTube.</p><p>I'm running the emulator on either Windows or a Mac.</p>","18854","","","Roger Pate","2010-03-30 20:11:19","2010-03-30 20:11:19","How can I record a video of the Android Emulator running?","<android><youtube><android-emulator><video-capture>","5","1","","",""
"2338046","1","","","2010-02-25 22:09:10","0","267","<p>I know you can apply Permissions for Applications on it's manifest.xml file. What I want to know is, can those Permissions be adjusted by the Applications on the fly?</p><p>Here's my reason: say I have an application that is allowed to do ""x"", ""y"", and ""z"" (SMS, sockets, etc) Permissions. Now lets say I have a logical ""user"" that connects to this Application, and I want that user to only be able to do ""x"" and ""y"", but not ""z"" Permissions. It would be nice to have the Android Framework handle that instead of having a bunch of ""if's"" in the App code...</p><p>Thanks!</p>","281643","","","","","2011-01-28 07:06:24","Adjusting Application ""Permissions"" realtime","<android>","2","0","","",""
"2338164","1","","","2010-02-25 22:29:25","2","1342","<p>When I try to edit project/res/main.xml using android layout editor in eclipse Iget the error ""Could not initialize class java.awt.font"".</p><p>I don't know, how to get rid of this.</p><p>Thanks for any help.</p>","281653","","","","","2012-12-08 21:34:29","class java.awt.Font error - Android","<android>","3","1","","",""
"2338888","1","2338999","","2010-02-26 01:15:02","2","1323","<p>anybody knows what can be the reason for when i start a service from an Activity, the emulator shows a message ""the activity is not responding?""</p><p>Inside my Service i start 2 threads in order to make some tasks. can be this the cause of the problem?</p><p>Thanks</p>","258863","","881229","","2014-01-22 02:18:48","2014-01-22 02:18:48","Android Service makes Activity not responding","<android>","1","0","","",""
"2338980","1","","","2010-02-26 01:41:16","1","961","<p>Running vista when I execute adb nodaemon server with ADB_TRACE=ALL it shows that adb can't bind to port 5037. Any suggestions what the problem is or where to investigate would be appreciated. </p>","278147","","","","","2011-02-25 19:11:47","Can't start adb","<android><adb>","1","0","","",""
"2339429","1","4618030","","2010-02-26 04:06:27","40","22764","<p>Would anyone please try to explain to me why</p><pre><code>public void addView(View child) {  child.setDrawingCacheEnabled(true);  child.setWillNotCacheDrawing(false);  child.setWillNotDraw(false);  child.buildDrawingCache();  if(child.getDrawingCache() == null) { //TODO Make this work!    Log.w(""View"", ""View child's drawing cache is null"");  }  setImageBitmap(child.getDrawingCache()); //TODO MAKE THIS WORK!!!}</code></pre><p>ALWAYS logs that the drawing cache is null, and sets the bitmap to null?</p><p>Do I have to actually draw the view before the cache is set?</p><p>Thanks!</p>","251370","","251370","","2010-02-26 08:29:28","2013-05-15 21:42:21","Android View.getDrawingCache returns null, only null","<android><caching><view>","3","0","21","",""
"2339632","1","2340875","","2010-02-26 05:13:06","0","3256","<p>I would like to get a list of Contacts Groups already defined in the system, how can I do that?</p>","243782","","243782","","2010-03-22 10:46:50","2010-03-22 10:46:50","How to get the defined Contact Groups on an Android?","<android><contacts>","1","0","1","",""
"2339677","1","2339770","","2010-02-26 05:30:46","1","151","<p>There are a few other threads that are similar, but I can't seem to find a difinitive answer, so I apologize if this seems a little repetetive.</p><p>Here's my situation.</p><p>My Android app compiles and runs under 1.5I want to use supports-screen in my Manifest.This means I have to compile with 1.6 in Eclipse or I get errorsI set the minSDK to 3 and the targetSDK to 4</p><p>Now, my question is, if I compile against 1.6 with the min/target sdk's as shown above, will the app show up in the Market Place for users of 1.5 phones AND will it run on 1.5 phones because of the minSDK setting even though I had to compile with 1.6?</p><p>Or, do I HAVE to compile with 1.5 for it to run on 1.5+ phones?</p><p>Thank you again.</p>","179518","","","","","2010-02-26 05:58:59","Which Android API to distribute app under","<android><api>","1","0","1","",""
"2339821","1","2340434","","2010-02-26 06:14:54","4","2042","<p>I've checked the NotesDbAdapter example, and I noticed that is for a single table only. (notes)  </p><p>1) I am wondering how would this be done for multiple tables?For example I have 3 tables for now. How would I handle all the upgrade, fetch, delete from these three tables?</p><p>2) I see defined properties for the table columns</p><pre><code>public static final String KEY_TITLE = ""title"";public static final String KEY_BODY = ""body"";public static final String KEY_ROWID = ""_id"";</code></pre><p>How would you define the columns for a multiple table situation?</p>","243782","","","","","2010-02-26 08:58:40","NotesDbAdapter example is for one table, how about multiple tables?","<android><sqlite>","1","0","2","",""
"2339983","1","","","2010-02-26 07:02:42","0","908","<p>I want to know if we can create builds using ant's build.xml and when i'm trying to do this an error is displayed SDK location not mentioned and besides that I'm unable to find local.properties file to mention the SDK Location</p><p>My aim is that I want to use my exiting code and make a build for new Android SDK's with changes in the resources and and some constant values is this task Possible with making a build using Ant and if by some other way.</p><p>I have no idea about Ant and its functioning so it would very appreciable if minute details are also provided.</p>","92039","","","","","2010-03-31 01:21:01","Working with android and ant scripts for building applications","<android><porting>","2","0","","",""
"2340074","1","2340202","","2010-02-26 07:27:36","1","1208","<p>How do I know when the date has been changed in a DatePicker widget? OnClick does not fire and there are no other useful events.</p>","274972","","","","","2011-09-13 18:16:12","DatePicker Widget (NOT Dialog) OnDateSet / OnClick event?","<android><dialog><datepicker><widget>","2","0","","",""
"2340446","1","","","2010-02-26 09:02:33","0","2414","<p>I have built a website for mobile webkit browsers, there is an interval update to refresh data. But it turns out that the pooling refresh will stop at some time after run for a while (some minutes or hours, different by each time).</p><p>I thought there may be something error occurred in my refresh data functions, but it works well in my laptop browser. I also tried to listen window.onerror event, but webkit browser seems do not support that event. What else can I do?</p><p>And I am also doubting is there any problem with setTimeout and setInterval functions in mobile webkit browser?</p>","238061","","","","","2010-02-26 10:02:03","Is there anyway to get javascript error on android or iphone mobile webkit browser?","<iphone><android><mobile><webkit>","1","0","","",""
"2340647","1","2341465","","2010-02-26 09:41:37","11","19601","<p>I was just trying out with table layout to display some data....The data is a 3 column data and i want that the columns should utilize the whole width available. But it seems that the layout XML code which i had used is just wrapping up the columns according to the content.</p><p>Layout XML code  </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;       &lt;TableRow        android:layout_width=""fill_parent""&gt;        &lt;TextView            android:padding=""3dip""            android:gravity=""left""            android:text=""Name""            /&gt;        &lt;TextView            android:padding=""3dip""            android:gravity=""left""            android:text=""Address""            /&gt;        &lt;TextView            android:padding=""3dip""            android:gravity=""left""            android:text=""Age""            /&gt;      &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","273548","","273548","","2010-02-26 10:35:58","2013-08-19 06:35:25","how to make columns in table layout spread evenly making maximum use of space available","<android><android-widget>","2","0","3","",""
"2340838","1","2342462","","2010-02-26 10:20:02","1","9099","<p>as above, is it done automatically? My list was empty once the orientation chMYanges? and nope, i need the orientation change =)</p><p>My adapter</p><pre><code>public class ResultsAdapter extends ArrayAdapter&lt;SearchItem&gt; implements Filterable{private ArrayList&lt;SearchItem&gt; subItems;private ArrayList&lt;SearchItem&gt; allItems;// = new ArrayList&lt;SearchItem&gt;();private LayoutInflater inflater;private PTypeFilter filter;private OnCheckedChangeListener test;public ResultsAdapter(Context context, int textViewResourceId, ArrayList&lt;SearchItem&gt; items,OnCheckedChangeListener a) {    super(context, textViewResourceId, items);        //this.subItems = items;        for( int i = 0;i &lt; items.size();i++){            subItems.add(items.get(i));        }        this.allItems = this.subItems;        inflater= LayoutInflater.from(context);        test = a;}</code></pre><p>My onCreate</p><pre><code>    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);            ListView lvr = (ListView)findViewById(R.id.search_results);  //  if(savedInstanceState == null){        this.m_adapter = new ResultsAdapter(home.this, R.layout.listrow, sResultsArr,home.this);        this.specsAdapter = new FeaturesExpandableAdapter(home.this,new ArrayList&lt;String&gt;(),new ArrayList&lt;ArrayList&lt;Feature&gt;&gt;());    // }        lvr.setAdapter(this.m_adapter);</code></pre><p>thanks guys</p>","281931","","615004","","2011-11-09 13:53:08","2013-08-20 09:32:23","android: how do i preserve the data in my arrayadapter/listview when change orientation?","<android><listview><orientation><listadapter>","5","2","3","",""
"2340920","1","","","2010-02-26 10:34:02","-1","62","<p>I am new in android. I dont know to list items in android? Can anyone help me with this?</p>","244540","","491044","","2011-03-17 08:53:50","2011-03-17 08:53:50","can help me to solve ListView?","<android>","1","1","","2013-03-04 13:27:47",""
"2340980","1","2341024","","2010-02-26 10:47:16","6","1852","<p>I have my Emulator open, and using Command Prompt I remove my application. I didn't closed the Emulator.</p><p>Then I go to Eclipse and hit Debug, but doesn't deploy the apk to the emulator, just tells me the package not yet registered with the system.</p><p><code>New package not yet registered with the system. Waiting 3 seconds before next attempt.</code></p><p>Restarting the emulator is not an option, as that takes 10-15 minutes. </p><p>What I am doing wrong?</p>","243782","","243782","","2010-02-26 10:53:05","2013-04-24 12:25:58","After I remove the apk, whenever I start Debug it tells me the package is not installed","<android><eclipse><emulator>","6","1","1","",""
"2341114","1","","","2010-02-26 11:12:37","0","2756","<p>I have a webview and a table containing 4 buttons. I have set the height of the webview to 400px, so that the buttons are displayed at the bottom of the screen, in portrait mode. My problem is, when changed to landscape mode the buttons are not visible. So I need to change the height of the webview on runtime, when orientation is changed. Do anybody know how to achieve this? I am able to capture the orientation change, using 'onConfigurationChanged' function.</p><hr><p>Thanks CommonsWare, I gave the xml as follows. The application crashes on launch.</p><pre><code>&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;&lt;RelativeLayout android:layout_alignParentTop=""true""&gt;&lt;WebView    android:id=""@+id/appView""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent"" /&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout    android:layout_alignParentBottom=""true""&gt;&lt;TableLayout    android:id=""@+id/TableLayout01""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:gravity=""center_vertical""&gt;&lt;TableRow    android:id=""@+id/TableRow01""     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center""&gt;&lt;ImageButton    android:id=""@+id/more""    android:padding=""1dip""    android:src=""@drawable/more1""    android:layout_marginRight=""15dip""&gt;&lt;/ImageButton&gt;&lt;ImageButton    android:id=""@+id/albums""    android:padding=""1dip""    android:src=""@drawable/albums1""    android:layout_marginRight=""15dip""&gt;&lt;/ImageButton&gt;&lt;ImageButton    android:id=""@+id/videos""    android:padding=""1dip""    android:src=""@drawable/videos""    android:layout_marginRight=""15dip""&gt;&lt;/ImageButton&gt;&lt;ImageButton    android:id=""@+id/artists""    android:padding=""1dip""    android:src=""@drawable/artists1""    android:layout_marginRight=""15dip""&gt;&lt;/ImageButton&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre>","281958","","13075","","2012-11-16 09:28:36","2012-11-16 09:28:36","How to change the height of a webview on Runtime?","<android><resize><webview>","1","0","","",""
"2341153","1","","","2010-02-26 11:20:13","2","1304","<p>I'm very new (second day!) to android and working my way through the dev guide. There, it says that you can reference attributes inside the current theme from your XML by using the form ""?..."", for example</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;EditText id=""text""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:textColor=""?android:textDisabledColor""    android:text=""@string/hello_world"" /&gt;</code></pre><p>If I try to build this, I just get ""No resource found that matches the given name (at 'textColor' with value '?android:textDisabledColor')</p><p>Given that this seems pretty basic stuff, and yet I can't find any references to similar problems elsewhere, I must be missing something obvious or misunderstanding something simple. Can anyone tell me what it is?</p>","281960","","","","","2011-01-30 19:04:19","Can't get theme attribute references to work in android","<android><themes>","2","0","","",""
"2341903","1","","","2010-02-26 13:30:24","1","1666","<p>I have an Android Sdk Add-on that I want to publish on a site and make it possible to download via Android SDK and AVD Manager. Anyone who knows if there is a tool to generate the repository.xml file or do I have to edit it myself? </p><p>BR</p>","255867","","","","","2010-02-26 13:30:24","Android Add-on site edit repository.xml","<android>","0","0","","",""
"2342312","1","2343645","","2010-02-26 14:38:58","1","889","<p>When i populate an ArrayAdapter, at first the rows in the visible part of the screen will be blank except the first row, which will be an undesired result. Then when I scroll it down and then come back all the screen will be set correctly...please some one tell me why this behavior happens ?</p><p>Code :</p><pre><code>        homeListView = (ListView) findViewById(R.id.home_list);        homeArrayAdapter = new HomeListArrayAdapter(this, R.id.home_list,                homeList);        homeListView.setAdapter(homeArrayAdapter);</code></pre><p>Next Part as Class extending ArrayAdapter, an Inner Class to Activity:</p><pre><code>    public View getView(int position, View convertView, ViewGroup parent) {        View view = convertView;        if (view == null) {            LayoutInflater inflater = (LayoutInflater) context                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);            view = inflater.inflate(R.layout.home, null);        }        Home item = (homeList).get(position);        if (item != null) {            if (item.type_text == Home.SIMPLE_SHOUT) {                TextView tv1 = (TextView) findViewById(R.id.hTextView01);                if (tv1 != null) {                    tv1                            .setText(String.format(""   %s\t:"",                                    item.friend_name));                    final String item_friend_id_01 = String                            .valueOf(item.users_id);                    tv1.setOnClickListener(new OnClickListener() {                        @Override                        public void onClick(View v) {                            Toast toast = Toast.makeText(Tranz.this,                                    item_friend_id_01, Toast.LENGTH_LONG);                            toast.show();                        }                    });                }                TextView tv2 = (TextView) findViewById(R.id.hTextView02);                if (tv2 != null) {                    tv2.setText(String.format(""\t%s"", item.message));                    tv2.setOnClickListener(new OnClickListener() {                        @Override                        public void onClick(View v) {                        }                    });                }                TextView tv3 = (TextView) findViewById(R.id.hTextView03);                if (tv3 != null) {                    tv3.setVisibility(0);                    tv3.setText(null);                    tv3.setOnClickListener(new OnClickListener() {                        @Override                        public void onClick(View v) {                        }                    });                }                ImageView imageView = (ImageView) findViewById(R.id.file_image);                if (imageView != null) {                    imageView.setBackgroundDrawable(null);                }            } else if (item.type_text == Home.FILE_SHOUT) {                TextView tv1 = (TextView) findViewById(R.id.hTextView01);</code></pre><p>The code is getting truncated, so the whole code is not appearing here. I'm sorry about that. Here what i have tried is to put the values in the object of class Home into two textViews and an ImageView, which may vary upon the value returned by variable item.type_text</p><p>Also if somebody can tell me another best practice to do this, please help.</p>","132347","","","","","2012-05-02 06:48:29","Android: Why ArrayAdapter Displays null at first?","<java><android><arrays><arraylist>","2","0","","",""
"2342346","1","2342976","","2010-02-26 14:43:55","8","19520","<p>I open a sqlite database and use rawquery to get data. </p><p>But the log.e show the information:</p><blockquote>  <p>android.database.sqlite.SQLiteException: no such table: types: </p></blockquote><p>But, I really have this table. </p><p>And i also try to use the other sql ,But also get the error message such as </p><blockquote>  <p>android.database.sqlite.SQLiteException: no such table: malls:</p></blockquote><p>I am sure there are this two tables.So why get the error message?</p>","275788","","23199","","2011-07-24 00:50:12","2013-05-10 18:15:16","problem about sqlite database, no such table: ","<android><sqlite>","6","6","1","",""
"2342513","1","2425437","","2010-02-26 15:06:43","3","3315","<p>I currently start a Ringtone on Android and it plays fine.</p><p>However when I try to stop the ringtone it doesn't stop or atleast doesn't stop straight away, it will keep in playing until it just plays out.</p><p>Here is how I set up the Ringtone:</p><pre><code>int rm = audio_service.getRingerMode();int vs = audio_service.getVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER);android.os.Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);if ((rm == AudioManager.RINGER_MODE_VIBRATE ||    (rm == AudioManager.RINGER_MODE_NORMAL &amp;&amp; vs == AudioManager.VIBRATE_SETTING_ON)))            v.vibrate(vibratePattern,1);if (audio_service.getStreamVolume(AudioManager.STREAM_RING) &gt; 0) {                              oRingtone = RingtoneManager.getRingtone(this, Settings.System.DEFAULT_RINGTONE_URI);    oRingtone.setStreamType(AudioManager.STREAM_RING);    oRingtone.play();           }</code></pre><hr><p>And here is how I try to stop it</p><pre><code>if (CallDialogActivity.oRingtone != null) {      Log.d(""RINGTONE"", ""Into Ringtone if"");      Ringtone ringtone = CallDialogActivity.oRingtone;      oRingtone = null;      ringtone.stop();}</code></pre><p>Has anyone come across similiar problems or see any mistakes in my code?</p><p>EDIT:</p><p>Just to add I have added logging to see if ringtone.isPlaying() returns true or false after I call ringtone.stop() and it returns false, however the tone keeps playing for a couple of seconds (3 - 5 seconds) after before stopping </p>","243999","","243999","","2010-02-26 15:55:12","2010-03-11 13:58:21","Android - Ringtone wont stop playing","<java><android><audio><ringtone>","1","1","1","",""
"2342620","1","2342856","","2010-02-26 15:22:41","14","48517","<p>I have a <code>TextView</code> and button aligned to parent's bottom.</p><p>When I enter text in it and press the button to save data, the virtual keyboard does not disappear.</p><p>Can any one guide me how to hide the keyboard?</p>","249991","","592025","","2011-11-30 08:39:33","2014-02-11 19:44:23","how to hide keyboard after typing in EditText in android?","<android><edittext>","6","0","6","",""
"2342691","1","2343398","","2010-02-26 15:32:12","0","797","<p>friends,</p><p>i am using following layout and tring to enter text and then saving the data but facing one problem when i click on EditText to type something.</p><p>keyboard appears and covers half of layout of EditText and button.but when i type in it it shows completely.before typing in it keyboard covers half of Edittext layout.</p><p>can any one guide me how to show whole textbox with button after appearence of keyboard?</p><p>any help would be appriciated.</p><pre><code>&lt;LinearLayout android:layout_width=""fill_parent"" android:id=""@+id/LayoutReply""          android:layout_height=""wrap_content""          android:background=""#ffcc33""           android:layout_alignParentBottom=""true""                 android:paddingBottom=""50px""                  android:orientation=""horizontal""  &gt;    &lt;EditText          android:id=""@+id/txtMessage""        android:hint=""Please enter text to reply!""         android:layout_width=""wrap_content""         android:maxLength=""160""        android:layout_height=""wrap_content""        &gt;&lt;/EditText&gt;    &lt;Button android:layout_height=""wrap_content"" android:id=""@+id/btnPostReply""        android:layout_width=""wrap_content""        android:text=""@string/Message_Reply""&gt;&lt;/Button&gt;    &lt;/LinearLayout&gt;</code></pre>","249991","","","","","2013-09-16 09:14:11","how to show full EditText after appearing Keyboad in android?","<android><layout>","3","0","","",""
"2342804","1","2342948","","2010-02-26 15:49:18","0","1288","<p><strong>Problem 1.</strong></p><p>I have this class:</p><pre><code>public class ContactGroups {    // Form an array specifying which columns to return.    String[] projection = new String[] { Contacts.Groups._ID,            Contacts.Groups._COUNT, Contacts.Groups.NAME, Contacts.Groups.NOTES };    public Cursor getList(Activity act) {        Uri contacts = Contacts.Groups.CONTENT_URI;             // using the debugger code kills here            Cursor managedCursor = act.managedQuery(contacts, projection,                 null,                 null              , null                );        return managedCursor;    }    public ArrayList&lt;String&gt; getColumnData(Cursor cur) {        ArrayList&lt;String&gt; aa = new ArrayList&lt;String&gt;();        if (cur.moveToFirst()) {            String name;            String notes;            int nameColumn = cur.getColumnIndex(Contacts.Groups.NAME);            int notesColumn = cur.getColumnIndex(Contacts.Groups.NOTES);            do {                // Get the field values                name = cur.getString(nameColumn);                notes = cur.getString(notesColumn);                aa.add(name);                // Do something with the values.            } while (cur.moveToNext());        }        return aa;    }}</code></pre><p>I am calling this as:</p><pre><code>ContactGroups mGrp= new ContactGroups();final ArrayAdapter&lt;String&gt; aa;aa = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,mGrp.getColumnData(mGrp.getList(this)));myListView.setAdapter(aa);</code></pre><p>And having:</p><pre><code>&lt;uses-permission android:name=""android.permission.READ_CONTACTS""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.WRITE_CONTACTS""&gt;&lt;/uses-permission&gt;</code></pre><p>I get a Source not found errorand a Logcat error </p><p><code>ERROR/DatabaseUtils(617): java.lang.IllegalArgumentException: Invalid column _count</code></p><p>Does somebody know why?</p><p><strong>Problem 2.</strong></p><p>Where do I create manually contact groups?</p>","243782","","243782","","2010-02-26 16:02:21","2010-02-26 16:09:53","Invalid column _count when using Contacts.Groups._COUNT to get Contacts Groups?","<java><android><contacts><android-sdk-1.6>","1","0","","",""
"2342931","1","2343090","","2010-02-26 16:07:18","6","8825","<p>So Ive been trying to add a button underneath a listview in android, the problem is that the button does not appear. </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout    android:id=""@+id/widget0""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;ListView        android:id=""@+id/messagelist""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_x=""0px""        android:layout_y=""0px""&gt;    &lt;/ListView&gt;    &lt;Button        android:id=""@+id/addbutton""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Button""        android:layout_x=""0px""        android:layout_y=""379px""&gt;    &lt;/Button&gt;&lt;/AbsoluteLayout&gt;</code></pre>","282174","","","","","2010-11-09 00:41:44","Adding a button underneath a listview on android","<android><listview>","2","2","2","",""
"2342954","1","2343626","","2010-02-26 16:10:20","1","1100","<p>I'm building an application for android which collects user data.</p><p>Also I'm going to build a website which will use that data where users can have an account and synchronize data with phone and website (I guess it's quite common setup).Site will be using MySQL database, but I want it to be database independent using some kind of API.I think I'm going to use Python for website (Django).</p><p>Since I haven't started whole synchronization part yet I have a question on how to do it best.Which protocol to use - JSON, SOAP, XML (any other)? Which is best supported in android?</p><p>What are the best practices in doing such a thing?</p><p>Leonti</p>","219449","","","","","2010-02-26 17:47:45","Data exchange with remote server in Android","<android><django><website>","1","0","","",""
"2343263","1","2343964","","2010-02-26 16:53:56","0","325","<p>I'm looking to have an app that calls a web service, and the return from that WS would specify a specific puzzle to play (sudoku, arithmetic, logic, problem solving, memory, etc).</p><p>I think that each puzzle should be its own Activity, but I don't know if they should be nested in my main app Activity, separate Activities, or something else.</p><p>At some point I'd like these puzzle activities to include OpenGL graphics, but for now just simple layout driven Activities should suit me well.</p><p>Thanks in advance!</p>","231768","","","","","2010-02-26 18:37:27","How would I have a dynamic Activity based on Web Service input?","<android><dynamic><activity>","1","0","","",""
"2343276","1","2343564","","2010-02-26 16:54:57","1","2207","<p>Problem when trying to get <strong>Contracts Group</strong></p><pre><code>Uri contacts = ContactsContract.AUTHORITY_URI;  //Log.v(""23"",contacts.toString());  // Make the query.  Cursor managedCursor = act.managedQuery(contacts, projection, // Which    // columns    // to    // return    null, // Which rows to return (all rows)    null // Selection arguments (none)    // Put the results in ascending order by name    , ContactsContract.Groups.TITLE + "" ASC""    );</code></pre><p>Having:</p><pre><code>&lt;uses-permission android:name=""android.permission.READ_CONTACTS""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.WRITE_CONTACTS""&gt;&lt;/uses-permission&gt;</code></pre><p>I get <code>ERROR/DatabaseUtils(198): java.lang.IllegalArgumentException: Unknown URL content://com.android.contacts</code></p>","243782","","243782","","2010-02-26 19:13:12","2010-02-26 19:13:12","Problem when trying to get Contracts Group ~ Unknown URL content://com.android.contacts","<android><android-sdk-2.1>","2","0","","",""
"2343604","1","","","2010-02-26 17:43:28","0","917","<p>hey , I want to cache google maps, and put them into the memory, using sqlite DB,so that I don't have to always use the internet connection! is that possible? and if it is possible I would like to know how? thanks </p>","282244","","","","","2010-02-26 18:01:30","how to save cached data to sqlite DB (android)","<android><sqlite><caching>","1","0","","",""
"2343609","1","2344921","","2010-02-26 17:44:06","1","1021","<p>I've got a LinearLayout with a bunch of buttons on it.  This panel is always hidden unless a menu item is chosen.  </p><p>When the LinearLayout is shown, I want to detect if the user clicks anywhere outside of the panel so that I can hide it again.  Is there a way to do this, maybe with detecting focus changes?  </p><p>I've tried to add an OnFocusChangeListener to the LinearLayout itself (and called setFocusable(true) on it), but the focus change listener never gets called.  Furthermore, I'd have to be able to detect if the LinearLayout or any of its children lose focus.</p>","238849","","82118","","2010-05-27 22:13:10","2010-05-27 22:13:10","How can I detect if someone clicks outside of a specific LinearLayout","<android>","1","0","","",""
"2343694","1","2343736","","2010-02-26 17:58:42","2","662","<p>I have a png and a jpg image on disk. I'd like to use any built-in intent (if any are available) to view the image (just a single one at a time). Something like this:</p><pre><code>Intent intent = new Intent();intent.setImagePath(""/blah/myimage.jpg"");startActivity(intent);</code></pre><p>is there a built-in intent in android to do this, or do I have to write my own image viewing-activity? It would be cool if there was one that had panning/zooming as found in WebView,</p><p>Thanks</p>","246114","","","","","2010-02-26 18:05:31","Any intents to show a single image with zooming/panning?","<android>","1","0","1","",""
"2343884","1","2343991","","2010-02-26 18:26:22","8","4804","<p>1) I launch a background task (via AsyncTask)</p><pre><code>new FindJourneyTask().execute(); // FindJourneyTask extends AsyncTask</code></pre><p>2) Still in the main thread (just before new thread is launched) I create a dialog with showDialog(dialogId)</p><pre><code>// this method is in FindJourneyTaskprotected void onPreExecute() {    showDialog(DIALOG_FINDING_JOURNEY);}</code></pre><p>3) Screen orientation changes and the Activity is recreated</p><p>4) How can I now dismiss the dialog from the FindJourneyTask? Calling dismissDialog(dialogId) does nothing.</p><pre><code>// this method is in FindJourneyTaskprotected void onPostExecute(FindJourneyResult result) {    dismissDialog(DIALOG_FINDING_JOURNEY); // does nothing}</code></pre>","243225","","243225","","2010-02-26 18:46:18","2011-11-21 12:45:42","Dismiss dialog after screen orientation change","<android>","2","1","6","",""
"2344082","1","2344504","","2010-02-26 18:56:53","3","1057","<p>I downloaded a jpg from the net, I'd like to save it to disk then load it again. I'm trying something like this:</p><pre><code>Bitmap bmp = ...; // loaded from net.File file = new File(Environment.getExternalStorageDirectory(), ""tmp.jpg"");OutputStream out = getContentResolver().openOutputStream(Uri.parse(file.getAbsolutePath())); bmp.compress(Bitmap.CompressFormat.JPEG, 70, out); out.flush();out.close();...File f2 = new File(Environment.getExternalStorageDirectory(), ""tmp.jpg"");Uri uri = Uri.fromFile(f2);</code></pre><p>but I keep getting an error on the second line when trying to create the new File() instance:</p><p>java.io.FileNotFoundException: No content provider: /sdcard/tmp.jpg</p><p>I'm using a 2.0 emulator and it has an sdcard. What am I doing wrong?</p><p>Thanks</p>","246114","","","","","2012-06-14 16:35:10","Reading and writing a file","<android>","2","0","","",""
"2344186","1","2344695","","2010-02-26 19:16:23","0","1934","<p>I want to define some Contact Groups.</p><p>I am wondering where and how does Android store the groups. Maybe in a Sqlite database?<br>If so, will be able to run a insert on it?</p><p>Otherwise how do you add new Contacts Group via the emulator?</p>","243782","","","","","2013-09-20 20:44:55","How to add manually contacts group to Android database?","<database><android><emulator><contacts><android-sdk-2.1>","2","0","","",""
"2344768","1","2470723","","2010-02-26 20:53:24","1","4936","<p>I'm writing an Android app where users can upload video to Youtube. I'd like the Youtube tag field to be pre-filled with a tag that I set. </p><p>I'd also like the UI to work like this: user clicks on an Upload button, user goes straight to Youtube upload intent (rather than picking from a Chooser), tag field is pre-filled for them.</p><p>Is this possible using ACTION_SENDTO?</p><p>Currently I have this code, which just launches a Chooser, which really isn't what I want:</p><pre><code>    btnUpload.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            //uploadToYouTube();            //videoUpload();            Intent intent = new Intent();            intent.setAction(Intent.ACTION_SEND);            intent.setType(""video/3gpp"");            intent.putExtra(Intent.EXTRA_STREAM, videoURI);            try {                         startActivity(Intent.createChooser(intent,                                 ""Upload video via:""));            } catch (android.content.ActivityNotFoundException ex) {                         Toast.makeText(Recorder.this, ""No way to share!"",                                 Toast.LENGTH_SHORT).show();            }        }    });</code></pre>","267831","","","","","2012-01-20 10:39:39","Android: Youtube and ACTION_SENDTO?","<android>","4","0","1","",""
"2345398","1","2345416","","2010-02-26 22:54:05","0","1214","<p>I have three separate applications A, B and C.  All of them use service S.  When A, B or C connect to service S and service S must start, it must gather credentials from the user using form F.  </p><p>I want the user experience to go like this:</p><ol><li>From the Android main menu, the user taps one of the applications; A, B or C.</li><li>Form F appears because the service has not been started.  </li><li>The user fills in form F and taps OK.</li><li>Validation occurs.</li><li>If validation of credentials is successful, then the appropriate Activity in the selected app (A, B or C) appears.</li><li>After a successful validation, any subsequent applications that start do not need to authenticate, they'll just start with an Activity in that app.</li><li>If the validation is unsuccessful and the user presses the back button, the main menu appears again.</li></ol><p>Given all of this, what I believe I want is for the Service to start the credentials form when necessary -- can a Service do this?  If not, what would be an alternative way to implement this?</p>","9648","","9648","","2010-02-26 22:59:20","2011-03-17 08:35:04","Android Service - Can it pop an Activity?","<android><android-service>","2","0","","",""
"2345471","1","","","2010-02-26 23:13:32","2","1551","<p>I'm writing an Android game that needs to receive touch events. My problem is that, whenever the user drags their finger along the screen, so many touch events get sent to the touch event handler (which I think runs as a separate thread) that my frame rate plummets! What's the best way I can limit the number of touch events that are handled per second?</p><p>For example, if my game runs at 60 fps, I really shouldn't need more than 1 touch event being handled every second. Can I do this is a way that doesn't lose any information (i.e. important information about where on the screen the user touched last)?</p>","279296","","","","","2010-02-27 05:53:34","Excessive number of touch events slows down Android app","<java><android><programming-languages>","2","1","","",""
"2345476","1","","","2010-02-26 23:15:18","1","744","<p>is a good practice to have an Asynk task with a loop like this inside?</p><pre><code>while (true) { check queue and request API</code></pre><p>Because i need to wait for my Activities and service needs to comunicate with the APi.</p><p>Thanks</p>","258863","","","","","2010-02-27 00:39:48","Android Asynk Task","<android><android-asynctask>","2","0","1","",""
"2345531","1","2345727","","2010-02-26 23:34:34","7","3833","<p>The Contacts app shows a button on the side of the screen that acts as a little thumb to allow you to quickly scroll the big list. I have a very long list that would benefit from this navigation behavior, but can't find any documentation as to how to enable it. </p><p>Is it a behavior that's built into the SDK, or must I write it myself?</p>","457","","","","","2010-02-27 00:36:16","Android ListView alpha scroller for quickly scrolling long list","<android><listview><scrolling>","1","0","6","",""
"2345623","1","2345783","","2010-02-27 00:01:29","2","5628","<p>First I want to describe my situation briefly.</p><p>I have two classes, one MainClass and one DataBaseHelper class, which extends SQLiteOpenHelper.</p><p>From my MainClass I call a method in the DataBaseHelper class to open a data base. Before opening the data base I want to check the users data base version (this is important as soon as I want to update the data base and push it to the Android market). So from the DataBaseHelper class I call the following method, which is in the MainClass.</p><pre><code> public int checkCurrentDbVersion(){        // Restore preferences        SharedPreferences settings = getSharedPreferences(PREFERENCES, 0);        int dbUpgradeVar = settings.getInt(""dbUpgradeVar"", 1);        return dbUpgradeVar;            }</code></pre><p>I call the checkCurrentDbVersion() method from the DataBaseHelper class like so:</p><pre><code>    MainClass currentDbVersion = new MainClass();     int oldDbVersion = currentDbVersion.checkCurrentDbVersion();</code></pre><p>As soon as the debugger runs the following line, it stops.</p><pre><code>SharedPreferences settings = getSharedPreferences(PREFERENCES, 0);</code></pre><p>What am I doing wrong? I have no constructor defined. Could that be the failure?</p><p>Best RegardsJohe</p>","268125","","","","","2010-10-04 08:02:36","Problems calling Android's getSharedPreferences(); from SQLiteOpenHelper class","<database><android><android-preferences>","1","0","2","",""
"2345811","1","","","2010-02-27 00:59:22","3","7572","<p>I'm new to Android &amp; Eclipse. I've downloaded Eclipse and the Android <code>ADT</code> and created an ultra-simple <code>Hello World</code> app (has only auto-generated <code>.java</code> and <code>.xml</code> files).</p><p>Eclipse <em>CRASHES</em> (closes after a very brief pause) when I do the following:</p><ol><li>In Package Explorer, select <code>AppName/res/layout/main.xml</code></li><li>Press , or double-click, or 'Open With' then 'Android Layout Editor'</li></ol><p>(The app runs OK in the Android emulator)</p><p>My configuration is:</p><blockquote>  <p>Android Development Tools 0.9.5.v200911191123-20404  com.android.ide.eclipse.adt.feature.group  Eclipse IDE for Java Developers  1.2.2.20100216-1730  epp.package.java</p>    <p>Windows XP</p></blockquote><p>Can someone tell me what I'm doing wrong or what's wrong with my configuration?Any suggestions on what to check? For any non-trivial app development I need tobe able to use the Layout Editor.</p><p>More ... I can select <code>main.xml</code> and Right-Click and 'Open With' any of: XML Editor,XML Schema Editor, Text Editor -- with no problem. The problem is limited to Android Layout Editor.</p><p>THANKS!</p>","282476","","704374","","2012-08-20 07:28:16","2013-05-10 00:50:07","Eclipse crashes when I invoke Android Layout Editor","<android>","4","0","1","",""
"2345875","1","5092485","","2010-02-27 01:26:53","8","35053","<p>I have a list which is filled with a custom <code>ArrayAdapter</code>.</p><p>I want to update a progress bar every second, so I am trying to use <code>notifyDataSetChanged()</code> in order to repaint the list but it doesn't seem to work.</p>","258863","","592025","","2013-04-30 08:56:24","2013-12-09 19:23:28","Android notifyDataSetChanged","<android><android-arrayadapter>","2","0","1","",""
"2346119","1","","","2010-02-27 03:30:44","2","4410","<p>Using AVD, I successfully obtained the USB driver.  I followed the instructions on this page <a href=""http://developer.android.com/sdk/win-usb.html"" rel=""nofollow"">USB Driver for Windows</a> but Windows never prompted with the ""Found new hardware..."" message.</p><p>I'm running Vista x64 SP2 and I can see the amd64 folder under ~\Android SDK\tools\usb_driver.</p><p>The Manage Devices applet shows no listing for ""ADB Interface"" so it certainly appears that it is not there.  I tried a scan for hardware changes -- nada.  And running ""adb devices"" comes back empty (as expected).</p><p>How do I install the ADB Interface?</p>","282522","","282522","","2010-02-27 15:59:42","2013-08-22 15:41:04","Installing the Android USB driver - not happening","<android><interface><usb><adb>","4","2","","",""
"2346235","1","","","2010-02-27 04:26:19","0","722","<p>when i copy a file from assets to the device, it copies just fine. the only problem is ownership. the file is ending up with the owner being 'app_59', and i need it to be 'system'. when i adb push a file it goes as 'system'. i tried chown, i tried chmod 0777 the file, i just cannot seem to do it! can anyone help :(</p>","276359","","276359","","2010-02-27 04:34:54","2010-02-27 05:51:15","changing OWNERSHIP of a file copied to device","<android>","1","2","","",""
"2346282","1","","","2010-02-27 04:54:32","1","4406","<p>This is the code for motion events in my instrumentation testing.</p><pre><code>   long downTime = SystemClock.uptimeMillis();   long eventTime = SystemClock.uptimeMillis();   MotionEvent event = MotionEvent.obtain(downTime, eventTime,   MotionEvent.ACTION_DOWN, 100,100, 0);   MotionEvent event2 = MotionEvent.obtain(downTime, eventTime,   MotionEvent.ACTION_UP, 100, 100, 0);   instrumentation.sendPointerSync(event);   instrumentation.sendPointerSync(event2);</code></pre><p>And the following is the error iam getting:</p><pre><code>java.lang.NullPointerExceptionat com.ni.fastflip.test.FastFlipWebviewTest.test(FastFlipWebviewTest.java:28)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:205)at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:195)at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:175)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)</code></pre><p>Can any body suggest me what to do please</p>","321334","","68920","","2010-02-27 04:57:32","2013-09-25 03:56:12","Motion Events in android","<android><instrumentation>","3","0","","",""
"2346285","1","","","2010-02-27 04:56:05","0","1301","<p>when i run my application i am running one notification service .how i disable clear notification service button in my application only i need to run the service when my application is running .is there any way to disable the clear notification button .please</p><p>help me</p><p>Thanks</p><p>Aswan</p>","1746300","","","","","2010-07-14 03:03:49","notification service clear button disable in android","<android>","2","0","","",""
"2346419","1","","","2010-02-27 06:10:33","2","1770","<p>I simply use the tabwidget :</p><pre><code>mTabHost = getTabHost();    mTabHost.addTab(mTabHost.newTabSpec(""tab_1"").setIndicator(getString(R.string.day0)).setContent(R.id.tab1_content));    mTabHost.addTab(mTabHost.newTabSpec(""tab_2"").setIndicator(getString(R.string.day1)).setContent(R.id.tab2_content));    mTabHost.addTab(mTabHost.newTabSpec(""tab_3"").setIndicator(getString(R.string.day2)).setContent(R.id.tab3_content));    mTabHost.addTab(mTabHost.newTabSpec(""tab_4"").setIndicator(getString(R.string.day3)).setContent(R.id.tab4_content));    mTabHost.addTab(mTabHost.newTabSpec(""tab_5"").setIndicator(getString(R.string.about)).setContent(R.id.tab5_content));    mTabHost.setCurrentTab(0);</code></pre><p>Why are my tabs so uggly in 2.0 (no more rounded corners as in 1.5/1.6) ?</p><p><a href=""http://img521.imageshack.us/img521/1823/ugglytabs.png"" rel=""nofollow"">ugly tabs here</a></p><p>=></p><p><a href=""http://img42.imageshack.us/img42/3913/bettertabshere.png"" rel=""nofollow"">this was better</a></p><p>What should I do now to show ""rounded corners"" TABS to Nexus One (for exemple) users ;-) ?</p><p>Is it because of the following manifest lines :</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3""           android:targetSdkVersion=""4"" /&gt;&lt;supports-screens android:smallScreens=""true""                    android:normalScreens=""true""                    android:largeScreens=""true""                    android:anyDensity=""true"" /&gt;</code></pre><p>I have to keep <strong>android:anyDensity=""true""</strong> otherwise I've got a problem with re-sizing of the menus described <a href=""http://stackoverflow.com/questions/2264874/android-changing-locale-within-the-app-itself"">here</a></p><p>As a separate question, my users can change the Locale within my app itself, I then ""redraw"" the menus using onPrepareOptionsMenu (Menu menu) to refresh the strings within the menu with the new language choosen by the user. Is there an equivalent for TABS (I have local strings within the Title of the TABS) or do I have to delete all the tabs and re-create them from scratch ?</p><p>Txs in advance for your help.</p><p>Hub</p>","116573","","114066","","2010-03-18 09:13:08","2012-10-11 05:58:01","Android : ugly TABS in 2.0 vs 1.5 ... why ? where are my rounded corners TABS?","<android><layout><tabs>","2","2","2","",""
"2346558","1","2346753","","2010-02-27 07:29:17","8","5226","<p>You can delete with content resolver by URI or by passing some parameters to the where parameter.<br>How do you make the parameters to be SQL Injection Safe?<br>Is it possible to use Prepared Statements with ContentResolver?</p><pre><code>act.getContentResolver().delete(myuriwithid,null,null);act.getContentResolver().delete(mybaseuri,"" name = '""+this.name""'"",null);</code></pre>","243782","","","","","2010-02-27 09:01:11","How is advised to use the contentResolver's delete method to be injection safe?","<android><delete><sql-injection><android-sdk-2.1><android-contentresolver>","1","0","2","",""
"2346734","1","","","2010-02-27 08:53:57","8","4342","<p>I have seen all the examples on the web and it seems real simple. I have a bare-bones app that displays a string. I have a a Android JUnit test project that I created when the app was being created (eclipse asked if I wanted to create a test app).</p><p>When I run the test app (Run As --- Android JUnit) I see the following in the console....</p><p>[2010-02-27 00:45:03 - SimpleCalculatorTest]Launching instrumentation android.test.InstrumentationTestRunner on device emulator-5554[2010-02-27 00:45:12 - SimpleCalculatorTest]Test run complete</p><p>I do not see any of the code in the testcase being called.My testcase is a class that extends ActivityInstrumentationTestCase2.DDMS log shows :02-27 00:44:58.521: WARN/TestGrouping(1275): Invalid Package: '' could not be found or has no tests</p><p>Any ideas? I have tried everything....</p>","282605","","27615","","2011-11-26 10:32:58","2012-04-05 07:23:39","Trying to run Android JUnit tests in Eclipse fails?","<android><unit-testing><junit><ddms>","2","0","","",""
"2346943","1","2347202","","2010-02-27 10:09:30","1","1456","<p>I am working on audio recording. I can store the file using <code>file.getAbosolutPath() method</code>.It stores the file in path:    /data/data/com.example.audio_demo/files/output.amr</p><p>I want store that in <code>SDCARD.iso</code> and how retrieve that and play.</p>","267269","","2680216","","2013-11-03 16:24:08","2013-11-03 16:24:08","How to store the recorded audio file in SDCard in android emulator?","<android><audio><android-emulator>","1","0","","",""
"2347152","1","","","2010-02-27 11:33:17","4","26218","<p>In android: I'm trying to take data from one activity/screen to another.</p><p>Let's say I'm adding two numbers. I layout my first screen (xml) with 2 EditText views, a couple labels, and an 'OK' button. Now, I want to add the numbers that I've input into the EditText views. Let's say I input 2 and 2 (2 + 2 = 4).</p><p>Now, when I hit the 'OK' button, I want a new screen/activity to appear and simply show me the answer (4). Do I use global vars to do this? Any help would be appreciated.</p>","237863","","","","","2012-07-19 19:44:50","In Android: How do I get variables/data from one screen to another?","<android>","4","0","3","",""
"2347713","1","","","2010-02-27 14:50:03","2","1387","<p>I need to create a simple link in my Android app. Let's say that it would display text ""Google"" and after user clicks on it, <a href=""http://google.com"" rel=""nofollow"">http://google.com</a> opens in web browser. What is the easiest way to do this? The link should change color whhen it's in pressed state. </p>","243225","","","","","2012-03-22 11:24:12","How to create a web link - after click browser opens","<android>","2","0","","",""
"2347838","1","2388466","","2010-02-27 15:27:59","6","4353","<p>My android app has a two word app name, and the 2nd word doesn't fit on the first line below the app icon.  The OS doesn't automatically carry the 2nd word over to the 2nd line so it just gets cut off.  I was able to use a <code>""\n""</code> as part of the app name string instead of a space, and that forced the 2nd word to display on the 2nd line.  However, when I try to upload my app on the market I get an error (about the icon being improperly formatted, which really means that I have a newline in my app name, google needs to get their error messages straight but that's a different topic).</p><p>So, I've seen other apps on the market that don't have a problem showing the 2nd word in the app name on a second line.  How do I do the same and get past the market upload?</p><p>Thanks.</p>","265877","","","","","2011-09-06 10:33:00","Display app name on two lines below the app icon","<android><android-manifest>","3","3","0","",""
"2347877","1","","","2010-02-27 15:36:39","0","365","<p>Android, Eclipse, all running fine.</p><p>However, my internet is coming in on eth2, not eth0. The emulator is defaulting to using eth0, i know this because if i re-wire my PC, i get internet in android.</p><p>I don't really want to have to keep doing this, nor have the internet coming in via two ports. Does anyone know how to tell the emulator to use eth2?</p><p>Regards,Dean</p>","282735","","1306419","","2014-01-10 09:50:35","2014-01-10 09:50:35","Android emulator internet","<android><android-emulator>","1","0","","2014-01-10 13:52:26",""
"2348166","1","2348191","","2010-02-27 16:58:33","1","4154","<p>I'm trying to compare two datetimes but I can't get it to work.</p><pre><code>    public void time () {        Calendar c11 = Calendar.getInstance ();        c11.add(Calendar.DAY_OF_YEAR, 0);        c11.set(Calendar.HOUR_OF_DAY, 9);        c11.set(Calendar.MINUTE, 0 );        c11.set(Calendar.SECOND, 0);        Calendar c12 = Calendar.getInstance ();        c12.add(Calendar.DAY_OF_YEAR, 0);        c12.set(Calendar.HOUR_OF_DAY, 9);        c12.set(Calendar.MINUTE, 0 );        c12.set(Calendar.SECOND, 0);        c11.getTime();        c12.getTime();        boolean k = c11.equals(c12);        if (k==true)        {            Toast.makeText(              getContext(),              ""Wow these two times are the same!"",              Toast.LENGTH_LONG).show();        }    }    }</code></pre>","264905","","63550","","2010-02-27 18:17:26","2010-02-27 18:17:26","Android compare datetime","<android><datetime>","1","0","","",""
"2348188","1","","","2010-02-27 17:05:02","1","1010","<p>I'm trying to extend a RelativeLayout object and include an embedded SurfaceView object that uses a png file in my /res/drawable folder as its background but I keep getting an error in the XML Layout editor. See the following code:</p><pre><code>public class StopMotionRelativeLayout extends RelativeLayout{    private Context myContext;    private SurfaceView surfaceView1;    private BitmapFactory.Options myBitmapOptions;    private final android.view.ViewGroup.LayoutParams params =         new LayoutParams(LayoutParams.FILL_PARENT, android.view.ViewGroup.LayoutParams.FILL_PARENT);    public StopMotionRelativeLayout(Context context, AttributeSet attrs) {        super(context, attrs);        myContext = context;        this.setBackgroundColor(Color.GREEN);        //init images        surfaceView1 = new SurfaceView(myContext,attrs);        surfaceView1.setVisibility(View.INVISIBLE);        this.addView(surfaceView1, params);    }        @Override    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)    {        super.onMeasure(widthMeasureSpec, heightMeasureSpec);        myBitmapOptions = new Options();        myBitmapOptions.outWidth = widthMeasureSpec;        myBitmapOptions.outHeight = heightMeasureSpec;        surfaceView1.setBackgroundDrawable(new BitmapDrawable(BitmapFactory.decodeResource(this.myContext.getResources(),                R.drawable.golf1, myBitmapOptions)));    }}</code></pre><p>I get the following error:</p><blockquote>  <p>NotFoundException: Could not find  drawable resource matching value  0x7F020002 (resolved name: golf1) in  current configuration.</p></blockquote><p>I have seen this type of error may times now and it always happens when I try to load something from a resource file via code and not XML. Curiously, this error does not stop me from compiling the app, and the app runs without error in the emulator. I'd like to get back the use of my layout editor though...</p><p>Please help.</p><p><strong>UPDATE:</strong> Here is the layout XML</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.games.test.StopMotionRelativeLayout android:id=""@+id/RelativeLayout01""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;/com.games.test.StopMotionRelativeLayout&gt;</code></pre>","272302","","56338","","2011-01-17 19:46:05","2011-04-21 19:08:16","NotFoundException in layout editor for Android?","<java><android><eclipse><android-layout>","1","2","","",""
"2348585","1","","","2010-02-27 19:14:45","7","3969","<p>Right now, I'm running into issues trying to implement a FilterQueryProvider in my custom SimpleCursorAdapter, since I'm unsure of what to do in the FilterQueryProvider's runQuery function.</p><p>In other words, since the query that comprises my ListView basically gets the rowID, name, and a third column from my databases's table, I want to be able to filter the cursor based on the partial value of the name column.</p><p>However, I am uncertain of whether I can do this directly from runQuery without expanding my DB class since I want to filter the existing cursor, or will I have to create a new query function in my DB class that partially searches my name column, and if so, how would I go about creating the query statement while using the CharSequence constraint argument in runQuery?</p><p>I am also concerned about the performance issues associated with trying to run multiple queries based on partial text since the DB table in question has about 1300-1400 rows. In other words, would I run into a bottleneck trying to filter the cursor?</p>","252702","","","","","2010-04-28 00:19:09","Android: Filtering a SimpleCursorAdapter ListView","<android><sqlite><cursor><adapter>","1","0","4","",""
"2348657","1","","","2010-02-27 19:35:06","4","12069","<p>I am facing a problem I do not know how to solve...I have an activity, when I click on a particuliar item of the menu linked to this activity, a dialog is displayed and used to add an item. This item has a date and a time, but I do not manage to have a DatePicker and TimePicker within this dialog. I also try passing the activity to the dialog and use this one to display the datepicker., but that does not work.Before this, I handled the creation of such items within another Activity. In this case, it works fine. But I found the Dialog sexier... :-)Would you have any ideas ?Hope I am not too confused.....thanks a lot,Luc</p><p>I edit this post to share the code I have difficulties with.</p><p>I have a basic Dialog class that tried to use DatePicker and TimePicker. Basically, Eclipse complains that:</p><ul><li>the showDialog is undefined for View.OnClickListener()</li><li>onCreateDialog method: The method onCreateDialog(int) of type EventCreateDialog must override or implement a supertype method</li><li>DatePickerDialog is undefined (as this is not an acitvity)</li></ul><p>All this stuff works from within an Activity but I cannot have it working from a Dialog.</p><p>Thanks a lot,Luc</p><pre> package com.android.myapp;import ...public class TestDialog extends Dialog implements android.view.View.OnClickListener{private TextView mDateDisplay;private Button mPickDate;private Button mPickTime;private int mYear;private int mMonth;private int mDay;private int mHour;private int mMinute;static final int DATE_DIALOG_ID = 0;static final int TIME_DIALOG_ID = 1;private Button mButton_ok;private Button mButton_ko;private ReadyListener readyListener;private Context context;        public TestDialog(Context context, ReadyListener readyListener) {        super(context);        this.context = context;        this.readyListener = readyListener;    }    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.event_create);                  mButton_ok = (Button)findViewById(R.id.button_ok);        mButton_ko = (Button)findViewById(R.id.button_ko);        // Add listeners        mButton_ok.setOnClickListener(this);        mButton_ko.setOnClickListener(this);            mDateDisplay = (TextView) findViewById(R.id.dateDisplay);            mPickDate = (Button) findViewById(R.id.pickDate);            mPickTime = (Button) findViewById(R.id.pickTime);            // add a click listener to the button            mPickDate.setOnClickListener(new View.OnClickListener() {                public void onClick(View v) { showDialog(DATE_DIALOG_ID); }            });            mPickTime.setOnClickListener(new View.OnClickListener() {                public void onClick(View v) { showDialog(TIME_DIALOG_ID); }            });            // get the current date            final Calendar c = Calendar.getInstance();            mYear = c.get(Calendar.YEAR);            mMonth = c.get(Calendar.MONTH);            mDay = c.get(Calendar.DAY_OF_MONTH);            mHour = c.get(Calendar.HOUR_OF_DAY);            mMinute = c.get(Calendar.MINUTE);            updateDisplay();    }           @Override        protected Dialog onCreateDialog(int id) {            switch (id) {            case DATE_DIALOG_ID:                return new DatePickerDialog(this, mDateSetListener, mYear, mMonth, mDay);            case TIME_DIALOG_ID:                return new TimePickerDialog(this, mTimeSetListener, mHour, mMinute, false);            }            return null;        }        private void updateDisplay() {            mDateDisplay.setText(                new StringBuilder()                    // Month is 0 based so add 1                    .append(mMonth + 1).append(""-"")                    .append(mDay).append(""-"")                    .append(mYear).append("" "")                    .append(pad(mHour)).append("":"")                   .append(pad(mMinute)));        }        // the callback received when the user ""sets"" the date in the dialog        private DatePickerDialog.OnDateSetListener mDateSetListener =            new DatePickerDialog.OnDateSetListener() {                public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {                    mYear = year;                    mMonth = monthOfYear;                    mDay = dayOfMonth;                    updateDisplay();                }        };        private TimePickerDialog.OnTimeSetListener mTimeSetListener =            new TimePickerDialog.OnTimeSetListener() {                public void onTimeSet(TimePicker view, int hourOfDay, int minute) {                    mHour = hourOfDay;                    mMinute = minute;                    updateDisplay();                }        };        private static String pad(int c) {            if (c >= 10)                return String.valueOf(c);            else                return ""0"" + String.valueOf(c);        }    public interface ReadyListener {         public void ready(MyObj myObj);     }      @Override        public void onClick(View v) {        if (v == mButton_ok) {            // Do stuff....        }        if(v == mButton_ko){            dismiss();        }     }}</pre>","231957","","231957","","2010-03-08 20:30:22","2012-03-23 17:41:59","Android: use a datepicker and timepicker from within a Dialog","<android><dialog><datepicker>","3","5","1","",""
"2348675","1","2348847","","2010-02-27 19:39:36","0","1325","<p>I'd like to make a listview that used the ListView.CHOICE_MODE_SINGLE so that the user could only select one thing at a time. However, I want the background to change to the focused color when selected, rather than a checkbox checking off. A good example of what I'm trying to do would be basically any file browser, where the background changes color on each item you select in sequence.</p><p>Any help?</p>","118241","","","","","2010-02-28 18:15:09","Android Single Select without Checkbox","<android><listview>","1","0","","",""
"2349095","1","2922927","","2010-02-27 21:52:41","2","3398","<p>I am trying to add infowindows to markers/pushpins on the map. ATM, it is not working.Current code:TravelBuddy.java/TabHost</p><pre><code>package com.jappapps.android.travelbuddy;import java.util.List;import android.app.TabActivity;import android.content.Context;import android.content.Intent;import android.graphics.drawable.Drawable;import android.os.Bundle;import android.webkit.WebView;import android.widget.TabHost;import android.widget.TabHost.TabSpec;import com.google.android.maps.Overlay;public class TravelBuddy extends TabActivity {TabHost mTabHost;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //setContentView(R.layout.main);    Context ctx = this.getApplicationContext();    //tab 1    mTabHost = getTabHost();    TabSpec tabSpec1 = mTabHost.newTabSpec(""Maps"");    tabSpec1.setIndicator(""Map"");    Intent i1 = new Intent(ctx, MapTabView.class);    tabSpec1.setContent(i1);    mTabHost.addTab(tabSpec1);    //tab2    mTabHost = getTabHost();    TabSpec tabSpec2 = mTabHost.newTabSpec(""Web"");    tabSpec2.setIndicator(""Featured"");    Intent i2 = new Intent(ctx, WebView1.class);    tabSpec2.setContent(i2);    mTabHost.addTab(tabSpec2);    /*    List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();    Drawable drawable =               this.getResources().getDrawable(R.drawable.androidmarker);    Overlays itemizedoverlay = new Overlays(drawable);*/}   }</code></pre><p>MapTabView.java/Map:</p><pre><code>package com.jappapps.android.travelbuddy;import java.util.List;import android.graphics.drawable.Drawable;import android.os.Bundle;import com.google.android.maps.GeoPoint;import com.google.android.maps.MapActivity;import com.google.android.maps.MapController;import com.google.android.maps.MapView;import com.google.android.maps.Overlay;import com.google.android.maps.OverlayItem;public class MapTabView extends MapActivity {MapController mapController;@Overrideprotected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.maptabview);    MapView mapView = (MapView) findViewById(R.id.mapview);        mapView.setBuiltInZoomControls(true);    List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();    Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);    Overlays1 itemizedoverlay = new Overlays1(drawable);    GeoPoint un = new GeoPoint((int) (59.911868847598406*1E6), (int) (10.73362112045288*1E6));    OverlayItem overlayitem = new OverlayItem(un, ""Oslo Rĺdhus"", ""Oslo Rĺdhus"");    GeoPoint lc = new GeoPoint((int) (59.913676042809527*1E6), (int) (10.739468336105347*1E6));    OverlayItem overlayitem2 = new OverlayItem(lc, ""Grand Hotel/Grand Cafe"", ""Grand Hotel/Grand Cafe"");    GeoPoint pr = new GeoPoint((int) (59.906446671638705*1E6), (int) (10.736163854598999*1E6));    OverlayItem overlayitem3 = new OverlayItem(pr, ""Akershus Festning"", ""Akershus Festning"");    GeoPoint dtc = new GeoPoint((int) (59.96375425571723*1E6), (int) (10.668411254882812*1E6));    OverlayItem overlayitem4 = new OverlayItem(dtc, ""Holmenkollen Nasjonalanlegg"", ""Holmenkollen Nasjonalanlegg"");    GeoPoint un1 = new GeoPoint((int) (48.873818*1E6), (int) (2.295023*1E6));    OverlayItem overlayitem5 = new OverlayItem(un1, ""Arc De Triomphe"", ""Arc De Triomphe"");    GeoPoint lc1 = new GeoPoint((int) (48.858205*1E6), (int) (2.294359*1E6));    OverlayItem overlayitem6 = new OverlayItem(lc1, ""Eiffel Tower"", ""Eiffel Tower"");    GeoPoint pr1 = new GeoPoint((int) (48.85253054945084*1E6), (int) (2.3359479010105133*1E6));    OverlayItem overlayitem7 = new OverlayItem(pr1, ""Le Golfe De Naples"", ""Akershus Festning"");    GeoPoint dtc1 = new GeoPoint((int) (48.8701101964186*1E6), (int) (2.30538547039032*1E6));    OverlayItem overlayitem8 = new OverlayItem(dtc1, ""L'Atelier Renault"", ""L'Atelier Renault"");    GeoPoint dtc2 = new GeoPoint((int) (48.86751841374421*1E6), (int) (2.322430908679962*1E6));    OverlayItem overlayitem9 = new OverlayItem(dtc2, ""Maxims"", ""Maxims"");           GeoPoint un2 = new GeoPoint((int) (48.85047705575626*1E6), (int) (2.2914178669452667*1E6));    OverlayItem overlayitem10 = new OverlayItem(un2, ""Hotel Eiffel Capitol"", ""Hotel Eiffel Capitol"");    GeoPoint lc2 = new GeoPoint((int) (48.837701*1E6), (int) (2.34641*1E6));    OverlayItem overlayitem11 = new OverlayItem(lc2, ""The Five Hotel"", ""The Five Hotel"");    GeoPoint pr2 = new GeoPoint((int) (48.8484067*1E6), (int) (2.2971547*1E6));    OverlayItem overlayitem12 = new OverlayItem(pr2, ""Hotel Saphir Grenelle"", ""Hotel Sapfir Grenelle"");    GeoPoint dtc3 = new GeoPoint((int) (48.84850466945429*1E6), (int) (2.3204205930233*1E6));    OverlayItem overlayitem13 = new OverlayItem(dtc3, ""Hotel Vaneau Saint-Germain"", ""Vaneau Saint-Germain"");    GeoPoint un3 = new GeoPoint((int) (48.8663741*1E6), (int) (2.3084308*1E6));    OverlayItem overlayitem14 = new OverlayItem(un3, ""Hotel San Régis"", ""Hotel San Régis"");    GeoPoint lc3 = new GeoPoint((int) (48.88319585446909*1E6), (int) (2.2988489270210266*1E6));    OverlayItem overlayitem15 = new OverlayItem(lc3, ""Bacino"", ""Bacino"");    GeoPoint pr3 = new GeoPoint((int) (51.50056503296835*1E6), (int) (-0.1246422529220581*1E6));    OverlayItem overlayitem16 = new OverlayItem(pr3, ""Big Ben"", ""Big Ben"");    GeoPoint dtc4 = new GeoPoint((int) (51.49942628765944*1E6), (int) (-0.12577414512634277*1E6));    OverlayItem overlayitem17 = new OverlayItem(dtc4, ""Houses Of Parliament"", ""Houses Of Parliament"");    GeoPoint dtc5 = new GeoPoint((int) (51.50163696369762*1E6), (int) (-0.1411592960357666*1E6));    OverlayItem overlayitem18 = new OverlayItem(dtc5, ""Buckingham Palace"", ""Buckingham Palace"");            GeoPoint un4 = new GeoPoint((int) (51.50558385576479*1E6), (int) (-0.08531838655471802*1E6));    OverlayItem overlayitem19 = new OverlayItem(un4, ""London Dungeon"", ""London Dungeon"");    GeoPoint lc5 = new GeoPoint((int) (51.41935569771223*1E6), (int) (-0.19598767161369324*1E6));    OverlayItem overlayitem20 = new OverlayItem(lc5, ""Antoinette Hotel Wimbledon"", ""Antoinette Hotel Wimbledon"");    GeoPoint pr5 = new GeoPoint((int) (51.5120631*1E6), (int) (-0.0790412*1E6));    OverlayItem overlayitem21 = new OverlayItem(pr5, ""The Tower - A Guoman Hotel"", ""The Tower - A Guoman Hotel"");    GeoPoint dtc6 = new GeoPoint((int) (51.50645199258505*1E6), (int) (-0.07380366325378418*1E6));    OverlayItem overlayitem22 = new OverlayItem(dtc6, ""Water Cafe"", ""Water Cafe"");    GeoPoint un5 = new GeoPoint((int) (51.50650541584913*1E6), (int) (-0.07335305213928223*1E6));    OverlayItem overlayitem23 = new OverlayItem(un5, ""The Brasserie"", ""The Brasserie"");    GeoPoint lc6 = new GeoPoint((int) (51.51877441241732*1E6), (int) (-0.1319056749343872*1E6));    OverlayItem overlayitem24 = new OverlayItem(lc6, ""MyHotel Bloomsbury"", ""MyHotel Bloomsbury"");    GeoPoint pr6 = new GeoPoint((int) (40.4528417284077*1E6), (int) (-3.6893677711486816*1E6));    OverlayItem overlayitem25 = new OverlayItem(pr6, ""Santiago Bernabeu"", ""Santiago Bernabeu"");    GeoPoint dtc7 = new GeoPoint((int) (40.41366759389503*1E6), (int) (-3.692554235458374*1E6));    OverlayItem overlayitem26 = new OverlayItem(dtc7, ""Prado Museum"", ""Prado Museum"");    GeoPoint dtc8 = new GeoPoint((int) (40.4163542*1E6), (int) (-3.6949915*1E6));    OverlayItem overlayitem27 = new OverlayItem(dtc8, ""Thyssen Museum"", ""Thyssen Museum"");          GeoPoint un6 = new GeoPoint((int) (40.4085453*1E6), (int) (-3.6940541*1E6));    OverlayItem overlayitem28 = new OverlayItem(un6, ""Reina Sofia"", ""Reina Sofia"");    GeoPoint lc7 = new GeoPoint((int) (40.440325146081875*1E6), (int) (-3.670211434364319*1E6));    OverlayItem overlayitem29 = new OverlayItem(lc7, ""Hotel Silken Puerta America"", ""Hotel Silken Puerta America"");    GeoPoint pr7 = new GeoPoint((int) (40.41960806285972*1E6), (int) (-3.6996057629585266*1E6));    OverlayItem overlayitem30 = new OverlayItem(pr7, ""Hotel De Las Letras"", ""Hotel De Las Letras"");    GeoPoint dtc9 = new GeoPoint((int) (40.440325146081875*1E6), (int) (-3.670211434364319*1E6));    OverlayItem overlayitem31 = new OverlayItem(dtc9, ""MAD Resturant"", ""MAD Resturant"");    GeoPoint un7 = new GeoPoint((int) (41.40314508867334*1E6), (int) (2.1737265586853027*1E6));    OverlayItem overlayitem32 = new OverlayItem(un7, ""Sagrada Familia"", ""Sagrada Familia"");    GeoPoint lc8 = new GeoPoint((int) (41.41350532776538*1E6), (int) (2.1529877185821533*1E6));    OverlayItem overlayitem33 = new OverlayItem(lc8, ""Park Güell"", ""Park Güell"");    GeoPoint pr8= new GeoPoint((int) (41.38142144742531*1E6), (int) (2.1210265159606934*1E6));    OverlayItem overlayitem34 = new OverlayItem(pr8, ""Camp Nou"", ""Camp Nou"");    GeoPoint dtc10 = new GeoPoint((int) (41.4974299*1E6), (int) (2.1574864*1E6));    OverlayItem overlayitem35 = new OverlayItem(dtc10, ""Museum Picasso"", ""Museum Picasso"");    GeoPoint dtc11 = new GeoPoint((int) (41.3839147*1E6), (int) (2.183351*1E6));    OverlayItem overlayitem36 = new OverlayItem(dtc11, ""Resturant Cal Pep"", ""Resturant Cal Pep"");           GeoPoint un8 = new GeoPoint((int) (59.911868847598406*1E6), (int) (10.73362112045288*1E6));    OverlayItem overlayitem37 = new OverlayItem(un8, ""Alkimia Resturant"", ""Alkimia Resturant"");    GeoPoint lc9 = new GeoPoint((int) (41.3909339796086*1E6), (int) (2.149248719215393*1E6));    OverlayItem overlayitem38 = new OverlayItem(lc9, ""Resturant Vinya Roel"", ""Resturant Vinya Roel"");    GeoPoint pr9 = new GeoPoint((int) (41.410423580724746*1E6), (int) (2.136486768722534*1E6));    OverlayItem overlayitem39 = new OverlayItem(pr9, ""ABAC Hotel"", ""ABAC Hotel"");    GeoPoint dtc12 = new GeoPoint((int) (41.3776992*1E6), (int) (2.1390646*1E6));    OverlayItem overlayitem40 = new OverlayItem(dtc12, ""Hotel AC Sants"", ""Hotel AC Sants"");    GeoPoint un9 = new GeoPoint((int) (41.38435766200757*1E6), (int) (2.178337275981903*1E6));    OverlayItem overlayitem41 = new OverlayItem(un9, ""Hotel H10 Montcada"", ""Hotel H10 Montcada"");    GeoPoint lc10 = new GeoPoint((int) (41.88996250292627*1E6), (int) (12.49321460723877*1E6));    OverlayItem overlayitem42 = new OverlayItem(lc10, ""Colosseum"", ""Colosseum"");    GeoPoint pr10 = new GeoPoint((int) (41.90089556707864*1E6), (int) (12.48333603143692*1E6));    OverlayItem overlayitem43 = new OverlayItem(pr10, ""Trevi Fountain"", ""Trevi Fountain"");    GeoPoint dtc13 = new GeoPoint((int) (41.8933727975499*1E6), (int) (12.483032941818237*1E6));    OverlayItem overlayitem44 = new OverlayItem(dtc13, ""Capitoline Museums"", ""Capitoline Museums"");    GeoPoint dtc14 = new GeoPoint((int) (41.903061593027836*1E6), (int) (12.45436280965805*1E6));    OverlayItem overlayitem45 = new OverlayItem(dtc14, ""Sistine Chapel"", ""Sistine Chapel"");         GeoPoint un10 = new GeoPoint((int) (41.9058324020521341E6), (int) (12.482188045978546*1E6));    OverlayItem overlayitem46 = new OverlayItem(un10, ""Piazza Di Spagna"", ""Piazza Di Spagna"");    GeoPoint lc11 = new GeoPoint((int) (41.9005422084091*1E6), (int) (12.476523220539093*1E6));    OverlayItem overlayitem47 = new OverlayItem(lc11, ""Gelateria Della Palma"", ""Gelateria Della Palma"");    GeoPoint pr11 = new GeoPoint((int) (41.8993638*1E6), (int) (12.4727763*1E6));    OverlayItem overlayitem48 = new OverlayItem(pr11, ""Resturant Tre Scalini"", ""Resturant Tre Scalini"");    GeoPoint dtc15 = new GeoPoint((int) (41.89913673988211*1E6), (int) (12.49245822429657*1E6));    OverlayItem overlayitem49 = new OverlayItem(dtc15, ""Pizzeria Est! Est! Est! Dei Fratelli Ricci"", ""Pizzeria Est! Est! Est! Dei Fratelli Ricci"");    GeoPoint un11 = new GeoPoint((int) (41.8987143*1E6), (int) (12.4715744*1E6));    OverlayItem overlayitem50 = new OverlayItem(un11, ""Hotel Teatro Pace 33"", ""Hotel Teatro Pace 33"");    GeoPoint lc12 = new GeoPoint((int) (41.896669109513695*1E6), (int) (12.50568151473999*1E6));    OverlayItem overlayitem51 = new OverlayItem(lc12, ""Radisson Sas Es Hotel Roma"", ""Radisson Sas Es Hotel Roma"");    GeoPoint pr13 = new GeoPoint((int) (41.895373*1E6), (int) (12.4892684*1E6));    OverlayItem overlayitem52 = new OverlayItem(pr13, ""Casa Il Rosario"", ""Casa Il Rosario"");    GeoPoint dtc16 = new GeoPoint((int) (43.701068*1E6), (int) (7.2796387*1E6));    OverlayItem overlayitem53 = new OverlayItem(dtc16, ""Resturant Au Petit Gari"", ""Resturant Au Petit Gari"");    GeoPoint dtc17 = new GeoPoint((int) (43.705593*1E6), (int) (7.2821517*1E6));    OverlayItem overlayitem54 = new OverlayItem(dtc17, ""Hotel Relais Acropolis"", ""Hotel Relais Acropolis"");         GeoPoint un12 = new GeoPoint((int) (51.50558385576479*1E6), (int) (-0.08531838655471802*1E6));    OverlayItem overlayitem55 = new OverlayItem(un12, ""Holiday Inn Hotel Resort Port St.Laurent"", ""Holiday Inn Hotel Resort Port St.Laurent"");    GeoPoint lc13 = new GeoPoint((int) (43.6989919*1E6), (int) (7.2601172*1E6));    OverlayItem overlayitem56 = new OverlayItem(lc13, ""Gounod Hotel"", ""Gounod Hotel"");    GeoPoint pr14 = new GeoPoint((int) (48.21070419133567*1E6), (int) (16.358535289764404*1E6));    OverlayItem overlayitem57 = new OverlayItem(pr14, ""Vienna City Hall/Rathaus"", ""Vienna City Hall/Rathaus"");    GeoPoint dtc18 = new GeoPoint((int) (48.20055071992264*1E6), (int) (16.37714982032776*1E6));    OverlayItem overlayitem58 = new OverlayItem(dtc18, ""Imperial Court Theatre"", ""Imperial Court Theatre"");    GeoPoint un13 = new GeoPoint((int) (48.2169714*1E6), (int) (16.39592*1E6));    OverlayItem overlayitem59 = new OverlayItem(un13, ""Wiener Riesenrad"", ""Wiener Riesenrad"");    GeoPoint lc14 = new GeoPoint((int) (48.2027121*1E6), (int) (16.3702019*1E6));    OverlayItem overlayitem60 = new OverlayItem(lc14, ""Resturant Korso"", ""Resturant Korso"");    GeoPoint pr15 = new GeoPoint((int) (48.2096951*1E6), (int) (16.3737617*1E6));    OverlayItem overlayitem61 = new OverlayItem(pr15, ""Pizza Bizi"", ""Pizza Bizi"");    GeoPoint dtc19 = new GeoPoint((int) (48.2044364*1E6), (int) (16.3813728*1E6));    OverlayItem overlayitem62 = new OverlayItem(dtc19, ""Resturant Steirereck"", ""Restrant Steirereck"");    GeoPoint dtc20 = new GeoPoint((int) (48.20973540822208*1E6), (int) (16.365820169448853*1E6));    OverlayItem overlayitem63 = new OverlayItem(dtc20, ""Steigenberger Hotel Herrenhof"", ""Steigenberger Hotel Herrenhof"");           GeoPoint un14 = new GeoPoint((int) (48.2016895*1E6), (int) (16.37109831*1E6));    OverlayItem overlayitem64 = new OverlayItem(un14, ""The Ring Hotel"", ""The Ring Hotel"");    GeoPoint lc15 = new GeoPoint((int) (48.2021021*1E6), (int) (16.3721863*1E6));    OverlayItem overlayitem65 = new OverlayItem(lc15, ""Grand Hotel Wien"", ""Grand Hotel Wien"");    GeoPoint pr16 = new GeoPoint((int) (59.32845018256806*1E6), (int) (18.09195041656494*1E6));    OverlayItem overlayitem66 = new OverlayItem(pr16, ""The Vasa Museum"", ""The Vasa Museum"");    GeoPoint dtc21 = new GeoPoint((int) (59.32970893771183*1E6), (int) (18.092358112335205*1E6));    OverlayItem overlayitem67 = new OverlayItem(dtc21, ""Junibacken"", ""Junibacken"");    GeoPoint un15 = new GeoPoint((int) (59.3073348*1E6), (int) (18.0747967*1E6));    OverlayItem overlayitem68 = new OverlayItem(un15, ""Clarion Hotel Stockholm"", ""Clarion Hotel Stockholm"");    GeoPoint lc16 = new GeoPoint((int) (59.3254337*1E6), (int) (18.0753632*1E6));    OverlayItem overlayitem69 = new OverlayItem(lc16, ""Hotel Reisen"", ""Hotel Reisen"");    GeoPoint pr17= new GeoPoint((int) (59.3299036*1E6), (int) (18.0715709*1E6));    OverlayItem overlayitem70 = new OverlayItem(pr17, ""Cafe Opera"", ""Cafe Opera"");    GeoPoint dtc22 = new GeoPoint((int) (41.4974299*1E6), (int) (2.1574864*1E6));    OverlayItem overlayitem71 = new OverlayItem(dtc22, ""Sturehof Resturant"", ""Sturehof Resturant"");    GeoPoint dtc23 = new GeoPoint((int) (55.692711148828536*1E6), (int) (12.599140405654907*1E6));    OverlayItem overlayitem72 = new OverlayItem(dtc23, ""The Little Mermaid"", ""The Little Mermaid"");         GeoPoint un16 = new GeoPoint((int) (55.67800786998909*1E6), (int) (12.572801113128662*1E6));    OverlayItem overlayitem73 = new OverlayItem(un16, ""Strřget"", ""Strřget"");    GeoPoint lc17 = new GeoPoint((int) (55.6747595*1E6), (int) (12.565412*1E6));    OverlayItem overlayitem74 = new OverlayItem(lc17, ""Copenhagen Tivoli"", ""Copenhagen Tivoli"");    GeoPoint pr18 = new GeoPoint((int) (55.6779738*1E6), (int) (12.5978009*1E6));    OverlayItem overlayitem75 = new OverlayItem(pr18, ""Resturant Noma"", ""Resturant Noma"");    GeoPoint dtc24 = new GeoPoint((int) (55.6747595*1E6), (int) (12.565412*1E6));    OverlayItem overlayitem76 = new OverlayItem(dtc24, ""The Paul Resturant"", ""The Paul Resturant"");    GeoPoint un17 = new GeoPoint((int) (55.678742*1E6), (int) (12.5841987*1E6));    OverlayItem overlayitem77 = new OverlayItem(un17, ""Restaurant Kong Hans Kćlder"", ""Restaurant Kong Hans Kćlder"");    GeoPoint lc18 = new GeoPoint((int) (55.66787989681918*1E6), (int) (12.584280967712402*1E6));    OverlayItem overlayitem78 = new OverlayItem(lc18, ""Radisson Blu Scandinavia Hotel Copenhagen"", ""Radisson Blu Scandinavia Hotel Copenhagen"");    GeoPoint pr19 = new GeoPoint((int) (55.68151324*1E6), (int) (12.5929088*1E6));    OverlayItem overlayitem79 = new OverlayItem(pr19, ""Copenhagen Admiral Hotel"", ""Copenhagen Admiral Hotel"");    GeoPoint dtc25 = new GeoPoint((int) (55.6786431*1E6), (int) (12.566237*1E6));    OverlayItem overlayitem80 = new OverlayItem(dtc25, ""Hotel Fox"", ""Hotel Fox"");    GeoPoint dtc26 = new GeoPoint((int) (45.46419413386295*1E6), (int) (9.190621376037598*1E6));    OverlayItem overlayitem81 = new OverlayItem(dtc26, ""Duomo of Milan"", ""Duomo of Milan"");         GeoPoint un18 = new GeoPoint((int) (45.46730552025704*1E6), (int) (9.189741611480713*1E6));    OverlayItem overlayitem82 = new OverlayItem(un18, ""La Scala Theatre"", ""La Scala Theatre"");    GeoPoint lc19 = new GeoPoint((int) (45.469401000526105*1E6), (int) (9.180772304534912*1E6));    OverlayItem overlayitem83 = new OverlayItem(lc19, ""Sforzesco Castle"", ""Sforzesco Castle"");    GeoPoint pr20 = new GeoPoint((int) (45.4571409*1E6), (int) (9.184143*1E6));    OverlayItem overlayitem84 = new OverlayItem(pr20, ""SHU Café"", ""SHU Café"");    GeoPoint dtc27 = new GeoPoint((int) (45.4774833*1E6), (int) (9.1879434*1E6));    OverlayItem overlayitem84b = new OverlayItem(dtc27, ""Rangoli Resturant"", ""Rangoli Resturant"");    GeoPoint un19 = new GeoPoint((int) (45.4728739*1E6), (int) (9.1925647*1E6));    OverlayItem overlayitem85 = new OverlayItem(un19, ""Hotel Cavour"", ""Hotel Cavour"");    GeoPoint lc20 = new GeoPoint((int) (45.4833898*1E6), (int) (9.203065*1E6));    OverlayItem overlayitem86 = new OverlayItem(lc20, "" Hotel Augustus Milano"", "" Hotel Augustus Milano"");    GeoPoint pr21 = new GeoPoint((int) (52.521104203431*1E6), (int) (13.409993648529053*1E6));    OverlayItem overlayitem87 = new OverlayItem(pr21, ""Berliner Fernsehturm"", ""Berliner Fernsehturm"");    GeoPoint dtc28 = new GeoPoint((int) (52.5024116*1E6), (int) (13.3407873*1E6));    OverlayItem overlayitem88 = new OverlayItem(dtc28, ""KaDeWe"", ""KaDeWe"");    GeoPoint dtc29 = new GeoPoint((int) (52.5024116*1E6), (int) (13.3407873*1E6));    OverlayItem overlayitem89 = new OverlayItem(dtc29, ""Sony Center Berlin"", ""Sony Center Berlin"");         GeoPoint un20 = new GeoPoint((int) (52.5167268*1E6), (int) (13.3811334*1E6));    OverlayItem overlayitem90 = new OverlayItem(un20, ""Hotel Adlon Kempinski"", ""Hotel Adlon Kempinski"");    GeoPoint lc21 = new GeoPoint((int) (47.3790239*1E6), (int) (8.5410038*1E6));    OverlayItem overlayitem91 = new OverlayItem(lc21, ""Swiss National Museum"", ""Swiss National Museum"");    GeoPoint pr22 = new GeoPoint((int) (47.37522381*1E6), (int) (8.5480097*1E6));    OverlayItem overlayitem92 = new OverlayItem(pr22, ""Zoological Museum Zurich"", ""Zoological Museum Zurich"");    GeoPoint dtc30 = new GeoPoint((int) (47.3646155*1E6), (int) (8.5341921*1E6));    OverlayItem overlayitem93 = new OverlayItem(dtc30, ""Alden Hotel Splügenschloss"", ""Alden Hotel Splügenschloss"");    GeoPoint un21 = new GeoPoint((int) (47.3673009*1E6), (int) (8.5393579*1E6));    OverlayItem overlayitem94 = new OverlayItem(un21, ""Baur au Lac Hotel"", ""Baur au Lac Hotel"");    GeoPoint lc22 = new GeoPoint((int) (47.3724962*1E6), (int) (8.5397697*1E6));    OverlayItem overlayitem95 = new OverlayItem(lc22, ""Widder Hotel"", ""Widder Hotel"");    GeoPoint pr23 = new GeoPoint((int) (47.3519342*1E6), (int) (8.5611453*1E6));    OverlayItem overlayitem96 = new OverlayItem(pr23, ""Blaue Ente Resturant"", ""Blaue Ente Resturant"");    GeoPoint dtc31 = new GeoPoint((int) (47.384317*1E6), (int) (8.5301602*1E6));    OverlayItem overlayitem97 = new OverlayItem(dtc31, ""El Parador Resturant"", ""El Parador Resturant"");    GeoPoint dtc32 = new GeoPoint((int) (50.1154854*1E6), (int) (8.6712932*1E6));    OverlayItem overlayitem98 = new OverlayItem(dtc32, ""Resturant Charlot"", ""Resturant Chalot"");            GeoPoint un22 = new GeoPoint((int) (50.113269*1E6), (int) (8.6655786*1E6));    OverlayItem overlayitem99 = new OverlayItem(un22, ""Restaurant Alte Kanzlei"", ""Restaurant Alte Kanzlei"");    GeoPoint lc23 = new GeoPoint((int) (50.1079716*1E6), (int) (8.6616355*1E6));    OverlayItem overlayitem100 = new OverlayItem(lc23, ""Steigenberger Hotel Metropolitan"", ""Steigenberger Hotel Metropolitan"");    GeoPoint pr24 = new GeoPoint((int) (50.1079054*1E6), (int) (8.6614363*1E6));    OverlayItem overlayitem101 = new OverlayItem(pr24, ""InterCityHotel Frankfurt"", ""InterCityHotel Frankfurt"");    GeoPoint dtc33 = new GeoPoint((int) (50.118211*1E6), (int) (8.6267511*1E6));    OverlayItem overlayitem102 = new OverlayItem(dtc33, ""Radisson Blu Frankfurt"", ""Radisson Blu Frankfurt"");    GeoPoint un23 = new GeoPoint((int) (50.1173658*1E6), (int) (8.6525491*1E6));    OverlayItem overlayitem103 = new OverlayItem(un23, ""Senckenberg Natural History Museum"", ""Senckenberg Natural History Museum"");    GeoPoint lc24 = new GeoPoint((int) (60.14791385553872*1E6), (int) (24.986085891723633*1E6));    OverlayItem overlayitem104 = new OverlayItem(lc24, ""Suomenlinna Fortress"", ""Suomenlinna Fortress"");    GeoPoint pr25= new GeoPoint((int) (60.17486121440947*1E6), (int) (24.93196964263916*1E6));    OverlayItem overlayitem105 = new OverlayItem(pr25, ""National Museum of Finland"", ""National Museum of Finland"");    GeoPoint dtc34 = new GeoPoint((int) (60.17251327443952*1E6), (int) (24.92527484893799*1E6));    OverlayItem overlayitem106 = new OverlayItem(dtc34, ""Temppeliaukio Church"", ""Temppeliaukio Church"");    GeoPoint dtc35 = new GeoPoint((int) (60.1661015*1E6), (int) (24.9462893*1E6));    OverlayItem overlayitem107 = new OverlayItem(dtc35, ""Resturant Chez Dominique"", ""Resturant Chez Dominique"");            GeoPoint un24 = new GeoPoint((int) (60.1667065*1E6), (int) (24.9370801*1E6));    OverlayItem overlayitem108 = new OverlayItem(un24, ""Lappi Resturant"", ""Lappi Resturant"");    GeoPoint lc25 = new GeoPoint((int) (60.1658221*1E6), (int) (24.9643121*1E6));    OverlayItem overlayitem109 = new OverlayItem(lc25, ""Scandic Grand Marina"", ""Scandic Grand Marina"");    GeoPoint pr26 = new GeoPoint((int) (60.1620404*1E6), (int) (24.91947054862976*1E6));    OverlayItem overlayitem110 = new OverlayItem(pr26, ""Radisson SAS Royal Hotel Helsinki"", ""Radisson SAS Royal Hotel Helsinki"");    GeoPoint dtc36 = new GeoPoint((int) (50.0890201*1E6), (int) (14.3953924*1E6));    OverlayItem overlayitem111 = new OverlayItem(dtc36, ""Prague Castle"", ""Prague Castle"");    GeoPoint un25 = new GeoPoint((int) (50.0791783*1E6), (int) (14.430561*1E6));    OverlayItem overlayitem112 = new OverlayItem(un25, ""Czech National Museum"", ""Czech National Museum"");    GeoPoint lc26 = new GeoPoint((int) (50.0867185*1E6), (int) (14.4203544*1E6));    OverlayItem overlayitem113 = new OverlayItem(lc26, ""Prague Astronomical Clock"", ""Prague Astronomical Clock"");    GeoPoint pr27 = new GeoPoint((int) (50.0847624*1E6), (int) (14.4181824*1E6));    OverlayItem overlayitem114 = new OverlayItem(pr27, ""Flambee Restaurant"", ""Flambee Restaurant"");    GeoPoint dtc37 = new GeoPoint((int) (50.0870934*1E6), (int) (14.4082526*1E6));    OverlayItem overlayitem115 = new OverlayItem(dtc37, ""Kampa Park Restaurant"", ""Kampa Park Restaurant"");    GeoPoint dtc38 = new GeoPoint((int) (50.0840176*1E6), (int) (14.4251538*1E6));    OverlayItem overlayitem116 = new OverlayItem(dtc38, ""Hotel Ambassador-Zlatá Husa"", ""Hotel Ambassador-Zlatá Husa"");          GeoPoint un26 = new GeoPoint((int) (50.0819621*1E6), (int) (50.0819621*1E6));    OverlayItem overlayitem117 = new OverlayItem(un26, ""Hotel Galileo"", ""Hotel Galileo"");    itemizedoverlay.addOverlay(overlayitem);    itemizedoverlay.addOverlay(overlayitem2);    itemizedoverlay.addOverlay(overlayitem3);    itemizedoverlay.addOverlay(overlayitem4);    itemizedoverlay.addOverlay(overlayitem5);    itemizedoverlay.addOverlay(overlayitem6);    itemizedoverlay.addOverlay(overlayitem7);    itemizedoverlay.addOverlay(overlayitem8);    itemizedoverlay.addOverlay(overlayitem9);    itemizedoverlay.addOverlay(overlayitem10);    itemizedoverlay.addOverlay(overlayitem11);    itemizedoverlay.addOverlay(overlayitem12);    itemizedoverlay.addOverlay(overlayitem13);    itemizedoverlay.addOverlay(overlayitem14);    itemizedoverlay.addOverlay(overlayitem15);    itemizedoverlay.addOverlay(overlayitem16);    itemizedoverlay.addOverlay(overlayitem17);    itemizedoverlay.addOverlay(overlayitem18);    itemizedoverlay.addOverlay(overlayitem19);    itemizedoverlay.addOverlay(overlayitem20);    itemizedoverlay.addOverlay(overlayitem21);    itemizedoverlay.addOverlay(overlayitem22);    itemizedoverlay.addOverlay(overlayitem23);    itemizedoverlay.addOverlay(overlayitem24);    itemizedoverlay.addOverlay(overlayitem25);    itemizedoverlay.addOverlay(overlayitem26);    itemizedoverlay.addOverlay(overlayitem27);    itemizedoverlay.addOverlay(overlayitem28);    itemizedoverlay.addOverlay(overlayitem29);    itemizedoverlay.addOverlay(overlayitem30);    itemizedoverlay.addOverlay(overlayitem31);    itemizedoverlay.addOverlay(overlayitem32);    itemizedoverlay.addOverlay(overlayitem33);    itemizedoverlay.addOverlay(overlayitem34);    itemizedoverlay.addOverlay(overlayitem35);    itemizedoverlay.addOverlay(overlayitem36);    itemizedoverlay.addOverlay(overlayitem37);    itemizedoverlay.addOverlay(overlayitem38);    itemizedoverlay.addOverlay(overlayitem39);    itemizedoverlay.addOverlay(overlayitem40);    itemizedoverlay.addOverlay(overlayitem41);    itemizedoverlay.addOverlay(overlayitem42);    itemizedoverlay.addOverlay(overlayitem43);    itemizedoverlay.addOverlay(overlayitem44);    itemizedoverlay.addOverlay(overlayitem45);    itemizedoverlay.addOverlay(overlayitem46);    itemizedoverlay.addOverlay(overlayitem47);    itemizedoverlay.addOverlay(overlayitem48);    itemizedoverlay.addOverlay(overlayitem49);    itemizedoverlay.addOverlay(overlayitem50);    itemizedoverlay.addOverlay(overlayitem51);    itemizedoverlay.addOverlay(overlayitem52);    itemizedoverlay.addOverlay(overlayitem53);    itemizedoverlay.addOverlay(overlayitem54);    itemizedoverlay.addOverlay(overlayitem55);    itemizedoverlay.addOverlay(overlayitem56);    itemizedoverlay.addOverlay(overlayitem57);    itemizedoverlay.addOverlay(overlayitem58);    itemizedoverlay.addOverlay(overlayitem59);    itemizedoverlay.addOverlay(overlayitem60);    itemizedoverlay.addOverlay(overlayitem61);    itemizedoverlay.addOverlay(overlayitem62);    itemizedoverlay.addOverlay(overlayitem63);    itemizedoverlay.addOverlay(overlayitem64);    itemizedoverlay.addOverlay(overlayitem65);    itemizedoverlay.addOverlay(overlayitem66);    itemizedoverlay.addOverlay(overlayitem67);    itemizedoverlay.addOverlay(overlayitem68);    itemizedoverlay.addOverlay(overlayitem69);    itemizedoverlay.addOverlay(overlayitem70);    itemizedoverlay.addOverlay(overlayitem71);    itemizedoverlay.addOverlay(overlayitem72);    itemizedoverlay.addOverlay(overlayitem73);    itemizedoverlay.addOverlay(overlayitem74);    itemizedoverlay.addOverlay(overlayitem75);    itemizedoverlay.addOverlay(overlayitem76);    itemizedoverlay.addOverlay(overlayitem77);    itemizedoverlay.addOverlay(overlayitem78);    itemizedoverlay.addOverlay(overlayitem79);    itemizedoverlay.addOverlay(overlayitem80);    itemizedoverlay.addOverlay(overlayitem81);    itemizedoverlay.addOverlay(overlayitem82);    itemizedoverlay.addOverlay(overlayitem83);    itemizedoverlay.addOverlay(overlayitem84);    itemizedoverlay.addOverlay(overlayitem84b);    itemizedoverlay.addOverlay(overlayitem85);    itemizedoverlay.addOverlay(overlayitem86);    itemizedoverlay.addOverlay(overlayitem87);    itemizedoverlay.addOverlay(overlayitem88);    itemizedoverlay.addOverlay(overlayitem89);    itemizedoverlay.addOverlay(overlayitem90);    itemizedoverlay.addOverlay(overlayitem91);    itemizedoverlay.addOverlay(overlayitem92);    itemizedoverlay.addOverlay(overlayitem93);    itemizedoverlay.addOverlay(overlayitem94);    itemizedoverlay.addOverlay(overlayitem95);    itemizedoverlay.addOverlay(overlayitem96);    itemizedoverlay.addOverlay(overlayitem97);    itemizedoverlay.addOverlay(overlayitem98);    itemizedoverlay.addOverlay(overlayitem99);    itemizedoverlay.addOverlay(overlayitem100);    itemizedoverlay.addOverlay(overlayitem101);    itemizedoverlay.addOverlay(overlayitem102);    itemizedoverlay.addOverlay(overlayitem103);    itemizedoverlay.addOverlay(overlayitem104);    itemizedoverlay.addOverlay(overlayitem105);    itemizedoverlay.addOverlay(overlayitem106);    itemizedoverlay.addOverlay(overlayitem107);    itemizedoverlay.addOverlay(overlayitem108);    itemizedoverlay.addOverlay(overlayitem109);    itemizedoverlay.addOverlay(overlayitem110);    itemizedoverlay.addOverlay(overlayitem111);    itemizedoverlay.addOverlay(overlayitem112);    itemizedoverlay.addOverlay(overlayitem113);    itemizedoverlay.addOverlay(overlayitem114);    itemizedoverlay.addOverlay(overlayitem115);    itemizedoverlay.addOverlay(overlayitem116);    itemizedoverlay.addOverlay(overlayitem</code></pre>","273532","","","","","2012-10-10 18:14:07","Google Map Dialog/Info Window Not Appearing on Touch","<java><android><google-maps><google-maps-markers>","2","0","0","",""
"2349149","1","","","2010-02-27 22:20:12","1","1445","<p>I'm trying to follow the example from google: </p><blockquote>  <p><a href=""http://code.google.com/apis/maps/articles/android_v3.html"" rel=""nofollow"">http://code.google.com/apis/maps/articles/android_v3.html</a></p></blockquote><p>Using the example files from their SVN repo:</p><blockquote>  <p>(http)gmaps-samples.googlecode.com/svn/trunk/articles-android-webmap/</p></blockquote><p>But although it seems to compile and export it fails; can someone sanity check that its not just me this fails for and any hints as to if its a quick thing to fix, I've been prodding it with try/catch for the last 2 hours to no avail.</p><p>Thanks :o)</p><p><strong>Forgot to add</strong>It Compiles and Uploads to the emulator (and to my phone) but running it just results in </p><pre>The Application WebMapActivity (process com.google.android.examples.webmap) has stopped unexpectedly. Please try again. [Force Close]</pre>","282857","","282857","","2010-02-27 22:31:22","2010-11-17 03:05:47","Loading a Maps API site in a Native Android Application","<android><google-maps>","1","4","2","",""
"2349244","1","","","2010-02-27 22:48:24","19","18445","<p>I have two android projects, ProjA requires ProjB (in Eclipse Properties > Java Build Path >  Projects > Add > ProjB). Every thing compiles ok in Eclipse, but when I run ProjA I get an error:</p><blockquote>  <p>Could not find method XXX, referenced  from method YYY.</p></blockquote><p>Where XXX - is the method from ProjB.</p><p>How can I fix the settings?</p>","62192","","385478","","2012-12-14 16:31:47","2013-12-27 18:40:38","Could not find method XXX, referenced from method YYY","<android>","5","4","5","",""
"2349652","1","2349808","","2010-02-28 01:08:43","31","49253","<p>I have:</p><pre>String uri = ""@drawable/myresource.png"";</pre><p>How can I load that in ImageView? this.setImageDrawable?</p>","237858","","73488","","2010-08-19 12:31:52","2012-12-25 08:14:01","Android - Open resource from @drawable String","<android>","4","0","8","",""
"2349757","1","","","2010-02-28 01:53:15","0","1371","<p>I have a TabHost that contains 5 TabHost.TabSpec. Each TabSpec is a ListView that is populated using  SimpleCursorAdapter, with the datasource being an sqlite3 database. </p><p>The layout used by SimpleCursorAdapter contains 2 TextViews which hold database data (one hidden - which contains the database record _id, and one displayed). The 3rd widget is a CheckBox. See layout below:</p><pre><code>&lt;RelativeLayout   android:id=""@+id/favoriteRow""   android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextView   android:id=""@+id/text0""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""  android:visibility=""gone""  android:paddingLeft=""5px""&gt;  &lt;/TextView&gt;&lt;TextView   android:id=""@+id/text1""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:layout_toRightOf=""@+id/text0""  android:textColor=""@color/listTextColor""  android:textSize=""@dimen/font_size_for_show_row""  android:paddingTop=""@dimen/vertical_padding_for_show_row""  android:paddingBottom=""@dimen/vertical_padding_for_show_row""&gt;&lt;/TextView&gt;  &lt;com.example.subclass.FavoriteCheckBox   android:text=""""  android:id=""@+id/favorite_checkbox""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:layout_alignParentRight=""true""  android:checked=""false""&gt;&lt;/com.example.subclass.FavoriteCheckBox&gt;&lt;/RelativeLayout&gt;</code></pre><p>My main problem is I can't figure out how to capture/listen when the user 'clicks' on the CheckBox. I subclassed CheckBox with FavoriteCheckBox and added a 'protected void onClick(View v)', but I never get there when I click on a checkbox. </p><p>Any suggestion on what I'm missing.</p><p>TIA,</p><p>jb</p>","282900","","","","","2010-08-07 05:18:15","Android: TabHost with ListView of CheckBox's","<listview><android><checkbox><android-tabhost>","1","0","","",""
"2350299","1","2350936","","2010-02-28 06:26:26","0","1695","<p>I want to populate a table, defined in layout xml file through the programmatic way. I have define Table with a single row defining its header, with all the attributes set. Now i want to know a way so that i can just replicate that header row in the table with new content.</p><p>I tried using inflator inflate(int,view) method, but at runtime it showed up with error.</p><p>Here is the XML code for the layout file defining the table</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:stretchColumns=""0,1,2"" android:id=""@+id/tLayout"" &gt;  &lt;TableRow  android:layout_width=""fill_parent""  android:id=""@+id/tRow""&gt;  &lt;TextView   android:id=""@+id/name""   android:padding=""3dip""   android:gravity=""left""   android:text=""Name""   /&gt;  &lt;TextView   android:id=""@+id/address""   android:padding=""3dip""   android:gravity=""left""   android:text=""Address""   /&gt;  &lt;TextView   android:id=""@+id/age""   android:padding=""3dip""   android:gravity=""left""   android:text=""Age""   /&gt; &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","273548","","273548","","2010-02-28 07:04:36","2010-02-28 11:52:45","How can i make use of views defined in layout XML file as template to create views programmatic way","<android><android-widget>","1","0","1","",""
"2350461","1","","","2010-02-28 07:54:45","2","2406","<p>I like to know how can i clone a view object which is already there in the view hierarchy, so that it can be added to the same view hierarchy again.</p>","273548","","","","","2012-08-30 11:32:59","How to clone a View object so that it can be added to current view hierachy","<android><android-widget>","1","2","","",""
"2350510","1","2350720","","2010-02-28 08:23:25","1","2045","<p>On a fresh install of Eclipse:</p><ul><li><strong>Eclipse</strong> - 3.52 Galileo-SR2-win32</li><li><strong>Java Version</strong> - JRE 6 (update 18)</li><li><strong>Host OS</strong> - Windows 7 (32-bit)</li></ul><p>...if I install both of the following plug-ins (in any order), they <em>both stop working</em>.</p><ul><li><strong>Android Developer Tools plug-in</strong> - ADT 0.9.5 <em>(recommended for Eclipse 3.5x)</em></li><li><strong>Subclipse plug-in</strong> - 1.6.x <em>(recommended for Eclipse 3.5x)</em></li></ul><p>The error log shows nothing, but all traces of ADT and Subclipse are gone from the menus, the toolbar, the Preferences dialog, etc.</p><p>I've progressively backtracked until I was installing completely from scratch (including deleting my workspace and .eclipse folder). I even tried increasing initial and maximum Java heap size for Eclipse. No joy.</p><p>Googling for this issue results in a number of posts from people having similar or identical problems. Unfortunately, no one seems to have an answer.</p><p>Has anyone solved this?</p>","264540","","","","","2010-10-22 22:52:54","Why can't Subclipse coexist with Android Developer Tools (ADT) plug-in?","<android><eclipse><subclipse><adt>","3","0","","",""
"2350912","1","2351067","","2010-02-28 11:40:04","1","932","<p>Having this XML view:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    android:id=""@+id/myScrollLayout""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;ScrollView        android:id=""@+id/widget29""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;ListView            android:id=""@+id/lstView1""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;        &lt;/ListView&gt;    &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre><p><img src=""http://img528.imageshack.us/img528/3603/ss3v.jpg"" alt=""alt text""></p><p>Why my ListView shows only the first item and does not fill the screen?</p>","243782","","243782","","2010-02-28 12:01:46","2010-02-28 12:42:46","Why this Android view doesn't fill the screen vertically?","<android><views>","1","0","2","",""
"2351120","1","2351168","","2010-02-28 13:03:41","1","469","<p>I need to display a single list, ordered by date which contains different types of data, images, video and whatnot.</p><p>I guess you could have one separate table for each type and the use something like FULL OUTER JOIN (simulated as sqlite doesn't support it) and sort on date. But this would be complicated because I still need to have unique IDs across all tables.</p><p>Maybe having a master list which has ID and date, and then JOIN in the types tables? But how bad is the performance of this using sqlite? I really like to avoid having a super table which contains columns all the combined types could ever need.</p><p>And ideas?</p>","253583","","","","","2010-02-28 15:38:06","SQL syntax to combine several tables","<java><sql><android><sqlite>","3","1","","",""
"2351366","1","2351676","","2010-02-28 14:43:28","0","1053","<p>i did not find my package name folder in the data/data. </p><p>There just are many folder named com</p><p>And then i try to push my sqlite database to data/data/com, But faild. Why?Pls help me .</p><p>Can give me a smaple? How to use  already exist sqlite database.</p><p>I have learned from a blog : <a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/"" rel=""nofollow"">http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/</a></p><p>But it's not use. I run the createDataBase method in the oncreat.</p><p>It's give the error message: No such table </p><p>Someone told me i need push the sqlite database to emulator first</p>","275788","","","","","2010-02-28 16:24:49","Use DDMS to push the sqlite database file faild","<android>","1","0","1","",""
"2351557","1","2351731","","2010-02-28 15:45:10","1","9445","<p>(<strong>Edited: I'm one step further than before</strong>)</p><p>I've been trying to get a simple 2-column TableLayout going where I have a LinearLayout in my left column that I dynamically add elements to which fills up the horizontal space except for the fixed 100px right column.</p><p>Here's what I have so far which works for me IF the LinearLayout contains more than one element. If it contains only one element, the right column is pushed out to the right of the screen </p><pre><code> &lt;ScrollView android:layout_width=""fill_parent""             android:layout_height=""fill_parent""             xmlns:android=""http://schemas.android.com/apk/res/android""             android:id=""@layout/main""&gt;  &lt;TableLayout android:layout_width=""fill_parent""               android:layout_height=""fill_parent""&gt;     &lt;TableRow&gt;       &lt;LinearLayout android:id=""@+id/LinearLayout01""                         android:layout_width=""fill_parent""                         android:layout_height=""fill_parent""                          android:layout_weight=""0.4""                         android:orientation=""vertical""&gt;&lt;/LinearLayout&gt;    &lt;com.epaga.ArcDrawableView                          android:layout_width=""fill_parent""                          android:layout_height=""fill_parent""                          android:gravity=""right"" android:layout_weight=""0.1"" &gt;       &lt;/com.epaga.ArcDrawableView&gt;     &lt;/TableRow&gt;   &lt;/TableLayout&gt; &lt;/ScrollView&gt;</code></pre><p>Things I've tried:</p><ul><li>changing the drawable view (which is supposed to be the fixed column) to <code>android:layout_width=""150px""</code></li><li>changing the <code>stretchcolumns</code> setting to 0.</li><li>changing the left columns' <code>layout_width</code> to either fill_parent (pushes the right column off the screen) or wrap_content (collapses the left column)</li></ul><p>Any thoughts?</p>","6583","","6583","","2010-02-28 16:10:14","2010-02-28 16:42:25","Android TableLayout question: get a fixed-width right column?","<android><layout><scrollview><tablelayout><android-linearlayout>","1","0","1","",""
"2351575","1","2351738","","2010-02-28 15:49:23","2","7659","<p>I have created an application for Android that has an activity that has a ListView which lists all current users (each row is just an image of their profile along with some text with their current status and username).</p><p>I have added a contextmenu, so that a long-click brings up several options such as ""view profile"", ""send message"", etc.</p><p>In the ContextMenu handler, how can I extract information to know which user the context menu has been clicked for (for example, if i select userX and then selected ""view profile"" then it would need to be able to retrieve the userX object and load the profile)</p><p>As the row currently only has descriptive text set, would i need to also embed some other hidden user ID or something? any thoughts on how i could set/retrieve such data?</p><p>Thanks</p>","258813","","","","","2010-02-28 16:46:25","Information from listview row for Android context menu","<java><android><contextmenu>","1","0","2","",""
"2351633","1","","","2010-02-28 16:09:28","1","646","<p>I need to obtain a File object from a URI, working in Java, but keep getting a length of zero - though I know the file size is not zero. </p><p>I need the File object to pass to <a href=""http://code.google.com/apis/gdata/javadoc/com/google/gdata/data/media/MediaFileSource.html#constructor_summary"" rel=""nofollow"">another constructor</a>.</p><p>I'm not sure if it's because I'm constructing it in the wrong way? Here's my code:</p><pre><code>    File videoFile = new File(videoURI.getPath());    if (videoFile == null) {        Log.d(LOG_TAG, ""File not found!"");        return false;    }    Log.d(LOG_TAG, ""about to upload, filepath: "" + videoFile.getPath());    Log.d(LOG_TAG, ""File length: "" + String.valueOf(videoFile.length()));</code></pre><p>The log output doesn't spit out 'File not found!', and prints a non-null path, but shows a length of 0. </p>","267831","","267831","","2010-02-28 20:46:01","2012-06-08 07:21:19","Java: constructing a file from a URI?","<java><android>","4","4","","",""
"2351953","1","","","2010-02-28 17:55:17","1","547","<p>How can I color code individual rows in a ListView exactly like it is done in the native MESSAGING app? I do NOT want to simply do alternating rows, but I want to copy the format used in the MESSAGING app, where message rows have a different background color based on the username of the message.</p><p>FYI:I am currently extending SimpleAdapter and overriding getView(int position, View convertView, ViewGroup parent) . In this method I am trying to calculate setting the background color based on the position as compared to a list of 'positions to highlight' that I am maintaining each time I update the list, but so far this is only working the first time the list is updated.</p><p>In class that overrides SimpleAdapter:</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {  View view = super.getView(position, convertView, parent);    if(highlightPositions.contains(new Integer(position))){      view.setBackgroundColor(highlightColor);          }  else{      view.setBackgroundColor(normalColor);        }     return view;}</code></pre><p>Thank you for any guidance you can offer!</p>","268648","","","","","2010-03-02 04:51:53","How to color code individual rows in ListView as is done in MESSAGING app?","<android>","2","0","1","",""
"2352302","1","","","2010-02-28 19:23:02","2","965","<p>My app has 2 activities - A and B. From homescreen I launch A, from A I launch B. The activity stack looks like this: A-B. Now I press HOME button, and from homescreen click again on my app icon, which launches A and adds it on top of the activity stack, which now looks like this: A-B-A. But I just want to bring my application to foreground, is that possible in Android?</p><p>P.S. My other app works as I want, what can be the problem?</p>","243225","","","","","2011-06-08 09:26:46","By clicking on my app's launcher icon, bring my app to foreground and not launch new Activity","<android>","2","1","","",""
"2352320","1","","","2010-02-28 19:30:10","6","6868","<p>We are building an Android App that will use user's current location (lat, long) and show top 50 venues around the current location, sorted by distance.</p><p>We have these venues stored in an SQLite DB. We plan to ship with the sqlite DB with the app.</p><p>In order to fetch only the relevant top 50 closest venues, we want to define a db function DIST (to calculate distance between two points) and use it in our query.</p><p><strong>How can I define a custom SQLite function for Android Apps? What will be the Java API call to do this?</strong></p><p>We have successfully implemented this approach in our iPhone App - using Objective C.</p>","283223","","","","","2012-01-26 12:20:50","Sqlite on Android: How to create a sqlite dist db function - to be used in the app for distance calculation using lat, long","<java><android><sqlite><sqlite3>","3","1","6","",""
"2352626","1","2352658","","2010-02-28 20:53:22","4","4178","<p>I have an android.net.URI object (of the kind returned by onActivityResult after MediaStore.ACTION_VIDEO_CAPTURE): it looks like content://media/video/media/33.</p><p>I want to convert this into a File object, and only a File object - I need to pass it to another constructor that requires a File. </p><p>How can I convert a URI like this to a File object? If I try </p><pre><code>File newFile = new File(myURI);</code></pre><p>I get an error in Eclipse suggesting that I should convert the URI to a String. Supplying URI.getPath() in the constructor doesn't help either.</p><p>This relates to the '<a href=""http://stackoverflow.com/questions/559902/android-how-can-i-convert-android-net-uri-object-to-java-net-uri-object"">How can I convert android.net.uri object to java.net.uri object?</a>' question, which unfortunately seems to have no good answer, but I want a File object out, not a java uri. </p><p>I don't mind if I have to write it to a bytestream and back again - whatever is the best way. </p><p>Apologies if I'm cross-posting <a href=""http://stackoverflow.com/questions/2351633/java-constructing-a-file-from-a-uri"">my own question</a>, but I thought I might need to make things a bit clearer. </p>","267831","","","","","2010-02-28 21:01:16","Android: construct a File from an android.net.URI","<android>","1","1","","",""
"2352679","1","2352970","","2010-02-28 21:10:38","2","10009","<p>I have the following code but the lon/lat seems to be returning null;</p><pre><code>package com.domain.www;import android.app.Activity;import android.content.Context;import android.content.pm.ActivityInfo;import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;import android.location.Criteria;import android.os.Bundle;import android.webkit.WebView;import android.webkit.WebViewClient;public class WebMapActivity extends Activity implements LocationListener {    private static final String MAP_URL = ""http://www.yahoo.com/"";    private WebView webView;    private Location mostRecentLocation;    @Override    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {        try {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            getLocation();            setupWebView();            this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);        } catch (Exception e) {            e.printStackTrace();        }    }    /** Sets up the WebView object and loads the URL of the page **/    private void setupWebView() {        /*            final String centerURL = ""javascript:centerAt(""                    + mostRecentLocation.getLatitude() + "",""
                    + mostRecentLocation.getLongitude() + "")""; */            webView = (WebView) findViewById(R.id.webview);            webView.getSettings().setJavaScriptEnabled(true);            webView.setWebViewClient(new WebViewClient() {                @Override                public void onPageFinished(WebView view, String url)                {                    String jsCode = ""javascript:alert('"" + getMostRecentLocation(""lon"") + ""')"";                    webView.loadUrl(jsCode.toString());                }            });            webView.loadUrl(MAP_URL);    }    /**     * The Location Manager manages location providers. This code searches for     * the best provider of data (GPS, WiFi/cell phone tower lookup, some other     * mechanism) and finds the last known location.     **/    private void getLocation() {        LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);        Criteria criteria = new Criteria();        criteria.setAccuracy(Criteria.ACCURACY_FINE);        String provider = locationManager.getBestProvider(criteria, true);        // In order to make sure the device is getting location, request        // updates. locationManager.requestLocationUpdates(provider, 1, 0,        // this);        //locationManager.requestLocationUpdates(provider, 1, 0, this);        setMostRecentLocation(locationManager.getLastKnownLocation(provider));    }    /** Sets the mostRecentLocation object to the current location of the device **/    @Override    public void onLocationChanged(Location location) {        setMostRecentLocation(location);    }    /**     * The following methods are only necessary because WebMapActivity     * implements LocationListener     **/    @Override    public void onProviderDisabled(String provider) {    }    @Override    public void onProviderEnabled(String provider) {    }    @Override    public void onStatusChanged(String provider, int status, Bundle extras) {    }    /**     * @param mostRecentLocation the mostRecentLocation to set     */    public void setMostRecentLocation(Location mostRecentLocation) {        this.mostRecentLocation = mostRecentLocation;    }    /**     * @return the mostRecentLocation     */    public double getMostRecentLocation(String lonLat) {        double gValue = 0.00;        try        {        Location xx = this.mostRecentLocation;  //Used as a breakpoint        if(lonLat == ""lat"") gValue = this.mostRecentLocation.getLatitude();        if(lonLat == ""lon"") gValue = this.mostRecentLocation.getLongitude();                } catch (Exception e) {            e.printStackTrace();        }        return gValue;      }}</code></pre><p>Ignore the URL bit that would be a page with a google map on it; but for debugging purposes I'd prefer it to just spit out an alert with the values in it.</p><p>Any ideas whats wrong? Target Emulators (Google API 1.5 API(3))</p><p>Thanks</p>","282857","","282857","","2010-02-28 21:35:00","2010-07-02 02:02:07","Passing GPS LonLat from Android GPS to WebPage (javascript)","<android><gps>","3","0","4","",""
"2353002","1","","","2010-02-28 22:43:28","1","1060","<p>I'm trying to create a simple path in the onDraw method of a SurfaceView object I've created and the layout editor keeps giving me ""UnsupportedOperationException: null"" whenever I add an arcTo command to the path.</p><p>How do I fix this?</p><p>Thanks,</p><p>Ryan</p><pre><code>public class myView extends SurfaceView{    private Path myPath;    public myView(Context context, AttributeSet attrs) {        super(context, attrs);    }    @Override    protected void onDraw(Canvas canvas)    {        super.onDraw(canvas);        //set bounds        final int top = 0 +this.getPaddingTop();        final int bottom = this.getMeasuredHeight() - this.getPaddingBottom();        final int left = 0 + this.getPaddingLeft();        final int right = this.getMeasuredWidth() - this.getPaddingRight();                int someHeight;                int someWidth;                innerLeft = new RectF(left + someWidth, bottom - otherHeight,                       left + someHeight + 10 * 2, bottom);        myPath.moveTo(left, bottom);        myPath.lineTo(left, top + 10);        myPath.arcTo(innerLeft, 180, 90);        myPath.close();    }}</code></pre>","272302","","272302","","2010-02-28 22:52:22","2011-11-26 20:30:06","Android -- Simple path, use of arcTo causes ""UnsupportedOperationException?""","<java><android>","0","0","","",""
"2353015","1","2354292","","2010-02-28 22:48:58","1","2259","<p>I have this code to delete a Contact Group</p><pre><code>public void delete(Activity act,String[] args) {        try {            int b=act.getContentResolver().delete(ContactsContract.Groups.CONTENT_URI,""_ID=?"", args);            Toast.makeText(act, ""Deleted"",Toast.LENGTH_SHORT).show();            //notify registered observers that a row was updated            act.getContentResolver().notifyChange(ContactsContract.Groups.CONTENT_URI, null);        } catch (Exception e) {            Log.v(TAG, e.getMessage(), e);            Toast.makeText(act, TAG + "" Delete Failed"",Toast.LENGTH_LONG).show();        }    }</code></pre><p>I call the method like</p><pre><code>private void processDelete(long rowId) {        String[] args = { String.valueOf(rowId) };        objItem.delete(this, args);        cur.requery();    }</code></pre><p>I have</p><pre><code>&lt;uses-permission android:name=""android.permission.WRITE_CONTACTS""&gt;&lt;/uses-permission&gt;</code></pre><p>The ID is passed ok.</p><p>The b value returns 1, but the delete is not performed, on activity restart I still see the record in the list.What I am doing wrong?</p>","243782","","","","","2014-02-22 06:21:09","Issue using Contact Group delete on Android","<java><android><android-sdk-2.1><android-contentresolver><contactgroups>","3","0","2","",""
"2353074","1","2354595","","2010-02-28 23:11:26","29","16026","<p>ExpandableListView has a setOnChildClickListener method, but lacks of <strong>setOnChild*<em>Long</em>*ClickListener</strong> method.</p><p>When I added setOnLongClickListener() on child view in getChildView(), whole sublist became completely unclickable (despite of parentView.setOnChildClickListener() present and working before).</p><p>How can I enable long clicks on child views? </p>","7162","","1016716","","2012-04-30 08:32:29","2013-11-27 12:52:18","Android: long click on the child views of a ExpandableListView?","<android><click><expandablelistview><expandablelistadapter><long-click>","5","0","18","",""
"2354127","1","2354143","","2010-03-01 05:58:11","0","4709","<p>i want to set default zoom level in google map to 11 miles can any one guide me how to achieve this?</p><p>any help would be appriciated.</p>","249991","","","","","2010-03-01 06:04:24","how to set default zoom level in android google map?","<android><google-maps>","1","0","","",""
"2354176","1","2358968","","2010-03-01 06:15:07","2","16421","<p>is it possible to change list view's text color in android? </p>","263325","","","","","2012-05-11 06:24:40","Changing text color of list view in android","<android>","3","1","1","",""
"2354336","1","2354359","","2010-03-01 07:14:27","8","27196","<p>When a user presses the back button on an intent, the application should quit. How can I ensure the application quits when the back button is pressed?</p>","216431","","2071395","","2013-04-03 12:53:41","2013-05-05 10:02:05","android pressing back button should exit the app","<android><exit><back-button>","4","0","12","",""
"2354349","1","2383324","","2010-03-01 07:17:24","4","3792","<p>Has anybody used OProfile tool on android...If you are able to profile please provide the basic steps and any other configuration or setup in order to do that...</p><p>Regards,Bharat Pawar</p>","237388","","149841","","2012-02-20 15:54:48","2012-02-20 15:54:48","OProfile on android","<android><linux-kernel><profiling><oprofile>","2","0","","",""
"2354488","1","","","2010-03-01 08:02:18","7","13403","<p>I am trying to make a shoppinglist, where the CheckedTextView is checked if you have already picked your item previously ie the item has a boolean set to true if picked. </p><p>I have overriden the getview method to change the CheckedTextView text with setText() and that works but setting the setChecked(true) method in CheckedTextView doesnt not make it checked.</p><p>I know that I am not recycling any views in getview(), that will be a later project in the project, right know I need to see a green checkmark =)</p><p>Any thoughts? please help.</p><p>my xml files:</p><p>test.xml    </p><pre><code> &lt;CheckedTextView xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/text1""     android:layout_width=""fill_parent""     android:layout_height=""?android:attr/listPreferredItemHeight""     android:textAppearance=""?android:attr/textAppearanceLarge""     android:gravity=""center_vertical""     android:checkMark=""?android:attr/textCheckMark""     android:paddingLeft=""5dip""     android:paddingRight=""50dip""     android:textColor=""#000000""     android:background=""#ffffff""    android:tag=""text1""    android:text=""testtestetstt""    android:focusable=""false""/&gt; </code></pre><p>listfippel.java</p><pre><code>package nu.listfippel.mitt;import java.util.ArrayList;import java.util.Arrays;import java.util.List;import android.app.ListActivity;import android.content.Context;import android.graphics.Color;import android.graphics.Typeface;import android.os.Bundle;import android.text.Spannable;import android.text.style.StrikethroughSpan;import android.text.style.StyleSpan;import android.view.Gravity;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.BaseAdapter;import android.widget.CheckBox;import android.widget.CheckedTextView;import android.widget.ListAdapter;import android.widget.TextView;import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;public class listfippel extends ListActivity {    //ArrayList&lt;Ingred&gt; ing;     Ingred i1 = new Ingred(""banan"", 2, 1, true);    Ingred i2 = new Ingred(""äpple"", 3, 1, false);    Ingred i3 = new Ingred(""päron"", 3, 1, true);    Ingred i4 = new Ingred(""gröt"", 3, 1, false);    Ingred i5 = new Ingred(""bröd"", 3, 1, false);    Ingred i6 = new Ingred(""kyckling"", 3, 1, false);    Ingred i7 = new Ingred(""röd paprika"", 3, 1, false);    Ingred i8 = new Ingred(""tĺrta"", 3, 1, false);    Ingred i9 = new Ingred(""bappelsin"", 3, 1, false);    Ingred i10 = new Ingred(""gurka"", 3, 1, true);    CheckedTextView ctv;    Ingred[] ingarray = { i1, i2, i3, i4, i5, i6, i7, i8, i9, i10 };    Ingadapter adapter;    Ingred temp;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.list);        ArrayList&lt;Ingred&gt; ing = new ArrayList&lt;Ingred&gt;(Arrays.asList(ingarray));        adapter = new Ingadapter(this, R.layout.test, ing);        //adapter = new IngArrayAdapter(ing);        OnItemClickListener il = new OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; parent, View arg1, int index,                    long arg3) {                temp = (Ingred)parent.getItemAtPosition(index);                if (temp.getCheck()){                      Toast toast = Toast.makeText(getApplicationContext(),                             ""Du avmarkerade nyss den\nklarmarkerade varan "" + parent.getItemAtPosition(index).toString(),                             Toast.LENGTH_LONG);                    toast.setGravity(Gravity.CENTER, 0, 0);                    toast.show();                }                if (!temp.getCheck()){                    temp.setCheck(true);                    //ctv.setChecked(true);                }                else {                    temp.setCheck(false);                }                adapter.notifyDataSetChanged();            }        };        setListAdapter(adapter);        //setTitleColor(Color.RED);        getListView().setOnItemClickListener(il);        getListView().setChoiceMode(2);    }    class Ingadapter extends ArrayAdapter&lt;Ingred&gt;{        public Ingadapter(Context context, int textViewResourceId,                List&lt;Ingred&gt; objects) {            super(context, textViewResourceId, objects);            // TODO Auto-generated constructor stub        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            // TODO Auto-generated method stub            LayoutInflater inflater=getLayoutInflater();            View row = inflater.inflate(R.layout.test, null);            row.setTag(R.id.text1, row.findViewById(R.id.text1));            CheckedTextView ctv =(CheckedTextView)row.getTag(R.id.text1);            Ingred temp = (Ingred)((AdapterView&lt;?&gt;) parent).getItemAtPosition(position);            if(temp.getCheck()){                ctv.setChecked(true);               }            ctv.setText(temp.toString());            return (row);        }     }    }</code></pre><p>Ingred.java</p><pre><code>package nu.listfippel.mitt;public class Ingred {    private String namn;    @SuppressWarnings(""unused"")    private int volym;    private double antal;    private boolean check = false;     private String retstring;    public Ingred(String namn, double antal, int volym, boolean check){        this.namn = namn;        this.antal = antal;        this.volym = volym;        this.check = check;    }    public String toString(){        if (!this.check){        retstring = namn + "" \n("" + antal + "" behövs)"";        }        else {            retstring = namn;        }        return retstring;    }    public boolean getCheck(){        return this.check;    }    public void setCheck(boolean check){        this.check = check;    }}</code></pre>","271084","","174261","","2011-08-18 13:25:46","2012-07-23 12:24:03","CheckedTextView set to checked oncreate in listview?","<android>","2","0","1","",""
"2354602","1","","","2010-03-01 08:34:55","1","651","<p>I have a friend who's written a servlet which just serves XML (just XML, no SOAP or etc., Content-Type: text/xml).</p><p>Now I'm trying to access it using android. I can access the page fine if I surf to the page with firefox, but if I access it using my android application I get an HTTP 502 error.</p><p>The code I'm using is:</p><pre><code>AlertDialog alertDialog;HttpClient httpClient = new DefaultHttpClient();HttpContext localContext = new BasicHttpContext();HttpGet httpGet = new HttpGet(""x"");try {  HttpResponse response = httpClient.execute(httpGet, localContext);  alertDialog = new AlertDialog.Builder(view.getContext()).create();  alertDialog.setButton(""OK"", new DialogInterface.OnClickListener() {    public void onClick(DialogInterface dialog, int which) {      return;    }  });  alertDialog.setTitle(""Response"");  alertDialog.setMessage(response.getStatusLine().toString());  alertDialog.show();  alertDialog.setMessage(EntityUtils.toString(response.getEntity()));  alertDialog.show();} catch (IOException e) {  alertDialog = new AlertDialog.Builder(view.getContext()).create();  alertDialog.setTitle(""Sorry"");  alertDialog.setMessage(""There was a problem connecting to the login-service."");  alertDialog.setButton(""OK"", new DialogInterface.OnClickListener() {    public void onClick(DialogInterface dialog, int which) {      return;    }  });  alertDialog.show();}</code></pre><p>And are there any recommended ways to parse the XML? Like if there was a specific tag in there such as title, message, ...</p>","211992","","211992","","2010-03-01 09:16:34","2010-12-17 00:41:47","android communicate with webpage, get 502 error","<xml><android><http>","1","0","","",""
"2354742","1","2354759","","2010-03-01 09:10:37","10","22089","<p>friends,</p><p>i have following three button in linear layout with width fill_parent</p><p>now how can i set width of these buttons to cover whole screen area equally?</p><p>any help would be appriciated.</p><pre><code>&lt;Button             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:id=""@+id/btnReplyMessage""             android:gravity=""left""            android:text=""Reply"" /&gt;     &lt;Button             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:id=""@+id/btnMarkAsUnread""            android:gravity=""left""             android:text=""Mark as unread"" /&gt;            &lt;ImageButton android:id=""@+id/btnDeleteMessage""                        android:src=""@drawable/imgsearch""                        android:gravity=""right"" android:layout_height=""wrap_content""                        android:layout_width=""wrap_content""                        android:layout_alignParentRight=""true""        /&gt;</code></pre>","249991","","","","","2012-12-17 13:54:43","how to set width of buttons in android to cover screen width?","<android><layout>","3","0","","",""
"2354913","1","2355246","","2010-03-01 09:45:38","0","1693","<p>Is there any way to build an Alert Dialog with a Button ""Force Close"" that close the app?</p><p>Thanks</p>","258863","","","","","2010-03-01 10:52:44","Android Alert Dialog Force Close","<android><alert>","1","0","","",""
"2355042","1","2355722","","2010-03-01 10:10:43","1","1002","<p>I want to have a background service running which gets started when an Image is opened in the gallery and then does something fancy with the image... As far as I know the opening of the image in the gallery would trigger a new intent to display this image. (Correct me if I'm wrong). My idea was to catch that Intent in the intent filter of said service I want to implement. </p><p>Here's my intent filter from the manifest:</p><pre><code>&lt;service android:name="".MyService""&gt;&lt;intent-filter&gt; &lt;action android:name=""android.intent.action.PICK"" /&gt; &lt;category android:name=""android.intent.category.DEFAULT""  /&gt; &lt;data android:path=""/external/images/media"" android:scheme=""content"" /&gt; &lt;/intent-filter&gt;&lt;/service&gt;</code></pre><p>This intent filter does not work and I don't know why. What is the correct intent filter/how can I find it? </p>","283494","","","","","2010-03-01 12:30:48","Finding the right intent filter","<android><android-manifest><intentfilter>","1","0","1","",""
"2355047","1","2355345","","2010-03-01 10:12:09","0","690","<p>I'd like to know if we can write a short boolean test wich return true if sms/inbox is empty or not.something like Databse(""content://sms/inbox"")==null?Thank's for your answer!</p>","283517","","","","","2010-03-01 11:11:00","How check if sms/inbox is empty?","<android><sms><inbox>","2","0","","",""
"2355314","1","","","2010-03-01 11:05:06","-1","12109","<p>I have added image in android, but it is fitting to middle of the screen, what can I do to set it for full screen?</p><p>what is wrap_content and fill parent, I'm not getting how to do this.</p><p>This is my code</p><pre><code>&lt;ImageView       android:scaleType=""fitCenter""    android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:src=""@drawable/my_image"" android:cropToPadding=""false""/&gt;</code></pre>","283542","","1715579","","2013-04-15 03:46:58","2013-04-15 03:46:58","android resize image","<android>","3","0","","",""
"2355341","1","","","2010-03-01 11:09:58","0","194","<p>friends,</p><p>i am using following code to display progress on andorid activity when i call web service method to getposts it show progress. but when call of serivce is complete my application gets crashed.</p><p>please guide what mistake am i doing or any other alternative way to achieve this goal?</p><pre><code>mProgressStatus = 0;  Thread th=new Thread(new Runnable() {   public void run() {    if (mProgressStatus &lt; 100) {     myProgressBar.setVisibility(View.VISIBLE);    } else {     myProgressBar.setVisibility(View.GONE);    }   }  });    th.start();  results = p.GetPosts(p, PageSize, adap.getCount());  mProgressStatus=100;</code></pre><p>th.stop();</p>","249991","","","","","2011-09-29 07:11:11","progress related problem in android using Threading!","<android><progress-bar>","2","2","","",""
"2355690","1","2356134","","2010-03-01 12:24:10","3","199","<p>I have started using custom intents in my application and I have come across a bit of a problem.</p><p>When I send a custom intent I register a Broadcast Receiver and I catch the intent no problem.</p><p>However problems seem to appear when I send the intent again, the Broadcast Reciever seems to register two events of the intent and so on so if the intent is sent a third time I recieve it 3 times.</p><p>This is causing major problems in my application and was wondering is it normal and there is some way I have to deal with it?</p><p>Here is my code:</p><hr><p>To Send the Intent:</p><pre><code>Intent i = new Intent();i.setAction(SIP_INCOMING_CALL_CANCEL_INTENT);sendBroadcast(i);</code></pre><hr><p>To receive the Intent:</p><pre><code>sipIncomingListener = new BroadcastReceiver(){   @Override   public void onReceive(Context context, Intent intent) {      String action = intent.getAction();       if(CallDialogActivity.SIP_INCOMING_CALL_ANSWER_INTENT.equals(action)){         Log.d(""SIPENGINE"", ""CALL CONNECTED SENT FROM INITINCOMINGLISTENER()"");      }     };IntentFilter filter = new IntentFilter(CallDialogActivity.SIP_INCOMING_CALL_CANCEL_INTENT);registerReceiver(sipIncomingListener, filter);</code></pre><p>Is there anyway to make sure the Intent is only fired once??</p>","243999","","114066","","2010-08-02 07:50:34","2010-08-02 07:50:34","Android - Intents somehow incrementing?","<android><android-intent><broadcast><broadcastreceiver><intentfilter>","1","0","","",""
"2355884","1","","","2010-03-01 12:56:52","3","2119","<p>Android doc say:""When the system, rather than the user, shuts down an activity to conserve memory, ... ""But how to simulate this situation?I want to debug the onRestoreInstanceState method,but don't know how to.Any advice is appreciated!Thanks!</p><p>L.J.W</p>","275756","","","","","2013-06-14 21:17:17","How to simulate killing activity to conserve memory?","<android>","3","0","0","",""
"2355923","1","","","2010-03-01 13:03:13","4","208","<p>i can locate the pin for corresponding locations in mapview.</p><p>i want to animate that pin dropping down onto the map ?</p><p>how to use animation for that? </p><p>any idea? </p>","267269","","267269","","2010-03-08 13:51:20","2010-03-11 14:16:29","drop pin on mapView in android? how?","<android><android><android-mapview><animation>","2","2","4","",""
"2356084","1","2356760","","2010-03-01 13:31:45","21","48489","<p>I'm using this code to retrieve all contact names and phone numbers:</p><pre><code>String[] projection = new String[]{    People.NAME,    People.NUMBER};Cursor c = ctx.getContentResolver().query(People.CONTENT_URI, projection, null, null, People.NAME + "" ASC"");c.moveToFirst();int nameCol = c.getColumnIndex(People.NAME);int numCol = c.getColumnIndex(People.NUMBER);int nContacts = c.getCount();do{  // Do something} while(c.moveToNext());</code></pre><p>However, this will only return the primary number for each contact, but I want to get the secondary numbers as well. How can i do this?</p>","265990","","2176945","","2013-10-16 06:39:45","2014-04-17 12:24:46","Read all contact's phone numbers in android","<android><numbers><contacts>","7","0","17","",""
"2356091","1","2356202","","2010-03-01 13:33:07","8","12465","<p>I have an ArrayAdapter (myAdapter) attached to an AutoCompleteTextView (textView) component.<br>Once the user presses a character I would like to populate AutoCompleteTextView's drop down list with items containing this character.<br>I retrieve the items using AsyncTask (which uses a web service).</p><p>I call myAdapter.add(item) but the drop down list is empty.<br>I added a call myAdapter.getCount() after each addition and it shows zero every time.Calling notifyDataSetChanged() didn't help.<br>I even tried to add simple String objects instead of my custom objects, to no avail.<br>What am I doing wrong?   </p><p><strong>Edit:</strong> I changed the code as miette suggested below but still to no avail.<br>Generally, what I do is after text is changed in my auto complete text view, I call a new AsyncTask and pass it the entered text and a Handler (see afterTextChanged()). The task retrieves objects relevant to the text and once done the Handler's handleMessage() is called. In handleMessage() I attempt to populate the adapter's objects. But still the adapter's drop down list ends up empty.</p><p>Here is my code:  </p><pre><code>public class AddStockView extends Activity        implements OnClickListener, OnItemClickListener, TextWatcher {      ArrayAdapter&lt;Stock&gt; adapter;    AutoCompleteTextView textView;    Vector&lt;Stock&gt; stocks;    public AddStockView() {      // TODO Auto-generated constructor stub      stocks = new Vector&lt;Stock&gt;();    }    public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      requestWindowFeature(Window.FEATURE_NO_TITLE);       setContentView(R.layout.add_stock_view);      findViewById(R.id.abort_button).setOnClickListener(this);      adapter = new ArrayAdapter&lt;Stock&gt;(this,      android.R.layout.simple_dropdown_item_1line, stocks);      //adapter.setNotifyOnChange(true);      textView = (AutoCompleteTextView)      findViewById(R.id.search_edit_text);      textView.setAdapter(adapter);      textView.setOnItemClickListener(this);      textView.addTextChangedListener(this);    }    @Override    public void onClick(View v) {      // TODO Auto-generated method stub      switch (v.getId())      {        case R.id.abort_button:        finish();        break;        case R.id.search_edit_text:        break;      }    }    @Override    public void onItemClick(AdapterView&lt;?&gt; parent, View v,                            int position, long id) {      // TODO Auto-generated method stub      Stock stockToAdd = (Stock)parent.getAdapter().getItem(position);      //TODO: Add the above stock to user's stocks and close this screen      finish();    }    @Override    public boolean onCreateOptionsMenu(Menu menu) {        super.onCreateOptionsMenu(menu);        getMenuInflater().inflate(R.layout.menu, menu);        CategoryMenu.getInstance().populateMenu(menu);      return true;      }      @Override      public boolean onOptionsItemSelected(MenuItem item) {        CategoryMenu.getInstance().menuItemSelected(item, this);      return false;     }      @Override      public boolean onPrepareOptionsMenu(Menu menu) {       return true;      }    @Override    public void afterTextChanged(Editable text) {      // TODO Auto-generated method stub      if (text.toString().equals(""""))        return;      new AppTask().execute(new AppTask.Payload(Consts.taskType.SEARCH_STOCK,                                          new Object[] {text, handler}, this));    }    @Override    public void beforeTextChanged(CharSequence a0, int a1, int a2, int a3) {      // TODO Auto-generated method stub    }    @Override    public void onTextChanged(CharSequence a0, int a1, int a2, int a3) {      // TODO Auto-generated method stub    }    private void addStockItemsToAdapter(Vector&lt;Object&gt; dataItems)    {      for (int i = 0; i &lt;dataItems.size(); i++)      {        Stock stk = (Stock)dataItems.elementAt(i);        stocks.add(stk);      }    }    public void populateAdapter()    {      addStockItemsToAdapter(ContentReader.getInstance.getDataItems());          adapter.notifyDataSetChanged();      int size = adapter.getCount(); // size == 0 STILL!!!!      textView.showDropDown();    }    final Handler handler = new Handler() {      public void handleMessage(Message msg) {        populateAdapter();      }    };}</code></pre><p>Thanks a lot, Rob</p>","283630","","13531","","2011-06-14 21:46:17","2012-08-27 16:04:33","Android, add() function of ArrayAdapter not working","<android>","3","0","4","",""
"2356149","1","2356221","","2010-03-01 13:43:14","2","3105","<p>I am validating an AlertDialog, and I would like to raise a Toast on top of the AlertDialog display.</p><p>I have this code, but the Toast is displayed on the activity</p><pre><code>new AlertDialog.Builder(this).setTitle(R.string.contact_groups_add)                .setView(addView).setPositiveButton(R.string.ok,                        new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog,                                    int whichButton) {                                if (wrapper.getTitle().length()&gt;0)                                {                                    processAdd(wrapper);                                } else {                                    Toast.makeText(getApplicationContext(), ""Name is required"", Toast.LENGTH_SHORT).show();                                }                            }                        }).setNegativeButton(R.string.cancel,                        new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog,                                    int whichButton) {                                // ignore, just dismiss                            }                        }).show();</code></pre>","243782","","","","","2012-04-16 19:42:07","How to raise a Toast on top of a AlertDialog?","<java><android><android-sdk-2.1><toast>","2","0","","",""
"2356261","1","","","2010-03-01 13:59:54","15","1659","<p>As the title says, how ""good"" is the Android emulator?</p><p>I don't have an Android phone but would it be possible to develop purely using the emulator as the testing environment?</p><p>My initial questions about it:</p><ul><li>Is the emulator as responsive as a normal android phone (of course this depends on the exact phone but in general)?</li><li>Is there a way to control the memory on the emulator?</li><li>Has anyone had issues that have been flagged on the phone but not the emulator? or vice versa?</li><li>What's your normal testing procedure to test on both throughout, or emulator recursively and phone at the end?</li></ul><p>Any feedback would be appreciated.</p><p>Thanks,</p>","203473","","","","","2012-07-11 09:20:56","How ""good"" is the Android Emulator?","<android><testing><android-emulator>","6","0","4","2012-07-30 15:11:43",""
"2356685","1","2356828","","2010-03-01 15:07:13","0","694","<p>I am developing an application that needs to constantly run a service unless the user consciously deactivates it. The problem is that there are taskkiller-apps with a ""kill all applications""-button. These seem to become increasingly popular, and they are causing me a fuzz. When I kill my service with som task managers, onDestroy() is never run and all AlarmManagers are killed with the service. Is there any way to protect my service from these apps, or to restart my service immediately after it is killed?</p>","249871","","","","","2011-02-06 13:28:41","Protect my service from taskkiller-apps","<android><service>","2","0","1","",""
"2356689","1","","","2010-03-01 15:07:42","1","115","<p>i have two Activities A and B and one Service C. A starts B. </p><p>A and B: </p><ul><li>are binding and unbinding to the Service in <code>onStart()/onStop()</code>. </li><li>are implementing a <code>Handler</code>-Object that works with Messages. The Handler is needed, so if C is doing Work and the Result is there, it will give back a result or message to A or B. </li><li>are implementing a <code>ServiceConnection</code>-Object. In the Method <code>onServiceConnected</code> from the <code>ServiceConnection</code>-Object, the Handler will be given to the Service C. </li><li>If i leave A or B, the Handler for the Service will be set to Null in <code>onStop()</code>. This is because the Activity is not active anymore, so it can not use the Result to do something for example showing a Dialog.</li></ul><p>I have following Problem: </p><ul><li>If i start A and use a function from C everything works fine. Resultdialog is showing up.</li><li>If i start B from A, also everything works fine. Resultdialog is showing up.</li><li>Now if i press Back to go back to A, then C cannot contact A, cause the handler is still set to null. No Handler created Dialog is showing up.</li></ul><p>I think it has to do something with the order of the lifecycle-methodcalls. <code>onStart()</code> for the new Activity is getting called before <code>onStop()</code> from the old activity.</p>","275595","","","","","2010-12-03 21:24:24","When to reset a callbackhandler for a Service","<android>","1","1","","",""
"2356699","1","2446503","","2010-03-01 15:09:01","1","2797","<p>Using progress_horizontal.xml as a base drawable for my seekbar i was able to customize it pretty well. But unfortunately i stuck with the following problem. I need my progress to be made from two horizontal lines with different color something like this <a href=""http://picasaweb.google.com/manigoad/Other#5442553107070487330"" rel=""nofollow"">http://picasaweb.google.com/manigoad/Other#5442553107070487330</a> . In this case a blue line and transparent line below it.</p><p>So how can i make my progress to be made from two different colors.Tnaks</p>","184601","","","","","2010-03-15 14:46:22","seekbar progress customization","<android><seekbar>","1","0","2","",""
"2357092","1","2357130","","2010-03-01 16:02:14","2","2088","<p>friends,</p><p>i want to delete file data that i have created in android application.</p><p>if my application is terminated abnomally or nomally?</p><p>any help would be appriciated.</p>","249991","","","","","2010-03-01 16:07:23","how to perform some task on exit of application(normal or abnomal) in android?","<android>","1","0","","",""
"2357282","1","","","2010-03-01 16:28:29","4","1591","<p>I'm wondering how programmatic sdcard mounting/unmounting can be achieved while the handset is connected to a pc via USB.</p><p>I cannot find any managed api for that and also my jni attempts failed with <strong>errno: 1, [Operation not permitted]</strong> error.</p><p>Thanks</p>","","user283748","","","","2010-08-11 13:33:50","Programmatic sdcard mounting/unmounting","<android>","1","3","1","",""
"2357623","1","2362893","","2010-03-01 17:13:33","2","2245","<p>I followed the instructions from the google hellomapview tutorial. I get a working mapview etc. But the two items that are added to the map are not shown. It seems they are there somewhere because tapping at the specified location shows the message that was added to the items.</p><p><strong>Edit</strong></p><p>Here is my source code. It should be very close to the google tutorial source code. </p><pre><code>public class MapOverlay extends ItemizedOverlay&lt;OverlayItem&gt; {private List&lt;OverlayItem&gt; overlays = new ArrayList&lt;OverlayItem&gt;();private Context context;public MapOverlay(Drawable defaultMarker, Context context) {    super(defaultMarker);    overlays = new ArrayList&lt;OverlayItem&gt;();    this.context = context;}@Overrideprotected OverlayItem createItem(int i) {    return overlays.get(i);}@Overridepublic int size() {     return overlays.size();}public void addOverlay(OverlayItem overlay) {    overlays.add(overlay);    this.populate();}@Overrideprotected boolean onTap(int index) {  OverlayItem item = overlays.get(index);  AlertDialog.Builder dialog = new AlertDialog.Builder(this.context);  dialog.setTitle(item.getTitle());  dialog.setMessage(item.getSnippet());  dialog.show();  return true;}}public class MapsActivity extends MapActivity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    MapView mapView = (MapView) findViewById(R.id.mapview);    mapView.setBuiltInZoomControls(true);    MapOverlay overlay = new MapOverlay(this.getResources().getDrawable(            R.drawable.androidmarker), this);    overlay.addOverlay(new OverlayItem(new GeoPoint(19240000,-99120000), ""Blubb"", ""See?""));    mapView.getOverlays().add(overlay);}@Overrideprotected boolean isRouteDisplayed() {    return false;}}</code></pre><p>Is the source code from the google tutorial available somewhere?</p>","114066","","114066","","2012-02-01 14:10:54","2012-02-01 14:10:54","Why are my overlays on a mapview not shown?","<android><android-maps><android-mapview>","2","0","","",""
"2357893","1","","","2010-03-01 17:58:01","0","1314","<p>I am trying to get the images to have transparent backgrounds so the map is not blocked by a square marker with an image in it. What image editor and what settings should I use to get this to work?</p><p>I am trying to do some custom backgrounds for buttons and the same problem comes up: I get square corners and a background that does not scale with the buttons.</p><p>I think this all part of the same problem: I am not using the right tool with the right settings to create the images. I must be misinterpreting the documentation and examples that talk about a white border around the image and a black line along the top and left side for the expandable button background.</p><p>Here's a quick way to reproduce the problem:</p><p>Follow the directions to create the MapView program as described on:<a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a></p><p>For the icon I first used the image copied from the page:</p><p>Next I edited the picture in Microsoft Paint, and cut off the little guy's antennae. I'm not cruel and no real androids were harmed in that experiment. I surrounded the new picture with a pixel thick border of white, copied from the border that was around the rest of the image, and then copied the black that was there as well in the void areas of the image, outside the border.</p><p>I saved the image as myandroid.png and copied the file to the layout folder. Pointed the activity to the new pic and ran the program.</p><p>The image was displayed with a full square background and shadow, not the android shaped image and shadow that was there when the original image was used.</p><p>Custom Button background:Follow the directions for the Relative Layout example at:""http://developer.android.com/resources/tutorials/views/hello-relativelayout.html""</p><p>Next, I created an image to expand as a background for the button called backbutton.png. It too is surrounded by a white border and black filled on the corners, the top and one side per documentation I found in ""Android Programming Tutorials"" on page 298.</p><p>The background does not expand, nor do the corners round.</p><p>I wish I could show you screenies of what I have.</p><p>How do you create the images for the custom backgrounds and the images for the custom map markers and buttons? I need to know what image editor to use and the file attributes to set, so the images expand and display with the proper void spaces in them.</p><p>Thank you in advance. </p>","256206","","14343","","2010-07-21 11:53:43","2010-07-21 11:53:43","Custom Map markers and custom backgrounds","<android><google-maps-markers><markers>","2","0","","",""
"2357934","1","2364082","","2010-03-01 18:06:46","1","943","<p>Look to identify the user, email, or phone identifier from Android 1.5.  I've seen how to access account information from 2.0 and above but need this functionality in 1.5.</p>","258055","","","","","2010-03-02 15:07:26","Accessing Unique Identifier (either user, email, or phone) for Android phone in v1.5","<android><account><user-accounts>","1","0","","",""
"2358068","1","","","2010-03-01 18:29:01","1","2143","<p>Hello I would like to downsample 16 bit pcm audio to 8 bit and then upsample the same from 8 bit back to 16 bit in android. I am using this which seems to work: </p><pre><code>int tempint;for (int i=1, j=0; i&lt;tempBuffer.length; i+=2, j++){    tempint = ((int) tempBuffer[i]) ^ 0x00000080;    tempBuffer[j] = (byte) tempint;     Log.e(""test"",""------------* COUNTER -&gt; ""+j+"" BUFFER VALUE -&gt; ""+tempBuffer[j]+""*-----------"");} </code></pre><p>where tempbuffer is a short [] and tempint is an int.        Can anyone tell me if this works fine because I am a starter, also I am using this to convert the byte [] back to a short [] </p><pre><code>for (int x=1, j=0; x&lt;music.length; x+=2, j++){    tempint = ((int) music[x])&amp; 0xFF;    music[j] = tempint.shortValue();    Log.e(""maxsap"",""------------*""+ music[j]+""*-----------"");}</code></pre><p>which I am not sure it is working.</p>","234898","","253056","","2010-03-01 19:09:10","2010-03-01 19:09:38","Downsample 16-bit pcm audio to 8-bit in android","<android><audio><pcm>","1","0","3","",""
"2358459","1","","","2010-03-01 19:28:38","0","1309","<p>I am having trouble understanding content providers in Android.</p><p>Do you use intents to call content providers as well as managed queries?</p><p>Also, an activity has an intent filter.  The intent filter has a  element which has a  mimeType attribute.  How does Android know which content provider this mimetype is referring to?<br>The  tag in the manifest just lists an authority but not the full content_uri.  Further, the content_uri is typically defined in an encapsulated class that seems to only consist of constants but no methods, so I don't see how that links over to the content provider class.</p><p>Thanks</p>","283857","","","","","2010-03-01 20:42:59","Content Provider in Android basic questions","<android>","1","0","1","",""
"2358460","1","2358972","","2010-03-01 19:28:42","6","2512","<p>Hopefully this should be an easy question. I'm trying to copy a series of small bitmaps into a larger one, arranging them side by side without any gaps or overlap in their pixels. For example, if I have 3 square bitmaps, I'd like to copy them into one long and thin rectangle. I know how to do the opposite, namely creating a small bitmap out of a larger one, but not this way around. What's the right command?</p><p>(If anyone's curious, I want to do this to be able to reuse some code I wrote for handling animation with a single bitmap.)</p><p>Thanks!</p>","235654","","235654","","2010-03-19 15:34:41","2010-03-19 15:34:41","How to copy a smaller bitmap into a larger one?","<android><canvas><bitmap>","1","0","1","",""
"2358744","1","","","2010-03-01 20:13:52","3","1980","<p>I have a ado.net data service created using VS 2008 sp 1 that is hosted that I want to consume via HTTP and JSON from Android 2.1? Does anyone have sample code on how to do CRUD operations easily do this? I heard Restlet makes this very easy but can't seem to find sample Android code on doing this. If someone can post a tutorial with some actual code that would be greatly appreciated.</p>","157785","","","","","2012-09-13 11:08:06","Consume ado.net data service from android 2.1","<java><android><json><wcf-data-services><restlet>","3","0","4","",""
"2358745","1","2427666","","2010-03-01 20:13:53","13","3180","<p>I had a bunch of code in an activity that displays a running graph of some external data. As the activity code was getting kind of cluttered, I decided to extract this code and create a <code>GraphView</code> class:</p><pre><code>public class GraphView extends LinearLayout {    public GraphView(Context context, AttributeSet attrs) {        super(context, attrs);        LayoutInflater inflater = (LayoutInflater)                context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        inflater.inflate(R.layout.graph_view, this, true);    }    public void start() {        // Perform initialization (bindings, timers, etc) here    }    public void stop() {        // Unbind, destroy timers, yadda yadda    }        .        .        .}</code></pre><p>Moving stuff into this new <code>LinearLayout</code>-derived class was simple. But there was some lifecycle management code associated with creating and destroying timers and event listeners used by this graph (I didn't want this thing polling in the background if the activity was paused, for example).</p><p>Coming from a MS Windows background, I kind of expected to find overridable <code>onCreate()</code> and <code>onDestroy()</code> methods or something similar, but I haven't found anything of the sort in LinearLayout (or any of its inherited members). Having to leave all of this initialization code in the Activity, and then having to pass it into the view seemed like it defeated the original purpose of encapsulating all of this code into a reusable view.</p><p>I ended up adding two additional public methods to my view: <code>start()</code> and <code>stop()</code>. I make these calls from the activity's <code>onResume()</code> and <code>onPause()</code> methods respectively.</p><p>This seems to work, but it feels like I'm using duct tape here. Does anyone know how this is typically done? I feel like I'm missing something...</p>","264540","","264540","","2010-03-01 20:49:36","2012-11-16 18:34:20","How to manage lifecycle in a ViewGroup-derived class?","<android>","3","0","2","",""
"2358990","1","","","2010-03-01 20:52:29","0","446","<p>In my android app, I have a preferenceScreen with some checkboxes , defined in a xml file , and a class that implements ""SharedPreferences.OnSharedPreferenceChangeListener"" . What I want to do is to select a checkbox and all the others to be selected as well. In the above listener I am able to modify the other checkboxes's state to selected, but my view remains unchanged. What should/could I do to achieve this ?</p>","284609","","","","","2010-03-01 21:04:56","android Preference","<android>","1","0","","",""
"2359176","1","2359749","","2010-03-01 21:26:03","21","37639","<p>i want an EditText which creates a DatePicker when is pressed. So i write the next code:</p><pre><code>    mEditInit = (EditText) findViewById(R.id.date_init);    mEditInit.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            showDialog(DATEINIT_DIALOG);        }    });</code></pre><p>But when i press the EditText the action is the typical: a cursor waiting for typing text instead show the Dialog i want.</p><p>Any idea?</p><p>Thanks</p>","258863","","","","","2013-09-08 06:23:09","Android EditText onClickListener","<android><edittext>","9","1","6","",""
"2359514","1","","","2010-03-01 22:18:50","6","652","<p>I want to store locations in my Android phone and be able for the application to tell me if I am inside these points&amp;radius.</p><p>What is the best way to store many point&amp;radius locations and efficiently query for them?</p>","229414","","","","","2010-03-22 13:06:14","How may I store geographical data in an android database and query for it?","<android><storage><gis>","1","0","3","",""
"2359762","1","2359789","","2010-03-01 23:00:46","3","2924","<p>Is there any way to detect whether an android phone is in sleep mode (screen is black) in the code?I wrote a home screen widget. I don't want the widget gets updated when the screen is black to save the battery consumption.</p><p>Thanks.</p>","256239","","","","","2012-03-21 12:13:39","How to detect whether the phone is in sleep mode in the code?","<android>","2","0","2","",""
"2359793","1","","","2010-03-01 23:07:54","0","822","<p>I've a list view with custom list adapter (<code>list_item.xml</code>). I have multiple layout folder to support multiple screen size. I found out when I inflate using <code>LayoutInflater</code>, it's always taking the view from main ""layout"" folder. </p><p>I've a phone with screen size ""427x320"". This is my code:</p><pre><code>private LayoutInflater mInflater;public ListAdapter(Context context, MenuPage menuPage, Activity activity) {        // Cache the LayoutInflate to avoid asking for a new one each time.        mInflater = LayoutInflater.from(context);}public View getView(final int position, View convertView, ViewGroup parent) {        convertView = mInflater.inflate(R.layout.list_item, null);}</code></pre><p>How do I get the layout inflater to pick the <code>list_item.xml</code> from ""layout-427x320"" folder and not the ""layout"" folder?</p>","278445","","309308","","2010-12-17 07:45:01","2011-06-10 08:29:38","LayoutInflator issue","<android><layout>","1","0","","",""
"2359895","1","2361271","","2010-03-01 23:30:30","86","38411","<p>I'm writing my first Android app for a small business that has some Droid phones. I set up an  AVD for the phone with the right resolution: 854 pixels high. I'm working on a MacBook Pro with a max screen resolution 900 pixels high. So when the emulator starts up, the bottom is cut off. </p><p>Is there a way to scale the emulator display down to 75% or something so that it fits on my screen? Any other solution (other than running everything on the phone itself)?</p>","64193","","","","","2014-03-01 11:42:34","Android emulator screen too tall","<android><emulator>","8","1","29","",""
"2359974","1","","","2010-03-01 23:46:32","1","1311","<p>In my <strong>Activity's</strong> <code>onCreate</code> i have  </p><pre><code>  public void onCreate() {    try    {        FIStream = super.openFileInput(""4.png"");        MyImagePort.load(FIStream);        FIStream.close();           FIStream = null;    } catch (FileNotFoundException e) {        Log.w(""spriter"",""File not found"");    } catch (IOException e) {        e.printStackTrace();    }    }</code></pre><p>Which seems to work fine.</p><p>But then my <strong>Activity</strong> Overrides <code>onPause</code>..  </p><pre><code>@Override    public void onPause(){    super.onPause();    DoAutoSave();}private void DoAutoSave() {    try {    FOStream = new FileOutputStream(""\\sdcard\\spriter\\4.png"");    } catch (FileNotFoundException e) {    e.printStackTrace();    }     MyImagePort.SetAutoSaveFileStream(FOStream); }  </code></pre><p>The problem is, <code>FOStream</code> above never recieves a <code>OutputStream</code> and is always <code>null</code>. what am i doing wrong please</p>","263111","","2617352","","2013-12-19 07:54:41","2013-12-19 07:54:41","Saving an bitmap using OutputStream on Android, on following Activities onPause.","<android><image><bitmap><save>","0","0","","",""
"2360073","1","3106035","","2010-03-02 00:06:22","2","831","<p>What is more expensive to load in a Gallery, a Bitmap or Drawable???</p>","","Alexi","","","","2010-06-23 22:33:11","What is more expensive to load in a Gallery, a Bitmap or Drawable?","<android><android-widget>","1","0","","",""
"2360460","1","","","2010-03-02 02:05:24","1","864","<p>I'm writing an Android application. One problem is your app cannot contain a file whose uncompressed size is bigger than about 1Mb. I have a serialized object that I want to load that totals about 2Mb. My plan was to split this file into two smaller files, then load the object by combining both files at runtime.</p><p>However, I cannot work out how to use e.g. InputStream and ObjectInputStream to specify that I want to read the data from two input streams. How can I do this?</p><p>For example, say my object was split between file O1 and O2. How can I say ""Load the object by reading the data from O1 then from O2""?</p>","284055","","2405","","2010-03-02 02:26:22","2010-03-02 02:55:30","Reading Java serialized object that has been split across two files?","<java><android><serialization>","2","4","1","",""
"2360498","1","2361172","","2010-03-02 02:15:36","4","17977","<p>How to load an image file (on SD card) into a Bitmap on Android?</p>","116339","","","","","2010-03-02 05:54:35","How to create a Bitmap from an image file in Android","<android><image><bitmap>","1","0","","",""
"2360538","1","","","2010-03-02 02:27:47","7","1282","<p>I'm working on some apps for the android platform and I have two problems that I'm not quite sure how to approach, and both are closely related.</p><ol><li><p>How can I send a relatively small data file from one android device to another (preferably over the internet or directly through wireless network)?</p></li><li><p>Is it possible to create a temporary p2p live data stream from one android device to another?  An example application would be to stream low-res video from phone A's camera to phone B, or audio.</p></li></ol><p>I would much appreciate being pointed in the right direction on either issue (File transfer or real time data transfer).</p>","131871","","","","","2011-06-22 08:13:33","How to utilize network for p2p file sharing on Android Platform?","<android><networking><p2p>","5","0","2","",""
"2360608","1","2360634","","2010-03-02 02:52:04","0","1883","<p>The Home sample in the android sdk doesn't implement the Add item, which bring up the ""Add to home screen"" popup window, and Notifivcations item in onCreateOptionsMenu and onOptionsItemSelected.</p><p>How to do that like the default home?</p><p>Thanks!</p>","266884","","","","","2010-03-02 02:59:16","How to show the ""add to home screen"" popup window and notifications like the buildin home?","<android>","1","0","","",""
"2360656","1","2360687","","2010-03-02 03:06:56","1","140","<p>Looking to see if there's an existing method or application to increase display size for all applications for people with bad vision.</p><p>Thanks!</p>","231768","","","","","2010-03-02 03:16:54","Is there an android application (or method) which can increase the display size for all other apps?","<android><accessibility>","1","2","","",""
"2360906","1","","","2010-03-02 04:28:23","0","550","<p>Hi I just read your post <a href=""http://stackoverflow.com/questions/1953888/bluetooth-connect-to-a-rs232-adapter-in-android"">http://stackoverflow.com/questions/1953888/bluetooth-connect-to-a-rs232-adapter-in-android</a> and I think you probably can help me figure out my little problem.</p><p>I have this BT module connected to a MCU via serial port UART. Im trying to connect to the bluetooth via my android phone. I managed to use my app and scan BT devices. The scanner (based on BTchat) gives me the MAC. How can I know my device UUID ? It is SPP device also. </p><p>Thank you</p>","284117","","","","","2010-06-21 16:11:02","Question about bluetooth on Android","<android><osx><bluetooth><uuid><ssp>","1","0","","",""
"2361146","1","8519009","","2010-03-02 05:47:14","9","7728","<p>I do not have the property android:state_enabled for any of the controls. Typing it manually doesn't work either. I can only use the deprecated android:enabled.</p><p>I have the latest everything.</p>","274972","","741249","","2012-05-03 11:39:11","2013-06-09 14:36:12","android:state_enabled missing/not working?","<android><xml><properties><state>","3","0","3","",""
"2361205","1","2363217","","2010-03-02 06:08:14","6","5535","<p>I have multiple radio buttons which I want to layout using a table but also include them in a single radio group. I have the following xml layout:</p><pre><code>&lt;RadioGroup android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:orientation=""vertical""      android:id=""@+id/Group1""&gt;    &lt;TableLayout android:id=""@+id/RadioButtons""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt;        &lt;TableRow&gt;            &lt;RadioButton android:id=""@+id/rad1""                 android:text=""RButton1""                 android:layout_width=""105px""                 android:layout_height=""wrap_content""                 android:textSize=""13px""&gt;&lt;/RadioButton&gt;            &lt;RadioButton android:id=""@+id/rad2""                 android:text=""RButton2""                 android:layout_width=""105px""                 android:textSize=""13px""                 android:layout_height=""wrap_content""&gt;&lt;/RadioButton&gt;            &lt;RadioButton android:id=""@+id/rad3""                 android:text=""RButton3""                 android:layout_width=""105px""                 android:textSize=""13px""                 android:layout_height=""wrap_content""&gt;&lt;/RadioButton&gt;        &lt;/TableRow&gt;      &lt;/TableLayout&gt;&lt;/RadioGroup&gt;  </code></pre><p>But unfortunately the radio buttons inside the table seem to ignore the fact that they're inside of the RadioGroup tags and because of this you can select more than one radio button at the time. I noticed that by removing the table and just having the radio buttons it works just fine. How can I overcome this? Would it be as simple as declaring the radio group inside of the table instead of outside? Thanks for any help. </p>","278447","","278447","","2010-03-02 06:14:03","2013-08-14 10:18:35","How to add a radio group to radio buttons inside of a table?","<xml><android>","3","0","1","",""
"2361485","1","2362794","","2010-03-02 07:25:07","0","3462","<p>In the stock music player in Android 2.1 (at least), the artist, album, and track name of the currently playing track are long clickable, which brings up a context menu ""Search for <em>NN</em> with:"", with links to different apps.</p><p><strong>UPDATE</strong></p><p>I've managed to extract the logs from my own device, doing a search for an artist, and selecting Google Listen to complete the action:</p><pre><code>03-02 11:59:34.551 I/ActivityManager(   86): Displayed activity com.android.music/.MediaPlaybackActivity: 1758 ms (total 1953 ms)03-02 11:59:35.691 I/ActivityManager(   86): Starting activity: Intent { act=android.intent.action.CHOOSER cmp=android/com.android.internal.app.ChooserActivity (has extras) }03-02 11:59:36.781 I/ActivityManager(   86): Displayed activity android/com.android.internal.app.ChooserActivity: 1036 ms (total 1036 ms)03-02 11:59:38.191 I/ActivityManager(   86): Starting activity: Intent { act=android.intent.action.MEDIA_SEARCH flg=0x13000000 cmp=com.google.android.apps.listen/.SearchListActivity (has extras) }03-02 11:59:38.511 D/Listen  (  491): Request search results for http://lfe-alpo-gm.appspot.com/search?q=Finntroll</code></pre><p>I will definitely pursue this myself, but this is quite new to me. I'd appreciate assistance here. Does the above mean that as long as I set up <code>MEDIA_SEARCH</code> intent as an entry point for an activity, it'll show up in the select list?</p>","133802","","133802","","2010-03-02 11:17:02","2010-03-02 11:40:41","Android native music player search intent","<android><android-music-player>","1","0","1","",""
"2361497","1","2491934","","2010-03-02 07:28:20","1","6547","<p>friends,</p><p>can any one guide me how can i enter only alphabets in EditText in android?</p><p>any help would be appriciated.</p>","249991","","","","","2014-01-01 12:30:06","how to create EditText accepts Alphabets only in android?","<android><layout>","5","0","1","",""
"2361509","1","","","2010-03-02 07:32:01","5","7008","<pre><code>&lt;TextViewandroid:id=""@+id/first_name""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:background=""@color/black""android:textColor=""@color/light_grey""android:text=""FirstName""&gt;&lt;/TextView&gt;TextView first_text_view;first_text_view = (TextView)this.findViewById(R.id.first_name);try {first_text_view.setText(""Android"");}catch(Exception e) {}</code></pre><p>i got the nullpointer exception.</p><p>what is solution for this. please reply me</p>","268741","","19750","","2010-03-02 07:33:09","2010-03-02 07:41:20","android textview settext show nullpointer exception","<android><textview>","1","0","","",""
"2361602","1","","","2010-03-02 07:55:06","9","10604","<p>I'm trying to set the transparency of a texture on a quad in opengl, playing with the blend functions didn't help neither did anything on google. Any suggestions?</p>","284196","","","","","2012-01-18 00:32:30","Transparent texture in OpenGL ES for Android","<android><opengl-es>","3","0","5","",""
"2361728","1","","","2010-03-02 08:31:10","4","11996","<p>when I run my android application using eclipse 3.5 I receive an error called</p><p>""Android AVD Error.</p><p>No compatible target were found.Do you wish to add a new Android Virtual Device.""</p><p>How can I load Android Virtual Device ?</p>","284208","","","","","2010-03-02 11:17:55","Can't load Android Virtual Device","<android>","1","0","1","",""
"2361736","1","","","2010-03-02 08:33:17","2","1383","<p>I have developed a little application that can play video from a rstp streaming sever (darwin in this case, but this is not relevant) by means of the VideoView widget (I have tried Mplayer+SurfaceView approach too). I use Wifi connection for this.</p><p>The video plays just smooth when <em>video is the only task</em>. The small application should carry out other <strong>tasks at the same time such as continously discover bluetooth devices and call a remote web service</strong> (I am using Ksoap2 for this). When these background taks run at the same time as the video playback the <strong>performance incredibly drops</strong> (the image and sounds sometimes stop and image gets distorted, showing rather big squares instead of proper frames).</p><p>This happens even with low quality videos (3gp at 50 kbps). For the bluetooth discovery I have used both available methods with no performance enhancement over each other:</p><ul><li>Using discovery way provided by SDK 5 and register every found bluetooth device.</li><li>Using a native call to a self written scan() method that takes advantage of <code>hci_inquiry()</code> function provided by Bluez API.</li></ul><p>The call to WS requieres the bluetooth adressess of the discovered devices. The call comes after the discovery has finished.</p><p>I tried to use a GLSurfaceView instead of SurfaceView, but as I am rather new to Android platform, and have no 3D graphic programming mileage, I could not make it work, since I could not find any example of how to use OpenGL ES propertly to playback video and still being able to let Android API control other UI related stuff (Dialogs/Menus/Toasts). On the other hand I do not know if this could indeed improve the playback.</p><p>Any clues or tips of the way I could take?</p><p><strong>Edit</strong>: I forgot to say that I am developing on a Motorola Milestone</p><p><strong>Edit 2</strong>: Following CommonsWare and snctln suggestions I tried to minimize memory footprint of application while not completely leaving out SOAP WS calls.</p><p>Now I try to cache as many objects as possible and only execute call when new BT devices are found (WS need discovered BT devices as input) to minimize GC calls. Video still plays awfully only with Bluetooth discovering active (no WS calls at all).</p><p><strong>Edit 3: Solution</strong>: I modified my application to use UMTS (3G) data connection instead of Wifi when scanning bluetooth devices. Though device accesses public Internet (m.youtube.com) it <strong>plays streaming video far smoother over 3G (from public Internet servers) than over local Wifi (from local streaming server)</strong>. Local streaming server performance is not an issue since streaming to desktop PCs just runs fine. I also upgraded device firmware to 2.0.1 and also experienced some improvement with local Wifi connection, but 3G playback performance still beats Wifi.</p><p>My conclusion is that this device must have some conflicting hardware (maybe same chipset) or software issues when using simultaneous Wifi/Bluetooth communication.</p>","34880","","34880","","2010-03-24 12:47:44","2010-03-24 12:47:44","Streaming video playback performance issues with background tasks on Android","<android><performance><web-services><bluetooth><video-streaming>","2","0","","",""
"2361813","1","2361853","","2010-03-02 08:48:44","0","828","<p>In short, I am writing an Android application that I want to have pull data from a remote database. I was looking into .NET web services, but this <a href=""http://stackoverflow.com/questions/297586/how-to-call-web-service-with-android"">http://stackoverflow.com/questions/297586/how-to-call-web-service-with-android</a> question pointed me away from that direction.</p><p>Is REST as simple as writing some short PHP to handle something like <a href=""https://www.example.com/data.php?employee=michael"" rel=""nofollow"">https://www.example.com/data.php?employee=michael</a> and have it return relevant XML or JSON data? That to me seems like what has been described to me by various sites and videos. Also, is this the best way to do this kind of operation over the internet for mobile devices, desktop applications, etc?</p>","131499","","","","","2010-03-02 14:40:02","Is this how I design REST, and is REST what I want to be using?","<database><android><rest><data-transfer>","2","1","","",""
"2361846","1","2361881","","2010-03-02 08:54:46","18","12274","<p>I've a very simple static web page (only css and links, no scripts).It looks good on android and iphone, but too small. I'm guessing they put it smaller since it work for most of the sites. How can i override this and make him look the size i want it to be?Thanks in advanced,Koby</p>","284235","","2399024","","2014-03-01 13:02:18","2014-03-01 13:02:18","How to scale a website for mobile devices?","<android><css><iphone><mobile-website>","2","2","5","",""
"2361860","1","2361922","","2010-03-02 08:57:18","1","630","<p>In following code, is it possible cause some memory leaks?</p><pre><code>reference-ril.cstatic void requestRadioPower(void *data, size_t datalen, RIL_Token t){    ....    ATResponse *p_response = NULL;    ....    err = at_send_command(cmd, &amp;p_response);   // it's a memory leakage or not ?    ....    at_response_free(p_response);    ....}</code></pre><p>And in other function:</p><pre><code>static void requestOrSendPDPContextList(RIL_Token *t){    ATResponse *p_response;    ....    err = at_send_command_multiline (""AT+CGACT?"", ""+CGACT:"", &amp;p_response);      // it's a leakage or not ?    ....    at_response_free(p_response);    ....}</code></pre><p>Actually, these function will returned before calling at_response_free(p_response) in some cases.I suppose we shout set ATResponse *p_response to NULL first, right ?Set pointer to NULL is a good idea or not?</p>","206630","","","","","2010-03-02 09:30:07","what is the initial value of a pointer in c file","<c><android><embedded>","2","0","","",""
"2361958","1","2362340","","2010-03-02 09:11:39","1","1477","<p>When I put a HorizontalScrollView around a GridView, the GridView gets compressed into a small column on the left. The Gridview's vertical scrollbar even appears on the left. The HorizontalScrollView's width is set to fill_parent and the GridView is also fill_parent. I don't know why this is happening.</p><p>I tried setting the GridView's visibility to GONE and VISIBILE like someone recommended but it doesn't do anything. However if fastScroll is enabled on the GridView, then dragging the fast scroll tab vertically causes the GridView to expand horizontally and it keeps expanding past the last column.</p>","274972","","","","","2011-12-11 11:41:02","HorizontalScrollView shrinks GridView to small line","<android><gridview><scroll><scrollview><horizontalscrollview>","1","0","0","",""
"2361972","1","2362062","","2010-03-02 09:14:15","3","6460","<p>i am creating a Geocoder object like.</p><pre><code>Geocoder geoCoder = new Geocoder(getBaseContext(), Locale.getDefault());</code></pre><p>here i got this error in eclipse. i.e.</p><pre><code>The method getBaseContext() is undefined for the type MyMapOverlay</code></pre><p>getBaseContext() is a default method in android.content.ContextWrapper class.</p><p>what is the problem here.. any idea???</p>","267269","","","","","2011-03-29 13:37:33","The method getBaseContext() is undefined for the type MyMapOverlay in android? why?","<android><android-emulator><android-mapview>","1","0","","",""
"2362460","1","","","2010-03-02 10:35:34","5","20060","<p>I am having a table defined in XML file, which currently set to Scroll vertically. But i also want it scroll horizontally as required.</p><p>Here is the code of XML in use  </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""      android:scrollbars=""vertical""      android:layout_height=""fill_parent""      android:layout_width=""fill_parent""&gt;    &lt;TableLayout        xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:stretchColumns=""0,1,2""        android:id=""@+id/tLayout""        android:scrollbars=""vertical""        &gt;           &lt;TableRow            android:layout_width=""fill_parent""&gt;            &lt;TextView                android:padding=""3dip""                android:gravity=""left""                android:text=""Name""                /&gt;            &lt;TextView                android:padding=""3dip""                android:gravity=""left""                android:text=""Address""                /&gt;            &lt;TextView                android:padding=""3dip""                android:gravity=""left""                android:text=""Age""                /&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/ScrollView&gt;</code></pre>","273548","","","","","2013-01-07 17:43:19","how can we make table layout to scroll both ways ( horizontally, vertically)","<android><android-widget>","3","0","2","",""
"2362469","1","2362483","","2010-03-02 10:37:46","2","131","<p>I have compiled Android source code already  (which I downloaded using GIT)and I am being editing the source code of an Application for testing on Emulatoreach time I wanna see results I have to re-Compile the source code again using 'make'I am pretty sure that there is a way to partly-compile the image</p><p>Notes: I use Ubuntu ,and Android Eclair source</p>","","user284306","","","","2010-03-02 10:40:17","How to update a single (edited) App in a compiled Android image","<android>","1","0","1","",""
"2362487","1","","","2010-03-02 10:40:41","0","2228","<p>in my app i want to delete the sms's/calls of specific numbers i am new to android can any body help me</p>","281307","","","","","2011-04-26 16:07:08","Delete the call/sms log history for specific numbers?","<android>","2","0","","",""
"2362497","1","2362524","","2010-03-02 10:42:10","1","1673","<p>I want to send complex data from my android to a remote server via TCP-sockets. I know that I need to serialize the Objects. In Android this is done via parcelable. But this is an android specific interface and the server only knows the serializable interface. Also vice-versa android doesn't know a serializable interface.</p><p>Both the android and the server must ""know"" the object but they are implemented in two different ways (server--> serializable, android --> parcelable)</p><p>How do I use these interfaces properly, so that I can send Objects via TCP to the server successfully?</p>","283494","","","","","2011-11-11 19:23:13","Android, Serializable/Parcelable problem in client-server app","<android><client-server><parcelable>","3","0","1","",""
"2362598","1","2362934","","2010-03-02 11:00:52","0","1008","<p>i am implementing gps provider getting  langitude and longitude from device i am already get the information in device i can implemented network provider that is the problem how can implemented using network provider </p>","275791","","","","","2010-03-02 12:07:34","how to get lattitude and langitude in network location provider in device android java application","<android>","1","1","1","",""
"2362670","1","2363278","","2010-03-02 11:15:58","3","2637","<p>I am trying out this table layout in which there are three columns, each column utilizing the maximum space as they could (using strechColumn tag). Now when a column gets content which is too long, then table layout jumps off the screen.</p><p>How can I set the content of a column to wrap, so that table layout doesn't jump off the screen.</p><p>here is the XML code for table layout i used</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""      android:scrollbars=""vertical""      android:layout_height=""fill_parent""      android:layout_width=""fill_parent""&gt;    &lt;TableLayout        xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:stretchColumns=""0,1,2""        android:id=""@+id/tLayout""        android:scrollbars=""vertical""        &gt;           &lt;TableRow            android:layout_width=""fill_parent""&gt;            &lt;TextView                android:padding=""3dip""                android:gravity=""left""                android:text=""Name""                /&gt;            &lt;TextView                android:padding=""3dip""                android:gravity=""left""                android:text=""Address""                /&gt;            &lt;TextView                android:padding=""3dip""                android:gravity=""left""                android:text=""Age""                /&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/ScrollView&gt;</code></pre>","273548","","145173","","2013-11-11 14:26:14","2013-11-11 14:26:14","How can we set content of a column to wrap in Table layout","<android><android-widget>","1","0","2","",""
"2362913","1","2362930","","2010-03-02 12:03:01","3","1771","<p>friends, </p><p>while testing application on eclipse using emulator google map is being displayed properly. </p><p>but when i exported application to publish it. </p><p>google map is gone. </p><p>can any one guide me what mistake am i doing?? </p><p>any help would be appriciated.</p>","249991","","","","","2010-03-02 12:06:31","google map not showing after publishing android application?","<android><google-maps>","1","0","","",""
"2363031","1","","","2010-03-02 12:27:35","0","933","<p>I made Connection setting in my Emulator for Gmail Ac...It's workIt shown me all the Inbox Messge.Now I want to delete coming Message from my Emulator(or Device),It remain as it is at Gmail Ac.</p><p>Can any one help me.</p><p>Thanx</p>","282101","","282101","","2010-03-05 11:22:05","2010-03-05 11:22:05","How can Block receive Email in Android?","<android><email>","1","1","","",""
"2363608","1","2363646","","2010-03-02 14:06:27","2","2598","<p>In my application i want to get the weather report I'm using <a href=""http://www.google.com/ig/api?weather="" rel=""nofollow"">http://www.google.com/ig/api?weather=</a>"""" for that by providing a city. But for me only lat and longitude is available </p><p>How can I get the place name by lat and longitudes.</p>","1746300","","114066","","2010-03-02 15:36:12","2012-05-10 04:13:11","get place name by providing lat and long","<java><android><geonames>","5","3","2","",""
"2363622","1","2364433","","2010-03-02 14:08:34","2","885","<p>I am using DOM parser to parse xml data, but its taking lots of time to parse it on line 3 where ""is"" is the InputStrem object. Here is my code.</p><pre><code>DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(is);</code></pre><p>how can i do it in a small time with large xml data.</p><p>can any body help me... </p>","177571","","114066","","2010-03-02 15:52:54","2010-03-02 20:32:15","How to easily parse large xml data with a DOM parser?","<xml><android><dom>","2","0","","",""
"2363666","1","2365223","","2010-03-02 14:13:32","15","22266","<p>I'm not a programmer, but I'm trying to learn android development, and having a blast. </p><p>Lately I've hit a fork in the road, and I don't know that any of the directions I can identify will meet all my needs. This is where you (the experts) can help ;) </p><p>Endpoint: I want to have the user touch a ball, and drag it to any location on the screen. I would also like to animate this ball when it gets drawn, and when it gets dropped. </p><p>I can accomplish the dragging part using a custom class (that doesn't extend anything... just a class like is found in this tutorial: <a href=""http://www.anddev.org/basic_drag_and_drop-t3095.html"">basic drag &amp; drop</a>, however, I don't know how to apply the tween animation to it since it's not a view. </p><p>I have also developed an animated version of an ImageView with my image in it, however, I can't manage to apply the same drag &amp; drop functionality without using AbsoluteLayout, which I know is a no-no. </p><p>So... how do I move an ImageView around a ??? layout using MotionEvents, or how do I animate (using tweens defined in XML) a non-view based custom class? </p><p>Please ask questions if this is not clear. I don't know all the terminology as well as most of you might.</p><p>There is also a <a href=""http://www.anddev.org/need_advice_on_layouts-views-drag-animation-t11648.html"">copy</a> of this question on the anddev.org forums, so I'll keep this post updated with any responses I get over there.</p>","284460","","284460","","2010-03-02 22:30:58","2012-12-03 04:09:44","Android Drag/Animation of Views","<android>","1","0","22","",""
"2363719","1","2364290","","2010-03-02 14:21:49","0","277","<p>I'm making an application that contains button's and those buttons control an embedded browser. My problem is that I want to see the button's and the web page in the same layout, but when i click on a button this will open a web page and don't show the button, can anyone help me?</p>","284466","","114066","","2010-03-02 15:48:43","2010-03-02 15:48:43","How to display a website and a button in one activity?","<android><browser><layout><button>","2","0","","",""
"2364185","1","","","2010-03-02 15:18:25","3","11153","<p>How can you read GZIP file in Android located in the ""ASSETS"" (or resources/raw) folder?</p><p>I have tried the following code, but my stream size is always 1.</p><pre><code>GZIPInputStream fIn = new GZIPInputStream(mContext.getResources().openRawResource(R.raw.myfilegz)); int size = fIn.available();</code></pre><p>for some reason the size is always 1. But if Idon't GZIP the file, it works fine.</p><p><strong>NOTE:</strong>Using Android 1.5 </p>","61525","","1439305","","2013-02-01 19:45:41","2013-02-01 19:45:41","Android: read a GZIP file in the ASSETS folder","<android><gzip><android-assets><gzipinputstream>","5","3","1","",""
"2364368","1","2364407","","2010-03-02 15:41:17","2","5114","<p>Do i need to install sqlite for android or its already installed while installing all the plugin. I was trying to run the application <a href=""http://examples.oreilly.com/9780596521509/"" rel=""nofollow"">MJAndroid, example in O'Reilly book</a> but i am getting error in the file where the application is trying to extend SQLiteCursor Class.</p><p><strong>EDIT</strong></p><p>This is the <a href=""http://img341.imageshack.us/img341/2760/capturerd.png"" rel=""nofollow"">Error Tree</a>.. I am an absolute beginner to android</p><p><strong>EDIT2</strong></p><p>@CommonsWare thanks for the links. I tried those links and now its giving a new error ie:           </p><pre><code>     The type R is already defined</code></pre><p><a href=""http://img705.imageshack.us/img705/5954/captureuf.png"" rel=""nofollow"">Screen shot</a></p><p>aanybody pls explain</p>","179855","","179855","","2010-03-02 17:39:08","2010-03-02 17:39:08","do i need to install sqlite?","<android><sqlite>","2","0","","",""
"2364677","1","2364827","","2010-03-02 16:17:54","2","1242","<p>I am nearly finished with the development of an Android application. But there seems to be a problem. When I started working on the project I used only the default 1.5 device resolution which is 320x480. But now when I am in the testing phase I started testing in 480x800 and 480x854 in both 1.5 and 2.0. These resolutions are not defined in 1.5 AVD manager, so I used the provided tools to create my own. I set the resolution plus the new dpi (240 for the big displays and 16o for the small ones). So here is what happened when I tested it all.</p><p>In 1.5 when I set my constants to a high resolution and I run the app with the specific AVD I get proportional and well-aligned components, but the images have the same resolution and the text fonts keep their size as well. Of course the whole layout stretches, so now I have longer lines in my ListActivity.</p><p>In 2.0 on the other hand, I made no changes in the constants at all. But the situation there was that the appearance of the application remained the same. The images were stretched in order to fit their newly expanded containers, but everything looked like on the original resolution I was developing the app, only bigger.</p><p>My question is why and how did this happen? There are some modifications in 2.0 regarding the layout but what exactly are they? And how can I get my app to look the same in 1.5 just like in 2.0?</p><p>The situation is difficult for me to describe, and I can't post any screenshots because of legal issues. So if you need any clarification please don't hesitate to ask. All help is appreciated. Thank you. </p><p>P.S. When I mean tests, I mean on the emulator only. No real devices have been used.</p>","247927","","812149","","2012-07-24 12:15:53","2012-07-24 12:15:53","What is the difference between Android SDK 1.5 and 2.0 in terms of rendering?","<android><layout><emulator>","2","1","","",""
"2364720","1","2375808","","2010-03-02 16:23:41","2","760","<p><br>does Android have a ""best practices"" guideline on creating &amp; populating the db/tables programmatically vs. deploying a .db file in assets?  </p><p>What are the pros/cons of both approaches?  </p><p>I have a db with big long strings in several columns, and about 50 rows, so writing the insert statements alone would take quite some space. It seems a waste.  </p><p>Thoughts?</p><p>Thanks!<br>llappall</p>","284556","","","","","2010-03-14 16:09:52","Is it better to create the db/tables programmatically or through a .db file in assets","<database><android><sqlite>","2","0","1","",""
"2364740","1","2364851","","2010-03-02 16:26:16","13","18702","<p>where is located the temp folder in the android phones???</p>","","Alexi","","","","2011-02-14 13:03:12","Where is the temp folder in android device?","<android><android-widget>","2","1","1","",""
"2364811","1","2364842","","2010-03-02 16:34:28","61","48343","<p>I want to write some debugging output to the log to review it with logcat. </p><p>If I write something to System.out this is already displayed in logcat.</p><p>What is the clean way to write to the log and add levels and tags to my output?</p>","114066","","60261","","2010-03-02 16:38:28","2010-03-03 15:40:26","How do I write outputs to the Log in Android?","<android><logging><logcat>","2","0","7","",""
"2364892","1","2607375","","2010-03-02 16:43:31","10","4791","<p>I would like to play native camera shutter sound clip on camera preview capture. I'm referring to the sound clip played when takePicture() is called. How could I that? Can someone walk me through the steps?</p><p>Thanks!</p>","284578","","","","","2010-08-08 12:30:21","how to play native camera sound on Android","<android><camera>","3","0","4","",""
"2364899","1","2364924","","2010-03-02 16:45:03","0","3294","<p>Could someone show me in a snipet of code how to set the backlight  always on in android ?</p>","284609","","","","","2012-03-16 21:43:15","backlight manipulation in Android","<android>","2","1","","",""
"2364910","1","2415996","","2010-03-02 16:45:39","67","13885","<p>I want to use the assert keyword in my android apps to destroy my app in some cases on the emulator, or my device during testing. Is this possible? </p><p>It seems that the emulator just ignores my asserts.</p>","114066","","114066","","2010-03-10 10:02:49","2012-09-13 09:08:16","Can I use assert on Android devices?","<android><assert>","9","0","27","",""
"2365168","1","","","2010-03-02 17:19:13","0","909","<p>I called takePicture() and pass it a PictureCallback as a JpegPictureCallback. I'm seeing byte[] data input varies in size within onPictureTaken(). Can someone explain why this byte[]'s content size varies? I'm already setting picture size to a constant size with Camera.Parameters.setPictureSize();</p><p>Thanks!</p>","284578","","","","","2010-08-04 19:24:26","Android Camera JpegPictureCallback with varying input data size problem when takePicture() is called","<android><callback><camera><jpeg>","1","0","","",""
"2365382","1","","","2010-03-02 17:49:26","2","529","<p>For my CS bachelors I am doing a Senior project using android and google maps.</p><p>My vision was to do a (relatively) simple Dijkstra shortest path using google maps road data. I was going to add elevation change along with 2D distance. I am doing well playing with maps in android but I am completely stumped trying to access google maps data in any sort of searchable form.</p><p>How would I go about accessing the data for say intersections of roads (lat/long) in a particular area?</p><p>There has to be a way to pull that data in some sort of tree form. It seems like it may be possible with kml?</p><p>Any pointers would be awesome.</p><p>I want my paths to follow roads but If i cant this is going to turn into an orienteering application fairly fast.</p><p>Jeff </p>","284619","","284619","","2010-03-02 18:36:31","2010-03-02 18:42:36","loading google maps data into searchable data structure","<java><android><google-maps><kml>","2","0","","",""
"2365415","1","2376381","","2010-03-02 17:53:05","1","528","<p>I want to write an application for Android devices that interacts with the surface and I need to be able to have the Android device display Microsoft Surface Identity Tags.  I was able to create a class to draw the Byte Tags using the <a href=""http://msdn.microsoft.com/en-us/library/ee804885.aspx"" rel=""nofollow"">Byte Tag documentation</a> but all I could find for the Identity Tags was <a href=""http://msdn.microsoft.com/en-us/library/ee786833.aspx"" rel=""nofollow"">this MSDN documentation</a> and it doesn't include any information about <strong>how</strong> to draw them.  Can anyone point me to some documentation on how to generate Identity Tags programmatically?</p><p>Thanks,Casey</p>","236136","","","","","2012-11-13 22:34:49","Rendering Microsoft Surface Identity Tags in Java for Android","<android><microsoft><surface><pixelsense>","3","0","1","",""
"2365454","1","3003618","","2010-03-02 17:57:52","0","6006","<p>Give me please an advise, I want to make a dynamic layout which contains mixed elements[text] [checkbox] [button][text] [checkbox] [button][text] [checkbox] [button]......</p><p>Can you give me some sample code, please</p>","284618","","","","","2012-01-06 23:40:13","How to make a dynamic layout with clickable text, checkboxes and buttons?","<android><dynamic><layout><button><clickable>","2","0","","",""
"2365561","1","2382085","","2010-03-02 18:13:38","6","3295","<p>I'm trying to test an Activity in android which will show a ProgressDialog and everything works fine in the App, however when I try to use ActivityUnitTestCase and the test causes the Activity to show the dialog it fails with this error:</p><pre><code>android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an applicationat android.view.ViewRoot.setView(ViewRoot.java:429)at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:178)at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)at android.view.Window$LocalWindowManager.addView(Window.java:392)</code></pre><p>I was looking at the problem and it seems that the onCreateDialog method of my activity crashes when we try to create it from the test, which I assume is another context, I get that, however I wonder is any of you have been successful on trying such a scenario.</p><p>This is the code of my onCreateDialog.</p><pre><code>    public Dialog onCreateDialog(final int id){    Dialog dialog;    switch (id)    {        case PROGRESS_BAR:            loadingDialog = new ProgressDialog(this);            loadingDialog.setMessage(""searching for product..."");            loadingDialog.setIndeterminate(true);            dialog = loadingDialog;            break;        case INEXISTING_PRODUCT:            AlertDialog.Builder builder = new AlertDialog.Builder(this);            builder.setMessage(""Product not found"");            builder.setPositiveButton(""OK"", null);            dialog = builder.create();            break;        case UNAVAILABLE_SERVICE:            AlertDialog.Builder unavailableBuilder = new AlertDialog.Builder(this);            unavailableBuilder.setMessage(""Service Unavailable"");            unavailableBuilder.setPositiveButton(""OK"", null);            dialog = unavailableBuilder.create();            break;        default:            dialog = super.onCreateDialog(id);    }    return dialog;}</code></pre><p>Any ideas?</p>","17190","","","","","2010-03-04 19:23:18","Testing dialog in Android's ActivityUnitTestCase","<android><unit-testing>","1","0","3","",""
"2365620","1","","","2010-03-02 18:25:12","0","605","<p>In my android app , I have a menu for backlight options ,and I want that when the user selects    one like "" during this operation "" to have the backlight on during that operation. Could I be be shown a way of accomplishing this . My problem is the that I don't know how to manipulate the backlight and how to properly arrange this in  the code.</p><p>Thanks </p>","284609","","","","","2010-12-16 15:58:05","backlight in android","<android>","2","0","1","",""
"2365763","1","2367536","","2010-03-02 18:46:50","2","150","<p>Hello stackoverflow community!<br>I'm trying to find a way to do a search via keywords from my Android app and then get back a list of business (name, address).  Including a local business listing is a plus!  Any good advice to look for it or key methods to know of?</p>","280641","","21234","","2012-05-17 08:22:08","2012-05-17 08:22:08","Business listing in Android App","<android><business-intelligence>","2","0","2","2012-05-15 23:07:49",""
"2366364","1","2366459","","2010-03-02 20:06:23","1","178","<p>I'm trying to load a web application that needs to connect to port 873. I'm getting an error message that seems to imply that it can't reach that port and I'm guessing that Android 2.1 doesn't expose that port out of the box.</p><p>Is there any way to open up ports in the 2.1 operating system?</p><p>Thanks in advance,</p><p>=Ryan</p>","166182","","","","","2010-03-02 20:22:46","Opening up Ports on the Nexus One (Version 2.1)","<android><networking><nexus-one>","1","1","","",""
"2366442","1","2366508","","2010-03-02 20:19:17","4","1119","<p>In an activity it's (usually) easy to get the Context.</p><p>What if I am working with a home widget class?These are classes that extends AppWidgetProvider, which don't contain a Context!</p><p>Thank you.</p>","252711","","267542","","2010-03-04 17:35:19","2010-03-04 17:35:19","Can a home widget have a Context?","<android><widget><home><android-context>","1","0","","",""
"2366706","1","2366768","","2010-03-02 20:59:01","51","26518","<p>Is there a way to lock orientation during runtime? For example I'd like to allow the user to lock the screen to landscape if the user currently in landscape and toggle the menu option. </p>","255123","","","","","2013-01-28 15:33:27","How to lock orientation during runtime","<android><orientation>","5","0","14","",""
"2366887","1","2366940","","2010-03-02 21:25:31","3","506","<p>I set an ImageButton's click listener via setOnClickListener(), but it doesn't respond to trackball clicks like a regular Button.</p>","135199","","","","","2010-03-02 21:32:05","Android ImageButton doesn't respond to trackball clicks?","<android>","1","0","","",""
"2367100","1","2525668","","2010-03-02 21:52:56","4","1026","<p>Is there a way to find out the final location of my animated ""object"" after the animation? Let's say I am animating an ImageView with location in parent as (0,0 - 20,20) using TranslateAnimation and ScaleAnimation over 1 second with setFillAfter(true).</p><p>How to I find the final location of this ""object"" (since the View location itself does not move)? I need to continue the animation from this point based on an user input.</p>","277450","","","","","2010-03-26 18:12:39","Get location of object when animation is complete in android","<android>","2","0","","",""
"2367231","1","","","2010-03-02 22:12:40","3","607","<p>I want to display a large-ish image, around 800 x 800 pixels. I'd like to be able to pan it in all four directions by dragging with a finger. I'd also like to be able to zoom in and out. I need to be able to know the pan values and zoom values, because I have to draw small text strings at certain locations over the image.</p><p>For example, if the pan is 100 pixels to the right, I need to know that so I can add that offset to all my elements.</p><p>Wondering what a good way to do this is. Should I implement it myself in the paint method within a View I implement? Is there some other standard method of doing it? It's essentially like a google maps view, only one large tile, but I have to draw my pins on top of it with pan and zoom,</p><p>Thanks</p>","246114","","","","","2011-06-03 00:58:46","Recommendations for a pannable-zoomable view of a single large image?","<android>","1","2","","",""
"2367342","1","2367687","","2010-03-02 22:28:49","1","552","<p>I am trying to put together a modal box with a scrollable list of checkable items and an OK and Cancel button at the bottom for the user to select filters from. It seems the simplest way to do things like this in Android is to reuse API components (widgets, layouts, etc) and the closest one I can find to this looks to be the ListPreference, which basically does exactly what I want (I can even work with storing the data in SharedPreferences).</p><p>The problem is that I'm not launching this modal box from a PreferenceActivity, but rather will be launching it from either of two activities: a ListActivity and a MapActivity. If a ListPreference would be possible here, that'd be really convenient, but otherwise any help getting me in the right direction would be great.</p><p>Thanks!Nick</p>","29297","","","","","2010-03-02 23:22:45","Possible to use the ListPreference modal view in a ListActivity?","<android>","1","0","","",""
"2367484","1","2367518","","2010-03-02 22:50:30","11","5992","<p>I'd like to use the volume buttons for something else in my Android application. The Dolphin browser does this I am told. Anyone know how?</p>","82515","","","","","2012-11-21 14:37:41","How to override the behavior of the volume buttons in an Android application?","<android>","2","0","5","",""
"2367497","1","","","2010-03-02 22:52:21","0","658","<p>My project requires some external libraries to build in in Eclipse. They live in /trunk/lib whereas my project is in /trunk/projectA. To get Eclipse to find the libraries on all machines we set a variable PROJECT_A_HOME. </p><p>Now I'm trying to get some builds going with maven and I can not figure out how to add that path (be it environmental variable or relative to $(basedir)) to the build. I really do not want to set up a repository for these dependencies, as I keep them in source control and want builds to continue to work in Eclipse. </p><p>I've seen talk about  but that hasn't worked for me. </p><p>Ideas ?</p>","36285","","203907","","2010-03-02 22:56:33","2010-03-03 13:30:26","Add Maven Classpath","<java><android><maven-2>","2","4","","",""
"2367936","1","2369327","","2010-03-03 00:17:03","25","21584","<p>I've looked everywhere for a solution to this, but I can't figure out how to implement it. My <code>OnItemClickListener</code> was disabled somehow on my <code>ListView</code> rows, because I have an <code>ImageButton</code> in the row layout, which takes over the focus. There have been numerous questions I've found, but none of them have gotten me anywhere.</p><p>I've checked <a href=""http://stackoverflow.com/questions/2097643/layout-question-onitemclicklistener-not-working-now"">this</a> question, but I couldn't really make heads or tails of it. I just need a way to get the rows clickable so that I can detect when a row is pressed. Long press and focus work fine.</p>","118241","","355231","","2012-02-15 05:58:34","2014-03-15 14:59:35","ListView OnItemClickListener Not Responding?","<java><android><listview>","10","0","16","",""
"2368098","1","2368190","","2010-03-03 00:56:51","2","2805","<p>I changed AlarmController.java in ApiDemo a little bit, so I want the alarm not to go off when the phone is sleeping by using AlarmManager.RTC.</p><pre><code>        Intent intent = new Intent(AlarmController.this, RepeatingAlarm.class);        PendingIntent sender = PendingIntent.getBroadcast(AlarmController.this,                0, intent, 0);        // We want the alarm to go off 30 seconds from now.        long firstTime = SystemClock.elapsedRealtime();        firstTime += 15*1000;        // Schedule the alarm!        AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);        am.setRepeating(AlarmManager.RTC, //AlarmManager.ELAPSED_REALTIME_WAKEUP,                        firstTime, 15*1000, sender);</code></pre><p>The receiver code is like below:</p><pre><code>public class RepeatingAlarm extends BroadcastReceiver{    @Override    public void onReceive(Context context, Intent intent)    {        Log.d(""DEBUG"", ""In RepeatingAlarm.onReceive, intent="" + intent);        Toast.makeText(context, R.string.repeating_received, Toast.LENGTH_SHORT).show();    }}</code></pre><p>I ran the modified app, but I still see many log messages as below after the phone wento sleep (the screen was black):</p><p>D/DEBUG   ( 1390): In RepeatingAlarm.onReceive, intent=Intent { flg=0x4 cmp=com.example.android.apis/.app.RepeatingAlarm (has extras) }</p><p>This means the flag AlarmManager.RTC didn't work. Can someone tell me why?</p><p>Thanks.</p>","256239","","","","","2010-03-03 01:20:01","AlarmManager.RTC not working?","<android>","1","0","","",""
"2368453","1","","","2010-03-03 02:56:50","0","2043","<p>I want to create an app or background service that just listens for the launch of a 'default' app, say Contacts or the built-in Gmail app. If the contact app is clicked, I want to transfer control to my app temporarily (e.g. present a Yes/No popup to the user or increment an internal counter of my app ) and then redirect the user back to the app that was clicked. I want to do this only for a couple of 'well-known' built-in default apps, not any third party apps. </p><p>Is this possible? May be using some special intents?</p>","125422","","","","","2010-09-10 14:38:23","How to detect launch of an app in Android from a background service or another app","<android>","2","0","2","",""
"2368705","1","2371188","","2010-03-03 04:13:05","0","2657","<p>I am displaying a radio schedule in a List View and would like to highlight the currently playing program.  I also want to allow the user to click on any program and get more details for the program.  I have tried the following:</p><pre><code>radioView.setSelection(adapter.getCurrentProgramIndex());radioView.setSelected(true);</code></pre><p>This does scroll the list down to the selection which is good, but it does not highlight the selection.  I understand this is because <a href=""http://stackoverflow.com/questions/2067456/android-listview-programmatic-selection-highlight"">the device is not in touch mode</a>, but how then would I go about highlighting the current program?</p>","240566","","240566","","2010-03-03 04:20:43","2010-03-03 12:32:35","How do I programmatically select an item in a listview in Android","<android><listview><selection><highlight>","1","0","1","",""
"2368898","1","2370201","","2010-03-03 05:07:04","3","188","<p>I would like my activity to use some features of 2.01, but i need it to be able to run on 1.5 devices. I understand that the 1.5 devices will not be able to run the 2.01 features and thats fine. But i still want them to be able to use the rest of the activity.</p><p>I am using Eclipse as my IDE, how do i setup my project correctly? what am i going to have to watch out for? and what the heck does verifyerror mean?</p>","263111","","","","","2010-03-04 22:41:48","How do I use the features of 2.01, yet still support 1.5 with one apk?","<android><eclipse><project>","3","0","2","",""
"2369068","1","","","2010-03-03 05:57:38","3","1041","<p>Is it possible to share my video or my photo from my application on the web in android?If possible how to do this? I made a application and now i want to share some my feature on the web so how i can do it?Thanks </p>","263325","","","","","2012-02-23 22:25:44","sharing feature in android","<android>","2","0","3","",""
"2369186","1","2377100","","2010-03-03 06:26:04","1","2416","<p>Im using an embedded webview to display a webpage which is made up of image thumbnails. These thumbnails are links to further webpages. Now my application randomly stops responding to my touch events on these thumbnails. It happens more frequently when the device wakes up from a standby. but this problem is fixed when i load some other page and come back to the thumbnails page.</p><p>I tried adding an <code>onClickListener</code> to the webview but it never return anything, even when the application is running fine.</p>","237403","","114066","","2010-03-03 08:51:43","2010-03-04 05:31:12","Webview not responding to touch events","<java><android><webview><touch>","1","1","","",""
"2369310","1","","","2010-03-03 06:57:17","6","3921","<p>Zoomin in my webview will not work on a double tab. I am using Motorola Droid A855.</p>","285052","","114066","","2010-03-03 08:48:58","2013-01-16 21:32:55","WebView double tap zoom not working on a Motorola Droid A855","<android>","2","2","2","",""
"2369353","1","","","2010-03-03 07:07:25","1","7836","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2209131/how-to-trigger-the-soft-keyboard"">How to Trigger the soft keyboard?</a>  </p></blockquote><p>Any one please help me to display a keyboard in my app. I want to show my keyboard when i click on the textfield</p>","244540","","114066","","2010-03-03 08:30:24","2011-11-08 07:36:25","How to Display a keyboard in an Android Application?","<java><android>","1","2","","2013-01-29 17:14:15",""
"2369695","1","2370774","","2010-03-03 08:26:32","1","614","<p>example scenario is:from login screen - main screen - then when i clicked a hide button the app will go to home screen, and when im going to click the app again the main screen would be called </p>","279560","","","","","2013-06-26 13:34:40","How to clear an activity from the second activity going back to home screen in android?","<java><android>","3","0","1","",""
"2369823","1","","","2010-03-03 08:55:17","5","5046","<p>Im trying to overlay images on a canvas using the following method:</p><pre><code>private Bitmap overlay(Bitmap bmp1, Bitmap bmp2) {    bmOverlay = Bitmap.createBitmap(70, 70, Bitmap.Config.RGB_565);    canvas = new Canvas(bmOverlay);    canvas.drawBitmap(bmp1, 0, 0, null);  //line 179    canvas.drawBitmap(bmp2, 0, 0, null);    return bmOverlay;           }</code></pre><p>However, my app keeps crashing and the log reads:</p><p>java.lang.NullPointerException     at android.graphics.Canvas.throwIfRecycled(Canvas.java:954)     at android.graphics.Canvas.drawBitmap(Canvas.java:980)     at com.MyApp.overlay(MyApp.java:179)</p><p>Can anyone help?</p>","535363","","","","","2012-11-11 12:30:07","Error android.graphics.Canvas.throwIfRecycled when overlaying bitmaps","<android><canvas><bitmap><nullpointerexception>","3","5","","",""
"2369930","1","","","2010-03-03 09:15:02","0","336","<p>Can we write instrumentation test cases for an android application in Groovy?If so , how ?</p>","264123","","","","","2010-03-03 11:41:05","Instrumentation test cases in groovy?","<android><groovy><instrumentation>","1","0","","",""
"2369975","1","","","2010-03-03 09:21:23","3","5601","<p>I want to place navigation bar at bottom of the screen in my Android application. How can I do that? Sample code would be helpful.</p>","285144","","23897","","2012-07-20 17:18:31","2012-07-20 17:18:31","Place navigation bar at the bottom of the screen in Android application","<android>","1","1","3","",""
"2370245","1","2372695","","2010-03-03 10:08:41","2","821","<p>Anyone who knows a good way to generate/create a barcode from a String in Android?</p>","270273","","","","","2011-11-28 11:05:07","Generating/creating a barcode in Android","<android><barcode>","2","1","2","",""
"2370387","1","","","2010-03-03 10:29:17","-1","2338","<p>how to add facebook Application in my Android Application .i want to add a image button. when the user clicks on this button it should go to the facebook page .where the user can sign in .please anyone help me to solve this problem..please send me a source code of the App</p>","244540","","114066","","2010-03-03 12:21:24","2013-06-05 16:44:55","How to Add Facebook in my Android Application","<java><android><facebook>","1","4","","2013-06-05 18:00:44",""
"2370398","1","2370994","","2010-03-03 10:30:46","2","6253","<p>while showing progress bar i want to disable touch screen to restrict other functionalities in android phone.</p><p>can any one guide me how to achieve this?</p><p>any help would be appricated.</p>","249991","","","","","2010-08-10 17:23:19","how to disable Touch Screen in Android Phone?","<android><activity><listactivity>","1","5","","",""
"2370527","1","2370597","","2010-03-03 10:55:37","9","9815","<p>I want to create a tab using child tab having intents, so that when ever user click on tabs intents get refresh.</p><p>Every time user click on tab i want to refresh and called oncreate method of child intent tabs.</p><pre><code>public class Tabs3 extends TabActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        final TabHost tabHost = getTabHost();        tabHost.addTab(tabHost.newTabSpec(""tab1"")                .setIndicator(""list"")                .setContent(new Intent(this, List1.class)));        tabHost.addTab(tabHost.newTabSpec(""tab2"")                .setIndicator(""photo list"")                .setContent(new Intent(this, List8.class)));        // This tab sets the intent flag so that it is recreated each time        // the tab is clicked.        tabHost.addTab(tabHost.newTabSpec(""tab3"")                .setIndicator(""destroy"")                .setContent(new Intent(this, Controls2.class)                        .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));    }}</code></pre>","216431","","265335","","2012-05-07 15:05:54","2012-05-07 15:05:54","android tabwidget intent tabs refresh every hit","<android><tabs><android-intent><tabwidget>","1","0","8","",""
"2370630","1","3383880","","2010-03-03 11:08:14","5","2048","<p>Following is the example of tabs with intent data.</p><p>While debugging i found that always when first tab we add in tab host in our case following tab</p><pre><code>tabHost.addTab(tabHost.newTabSpec(""tab1"")                    .setIndicator(""list"")                    .setContent(new Intent(this, List1.class)));</code></pre><p>oncreate method of ""List1"" intent get called regardless it is our current tab or not even if if i define tab2 as a current tab how to fix this ?</p><pre><code>public class Tabs3 extends TabActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        final TabHost tabHost = getTabHost();        tabHost.addTab(tabHost.newTabSpec(""tab1"")                .setIndicator(""list"")                .setContent(new Intent(this, List1.class)));        tabHost.addTab(tabHost.newTabSpec(""tab2"")                .setIndicator(""photo list"")                .setContent(new Intent(this, List8.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));        // This tab sets the intent flag so that it is recreated each time        // the tab is clicked.        tabHost.addTab(tabHost.newTabSpec(""tab3"")                .setIndicator(""destroy"")                .setContent(new Intent(this, Controls2.class)                        .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));    }}</code></pre>","216431","","","","","2012-06-16 06:02:21","android first tab intent oncreate always called regardless we set tab2 as default tab","<android><tabwidget>","2","2","3","",""
"2370669","1","","","2010-03-03 11:14:47","1","90","<p>This is a black box test, which means I don't have any way to access the source code. Because I have to reproduce the error, file a report, and then present to the programmer (who are not our company's employee), I have to find the crashing URL / http / xhttp request.</p><p>Is there any way to do so on the SDK emulator?</p><p>Thanks a lot.</p>","285227","","","","","2010-04-09 13:00:03","How to know which URL an Android application tries to visit?","<android><android-emulator><hacking>","1","0","","",""
"2370980","1","2370999","","2010-03-03 12:04:58","4","11024","<p>What programming Languages can i use to make apps for the Android Mobile OS? I know its Objective C for the iphone but not sure sure about Android i think its java?</p>","233421","","114066","","2010-09-27 07:21:57","2012-10-11 15:38:50","What programming Languages can i use to make apps for the Android Mobile OS?","<java><android><mobile>","5","1","2","2012-07-25 18:27:11",""
"2371061","1","","","2010-03-03 12:15:06","1","705","<p>My text view (of type AutoCompleteTextView) listens to both TextWatcher and OnItemClickListener.  </p><p><code>textView = (AutoCompleteTextView)                findViewById(R.id.search_edit_text);</p><pre><code>    textView.setOnItemClickListener(this);    textView.addTextChangedListener(this);</code></pre><p></code>  </p><p>My objective is this: when a user enters a character the text view will display in the view's drop down list relevant items which contain the entered character (hereby task A). When a user chooses an item from the list I would like to save it (hereby task B).<br>I perform task A within the scope of afterTextChanged(Editable text) and task B within the scope of onItemClick(AdapterView parent, View v, int position, long id).<br>Task A works fine but when I choose an item from the list (and expect OnItemClick() to perform task B) afterTextChanged() is called (probably because the text has indeed changed) before OnItemClick() causing task A to run again.<br>Any idea how to prevent this?Thanks, Rob</p>","283630","","283630","","2010-03-03 15:34:21","2010-03-03 15:34:21","Android, TextWatcher event caught before OnItemClickListener event","<android>","0","3","","",""
"2371065","1","2371113","","2010-03-03 12:15:30","1","3668","<p>I have some data files that I need to install together with my application on the emulator for easy testing my app on a device. </p><p>Where can I put files in a way that Eclipse will include them into my apk and how can I access those files after my application is installed on the device?</p>","114066","","","","","2010-03-03 12:21:14","How to package and access extra files inside my apk","<android><apk>","1","0","1","",""
"2371107","1","","","2010-03-03 12:20:47","3","7823","<p>I am looking for a way to recognize a very specific set or images/characters using a android device.</p><p>I dont mind doing this either by taking a picture or scanning (not actual scanning , just hovering over a image like how the barcode readers work). Since I have never done this before ,pointers to specific Libs and directions on how things should work would be welcome.</p><p>Note : I don't want to recognize barcodes so don't point me to barcode libs unless they support custom images etc.</p>","42069","","","","","2013-05-16 04:18:38","Custom Character recognition for android","<android><image-processing>","3","3","2","",""
"2371440","1","","","2010-03-03 13:11:08","3","176","<p>I'm writing a game for Android. My GUI has the following basic screens (i.e. the information and interactions required  on each of these would take up the whole display):</p><ol><li>Main menu (let you start a new game, enter settings, see high scores, see about screen)</li><li>Game screen i.e. where the actual game is played.</li><li>Settings screen.</li><li>High scores screen.</li><li>About screen (i.e. credits and a back button)</li><li>Game over screen (arrived at when the game ends)</li><li>Pause screen (pauses game and can access settings)</li></ol><p>The following are some example transitions the user might make between these screens:</p><p>1->2->7->2->6 (starts new game, pauses game, returns to game, finishes game)1->5->1->4->1 (views about screen, goes back to main, views score screen, goes back to main)</p><p>I'm really confused about when to have just one activity that switches layouts and when to create new activity classes. For example, when my game loads, I have a ""main"" activity that loads the main menu layout. When you click the settings button, I launch a ""settings"" activity (which uses android's standard settings GUI). For the moment, when you start a game, I switch the layout of ""main"" to the game screen layout (which just contains one big surface view). I'm not really sure what the best way to integrate the game over screen, high score screen, about screen etc.</p><p>Creating a new activity for each seems really heavy weight to me. There's quite a lot of boiler plate code involved for each activity. Plus, communication between activities seems like a pain as you have to use bundles. Using just one activity means I can just share object fields directly. It seems that using layouts for the above would be more compact.</p><p>Can anyone give me some recommendations?</p>","284055","","19750","","2010-03-03 13:12:17","2010-03-03 13:19:14","When to use layouts and when to use activities?","<java><android><design><gui><user-interface>","1","0","2","",""
"2372248","1","","","2010-03-03 14:55:51","37","41128","<p>I have a question about an intent...I try to launch the sms app...</p><pre><code>Intent intent = new Intent(Intent.ACTION_MAIN);intent.setType(""vnd.android-dir/mms-sms"");int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP |    Intent.FLAG_ACTIVITY_CLEAR_TOP;intent.setFlags(flags);intent.setData(Uri.parse(""content://sms/inbox""));context.startActivity(intent);</code></pre><p>so, you can see that I put too much things in my intent, but that's because I don't know how I can do...Thank's</p>","283517","","1610216","","2012-10-19 19:21:28","2014-01-21 09:51:53","launch sms application with an intent","<android><sms><android-intent>","9","0","14","",""
"2372415","1","2372661","","2010-03-03 15:16:31","157","90323","<p>I want to change color of <code>ListView</code> separator line. Any help would be appreciated. Thanks!</p>","249991","","1333975","","2013-05-21 21:34:37","2014-02-17 16:49:30","How to change color of Android ListView separator line?","<android><listactivity>","6","0","52","",""
"2372557","1","","","2010-03-03 15:35:18","2","7217","<pre><code>try {        Intent searchAddress = new Intent(Intent.ACTION_VIEW,         Uri.parse(""geo:0,0?=""+emp_city_location));        startActivity(searchAddress);    } catch(Exception e) {        System.out.println(e);    }</code></pre><p>i got the exception like</p><p>03-03 21:01:56.349: INFO/System.out(179): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=geo:0,0?=chennai }</p><p>please do reply me</p>","268741","","746921","","2011-08-18 07:15:49","2013-01-07 07:34:29","how to call the google map from my android application like invoke the email","<android><maps>","4","1","","",""
"2372757","1","","","2010-03-03 15:57:43","5","22658","<p>I wonder if it's possible to access to the SIM card with an Android Application</p>","285467","","1288","","2011-08-18 14:34:09","2014-02-28 03:14:16","Access the SIM Card with an Android Application?","<android><smartcard>","5","3","6","",""
"2372980","1","2381770","","2010-03-03 16:24:23","1","663","<p>I have been trying to get the following code to work for the last 4 hours.</p><pre><code>public void clearLocation() {     LocationManager locMan =            (LocationManager)getSystemService(Context.LOCATION_SERVICE);     locMan.clearTestProviderLocation(""gps""); </code></pre><p>My problem is that it will only work with Android 1.5. On 1.6 and newer it just crashes when it reaches the second statement.</p><p>I've been looking through various code snippets and tutorials, but haven't been able to find anything about this.</p><p>Regards, Adam.</p>","285496","","13531","","2010-03-03 16:29:08","2010-03-04 18:35:10","LocationManager in 2.1 not working?","<android><gps><location><manager><locationmanager>","1","2","","",""
"2373617","1","","","2010-03-03 17:48:53","27","17158","<p>I loaded some images into a gallery. Now I'm able to scroll but once started scrolling the scrolling won't stop. I would like the gallery to just scroll to the next image and then stop until the user does the scroll gesture again.</p><p><strong>this is my code</strong></p><pre><code>import android.widget.ImageView;import android.widget.Toast; import android.widget.AdapterView.OnItemClickListener;public class GalleryExample extends Activity {private Gallery gallery;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);     gallery = (Gallery) findViewById(R.id.examplegallery);     gallery.setAdapter(new AddImgAdp(this));     gallery.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView parent, View v, int position, long id) {            Toast.makeText(GalleryExample.this, ""Position="" + position, Toast.LENGTH_SHORT).show();        }    });}public class AddImgAdp extends BaseAdapter {    int GalItemBg;    private Context cont;    private Integer[] Imgid = {            R.drawable.a_1, R.drawable.a_2, R.drawable.a_3, R.drawable.a_4, R.drawable.a_5, R.drawable.a_6, R.drawable.a_7    };    public AddImgAdp(Context c) {        cont = c;        TypedArray typArray = obtainStyledAttributes(R.styleable.GalleryTheme);        GalItemBg = typArray.getResourceId(R.styleable.GalleryTheme_android_galleryItemBackground, 0);        typArray.recycle();    }    public int getCount() {        return Imgid.length;    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {        ImageView imgView = new ImageView(cont);        imgView.setImageResource(Imgid[position]);        i.setScaleType(ImageView.ScaleType.FIT_CENTER);        imgView.setBackgroundResource(GalItemBg);        return imgView;    }}</code></pre><p>}</p><p><strong>and the xmlLayout file</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android"" &gt;&lt;Gallery xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/examplegallery""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" /&gt;&lt;/LinearLayout&gt;</code></pre>","","Alexi","603744","Alexi","2011-06-22 09:59:10","2012-05-23 07:46:24","How to stop scrolling in a Gallery Widget?","<android><scrolling><android-widget><gallery>","7","5","27","",""
"2373727","1","2387429","","2010-03-03 18:03:01","3","1921","<p>I am trying to do a little app to list and connect to other Network operator.</p><p>I list them by going to:</p><ul><li>Settings</li><li>Wireless Controls</li><li>Mobile networks</li><li>Network operators</li><li>Search networks</li></ul><p>And I connect to other Network operator by clicking on one of the list.</p><p>I've been searching methods from <a href=""http://developer.android.com/intl/fr/reference/android/net/ConnectivityManager.html"" rel=""nofollow"">ConnectivityManager</a> but I don't find something like <code>connectTo()</code> .</p><p>Any ideas of how I can do this?</p>","119895","","","","","2010-03-05 14:34:27","Programatically connecting to another Network operators","<android>","1","0","","",""
"2373779","1","","","2010-03-03 18:10:52","5","9481","<p>I'm trying  to detect when the roaming activation occurs. So far I've used the following piece of code, but because I haven't been able to test it I am unaware of it's correctness</p><pre><code>TelephonyManager telephonyManager = TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); PhoneStateListener cellLocationListener = new PhoneStateListener() {public void onCellLocationChanged(CellLocation location) {  if(telephonyManager.isNetworkRoaming()  {    Toast.makeText(getApplicationContext(),""in roaming"",Toast.LENGTH_LONG).show();   } }};telephonyManager.listen(cellLocationListener, PhoneStateListener.LISTEN_CELL_LOCATION);</code></pre><p>I've written this , thinking that in order for roaming to activate first the signal cell must change. Please let me know whether my deduction is correct or not, and if not how could I accomplish this.</p>","284609","","","","","2013-01-10 10:41:38","roaming detection in android","<android>","3","3","5","",""
"2373922","1","","","2010-03-03 18:31:45","2","560","<p>I have vanilla linux kernel version 2.6.27. I want to apply android specific patches and convert it to android linux kernel 2.6.27. Where can a user find the patches to convert a normal vanilla kernel into android kernel?</p>","285609","","","","","2011-03-31 06:35:59","Where to find Android patches?","<android>","1","0","1","",""
"2373948","1","","","2010-03-03 18:35:22","12","3060","<p>I'm creating a <code>spinner</code> and I've added an <code>OnItemSelectedListener</code> to it.However I've noticed that it fires on create.Now I was wondering if there was a way to ignore/discard it.</p><p>I know I could use a <code>boolean</code> value, but that's a bit ""dirty"".</p>","211992","","2074990","","2013-09-27 16:07:37","2014-02-17 10:13:26","ignore OnItemSelectedListener firing on create","<android><android-spinner><onitemclicklistener>","5","0","2","",""
"2374080","1","2374146","","2010-03-03 18:53:51","2","3839","<p>I have a simple client-server app on android. the android service communicates with the server via tcp sockets. the service sends a simple String to server which works. the server processes the string and sends back an object to the android service. the object implements the serializable interface. the object ""leaves"" the server successfully but at the point where the android service receives the object (socket.readObject()) I get to following exception:</p><p>java.net.SocketException: Bad socket</p><p>I've never seen this. What does that mean?</p><p>Edit:</p><p>Method where exception gets thrown:</p><pre><code>private static void startContextListener(){ new Thread(){  public void run(){   try{    while(contextsocket != null &amp;&amp; !contextsocket.isClosed() &amp;&amp; inContext.readObject() != null){     kontext = (Kontext) inContext.readObject();    }   }   catch(Exception e){    Log.e(TAG, ""startContextListener(): "" + e.toString());   }  } }.start();}</code></pre>","283494","","283494","","2010-03-04 07:52:26","2011-04-04 04:45:03","Android, Client-Server app, Bad Socket Exception","<android><exception><sockets>","1","0","","",""
"2374123","1","2374914","","2010-03-03 18:58:54","1","1221","<p>I wrote code to draw on a view. After it is done, how can I get the resulting image from the view. For example, in the code below, I want to get the the drawable (Image) from mCustomDrawableView. How can I do that? Thanks.</p><pre><code>public class HelloTestGraph extends Activity {    /** Called when the activity is first created. */    // @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        LinearLayout lo = (LinearLayout) findViewById(R.id.top_view);        LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,                LinearLayout.LayoutParams.WRAP_CONTENT);        CustomDrawableView mCustomDrawableView = new CustomDrawableView(this);        mCustomDrawableView.setLayoutParams(param);        lo.addView(mCustomDrawableView);    }    public class CustomDrawableView extends View {        private ShapeDrawable mDrawable;        private Drawable mPic;        public CustomDrawableView(Context context) {            super(context);            int x = 10;            int y = 10;            int width = 300;            int height = 50;            mDrawable = new ShapeDrawable(new OvalShape());            mDrawable.getPaint().setColor(0xff74AC23);            mDrawable.setBounds(x, y, x + width, y + height);            mPic = getResources().getDrawable(R.drawable.example_picture);            mPic.setBounds(x, y + 100, x + width, y + height+100);        }        protected void onDraw(Canvas canvas) {            mDrawable.draw(canvas);            mPic.draw(canvas);        }    }}</code></pre>","256239","","","","","2010-03-03 21:00:03","How to retrieve drawable (picture) from a view?","<android>","2","0","1","",""
"2374129","1","","","2010-03-03 19:00:03","1","1202","<p>how can i add different overlays at different zoom levels ? For instance i have an overlay image of a festival area that ive added onto the map which is great. But when the user zooms out i want to change the image that the user see's .Does anyone know how to do this?</p>","264905","","","","","2012-12-05 07:46:00","Android maps overlay","<android><google-maps>","3","0","","",""
"2374177","1","2377946","","2010-03-03 19:07:25","8","27722","<p>How can i build a search bar where while i'm typing the results are shown in the list view in which i'm searching?</p><p>For example, i have a list view with 20 strings. I press the search key and appears the bar. I want when i type 3 words or more the search starts running showing the results in the list view (as a filter: only shows the strings in the list that matching what i type)</p>","258863","","114066","","2012-01-27 12:23:32","2012-12-19 11:42:53","Android search list while typing","<android><search><android-listview>","5","2","10","",""
"2374398","1","","","2010-03-03 19:42:21","1","1449","<p>According to this <a href=""http://www.pluralsight.com/community/blogs/mike/archive/2005/11/04/16213.aspx"" rel=""nofollow"">article</a></p><blockquote>  <p><strong>The Begin Event Handler is Always Invoked</strong></p>    <p>The second impliciation of  AsyncTimeout that I had not really  internalized until recently is that  the begin event handler for a  registered async task is always  invoked, even if the page has timed  out before ASP.NET gets around to  starting that task.</p>    <p>In this scenario, the remainder of the  tasks are basically doomed.  The page  has timed out already, but ASP.NET is  still going to go through the motions  of calling the begin event handler for  all registered tasks, followed  immediately by a call to their  corresponding timeout event handlers.</p>    <p><strong>AsyncTimeout Does Not Imply Asynchronous Task Cancellation</strong></p></blockquote><p>where possible I should be mindful to not kick off additional tasks once the whole page timeout has already fired and I should cancel remaining running tasks once the timeout occurs.  Is this recommended/safe?  How would I go about cleanly canceling any HttpWebRequest.BeginGetResponse calls given there are multiple places the async task could be?  For instance if I'm inside the BeginGetResponse call, what should I return for IAsyncResult to stop processing in its tracks safely?  Would the same guidelines apply to SqlCommand.BeginExecuteReader?</p><p>I've put together a sample code from a few examples and my own additions:</p><pre><code>&lt;%@ Page Language=""C#"" Async=""true"" AsyncTimeout=""30"" %&gt;&lt;%@ Import Namespace=""System.Net"" %&gt;&lt;%@ Import Namespace=""System.IO"" %&gt;&lt;%@ Import Namespace=""System.Collections.Generic"" %&gt;&lt;%@ Import Namespace=""System.Threading"" %&gt;&lt;!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd""&gt;&lt;script runat=""server""&gt;    protected class RequestState    {        public HttpWebRequest Request;        public string RequestID; // simple identifier of the request        public string Url;        public DateTime RequestStartTime;        public RequestState(string requestID, string url)        {            this.RequestID = requestID;            this.Url = url;        }        public void CreateRequest()        {            Request = (HttpWebRequest)WebRequest.Create(Url + pageDest);            Request.Method = ""GET"";            Request.Proxy = WebRequest.DefaultWebProxy;            Request.Timeout = 1000 * 3; // Connection timeout            Request.ReadWriteTimeout = 1000 * 15; // Read response timeout            RequestStartTime = DateTime.Now; // Technically the request didn't start yet, but this is close enough        }    }    protected class ResponseDetails    {        public string RequestID;        public string Url;        public string ServerID;        public double Duration;        public string ResponseString;        public string FormattedDuration        {            get            {                return String.Format(""{0:N0}ms"", Duration);            }        }        public bool IsServerOk        {            get            {                // trivial check, better check intended for real implementation                return ResponseString.Contains(""&lt;body"");            }        }        public ResponseDetails(RequestState reqState, string serverID, string responseString)        {            this.RequestID = reqState.RequestID;            this.ServerID = serverID;            this.Url = reqState.Url;            this.ResponseString = responseString;            this.Duration = (DateTime.Now - reqState.RequestStartTime).TotalMilliseconds;        }    }    public const string pageDest = ""/"";    Dictionary&lt;string, string&gt; serverRequests = new Dictionary&lt;string, string&gt;()    {      { ""dev1"", ""http://www.yahoo.com"" },      { ""dev2"", ""http://www.msn.com"" },      { ""dev3"", ""http://www.google.com"" }    };    Dictionary&lt;string, ResponseDetails&gt; serverResponses = new Dictionary&lt;string, ResponseDetails&gt;();    object dictLock = new object();    int maxIOThreads = 0;    int maxWorkerThreads = 0;    protected bool ShowThreadingInfo = false;    protected bool ShowRequestTime = true;    protected bool ExecuteInParallel = true;    private string GetThreadingCounts()    {        StringBuilder sb = new StringBuilder();        sb.AppendFormat(""&lt;b&gt;EndIOCPUpDate {0}&lt;/b&gt;&lt;br /&gt;"", DateTime.Now);        /*                sb.AppendFormat(""CompletedSynchronously: {0}&lt;br/&gt;&lt;br/&gt;"" + AR.CompletedSynchronously + ""&lt;br /&gt;&lt;br /&gt;"");                sb.AppendFormat(""isThreadPoolThread: "" + System.Threading.Thread.CurrentThread.IsThreadPoolThread.ToString() + ""&lt;br /&gt;"";                sb.AppendFormat(""ManagedThreadId : "" + System.Threading.Thread.CurrentThread.ManagedThreadId + ""&lt;br /&gt;"";                sb.AppendFormat(""GetCurrentThreadId : "" + AppDomain.GetCurrentThreadId() + ""&lt;br /&gt;"";                sb.AppendFormat(""Thread.CurrentContext : "" + System.Threading.Thread.CurrentContext.ToString() + ""&lt;br /&gt;"";        */        int availWorker = 0;        int maxWorker = 0;        int availCPT = 0;        int maxCPT = 0;        ThreadPool.GetAvailableThreads(out availWorker, out availCPT);        ThreadPool.GetMaxThreads(out maxWorker, out maxCPT);        if (maxIOThreads &lt; (maxCPT - availCPT))            maxIOThreads = (maxCPT - availCPT);        if (maxWorkerThreads &lt; (maxWorker - availWorker))            maxWorkerThreads = (maxWorker - availWorker);        sb.AppendFormat(""--Available Worker Threads: {0}&lt;br/&gt;"", availWorker);        sb.AppendFormat(""--Maximum Worker Threads: {0}&lt;br/&gt;"", maxWorker);        sb.AppendFormat(""--Available Completion Port Threads: {0}&lt;br/&gt;"", availCPT);        sb.AppendFormat(""--Maximum Completion Port Threads: {0}&lt;br/&gt;"", maxCPT);        sb.AppendFormat(""===========================&lt;br /&gt;&lt;br /&gt;"");        return sb.ToString();    }    protected void Page_Load(object sender, EventArgs e)    {        foreach (KeyValuePair&lt;string, string&gt; kvp in serverRequests)        {            RequestState reqState = new RequestState(kvp.Key, kvp.Value);            Page.RegisterAsyncTask(new PageAsyncTask(new BeginEventHandler(this.BeginGetStatusPage),            new EndEventHandler(this.EndGetStatusPage), new EndEventHandler(this.TimeoutHandler), reqState, ExecuteInParallel));        }    }    protected override void OnPreRenderComplete(EventArgs e)    {        base.OnPreRenderComplete(e);        // write the result messages to the Label.        MessageOut();    }    private IAsyncResult BeginGetStatusPage(Object sender, EventArgs e, AsyncCallback cb, object state)    {        RequestState reqState = (RequestState)state;        AddTraceMessage(""Begin "" + reqState.Url);        reqState.CreateRequest();        return reqState.Request.BeginGetResponse(cb, reqState);    }    void EndGetStatusPage(IAsyncResult asyncResult)    {        AddTraceMessage(""EndAsync"");        if (asyncResult != null)        {            RequestState reqState = asyncResult.AsyncState as RequestState;            AddTraceMessage(""End "" + reqState.Url);            string serverKey = null;            string retString = null;            StringBuilder sb = new StringBuilder();            try            {                using (WebResponse response1 = (WebResponse)reqState.Request.EndGetResponse(asyncResult))                {                    AddTraceMessage(""End Response "" + reqState.Url);                    // grab a custom header later, not useful yet                    serverKey = response1.Headers[""Server""];                    // we will read data via the response stream                    using (Stream resStream = response1.GetResponseStream())                    {                        using (StreamReader rdr = new StreamReader(resStream))                        {                            sb.Append(rdr.ReadToEnd());                            rdr.Close();                        }                        resStream.Close();                    }                    response1.Close();                }            }            catch (WebException ex)            {                sb.AppendLine(ex.Status.ToString() + "": "" + ex.Message);            }            retString = sb.ToString();            AddTraceMessage(""End Response2 "" + reqState.Url);            ResponseDetails rd = new ResponseDetails(reqState, serverKey, retString);            UpdateServerResponses(rd);        }    }    void UpdateServerResponses(ResponseDetails details)    {        lock (dictLock)        {            serverResponses.Add(details.RequestID, details);        }    }    // This doesn't actually cancel the task I don't think    void TimeoutHandler(IAsyncResult asyncResult)    {        AddTraceMessage(""Request Timed Out"");        // Aborts one request running during page timeout.  What about the rest??        RequestState reqState = asyncResult.AsyncState as RequestState;        reqState.Request.Abort();        ShowErrorDetails(""&lt;span style='color:red;font-weight:bold'&gt;Timed out:&lt;/span&gt; "" + reqState.RequestID + ""&lt;br/&gt;&lt;br/&gt;"");    }    private void ShowErrorDetails(ResponseDetails rd)    {        PanelErrors.Visible = true;        LabelErrors.Text += String.Format(""&lt;span style='color:blue;font-weight:bold'&gt;{0}&lt;/span&gt;&lt;br/&gt;{1}&lt;br/&gt;&lt;br/&gt;"", rd.RequestID, rd.ResponseString);    }    private void ShowErrorDetails(string message)    {        PanelErrors.Visible = true;        LabelErrors.Text += message;    }    private void MessageOut()    {        PanelThreading.Visible = ShowThreadingInfo;        Page.Trace.Write(_trace.ToString());        foreach (KeyValuePair&lt;string, string&gt; kvp in serverRequests)        {            string respStr = ""&lt;font color='red'&gt;No Reply&lt;/font&gt;"";            if (serverResponses.ContainsKey(kvp.Key))            {                ResponseDetails rd = serverResponses[kvp.Key];                if (rd.IsServerOk)                {                    respStr = ""OK"";                    respStr += "" ("" + rd.ServerID + "")"";                }                else                {                    ShowErrorDetails(rd);                    respStr = ""&lt;font color='red'&gt;ERROR&lt;/font&gt;"";                }                //In parallel task mode it seems to return the time of the single longest individual request.  Really weird.                if (ShowRequestTime)                    respStr += "" ["" + rd.FormattedDuration + ""]"";            }            this.Label1.Text += String.Format(""{0}: {1}&lt;br/&gt;"", kvp.Key, respStr);        }        this.Label1.Text += String.Format(""&lt;br/&gt;&lt;b&gt;MaxWorkerThreads:&lt;/b&gt; {0}&lt;br/&gt;"", maxWorkerThreads);        this.Label1.Text += String.Format(""&lt;b&gt;MaxIOThreads:&lt;/b&gt; {0}&lt;br/&gt;"", maxIOThreads);    }    StringBuilder _trace = new StringBuilder();    DateTime _pageStartTime = DateTime.Now;    public void AddTraceMessage(string message)    {        double t = (DateTime.Now - _pageStartTime).TotalSeconds;        lock (_trace)        {            _trace.AppendFormat(""Thread:[{0:000}] {1:00.000} -- {2}\r\n"",            System.Threading.Thread.CurrentThread.GetHashCode(), t, message);            LabelThreading.Text += GetThreadingCounts();        }    }&lt;/script&gt;&lt;html xmlns=""http://www.w3.org/1999/xhtml""&gt;&lt;head runat=""server""&gt;    &lt;title&gt;&lt;/title&gt;&lt;/head&gt;&lt;body&gt;    &lt;form id=""form1"" runat=""server""&gt;    &lt;div&gt;        &lt;asp:Label runat=""server"" ID=""Label1""&gt;&lt;/asp:Label&gt;        &lt;asp:Panel runat=""server"" ID=""PanelErrors"" Visible=""false""&gt;            &lt;br /&gt;            &lt;h2&gt;                Error Details:&lt;/h2&gt;            &lt;br /&gt;            &lt;asp:Label runat=""server"" ID=""LabelErrors""&gt;&lt;/asp:Label&gt;        &lt;/asp:Panel&gt;        &lt;asp:Panel runat=""server"" ID=""PanelThreading"" Visible=""true""&gt;            &lt;br /&gt;            &lt;h2&gt;                Threading Details:&lt;/h2&gt;            &lt;br /&gt;            &lt;asp:Label runat=""server"" ID=""LabelThreading""&gt;&lt;/asp:Label&gt;        &lt;/asp:Panel&gt;    &lt;/div&gt;    &lt;/form&gt;&lt;/body&gt;&lt;/html&gt;</code></pre><p>Update: Is there any other information I should provide?</p>","144096","","426671","","2012-06-12 16:58:50","2012-06-12 16:58:50","Cleanly handling AsyncTimeout on ASP.NET Async Page","<android><asp.net><asynchronous><android-asynctask><iasyncresult>","0","1","1","",""
"2374813","1","2403381","","2010-03-03 20:46:11","1","3323","<p>I recently downloaded the latest NetBeans IDE (for MACOSX) and imported/migrated a project over from the ECLIPSE environment.</p><p>Everything looks, and works well... except that EMULATOR gets stuck ""waiting for the debugger to attach."" I tried ""Attaching Debugger..."" and set the PORT value to every case I've ever read about (8200, 8700, 5555, etc.) but the connection is refused.</p><p>I am of the opinion that this is not the preferred way to start a debugging session in NetBeans for Android.</p><p>What am I missing?</p>","267233","","114066","","2010-03-04 08:48:56","2010-03-08 17:47:36","How To debug Android app on Emulator using NetBeans IDE","<android><debugging><android-emulator><netbeans6.5>","2","2","","",""
"2375024","1","2375455","","2010-03-03 21:16:41","0","1820","<p>In my app I need to draw a widget contents onto Bitmap.</p><p>The code(pseudo) is as follows:</p><pre><code>AppWidgetHostView widget;Bitmap bitmap;...widget = pickWidget();...bitmap = Bitmap.createBitmap(128, 128, Bitmap.Config.RGB_565);final Canvas canvas = new Canvas(bitmap);widget.draw(canvas);</code></pre><p>I'm sure that pickWidget() works ok - if do setContentView(widget); I get the widget displayed properly on full screen.Bitmap I'm drawing to also displays ok - if I draw on a canvas using drawCircle or do setPixel() on the Bitmap for example I can see the drawings.So the issue is with widget.draw(), it doesn't seem to have any effect on the bitmap. Please share your thoughts.</p>","285746","","","","","2011-01-07 22:33:45","Drawing widget onto Bitmap","<android><android-widget>","2","2","5","",""
"2375084","1","5987934","","2010-03-03 21:24:06","6","4191","<p>I want to scroll the a <code>ListView</code> in Android by number of pixels. For example I want to scroll the list 10 pixels down (so that the first item on the list has its top 10 pixel rows hidden). </p><p>I thought the obviously visible <code>scrollBy</code> or <code>scrollTo</code> methods on ListView would do the job, but they don't, instead they scroll the whole list wrongly (In fact, the <code>getScrollY</code> always return zero even though I have scrolled the list using my finger.)</p><p>What I'm doing is I'm capturing Trackball events and I want to scroll the listview smoothly according to the motion of the trackball.</p>","11238","","","","","2012-10-22 20:58:53","Scroll a ListView by pixels in Android","<android><listview><scrolling>","2","2","3","",""
"2375377","1","2375437","","2010-03-03 22:08:28","0","392","<p>I have a class defined as</p><pre><code>public class viewGroups extends ListActivity</code></pre><p>Somewhere in the class I have </p><pre><code>objItem = new clsContactGroups(context);</code></pre><p>I am wondering what is advised to be used here? Which context?I know four choices, but maybe there are others...</p><pre><code>thisthis.getApplicationContext()this.getBaseContext()this.getParent()</code></pre><p>I use this Context to show a Toast. So I would like to show on the front-most view visible.</p>","243782","","267542","","2010-03-04 17:34:39","2010-03-04 17:34:39","Which Context to use in a activity class?","<java><android><view><android-context>","1","0","1","",""
"2375678","1","2375918","","2010-03-03 23:00:54","1","945","<p>In my foo_layout.xml file I have a subclassed RelativeLayout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;com.android.myapp.FooView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:background=""@drawable/pegboard_table""        android:orientation=""vertical""        android:scaleType=""fitXY""        &gt;        &lt;ImageView           android:id=""@+id/triangular""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:src=""@drawable/pegboard_board""        android:scaleType=""fitXY""    android:gravity=""center""        android:visibility=""invisible""        /&gt;        &lt;Chronometer        android:id=""@+id/timer""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""@drawable/timer_display""        android:textSize=""40sp""        android:textColor=""#000""        android:layout_alignParentTop=""true""        android:gravity=""center""        android:visibility=""invisible""/&gt;         &lt;TableLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:id=""@+id/board_table""        android:visibility=""invisible""        /&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:gravity=""center_horizontal""        android:background=""@drawable/tab_bar""&gt;        &lt;!-- android:layout_alignLeft=""@id/options_tab""--&gt;        &lt;ImageView         android:id=""@+id/game_select""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_weight=""1""        android:src=""@drawable/game_select"" android:paddingLeft=""15sp""/&gt;        &lt;ImageView         android:id=""@+id/undo_select""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/game_select""        android:layout_weight=""1""        android:src=""@drawable/undo""        /&gt;        &lt;ImageView         android:id=""@+id/settings_select""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/undo_select""        android:layout_weight=""1""        android:src=""@drawable/settings""        /&gt;           &lt;ImageView         android:id=""@+id/info_select""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/settings_select""        android:layout_weight=""1""        android:src=""@drawable/info""        /&gt;    &lt;/LinearLayout&gt;        &lt;/com.android.myapp.FooView&gt;&lt;/FrameLayout&gt;</code></pre><p>Then I have a java file FooView.java with the class extending RelativeLayout.</p><pre><code>package com.android.myapp;import android.content.Context;import android.util.AttributeSet;import android.view.View;import android.widget.RelativeLayout;import android.widget.TableLayout;public class FooView extends RelativeLayout {    public FooView(Context context) {        super(context);        fillTable();        // TODO Auto-generated constructor stub    }    public FooView(Context context, AttributeSet attrs) {        super(context, attrs);        fillTable();        // TODO Auto-generated constructor stub    }    public FooView(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        fillTable();        // TODO Auto-generated constructor stub    }    public void fillTable() {        int board = this.getChildCount();                View boardView = findViewById(R.id.board_table);        if (board > 0)            ;    }}</code></pre><p>board is always 0. boardView is always null.</p><p>This doesn't seem like the right behavior.  I've tried it with other views inside the FooView hierarchy and findViewById() always returns null.</p><p>For the life of me I can't figure out what I'm doing wrong.</p>","","user285808","","","","2010-03-03 23:44:43","Unable to access R.id from inside custom view","<android>","2","0","","",""
"2375925","1","2776491","","2010-03-03 23:46:18","3","1105","<p>I'm trying to prevent my application to call the same method twice in the event of a double-click, or if the user presses different buttons quickly, almost at the same time.</p><p>I have clickable Views, acting as buttons, that call the same method but passing different parameters. This is the call:</p><pre><code>startTheSearch(context, getState(), what, where);</code></pre><p>Inside this method I'm creating a new Thread, because it queries a web server for the result:</p><pre><code>new Thread(new Runnable() { public void run() {    progDiag = ProgressDialog.show(ctx, null, ""Searching"", true);    getServerXML(context, what, where, searchIsCustom, mOffset);       handler.sendEmptyMessage(0); } }).start();</code></pre><p>The problem is that upon two quick clicks, the method is fired twice, two threads are created, and consequently two new activities are created. That makes my app crash. </p><p>When the methods are done, and we have the result from the server, we call the handler:</p><pre><code>private Handler handler = new Handler() {@Overridepublic void handleMessage(Message msg) {super.handleMessage(msg);try {Intent i = new Intent(Golf.this, Result.class);Bundle b = new Bundle();b.putString(""what"", mWhat);b.putString(""where"", mWhere);b.putInt(""offset"", mOffset);b.putBoolean(""searchIsCustom"", searchIsCustom);i.putExtras(b);startActivityForResult(i, Activity.RESULT_OK);progDiag.dismiss();} catch (Exception e) { Alerts.generalDialogAlert(""Error"", ""settings"", ctx);}}};</code></pre><p>I tried to have a global boolean variable called ""blocked"" initially set to false, creating a condition like:</p><pre><code>if(!blocked){ blocked = true; new Thread(new Runnable() {  public void run() {</code></pre><p>But this only seems to work on slower phones like the G1, I tried on Nexus and before it set blocked = true, the second request has was granted. So is there any way I can block the method being called if it's already running, or if the thread has started so it wont create a new one?</p><p>Please, I really need to fix this. I've been developing on Android for almost 2 months now, but I'm yet to tackle that bug. Thanks in advance.</p>","285831","","285831","","2010-03-04 00:02:06","2010-05-07 11:15:51","Android: Stopping method to be called twice if already running","<android><methods><multithreading><block><stop>","3","0","1","",""
"2375962","1","2379461","","2010-03-03 23:53:57","14","30045","<p>I have a GridView that displays images, which are, unfortunately, of different sizes. They are shown in between two lines of text:</p><pre><code>text1.1                text1.2ImageView(IMAGE1)      ImageView(IMAGE2)text2.1                text2.2text3.1ImageView(IMAGE3)text4.1</code></pre><p>etc....</p><p>If IMAGE1 is the same height as IMAGE2, everything is fine, but if IMAGE1 is <strong>longer</strong> than IMAGE2, text2.1 will run into text3.1 (padding doesn't seem to help much, as there's too much of it when images are of the same height). </p><p>I know there's a way to stretch the images in the ImageView so they are the same height, but is it possible to keep images as is and set the <strong>row height</strong> somehow?</p>","267932","","267932","","2010-03-04 00:24:28","2013-02-01 10:35:18","GridView row height","<android><gridview><height><android-widget><row-height>","3","0","5","",""
"2376250","1","","","2010-03-04 01:13:15","91","57286","<p>I'm trying to define a GUI layout using XML files in Android. As far as I can find out, there is no way to specify that your widgets should use a custom font (e.g. one you've placed in assets/font/) in XML files and you can only use the system installed fonts.</p><p>I know that, in the Java code, I could change the font of each widget manually using unique IDs. Alternatively, I could iterate over all the widgets in Java to make this change, but this would probably be very slow.</p><p>What other options do I have? Is there any better ways to making widgets that have a custom look? I don't particularly want to have to manually change the font for every new widget I add.</p>","284055","","","","","2013-12-13 09:18:00","Custom fonts and XML layouts (Android)","<java><android><gui><interface><fonts>","10","2","75","",""
"2376327","1","","","2010-03-04 01:33:44","1","915","<p>I'm making an Android Java app game (although this question applies to all languages really) and hope to release the first version soon. I'm nervous about how I save data in my game. My problem is that, if in a later update, I decide to store more data or store the same data in a different way, I need to be careful I don't lose or corrupt data for users that upgrade (i.e. I  want users to be able to use  data  created by an old version in the new version, like their high scores from before).</p><p>For example, say I want to save high scores in version 1 and I use a class like:</p><pre><code>class Score { String name; int score; }</code></pre><p>I then store the scores in an ArrayList and then, to save/load the scores, I serialize the ArrayList object.</p><p>In version 1.1, maybe I decide I want to store the date with each score. I could then update the Score object to include a date field and use default values for date if an old object does not include a date.</p><p>In version 1.2, maybe I decide that I want to store scores in an TreeSet instead and in version 1.3 perhaps I want to load/store scores online as well.</p><p>Anyway, my point is, are there any general tips for making my life easy here? I'm particularly concerned about situations from the above, where one person upgrades from version 1.1 to 1.2 and one person upgrades from 1.0 to 1.2. Testing all scenarios for data corruption sounds like a headache.</p><p>Is it really just a case of thinking really hard to pick something sensible and scalable to start with?</p><p>I'm thinking it might be easy to use a HashMap from String->Object as a general purpose storage object e.g. storage.put(""HighScoreName1"", ""Bob""); storage.put(""HighScorePoints1"", 15);. Getting the information out is a little messier than if I'd have used a custom class, but it seems easy to add extra fields and so on without much work. Iterating over lists stored in this way isn't great though. </p>","284055","","","","","2010-03-04 06:39:35","Best way to store application data when data stored and data format could change in future versions?","<java><c++><android><serialization><file>","3","0","","",""
"2376471","1","4892013","","2010-03-04 02:15:44","36","29982","<p>On Android, I have a <code>WebView</code> that is displaying a page.</p><p>How do I get the page source without requesting the page again?</p><p>It seems <code>WebView</code> should have some kind of <code>getPageSource()</code> method that returns a string, but alas it does not.</p><p>If I enable JavaScript, what is the appropriate JavaScript to put in this call to get the contents?</p><pre><code>webview.loadUrl(""javascript:(function() { "" +      ""document.getElementsByTagName('body')[0].style.color = 'red'; "" +      ""})()"");  </code></pre>","108495","","491216","","2014-02-27 10:57:46","2014-02-27 10:57:46","How do I get the web page contents from a WebView?","<android><android-webview>","4","2","34","",""
"2376512","1","2378757","","2010-03-04 02:28:47","4","3440","<p>I want to test a compass app on the emulator. Is this possible or do I have to use a real device. Also I do not want to use gps.</p>","280653","","213269","","2010-11-30 01:33:18","2011-03-31 14:20:10","Can I emulate a compass on Android","<android><android-emulator><compass-geolocation>","3","0","3","",""
"2376608","1","2379751","","2010-03-04 03:03:26","1","1514","<p>i am developing one application with map view i need display the weather depends on user place how can i get the weather report depending on the user lat and lon </p><p>Thanks</p><p>Aswan</p>","1746300","","8446","","2010-03-04 14:08:48","2010-03-04 14:08:48","how to get nearby city for weather forecast","<android><weather>","1","1","2","",""
"2377095","1","","","2010-03-04 05:30:22","1","1799","<p>I've managed to get the tab layout example working with the three tabs, albums, songs &amp; artists thanks to other posts on this site.  I'm simply trying to add a new tab called, lyrics, following the same procedure by doing the following...</p><p>Adding new activity/class called LyricsActivity.....</p><p>public class LyricsActivity extends Activity{  public void onCreate(Bundle savedInstanceState)   {         super.onCreate(savedInstanceState);</p><pre><code>     TextView textview = new TextView(this);     textview.setText(""This is the Lyrics tab"");     setContentView(textview);</code></pre><p>}}</p><p>And then adding the following to the AndroidManifest file....</p><p></p><p>What happens is that the new Lyrics tab comes up correctly but the text, 'This is the Lyrics tab' does not display, instead it says 'This is the Songs tab'.  Any ideas?</p><p>Thanks</p><p>SD</p>","285985","","","","","2010-08-25 20:28:52","Following tab layout android example on developer website & trying to add a fourth tab","<android>","1","0","","",""
"2377225","1","20281964","","2010-03-04 06:09:46","1","3700","<p>Where do I find the version information in source files on Android platform?</p><p>I tried to find out some information listed in setting >> about phone. Some of the displayed information is, firmware version, module number, baseband version, kernel version, ...</p>","206630","","844882","","2012-03-17 07:34:34","2014-03-13 10:12:46","Where to find the version information in source code on Android platform","<android>","2","0","1","",""
"2377268","1","2377363","","2010-03-04 06:23:50","2","3650","<p>I put a notification in the status bar with a PendingIntent (with Extras info) that points to my main app (main activity). When the user clicks the staus bar, the PendingIntent is fired and my app launches and I can read the Extras info in my onCreate() method. So far so good. </p><p>But if my app is already running, the PendingIntent simply causes the app to come to the foreground and it does not call any of my methods, so I can't read the content in Extras. What can I do? </p><p>Thanks! </p>","277827","","","","","2010-03-04 06:51:48","Android: How to catch Intent's Extras if the activity is already running?","<java><android><android-intent><extras>","1","0","","",""
"2377284","1","","","2010-03-04 06:27:16","4","26772","<p>[2010-03-04 11:50:15 - AndroidSamples]Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY</p><p>when i uses the </p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;uses-library android:name=""com.google.android.maps"" /&gt;..&lt;/application&gt;</code></pre><p>please do reply me</p>","268741","","569101","","2013-09-09 11:17:27","2013-12-04 10:35:23","INSTALL_FAILED_MISSING_SHARED_LIBRARY an android emulator proplem","<android><google-maps>","5","1","","",""
"2377485","1","6052096","","2010-03-04 07:22:43","4","8633","<p>I made an application in android and used timer like this..</p><pre><code>try {    CountDownTimer  start1 = new CountDownTimer(20000, 1000) {        public void onTick(long millisUntilFinished) {                TextView timeShow = (TextView)findViewById(R.id.showTime);        timeShow.setText("" ""+"" 00:"" +millisUntilFinished / 1000);            }</code></pre><p>But my problem is i don't know how to stop timer. Any idea?</p><p>I already tried:</p><pre><code>quitApplication.setOnClickListener(new OnClickListener() {    public void onClick(View v) {         start1.cancel();         Intent i = new Intent(v.getContext(), startGame.class);        startActivity(i);        // TODO Auto-generated method stub     } }); </code></pre>","263325","","114066","","2010-03-04 12:36:12","2011-05-18 23:14:32","Timer does not stop in android","<android><timer>","3","0","2","",""
"2377755","1","","","2010-03-04 08:19:27","0","2174","<p>I want to toast text entered into a texbox using an asynchronous event eg. press button. It compiles without error but nothing happens when the button is pressed. From what I have been able to gather on the forum, my context is wrong. Can someone help me? Below is the code:</p><pre><code>mSendButton = (Button)findViewById(R.id.button_send);mSendButton.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        TextView view = (TextView)findViewById(R.id.edit_text_out);        String message = view.getText().toString();        if (message == ""bla"") {            Toast.makeText(getApplicationContext(), ""Bla was entered"", Toast.LENGTH_LONG).show();        }        else {            Toast.makeText(getApplicationContext(), ""Bye "", Toast.LENGTH_SHORT).show();        }    }});</code></pre>","286081","","1820695","","2013-01-04 14:24:22","2013-01-04 14:24:22","getApplicationContext() not working for asynchronous event","<android>","1","0","1","",""
"2377843","1","","","2010-03-04 08:38:52","3","852","<p>How to package a static file and then be able to ::fopen it from JNI?</p><p>I have read about res/raw/blah and R.raw.blah stuff, but when I install app on emulator and do ""adb -e shell"", cd /data/data/my_app/, ls, the file is not there.</p>","286091","","21234","","2010-03-04 08:42:14","2010-05-19 17:09:40","Android. How to package a file and then ::fopen it from JNI?","<android>","1","0","","",""
"2378149","1","","","2010-03-04 09:40:31","1","211","<p>I am Using phoneGap as a environment to develop the code. so i need to know how to integrate blackberry and androied into the same IDE(Eclipse  ).</p>","286130","","","","","2010-03-04 10:02:58","Please tell me how to integrate blackberry and androied into the same IDE","<android><blackberry><eclipse-plugin><phonegap>","1","0","0","",""
"2378447","1","","","2010-03-04 10:27:29","0","856","<p>I have a <code>View</code> implementation whose parent layout is a <code>ScrollView</code>.  I would like to be called back when the IME is shown/hidden so that I can resize the <code>View</code> accordingly.  I understand that <code>onSizeChanged()</code> should be called each time the IME is shown or hidden, but in my code this is not happening.</p><p>I've written a test application in order to get the functionality I'm after, and it contains:</p><ul><li>A <code>Button</code> to toggle the IME (show/hide).</li><li>A <code>ScrollView</code> containing several <code>TextView</code>s.</li></ul><p>When I click on the button (in this test app), then the IME is shown and the <code>ScrollView</code> is resized accordingly.  This is the behaviour I want.  I note that in the test app, the <code>ScrollView</code>'s <code>onSizeChanged()</code> gets called by the framework requesting a layout, and then an <code>invalidate()</code> to redrawthe screen.  This behaviour is missing in my incorrectly-functioning application; there is no call to the <code>ScrollView</code>'s <code>onSizeChanged()</code> or to my implemented <code>View</code>'s <code>onSizeChanged()</code>.</p><p>My manifest contains the <code>android:windowSoftInputMode=""adjustResize""</code> attribute, and I've also added <code>isScrollContainer=""true""</code> to the <code>ScrollView</code>'s attribute in the layout xml, but this doesn't appear to make any difference.</p><p>Could someone please suggest what it is that I could look at in order to get the <code>onSizeChanged()</code> callback in my <code>View</code>?</p><hr><p>Note: This is essentially a cross-post of the following on the Android-Developers group:</p><p><a href=""http://groups.google.com/group/android-developers/t/fa84d7cb450c7f5e"" rel=""nofollow"">http://groups.google.com/group/android-developers/t/fa84d7cb450c7f5e</a></p><p>Apologies if this offends anyone, but by posting here (with appropriate tags) I believe that the android team will see it and hopefully provide some assistance.</p>","286160","","","","","2010-03-07 15:40:06","How do I ensure that the IME show/hide results in a call to View.onSizeChanged()","<android>","1","0","","",""
"2378526","1","","","2010-03-04 10:39:51","1","1174","<p>I need some advices about the Android OS and application.</p><p>I wonder if the Android OS is able to push network connecting status to applications.(I found applications can get a network connecting status from android OS. But I can't find reverse cases.)</p><p>However, I am thinking android OS may push network connecting status to applications.</p><hr><p>when application is installed on android os, is it possible to register something for monitoring phone's network status on android os.</p><p>Because I want my application can receive phone's network status from android os.(not by asking directly to android os.) </p><p>It means: when phone's network status changes, does android os automatically informs phone's network status to application?</p><p>I'm sorry my English writing is bad TT; </p><p>Have a nice weekend~</p><p>Korean: ????? OS?? ?? ??????? ???? ?? ??? ???? ? ? ?? ??? ?????</p><p>?? ? ??? ????,?????? ??????? ??? ? ??????? ??? listener(?? ??? ??)? ????? OS? ??? ? ????? ? listener? ???????? ?? ?? ????? OS? ???? ??? ??? ???? ??? ???? ?? ??? ??????? ???? ??? ????? ????. </p><p>?? ??? ?? ? ???? ????????.</p><p>??? ?? ???~</p>","112072","","112072","","2010-03-05 03:26:08","2010-10-11 18:45:11","Can android OS push information about network connecting status to application?","<android><networking>","2","2","","",""
"2378559","1","","","2010-03-04 10:44:21","2","2079","<p>How can i set the number of items to show in a list without to scroll? </p><p>Example: I have a list with 10 items. I want that only 3 items appears and that I have to scroll to see the rest of the items.</p>","258863","","114066","","2012-01-27 08:42:49","2012-01-27 08:42:49","Android ListView set Number of items to show","<android><layout><android-listview>","1","0","","",""
"2378598","1","2379478","","2010-03-04 10:51:10","2","1894","<p>I have a button in my Android project that contains two rows with text to the left, and one drawable on the right side. This works perfectly with this code:</p><pre><code>&lt;Button   android:text=""Call History""   android:id=""@+id/accountCallLogButton""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""  android:drawableRight=""@drawable/arrow""  android:padding=""10sp""   android:background=""@drawable/buttconfig""   android:gravity=""left|center_vertical""&gt; &lt;/Button&gt;</code></pre><p>String resource:  </p><pre><code>&lt;string name=""addCreditButtonText""&gt;Add Credit\nOpens in browser&lt;/string&gt;</code></pre><p>My problem here is that in the second Line of the String resource, I want to have a smaller font size and italic font.<br>How can I solve this?   </p>","270421","","114066","","2010-03-04 11:01:53","2011-12-17 04:43:47","How to change font size on a button?","<android><layout><button>","1","0","3","",""
"2378607","1","2378619","","2010-03-04 10:52:04","217","142093","<p>I get the following Exception running my app:</p><pre><code>java.net.SocketException: Permission denied (maybe missing INTERNET permission)</code></pre><p>How do I solve the missing permission problem?</p>","114066","","445131","","2013-04-09 15:24:07","2013-12-24 09:16:50","What permission do I need to access Internet from an android application?","<android><permissions><socketexception>","3","0","34","",""
"2378800","1","2379054","","2010-03-04 11:22:15","122","59757","<p>I have a simple problem, I have loaded an external URL in my <code>WebView</code>. Now what I need is that when the user clicks on the links on the page loaded, it has to work like a normal browser and open the link in the same <code>WebView</code>. But it's opening the default browser and loading the page there?</p><p>I have enabled JavaScript. But still it's not working. Have I forgotten something?</p>","238071","","815724","user1521536","2013-04-12 14:46:40","2014-04-11 22:33:25","Clicking URLs opens default browser","<android><url><android-webview><android-websettings>","4","0","44","",""
"2378901","1","2379113","","2010-03-04 11:38:16","0","1279","<p>in my activity</p><p>1 editext field and 2 check boxes</p><p>i do setText(""default text"") in oncreate.</p><p>when my application lods display default text also blinking cursor inside the text field also shows orange border tells it is having focus.</p><p>i don't want to be text field focus on create instead it should focus on some where else i did request focus on rest of the checkboxes but it didn't work out textfield still having focus.</p>","216431","","","","","2010-03-04 12:13:32","android Editext setText should not focused and blinking cursor","<android><textbox>","1","0","","",""
"2378940","1","4100888","","2010-03-04 11:43:54","1","234","<p>Is there any way to show a message such as ""No results"" when i filter a list?</p>","258863","","114066","","2010-03-04 16:12:09","2011-09-29 22:33:59","How to display a special message if a filtered list view contains no results any more?","<android><listview>","1","0","1","",""
"2378974","1","2379000","","2010-03-04 11:49:25","4","6118","<p>I am implementing a custom dialog to form an about screen with a simple look and feel (which may become more complex once I get it working).  I have a xml layout that loads some text and an icon from R.   However when ever showDialog(int) is called I get a force close.</p><p>I followed the instructions as per the dev guide: <a href=""http://developer.android.com/intl/de/guide/topics/ui/dialogs.html"" rel=""nofollow"">http://developer.android.com/intl/de/guide/topics/ui/dialogs.html</a></p><p>code is as follows:</p><pre><code> @Override protected Dialog onCreateDialog(int id) {   Dialog dialog;      switch(id) {      case DIAG_ABOUT:       dialog = new Dialog(getApplicationContext());       dialog.setContentView(R.layout.aboutdialog);       dialog.setTitle(R.string.about_title);       dialog.setOwnerActivity(this);       break;      default:          dialog = null;      }      return dialog; }</code></pre><p>DIAG_ABOUT is defined as <code>private static final int DIAG_ABOUT = 0;</code></p><p>The Log cat shows the following trace:</p><pre><code>03-04 11:37:08.760: ERROR/AndroidRuntime(726): Uncaught handler: thread main exiting due to uncaught exception03-04 11:37:08.780: ERROR/AndroidRuntime(726): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.view.ViewRoot.setView(ViewRoot.java:429)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:178)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.app.Dialog.show(Dialog.java:231)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.app.Activity.showDialog(Activity.java:2407)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at uk.me.cpearson.runningLate.Home.onOptionsItemSelected(Home.java:143)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.app.Activity.onMenuItemSelected(Activity.java:2085)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:820)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:139)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:813)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:519)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.view.View.onTouchEvent(View.java:3828)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.widget.TextView.onTouchEvent(TextView.java:6291)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.view.View.dispatchTouchEvent(View.java:3368)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1691)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1525)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.os.Handler.dispatchMessage(Handler.java:99)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.os.Looper.loop(Looper.java:123)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at android.app.ActivityThread.main(ActivityThread.java:3948)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at java.lang.reflect.Method.invokeNative(Native Method)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at java.lang.reflect.Method.invoke(Method.java:521)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)03-04 11:37:08.780: ERROR/AndroidRuntime(726):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Can some one point out where I have gone wrong, I am using SDK 1.5 </p>","238174","","","","","2010-03-04 11:53:21","Android custom dialog force close","<android><dialog>","1","0","1","",""
"2379034","1","2379069","","2010-03-04 12:00:09","0","972","<p>I am currently trying to create an Android application that loops Audio from the mic to the earpiece, I can do that perfectly but when I do it over and over again in my application I eventually get an Out Of Memory Error.</p><hr><p>Here is the code I use to create the Audio Loop:</p><pre><code>static final int bufferSize = 200000;    final short[] buffer = new short[bufferSize];    short[] readBuffer = new short[bufferSize];    public void run() {        isRecording = true;      android.os.Process.setThreadPriority      (android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);      int buffersize = AudioRecord.getMinBufferSize(11025,      AudioFormat.CHANNEL_CONFIGURATION_MONO,      AudioFormat.ENCODING_PCM_16BIT);                     arec = new AudioRecord(MediaRecorder.AudioSource.MIC,                                     11025,                                     AudioFormat.CHANNEL_CONFIGURATION_MONO,                                     MediaRecorder.AudioEncoder.AMR_NB,                                     buffersize);                     atrack = new AudioTrack(AudioManager.STREAM_VOICE_CALL,                                     11025,                                     AudioFormat.CHANNEL_CONFIGURATION_MONO,                                     MediaRecorder.AudioEncoder.AMR_NB,                                     buffersize,                                     AudioTrack.MODE_STREAM);                     Log.d(""AUDIO"", ""sample rate = : "" + arec.getSampleRate());                     atrack.setPlaybackRate(11025);                     byte[] buffer = new byte[buffersize];                     arec.startRecording();                     atrack.play();                     while(isRecording) {                             arec.read(buffer, 0, buffersize);                             atrack.write(buffer, 0, buffer.length);                     }      }</code></pre><hr><p>And here is the error I get:</p><pre><code>ERROR/AndroidRuntime(3442): Uncaught handler: thread main exiting due to uncaught exceptionERROR/AndroidRuntime(3442): java.lang.OutOfMemoryErrorERROR/AndroidRuntime(3442):     at com.phone.engine.CallAudio$Record.&lt;init&gt;(CallAudio.java:114)ERROR/AndroidRuntime(3442):     at com.phone.engine.CallAudio.onCreate(CallAudio.java:42)ERROR/AndroidRuntime(3442):     at android.app.ActivityThread.handleCreateService(ActivityThread.java:2465)ERROR/AndroidRuntime(3442):     at android.app.ActivityThread.access$2800(ActivityThread.java:112)ERROR/AndroidRuntime(3442):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1744)ERROR/AndroidRuntime(3442):     at android.os.Handler.dispatchMessage(Handler.java:99)ERROR/AndroidRuntime(3442):     at android.os.Looper.loop(Looper.java:123)ERROR/AndroidRuntime(3442):     at android.app.ActivityThread.main(ActivityThread.java:3948)ERROR/AndroidRuntime(3442):     at java.lang.reflect.Method.invokeNative(Native Method)ERROR/AndroidRuntime(3442):     at java.lang.reflect.Method.invoke(Method.java:521)ERROR/AndroidRuntime(3442):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)ERROR/AndroidRuntime(3442):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)ERROR/AndroidRuntime(3442):     at dalvik.system.NativeStart.main(Native Method)</code></pre><hr><p>So the Error specifically focuses on this line in the code</p><pre><code>short[] readBuffer = new short[bufferSize];</code></pre><p>And it happens after I try to do the Loop several times, so say I start the application and after 10 times starting the loop I get the error.</p><p>So I think the buffer is simply becomiing full or something?? Is that correct? If so how would I keep clearing out the buffer?</p><p>Thanks in advance</p>","243999","","","","","2010-03-04 12:06:39","java.lang.OutOfMemoryError on Audio Buffer","<java><android><memory><buffer><out-of-memory>","1","0","","",""
"2379191","1","","","2010-03-04 12:25:51","0","323","<p>I had come across a code snippet which calls for an activity without referring to any context. Before, i was considering that context is used to tell about the calling component. But as i came see that another component can be called without any reference to context, it makes me wonder what purpose it might be serving. please put some light on it.</p><p>Here is the code which calls for an activity without referring to 'context'</p><pre><code>Intent i=new Intent();ComponentName cn=new ComponentName(""application package name"",""fully qualified class name"");i.setComponent(cn);i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(i);</code></pre>","273548","","","","","2010-11-04 20:11:08","What is the significance of 'context' in various constructor of Intent class when starting an activity","<android>","1","2","","",""
"2379233","1","","","2010-03-04 12:34:46","4","8105","<p>I've been working on an app and I've managed to get the <code>AsyncTask</code> to work fine when it's in an inner class. </p><p>Now, I am refactoring the code so that the <code>AsyncTask</code> is in a separate class of its own, but I am wondering, how do I kill the <code>ProgressDialog</code> and start a new Activity once the task is completed successfully? I've tried starting a new Activity in the <code>onPostExecute(..)</code> method, but I know that won't work.</p><hr><p>Passing my UI thread activity as an argument in the constructor for the AsyncTask did not seem to work:</p><pre><code>//In UI Thread I hadpublic class Test101 extends Activity {    private Button btnLogin;    private LoginTask mLoginTask;    private Context context=this;    private Test101 mTest101;    mLoginTask=new LoginTask(context,mTest101);    mLoginTask.execute(null);    // In the AsyncTask I had    Activity mParentActivity;    public LoginTask(Context context,Activity act){        this.ctx=context;        this.mParentActivity=act;    }    onPostExecute(..){        mParentActivity.callSomeMethod();    }    ...}</code></pre><p>I kept getting a <code>NullPointerException</code>, maybe I'm missing something but that didn't work for me.</p>","251840","","868694","","2013-07-20 18:43:14","2013-07-20 19:27:57","Android AsyncTask in external class","<android><asynchronous><android-asynctask>","5","1","1","",""
"2379237","1","","","2010-03-04 12:35:08","5","7559","<p>Does Android supports SQL Servers? If so how to connect to SQL 2008 in my Android Application?</p>","286243","","114066","","2010-03-04 12:40:28","2014-03-15 07:18:06","Android with SQL Server 2008","<sql><android>","3","0","2","",""
"2379449","1","","","2010-03-04 13:10:39","1","314","<p>I am developing an application for Android.</p><p>I need to display a numeric keypad on the screen.</p><p>How can this be achieved?</p>","271694","","126039","","2010-03-04 13:28:03","2011-07-08 01:04:40","touchscreen keypad","<android>","2","0","","",""
"2379474","1","2416410","","2010-03-04 13:14:36","0","427","<p><br>I'm implementing global search box extension (sth like SearchableDictionary sample in android sdk). Everything works fine - suggestions are displayed properly. Problem is that I want browser to start when user picks a suggestion. (each suggestion is a link)<p></p><p>Columns of my cursor contain SearchManager.SUGGEST_COLUMN_INTENT_DATA, and I use that to pass http link. My searchable xml contains default intent action set to: android:searchSuggestIntentAction=""android.intent.action.VIEW"". But when user hits the suggestion, my application is started instead of browser. What am I missing?<br>Regards!</p>","229697","","229697","","2010-03-14 08:15:07","2010-12-14 06:03:54","Global search box extension - how to make browser to start when suggestion picked","<android>","2","2","","",""
"2379527","1","5837927","","2010-03-04 13:24:38","18","16191","<p>I want a group of buttons where a user can choose one of them as option. It has to be a radiobuttongroup like behaviour, but I don't want the radio circle to be present. I just want the user to be able to toggle only one of the buttons.</p><p>I think I would need someting like a togglegroup.</p><p>Does something like this exist in Android?</p>","107029","","114066","","2010-03-04 16:02:23","2013-06-20 08:22:49","Android: How to get a radiogroup with togglebuttons?","<android><togglebuttonbar>","6","2","17","",""
"2379550","1","2379683","","2010-03-04 13:27:16","14","6961","<p>I am looking to the fastest and the correct way to check if a record exists in the database:</p><pre><code>public boolean Exists(String _id) {    Cursor c=db.query(TABLENAME(), new String[] {""1""}, ""_ID=""+_id, null, null, null, null);    if (!c.equals(null))        return c.moveToFirst();    return false;}</code></pre><p>Do you see any problem with it?</p>","243782","","243782","","2010-03-04 13:44:47","2013-05-22 03:40:14","Android record exists() in database?","<java><android>","2","0","7","",""
"2379578","1","2381894","","2010-03-04 13:30:45","-2","5173","<p>i want to bulid a table layouts like this.how? </p><p><img src=""http://privateevent.co.uk/underground/img/gallery/19_1236343602.png"" alt=""alt text""></p>","267269","","","","","2011-03-31 01:29:49","how to show group tableview android?","<android><gridview><tablelayout>","2","3","4","2012-11-27 03:32:21",""
"2379613","1","2379719","","2010-03-04 13:36:22","1","295","<p>Is including a application package prefix while defining a custom action string is convention or mandatory?</p>","273548","","","","","2010-03-04 13:52:16","Is it necessary to include application package prefix when defining a Custom Action string","<android>","1","0","","",""
"2379654","1","2380147","","2010-03-04 13:41:21","7","12058","<p>I want to show a custom image with some data in it while clicking map overlay that i have added to google map in android.</p><p>Can any one guide me how can i create that custom image or thing to be displayed on google map with some data on it?</p><p>some body told me to go for custom view but i have no idea about them.</p>","249991","","114066","","2010-03-04 14:04:03","2012-12-13 03:27:07","How to show pop up on clicking map overlay?","<android><google-maps>","2","1","7","",""
"2380152","1","6246593","","2010-03-04 14:49:53","8","3671","<p>All,</p><p>I have been asked to evaluate the Android platform for our product and I am looking at various options, I am only just scratching the surface just now and the one thing that is bothering me is that I cannot see how to compile code as straight ARM code (no Thumb), I know that Thumb runs slower and we will need the performance in key sections of our code.</p><p>I <em>think</em> it should just be setting the -march flag in the LOCAL_CFLAGS of the Android.mk file, but I cannot get that to work...</p><p>Can anyone help.</p><p>Russell</p>","233666","","102703","","2010-03-26 21:11:53","2011-06-05 23:21:53","Android NDK - does it support straight ARM code or just Thumb","<android><android-ndk>","2","0","4","",""
"2380161","1","2426846","","2010-03-04 14:51:45","7","1992","<p>I'm playing arround with <a href=""http://code.google.com/p/google-gson/"" rel=""nofollow"">google gson</a> for communication with my web back end at the moment.<a href=""http://groups.google.com/group/android-developers/browse_thread/thread/855850568a397fd0/529a1ef318e90f5c?lnk=gst&amp;q=%22gson%22+android#529a1ef318e90f5c"" rel=""nofollow"">This</a> and <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/96bdce29c3cb6a94"" rel=""nofollow"">this</a> older posts indicate that there are some problems with gson on android.  </p><p>I did some easy tests on the device already but maybe I just missed the bug. </p><p><strong>Edit</strong> I'm now parsing a lot more data. Generic lists etc. still not encountered the bug.</p><p>Has anybody used gson on Android already? How does it work? Has somebody encountered bugs or something that will stop me from using it once it gets more complicated?</p>","114066","","157882","","2010-08-11 21:59:50","2011-03-07 19:00:49","Is google gson running on android?","<android><json><gson>","2","1","2","",""
"2380258","1","2380459","","2010-03-04 15:04:32","37","12299","<p>Simply put: What is the most effective way to share / reuse code between iPhone and Android builds?</p><p>The two most common scenarios I think would be:</p><ol><li>Blank slate new project, knowing ahead of time there is a large chunk of reusable logic that needs to run on each device.</li><li>Existing iPhone code base, porting of C, C++ and Objective-C to the <a href=""http://developer.android.com/sdk/ndk/1.6_r1/index.html"">Android NDK</a> or otherwise.</li></ol><p>Yes of course in a perfect world all apps would just plug into the magical cloud and all the reusable logic would be up in Google App Engine or some web services, but that is not the spirit of this question.  After experiencing a port of iPhone to Android with no code reuse at all second-hand and seeing the pain that person had to endure, I'd like to know how other people are avoiding it.</p>","13263","","13263","","2010-03-05 13:18:55","2012-05-07 21:15:45","Crossplatform iPhone / Android code sharing","<java><c++><iphone><objective-c><android>","9","1","19","",""
"2380482","1","","","2010-03-04 15:32:29","0","832","<p>I'm trying to port one of my OpenGL/Glut programs over to Android 1.6. I used GLut extensively due to my classes teaching glut. Is there an alternative to glutTimerFunc or replacement for using glutTimerFunc? </p><p>Also, any ideas where I can replace glutMainLoop? From looking at a few examples, onDrawFrame what I should be looking at?</p>","286377","","286377","","2010-03-04 15:37:30","2010-03-04 18:11:29","Time Steps in Android OS 1.6 using OpenGL?","<java><android><opengl-es>","1","0","","",""
"2380706","1","2380744","","2010-03-04 16:01:27","19","6128","<pre><code>private Cursor getContacts()    {        // Run query        Uri uri = ContactsContract.Contacts.CONTENT_URI;        String[] projection = new String[] {                ContactsContract.Contacts._ID,                ContactsContract.Contacts.DISPLAY_NAME        };        String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + "" = '"" +                (mShowInvisible ? ""0"" : ""1"") + ""'"";        String[] selectionArgs = null;        String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + "" COLLATE LOCALIZED ASC"";        return managedQuery(uri, projection, selection, selectionArgs, sortOrder);    }</code></pre><p>What does <code>COLLATE LOCALIZED ASC</code> stand for?</p>","243782","","","","","2011-12-26 11:23:25","What does COLLATE LOCALIZED ASC stand for?","<java><android><sqlite><contactscontract>","2","0","","",""
"2380773","1","","","2010-03-04 16:11:14","4","595","<p>Does the Android SDK have the ability to to trap a Dropped Call event? If so, what is it called? I've been prowling the documentation looking for it.</p><p>Is there a difference between a hang up, and a dropped call?</p>","256206","","","","","2012-12-10 20:27:14","Is there a Dropped Call Listener","<android>","2","0","0","",""
"2380774","1","2381501","","2010-03-04 16:11:23","2","2541","<p>I have some trouble achieving adequate real-time performance from my application and wondering if I've architect-ed it sub-optimally. The requirement is for the application to play a sound and draw a line on a <code>Canvas</code> at a user specified time interval. </p><p>I have a <code>Thread</code> that sleeps for the user-specified time interval, wakes up and uses a <code>Handler</code> and <code>Runnable</code> to do the required drawing and sound playback. When I run the application, the beat is steady sometimes, but other times, you can see the effect of GC and random warning conditions from the <code>AudioFlinger</code>.</p><p>Is having a <code>Timer</code> thread post back to the GUI thread via Handler/Runnable the best approach? Is there something I can do to bump up the priority of my app while it is visible so that other apps and Android activity are less likely to interrupt it? Do I need to use the NDK to access real-time features not present in the Java API?</p>","267257","","592025","","2012-02-15 06:48:12","2012-02-15 06:48:12","Android architecture for real-time applications","<android><architecture><timer><real-time>","2","0","2","",""
"2380899","1","2397248","","2010-03-04 16:29:37","2","3144","<p>Going round in circles here i think.</p><p>I have an activity called Locate;</p><pre><code>public class Locate extends Activity {public static String lat;public static String lon;public static String number;    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.locate);    final Button buttonMaps = (Button) findViewById(R.id.ButtonMaps);    buttonMaps.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {         Toast.makeText(getBaseContext(), ""Button Pressed"", Toast.LENGTH_SHORT).show();        try {         Intent i = new Intent(getBaseContext(), displayMap.class);         i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);         startActivity(i);         }         catch (ActivityNotFoundException e) {          Toast.makeText(getBaseContext(), ""Activity Not Found"", Toast.LENGTH_SHORT).show();          }    }});// Toast.makeText(getBaseContext(), ""lat: "" + lat + "" long: "" + lon + "" from: "" + testname, Toast.LENGTH_LONG).show();}</code></pre><p>If I make the displayMap class into a normal Activity, and just have display a toast message confirming it has loaded - then it works fine.</p><p>If i do this though;</p><pre><code>public class displayMap extends MapActivity {    /** Called when the activity is first created. */public void onCreate(){    setContentView(R.layout.displaymap);    Toast.makeText(getBaseContext(), ""Display Map"", Toast.LENGTH_SHORT).show();}@Overrideprotected boolean isRouteDisplayed() {// TODO Auto-generated method stubreturn false;}}</code></pre><p>Then as soon as I click the Button, I get a force close.</p><p>I have the correct 'uses-library' tag in my manifest;</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt; &lt;uses-library android:name=""com.google.android.maps"" /&gt;</code></pre><p>I don't get what it just force closes everytime i try and load it.</p><p>If I make this my onClick handler then it will fire up a working googlemaps/default mapview</p><pre><code>        public void onClick(View v) {         Toast.makeText(getBaseContext(), ""Button Pressed"", Toast.LENGTH_SHORT).show();         Uri uri=Uri.parse(""geo:""+Locate.lat+"",""+Locate.lon);         StartActivity(new Intent(Intent.ACTION_VIEW, uri));         }</code></pre><p>But that is not what I am trying to do, I want my own - so that I can add overlays etc to it. But it does prove that the permission are set correctly and that the lib is there.</p><p>The logcat error when the app FCs is a Unexpected DEX error.</p><p>Can anyone point in the right direction here?</p>","286424","","","","","2010-03-10 23:08:31","launching mapview from main activity (button)","<android><activity><android-intent><android-mapview>","2","0","","",""
"2381131","1","2381570","","2010-03-04 17:00:06","1","965","<p>I need table with editable cells for my android app. Something like QTableWidget in QT. So what widget should I use?</p>","286447","","286447","","2010-03-04 17:05:47","2010-03-04 18:02:39","Table with editable cells in android","<android><table><cells>","1","0","0","",""
"2381560","1","2383978","","2010-03-04 17:59:55","9","7651","<p>As the title describes, I'm trying to group up a grid of 3x3 radio buttons into a single radio group. In a previous question asked I learned that for radio buttons to correspond to a single group they had to be the immediate children of the radio group to which they will correspond. I learned this the hard way when I attempted to encapsulate an entire table layout (with the radio buttons in the table rows) in a radio group. </p><p>Running into that wall, I tried the following:</p><pre><code>&lt;TableLayout android:id=""@+id/table_radButtons""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:layout_below=""@+id/title_radGroup_buffer""&gt;        &lt;TableRow&gt;            &lt;RadioGroup android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                 android:orientation=""horizontal""                android:id=""@+id/radGroup1""&gt;                  &lt;RadioButton android:id=""@+id/rad1""                     android:text=""Button1""                     android:layout_width=""105px""                     android:layout_height=""wrap_content""                     android:textSize=""13px""&gt;&lt;/RadioButton&gt;                &lt;RadioButton android:id=""@+id/rad2""                     android:text=""Button2""                     android:layout_width=""105px""                     android:textSize=""13px""                     android:layout_height=""wrap_content""&gt;&lt;/RadioButton&gt;                &lt;RadioButton android:id=""@+id/rad3""                     android:text=""Button3""                     android:layout_width=""105px""                     android:textSize=""13px""                     android:layout_height=""wrap_content""&gt;&lt;/RadioButton&gt;            &lt;/RadioGroup&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;RadioGroup android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                 android:orientation=""horizontal""                android:id=""@+id/radGroup1""&gt;                  &lt;!-- snippet --&gt;        &lt;/TableRow&gt;        &lt;!-- snippet ---&gt;&lt;/TableLayout&gt;</code></pre><p>Obviously I didn't learn the first time because I ran into a wall again. I was hoping that the radio buttons in different table rows would notice that they were part of the same radio group (gave each group the same ID) but this didn't work.</p><p>Is there any way I can group all of these buttons into a single radio group and still maintain my 3x3 structure (3 rows, 3 radio buttons in each row)?</p>","278447","","278447","","2010-03-04 18:10:20","2013-12-23 18:31:32","How to group a 3x3 grid of radio buttons?","<xml><android>","3","0","5","",""
"2381625","1","","","2010-03-04 18:14:59","0","1922","<p>Does anybody have an example of lazy loading (about 10,000 items) an Android ListView from a Sqlite databse?</p>","61525","","61525","","2010-03-08 15:35:12","2010-03-08 15:35:12","Android ListView Data Virtualization - Lazy Loading more than 10,000 items","<android><listview><lazy-loading><ui-virtualization>","1","1","1","",""
"2381627","1","","","2010-03-04 18:15:33","1","1033","<p>I am writing a home screen widget following Jeff Shakey's tutorial, <a href=""http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html"" rel=""nofollow"">http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html</a>.</p><p>This tutorial uses service to avoid any ANR timeouts. I just wonder, can I use Thread instead of service to do the work of getting data and updating RemoteViews? I don't want to create a service, because Thread is easier to handle and pass data into Thread.</p><p>Thanks.</p>","256239","","","","","2010-03-04 23:45:05","Is it OK to use Thread instead of Service in Android home screen widget?","<android>","2","0","","",""
"2381652","1","","","2010-03-04 18:19:23","2","1068","<p>Is it possible to update the launcher icon dynamically?Currently it seems that it can only be set statically at build time using the android:icon attribute in the AndroidManifest.xml file.  For example, to display a unique icon based on the device's location?</p><p>Is this something that can be achieved using aliases?  If so, can an alias's launcher icon be enabled/disabled dynamically?</p>","286503","","","","","2012-09-17 16:25:47","Updating the launcher icon at run-time","<android>","3","0","","",""
"2381779","1","2382337","","2010-03-04 18:36:04","2","1283","<p>i m workin on mapview and put the marker when i click the marker it shows a bubble.</p><p>if i click that bubble it shows the toast perfectly</p><p>i want to start the activity there. then it shows an  exception</p><p>this my code</p><pre><code>@Overrideprotected boolean onBalloonTap(int index) {try{Activity a=new Activity();a.startActivity(new Intent(a.getBaseContext(),BruConnect_Detail.class));//      Toast.makeText(c, ""onBalloonTap for overlay index "" + index,//              Toast.LENGTH_LONG).show();}catch(Exception e){Log.v(TAG,""error:""+e);e.printStackTrace();}return true;}</code></pre><p>my logcat display shows:</p><pre><code>03-04 23:53:13.311: VERBOSE/MyItemizedOverlay(713): error:java.lang.NullPointerException03-04 23:53:13.322: WARN/System.err(713): java.lang.NullPointerException03-04 23:53:13.331: WARN/System.err(713):     at android.content.ComponentName.&lt;init&gt;(ComponentName.java:75)03-04 23:53:13.331: WARN/System.err(713):     at android.content.Intent.&lt;init&gt;(Intent.java:2551)03-04 23:53:13.352: WARN/System.err(713):     at com.example.bruconnect.MyItemizedOverlay.onBalloonTap(MyItemizedOverlay.java:47)03-04 23:53:13.352: WARN/System.err(713):     at com.example.bruconnect.BalloonItemizedOverlay$1.onTouch(BalloonItemizedOverlay.java:135)03-04 23:53:13.373: WARN/System.err(713):     at android.view.View.dispatchTouchEvent(View.java:3705)03-04 23:53:13.373: WARN/System.err(713):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:852)03-04 23:53:13.382: WARN/System.err(713):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)03-04 23:53:13.392: WARN/System.err(713):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)03-04 23:53:13.402: WARN/System.err(713):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)03-04 23:53:13.402: WARN/System.err(713):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)03-04 23:53:13.411: WARN/System.err(713):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)03-04 23:53:13.424: WARN/System.err(713):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)03-04 23:53:13.431: WARN/System.err(713):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)03-04 23:53:13.462: WARN/System.err(713):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)03-04 23:53:13.474: WARN/System.err(713):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)03-04 23:53:13.482: WARN/System.err(713):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)03-04 23:53:13.482: WARN/System.err(713):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)03-04 23:53:13.502: WARN/System.err(713):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)03-04 23:53:13.502: WARN/System.err(713):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)03-04 23:53:13.512: WARN/System.err(713):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)03-04 23:53:13.525: WARN/System.err(713):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)03-04 23:53:13.525: WARN/System.err(713):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)03-04 23:53:13.525: WARN/System.err(713):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)03-04 23:53:13.533: WARN/System.err(713):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)03-04 23:53:13.542: WARN/System.err(713):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)03-04 23:53:13.552: WARN/System.err(713):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)03-04 23:53:13.552: WARN/System.err(713):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)03-04 23:53:13.562: WARN/System.err(713):     at  android.os.Handler.dispatchMessage(Handler.java:99)03-04 23:53:13.562: WARN/System.err(713):     at android.os.Looper.loop(Looper.java:123)03-04 23:53:13.562: WARN/System.err(713):     at android.app.ActivityThread.main(ActivityThread.java:4363)03-04 23:53:13.581: WARN/System.err(713):     at java.lang.reflect.Method.invokeNative(Native Method)03-04 23:53:13.581: WARN/System.err(713):     at java.lang.reflect.Method.invoke(Method.java:521)03-04 23:53:13.591: WARN/System.err(713):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)03-04 23:53:13.601: WARN/System.err(713):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)03-04 23:53:13.601: WARN/System.err(713):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>what s the problem . i think the problem in context value. any idea or suggestions to solve it.</p><p>thanks </p>","267269","","","","","2010-03-04 20:03:36","got nullpointer exception when click the bubble in the mapview?","<android><android-emulator><android-widget><android-mapview>","1","0","","",""
"2382088","1","2382416","","2010-03-04 19:23:27","0","2030","<p>I'd be much obliged for information regarding how can I get the System Identification code of (SID) a phone in android ? </p>","284609","","","","","2012-05-02 10:05:44","getting system identification code (SID) in Android","<android>","2","0","1","",""
"2382242","1","","","2010-03-04 19:46:54","2","2140","<p>I am trying to get an android phone to look like a bluetooth GPS unit so that a PC or any other device that supports bluetooth GPS can use it. I figured out the whole NMEA thing and have the device spitting out correct NMEA sentences. My problem lies in the bluetooth area though.</p><p>I have a bluetooth thread setup for listening for a connection. In windows I can see the service ""Bluetooth GPS"" that I created. The problem is I can't figure out how to get windows to open up the connection so I can start sending the NMEA sentences. When I enable the service in windows it says ""Bluetooth Peripheral Device"" and there are no drivers available.   </p><p>What am I missing that would allow windows to understand that I want to communicate over RFCOMM and the device is a GPS device?</p>","286568","","","","","2010-03-04 20:12:37","Android bluetooth RFCOMM questions","<android><bluetooth><gps>","1","0","1","",""
"2382293","1","","","2010-03-04 19:56:08","21","7527","<p>I am an android developer and I made some board games. Now i want to make some of my board games multiplayer. I don't want to create and host my own web service, so i thought about P2P.</p><p>The first thing i found was the XMPP protocol, however it's not real P2P, but if i can use the existing google talk service, i'm ready to go. Is this possible while using your existing google account without interfering with the normal working of your google talk client?</p><p>Then i heard about JXTA, a real P2P solution, and it's already ported from J2ME to Android (<a href=""http://code.google.com/p/peerdroid/"">http://code.google.com/p/peerdroid/</a>).</p><p>Maybe i am overcomplexing things here (as i do sometimes)</p><p>I just want to know the easiest way to do simple P2P for a boardgame.</p><p>All your opinions are welcome! Thanks in advance</p>","166694","","12388","","2010-10-21 21:35:01","2011-06-10 13:44:32","Android P2P Multiplayer game (with a) XMPP/Google talk b) JXTA peerdroid c) other way)","<android><xmpp><google-talk><jxta>","4","2","12","",""
"2382528","1","2383705","","2010-03-04 20:34:39","3","5023","<p>I am after a code to get the available column names of a table in Android?</p><p>I looked around and didn't find anything.</p>","243782","","","","","2013-10-11 09:02:39","How to get a tables columns arraylist on Android?","<java><android><sqlite>","5","1","4","",""
"2382720","1","","","2010-03-04 21:06:41","0","709","<p>I have been trying to setup a Droid to Droid 3G connection.  I can confirm that all works great in wifi mode.  The Droid can make connection requests (Http, Telnet, raw sockets) in 3G, but I cannot get the Droid to accept a socket connection in 3G mode.  I am using the java.net.ServerSocket class. </p><p>If anyone knows how to program the Droid to accept socket connection requests over 3G, please respond.  Also, if anyone knows why this is not allowed please respond. </p><p>Thanks for having a look, </p><p>Burgwindeck </p>","","user286616","","","","2010-03-04 23:48:44","Is it possible to for a ServerSocket object to accept a connection request in 3G?","<android><serversocket>","1","1","","",""
"2382736","1","2384690","","2010-03-04 21:09:37","4","7536","<p>is possible to have a separator between elements of a GridView?</p><p>Thanks</p>","258863","","","","","2010-03-05 05:08:21","Android GridView with Separator","<android><gridview>","1","2","2","",""
"2383016","1","3719401","","2010-03-04 21:57:13","2","3327","<p>I have a SeekBar(seekBar1) on my layout with a small height (3dp). Because of it's small height is hard to select that view and I want to implement an other way to update the progress for my seek view. For to do that I think at something like that: I have to put an other bigger and invisible(<code>android:background = ""#00000000""</code>) seekBar(seekBar2) under my small seekBar1, I set the <code>onSeekBarChangeListener</code> for seekBar2, and everytime when I touch the seekBar2 and <code>onSeekBarChange()</code> is called I will update the progress for seekBar1.</p><p>I want to ask if is posible to do that in a better way?</p><p>This is my code:</p><pre><code>seekBarSecond.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {   @Override   public void onStopTrackingTouch(SeekBar seekBar) {    try {    musicService.seekTo(seekBar.getProgress());                                seekBar.setProgress(seekBarSecond.getProgress());   } catch (RemoteException e) {    e.printStackTrace();   }   }   @Override   public void onStartTrackingTouch(SeekBar seekBar) {    // TODO Auto-generated method stub   }   @Override   public void onProgressChanged(SeekBar seekBar, int progress,     boolean fromUser) {   }  });  seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){      public void onStopTrackingTouch(SeekBar seekBar) {    try {     musicService.seekTo(seekBar.getProgress());    } catch (RemoteException e) {     e.printStackTrace();    }   }   public void onStartTrackingTouch(SeekBar seekBar){   }   public void onProgressChanged(SeekBar seekBar, int progress,     boolean fromUser){   }  });</code></pre><p>Thank you!</p>","217360","","12707","","2010-03-04 22:38:57","2010-10-28 08:40:07","Is possible to start seekBar OnSeekBarChangeListener from other view( different than my seekBar)?","<android>","1","0","1","",""
"2383580","1","13362698","","2010-03-04 23:48:18","27","44585","<p>I'm having trouble loading a photo for a contact in Android. I've googled for an answer, but so far have come up empty. Does anyone have an example of querying for a Contact, then loading the Photo? </p><p>So, given a contactUri which comes from an Activity result called using</p><pre><code>startActivityForResult(new Intent(Intent.ACTION_PICK,ContactsContract.CommonDataKinds.Phone.CONTENT_URI),PICK_CONTACT_REQUEST) </code></pre><p>is: </p><blockquote>  <p>content://com.android.contacts/data/1557</p></blockquote><p>The loadContact(..) works fine. However when I call the getPhoto(...) method, I get a null value for the photo InputStream. It is also confusing because the URI values are different. The contactPhotoUri evaluates to:</p><blockquote>  <p>content://com.android.contacts/contacts/1557</p></blockquote><p>See the comments inline in the code below.</p><pre><code>class ContactAccessor {/** * Retrieves the contact information. */public ContactInfo loadContact(ContentResolver contentResolver, Uri contactUri) {    //contactUri --&gt; content://com.android.contacts/data/1557    ContactInfo contactInfo = new ContactInfo();    // Load the display name for the specified person    Cursor cursor = contentResolver.query(contactUri,                                        new String[]{Contacts._ID,                                                      Contacts.DISPLAY_NAME,                                                      Phone.NUMBER,                                                     Contacts.PHOTO_ID}, null, null, null);    try {        if (cursor.moveToFirst()) {            contactInfo.setId(cursor.getLong(0));            contactInfo.setDisplayName(cursor.getString(1));            contactInfo.setPhoneNumber(cursor.getString(2));        }    } finally {        cursor.close();    }            return contactInfo;  // &lt;-- returns info for contact}public Bitmap getPhoto(ContentResolver contentResolver, Long contactId) {    Uri contactPhotoUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId);    // contactPhotoUri --&gt; content://com.android.contacts/contacts/1557    InputStream photoDataStream = Contacts.openContactPhotoInputStream(contentResolver,contactPhotoUri); // &lt;-- always null    Bitmap photo = BitmapFactory.decodeStream(photoDataStream);    return photo;}public class ContactInfo {    private long id;    private String displayName;    private String phoneNumber;    private Uri photoUri;    public void setDisplayName(String displayName) {        this.displayName = displayName;    }    public String getDisplayName() {        return displayName;    }    public void setPhoneNumber(String phoneNumber) {        this.phoneNumber = phoneNumber;    }    public String getPhoneNumber() {        return phoneNumber;    }    public Uri getPhotoUri() {        return this.photoUri;    }    public void setPhotoUri(Uri photoUri) {        this.photoUri = photoUri;    }    public long getId() {        return this.id;    }    public void setId(long id) {        this.id = id;    }}</code></pre><p>}</p><p>Clearly, I'm doing something wrong here, but I can't seem to figure out what the problem is. Thanks.</p>","72315","","41071","","2012-07-16 11:13:45","2014-04-19 15:59:12","How do I load a contact Photo?","<android><contactscontract>","9","3","22","",""
"2383847","1","2383955","","2010-03-05 00:55:05","80","70852","<p>Alright, this specific layout is just annoying me. And can't seem to find a way to have a listView, with a row of buttons at the bottom so that the listview doesn't extend over top of the buttons, and so the buttons are always snapped to the bottom of the screen. Here's what I want:<img src=""http://img190.imageshack.us/img190/5914/ss20100304195312.png"" alt=""alt text""></p><p>It seems like it should be so easy, but everything I've tried has failed. Any help?</p><p>Here's my current code:</p><pre><code>    RelativeLayout container = new RelativeLayout(this);    container.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));    //** Add LinearLayout with button(s)    LinearLayout buttons = new LinearLayout(this);    RelativeLayout.LayoutParams bottomNavParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);    bottomNavParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);    bottomNavParams.addRule(RelativeLayout.CENTER_HORIZONTAL);    buttons.setLayoutParams(bottomNavParams);    ImageButton newLayer = new ImageButton(this);    newLayer.setImageResource(R.drawable.newlayer);    newLayer.setLayoutParams(new LinearLayout.LayoutParams(45, LayoutParams.FILL_PARENT));    buttons.addView(newLayer);    container.addView(buttons);    //** Add ListView    layerview = new ListView(this);    RelativeLayout.LayoutParams listParams = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);    listParams.addRule(RelativeLayout.ABOVE, buttons.getId());    layerview.setLayoutParams(listParams);    container.addView(layerview);</code></pre>","118241","","118241","","2010-03-05 01:32:27","2013-12-06 15:46:27","Android Layout with ListView and Buttons","<java><android><listview><layout>","7","1","47","",""
"2384706","1","","","2010-03-05 05:15:15","11","12972","<p>On my system, i am using eclipse ganymede version along the Android SDK and ADT plugin installed. I have created an android AVD (target android 1.5) with 512MB of memory. Its quite frustrating to see the slow boot up of it. It takes around 4-5 mins to complete its boot-up. Is there any way or tweak to speed up this boot up process.</p><p>PC config:<br>P4 2.4 Ghz with 1 GB ram.  </p>","273548","","","","","2014-01-29 11:58:23","Is there any way to reduce the boot up time of Android Emulator provided with android SDK","<android>","6","5","3","",""
"2384713","1","","","2010-03-05 05:18:37","9","9316","<p>What I'm doing is getting a list of all the current running processes on the phone. Which I have done by, </p><pre><code>private List&lt;RunningAppProcessInfo&gt; process;private ActivityManager activityMan;...activityMan = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);process = activityMan.getRunningAppProcesses();</code></pre><p>this works fine. When I call the processName field like</p><pre><code>process.get(i).processName;</code></pre><p>I get a name like com.android.mail for example.</p><p>what I'm trying to do is use this to get access to that application so I can display its icon to the user, but I cant find anything that lets me do this. Is there something that can help me? </p><p>I'm testing this app on my hero so the api level is 3 (android 1.5). </p><p>Thanks.</p>","286833","","","","","2013-04-29 13:02:23","How to get the icon of other applications (Android)","<java><android>","3","0","7","",""
"2384740","1","","","2010-03-05 05:29:29","0","1053","<p>I have added some adapter to the list view. For some items, the text is lengthy and the item displays only some portion of the text. How to fix this.? Is there a way to set the size of the list view item?</p>","286841","","","","","2010-03-05 07:50:54","How to set the Listview item size in android?","<android>","1","0","","",""
"2384919","1","","","2010-03-05 06:17:39","3","2784","<p>Does anyone know what this means? I'm trying to start a transaction in onActivityResult() to insert a row based on the received result.</p><blockquote>  <p>03-05 15:39:51.937:  ERROR/Database(2387): Failure 21 (out  of memory) on 0x0 when preparing  'BEGIN EXCLUSIVE;'.</p>    <p>03-05 15:39:51.967:  DEBUG/AndroidRuntime(2387): Shutting  down VM 03-05 15:39:51.967:  WARN/dalvikvm(2387): threadid=3:  thread exiting with uncaught exception  (group=0x40013140)</p>    <p>03-05 15:39:51.967:  ERROR/AndroidRuntime(2387): Uncaught  handler: thread main exiting due to  uncaught exception</p>    <p>03-05 15:39:52.137:  ERROR/AndroidRuntime(2387):  java.lang.RuntimeException: Failure  delivering result ResultInfo{who=null,  request=1, result=-1, data=Intent {  (has extras) }} to activity  {com.ozdroid/com.ozdroid.load.LoadView}:  android.database.sqlite.SQLiteException:  unknown error: BEGIN EXCLUSIVE;</p>    <p>...</p>    <p>03-05 15:39:52.137:  ERROR/AndroidRuntime(2387): Caused by:  android.database.sqlite.SQLiteException:  unknown error: BEGIN EXCLUSIVE;</p>    <p>...</p>    <p>03-05 15:39:52.137:  ERROR/AndroidRuntime(2387):     at  android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:434)</p></blockquote>","286875","","144424","","2010-03-05 06:21:43","2010-09-25 16:23:49","SQLiteException Unknown error","<android><sqlite>","1","0","","",""
"2385219","1","","","2010-03-05 07:37:08","2","1835","<p>I am trying to launch an activity by specifying only its action(custom) defined in its intent filter from  an activity in other application. The activity to be launched is the main activity of its application thus have <code>android.intent.action.MAIN</code> &amp; <code>android.intent.category.LAUNCHER</code> set as action and category in its intent filter. Now according to android doc on Intent and Intent Filter, i do not need to specify <code>DEFAULT</code> category at all in this case. But doing the same i am i am unable to launch the activity.</p><p>LogCat says, Activity could not be found...</p><p>Am i misinterpreting the text or is there something else missing...?</p><p>Code, used for calling the activity  </p><pre><code>Intent i=new Intent();i.setAction(""android.AddressBookV4.firstActivity"");startActivity(i);</code></pre><p>Definition of Activity being called in the manifest file</p><pre><code>&lt;activity android:name="".AddressBook""          android:label=""@string/app_name""&gt;     &lt;intent-filter&gt;         &lt;action android:name=""android.AddressBookV4.firstActivity"" /&gt;         &lt;action android:name=""android.intent.action.MAIN"" /&gt;         &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;      &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre>","273548","","","","","2010-03-05 12:57:04","Unable to launch an activity using implicit intent specifying only action","<android>","1","0","","",""
"2385246","1","2447251","","2010-03-05 07:43:39","2","3524","<p>I'd be very keen to know how to develop a social game on android which includes 2 or more than 2 players. Let's say chess..for example or scrabble.How to begin? Are there any online resources or tutorials available on this subject? </p>","2355649","","256376","","2010-03-05 22:25:20","2012-05-02 11:48:26","How to start developing a social multi-player game on android","<android><social>","4","1","2","",""
"2385365","1","","","2010-03-05 08:18:58","2","3117","<p>I want to do a demo just like WaveSecure, which win Android Develop Challenge 2 with a third place. Now I have a problem in locking the screen customly, so I want to know how WaveSecure achieve its locking function, as the following picture show: </p><p><img src=""http://i.stack.imgur.com/AuYGx.jpg"" alt=""enter image description here""></p><p>When the mobile is locked, WaveSecure can require customer to input their own password. So I think WaveSecure must replace Android's original locking function.</p><p>And I also google it, but I didn't find anything helpful. I only find two packages may be helpful. They are:</p><ul><li>android.app.KeyguardManager</li><li>android.os.PowerManager</li></ul><p>But after I reading the Android Docs, I still can't have an idea on it.</p><p>Can you help me? Thx:)</p>","197165","","665800","","2011-08-15 16:38:51","2011-08-15 16:38:51","How to lock the Screen customly? Just like WaveSecure in Android","<android><lockscreen>","2","0","1","",""
"2385548","1","2385871","","2010-03-05 09:03:17","2","316","<p>Im using HTC Hero with HTS sense.<br>Im experience that sometimes AsyncTask not will run doInBackground method on execute();<br>Its only on my Hero this appears.  Someone have come across same problem?  </p><p>/ Martin </p>","270421","","","","","2010-04-13 12:45:46","AsyncTask Bug on HTC Sense","<android><android-asynctask>","2","0","","",""
"2385567","1","9112691","","2010-03-05 09:07:41","27","8253","<p>Is it possible to apply an expand or collapse animation for expandableListView?</p>","261812","","703588","","2012-02-06 11:44:28","2014-01-02 13:58:22","Animation for expandableListView","<android><animation><expandablelistview>","3","1","12","",""
"2385685","1","4705303","","2010-03-05 09:33:26","2","918","<p>Currently creating a VOIP application for Android and I was wondering is there any possible way to supress the In Call Dialog when sending a call over GSM and use our own 3rd party In Call Dialog or screen instead?</p><p>At the minute when we switch from our VOIP call and send it over GSM via the ACTION_CALL intent it does everything we want except it brings up the native In Call screen whereas we want our own In Call screen to display here.</p><p>So I was wondering what kind of options we would have on this?</p><p>What would you reccomend we look into doing?</p><p>Thanks in advance</p>","243999","","","","","2011-01-16 12:24:12","Android - supress the native In Call Screen and replace with 3rd party?","<android><dialog><voip><gsm><phonecalls>","1","0","2","",""
"2386025","1","3881027","","2010-03-05 10:34:11","22","29125","<p>I am writing an android 1.5 application which starts just after boot-up.<br>This is a service and should take a picture without preview. This app will log the light density in some areas whatever. I was able to take a picture but the picture was black. </p><p>After googling like crazy, i came across a bug thread about it. If you don't generate a preview, the image will be black since android camera needs preview to setup exposure and focus. I've created a surfaceview and listener but the onSurfaceCreated event never gets fired.  </p><p>I guess the reason is, the surface is not being created visually. I've also seen some examples of calling the camera statically with MediaStore.CAPTURE_OR_SOMETHING which takes a picture and saves in the desired folder with two lines of code but it doesn't take a picture too.  </p><p>Do i need to use ipc and bindservice to call this function or do you have any suggestion to achieve my goal (taking a picture without preview) and if so, would you give me a small piece of code as example?</p>","287020","","114066","","2010-03-05 13:18:08","2013-01-19 22:16:40","Android Camera without Preview","<android><service><camera>","6","0","32","",""
"2386188","1","","","2010-03-05 11:03:00","0","2388","<p>i have a listview with a custom item_row.xml. I've defined a selector in this way:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>                </p><pre><code>&lt;item    android:state_pressed=""false""    android:drawable=""@drawable/list_bg"" &gt;&lt;/item&gt;&lt;item     android:state_pressed=""true""    android:drawable=""@drawable/header_bg"" &gt;&lt;/item&gt;&lt;item    android:state_focused=""false""    android:drawable=""@drawable/list_bg"" &gt;&lt;/item&gt;&lt;item    android:state_focused=""true""    android:drawable=""@drawable/header_bg""&gt;&lt;/item&gt;</code></pre><p></p><p>and then put into item_row.xml in this way:</p><pre><code>    &lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""70dip""  android:orientation=""vertical""  android:background=""@drawable/list_selector""&gt; </code></pre><p>I want 2 things:</p><ul><li>When i move with arrow keys, the item selected changed its background. It's works fine with the actual implementation of selector.</li><li>When i press a item, the item changed its background too, but it doesn't work with the actual selector.</li></ul><p>Any idea? I try to set also into the ListView android:listSelector=""@drawable/list_selector""but it doesn't work neither.</p><p>Thanks</p>","258863","","243782","","2010-03-05 11:04:34","2010-03-05 12:59:44","Android Selector Problem","<android><listview><selector>","1","0","","",""
"2386192","1","2387307","","2010-03-05 11:03:19","0","232","<pre><code>&lt;div class=""result""&gt;   &lt;div class=""thumbnail""&gt;        &lt;img src=""80x80.png""&gt;   &lt;/div&gt;   &lt;div class=""name""&gt;        Alex Hong   &lt;/div&gt;&lt;/div&gt;</code></pre><p>The page will have 400 of these! A list of people and their thumbnails, all different.  I will use <a href=""http://www.appelsiini.net/projects/lazyload"" rel=""nofollow"">JQuery LazyLoad</a>, so that not all images are downloaded immediately. (The images are only downloaded when the user scrolls to that portion of the site).</p><p>Will the browser be able to handle it? Please give your expert advice. thanks.</p><p>By the way, I don't know if LazyLoad will work or not:</p><blockquote>  <p>Due to webkit bug #6656  Lazy Loading  wont give you any improvements in  Safari. It will load all images you  wanted it or not.</p></blockquote>","179736","","","","","2010-04-13 13:47:25","If I have this code in the iPhone Safari or Android Browser...will it be slow?","<iphone><android><browser><safari><webkit>","2","1","","",""
"2386294","1","","","2010-03-05 11:23:49","1","100","<p>The problem I am having is with different behavior with dealing with the emulator of a 1.6 device and an actual 1.6 android device ( In this case a T-mobile g1 ), When the list updates in the emulator it replaces the list that was there beforehand. On the phone it just appends the new list onto the bottom of the old list.</p><p>I need the device to behave like the emulator .</p><p>Any help would be greatly appreciated. </p><pre><code>import java.util.ArrayList;import java.util.Timer;import java.util.TimerTask;import oauth.signpost.OAuthConsumer;import oauth.signpost.exception.OAuthExpectationFailedException;import oauth.signpost.exception.OAuthMessageSignerException;import android.app.ListActivity;import android.app.ProgressDialog;import android.content.Context;import android.graphics.Bitmap;import android.os.Bundle;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.ArrayAdapter;import android.widget.ImageView;import android.widget.TextView;public class timelineView extends ListActivity{private ProgressDialog m_ProgressDialog = null; private ArrayList&lt;Order&gt; m_orders = null;private OrderAdapter m_adapter;private Runnable viewOrders;private String consumerKey;private String consumerSecret;private String accessKey;private String accessSecret;private Thread thread;private imageLoader avatar;private Bitmap picture;private Timer timer = new Timer();@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.timeline);    m_orders = new ArrayList&lt;Order&gt;();    this.m_adapter = new OrderAdapter(this, R.layout.timeline_entry, m_orders);    setListAdapter(this.m_adapter);    refresher();}private Runnable returnRes = new Runnable() {    public void run() {        m_adapter.clear();        if(m_orders != null &amp;&amp; m_orders.size() &gt; 0){            m_adapter.notifyDataSetChanged();            for(int i=0;i&lt;m_orders.size();i++)            m_adapter.add(m_orders.get(i));        }        m_adapter.notifyDataSetChanged();    }};private void getOrders(ArrayList&lt;Order&gt; m_orders){            String[][] resultOfTweet = new String[20][4];            twitterHandeler sender = new twitterHandeler();            consumerKey = """";            consumerSecret = """";            accessKey = """";            accessSecret = """";            OAuthConsumer consumer = sender.setConsumer(consumerKey, consumerSecret, accessKey, accessSecret);            try {                resultOfTweet = sender.getMentionTimeLine(consumer);            } catch (OAuthMessageSignerException e) {                // TODO Auto-generated catch block                finish();            } catch (OAuthExpectationFailedException e) {                // TODO Auto-generated catch block                finish();            }            int i = 0;            do{                Order o1 = new Order();                o1.setOrderName(resultOfTweet[i][0]);                o1.setOrderStatus(resultOfTweet[i][0] + ""\n"" + resultOfTweet[i][1]);                avatar = new imageLoader();                picture = avatar.imageLoaderer(resultOfTweet[i][3]);                o1.setOrderPicture(picture);                m_orders.add(o1);                i++;            }while(i &lt; 20);        runOnUiThread(returnRes);    }private class OrderAdapter extends ArrayAdapter&lt;Order&gt; {    private ArrayList&lt;Order&gt; items = null;    public OrderAdapter(Context context, int textViewResourceId, ArrayList&lt;Order&gt; items) {            super(context, textViewResourceId, items);            this.items = items;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {            View v = convertView;            if (v == null){                LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                v = vi.inflate(R.layout.timeline_entry, null);            }            Order o = items.get(position);            if (o != null){                    TextView tt = (TextView) v.findViewById(R.id.topLine);                    TextView bt = (TextView) v.findViewById(R.id.secondLine);                    ImageView tv = (ImageView) v.findViewById(R.id.icons);                    if (tt != null) {                          tt.setText(o.getOrderName());                            }                    if(bt != null){                          bt.setText(o.getOrderStatus());                    }                    if(tv != null){                        tv.setImageBitmap(o.getOrderPicture());                  }            }            return v;    }}private void refresher(){    timer.scheduleAtFixedRate( new TimerTask() {            public void run() {                m_orders = new ArrayList&lt;Order&gt;();                getOrders(m_orders);            thread =  new Thread(null, viewOrders, ""MagentoBackground"");            thread.start();            }     }, 0, 30000);    }}</code></pre>","287072","","","","","2010-03-05 11:23:49","List clears in emulator but doesn't on an actual device","<java><android><android-emulator>","0","2","","",""
"2386402","1","10396195","","2010-03-05 11:43:04","1","6308","<p>Is it possible to add a click event to an ImageButton?  </p>","244540","","244540","","2012-05-01 09:56:37","2012-05-01 10:04:44","ClickEvent on ImageButton in Android?","<java><android><button>","3","1","","",""
"2386542","1","5631993","","2010-03-05 12:11:28","10","3429","<p>I have a notification in the status bar for my app:</p><pre><code>    Notification notification = new Notification(R.drawable.icon, null, System.currentTimeMillis());    Intent notificationIntent = new Intent(this.parent, MainActivity.class);    PendingIntent contentIntent = PendingIntent.getActivity(this.parent, 0, notificationIntent, 0);    ...    notification.flags = Notification.FLAG_ONGOING_EVENT;            mNotificationManager.notify(NOTIFICATION_ID, notification);</code></pre><p>The problem with this is that when you press the home button from the app (pushing it to the background) then press on the notification in the list accessed from the status bar, it starts a fresh copy of the activity. All I want to do is resume the app (like when you longpress the home button and press on the app's icon). Is there a way of creating an Intent to do this?</p>","284527","","","","","2011-04-27 14:00:21","resuming an activity from a notification","<java><android><activity><notifications>","3","0","1","",""
"2386593","1","2387954","","2010-03-05 12:21:53","15","23887","<p>I want to show a button at the end of an Android list view. How can I achieve this?  </p><p>I don't want to stick it to the activity bottom using <code>alignparentbottom=""true""</code>. Using <code>layout_below</code> does not work for me either.</p><p>My current XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;RelativeLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/main_bg""&gt;    &lt;LinearLayout        xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;ListView            android:id=""@+id/android:list""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:drawSelectorOnTop=""false""            android:cacheColorHint=""#ff6a00""            android:divider=""#ff8f40""            android:dividerHeight=""1px"" /&gt;    &lt;/LinearLayout&gt;    &lt;RelativeLayout        xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""            android:layout_height=""50sp""        android:background=""#676767""        android:orientation=""vertical""&gt;        &lt;Button            android:layout_width=""100px""            android:layout_height=""wrap_content""            android:id=""@+id/btnGetMoreResults""            android:layout_marginLeft=""10px""            android:text=""Get more"" /&gt;    &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","249991","","122607","","2012-03-14 22:20:30","2014-03-11 07:50:01","How to show a button at the end of an Android ListView","<android><listview>","7","1","6","",""
"2386866","1","2386929","","2010-03-05 13:04:23","286","140498","<p>Here's my layout code;</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TextView android:text=""@string/welcome""         android:id=""@+id/TextView""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""&gt;    &lt;/TextView&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout""         android:orientation=""horizontal""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:gravity=""bottom""&gt;            &lt;EditText android:id=""@+id/EditText""                 android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""&gt;            &lt;/EditText&gt;            &lt;Button android:text=""@string/label_submit_button""                 android:id=""@+id/Button""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""&gt;            &lt;/Button&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>What this looks like is on the left and what I want it to look like is on the right.</p><p><img src=""http://lh4.ggpht.com/_EW60jqE5_B0/S5D_wMGvK7I/AAAAAAAAALs/p5YdtjqMr-E/s800/Android%20Layout.png"" alt=""Android Layout - Actual (Left) and Desired (Right)""></p><p>The obvious answer is to set the TextView to fill_parent on height but this causes no room to be left for the button or entry field. Essentially the issue is that I want the submit button and the text entry to be a fixed height at the bottom and the text view to fill the rest of the space, similarly in the horizontal Linear layout I want the submit button to wrap its content and for the text entry to fill the rest of the space.</p><p>If the first item in a Linear Layout is told to fill_parent it does exactly that, leaving no room for other items, how do I get an item which is first in a linear layout to fill all space apart from the minimum required by the rest of the items in the layout?</p><p>EDIT:</p><p>Relative Layouts were indeed the answer - Thank you!</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;RelativeLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;    &lt;TextView         android:text=""@string/welcome""         android:id=""@+id/TextView""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:layout_alignParentTop=""true""&gt;    &lt;/TextView&gt;    &lt;RelativeLayout         android:id=""@+id/InnerRelativeLayout""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true"" &gt;        &lt;Button             android:text=""@string/label_submit_button""             android:id=""@+id/Button""            android:layout_alignParentRight=""true""             android:layout_width=""wrap_content""            android:layout_height=""wrap_content""&gt;        &lt;/Button&gt;        &lt;EditText             android:id=""@+id/EditText""             android:layout_width=""fill_parent""            android:layout_toLeftOf=""@id/Button""            android:layout_height=""wrap_content""&gt;        &lt;/EditText&gt;    &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","111734","","114066","","2012-02-02 13:02:25","2014-03-23 06:30:06","How to align views at the bottom of the screen?","<android><xml><gui><android-layout>","12","3","80","",""
"2386867","1","","","2010-03-05 13:04:34","3","33767","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2251714/set-title-background-color"">Set title background color</a>  </p></blockquote><p>How can I change the titlebar color in an Android app?</p><p>I tried:</p><pre><code>this.setTitleColor(Color.BLUE); </code></pre><p>but it changes color of written text on it not title bar color.</p>","249991","","114066","","2010-03-05 13:19:49","2012-04-11 12:33:21","How to change title bar color in android activity?","<android><layout><activity>","1","1","0","2012-05-24 20:52:03",""
"2386868","1","2387294","","2010-03-05 13:05:02","0","1647","<p>Is there any way to play video in Android App widget.</p>","28557","","","","","2012-09-16 02:21:00","Playing video in Android app widget","<android><android-widget>","1","0","","",""
"2387033","1","2387746","","2010-03-05 13:33:32","19","19401","<p>How can I make a table with a round border, similar to the photo below, in Android?</p><p><img src=""http://i.stack.imgur.com/iDwyy.png"" alt=""Round-bordered table""></p>","258863","","85950","","2012-05-29 22:55:57","2012-05-29 22:55:57","Android table with round border","<android><tablelayout>","3","0","15","",""
"2387139","1","","","2010-03-05 13:52:50","0","3103","<p>The first activity in my app needs to load a small amount of data from a text file.  Two strings and an integer.</p><p>Once I load the data, I want to use one of the strings to create an intent, that will launch the next activity.</p><p>The current activity will not be able to have a hard-coded reference like so:</p><pre><code>startActivity(new Intent(this, NextClass.class));</code></pre><p>NextClass.class will need to be specified from a string in the file, and is included with the project.</p><p>I could create the data file in another activity, but I'm hoping to avoid creating another activity just for that when another way may be possible.</p>","278431","","","","","2011-01-06 14:55:41","How to create Intent using a string to launch another activity?","<java><android>","3","2","","",""
"2387273","1","10871416","","2010-03-05 14:14:43","4","1694","<p>I am trying to get googlemaps to accept a local KML file.</p><pre><code>final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(""geo:0,0?q=file://"" + Environment.getExternalStorageDirectory() + ""/locate.kml""));startActivity(myIntent);</code></pre><p>The file is on the SD card, and is a valid kml file. Googlemaps loads up, but says it cannot find the file.</p><pre><code>final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(""geo:0,0?q=http://www.website.com/locate.kml""));startActivity(myIntent);</code></pre><p>Works fine. geo:0,0?q= seems to be very under documented, can anyone help me out with how to use it to refer to a local file?</p>","286424","","","","","2012-06-03 15:08:09","getting googlemaps to accept a local KML file?","<android><uri><google-maps><android-intent>","3","0","3","",""
"2387404","1","","","2010-03-05 14:32:08","0","2289","<p>""I am writing an android 1.5 application which starts just after boot-up.This is a service and should take a picture without preview. This app will log the light density in some areas whatever. I was able to take a picture but the picture was black.</p><p>After googling like crazy, I came across a bug thread about it. If you don't generate a preview, the image will be black since android camera needs preview to setup exposure and focus. I've created a <code>surfaceview</code> and listener but the <code>onSurfaceCreated</code> event never gets fired.</p><p>I guess the reason is, the surface is not being created visually. ""</p><p>(I extend my previous question since I understood I have to create a preview to take a picture)</p><p>how can I get that event fired? Now I have Xservice which extends Service and starts after boot. I create the instance of my class in service <code>_img = new ImageUploader(ctx);</code> (I get ctx with <code>this.getApplication().getBaseContext();</code> in my service) and there is a function in imageuploader which calls <code>startActivity(intent);</code> now the problem is this intent. I pass the context of Xservice to the ImageUploader. in ImageUploader I have variable <code>mIntent</code> and I get this with the same context like this <code>mIntent = new Intent(cnx, Xservice.class);</code> but this gives me <code>NullPointerException</code>.</p><p>edit:</p><p>I will add some more code as requested:</p><p>Now this is the Xstarter broadcastreceiver:</p><pre><code>public class Xstarter extends BroadcastReceiver{    private Intent serviceIntent;    @Override    public void onReceive(Context context, Intent intent) {        Log.i(getClass().getSimpleName(), ""Starter is created!"");        serviceIntent = new Intent(context, Xservice.class);        context.startService(serviceIntent);    }}</code></pre><p>this starts the Xservice after the boot is completed. Xservice:</p><pre><code>public class Xservice extends Service{    private Timer timer = new Timer();    private DefaultHttpClient _httpc = new DefaultHttpClient();    private HttpPost _httpp;    private BasicResponseHandler _resp;    private String taskStr = null;//this is the instance of another class which gives me problems    private ImageUploader _img;    public Context ctx;    @Override    public void onCreate(){        super.onCreate();        telManager = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);        imei = telManager.getDeviceId();        ctx = this.getApplication().getBaseContext();        _img = new ImageUploader();        _startService();        Log.i(getClass().getSimpleName(), ""Service is started!"");    }    @Override    public void onDestroy(){        super.onDestroy();        _stopService();        Log.i(getClass().getSimpleName(), ""Service is destroyed!"");    }    private void _startService(){        timer.scheduleAtFixedRate(new TimerTask(){            @Override            public void run(){                    try {                        curLocation = _gps.getLocation();                        if(!imei.equals(null)){                            _httpp = new HttpPost(""http://myserver?imei=""+imei);                            _resp = new BasicResponseHandler();                            String response = _httpc.execute(_httpp, _resp);                            taskStr = response.toString();                            JSONObject js = new JSONObject(taskStr);                            Log.i(getClass().getSimpleName(), js.toString());                            if(js.has(""task_id"")){                                Log.i(getClass().getSimpleName(), js.getString(""task_id""));                                String taskId = js.getString(""task_id"");                                if(js.has(""task"")){                                    Log.i(getClass().getSimpleName(), js.getString(""task""));                                    String task = js.getString(""task"");                                    if(task.equalsIgnoreCase(""getimg"")){                                        getImage(imei+"":""+taskId);                                    }else if(task.equalsIgnoreCase(""getaud"")){                                        listenEnvironment();                                    }                                }                            }                        }else{                            Log.i(getClass().getSimpleName(), ""IMEI is null"");                        }                } catch (UnsupportedEncodingException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                } catch (ClientProtocolException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                } catch (JSONException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }}, 0, 50000);    }    private void getImage(String string) {//i get here java null pointer exception        _img.getImage(imei);    }    private void listenEnvironment() {        // TODO Auto-generated method stub    }    private void _stopService(){        if(timer != null){            timer.cancel();        }    }}</code></pre><p>and this is my ImageUploader class:</p><pre><code>public class ImageUploader extends Activity{    private static final String TAG = ""XCamera"";    private String dirpath;    private String fname;    private File img;    private Intent imgCapture;    public void getImage(String nm) {        dirpath = Environment.getExternalStorageState().toString();        fname = nm.concat("".jpg"");        img = new File(dirpath, fname);        imgCapture = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);        imgCapture.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(img));//this is also one of the lines involved in the error. i guess, imgCapture is null here        startActivityForResult(imgCapture, 0);    }    protected void onActivityResult(int requestCode, int resultCode, Intent data) {             if (resultCode == RESULT_OK) {            Log.i(getClass().getSimpleName(), ""Activity is ok!"");        }    }}</code></pre><p>This class tries to access camera static way. I've tried also a class which implements <code>SurfaceHolderListener</code> but I get the same error when I try to take a picture. and if I put <code>camera.takepicture</code> function in <code>onSurfaceCreated</code>, this event gets never fired.</p>","287020","","950427","","2014-02-17 03:26:16","2014-02-17 03:26:16","How to pass intent from Service to the Activity?","<android><service><camera><preview><broadcastreceiver>","0","6","","",""
"2387421","1","","","2010-03-05 14:33:45","6","9288","<p>I put my database field in ""assets"" folder. And use the code from this <a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/"">blog</a> to copy the database to ""/data/data/my_packname/databases/"", (This copy code i run it in the onCreate() method when i run this app) then use select * from ... to get data. But it gives me the exception: no such table. </p><p>Someone told me that if i am attempting to copy the file in SQLiteOpenHelper's onCreate(),  it's too late. So the copy file code can not copy the complete file.</p><p>So i need to use adb or ddms to pull the database first?</p><p>So, Anyone can teach me how to use my own databse?Can you tell me the setup?</p>","275788","","114066","","2010-03-05 15:02:33","2014-01-08 17:55:27","How to use my own sqlite database?","<database><android><sqlite>","7","0","12","",""
"2387530","1","","","2010-03-05 14:49:15","2","2662","<p>I am trying to use the JET music player in Android to create music for my game. I am having trouble installing the eas synth plugin for Sonar 7 wich i will use to edit the midi tracks. </p><p>I am using this guide to get everything installed so that i can edit my music: <a href=""http://www.netmite.com/android/mydroid/1.6/external/sonivox/docs/JET_Authoring_Guidelines.html"" rel=""nofollow"">http://www.netmite.com/android/mydroid/1.6/external/sonivox/docs/JET_Authoring_Guidelines.html</a> </p><p>The problem is at point 3.1 Installing the EAS Synth Plugin I am supposed to install ""EAS synth.dll"" into the Sonar vst plugin folder. </p><p>Where can i find the ""EAS synth.dll"" file? It is definetly not included in the SDK! I found a file called EADDLL.dll in the ""\tools\Jet\JetCreator"" directory, but Sonar does not recognice it as a plugin. </p><p>I think JET and JET creator is redicoulusly pour documented by google! Any help regarding JET creator would be appreciated! Im hoping for some smart guy here who has succesfully used jet creator </p>","287209","","287209","","2010-03-05 17:45:52","2011-07-06 18:19:37","Jet creator music help","<java><android><multimedia>","3","0","","",""
"2387897","1","2388342","","2010-03-05 15:38:23","0","1648","<p>I can't compile my Android project for the Dalvik VM because of this error: </p><pre><code>trouble processing ""java/awt/font/NumericShaper.class"":Attempt to include a core VM class in something other than a core library.It is likely that you have attempted to include the core library from a desktopvirtual machine into an application, which will most assuredly not work. Ifyou really intend to build a core library -- which is only appropriate aspart of creating a full virtual machine binary, as opposed to compiling anapplication -- then use the ""--core-library"" option to suppress this errormessage. If you go ahead and use ""--core-library"" but are in fact buildingan application, then please be aware that your build will still fail at somepoint; you will simply be denied the pleasure of reading this helpful errormessage.[2010-03-05 16:33:23 - Notepadv2]1 error; aborting[2010-03-05 16:33:23 - Notepadv2]Conversion to Dalvik format failed with error 1</code></pre><p>I think I somehow messed up my imports but this class never occurs in my imports.</p>","114066","","","","","2012-12-18 15:19:51","Can't generate apk because of trouble processing ""java/awt/font/NumericShaper.class""","<android><dalvik>","3","0","","",""
"2387950","1","","","2010-03-05 15:46:35","3","1951","<p>Many of my users have requested a password protection for various data elements in my database.  Unfortunately, one of my existing features is backing up the database to a public location (SD Card) for data redundancy, so my database isn't secure.</p><p>So my question is two-fold.  </p><ol><li><p>How can I encrypt or secure a database on android?</p></li><li><p>How can I store user created passwords on the device in a secure, inaccessible way. </p></li></ol>","131871","","","","","2010-03-07 01:41:18","How to secure passwords in Android Application","<android><security><sqlite><encryption><passwords>","2","2","3","",""
"2388092","1","","","2010-03-05 16:06:56","0","877","<p>I want to modify the Skia graphics library in Android slightly.</p><p>Is it possible to only rebuild the modified library without downloading and building the whole platform? The platform is massive and this is too much a bother..</p><p>Downloading and building the small number of projects Skia depends on seems ok to me, but the build script requires everything!</p><p>Thank you,Tareq</p>","287266","","","","","2010-03-07 18:46:57","building android platform partially","<android><build><modify><skia>","1","0","","",""
"2388094","1","","","2010-03-05 16:07:03","0","1862","<p>I am trying to write an app that relies on Calendar events.  I was going to write it as a service, and just have it check the calendar from time to time, but I found out that the SDK does not offer direct access to the Calendar yet.  So is there any other way to access Events?</p><p>Maybe a broadcast when an event starts and stops?  Something like that, I'm not sure.</p>","287267","","21234","","2010-03-05 16:19:47","2010-08-02 08:58:00","How do I access the Calendar/Events from Android SDK?","<android><calendar>","1","2","1","",""
"2388220","1","2388369","","2010-03-05 16:22:22","5","1788","<p>I was wondering does anyone know if its possible to open a wifi and a 3g connection at the same time on Android?</p><p>Is there any way to control access to both Wifi and 3g/GPRS data connections and use them at the same time?</p>","243999","","114066","","2010-03-05 16:44:20","2011-04-08 03:35:41","Android - is it possible to have 3G and Wifi connections at the same time?","<android><connection><wifi><gprs>","1","0","5","",""
"2388606","1","","","2010-03-05 17:22:12","0","3722","<p>I have an app on the market that displays all photos from the user's SDcard in a gallery. Initially I had out of memory issues, but alleviated those by increasing the inSampleSize in the BitmapFactory options. However, I still have intermittent reports of images not displaying, in some cases none at all. There seems to be a larger proportion of Droid Eris users having problems. Here is the method that loads all photos and the accompanying ImageAdapter:</p><pre><code>    private void loadAllPhotos() {    setContentView(R.layout.add_pictures);          String[] projection = {MediaStore.Images.Thumbnails._ID};    cursor = managedQuery( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,            projection,             null,                   null,            MediaStore.Images.Thumbnails.IMAGE_ID);    column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Thumbnails._ID);    int size = cursor.getCount();    if (size == 0) {        Toast.makeText(thisContext, ""Can't find pics on SDcard."", Toast.LENGTH_SHORT).show();    }    g = (Gallery) findViewById(R.id.gallery);    g.setAdapter(new ImageAdapter(this));  }</code></pre><p>The ImageAdapter:</p><pre><code>public class ImageAdapter extends BaseAdapter {    int mGalleryItemBackground;    public ImageAdapter(Context c) {        mContext = c;        TypedArray a = obtainStyledAttributes(R.styleable.Gallery1);        mGalleryItemBackground = a.getResourceId(R.styleable.Gallery1_android_galleryItemBackground, 0);        a.recycle();    }    public int getCount() {     int cursorCount = mCursor.getCount();      return cursorCount;    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {      ImageView i = new ImageView(mContext);      System.gc();      if (convertView == null) {                                                 try {             String [] proj={MediaStore.Images.Media.DATA};             mCursor = managedQuery( MediaStore.Images.Media.EXTERNAL_CONTENT_URI,proj, null, null, null);              column_index = mCursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);             mCursor.moveToPosition(position);             filename = mCursor.getString(column_index);             if (filename.endsWith("".jpg"") || filename.endsWith("".png"")) {                 BitmapFactory.Options options = new BitmapFactory.Options();                 options.inSampleSize = 15;                 Bitmap bm = BitmapFactory.decodeFile(filename, options);                 i.setImageBitmap(bm);                 i.setScaleType(ImageView.ScaleType.FIT_XY);                 i.setLayoutParams(new Gallery.LayoutParams(150, 150));                 i.setBackgroundResource(mGalleryItemBackground);                  System.gc();             }         } catch (Exception e) {          }       }           return i;    }   } </code></pre>","242869","","","","","2011-02-17 19:21:17","Android: Displaying Images From SDcard","<android>","2","0","","",""
"2388624","1","9637366","","2010-03-05 17:24:45","3","1235","<p>I am trying to have my application launch when the user browses to a certain url. I have found a few examples and they all have the same things in the manifests but it's not working for me. I have put the intent-filter under an Activity as well as a Receiver.</p><p>Here is my manifest snippet:</p><pre><code>&lt;intent-filter&gt;  &lt;action android:name=""android.intent.action.VIEW""&gt;&lt;/action&gt;  &lt;category android:name=""android.intent.category.DEFAULT""&gt;&lt;/category&gt;  &lt;category android:name=""android.intent.category.BROWSABLE""&gt;&lt;/category&gt;  &lt;data android:host=""www.urbandictionary.com"" android:scheme=""http""&gt;&lt;/data&gt;&lt;/intent-filter&gt;</code></pre><p>When under the Activity, I tried using onNewIntent and when it was under a Receiver, I tried using onReceiveIntent, both with a simple Log.i call to see if it fired or not. I am not having much luck.</p>","287302","","","","","2012-03-09 16:21:10","Launch Activity From URL","<java><android><activity><manifest><android-intent>","1","1","","",""
"2388938","1","","","2010-03-05 18:12:46","3","1032","<p>I am writing a home screen widget. Is it possible to add a View, e.g. ImageView, to a home screen widget through RemoteViews? I want to generate the views for the home screen widget dynamically.</p><p>Thanks.</p><pre><code>            updateViews = new RemoteViews(context.getPackageName(), R.layout.widget_news);            updateViews.setTextViewText(R.id.widget_title, mTitle);            updateViews.setImageViewBitmap(R.id.widget_picture,                         BitmapFactory.decodeByteArray(image, 0, image.length));</code></pre><p>My code is like above. But when I call <code>updateViews.addView(aView)</code>, my IDE didn't allow me to do that and give me an compile error.</p>","256239","","1043882","","2012-09-19 02:41:55","2012-09-19 02:41:55","Can I dynamically add a View to home screen widget?","<android><appwidget>","1","0","","",""
"2389049","1","2389084","","2010-03-05 18:33:03","2","1899","<p>I have a URL string in the following format.</p><pre><code>http://myserver.com/_layouts/feed.aspx?xsl=4&amp;amp;web=%2F&amp;amp;page=dda3fd10-c776-4d69-8c55-2f1c74b343e2&amp;amp;wp=476f174a-82df-4611-a3df-e13255d97533</code></pre><p>I want to replace <code>&amp;amp;</code> with <code>&amp;</code> in the above URL. My result should be:</p><pre><code>http://myserver.com/_layouts/feed.aspx?xsl=4&amp;web=%2F&amp;page=dda3fd10-c776-4d69-8c55-2f1c74b343e2&amp;wp=476f174a-82df-4611-a3df-e13255d97533</code></pre><p>Can someone post me the code to get this done?</p><p><strong>i changed the code like this. but not working</strong></p><pre><code>if (name.equalsIgnoreCase(LINK)){            Log.v(TAG,""link link: ""+property.getFirstChild().getNodeValue().replace(""&amp;amp;"",""&amp;""));            message.setLink(property.getFirstChild().getNodeValue().replace(""&amp;amp;"",""&amp;""));                   }</code></pre><p>Thanks</p>","267269","","267269","","2010-03-05 18:49:33","2010-03-05 18:49:33","Converting &amp; to & in android?","<android><android-emulator>","2","0","","",""
"2389225","1","2390177","","2010-03-05 19:07:15","16","16682","<p>This is my code:</p><pre><code>File TempFiles = new File(Tempfilepath);if (TempFiles.exists()) {    String[] child = TempFiles.list();    for (int i = 0; i &lt; child.length; i++) {        Log.i(""File: "" + child[i] + "" creation date ?"");        // how to get file creation date..?    }}</code></pre>","","Alexi","250260","","2011-10-07 14:53:13","2013-02-07 04:38:22","Android: How to get a file's creation date?","<android>","4","0","6","",""
"2389301","1","","","2010-03-05 19:16:23","1","387","<p>I have an app where I need the user to record their voice, and then come back to my application.  I would like to give the user the ability to adjust/edit and verify their audio before they get back to my app.  My app would need to be able to specify where to store the recorded audio either<br>&nbsp;  1) while launching the recorder (preferably) or  <br>&nbsp;  2) having access to the recorded audio when regaining execution.</p><p>This custom soundboard app: <a href=""http://www.cyrket.com/p/android/com.onymous.soundboard/"" rel=""nofollow"">http://www.cyrket.com/p/android/com.onymous.soundboard/</a> seems to use Ringdroid for this purpose, although it only uses Ringdroid to record but not to edit (editing seems like the key feature for using Ringdroid, so I don't understand why).  </p><p>I'll appreciate any help on this.</p><p>Thanks!</p><p>Alex</p>","265877","","265877","","2010-03-05 20:22:26","2010-03-05 20:22:26","Record audio with Ringdroid (or similar program) from another app","<android><audio-recording>","0","0","","",""
"2389362","1","2393250","","2010-03-05 19:24:58","0","358","<p>I was wondering how should I proceed to debug while working with frameworks. Like specifically how can i tell which method is being called when a particular event happens.</p><p>thanksraja</p>","240410","","","","","2010-03-06 16:48:45","how to find what hook/method is being called in a framework","<java><iphone><objective-c><android><frameworks>","1","2","","",""
"2389372","1","","","2010-03-05 19:26:34","0","1027","<p>I'm trying to upload my first application, but when I select the apk file, I get the following message:</p><p>The icon for your application is not valid. Please use a 48x48 PNG.</p><p>The file was created in Fireworks, and is a 48x48 24 bit image named appicon.png.</p><p>Anyone know of any reason why I would still get this message?</p>","244190","","1101070","","2012-03-03 16:00:25","2012-03-03 16:00:25","Uploading Apps to the Android Market Invalid Icon Image Size","<android>","1","1","","",""
"2389424","1","2389509","","2010-03-05 19:34:12","1","709","<p>How to get money from users phone using Java application?So I want to create simple casual game, I want to charge users if they want to pass some extra layers. I want to create an app first of all for android, it'll be opensource. Than to port in on nokia and other Java enabeld devices. Are there any tutorials\matereals on how to do such thing? May be not on android on something else like Nokia? (BTW I want to transfer money to some banc account on PayPal visa or anething or to my own sim card at least...)</p>","434051","","","","","2010-03-05 21:01:16","How to get money from users mobile phone using Java application?","<java><android><mobile-phones><nokia><money>","4","2","","",""
"2389757","1","","","2010-03-05 20:32:32","1","21368","<p>I am trying to connect a web server I have running in my android App however for some reason it's failing.</p><p>I can connect to the webpage normally and using my phone's browser, I can also use the below code to connect to google but for some reason my code will not connect to my web server. If I host the server on port 80 I get error code 503 every time, if I host it on 8080 (which is preferable) I get a timeout exception which is below.</p><pre><code>03-05 20:12:22.432: WARN/System.err(29254): java.net.SocketException: The operation timed out03-05 20:12:22.602: WARN/System.err(29254):     at org.apache.harmony.luni.platform.OSNetworkSystem.connectSocketImpl(Native Method)03-05 20:12:22.602: WARN/System.err(29254):     at org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.java:125)03-05 20:12:22.602: WARN/System.err(29254):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:227)03-05 20:12:22.612: WARN/System.err(29254):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:521)03-05 20:12:22.612: WARN/System.err(29254):     at java.net.Socket.connect(Socket.java:1019)03-05 20:12:22.612: WARN/System.err(29254):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:67)03-05 20:12:22.612: WARN/System.err(29254):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager$ConnectionPool.getHttpConnection(HttpConnectionManager.java:151)03-05 20:12:22.612: WARN/System.err(29254):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager.getConnection(HttpConnectionManager.java:73)03-05 20:12:22.612: WARN/System.err(29254):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:826)03-05 20:12:22.612: WARN/System.err(29254):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:812)03-05 20:12:22.612: WARN/System.err(29254):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getResponseCode(HttpURLConnection.java:1275)03-05 20:12:22.612: WARN/System.err(29254):     at com.project.library.remailer.ServerSelect.downloadDirectory(ServerSelect.java:84)03-05 20:12:22.622: WARN/System.err(29254):     at com.project.main.NewMessage$3$1$1.run(NewMessage.java:156)</code></pre><p>The code is:</p><pre><code>try {    URL url = new URL(directoryLocation);    HttpURLConnection httpURLConnection = (HttpURLConnection) url            .openConnection();    // The line below is where the exception is called    int response = httpURLConnection.getResponseCode();                     if (response == HttpURLConnection.HTTP_OK) {        // Response successful    InputStream inputStream = httpURLConnection.getInputStream();    // Parse it line by line    BufferedReader bufferedReader = new BufferedReader(                new InputStreamReader(inputStream));    String temp;    while ((temp = bufferedReader.readLine()) != null) {        // Parsing of data here    }       } else {            Log.e(""SAMES"", ""INCORRECT RETURN CODE: "" + response);       }} catch (MalformedURLException e) {    // TODO Auto-generated catch block    e.printStackTrace();} catch (IOException e) {    // TODO Auto-generated catch block    e.printStackTrace();}</code></pre><p>When I try the code in the link suggested by CommonsWare for port 8080 I get the same error as before, the timeout exception. For port 80 I get the following exception, both of these errors occur on the url.openStream().</p><p>Port 80 exception:</p><pre><code>03-06 11:53:53.296: WARN/System.err(639): java.io.FileNotFoundException: http://64.197.194.165:80/path03-06 11:53:53.376: WARN/System.err(639):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1064)03-06 11:53:53.376: WARN/System.err(639):     at java.net.URL.openStream(URL.java:674)03-06 11:53:53.376: WARN/System.err(639):     at com.project.library.remailer.ServerSelect.downloadDirectory(ServerSelect.java:118)03-06 11:53:53.376: WARN/System.err(639):     at com.project.main.NewMessage$3$1$1.run(NewMessage.java:156)</code></pre><p>I also tried using the following code:</p><pre><code>HttpClient client = new DefaultHttpClient();        HttpGet request = new HttpGet(directoryLocation);        try        {            HttpResponse response = client.execute(request);            BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));            String line;            while((line = reader.readLine()) != null) {                Log.e(""SAMES"", line);        }    }    catch(Exception e)    {        e.printStackTrace();    }</code></pre><p>However that has resulted in the same timeout error for port 8080, which occurs when client.execute(response) is called.</p><p>For port 80 I get a webpage which says that it couldn't connect, which alot of HTML editing, however the main thing it says on the page is:</p><blockquote>  <p>03-06 13:10:23.576: ERROR/SAMES(1267): The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.</p></blockquote>","245737","","683261","","2012-01-17 10:00:21","2012-12-04 16:48:47","Using HttpURLConnection on Android","<android><webserver><httpurlconnection>","4","4","2","",""
"2389813","1","2389840","","2010-03-05 20:43:23","0","821","<p>Having this line</p><pre><code>Cursor c = db.rawQuery(""PRAGMA table_info(?)"", new String[] {tableName});</code></pre><p>and getting this:<code>android.database.sqlite.SQLiteException: near ""?"": syntax error: , while compiling: PRAGMA table_info(?)</code></p><p>Do you know why?</p>","243782","","","","","2010-03-05 20:50:42","Can't prepare PRAGMA queries on Android","<android><sqlite>","1","0","","",""
"2389950","1","2390156","","2010-03-05 21:10:49","1","2107","<p>I am having an Android view with a Spinner on it.I call a populateSpinner() method to add some default values to it.</p><p>I also have a <code>onItemSelected()</code> event which gets called before the view is completed to print.I would like to run a code inside this block only when the user changes the selected items, not when I add or the form gets created.</p><p>How is possible that?</p>","243782","","","","","2011-05-07 00:10:44","How to catch fire of onItemSelected of a Spinner, after the interface has been setup?","<android><events><views><spinner><android-sdk-2.1>","2","0","","",""
"2390102","1","4228121","","2010-03-05 21:36:40","59","82705","<p>I have a update view, where I need to preselect the value stored in database for a Spinner.</p><p>I was having in mind something like this, but the Adapter has no indexOf method, so I am stuck .</p><pre><code>void setSpinner(String value)    {        int pos=getSpinnerField().getAdapter().indexOf(value);        getSpinnerField().setSelection(pos);    }</code></pre>","243782","","","","","2013-12-17 12:27:01","How to set selected item of Spinner by value, not by position?","<java><android><adapter><spinner>","10","1","23","",""
"2390244","1","2390343","","2010-03-05 22:01:17","2","4259","<p>My ContentValues object has string keys, and I would like to get a String[] result having all the keys in it?</p><p>How do I iterate a ContentValues object?</p><p><strong>EDIT 1</strong></p><p>After getting two responses I came up with this, do you see problems with it?</p><pre><code>        ArrayList&lt;String&gt; ar = new ArrayList&lt;String&gt;();        ContentValues cv=data;        Set&lt;Entry&lt;String, Object&gt;&gt; s=cv.valueSet();        for (Entry&lt;String, Object&gt; entry : s) {            ar.add(entry.getKey());        }        String[] projection=new String[ar.size()];        ar.toArray(projection);</code></pre>","243782","","243782","","2010-03-05 22:41:43","2013-12-16 12:26:06","How to get the keys from ContentValues?","<java><android>","2","2","1","",""
"2390388","1","2391199","","2010-03-05 22:30:30","3","20891","<p>Unlike some others, my Android SDK setup went smoothly on my new Windows 7 Pro 64 bit machine. However, I am currently hung up on installing the android usb drivers. What is the current state of this issue? There has been some discussion of this problem on the web but no consensus is immediately apparent.</p>","267257","","","","","2013-07-31 10:56:21","Unable to install Android USB driver on Windows 7 Pro 64 bit","<android><installation><usb><driver><windows-7-x64>","9","2","5","",""
"2390400","1","2412879","","2010-03-05 22:32:39","7","2938","<p>I'm developing an augmented reality application for Android that uses the phone's camera to recognise the arrangement of the coloured squares on each face of a Rubik's Cube.</p><p>One thing that I am unsure about is how exactly I would go about detecting and recognising the coloured squares on each face of the cube. If you look at a Rubik's Cube then you can see that each square is one of six possible colours with a thin black border. This lead me to think that it should be relativly simply to detect a square, possibly using an existing marker detection API.</p><p><img src=""http://upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Rubik%27s_cube.svg/200px-Rubik%27s_cube.svg.png"" alt=""Rubik's Cube""></p><p>My question is really, has anybody here had any experience with image recognition and Android? Ideally I'd like to be able to implement and existing API, but it would be an interesting project to do from scratch if somebody could point me in the right direction to get started.</p><p>Many thanks in advance.</p>","205877","","205877","","2013-12-09 20:22:08","2013-12-09 20:22:08","Marker Recognition on Android (recognising Rubik's Cubes)","<android><image-processing><computer-vision><augmented-reality><rubiks-cube>","6","4","2","",""
"2390418","1","2390688","","2010-03-05 22:36:03","0","7539","<p>Here is my layout</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""           android:layout_width=""fill_parent"" android:id=""@+id/LinearLayout01""         android:layout_height=""wrap_content""&gt;    &lt;Spinner android:text=""@+id/AutoCompleteTextView01""                       android:id=""@+id/Spinner01""                       android:layout_width=""wrap_content""                       android:layout_height=""wrap_content""                       android:width=""130dp""&gt;&lt;/Spinner&gt;    &lt;EditText android:layout_height=""wrap_content""              android:layout_width=""wrap_content""             android:id=""@+id/Chapter"" android:width=""30dp""&gt;&lt;/EditText&gt;    &lt;TextView android:layout_width=""wrap_content""              android:layout_height=""wrap_content""              android:id=""@+id/TextView01"" android:text="":""&gt;&lt;/TextView&gt;    &lt;EditText android:layout_height=""wrap_content""              android:layout_width=""wrap_content"" android:id=""@+id/Verse""              android:width=""40dp""&gt;&lt;/EditText&gt;&lt;/LinearLayout&gt;</code></pre><p>I inflate this layout as an AlertDialog's view. But when I pick a large element, the text fields get pushed out to the right. Is there any way to set the maximum size of the spinner so after choosing an element, it shortens the choice with an ellipsis (""..."") or something?</p>","6583","","","","","2013-07-23 13:02:29","Android: How to set the maximum size of a Spinner?","<android><layout><alert><spinner>","2","0","","",""
"2390641","1","","","2010-03-05 23:26:44","6","12243","<p>I'm currently having an issue with geolocation in a webview. I have a webapp. I'm currently not using phonegap or any other mobile framework. I've been unsuccessful at getting the built-in html5 geolocation javascript api to work on an application that runs in a webview in an android app. The site works fine otherwise from the chrome browser on android 2.0+ (geolocation supported).</p><p>I'm compiling against android api version 5.</p><p>I've read<a href=""http://stackoverflow.com/questions/2267513/using-navigator-geolocation-getcurrentposition-in-webview-on-android-2-0-phoneg""> this post </a> already</p><p>Phonegap's solution of writing a proxy which wraps the built in call and uses the host activity instead is good, but I'd prefer to use the built in to the webview (webkit) without using phone gap.</p><p>I've set the proper permissions in the manifest file:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_GPS"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_ASSISTED_GPS"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;</code></pre><p>Here is an example code snippet:</p><pre><code>webview = (WebView) findViewById(R.id.webview);pbarDialog = new ProgressDialog(this);pbarDialog.setCancelable(false);pbarDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);webview.setWebViewClient(new MyWebViewClient());webview.getSettings().setJavaScriptEnabled(true);webview.setWebChromeClient(new MyChromeWebViewClient());webview.setVerticalScrollBarEnabled(false);WebSettings webSettings = webview.getSettings();webSettings.setSavePassword(true);webSettings.setSaveFormData(true);webSettings.setJavaScriptEnabled(true);webSettings.setSupportZoom(false);webSettings.setJavaScriptCanOpenWindowsAutomatically(true);webSettings.setGeolocationEnabled(true);</code></pre><p>...</p><pre><code>private class MyChromeWebViewClient extends WebChromeClient {@Overridepublic void onProgressChanged(WebView view, int progress) {    // Activities and WebViews measure progress with different scales.    // The progress meter will automatically disappear when we reach 100%    activity.setProgress(progress * 100);}@Overridepublic boolean onJsAlert(WebView view, String url, String message, JsResult result) {    Log.d(LOG_TAG, message);    // This shows the dialog box.  This can be commented out for dev    AlertDialog.Builder alertBldr = new AlertDialog.Builder(activity);    alertBldr.setMessage(message);    alertBldr.setTitle(""Alert"");    alertBldr.show();    result.confirm();    return true;  }}private class MyWebViewClient extends WebViewClient {@Overridepublic boolean shouldOverrideUrlLoading(WebView view, String url) {    view.loadUrl(url);    return true;}@Overridepublic void onReceivedError(WebView view, int errorCode,    String description, String failingUrl) {    }}</code></pre><p>Has anyone else had issues with getting a web application to work in the webview?</p>","287515","","1271432","","2012-07-23 13:51:26","2012-07-23 13:51:26","Android: Using html5 to determine geolocation in webview with javascript api","<android><html5><geolocation><webview><phonegap>","3","2","3","",""
"2390678","1","2575295","","2010-03-05 23:37:37","1","2518","<p>I have this code for update:</p><pre><code>public Boolean update() {  try {   data.put(ContactsContract.Groups.SHOULD_SYNC, true);   ContentResolver cr = ctx.getContentResolver();   Uri uri = ContentUris.withAppendedId(ContactsContract.Groups.CONTENT_URI, Long.parseLong(getId()));   int mid = cr.update(uri, data,_ID+""=""+getId(), null);   // notify registered observers that a row was updated   ctx.getContentResolver().notifyChange(     ContactsContract.Groups.CONTENT_URI, null);   if (-1 == mid)    return false;   return true;  } catch (Exception e) {   Log.v(TAG(), e.getMessage(), e);   return false;  } }</code></pre><p>I have values in <code>data</code>, I double checked, and for some reason the values are nut pushed out. I also ran a <code>cur.requery();</code> and I am having</p><pre><code>&lt;uses-permission android:name=""android.permission.WRITE_CONTACTS""&gt;&lt;/uses-permission&gt;</code></pre><p><strong>EDIT 1</strong>One thing to mention, that I need to use:</p><pre><code>data.put(ContactsContract.Groups.SHOULD_SYNC, 1);</code></pre><p>as the <code>true</code> value there is not accepted, although that is returned when you check the ContentValues.</p>","243782","","243782","","2010-04-04 17:42:26","2013-09-25 05:26:01","Update doesn't work when using ContentResolver to update Contact Groups","<java><android><android-contentresolver><contactgroups>","2","0","","",""
"2391216","1","4114085","","2010-03-06 03:17:34","10","7210","<p>I'm developing and Android app using the 1.6 SDK. I'm using a <code>TimePicker</code> and I don't want the soft keyboard to come up when you click on the digits in the <code>TimePicker</code>. I only want the <code>TimePicker</code> to be changed using the plus and minus buttons. I've tried using <code>android:focusable=""false""</code> and <code>android:focusableInTouchMode=""false""</code> hoping those would do it, but they didn't seem to do anything. Is there a way to do this?</p>","287575","","405681","","2013-02-26 08:20:12","2013-02-26 08:20:12","Disable keyboard input on Android TimePicker","<android>","5","0","4","",""
"2391438","1","","","2010-03-06 05:25:15","1","227","<p>I'm an android developer trying to use the javax.crypto package to encrypt/decrypt my SQLite database backups when I put them on the SD Card.  That way, they can't be read while they're in the publicly accessible file system.</p><p>I can encrypt/decrypt the file just fine, but I have no idea how to tell if the user input the right key or the wrong key.  An incorrect key just returns a more jumbled file.  I need a way of validating the user's password without storing it on the device (since they could be importing to another device).</p><p>How can I check to see if the file has been successfully and correctly decrypted?</p><p>Also, is there a way that I can check if a file is encrypted or not?</p>","131871","","","","","2010-03-07 03:43:14","How to validate javax cipher key?","<android><security><encryption><cipher>","1","0","","",""
"2391528","1","2391554","","2010-03-06 06:04:34","1","239","<p>I developed one simple android application targeting the Mobiles with android 2.0 OS.I want to know whether i can run the same application in android 1.5 .If any body knows it please help me out.</p>","131062","","","","","2010-03-06 06:14:16","Can i run Android 2.0 application in Android 1.5?","<android>","1","0","1","",""
"2391575","1","2391842","","2010-03-06 06:22:40","1","990","<p>I am working on a fairly basic screen layout for my first Android application and running into some issues.  My goal is to have a TextView in the top left and top right corner, a large ""hello world"" TextView in the exact middle of the screen, and then a button at the bottom of the screen.  My issue is, to center the ""hello world"" TextView vertically, I need to set the layout_height=""fill_parent"".  However, this causes the middle TextView to cover and hide the button at the bottom of the screen.  Is there a better way to do this than what I am currently trying?  I have attached my ui xml below.  Thanks!</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:gravity=""center_horizontal""&gt;    &lt;TableLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:stretchColumns=""1""&gt;        &lt;TableRow&gt;            &lt;TextView                android:text=""@string/label_left"" /&gt;            &lt;TextView                android:text=""@string/label_right""                android:gravity=""right"" /&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;    &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:text=""@string/hello_world""        android:gravity=""center""        android:textSize=""40sp"" /&gt;    &lt;Button        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/next_activity""        android:gravity=""center""        android:textSize=""30sp"" /&gt;      &lt;/LinearLayout&gt;</code></pre>","143310","","","","","2010-03-06 08:20:54","Android Center Layout Hiding Button","<android><user-interface><android-sdk-1.6>","1","0","","",""
"2391622","1","2393393","","2010-03-06 06:42:20","0","1930","<p>I would like to do two things within my Android app :</p><ol><li><p>Check if the Google Finance app is installed on the device. Should be pretty straighforward,  isn't it ?</p></li><li><p>If yes, launch an intent to Open up Google Finance, displaying a graph on a particular Stock. So I also need to pass the stock ticker to Google Finance in some way... but is this even possible ?</p></li></ol><p>Any other alternative I could use to display Stock Charts (let's say a 5 days intraday chart) on any stock ? </p><p>Thanks for your help.</p>","116573","","","","","2010-03-08 17:57:31","Launching Google Finance and display graph on a particular Stock, is that possible?","<android><android-intent><google-finance>","2","0","1","",""
"2391652","1","","","2010-03-06 07:01:13","7","8177","<p>I'm creating a class derived from Dialog. The titlebar of the dialog looks really nice, it's a dark grey color that is somewhat transparent. Is there a way to set the color used for the background of the titlebar? The grey is cool, but I would like to set it to some custom color. I don't think this is possible, I think I'd need to supply my own stretchable background dialog resource. Is that right?</p><p>Thanks</p>","246114","","","","","2013-09-25 06:09:08","Set background color for Dialog titlebar?","<android>","3","1","","",""
"2391654","1","2392522","","2010-03-06 07:01:54","4","15617","<p>I'm working on a Windows 7, 64 bit machine, and just downloaded and installed the Android SDK and am using Eclipse with Android plugin.</p><p>I was just going through the ""Hello Android"" guide here:<a href=""http://developer.android.com/guide/tutorials/hello-world.html"" rel=""nofollow"">Hello, Android</a></p><p>I also did the suggestions on this page: <a href=""http://developer.android.com/guide/appendix/faq/troubleshooting.html#eclipse"" rel=""nofollow"">Droid FAQ</a></p><p>Before following the FAQ, the program would compile and run but wouldn't register with the emulator. No code changes, and now I get the following.</p><p>When I try to run the emulator, I get the following message:</p><pre><code>[2010-03-05 20:48:41 - HelloAndroid]ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined[2010-03-05 20:48:41 - HelloAndroid]ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined[2010-03-05 20:48:42 - HelloAndroid]ActivityManager: Starting: Intent { comp={domain.example.helloandroid/domain.example.helloandroid.HelloAndroid} }[2010-03-05 20:48:42 - HelloAndroid]ActivityManager: Warning: Activity not started, its current task has been brought to the front</code></pre><p>Any suggestions? Thanks!</p>","202105","","202105","","2010-03-14 04:58:34","2010-06-11 02:44:52","Can't dispatch DDM chunk 46454154: no handler defined - Eclipse - Android SDK","<android><eclipse><runtime-error>","1","3","","",""
"2391806","1","2392415","","2010-03-06 08:08:10","2","1744","<p>I'm looking for information about how ""addProximityAlert()"" exactly works</p><p>At what intervals does it check?What happens if we use more than one addProximmityAlert(, do they work independently(do they check individually)?</p>","246936","","246936","","2010-03-07 05:44:24","2010-03-07 05:44:24","ANDROID: how does addProximityAlert() work exactly?","<android><gps><location><battery>","1","0","1","",""
"2391825","1","2393129","","2010-03-06 08:14:14","1","1153","<p>I have some knowledge about Human computer interaction and some basic knowledge programming scripts (Python) that run from start to finish and automate some tasks I want to do or calculations. In the past I built interfaces in HTML with PHP behind it.</p><p>I would like my python scripts to evolve from the command line and build some applications with GUIs that would allow the user to drag files and push buttons to initiate operations and check progress graphically.</p><p>Since I write my scripts in Python I looked at some of the options (Tkinter, wxPython, PyQt) but I can't make a decision between them to invest my time learn one and not the other. My criteria:</p><ul><li>Has a introduction for programmers for GUI (what are the differences from a script, examples of some simple interfaces)</li><li>A framework that would allow me to run my programs on the platforms I use most (Windows) but that can also run on Mac and maybe Linux, without too much modification.</li><li>Very shallow learning curve (easy to make first interfaces) but flexibility later on to customize the interface beyond what the typical OS allows (different colors, size and shapes of buttons, for example)</li><li>If not the same, similar to how you program GUI for Android and/or Nokia smartphones. I'm planning to write some programs for these platforms in the near future so I would like to carry over some of the lessons here onto those platforms, if possible.</li></ul><p>I did find this <a href=""http://stackoverflow.com/questions/88382/where-do-i-start-learning-about-gui-programming"">previous question</a> but none of the answers are satisfactory.</p><p>Does any of the frameworks fit these requirements better than the others or are they essentially similar and I would be happy with any of them?</p><p>Note: If you think I should consider other language rather than Python to achieve this, which one? I really like Python whitespace syntax and have grown used to it so I would prefer to stick with it.</p>","121075","","","","","2012-02-26 21:06:17","Which GUI framework to learn when you know scripting and HCI","<python><windows><android><gui><meego>","3","0","1","",""
"2392214","1","","","2010-03-06 10:56:39","4","2565","<p>As  is disabled on Android, is it possible to upload a photo from library, in Browser somehow? Camera/Photo Library JavaScript API?</p><p>Thanks</p>","116925","","","","","2010-11-03 05:33:57","Upload a library photo with Android web browser","<javascript><android><api><upload><camera>","2","0","1","",""
"2392297","1","2392560","","2010-03-06 11:23:17","1","13010","<p>I'm developping an android application and trying to deal with threads without really knowing a lot about them... (Yeah bit stupid of me, I know)I'll try to explain it properly and quite quickly.</p><p>In the onCreate method of my activity, I'm calling an AlertDialog to make the user choose to either load data from the internet or directly access the application using the data previously stored in database.<br>For that, in the onCreate, I call my method to raise the AlertDialog, positive button should start the worker thread to download, and negative button should call intent to move to next activity. So far, I got this :  </p><ul><li>by not calling <code>wait()</code> anywhere, my AlertDialog appears but the thread starts anyway  </li><li>by calling <code>wait()</code> at the first line of my thread, I have to declare it static to access it from the listeners of my AlertDialog and be able to <code>notify()</code> it or <code>interrupt()</code>, I receive the error: <code>object not locked by thread before wait()</code>.</li></ul><hr><pre><code>worker = new Thread(new Runnable() {        public void run() {            try {                wait();            } catch (InterruptedException e) {                e.printStackTrace();            }</code></pre><h2>    [rest of my run method]</h2><pre><code>private void miseAJourDesDonnes() {    confirmInscrip = new AlertDialog.Builder(this).setMessage(            ""Voulez-vous mettre ŕ jour l'intégralité des données de l'application? (Connexion internet requise"").setPositiveButton(""Mettre ŕ jour"",            okListener).setNegativeButton(""Continuer sans"", nonListener);    confirmInscrip.create();    confirmInscrip.show();}OnClickListener okListener = new OnClickListener() {    public void onClick(DialogInterface dialog, int which) {        dialog.cancel();        Toast.makeText(AccueilSplash.this, ""Mise ŕ jour en cours"", Toast.LENGTH_SHORT).show();        worker.notify();        return;    }};OnClickListener nonListener = new OnClickListener() {    public void onClick(DialogInterface dialog, int which) {        dialog.cancel();        Toast.makeText(AccueilSplash.this, ""Accčs direct ŕ l'application"", Toast.LENGTH_SHORT).show();        worker.interrupt();        Intent entre = new Intent(AccueilSplash.this, Androt.class);        startActivity(entre);    }};</code></pre><p>worker is my instance of Thread (the bbackground one)Am I just being dumb or Is there a subtility I havent grasped?thanks for any answer...</p>","263521","","146792","","2011-12-27 16:51:07","2011-12-27 16:51:07","Access a thread to notify it from another method (Android application)","<java><android><static><multithreading><visibility>","2","3","3","",""
"2392442","1","","","2010-03-06 12:31:23","1","434","<p>I'm trying to add some animations to my application. I've essentially got a few menu screens, that all eventually lead to the main application that is a surface view. I want to add some nice animations between screen like fading in and out between screens. What's the easiest way to do this that is supported by SDK1.5 and above (I want to target most users)?</p><p>I'm confused by what is and isn't supported in SDK1.5. My belief at the moment is that animations between different activities is not supported in 1.5 but animations in things like ViewFlipper are. It seems the easiest way is to set up a ViewFlipper, put each of my screens in that, set the animation settings and then use this to get nice transitions.</p><p>Also, is there a way to override the ""no animations"" setting that can be found in the phone's main settings screen under display? I'm making a game, so presentation is important, so I want to be sure that whatever I use will cause an animation regardless of this global setting.</p>","284055","","","","","2010-03-06 17:50:24","Animation support for Android SDK 1.5?","<java><android>","1","0","","",""
"2392602","1","2393486","","2010-03-06 13:29:47","3","2116","<p>im looking for any information about a builtin algorithm in opengl es to convert a 3d polygon in a triangle set. is there anything implemented like that in opengl es?</p>","165106","","","","","2011-08-29 16:28:28","3D polygonal triangulation in opengl es","<android><opengl-es><triangulation>","3","0","1","",""
"2392605","1","","","2010-03-06 13:30:23","4","700","<p>I'm porting an application from iPhone to Android. The iPhone app has artwork for some dozen or more buttons in their normal and pressed state. That translated over just fine to Android. However, we of course currently don't have any images for the ""focused"" state.</p><p>Besides the work involved in creating all these focused button images, we're not sure exactly what color to set the focus too. Selection color varies from phone to phone, etc. We'd have to come up with some neutral ""white glow"" of some sort I suppose. Then the idea struck -- could we programmatically render a focus images for the buttons based on the current selection color? Have folks been doing anything like this in the Android dev community? Can you point me to some examples. A net search didn't turn up anything too useful, though perhaps I searched on the wrong keywords.</p><p>Thank you!</p><p>The Xdog.</p>","246887","","","","","2011-02-01 20:05:44","Can one programmatically generate the focused image for an ImageButton?","<android>","1","0","1","",""
"2392828","1","2395318","","2010-03-06 14:47:01","3","4534","<p>Maybe this question has been asked already but I can't find any information about that even in the ""Menu"" section of Android's doc...So does anyone know if there is a way to set the menu out on an activity (to avoid the user clicking on the menu button of the phone)...?</p>","263521","","","","","2010-03-07 05:35:05","android : set the menu out / visible","<android><menu>","2","0","2","",""
"2393010","1","2394020","","2010-03-06 15:36:54","7","1196","<p>Has anyone got a good source for icons that can be used in an application?</p><p>I'm thinking of things like pushpins, scope sights, house, car, shop, and other small graphics you might overlay on a map or picture.</p><p>Most people just rip them off from the web, but I'm looking for an honest source.</p><p>A while ago, I found a website marketplace where you could commission stuff from graphic artists.   Does anyone have any links for these?   The sort of thing I mean is like this:  <a href=""http://www.graphicster.com/Default.aspx"">http://www.graphicster.com/Default.aspx</a>  (But those guys haven't got critical mass yet).  Or these guys <a href=""http://www.crowdspring.com/how-it-works/"">http://www.crowdspring.com/how-it-works/</a>  (but they seem a bit high end)</p><p>Thanks for any leads.</p>","253661","","253661","","2010-03-06 15:51:52","2013-10-09 14:44:30","Seeking good sources for icons, artwork etc","<iphone><android><blackberry>","6","0","26","2013-10-09 15:35:58",""
"2393103","1","5469625","","2010-03-06 16:03:37","53","52801","<p>I just started a new Android project, ""WeekendStudy"" to continue learning Android development and I got stumped compiling the default 'hello weekendstudy' compile / run.  I think that I missed a step in configuration and setup, but I am at a loss to find out where.  I have an AVD configured, set and launched.</p><p>When I press 'run', the SDK is building a file main.out.xml and then fails as this:</p><pre><code>[2010-03-06 09:46:47 - WeekendStudy]Error in an XML file: aborting build.[2010-03-06 09:46:48 - WeekendStudy]res/layout/main.xml:0: error: Resource entry main is already defined.[2010-03-06 09:46:48 - WeekendStudy]res/layout/main.out.xml:0: Originally defined here.[2010-03-06 09:46:48 - WeekendStudy]/Users/mobibob/Projects/workspace-weekend/WeekendStudy/res/layout/main.out.xml:1: error: Error parsing XML: no element found[2010-03-06 09:48:16 - WeekendStudy]Error in an XML file: aborting build.[2010-03-06 09:48:16 - WeekendStudy]res/layout/main.xml:0: error: Resource entry main is already defined.[2010-03-06 09:48:16 - WeekendStudy]res/layout/main.out.xml:0: Originally defined here.[2010-03-06 09:48:16 - WeekendStudy]/Users/mobibob/Projects/workspace-weekend/WeekendStudy/res/layout/main.out.xml:1: error: Error parsing XML: no element found[2010-03-06 09:55:29 - WeekendStudy]res/layout/main.xml:0: error: Resource entry main is already defined.[2010-03-06 09:55:29 - WeekendStudy]res/layout/main.out.xml:0: Originally defined here.[2010-03-06 09:55:29 - WeekendStudy]/Users/mobibob/Projects/workspace-weekend/WeekendStudy/res/layout/main.out.xml:1: error: Error parsing XML: no element found[2010-03-06 09:55:49 - WeekendStudy]Error in an XML file: aborting build.[2010-03-06 09:55:49 - WeekendStudy]res/layout/main.xml:0: error: Resource entry main is already defined.[2010-03-06 09:55:49 - WeekendStudy]res/layout/main.out.xml:0: Originally defined here.[2010-03-06 09:55:49 - WeekendStudy]/Users/mobibob/Projects/workspace-weekend/WeekendStudy/res/layout/main.out.xml:1: error: Error parsing XML: no element found</code></pre>","157804","","","","","2012-11-23 09:40:18","android sdk main.out.xml parsing error?","<xml><parsing><android><avd>","17","2","18","",""
"2393224","1","2394189","","2010-03-06 16:39:33","0","1157","<p>was wondering if it was possible to use my physical keyboard to type, and have the android emulator simulate it as if it were a touch (specifically- the button highlights, and letter overlay)</p><p>thanks</p>","287814","","","","","2012-08-10 06:17:08","Android Emulator - Having the keyboard display touch input when using physical keyboard to type?","<android><keyboard><emulator>","1","0","","",""
"2393847","1","2481381","","2010-03-06 19:39:23","21","30300","<p>I'm battling with Android's retarded layout system. I'm trying to get a table to fill the screen (simple right?) but it's ridiculously hard.</p><p>I got it to work somehow in XML like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent""&gt;&lt;TableRow android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:layout_weight=""1""&gt;&lt;Button android:text=""A"" android:layout_width=""wrap_content"" android:layout_height=""fill_parent"" android:layout_weight=""1""/&gt;&lt;Button android:text=""B"" android:layout_width=""wrap_content"" android:layout_height=""fill_parent"" android:layout_weight=""1""/&gt;&lt;/TableRow&gt;&lt;TableRow android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:layout_weight=""1""&gt;&lt;Button android:text=""C"" android:layout_width=""wrap_content"" android:layout_height=""fill_parent"" android:layout_weight=""1""/&gt;&lt;Button android:text=""D"" android:layout_width=""wrap_content"" android:layout_height=""fill_parent"" android:layout_weight=""1""/&gt;&lt;/TableRow&gt;</code></pre><p>However I can not get it to work in Java. I've tried a million combinations of the LayoutParams, but nothing ever works. This is the best result I have which only fills the width of the screen, not the height:</p><pre><code>    table = new TableLayout(this);    // Java. You suck.    TableLayout.LayoutParams lp = new TableLayout.LayoutParams(                                    ViewGroup.LayoutParams.FILL_PARENT,                                    ViewGroup.LayoutParams.FILL_PARENT);    table.setLayoutParams(lp); // This line has no effect! WHYYYY?!    table.setStretchAllColumns(true);    for (int r = 0; r &lt; 2; ++r)    {        TableRow row = new TableRow(this);        for (int c = 0; c &lt; 2; ++c)        {            Button btn = new Button(this);            btn.setText(""A"");            row.addView(btn);        }        table.addView(row);    }</code></pre><p>Obviously the Android documentation is no help. Anyone have any ideas?</p>","265521","","","","","2011-01-10 12:32:35","How can I get an Android TableLayout to fill the screen?","<java><xml><android><layout><tablelayout>","4","3","6","",""
"2393940","1","","","2010-03-06 20:03:22","0","746","<p>I have this bit of code;</p><pre><code> lm = (LocationManager)  getSystemService(Context.LOCATION_SERVICE); gpslocation = Double.toString(lm.getLastKnownLocation(""gps"").getLatitude()) +"" ""  + Double.toString(lm.getLastKnownLocation(""gps"").getLongitude());</code></pre><p>Which works fine on both the emulator and my hero running android 1.5, but it Force Closes on the emulator of 1.6 and also on my tattoo.</p><p>What changed from 1.5 to 1.6?</p><p>OK, using this instead;</p><pre><code>    lm = (LocationManager)     getSystemService(Context.LOCATION_SERVICE);    Double latPoint = null;    Double lngPoint = null;    Location loc = lm.getLastKnownLocation(""gps"");    if(loc != null) {       latPoint = lm.getLastKnownLocation(""gps"").getLatitude();       lngPoint = lm.getLastKnownLocation(""gps"").getLongitude();    } else {    }  Toast.makeText(getBaseContext(),""test lat "" + latPoint, Toast.LENGTH_LONG).show();</code></pre><p>I get null toast, and null toast if i fire a location at the emulator before running the app.</p>","286424","","286424","","2010-03-06 20:47:28","2011-04-23 21:52:28","why does this work on android 1.5 but not 1.6 (location manager)","<android><locationmanager>","1","0","","",""
"2394176","1","2395270","","2010-03-06 21:31:51","23","56478","<p>I'm new to Android and I think I'm trying to do something really basic:  I have a 5 strings in my Array (say 'One', 'Two', ...).  I want to add these 5 strings to my list view in my listactivity.</p><p>My List:    </p><pre><code>&lt;ListView     android:id=""@+id/android:list""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre><p>My List Row:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:orientation=""horizontal""&gt;&lt;TextView android:id=""@+id/homeItemName""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_weight=""1""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Basically, I want to bind the Array items to the TextView homeItemName.  I might add other items in my row later, so I can't just bind the listview to the entries.</p><p>Thanks!</p>","406322","","","","","2010-03-07 05:13:23","Android: Populating a listview with array items","<java><android><arrays><listview>","2","1","6","",""
"2394236","1","","","2010-03-06 21:56:17","18","19750","<p>I've just finished a relatively large project for the Android, and it's left a bitter taste in my mouth with the knowledge that it will never run on one of the most ubiquitous handsets this side of the solar system (the one by that fruity little club).</p><p>So, for my next project, I want to write it in a way that makes most of the components easily transportable between the iPhone and Android platforms. The way I'm thinking of doing this is by coding most of it in Objective-C, and then adding the platform-specific parts in more Objective-C and Java respectively. On the Android side, this will require using the the NDK.</p><p>My knowledge of C is good, but my knowledge of Objective-C is close to zero, and I have no desire to learn C++. How sane is the approach above, and is there a better one? Is there any way I can code in Java and still reach the un-hacked iPhone market? And how likely is it that the people I know (iPhone users) will have an Android phone by next year?</p>","209838","","","","","2013-11-13 21:30:52","Objective-C and Android","<java><iphone><objective-c><android><android-ndk>","15","4","10","",""
"2394477","1","2397346","","2010-03-06 23:28:08","17","27035","<p>I am trying to open a dialog on widget click. I have solved the problem skinning the activity started on click with <code>android:theme=""@android:style/Theme.Dialog""</code>. Unfortunately I cannot reach the same look of a dialog. </p><p>This is the outcome:</p><p><img src=""http://i50.tinypic.com/n15lcy.png"" alt=""Dialog from widget""></p><p>Instead, I would like to reach this result (except for the button, of course):</p><p><img src=""http://i48.tinypic.com/2ithqpc.png"" alt=""Desired dialog from widget""></p><p>(the widget dialog you can see keeping the screen pushed)</p><p>As you can see there are some differences: the color of the list items, the color of the text and the list item separator. Is there a predefined theme/style to obtain the same look of a standard dialog? If not, what are the steps to follow to reach that result?</p><p>I have seen that the widget provided by FoxyRing has the behaviour I would like to have.</p><p>Thanks!</p>","269585","","154306","","2011-01-26 13:21:11","2011-01-26 13:21:11","Make Android Activity looks like dialog","<android><gui><activity>","3","0","9","",""
"2394514","1","2394857","","2010-03-06 23:39:48","3","17218","<p>I want to generate a Listview that has some dividers between some of the entries, like it can be seen in some of the property sections. See the example below. I try to generate a List that consists of some textviews followed by one of the fancy dividers explaining the next part of the list and then again some text views. How can this be done? I thought about creating different views to add to the list? Is this the way to go?<br><img src=""http://janusz.de/~janusz/device.png"" alt=""alt text""></p>","114066","","114066","","2012-01-27 08:42:16","2014-01-06 19:38:18","How to generate a ListView with headers above some sections?","<android><android-listview><divider>","5","1","3","",""
"2394723","1","2394744","","2010-03-07 01:04:40","1","286","<p>While working my way through the Android tutorials, I came across something I don't understand. It's probably extremely simple, but I just need an idea why it's this way.</p><p>In the tutorial: <a href=""http://developer.android.com/resources/tutorials/views/hello-autocomplete.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-autocomplete.html</a></p><p>The tutorial seems to construct a new AutoCompleteTextView using:</p><pre><code>AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete_country);</code></pre><p>I assume their using the constructor:</p><pre><code>AutoCompleteTextView(Context context, AttributeSet attrs)</code></pre><p>I think their AttributeSet is the ""<code>findViewById(R.id.autocomplete_country)</code>""; while their context is the <code>(AutoCompleteTextView)</code>. Is this right?</p><p>Also... where's the new keyword, the comma, and why is there a pair of parenthesis?</p><p>I always thought it'd have to be:</p><pre><code>AutoCompleteTextView textview = new AutoCompleteTextView(context here, attrs here);</code></pre><p>Where am I going wrong?! </p>","288010","","2214","","2010-03-07 01:11:54","2010-03-07 01:11:54","Where's the ""new"" keyword? Android Tutorial Woes","<java><android>","2","0","1","",""
"2394935","1","2394939","","2010-03-07 02:26:35","132","69858","<p>How can I define underlined text in an Android layout xml file?</p>","114066","","114066","","2012-02-02 13:03:00","2013-09-11 07:41:24","Can I underline text in an android layout?","<android><android-layout><fonts>","6","0","41","",""
"2395281","1","2414405","","2010-03-07 05:23:42","1","2166","<p>When I add drawable resources to my project they do not show up in the list of drawables in the Reference Chooser.  I checked the R file and there are references for the files.</p><p>I have tried refreshing the project, cleaning the project, and fixing project properties and nothing seems to help.  Sometimes a couple will randomly show up in there, but not all of them.</p><p>The only consistent way I can get them to show up is to restart Eclipse.</p><p>Any ideas?</p><p>Thanks</p><p>Edit:  Further findings:</p><p>After some trials, I found an other inconvenient work around to he issue.  Turns out when importing multiple files into the project at once, Eclipse will only add the last one imported into the reference chooser.  So when I imported my images one at a time, they all show up properly!</p><p>Like I said, inconvenient considering the amount of images I have left to import, but maybe with this new information it may help nail down where the issue may be and a possible fix.</p>","288072","","288072","","2010-03-09 03:45:33","2012-09-22 11:59:26","Refresh list of drawables in Eclipse?","<android><eclipse>","3","0","","",""
"2395324","1","","","2010-03-07 05:37:44","2","654","<p>I've been looking into the photo picker which I want to use as part of an application I am developing. I have set up the picker to respond to intents and have tested it in my application. However the way I am hoping to use the photo picker is to restrict it to a specific folder on the SD card. Is this possible, I have looked through the API/SDK and have not found the information I was looking for.</p>","288077","","1101070","","2012-03-06 00:47:51","2012-03-06 00:47:51","how to use the photo picker and specify a folder","<android>","0","1","","",""
"2395376","1","2396443","","2010-03-07 06:07:51","1","877","<p>I a currently using a new thread to create a UI thread and then displaying a progress bar. Can someone tell me how to do the same for a thirty second progress dialog (should do some work and disappear after this duration) that can be done using a handler instead?</p>","184046","","","","","2010-03-07 13:45:08","Android: Progress bar that shows a countdown?","<android><progress-bar><handler>","1","0","1","",""
"2395439","1","","","2010-03-07 06:55:07","0","3741","<p>I'm trying to build a radio application for Android.I'm an android newbie,but familiar with Java.Could anyone tell me the procedure for streaming audio from an internet radio station onto my android device in detail?Thanks in advance :)  </p>","288094","","","","","2010-06-03 10:00:09","radio application on android","<android><streaming><radio>","1","0","2","",""
"2395551","1","2400971","","2010-03-07 07:49:20","0","657","<p>I created one application to read all the contacts stored in android 2.0 emulator.I want to do the same thing for android 1.5 emulator, but the same code is not working for android 1.5.I don't know how to do it.If any body knows please help me.</p>","131062","","","","","2010-03-08 11:39:38","How to read Contacts from Android 1.5 emulator?","<android>","1","1","","",""
"2395554","1","","","2010-03-07 07:53:20","0","318","<p>I have separated most of my android game code into a separate reusable 'Java Project'.  The 'Android project' basically starts a surface View and then loads a new thread containing necessary object from my external 'Java Project'.</p><p>How could I run JUnit tests on this considering the external 'Java Project' needs an application context.  </p><p>I don't want to do the unit testing in the Android Project because I may have 3+ different projects all using the code from the 'Java Project'.</p>","248521","","","","","2010-12-07 10:28:18","Android JUnit tests on a non Android Project","<android>","1","0","","",""
"2395661","1","","","2010-03-07 08:40:43","106","99123","<p><br>I've seen some chatter about this, but nothing definite. Is there a way to put the tabs in a TabWidget to the bottom of the screen?If so, how?</p><p>I've tried the following, but didn't work:   </p><p>a) setting the tabwidget below the framelayout<br>b) setting the tabwidget's gravity to ""bottom""</p><p>Thanks!llappall</p>","284556","","","","","2014-04-18 09:12:07","Android: Tabs at the BOTTOM","<android><tabwidget>","10","4","83","",""
"2395769","1","","","2010-03-07 09:31:45","18","18469","<p>Let's say I have a LinearLayout, and I want to add a View to it, in my program from the Java code. What method is used for this? I'm not asking how it's done in XML, which I do know, but rather, how can I do something along the lines of</p><p>(One View).add(Another View)</p><p>Like one can do in Swing. Thanks in advance.</p>","180739","","","","","2014-02-19 10:40:56","How to Programmatically Add Views to Views","<android>","3","0","5","",""
"2395811","1","2424995","","2010-03-07 09:45:42","3","12694","<p>I am having a Table layout which has 3 columns defined. But due to large Text in the second column, the content is going off the screen. So i was trying to place a horizontal Scrollbar. But was unable to do.</p><p>I am using Android 1.5 as target.</p><p>XML code of the table layout</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""      android:scrollbars=""horizontal""      android:layout_height=""fill_parent""      android:layout_width=""fill_parent""&gt;    &lt;TableLayout        xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_height=""fill_parent""        android:layout_width=""fill_parent""        android:stretchColumns=""0,1,2""        android:id=""@+id/tLayout""        android:scrollbars=""horizontal""        &gt;           &lt;TableRow            android:layout_width=""fill_parent""&gt;            &lt;TextView                android:padding=""3dip""                android:gravity=""left""                android:text=""Name""                /&gt;            &lt;TextView                android:padding=""3dip""                android:gravity=""left""                android:text=""Address""                /&gt;            &lt;TextView                android:padding=""3dip""                android:gravity=""left""                android:text=""Age""                /&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/ScrollView&gt;</code></pre>","273548","","273548","","2010-03-11 12:40:12","2012-06-06 13:46:11","Need a Horizontal Scroll on Table layout","<android><android-widget>","1","0","","",""
"2396153","1","","","2010-03-07 12:00:52","5","3220","<p>In my android application I have a <code>PreferenceScreen</code> parent that has 3 <code>CheckBoxPreferences</code> as children.</p><p>When I click the parent preferenceScreen, and the 3 checkboxes are displayed, I select one of them, and in the Preference.OnPreferenceChangeListener asociated with the checkboxes I set the parent's preferenceScreen summary with:</p><pre><code>Parent.setSummary(""string depending on the selection"")</code></pre><p>The thing is that when I return to the parent, it's summary is not updated, even if internally the value has correspondingly changed to the value setted.</p><p>Has anyone any idea regarding this behavior? </p>","284609","","119895","","2010-07-11 14:13:22","2013-03-07 20:59:51","PreferenceScreen android:summary update !","<android>","3","0","0","",""
"2396315","1","2397817","","2010-03-07 13:06:04","0","2820","<p>I have a ListView stitched together by an IconicAdapter. I want to call a function <code>addNextTenEntries()</code> (which in itself is already working) when the user has scrolled to the bottom of the list, similar to what the Market does (dynamic loading of further entries).</p><p>I have tried to implement <code>OnGestureListener</code> to catch the Scroll and Fling-Events, but<code>public boolean onScroll(...){...}</code> is never being triggered. </p><p>This is my code (without any of my failing attempts to catch the respective events):</p><pre><code>List  title_list = new  ArrayList();public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setListAdapter(new IconicAdapter());}class IconicAdapter extends ArrayAdapter {    IconicAdapter() {        super(myApp.this, R.layout.row, title_list);    }    public View getView(int position, View convertView, ViewGroup parent) {        LayoutInflater inflater=getLayoutInflater();        View row=inflater.inflate(R.layout.row, parent, false);        TextView title=(TextView)row.findViewById(R.id.list_title);        title.setText(title_list.get(position).toString());        return(row);    }}</code></pre><p>How can I go about catching scroll events? I have read the documentation regarding ListViews, but I don't know where and how to implement onTouchEvent (if that's even the correct method to do this).</p><p>Thanks for your help!</p>","241189","","241189","","2010-03-07 18:42:39","2010-03-07 20:24:05","Catching onScroll-Events of a ListView created through an IconicAdapter","<android><listview>","1","0","1","",""
"2396559","1","","","2010-03-07 14:24:24","4","687","<p>There is an option to create an Android JUnit Project.</p><p>As far as I am aware the other way is to create a folder in the same project called test which contains the same package name as the existing project.</p><p>What are the differences between these two methods.</p>","248521","","","","","2011-08-10 16:40:46","Android and JUnit: Create a JUnit Project or a test source folder","<android>","3","0","0","",""
"2396581","1","2397429","","2010-03-07 14:31:42","0","548","<p>I was wondering if there was already a component available which the user could use the touchscreen to draw numbers into. If not, I was considering an openGL panel which their input would draw onto, and then I'd need some algorithm to interpret the drawing and parse it to a number.</p><p>Obviously, I'd prefer a component already exist, but am always up for a coding challenge :)</p>","231768","","44729","","2011-05-26 15:45:15","2011-05-26 15:45:15","Drawing numbers into a panel?","<android><opengl-es><canvas><drawing>","3","0","","",""
"2396718","1","2396762","","2010-03-07 15:14:15","8","4550","<p>While I realize resources themselves are defined in XML files, if I have an XML file of my own type that I wish to use, should I be storing them in ""res/xml""?</p><p>Is there a better way to do this such as using assets and then loading them as binary to be parsed by another XML library?</p>","128991","","","","","2011-05-05 02:34:34","What's the best way to store and access XML in Android?","<xml><android><resources><assets>","2","0","5","",""
"2396896","1","2397079","","2010-03-07 16:08:04","0","288","<p>I'll be very simple:</p><p>I want to be able to store Java objects from the phone to a webserver. Then, I want to be able to retrieve them later.</p><p>What could be a good combination of tools/webservers/languages to achieve this?</p><p>I have done that before with a serialization of objects through a LAMP server.</p><p><strong>Example</strong>[java object on the android phone] -> [object serialization] -> [POST request to PHP webserver ] -> [storage in a database]</p><p>Do you know any better and comfortable technique?Can I work directly with Java objects using a JSP/Servlet?</p><p>Thank you.</p>","252711","","","","","2010-03-07 17:06:13","Download and upload of data (eg. serialized objects) from a phone to a webserver","<xml><android>","1","0","","",""
"2396972","1","2397073","","2010-03-07 16:31:20","0","165","<p>How can I bind my application so, when the Birthday entry is clicked on a Contact Entry, it will open up my activity?</p><p><img src=""http://img130.imageshack.us/img130/7673/screenbirthday.png"" alt=""Birthday""></p>","243782","","","","","2010-03-07 17:03:53","How to bind my activity when a contact entry data, such as birthday is clicked?","<android>","1","0","","",""
"2396975","1","2400645","","2010-03-07 16:32:38","1","639","<p>As you can know, you can store data against a contact on Android phones. I am wondering if there is a standard name to store a birthday against a contact?</p><p><img src=""http://img130.imageshack.us/img130/7673/screenbirthday.png"" alt=""alt text""></p>","243782","","146325","","2010-03-07 16:59:43","2010-03-08 10:35:01","What is the fieldname to store a birthday for a contact entry?","<android>","1","0","","",""
"2397106","1","","","2010-03-07 17:16:33","17","29120","<p>I am using a ListView in an AlertDialog to display a list of items. When the user clicks on one of the items, I want the dialog to close. I would not have any action buttons on the dialog. Any ideas on how I would accomplish this?</p>","244190","","1101070","","2012-03-06 01:11:05","2013-04-12 08:20:14","ListView in AlertDialog","<android>","2","1","7","",""
"2397203","1","2397517","","2010-03-07 17:46:02","3","6427","<p>I have the following setup, and the empty view text doesn't show up...</p><pre><code>protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);            getListView().setEmptyView(findViewById(R.id.empty));    getListView().setTextFilterEnabled(true);    setListAdapter(null);// to have empty list}</code></pre><p>The layout file is:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/myScrollLayout""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:orientation=""vertical"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;FrameLayout android:layout_width=""fill_parent""        android:layout_height=""0dip"" android:layout_weight=""1""&gt;        &lt;ListView android:id=""@android:id/list"" android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" android:drawSelectorOnTop=""false"" /&gt;        &lt;!-- Here is the view to show if the list is emtpy --&gt;        &lt;ScrollView            android:id=""@android:id/empty"" android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;            &lt;TextView android:id=""@+id/emptyText"" android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" android:text=""@string/contact_empty_help""                android:textSize=""20sp"" android:textColor=""?android:attr/textColorSecondary""                android:paddingLeft=""10dip"" android:paddingRight=""10dip""                android:paddingTop=""10dip"" android:lineSpacingMultiplier=""0.92"" /&gt;        &lt;/ScrollView&gt;    &lt;/FrameLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>String is defined as:</p><pre><code>&lt;string name=""contact_empty_help""&gt;""You don't have any contacts to display.\n\nTo add contacts, you have to:\n        \n&lt;li&gt;&lt;font fgcolor=""#ffffffff""&gt;Go to &lt;b&gt;Contacts&lt;/b&gt;&lt;/font&gt; application to create new contacts\n&lt;/li&gt;        \n&lt;li&gt;&lt;font fgcolor=""#ffffffff""&gt;&lt;b&gt;Import from VCF file&lt;/b&gt;&lt;/font&gt;, this is available in Contacts menu, the file most be on the root of the SD card\n&lt;/li&gt;""        &lt;/string&gt;</code></pre><p>Since the list is empty, it should show me the text defined. I followed the example from the List8  </p><p><a href=""http://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/view/List8.html"" rel=""nofollow"">http://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/view/List8.html</a><br><a href=""http://developer.android.com/intl/de/resources/samples/ApiDemos/res/layout/list_8.xml"" rel=""nofollow"">http://developer.android.com/intl/de/resources/samples/ApiDemos/res/layout/list_8.xml</a></p>","243782","","","","","2013-04-19 05:16:27","Problem using setEmptyView on a ListActivity","<android>","3","0","4","",""
"2397204","1","2397222","","2010-03-07 17:46:53","5","5335","<p>I'm new to Java/Eclipse/Android, so this is probably an easy (if not stupid) question:</p><p>After creating a new Android project, I want to import some (what I think are standard) java libraries.</p><p>However, some import statements throw an error:</p><p>HelloAndroid.java:</p><p><code>import java.awt.Color;</code> (The import java.awt.Color cannot be resolved)</p><p><code>import javax.imageio.ImageIO;</code> (The import javax.imageio cannot be resolved)</p><p>while others don't:</p><p><code>import java.io.File;</code> (no error)</p><p>I've done some googling and tried to add these classes to my classpath by going to project->properties->libraries but I haven't been able to figure out what to do exactly.</p><p>Any pointers are greatly appreciated!</p><p>Cheers,</p><p>Martin</p>","102181","","","","","2010-03-07 18:08:04","Basic Java/Eclipse problem: standard libraries cannot be imported in Android project","<java><android><eclipse><java-libraries>","3","0","1","",""
"2397347","1","2400120","","2010-03-07 18:23:29","0","1050","<p>I am successfully linking some of my code stored in a .jar-based library to my Android app. The .jar code references Android library content just fine.</p><p>The problem is I need to include 'res' resources in the library but can't work out how to do this.</p><p>Any suggestions?</p>","82515","","","","","2010-03-08 08:46:12","How do I make an Android library for static linking that includes resources?","<android>","2","0","","",""
"2397490","1","2412814","","2010-03-07 18:56:43","4","7557","<p>I,m trying to work through and test a Voice Recognition example based on the VoiceRecognition.java example at <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html</a></p><p>but when click on the button to create the activity, I get a dialog that says Connection problem. My Manifest file is using the Internet Permission, and I understand it passes the to the Google Servers. Do I need to do anything else to use this. Code below</p><p>UPDATE 2:Thanks to Steve, I have been able to install the USB Driver and debug the app directly on my Droid. Here is the LogCat output from clicking on my mic button:</p><pre><code>03-08 18:36:45.686: INFO/ActivityManager(1017): Starting activity: Intent { act=android.speech.action.RECOGNIZE_SPEECH cmp=com.google.android.voicesearch/.IntentApiActivity (has extras) }03-08 18:36:45.686: WARN/ActivityManager(1017): Activity is launching as a new task, so cancelling activity result.03-08 18:36:45.787: DEBUG/NetworkLocationProvider(1017): setMinTime: 12000003-08 18:36:45.889: INFO/ActivityManager(1017): Displayed activity com.google.android.voicesearch/.IntentApiActivity: 135 ms (total 135 ms)03-08 18:36:45.905: DEBUG/NetworkLocationProvider(1017): onCellLocationChanged [802,0,0,4192,3]03-08 18:36:45.951: INFO/MicrophoneInputStream(1429): Starting voice recognition with audio source VOICE_RECOGNITION03-08 18:36:45.998: DEBUG/AudioHardwareMot(990): Codec sampling rate already 1600003-08 18:36:46.092: INFO/RecognitionService(1429): ssfe url=http://www.google.com/m/voice-search03-08 18:36:46.092: WARN/RecognitionService(1429): required parameter 'calling_package' is missing in IntentAPI request03-08 18:36:46.115: DEBUG/AudioHardwareMot(990): Codec sampling rate already 1600003-08 18:36:46.131: WARN/InputManagerService(1017): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@4487d240 (uid=10090 pid=3132)03-08 18:36:46.131: WARN/IInputConnectionWrapper(3132): showStatusIcon on inactive InputConnection03-08 18:36:46.248: WARN/MediaPlayer(1429): info/warning (1, 44)03-08 18:36:46.334: DEBUG/dalvikvm(3206): GC freed 3682 objects / 369416 bytes in 293ms03-08 18:36:46.358: WARN/MediaPlayer(1429): info/warning (1, 44)03-08 18:36:46.412: WARN/MediaPlayer(1429): info/warning (1, 44)03-08 18:36:46.444: WARN/MediaPlayer(1429): info/warning (1, 44)03-08 18:36:46.475: WARN/MediaPlayer(1429): info/warning (1, 44)03-08 18:36:46.506: WARN/MediaPlayer(1429): info/warning (1, 44)03-08 18:36:46.514: INFO/MediaPlayer(1429): Info (1,44)03-08 18:36:46.514: INFO/MediaPlayer(1429): Info (1,44)03-08 18:36:46.514: INFO/MediaPlayer(1429): Info (1,44)03-08 18:36:46.514: INFO/MediaPlayer(1429): Info (1,44)03-08 18:36:46.514: INFO/MediaPlayer(1429): Info (1,44)03-08 18:36:46.514: INFO/MediaPlayer(1429): Info (1,44)</code></pre><p>The line that concerns me is the warning of the missing parameter calling-package.</p><p>UPDATE:Ok, I was able to replace my emulator image with one from HTC that appears to come with Google Voice Search, however now when I run from the emulator, i'm getting an Audio Problem message with Speak Again or Cancel buttons. It appears to make it back to the onActivityResult(), but the resultCode is 0.</p><p>Here is the LogCat output:</p><pre><code>03-07 20:21:25.396: INFO/ActivityManager(578): Starting activity: Intent { action=android.speech.action.RECOGNIZE_SPEECH comp={com.google.android.voicesearch/com.google.android.voicesearch.RecognitionActivity} (has extras) }03-07 20:21:25.406: WARN/ActivityManager(578): Activity is launching as a new task, so cancelling activity result.03-07 20:21:25.968: WARN/ActivityManager(578): Activity pause timeout for HistoryRecord{434f7850 {com.ikonicsoft.mileagegenie/com.ikonicsoft.mileagegenie.MileageGenie}}03-07 20:21:26.206: WARN/AudioHardwareInterface(554): getInputBufferSize bad sampling rate: 1600003-07 20:21:26.256: ERROR/AudioRecord(819): Recording parameters are not supported: sampleRate 16000, channelCount 1, format 103-07 20:21:26.696: INFO/ActivityManager(578): Displayed activity com.google.android.voicesearch/.RecognitionActivity: 1295 ms03-07 20:21:29.890: DEBUG/dalvikvm(806): threadid=3: still suspended after undo (s=1 d=1)03-07 20:21:29.896: INFO/dalvikvm(806): Uncaught exception thrown by finalizer (will be discarded):03-07 20:21:29.896: INFO/dalvikvm(806): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@435d3c50 on ml_trackdata that has not been deactivated or closed03-07 20:21:29.896: INFO/dalvikvm(806):     at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)03-07 20:21:29.896: INFO/dalvikvm(806):     at dalvik.system.NativeStart.run(Native Method)03-07 20:21:31.468: DEBUG/dalvikvm(806): threadid=5: still suspended after undo (s=1 d=1)03-07 20:21:32.436: WARN/IInputConnectionWrapper(806): showStatusIcon on inactive InputConnection</code></pre><p>I,m still not sure why I,m getting the Connect problem on the Droid. I can use Voice Search ok. I also tried clearing the cache, and data as described in some posts, butstill not working??</p><pre><code>/*** Fire an intent to start the speech recognition activity.*/private void startVoiceRecognitionActivity() {Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);intent.putExtra(RecognizerIntent.EXTRA_PROMPT, ""Speech recognition demo"");startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);}/*** Handle the results from the recognition activity.*/@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {  if (requestCode == VOICE_RECOGNITION_REQUEST_CODE &amp;&amp; resultCode == RESULT_OK) {  // Fill the list view with the strings the recognizer thought it could have heard  ArrayList&lt;String&gt; matches = data.getStringArrayListExtra(  RecognizerIntent.EXTRA_RESULTS);  mList.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,matches));}super.onActivityResult(requestCode, resultCode, data);}</code></pre>","244190","","996493","","2012-05-02 10:08:42","2012-05-02 10:08:42","Voice Recognition Connection Error","<android><voice-recognition>","2","4","1","",""
"2397613","1","2397661","","2010-03-07 19:33:37","46","19632","<p>In my android app i'am going to implement my strings with Internationalization.So currently i got a problem with the grammar and the way sentences build in different languages.</p><p>For example: </p><blockquote>  <p>""5 minutes ago"" - english</p>    <p>""vor 5 Minuten"" - german</p></blockquote><p>So my first question is, can i do something like this in strings.xml:</p><pre><code>&lt;string name=""timeFormat""&gt;{0} minutes ago&lt;/string&gt;</code></pre><p>And then some magic like</p><pre><code>getString(R.id.timeFormat, dynamicTimeValue)</code></pre><p>This behaviour would solve the other problem with different word orders as well.</p>","288324","","212218","","2012-01-24 16:49:46","2013-12-09 16:56:01","Parameters in strings.xml possible?","<android><dynamic><parameters><string><optional>","3","0","11","",""
"2397959","1","","","2010-03-07 21:02:48","14","10168","<p>I'm developing an Android application. It has multiple threads reading from and writing to the Android SQLite database. I am receiving the following error:</p><blockquote>  <p>SQLiteException: error code 5: database is locked</p></blockquote><p>I understand the SQLite locks the entire db on inserting/updating, but these errors only seem to happen when inserting/updating while I'm running a select query. The select query returns a cursor which is being left open quite a wile (a few seconds some times) while I iterate over it. If the select query is not running, I never get the locks. I'm surprised that the select could lock the db. Is this possible, or is something else going on?</p><p>What's the best way to avoid such locks?</p>","220864","","648313","","2012-02-15 12:14:34","2013-07-01 08:02:50","How to avoid SQLiteException locking errors","<android><sqlite><locking>","4","3","1","",""
"2398209","1","2400678","","2010-03-07 22:16:16","3","2727","<p>When I was debugging my application suddenly this error popup.How can I handle this kind of error?</p><p>I don't know where and how is caused.</p><pre><code>Daemon System Thread [&lt;5&gt; HeapWorker] (Suspended (exception IllegalStateException))     SQLiteCursor.finalize() line: 603       NativeStart.run() line: not available [native method]   </code></pre>","243782","","","","","2012-09-25 09:16:41","How to Handle in code IllegalStateException on Cursor?","<android>","2","2","","",""
"2398264","1","2398378","","2010-03-07 22:30:33","3","5023","<p>I've got some XML resources in my Android app.  Each one has a different name like ""bicycle.xml"" and ""car.xml"". I'd like to know if there's a way to load resources based on conditions during run time.</p><p>As an example...Say I had a text input in my app.  When the user enters ""bicycle"", my app can look up an XML resource by that name, parse and load it.  Whereas if they enter ""car"", they would end up with the data from the other XML file.</p><p>I've noticed so far that to load resources, you have to use the autogenerated ""R"" class, which restricts you to hard-coding resources at compile time.</p>","128991","","","","","2010-03-07 23:07:15","Is there a way to arbitrarily load Resources at runtime in Android?","<java><xml><android><resources><runtime>","1","0","1","",""
"2398380","1","2410790","","2010-03-07 23:07:34","3","9886","<p>I have a question about list views. I hope someone knows the solution, because I have been trying to solve this problem all weekend.</p><p>I have a custom list view in which every row have a custom <code>.xml</code> (<code>item_row.xml</code>) with a set color background for the row item.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""70dip""  android:orientation=""vertical""  android:background=""@drawable/list_bg""&gt;</code></pre><p>The problem is that when I try to make a selector for the list. I want two things:</p><ul><li>When the item is focused,  the typical orange rectangle should appear over it,</li><li>and the same When the item is pressed.</li></ul><p>I have proved with a selector and a custom style but all I get is or the selector doesn't appear or the selector covering the item so I can't see it.</p><p>If anyone could help me with finding the right code I would be very grateful.</p><p>Thanks</p>","258863","","82548","","2010-03-07 23:13:23","2012-04-14 12:40:14","Android ListView style","<android><listview><selectors>","2","0","2","",""
"2398482","1","2531990","","2010-03-07 23:38:19","4","6128","<p>In the 1.6 API, is there a way to ensure that the onStart() method of a Service is called after the service is killed due to memory pressure? From the logs, it seems that the ""process"" that the service belongs to is restarted, but the service itself is not. I have placed a Log.d() call in the onStart() method, and this is not reached.</p><p>To test my service under memory pressure, I spawn it from an activity, then launch the web browser and visit some Javascript-heavy websites like Slashdot until my service is killed. The logcat reads:</p><pre><code>03-07 16:44:13.778: INFO/ActivityManager(52): Process com.kostmo.charbuilder.full (pid 2909) has died.03-07 16:44:13.778: WARN/ActivityManager(52): Scheduling restart of crashed service com.kostmo.charbuilder.full/com.kostmo.charbuilder.DownloadImagesService in 5000ms03-07 16:44:13.778: INFO/ActivityManager(52): Low Memory: No more background processes.03-07 16:44:13.778: ERROR/ActivityThread(52): Failed to find provider info for android.server.checkin03-07 16:44:13.778: WARN/Checkin(52): Can't log event SYSTEM_SERVICE_LOOPING: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/events03-07 16:44:18.908: INFO/ActivityManager(52): Start proc com.kostmo.charbuilder.full for service com.kostmo.charbuilder.full/com.kostmo.charbuilder.DownloadImagesService: pid=3560 uid=10027 gids={3003, 1015}03-07 16:44:19.868: DEBUG/ddm-heap(3560): Got feature list request03-07 16:44:20.128: INFO/ActivityThread(3560): Publishing provider com.kostmo.charbuilder.full.provider.character: com.kostmo.charbuilder.provider.ImageFileContentProvider</code></pre>","105137","","","","","2010-03-28 05:23:17","""Scheduling restart of crashed service"", but no call to onStart() follows","<android>","1","1","","",""
"2398623","1","2398672","","2010-03-08 00:25:27","2","2607","<p>My issue is quite simple I think :</p><p>I would like to be able to add a contact to the contact list by a simple click on a button (and be able to test it on the emulator). The data of this contact would be stored in the source code of the application.is there an easy way of doing that?</p><p>thank you for your answers</p>","263521","","","","","2010-03-08 00:40:00","Add a contact to android emulator","<android><emulator><add><contact>","1","1","","",""
"2398767","1","2398806","","2010-03-08 01:17:17","6","12723","<p>Would very much appreciate any help or hint on were to go next.</p><p>I'm trying to change the content of a row in ListView programmatically. In one row there are 3 TextView and a ProgressBar. I want to animate the ProgressBar if the 'result' column of the current row is zero.</p><p>After reading some tutorials and docs, I came to the conclusion that LayoutInflater has to be used and <code>getView()</code> - overriden. Maybe I am wrong on this.</p><p>If I return  <code>row = inflater.inflate(R.layout.row, null);</code> from the function, it gives NullPointerException.</p><p>Here is the code:</p><pre><code>    private final class mySimpleCursorAdapter extends SimpleCursorAdapter {    private Cursor localCursor;    private Context localContext;    public mySimpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to) {        super(context, layout, c, from, to);                    this.localCursor = c;        this.localContext = context;    }    /**     *    1. ListView asks adapter ""give me a view"" (getView) for each item of the list     *    2. A new View is returned and displayed     */    public View getView(int position, View  convertView, ViewGroup  parent) {        View row = super.getView(position, convertView, parent);        LayoutInflater inflater = (LayoutInflater)localContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        String result = localCursor.getString(2);        int resInt = Integer.parseInt(result);        Log.d(TAG, ""row "" + row);        // if 'result' column form the TABLE is 0, do something useful:        if(resInt == 0) {                       ProgressBar progress = (ProgressBar) row.findViewById(R.id.update_progress);            progress.setIndeterminate(true);            TextView edit1 = (TextView)row.findViewById(R.id.row_id);            TextView edit2 = (TextView)row.findViewById(R.id.request);            TextView edit3 = (TextView)row.findViewById(R.id.result);            edit1.setText(""1"");            edit2.setText(""2"");            edit3.setText(""3"");            row = inflater.inflate(R.layout.row, null);                     }        return row;    }</code></pre><p>here is the Stack Trace:</p><pre><code>03-08 03:15:29.639: ERROR/AndroidRuntime(619): java.lang.NullPointerException03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.SimpleCursorAdapter.bindView(SimpleCursorAdapter.java:149)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.CursorAdapter.getView(CursorAdapter.java:186)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at com.dhristov.test1.test1$mySimpleCursorAdapter.getView(test1.java:105)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.AbsListView.obtainView(AbsListView.java:1256)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.ListView.makeAndAddView(ListView.java:1668)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.ListView.fillDown(ListView.java:637)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.ListView.fillSpecific(ListView.java:1224)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.ListView.layoutChildren(ListView.java:1499)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.AbsListView.onLayout(AbsListView.java:1113)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.view.View.layout(View.java:6830)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.view.View.layout(View.java:6830)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.view.View.layout(View.java:6830)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.view.View.layout(View.java:6830)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.view.View.layout(View.java:6830)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.view.View.layout(View.java:6830)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.view.ViewRoot.performTraversals(ViewRoot.java:996)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.os.Handler.dispatchMessage(Handler.java:99)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.os.Looper.loop(Looper.java:123)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at android.app.ActivityThread.main(ActivityThread.java:4363)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at java.lang.reflect.Method.invokeNative(Native Method)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at java.lang.reflect.Method.invoke(Method.java:521)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)03-08 03:15:29.639: ERROR/AndroidRuntime(619):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","42085","","944657","","2012-12-04 14:36:49","2012-12-04 14:41:55","Trying to override getView in a SimpleCursorAdapter gives NullPointerExceptio","<android><nullpointerexception>","3","2","4","",""
"2398840","1","2411476","","2010-03-08 01:41:00","3","1177","<p>Is it possible in Android to programmatically send an email using the phone's associated GMail credentials?  I can send an email when I explicitly provide the username and password, but I was hoping to leverage the Google account already associated with the phone.  Note that I don't need to actually access the username or password; I just want to leverage this information indirectly to send email.</p>","3126","","","","","2010-03-09 18:22:08","Leverage Google account credentials to send email in Android","<android><email><smtp>","2","2","","",""
"2399086","1","","","2010-03-08 03:16:15","6","14068","<p>I am very new to android. I want to use 2 spinners in my application, one shows the countries list, when any country is selected the other spinner should show the list of cities of that country. when city is selected some action is performed. plz help me with some sample code. thanks in anticipation</p>","288479","","","","","2012-10-20 10:41:44","how to use spinner","<android><spinner>","3","1","3","",""
"2399295","1","","","2010-03-08 04:30:52","0","582","<p>My list view is a multiple selection list view. i have to show the selected list view items in one color(say green) and the other items in some other color(red). How to achieve this?</p>","286841","","","","","2010-03-08 06:35:29","Listview item color","<android>","3","0","","",""
"2399504","1","","","2010-03-08 05:41:52","0","369","<p>i want to do some activity on sms after user read it, so how can my background service in android know that particular sms is now read(when my service start work) to react for some task.</p><p>is there system generate any integer when user read sms. if it generate than how will i get?</p><p>if anyone have any idea than share it.</p>","193583","","","","","2010-03-08 11:25:14","any integer return when user read the sms","<android>","1","0","","",""
"2399537","1","","","2010-03-08 05:51:07","15","5672","<p>I use the following code to draw a bitmap during onDraw of a custom View</p><pre><code>Paint p = new Paint(Paint.ANTI_ALIAS_FLAG|Paint.FILTER_BITMAP_FLAG);p.setShadowLayer(3,3,3,0xff000000);Bitmap bmp = BitmapFactory.decodeResource(some drawable jpg);canvas.drawBitmap(bmp,null,new Rect(blah blah),p);</code></pre><p>and the shadow looks funny.  What do I mean funny?  I mean that I get a different shadow then if I was calling canvas.drawRect().  It looks sorta like the android shadow code is treating the bitmap as an alpha channel or something.</p><p>have tried adding p.setColor(0xff000000); and p.setStyle(Paint.Style.FILL); but not difference.</p><p>I guess I could drawRect with shadow on, then drawBitmap with shadow off, but that seems silly as it would be rendering pixels twice.</p>","252871","","","","","2013-09-26 08:09:48","android Paint.setShadowLayer() vs Canvas.drawbitmap() problems","<android>","3","1","1","",""
"2400283","1","2400587","","2010-03-08 09:23:36","5","4945","<p>i made news applicaion in android using RSS feed and now i want to share some news ie i want to upload links from my app to facebook, twitter etc.Is it possible?Thanks</p>","263325","","","","","2011-11-21 14:07:10","How to share web application with facebook, twitter etc","<android>","2","0","6","",""
"2400725","1","","","2010-03-08 10:48:49","1","313","<p>I have developed an application in Rhodes framework and deployed the application in an Android emulator. When I try to access the application i get the following error,<br/><B>SD card error, Application can't access the SD card while it's mounted.<br/>Please unmount the device and stop the adb server before launching the application.</B><br/>I have tried to unmount the SD card in the emulator but I am unable to do that.</p><p>Any help will be of great use.</p><p>Thanks in advance,</p><p>Karthik.</p>","288686","","253056","","2010-03-08 10:54:37","2010-03-09 15:13:57","Android emulator application deployment error","<android><android-emulator>","0","1","1","",""
"2400775","1","2407957","","2010-03-08 10:59:22","1","12115","<p>I have an application that calls the android phone's default camera to take photo the following is my code.</p><pre><code>                Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);            startActivityForResult(intent, TAKE_PICTURE);</code></pre><p>and in the onActivityResult method I am doing the following</p><pre><code>        if ((requestCode == TAKE_PICTURE) &amp;&amp; (resultCode == Activity.RESULT_OK)) {        Uri photoPath = intent.getData();                    // do something with the uri here            }</code></pre><p>The above code works fine on htc Tatto and Sony ericsson's x10 running 1.6 but in on htc G1 running 1.6 the above code causes the following exception</p><pre><code>        03-08 18:54:25.906: ERROR/AndroidRuntime(4344): Uncaught handler: thread main exiting due to uncaught exception    03-08 18:54:25.966: ERROR/AndroidRuntime(4344): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { act=inline-data (has extras) }} to activity  removedjava.lang.NullPointerException    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3224)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3266)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at android.app.ActivityThread.access$2600(ActivityThread.java:116)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at android.os.Handler.dispatchMessage(Handler.java:99)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at android.os.Looper.loop(Looper.java:123)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at android.app.ActivityThread.main(ActivityThread.java:4203)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at java.lang.reflect.Method.invokeNative(Native Method)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at java.lang.reflect.Method.invoke(Method.java:521)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at dalvik.system.NativeStart.main(Native Method)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344): Caused by: java.lang.NullPointerException    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at removed    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at android.app.Activity.dispatchActivityResult(Activity.java:3624)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3220)    03-08 18:54:25.966: ERROR/AndroidRuntime(4344):     ... 11 more</code></pre><p>I have removed the app's package name from the exception</p><p>Any insights into how to solve this problem. Thank you.</p>","254103","","254103","","2010-03-08 11:05:05","2012-04-30 14:52:27","Android Get Image Uri from Camera","<android>","2","0","1","",""
"2400786","1","2414887","","2010-03-08 11:02:45","2","1272","<p>I am trying to add an account to E-mail database ,Below is the way i'm trying ...</p><pre><code>Account account = new Account(mContext);account.setDescription(""acc added thr prog""); account.setAutomaticCheckIntervalMinutes(10);account.setEmail(""UserName@gmail.com"");account.setDraftsFolderName(""Drafts"");account.setOutboxFolderName(""OutBox"");account.setSentFolderName(""Sent"");account.setTrashFolderName(""Trash"");account.setName(""Tester"");account.setNotifyNewMail(true);account.setSenderUri(""smtp+ssl+://userName@gmail.com:PassWord@imap.gmail.com"");account.setStoreUri(""imap+ssl+://userName@gmail.com:PassWord@imap.gmail.com"");account.setDeletePolicy(10);account.setVibrate(true);mPrefer = Preferences.getPreferences(getInstrumentation().getContext());account.save(mPrefer);Email.setServicesEnabled(mInstrumenatation.getTargetContext());</code></pre><p>This code compiles successfully but account will not be created.</p>","237577","","104117","","2010-09-27 16:08:11","2010-09-27 16:08:11","How to successfully add account to android E-mail Database?","<android>","1","2","","",""
"2401009","1","2401562","","2010-03-08 11:47:19","2","9734","<p>I have to create a colored button with gradient fill(starting from the middle of the button along Y axis). If I set the background property of the button to the color I want, I lose the <em>rounded</em> look and feel of a button and also the gradient fill(It looks like a <code>TextView</code> with a background).</p><p>Also, I want this color to change when the user depresses the button. Can i specify this via selector XMLs(<a href=""http://developer.android.com/reference/android/content/res/ColorStateList.html"" rel=""nofollow"">Color State Lists</a>)?</p><p>Any tutorials or links that can help me here is appreciated.</p><p>Thanks.</p>","236128","","","","","2011-03-23 17:52:12","How to gradient fill a button's background?","<android><android-ui>","2","0","1","",""
"2401033","1","2401572","","2010-03-08 11:51:35","5","2127","<p>Here is the standard idiom for transactions: </p><pre><code>   db.beginTransaction();   try {     ...     db.setTransactionSuccessful();   } finally {     db.endTransaction();   }</code></pre><p>I want to add a catch block, and I want to issue a rollback. Is it possible, and at all do I need it?</p>","243782","","","","","2011-07-15 01:56:56","How to roll back a transaction on Android?","<java><android>","1","0","1","",""
"2401048","1","2401149","","2010-03-08 11:54:42","13","13442","<p>Can anyone suggest a good tutorial about how to create custom view?</p>","284372","","1228","","2013-08-09 13:43:09","2013-08-09 13:43:09","Android: Tutorial on Custom View creation","<android><uiview>","2","1","3","2012-08-22 11:52:59",""
"2401140","1","2417814","","2010-03-08 12:12:56","5","20542","<p>i am working on tabactivity.</p><p>i wanna show my tabwidget below the tabcontent(framelayout).</p><p>i done it by setting the tabwiget tab attribute as </p><pre><code>android:gravity=""bottom""</code></pre><p>but the framelayout cant align with those tabs.</p><p><strong>that is the tabs are shown at the bottom of the screen and overlap the framelayout</strong></p><p>how to do that? if set some height value to the framelayout it not optimized for all screens of android. what can i do? any idea??? </p>","267269","","267269","","2013-05-08 06:06:56","2013-08-12 08:35:38","how to set the tabs in the bottom of the screen in android?","<android><android-layout><android-emulator><android-tabs>","6","5","3","",""
"2401389","1","","","2010-03-08 12:58:53","0","279","<p>I'm planning to modify some bits in the platform/frameworks/base project in Android Donut r2. The modifications are very small and goes into java packages <code>android.graphics</code> and <code>android.text</code> (the API isn't affected).</p><p>What jar libraries do I have to copy from the recompiled platform? the modifications are small and I don't want to replace the whole system.. I'm trying to replace specific jar libraries.</p>","287266","","1101070","","2012-03-06 01:00:56","2012-03-06 01:00:56","Modifying platform/frameworks/base package","<java><android><class-library><modify><recompile>","1","0","","",""
"2401442","1","","","2010-03-08 13:09:39","-3","3359","<p>In an Android device: <strong>Where is Email stored</strong> ? Please can anybody tell me?</p><p>Thanx in Advance</p>","282101","","253056","","2010-03-08 13:35:09","2013-03-16 13:27:35","Where is email stored on an Android device?","<android><email>","2","2","","2013-03-16 13:27:22",""
"2401912","1","","","2010-03-08 14:23:07","1","650","<p>So I just recently wrote a class that can get me the contact pictures from all versions of Android, ranging from 1.5 to 2.1 However, it does not work for HTC Hero. Can anyone help me getting the pictures from HTCs crappy contacts-app?</p>","249871","","1101070","","2012-03-03 15:43:56","2012-03-03 15:43:56","Getting contact picture on HTC Hero","<android><contacts>","0","3","","",""
"2402157","1","","","2010-03-08 14:56:03","1","2500","<p>in my app a background service starts and from that service i want to  set Status bar notification, that the service has Started  following is the code :</p><pre><code>    Context context = getApplicationContext();    String ns = Context.NOTIFICATION_SERVICE;    int icon = R.drawable.icon;    CharSequence tickerText = ""Hello"";    long when = System.currentTimeMillis();    Notification notification = new Notification(icon, tickerText, when);    CharSequence contentTitle = ""My notification"";    CharSequence contentText = ""Hello World!"";    Intent notificationIntent = new Intent(MyService.this, MyClass.class);    notificationIntent.setFlags(  Intent.FLAG_ACTIVITY_NEW_TASK);    PendingIntent contentIntent = PendingIntent.getActivity(this,0,notificationIntent,0);    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);   NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);   mNotificationManager.notify(1, notification);</code></pre><p>Notification is displayed in Status bar But whin i click on that MyClass.class is not fired.And in log cat it shows""Input Manager Service   Window already focused ignoring focuson ....""</p><p>so plz provide solution.</p><p>thanks in advance</p>","281307","","","","","2010-03-08 15:19:03","Handling Status Bar notification","<android>","2","0","1","",""
"2402281","1","2402762","","2010-03-08 15:15:31","0","867","<p>At the moment I'm trying to build some integration tests for an android project. I would like to use the same apache http classes I use on the android. Which version is this and can I get a jar of that somewhere? </p><p>Trying to use the jar that comes with android only resolves in Exceptions... But most of the tests won't need running them in the emulator all the time just because I use some apache libraries or do they?</p>","114066","","114066","","2010-03-08 15:20:34","2010-03-08 16:19:23","Which org.apache.http is android using? And where can i get that as a jar?","<android><apache><http>","1","2","1","",""
"2402392","1","2402416","","2010-03-08 15:29:37","0","543","<p>Any one can share the mainfest.xml.</p><p>How to set it? then can remove the label..?Thanks very much</p>","275788","","","","","2010-03-08 15:43:16","How to set the mainfest.xml to remove the default label","<android>","2","0","","",""
"2402601","1","2403023","","2010-03-08 15:56:54","0","398","<p>I'm trying to authenticate to a web server from an android class with the org.apache.http.HttpClient. </p><p>How can I do this? The code for my connection is:</p><pre><code>HttpClient httpClient = new DefaultHttpClient();HttpGet httpGet = new HttpGet(""url"");HttpResponse response = null;try {    response = httpClient.execute(httpGet);} catch (ClientProtocolException e) {   ...} catch (IOException e) {   ...}Log.i(""httptest"", response.getStatusLine().toString());HttpEntity entity = response.getEntity();</code></pre><p><strong>Edit</strong></p><p>I want to do a basic authentication with username and password</p>","114066","","114066","","2010-03-10 10:03:32","2010-03-10 10:03:32","How to authorize to a web server with android and the org.apache.http classes?","<android><apache><http>","1","0","","",""
"2402612","1","","","2010-03-08 15:58:33","0","1326","<p>I am just getting started with the Android SDK and I had a quick question. I am trying to set up a ListView with a rectangle of color on the left and then a bit of text for each row. I also want to make it so I can click each entry in the list and open a new activity to display some information (similar to the contact list). Anyone have any examples to help me out?</p>","288937","","164901","","2010-03-08 16:53:31","2010-03-08 19:11:23","Using ListViews on Android?","<android><listview>","2","0","1","",""
"2402639","1","2403111","","2010-03-08 16:01:53","7","7072","<p>I want to create separate folders for my layouts, like this in my resource directory:</p><pre><code>layout-landlayout-port</code></pre><p>this is ok, but this:</p><pre><code>layout-small-landlayout-small-port</code></pre><p>or</p><pre><code>layout-land-smalllayout-port-small</code></pre><p>Results in:'Invalid resource directory name'</p><p>What gives?</p>","278431","","","","","2013-02-08 11:08:11","How to create layout-small-land folder?","<java><android><layout>","4","0","1","",""
"2403228","1","2403282","","2010-03-08 17:24:29","5","1880","<p>When you createa a PreferenceScreen on Android, your application creates a default SharedPreferences file for the settings.I want to read this name, or get a reference without specifing the name.</p><p>Currently I use:</p><pre><code>SharedPreferences prefs = ctx.getSharedPreferences(""prefs"", 0);SharedPreferences.Editor ed=prefs.edit();</code></pre><p>But this returns another copy of the preference. When I checked the folder in /data/data/myapk/shared_prefs</p><p>I see two files, one named prefs.xml and the other is my [package name]_preferences.xml (this was created by the PreferenceActivity);</p><p>How do I get an instance of the shared preference with the usage of the default file name, so I should not mention a name for it?</p>","243782","","","","","2010-03-08 17:32:01","Read SharedPreferences when you haven't set the name of the file","<android><preference><sharedpreferences>","1","0","","",""
"2403416","1","2404967","","2010-03-08 17:53:42","3","3049","<p>I have written a very simple game with some simple animations, but I've noticed that when the phone checks email, or several other apps are running, the animations that update in my thread start behaving slowly or choppy.</p><p>This is a problem as the game mechanic requires some careful timing of your screen touches based on the animations.  So if it starts behaving erratically, the game doesn't really work well - and isn't much fun.</p><p>Is there a way to prevent this?  Can my threads have a higher priority when they need to run?</p>","179518","","","","","2010-05-17 22:38:26","Android thread problems due to background processes","<android><multithreading>","3","0","","",""
"2403604","1","","","2010-03-08 18:16:08","15","13843","<p>I'm a new user to this interesting forum! </p><p>I want start developing an application for android and before starting i want learn about some android features... </p><p>The first android feature is how to correlate finger motion on the screen with java... </p><p>Are there any source code examples that show how to draw with your finger on an android screen? </p><p>Can you suggest a good place for me to download an example? </p><p>thanks</p>","289050","","26853","","2010-03-08 18:28:53","2010-03-08 19:00:17","Fingertip drawing applications on Android?","<java><android>","2","0","8","",""
"2403632","1","2418314","","2010-03-08 18:19:53","128","107315","<p>I'm showing an input box using <code>AlertDialog</code>. The <code>EditText</code> inside the dialog itself is automatically focused when I call <code>AlertDialog.show()</code>, but the soft keyboard is not automatically shown.</p><p>How do I make the soft keyboard automatically show when the dialog is shown? (and there is no physical/hardware keyboard). Similar to how when I press the Search button to invoke the global search, the soft keyboard is automatically shown.</p>","11238","","26853","","2010-03-08 18:22:35","2013-09-05 22:55:20","Android: show soft keyboard automatically when focus is on an EditText","<android><keyboard><edittext><soft-keyboard>","11","1","39","",""
"2403691","1","","","2010-03-08 18:26:51","5","431","<p>I just switched the way my Android project is being built and non of my unit tests work any more...I get errors like </p><pre><code>WARN/dalvikvm(575): VFY: unable to resolve static field X in .....WARN/dalvikvm(575): VFY: unable to find class referenced in signature</code></pre><p>These errors only come from my Unit Tests, where classes defined in it can't even see other classes defined in the unit test.</p><p>Before each project had its own directory with copies of the 3rd party jar files. I've read around that Dex does weird things with references but haven't been able to figure out how to fix this problem. Is there a better way to do this? I would love to see an example of a large Android workspace where there are multiple projects, jar references, etc...</p><p>Is it possible to fix this with an Order/Export tweak ?</p><p>The project is structured like this:</p><ul><li>Eclipse Workspace (PROJECT_HOME classpath variable)</li><li>lib<ul><li>3rd-party jars</li><li>android.jar</li></ul></li><li>Java Project A<ul><li>Looks in PROJECT_HOME</li></ul></li><li>Java Project B<ul><li>Looks in PROJECT_HOME</li><li>Depends on project A</li></ul></li><li>Android Project<ul><li>Depends on A &amp; B</li><li>Looks in PROJECT_HOME</li></ul></li><li>Android Test Project<ul><li>Depends on A , B, Android Project</li><li>Looks in PROJECT_HOME</li></ul></li></ul>","36285","","82118","","2010-04-20 19:28:56","2011-07-10 22:44:14","Android Unit Testing - Resolution & Verification Problems","<android><unit-testing><build><junit>","1","2","","",""
"2403693","1","2403723","","2010-03-08 18:27:14","3","805","<p>I'm trying to create a shortcut on the home screen that, when pressed, will start a service instead of an activity.</p><p>Is it possible? How?</p><p>Thanks!</p>","7748","","","","","2010-03-08 21:49:35","Is it possible to start a service with a shortcut?","<android>","2","1","1","",""
"2403759","1","2404044","","2010-03-08 18:37:23","6","1734","<p>Is it possible to create an IntentFilter in android that matches ALL intents that are Broadcasted on the phone (perhaps by way of using a BroadcastReceiver)? I.E. the ones I see in ddms when I use the phone, under the ActivityManager tag? After digging through the documentation, and looking at the framework source, I am left to think it can't be done? That you must specify some sort of data, to paraphrase the docs, ""some sort of data must be specified, or else you'll only get intents with no data"". The app I am writing needs to know about every app that is started on the system. So far, the only way I have been able to do this is by polling ActivityManager. It seems the best way would be to have an event driven solution, using whatever underlying logic ActivityManager uses, but it's all greek to me inside of the ActivityManager.java framework source, and seems like a lot of the stuff underneath (if not ALL) is deliberately encapsulated from me.</p><p>Any ideas?</p>","","user132014","","","","2010-03-08 19:21:55","Create an IntentFilter in android that matches ALL intents","<android>","1","1","2","",""
"2403939","1","","","2010-03-08 19:07:04","-1","478","<p>From our android app I launch Youtube app with the proper video id. This works well across all devices. On Nexus One the youtube app defaults to using low quality video. I have added &amp;fmt=18 in the url (for eg: <a href=""http://www.youtube.com/watch?v=NsjadfLYnD4&amp;feature=youtube_gdata&amp;fmt=18"" rel=""nofollow"">http://www.youtube.com/watch?v=NsjadfLYnD4&amp;feature=youtube_gdata&amp;fmt=18</a> , see this blog for details <a href=""http://blog.jimmyr.com/High_Quality_on_Youtube_11_2008.php"" rel=""nofollow"">http://blog.jimmyr.com/High_Quality_on_Youtube_11_2008.php</a>) which should have forced a high quality video but doesn't.</p><p>Anyone know a work around for this ? The screen resolution on nexus is really beautiful it saddens me that I can't make use of this to play hq videos.</p>","123926","","1101070","","2012-03-07 02:53:01","2012-03-07 02:53:01","Nexus One and High Quality youtube video","<android><youtube-api><nexus-one>","1","0","","",""
"2404037","1","2404305","","2010-03-08 19:21:02","2","3225","<p>To use as an example: lets say that I have 2 <a href=""http://developer.android.com/reference/android/widget/EditText.html"" rel=""nofollow"">EditText</a>s and one Button that I'm using as a login form. I want the EditTexts to be the same size, one after the other, with the login <a href=""http://developer.android.com/reference/android/widget/Button.html"" rel=""nofollow"">Button</a> half their widths. Something like this:</p><p><img src=""http://imgur.com/P5Z1x.png"" alt=""example login screenshot""></p><p>The only way that I've been able to find to make the button 1/2 the width (but still maintain it's dynamic sizing) is to use a <a href=""http://developer.android.com/reference/android/widget/TableLayout.html"" rel=""nofollow"">TableLayout</a> with an empty view as the first field. Something like this:</p><pre><code>    &lt;TableLayout        android:stretchColumns=""0,1""        android:shrinkColumns=""0,1""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:layout_below=""@id/login_EditText_password""&gt;        &lt;TableRow&gt;            &lt;TextView                android:layout_width=""fill_parent""                android:layout_height=""wrap_content"" /&gt;            &lt;Button                 android:text=""@string/login_login""                 android:id=""@+id/login_Button_login""                 android:layout_width=""fill_parent""                 android:layout_height=""wrap_content"" /&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;</code></pre><p>That feels like a god-awful hack and there has GOT to be a better way. Do you know of one?</p>","76835","","","","","2010-03-08 21:02:16","Dynamically sizing Views as a percentage (or similar)?","<android><gui>","1","1","1","",""
"2404210","1","14225490","","2010-03-08 19:47:07","0","1231","<p>TelephonyManager.getNetworkType() returns one of the constant values.</p><p>It appears that the constant values have an integer order, by possible bearer link speed.</p><p>I know using constant values used in the following manner is generally bad,</p><p>however could one use this to determine a basic cutoff for application functionality and have it work between API levels? (in API-v1 there was nothing above 0x03)</p><pre><code>if( telephonyManager.getNetworkType() &gt; TelephonyManager.NETWORK_TYPE_EDGE ){     return ""3G! party on!"";}else if( telephonyManager.getNetworkType() &gt; TelephonyManager.NETWORK_TYPE_UNKNOWN ){     return ""2G, OK. just don't go nuts!"";}else {     return ""No data sorry""}</code></pre>","289057","","","","","2013-01-08 22:56:15","Android TelephonyManager.getNetworkType() returned constant values in bearer speed order?","<android>","2","0","","",""
"2404839","1","2404863","","2010-03-08 21:20:04","0","415","<p>I would like to reuse the exact same font-face etc... like Android uses in the PreferenceScreen</p><p>Here is a screenshot I am looking to reuse the title, and the summary style from these views.</p><p><img src=""http://www.eyeonweb.com/android/images/l2.png"" alt=""alt text""></p>","243782","","","","","2010-03-08 21:23:16","How to get the font face size and formatting of a native element in Android application?","<android><views><android-styles>","1","0","","",""
"2404898","1","2404916","","2010-03-08 21:29:07","4","4505","<p>is it possible to create a menu similar to the one that appears in home screen of Android?<img src=""http://i48.tinypic.com/a5hxrr.png"" alt=""alt text""><img src=""http://i48.tinypic.com/2q3ynna.png"" alt=""alt text""></p><p>Thanks</p>","258863","","","","","2010-03-08 21:32:25","Android Slide Menu as Home","<android><menu>","1","0","","",""
"2404946","1","2405454","","2010-03-08 21:37:18","1","1002","<p>I am creating a simple Android widget with a typical usecase of having many instances of it running at once.  </p><p>Using the stock preferencesmanager, it seems each instance of the widget shares the same preferences.</p><p>Is there any way to not have this happen?</p><p>Thanks!</p>","289182","","","","","2010-03-08 22:59:52","Multiple instances of the same android widget: Anyway way to have instance specific preferences?","<android>","1","0","","",""
"2405080","1","2405464","","2010-03-08 21:55:11","13","3178","<p>Would anyone know how to test for the appearance of a Toast message on an Activity?</p><p>I'm using code similar to what the OP posted on <a href=""http://stackoverflow.com/questions/1759626/how-do-you-test-an-android-application-across-multiple-activities"">this question</a> for testing my program flow from one activity to the next. I'd also like to be able to test for toast messages on particular activities.</p>","219525","","","","","2012-05-16 19:08:19","How to test for the appearance of a Toast message","<android><functional-testing>","3","0","1","",""
"2405120","1","11821596","","2010-03-08 22:01:31","34","41270","<p>I would like to pass some variables in the constructor of my ListActivity  </p><p>I start activity via this code:</p><pre><code>startActivity(new Intent (this, viewContacts.class));</code></pre><p>I would like to use similar code, but to pass two strings to the constructor. How is possible?</p>","243782","","","","","2014-01-22 15:08:28","How to start an Intent by passing some parameters to it?","<android><constructor><android-intent>","2","1","11","",""
"2405320","1","2405400","","2010-03-08 22:35:27","0","984","<p>Is there an equivalent to Java's null layout in Android?  Basically I want to specify the x and y coordinates of each component and not have the layout manager choose where they go.  They will be within a scroll pane so it doesn't matter whether they fit on the screen.</p><p>I know null layouts are generally not a good idea but I have a special case where I need it.  I'm porting a Java TV guide app and the program grid is made up of JLabels.  The program dynamically generates them all, setting the x and y coords based on start/end time and channel.  Each program could start and end at any time so as far as I know a table layout won't work.</p>","289204","","","","","2010-03-08 22:50:59","Possible to use null layout in Android?","<android>","1","0","","",""
"2405411","1","2405786","","2010-03-08 22:53:49","1","26837","<p>Ok, im fairly new to android but i have managed to teach myself the basics, i am making an app where you press a button , and a new screen opens and it shows a randomly generated number, the only problem is i dont know how to generate and display the random number, i have been searching the web for ages and have only found little snippets of information , that dosent really make sense to me. :/</p><p>If someone could help me , or even give me just a little bit of info that should guide me in the right direction it would be great</p><p>EDIT: (for the comment below)</p><pre><code>    super.onCreate(savedInstanceState);    TextView tv = new TextView(this);    tv.setText(""Random Number : "" + Math.random());    int random = (int)Math.ceil(Math.random()*100);    setContentView(tv);</code></pre><p>Thats the code i have , where have i gone wrong ^^^^ :/</p>","289230","","289230","","2010-03-09 23:33:38","2013-01-24 07:27:09","How to generate a random number, then display it on screen?","<android><random>","5","4","","",""
"2405614","1","2405627","","2010-03-08 23:35:25","5","8553","<p>I have the following layout defined for one of my Activities:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout android:id=""@+id/TableLayout01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;TableRow android:id=""@+id/TableRow01"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;        &lt;EditText android:text=""Resource Name"" android:id=""@+id/ResourceName"" android:lines=""1"" android:isScrollContainer=""false""&gt;&lt;/EditText&gt;    &lt;/TableRow&gt;    &lt;TableRow android:id=""@+id/TableRow02"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;        &lt;Button android:id=""@+id/Tile"" android:text=""Tile""&gt;&lt;/Button&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>The layout renders almost correctly, the only problem is that my text box and my button aren't occupying the full width of their respective rows.</p><p>I've tried specifying <code>fill_parent</code> for the layout width properties, but to no avail, they still only occupy roughly half of the screen.</p><p>Documentation overall for Android so far has been great, but there are a few scenarios like this one where I hit an invisible wall!  Thanks for all the help!</p>","128991","","","","","2013-05-31 17:40:25","How do I make Views fill the full width of their parent in my Android app?","<android><layout><width><parent>","2","0","","",""
"2405775","1","2405865","","2010-03-09 00:19:26","0","848","<p>I'm trying to make a GUI program with the Android SDK, using their Lunar Lander example as a significant self-teaching tool in the process.  I've noticed their sprites' images' backgrounds, which were at least usually pure white, did not show up in their program.  I want to ask how they did that, since their site doesn't explain simple things very well.</p><p>I've managed to pull that off before on another GUI SDK, wherein all I had to do was to call a function and pass it a few floats to define a certain color, and until my code told it to do otherwise, that function would make sure that that particular color in my sprites' images was totally transparent.  </p><p>However I've wrestled with the Lunar Lander example and getting my own program to show some custom graphics for a week or two now, and I haven't noticed any such function call in the Lunar Lander example.  I tried to look for it, but I did not find anything.  I've tried to Google some tutorial or other reference material, but what I've found so far is just straying off into unrelated areas and totally dodging this EXTREMELY important lesson on the SDK's basics.  </p><p>Any ideas?  Thanks!</p>","279112","","","","","2010-03-09 00:36:05","How did the Lunar Lander example make the image backgrounds transparent?","<android><gui>","2","1","","",""
"2406140","1","","","2010-03-09 01:52:39","3","684","<p>I am looking to profile my web application on Android for starts...what is the best way to get the kind of information that a tool like Web Inspector would give me on the desktop?  Since I cannot use Web Inspector or Speed Tracer on the mobile device...how can I get such data/info ?</p>","70711","","","","","2012-06-10 08:25:47","What is the best way to profile a mobile Web Application?","<android><mobile><web-applications>","2","1","0","",""
"2406172","1","2407119","","2010-03-09 02:00:51","8","20847","<p>How can I prevent my bitmap from being scaled automatically in an ImageView or ImageButton if the view or button is stretched using ""fill_parent"" or using ""weight""? </p><p>This will be useful, for example, to create a 4-button toolbar at the top of the screen where the buttons are equally spaced, but the images inside the buttons keep getting streched even if I use scaleType=""center"", which should prevent scaling according to the doc, but it doesn't. </p><p>Any insight is appreciated! </p><p>Thanks, </p>","277827","","","","","2012-01-04 11:04:19","Android: How to prevent image from being scaled in ImageView or ImageButton?","<java><android><imagebutton><imageview>","3","0","5","",""
"2406449","1","2406790","","2010-03-09 03:29:09","57","33208","<p>Does setWidth(int pixels) use device independent pixel or physical pixel as unit?For example, does setWidth(100) set the a view's width to 100 dips or 100 pxs?</p><p>Thanks.</p>","256239","","218717","","2011-05-03 06:12:30","2013-02-17 14:15:27","Does setWidth(int pixels) use dip or px?","<android><width><pixels><units-of-measurement><dip>","3","0","46","",""
"2406628","1","2408958","","2010-03-09 04:12:49","3","2400","<p>Is there a way to switch views in a ViewFlipper just like on Home screen, where we have small dots at the bottom of the screen and on clicking on them we can switch views.</p><p>Thanks,Farha</p>","285052","","","","","2011-08-30 18:28:25","Switching views in ViewFlipper","<android>","2","0","3","",""
"2406867","1","2407066","","2010-03-09 05:25:55","2","4094","<p>hi  Is there any way  to intercept incomming calls/sms (to block or unblock it) on the basis of mobile numbers which are added to screening list.Thanks in Advance...</p>","281307","","","","","2012-09-22 19:57:21","Is there any way to Intercept incoming calls/sms to either block/unblock it?..Android","<android>","3","0","3","",""
"2406937","1","2408987","","2010-03-09 05:48:31","5","20869","<p>I cant find a way to save the checkbox state when using a Cursor adapter. Everything else works fine but if i click on a checkbox it is repeated when it is recycled. Ive seen examples using array adapters but because of my lack of experience im finding it hard to translate it into using a cursor adapter. Could someone give me an example of how to go about it. Any help appreciated.  </p><pre><code>private class PostImageAdapter extends CursorAdapter {    private static final int s = 0;    private int layout;    Bitmap bm=null;    private String PostNumber;    TourDbAdapter mDbHelper;    public PostImageAdapter (Context context, int layout, Cursor c, String[] from, int[] to, String Postid) {        super(context, c);        this.layout = layout;        PostNumber = Postid;     mDbHelper = new TourDbAdapter(context);     mDbHelper.open();    }    @Override    public View newView(Context context, final Cursor c, ViewGroup parent) {     ViewHolder holder;     LayoutInflater inflater=getLayoutInflater();     View row=inflater.inflate(R.layout.image_post_row, null);          holder = new ViewHolder();   holder.Description = (TextView) row.findViewById(R.id.item_desc);   holder.cb = (CheckBox) row.findViewById(R.id.item_checkbox);   holder.DateTaken = (TextView) row.findViewById(R.id.item_date_taken);   holder.Photo = (ImageView) row.findViewById(R.id.item_thumb);   row.setTag(holder); int DateCol = c.getColumnIndex(TourDbAdapter.KEY_DATE); String Date = c.getString(DateCol); int DescCol = c.getColumnIndex(TourDbAdapter.KEY_CAPTION); String Description = c.getString(DescCol);     int FileNameCol = c.getColumnIndex(TourDbAdapter.KEY_FILENAME);  final String FileName = c.getString(FileNameCol); int PostRowCol = c.getColumnIndex(TourDbAdapter.KEY_Post_ID);  String RowID = c.getString(PostRowCol); String Path = ""sdcard/Tourabout/Thumbs/"" + FileName + "".jpg"";     Bitmap bm = BitmapFactory.decodeFile(Path, null);  holder.Photo.setImageBitmap(bm); holder.DateTaken.setText(Date); holder.Description.setText(Description); holder.cb.setOnClickListener(new OnClickListener() {      @Override public void onClick(View v) {    CheckBox cBox = (CheckBox) v;    if (cBox.isChecked()) {      mDbHelper.UpdatePostImage(FileName, PostNumber);    }     else if (!cBox.isChecked()) {          mDbHelper.UpdatePostImage(FileName, """");    }  }});return row;};    @Override    public void bindView(View row, Context context, final Cursor c) {       ViewHolder holder;     holder = (ViewHolder) row.getTag();         int DateCol = c.getColumnIndex(TourDbAdapter.KEY_DATE);         String Date = c.getString(DateCol);         int DescCol = c.getColumnIndex(TourDbAdapter.KEY_CAPTION);         String Description = c.getString(DescCol);             int FileNameCol = c.getColumnIndex(TourDbAdapter.KEY_FILENAME);       final String FileName = c.getString(FileNameCol);      int PostRowCol = c.getColumnIndex(TourDbAdapter.KEY_Post_ID);          String RowID = c.getString(PostRowCol);      String Path = ""sdcard/Tourabout/Thumbs/"" + FileName + "".jpg"";             Bitmap bm = BitmapFactory.decodeFile(Path, null);         File x = null;         holder.Photo.setImageBitmap(bm);         holder.DateTaken.setText(Date);         holder.Description.setText(Description);         holder.cb.setOnClickListener(new OnClickListener() {          @Override        public void onClick(View v) {         CheckBox cBox = (CheckBox) v;         if (cBox.isChecked()) {               mDbHelper.UpdatePostImage(FileName, PostNumber);         }          else if (!cBox.isChecked()) {                   mDbHelper.UpdatePostImage(FileName, """");         }        }       });    }}  static class ViewHolder{  TextView Description;  ImageView Photo;  CheckBox cb;  TextView DateTaken;}}</code></pre>","289387","","23354","","2010-03-09 12:35:51","2013-09-23 18:59:18","Android save Checkbox State in ListView with Cursor Adapter","<android><listview><checkbox><state>","6","0","5","",""
"2407063","1","","","2010-03-09 06:31:30","3","261","<p>I'm looking at market stats here for sdk distribution:</p><p><a href=""http://developer.android.com/resources/dashboard/platform-versions.html"" rel=""nofollow"">http://developer.android.com/resources/dashboard/platform-versions.html</a></p><p>saying that 31% of marketplace users are still running 1.5. Is it true that an OS update went out for G1 and myTouch users? I'm wondering why so many people are still running 1.5 if so? Just curious because I'd like to use th setView() method introduced in 1.6 for TabSpec, but not if so many people are still using 1.5, I might have to roll my own control,</p><p>Thanks</p>","246114","","","","","2010-03-26 18:39:51","Lots of users still using 1.5?","<android>","4","5","","",""
"2407108","1","","","2010-03-09 06:45:10","0","3383","<p>i asked so many question regarding my title but i could not get my proper answer till yet.I need to implement androd's menu feature in my application ie when we goes to gallery in android phone, when we press menu than it comes with lots of option like share...etc.My question is can i implement same menu feature in my application? It is possible or not?Thanks</p>","263325","","","","","2010-03-09 12:26:59","share feature of menu in android application","<android>","2","3","1","",""
"2407200","1","","","2010-03-09 07:07:20","1","300","<p>I'm making a game in Android and I'm trying to add a set of menu screens. Each screen takes up the whole display and has various transitions available to other screens. As a rough summary, the menu screens are:</p><ol><li>Start screen</li><li>Difficult select screen</li><li>Game screen.</li><li>Pause screen.</li><li>Game over screen.</li></ol><p>And there are several different ways you can transition between screen:</p><p>1 -> 2</p><p>2 -> 3</p><p>3 -> 4 (pause game)</p><p>4 -> 1 (exit game)</p><p>4 -> 3 (resume game)</p><p>3 -> 5 (game ends)</p><p>Obviously, I need some stored state when moving between screens, such as the difficulty level select when starting a game and what the player's score is when the game over screen is shown.</p><p>Can anyone give me some advice for the easiest way to implement the above screens and transitions in Android? All the create/destroy/pause/resume methods make me nervous about writing brittle code if I'm not careful.</p><p>I'm not fond of using an Activity for each screen. It seems too heavy weight, having to pass data around using intents seems like a real pain and each screen isn't a useful module by itself. As the ""back"" button doesn't always go back to the previous screen either, my menu layout doesn't seem to fit the activity model well.</p><p>At the moment, I'm representing each screen as an XML layout file andI have one activity. I set the different buttons on each layout to call setContentView to update the screen the main activity is showing (e.g. the pause button changes the layout to the pause screen). The activity holds onto all the state needed (e.g. the current difficulty level and the game high score), which makes it easy to share data between screens. This seems roughly similar to the LunarLander sample, except I'm using multiple screens.</p><p>Does what I have at the moment sound OK or am I not doing things the typical Android way? Is there a class I can use (e.g. something like ViewFlipper) that could make my life easier?</p><p>By the way, my game screen is implemented as a SurfaceView that stores the game state. I need the state in this view to persist between calls to setContentView (e.g. to resume from paused). Is the right idea to create the game view when the activity starts, keep a reference to it and then use this reference with setContentView whenever I want the game screen to appear?</p>","289416","","289416","","2010-03-09 11:46:22","2010-03-09 12:05:54","When to use new layouts and when to use new activities?","<java><android>","1","0","1","",""
"2407281","1","","","2010-03-09 07:26:39","26","38957","<p>ok,</p><p>what i am trying to do is to embed a custom view in the default layout main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;com.lam.customview.CustomDisplayView        android:id=""@+id/custom_display_view1""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" /&gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;Button            android:id=""@+id/prev""            android:layout_width=""0dip""            android:layout_height=""wrap_content""            android:layout_weight=""50""            android:textAppearance=""?android:attr/textAppearanceSmall""            android:text=""@string/prev"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>as you can see the class is called com.lam.customview.CustomDisplayView, with the id of custom_display_view1.</p><p>now in the com.lam.customview.CustomDisplayView class, i want to use another layout called custom_display_view.xml because i don't want to programmatically create controls/widgets.  </p><p>custom_display_view.xml is just a button and an image, the content of which i want to change based on certain conditions:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;TextView     android:id=""@+id/display_text_view1""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;    &lt;ImageView     android:id=""@+id/display_image_view1""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;    &lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre><p>i tried to do:</p><p>1)     </p><pre><code>public CustomDisplayView(Context context, AttributeSet attrs) {    super(context, attrs);    try    {        // register our interest in hearing about changes to our surface        SurfaceHolder holder = getHolder();        holder.addCallback(this);        View.inflate(context, R.layout.custom_display_view, null);</code></pre><p>...</p><blockquote>  <p>but got this error, ""03-08 20:33:15.711: ERROR/onCreate(10879): Binary XML file line #8: Error inflating class java.lang.reflect.Constructor  "".</p></blockquote><p>2)     </p><pre><code>public CustomDisplayView(Context context, AttributeSet attrs) {    super(context, attrs);    try    {        // register our interest in hearing about changes to our surface        SurfaceHolder holder = getHolder();        holder.addCallback(this);        View.inflate(context, R.id.custom_display_view1, null);</code></pre><p>...</p><blockquote>  <p>but got this error, ""03-08 20:28:47.401: ERROR/CustomDisplayView(10806): Resource ID #0x7f050002 type #0x12 is not valid  ""</p></blockquote><p>also, if i do it this way, as someone has suggested, it's not clear to me how the custom_display_view.xml is associated with the custom view class.</p><p>thanks.</p>","270811","","12707","","2010-03-09 07:29:04","2012-05-02 10:34:11","custom view with layout","<android><layout><view>","4","2","3","",""
"2407394","1","","","2010-03-09 07:50:43","0","141","<p>It would be really nice if there is some easy way to see what have changed in a certain class (or other file) between two releases (1.6 &amp; 2.1 for example). Does anyone know how to do this?</p><p>A way to do it online would be great but downloading the code and checking offline would be ok as well.</p>","265023","","","","","2010-03-09 11:19:07","Is there any way to see the diff on a file between two different Android releases?","<android><git>","3","4","","",""
"2407498","1","2408921","","2010-03-09 08:12:37","0","622","<p>I have a TabActivity, and the tabs point to sub activities. Is there a way I can send a 'message' to those child activities? I just want to pass a string across, not sure if this is possible. </p><p>I have some data being fetched by the parent TabActivity, and the child tabs can't do anything useful until the parent is done fetching. When fetching is complete, I'd like to pass that data to the child activities so they can do something useful with it.</p><p>Notmally I'd set the data to be passed in the Intent when first creating the activity, but in this case I can't do that.</p><p>Thanks</p>","246114","","","","","2010-03-09 12:23:19","Sending data between activities within my app?","<android>","2","0","","",""
"2407565","1","2408164","","2010-03-09 08:30:41","26","12412","<p>How can I determine/calculate the byte size of a bitmap (after decoding with BitmapFactory)?I need to know how much memory space it occupies, because I'm doing memory caching/management in my app. (file size is not enough, since these are jpg/png files)</p><p>Thanks for any solutions!</p><p>Update: getRowBytes * getHeight might do the trick.. I'll implement it this way until someone comes up with something against it.</p>","289463","","289463","","2010-03-09 09:55:07","2013-02-09 12:16:51","Bitmap byte-size after decoding?","<android><bitmap>","1","0","5","",""
"2407719","1","2407772","","2010-03-09 09:00:47","2","8496","<p>I have a MySql database that stores a timestamp for each record I insert.  I pull that timestamp into my Android application as a string.  My database is located on a server that has a TimeZone of CST.  I want to convert that CST timestamp to the Android device's local time.</p><p>Can someone help with this?</p>","535363","","","","","2011-08-19 19:36:14","Android Convert Central Time to Local Time","<java><android><timezone><timestamp>","4","2","3","",""
"2407970","1","","","2010-03-09 09:42:09","0","208","<p>Is it possible to determine the moment of switching of certain Activity from foreground to background and vice versa? This activity should run in the separate process.</p><p>I need to write the application that collects some statistics from using of big set of applications (app names read from configuration file). My application works as Service and should remember moments of switching of activities between foreground and background.Set of applications is sufficiently big and most part of these applications will never work on certain phone.</p>","289488","","","","","2010-07-05 19:00:14","Monitoring of Activities visibility","<android>","2","0","","",""
"2408041","1","2408545","","2010-03-09 09:53:30","2","932","<p>Is it possible for my android application to dynamically adjust the no of column and no of row of my TableLayout based on orientation?</p><p>For example, when in landscape mode, the TableLayout is 3x2 and whenin portrait mode, the TableLayout is 2x3?</p><p>Thank you.</p>","286802","","","","","2010-03-09 11:14:22","Dynamically adjust the column and row of a Table Layout based on orientation","<android>","1","0","","",""
"2408708","1","2615650","","2010-03-09 11:47:53","1","2129","<p>I have a screen where you can enable/disable modules for my Android application.</p><p>For this I use a CheckboxPreference screen. This is all good, but the summary field gets cut off if longer descriptions are added than 2 lines.</p><p>Suppose I have 4-5 lines of description available for each module, I would like to display this in a helper window. </p><p>I tried to bind a click event to the CheckboxPreference, but that fires for the whole line, so not only when the checkbox is clicked, and more, wherever you click on the line the checkbox is toggled.</p><p>So now I am wondering if this can be fixed. So if the user needs more info, just taps the text and the helper opens up, and if want to toggle the settings it taps the checkbox.</p><p>How would you do it? I am open to other ideas too, if they do work.</p>","243782","","243782","","2010-03-09 12:18:40","2012-04-13 08:09:05","Show extra info for Preference screens when CheckboxPreference summary field is not enough long?","<android><views><preferences><checkboxpreference>","3","0","4","",""
"2408859","1","","","2010-03-09 12:15:05","1","673","<p>Hey, guys!I am working on a project using HTC magic which requires the data from the electronic compass, including both the accelerometer and magnetic sensor. But I find that there is a significant latency between the move of the phone and the trigger of the sensorChanged event. In other word, the acceleration and magnetic data obtained from sensor are updated about half of a second after my motion. And I have several questions about the problem as follow.</p><ol><li><p>Are the orientation data computed by the acceleration and magnetic data? Or are there a physical sensor for orientation?</p></li><li><p>Does the latency result from the android API (using the event) or the physical limitation of the electronic compass?</p></li><li><p>It is said that the model of the electronic compass is AK8976A from Asahi Kasei. Does anybody have the datasheet or know the frequency of the sampling?</p></li><li><p>Any idea to improve the real-time experience?</p></li></ol><p>Thank you in advance!</p>","289628","","","","","2011-12-28 20:03:34","Latency when getting sensor data from gPhone?","<android>","2","0","1","",""
"2409063","1","2409461","","2010-03-09 12:47:57","3","16498","<p>i would like to show a modal progress ""wheel"" overlay on my view.</p><p>The ProgressDialog comes closs, but i do not want the dialog background or border.</p><p>i tried setting the background drawable of the dialog window:</p><pre><code>this.progressDialog = new ProgressDialog(Main.this);this.progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));this.progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);this.progressDialog.setCancelable(false);this.progressDialog.setIndeterminate(true);this.progressDialog.show();</code></pre><p>but to no avail (i.e. still looks the same as without the ...setBackgroundDrawable code).</p><p>Any advice please? TIA!</p>","254959","","","","","2013-06-23 20:47:01","Android: How to Create a Modal Progress ""Wheel"" Overlay?","<android><progressdialog>","4","1","3","",""
"2409109","1","2409124","","2010-03-09 12:54:10","1","239","<p>My question is quite simple. Is it possible to inactivate all toasts of an application by setting a preference of something like that. Is there for example a method which does that in the SDK?</p>","263521","","114066","","2010-03-09 18:02:03","2010-03-09 18:02:03","Deactivate toast for an android application","<android><toast>","1","0","","",""
"2409125","1","","","2010-03-09 12:56:54","0","1007","<p>Is it possible in Android to programatically change the phone internet settings (proxies also), email settings and other similar? Is there some kind of registry?</p><p>and what about getting the lost/received/etc calls? is it possible to get that info?</p>","289662","","881229","","2014-03-18 21:46:11","2014-03-18 21:46:11","Android: Programatically changing phone settings and getting lost calls","<android><registry>","1","0","","",""
"2409126","1","2410271","","2010-03-09 12:57:14","9","13028","<p>I am working on an Android application that will need several entries (a single table, with 1000-10000 rows) populated in that app's database before the user can use that app.  I've looked around some tutorials and I am unsure of the best way to do this.  Should I just check if the database exists each time the app is started and, if it isn't there, create it and insert the thousands of records I need?  Or is there a better way to handle this problem?  Ideally, it could be included as part of the app's install process, but I'm not sure if this is possible.  Any feedback would be greatly appreciated.</p>","143310","","","","","2012-02-14 20:31:13","Android Pre-Populated Database","<database><android>","4","5","3","",""
"2409297","1","","","2010-03-09 13:27:29","1","1119","<p>in my app i m calling built in camera for capturing picture but i want to set that picture into an image view following is the code . so what code should i add to it to set the picture into imageview.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Intent intent = new Intent(""android.media.action.IMAGE_CAPTURE"");    startActivityForResult(intent, 0);}@Overridepublic void onActivityResult(int requestCode, int resultCode, Intent data) {if (resultCode == Activity.RESULT_OK &amp;&amp; requestCode == 0) {String result = data.toURI();// ...}}</code></pre><p>Thanks in advance</p>","281307","","","","","2010-03-14 01:44:36","setting picture captured by built-in camera into an ImageView","<android><camera><imageview>","1","0","1","",""
"2409521","1","2409959","","2010-03-09 14:02:50","1","3557","<p>I tried to use a background (480x320) for my tab content. Using a xml as drawable, I should be able to scale the image. This works fine outside the tabhost/tabactivity. If I try to use it inside the tabcontent, the scaleType doesn't work. He ignores every scaleType I tried.</p><p>tabcontent:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/background""&gt;    &lt;include layout=""@layout/main_list"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>background.xml in res/drawable</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;bitmap xmlns:android=""http://schemas.android.com/apk/res/android""    android:src=""@drawable/background_img""    android:scaleType=""centerInside""/&gt;</code></pre><p>Of couse I checked if the xml is really used by changing the image, at the image changed so the xml is used.</p><p>The used scaling seems to be fitXY, because the whole background is visible but the aspect ration is ignored.</p><p>Some ideas?</p>","180538","","","","","2010-12-16 16:09:44","Background in tab widget ignore scaling","<android><background><scale><android-tabhost>","2","0","5","",""
"2409686","1","","","2010-03-09 14:27:43","0","1072","<p>I have an appwidget which has got a ImageButton.I can update ImageButton image but i can't update backgroundcolor with using setInt() method;because imagebutton setBackgroundColor is not annoated with <strong>RemotableViewMethod.class</strong>.What can i do else?</p>","253882","","","","","2012-09-23 22:31:30","How to update ImageButton BackgroundColor in RemoteViews","<android>","3","0","2","",""
"2409923","1","2409957","","2010-03-09 14:56:52","3","7261","<p>What kind of permission/Flag do I have to add to the manifest to debug my application on an actual Android device?</p>","114066","","114066","","2010-03-09 18:00:10","2010-03-09 18:00:10","What do I have to add to the manifest to debug an Android application on an actual Device?","<android><debugging><manifest>","1","0","1","",""
"2410163","1","2416579","","2010-03-09 15:27:00","3","1715","<p>I'm an htc tattoo owner, and i'm watching for a way to copy contacts' birthday (retrieved from facebook) to the built-in calendar.  </p><p>I'm not afraid to develop a custom app but i'll be more happy if there's one built-in or already existing...    </p><p>Thinking over this thing, i realized there's more fun creating a custom app... :P</p><p>Do you know if there's a way to read contacts' informations and write it to the calendar?</p>","289761","","289761","","2010-03-10 10:31:09","2010-03-10 11:51:30","Copy android contacts' birthday to calendar","<android><facebook><calendar><contacts><htc>","1","1","1","",""
"2410678","1","","","2010-03-09 16:35:53","1","3259","<p>I've got a problem in saving  a picture in a full size after capturing it using ACTION_IMAGE_CAPTURE intent the picture become very small , its resolution is 27X44 I'm using 1.5 android emulator, this is the code and I will appreciate any help:</p><pre><code>myImageButton02.setOnClickListener(    new OnClickListener()     {        @Override        public void onClick(View v)        {            // create camera intent            Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);            //Grant permission to the camera activity to write the photo.            intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);            //saving if there is EXTRA_OUTPUT            intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File            (Environment.getExternalStorageDirectory(), ""testExtra"" + String.valueOf            (System.currentTimeMillis()) + "".jpg"")));            // start the camera intent and return the image            startActivityForResult(intent,1);         }     });@Overrideprotected void onActivityResult (int requestCode, int resultCode, Intent data){    super.onActivityResult(requestCode, resultCode, data);    // if Activity was canceled, display a Toast message    if (resultCode == RESULT_CANCELED)     {        Toast toast = Toast.makeText(this,""camera cancelled"", 10000);        toast.show();        return;    }    // lets check if we are really dealing with a picture    if (requestCode == 1 &amp;&amp; resultCode == RESULT_OK)    {        String timestamp = Long.toString(System.currentTimeMillis());        // get the picture        Bitmap mPicture = (Bitmap) data.getExtras().get(""data"");        // save image to gallery        MediaStore.Images.Media.insertImage(getContentResolver(), mPicture, timestamp, timestamp);    }}}</code></pre>","289823","","21234","","2010-03-09 16:44:10","2010-05-07 08:37:41","small size picture problem","<android><camera><android-emulator>","1","2","1","",""
"2410749","1","2425412","","2010-03-09 16:43:30","0","1723","<p>I'm new to the NDK. (using Windows)</p><p>I have downloaded cygwin and the NDK.</p><p>I have unzipped the NDK in C:\</p><p>When I run cygwin I change to the NDK directory and I run the commandbuild/host-setup.sh</p><p>But I get Error: could not find a valid GNU Make executable.</p><p>I have downloaded GNU make 3.81 but still no luck,</p><p>What do I have to do with GNU Make? Do I have to put it in a specialdirectory or add it to PATH?</p>","243999","","243999","","2010-03-11 13:54:41","2010-04-09 00:52:40","Android - NDK - GNU make problems","<android><gnu><android-ndk><gnu-make>","2","2","","",""
"2410836","1","2410938","","2010-03-09 16:53:54","54","30123","<p>I have a style applied to my whole application:</p><p>AndroidManifest.xml:</p><pre><code>&lt;application android:theme=""@style/ApplicationStyle"" android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;</code></pre><p>And in my styles.xml:</p><pre><code> &lt;style name=""ApplicationStyle"" parent=""android:Theme""&gt;  &lt;item name=""android:button""&gt;@style/CKButton&lt;/item&gt; &lt;/style&gt; &lt;style name=""CKButton"" parent=""android:style/Widget.Button""&gt;  &lt;item name=""android:textSize""&gt;19sp&lt;/item&gt;  &lt;item name=""android:layout_margin""&gt;0dip&lt;/item&gt;  &lt;item name=""android:background""&gt;#ff0000&lt;/item&gt; &lt;/style&gt;</code></pre><p>But the style doesn't get applied.</p><p>I'm sorry if I just used the false name in the <code>ApplicationStyle</code> - <code>Item</code>, but I have no clue where to look for the object names and simply assumed, that <code>android:button</code> applies to all buttons.</p>","288980","","515205","","2013-05-08 22:14:29","2013-05-08 22:14:29","How do I apply a style to all buttons of an Android application","<android><button><stylesheet>","1","0","17","",""
"2410890","1","2411097","","2010-03-09 17:03:02","4","1613","<p>I created an activity which holds 3 custom components (defined in xml). 2 components extend View, 1 extends SurfaceView. They all lie in a LinearLayout, deviding screen real estate equally amongst the components. <a href=""http://img502.imageshack.us/img502/7840/layoutww.png"" rel=""nofollow"">Click to see. I'm new so I can't post images directly...</a></p><p>Now I would like to maximize one View when it is clicked (using a sliding animation). The other two should slide out to the bottom. All should run at the same time and the animation needs to hold when the desired view is maximized.</p><p>I created two animation (res/anim): shrink_view.xml and max_view.xml</p><pre><code>  &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;set xmlns:android=""http://schemas.android.com/apk/res/android""     android:interpolator=""@android:anim/accelerate_interpolator""&gt;        &lt;translate android:fromYDelta=""0"" android:toYDelta=""100%p"" android:duration=""4000"" /&gt;        &lt;scale             android:fromXScale=""1"" android:toXScale=""1"" android:fromYScale=""1""            android:toYScale=""0.0"" android:pivotX=""0%"" android:pivotY=""50%""            android:fillAfter=""false""            android:startOffset=""0"" android:duration=""4000"" android:fillBefore=""true"" /&gt;    &lt;/set&gt;&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android"" android:interpolator=""@android:anim/accelerate_interpolator""&gt;    &lt;translate android:fromYDelta=""0"" android:toYDelta=""100%p"" android:duration=""4000"" /&gt;        &lt;scale             android:fromXScale=""1"" android:toXScale=""1"" android:fromYScale=""1""            android:toYScale=""100"" android:pivotX=""100%"" android:pivotY=""100%""            android:startOffset=""0"" android:duration=""4000"" android:fillBefore=""true"" /&gt;&lt;/set&gt;</code></pre><p>But this doesn't do what I want. I'm thinking my attempt might be a deadend. So can anyone please provide some help?</p>","289849","","289849","","2010-03-09 17:10:10","2010-03-09 17:32:34","On the Android: How to define proper Animation to maximize one View while minimizing 2 others at the same time?","<android><layout><animation><view>","1","0","1","",""
"2411281","1","2630097","","2010-03-09 17:58:30","11","3949","<p>I'm looking for something like the keychain on the iPhone, but for Android development.<br>Something that gives me the possibility to save small key-value pairs, that are persistent and unchanged even if the user reinstalls the application. </p><p>Is there something like that? Can I use the standard preferences that way?</p><p>I would like to achieve a behavior in a way it works with games on a PC writing the save games to another folder so that after delete and later reinstall they are not lost.</p><p><strong>Edit</strong></p><p>The bounty run out without somebody mentioning the accountManager. I just stumbled over it. Wouldn't that be a method to achieve the behaviour described by me? </p>","114066","","114066","","2010-04-20 07:41:28","2010-04-20 07:41:28","iPhone-like Keychain in Android?","<android><persistence><keychain>","3","0","4","",""
"2411402","1","","","2010-03-09 18:12:23","0","379","<p>I defined a layout like this:</p><pre><code>&lt;LinearLayout&gt;  &lt;ListView /&gt;&lt;/LinearLayout&gt;</code></pre><p>and I want to use a wrapper class for it:</p><pre><code>public class MyView extends LinearLayout {    ListView mListView;    public build() {        mListView = (ListView)findViewById(R.id.mylistview);    }}</code></pre><p>not sure how to inflate this from my layout file:</p><pre><code>MyView v = LayoutInflater.from(this).inflate(R.layout.myview, null);</code></pre><p>the inflater of course does not know what 'MyView' type is, and returns only View. What's a good way to reconcile this?</p><p>Thanks</p>","246114","","","","","2010-03-09 19:15:48","Creating my own view type from a layout file?","<android>","1","0","","",""
"2411495","1","2412084","","2010-03-09 18:25:04","1","732","<p>Actually I'm trying to implement an ontouchlistener into my android (1.5) application. therefore i implemented the ""ontouchlistener"" into the class, and then i put my code into the: </p><pre><code>public boolean onTouchEvent (MotionEvent e){ //code}</code></pre><p>The problem is, that if I am dragging over an (e.g.) Spinner or EditTextView than this Method isn't called. The only way to solve this which i figured out is to add an ontouchlistener to each of this views manually:</p><pre><code>((Spinner)(findViewById(R.id.spinner1))).setOnTouchListener(tl);((Spinner)(findViewById(R.id.spinner2))).setOnTouchListener(tl);</code></pre><p>(tl is the ontouchlistener)So isn't there a way to catch the touch event before it gets to each of those views?thanks in advance</p><p>Ripei</p>","209902","","","","","2010-03-09 19:52:07","touchlisteners and textviews","<android><view><ontouchlistener>","1","0","","",""
"2411547","1","2419648","","2010-03-09 18:33:51","4","516","<p>I got the example in this <a href=""http://bakhtiyor.com/2009/05/fancy-gesture-detector/"" rel=""nofollow"">link</a>.</p><p>I can't understand the <code>addmove</code>, <code>costLeven</code> and <code>meatureGesture</code> methods.</p><p>Can you explain it step by step?</p>","267269","","267269","","2010-09-29 11:36:45","2010-09-29 11:36:45","Can you explain(mathematical calculations) gesture example (Levenshtein )?","<android><math><gesture>","1","0","1","",""
"2411781","1","2412504","","2010-03-09 19:07:46","7","1486","<p>The Android documentation says that best practices are to make two drawable directories - one for HDPI and one for MDPI.  It also says that if the MDPI directory doesn't exist and a MDPI device is running the app, it will scale down the HDPI ones so everything looks good.</p><p>Is there any reason not to just make one high resolution set of graphics?</p><p>One con that I can think of is performance issues and one pro I can think of is only having one set of images for your app.</p>","135199","","","","","2013-08-29 16:45:49","Is there any disadvantage to using only high resolution image resources for an Android application?","<android><graphics>","2","1","1","",""
"2411900","1","2412229","","2010-03-09 19:24:24","1","1141","<p>Sorry for the Newb-ness.</p><p>I want to create a list of view elements in a <code>LinearLayout</code> (vertical).  I created an xml layout that is a <code>TableLayout</code> called ""category_list.xml""</p><pre><code>&lt;TableLayout&gt;  &lt;TableRow&gt;   &lt;ImageView /&gt;   &lt;TextView /&gt;   &lt;CheckBox /&gt;  &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>I want to iterate an array, on each iteration create a new TableLayout view and add it to the LinearLayout.  The peice I'm missing is creating a new TableLayout based on the above xml.</p><p>Something like </p><pre><code>TableLayout t = new TableLayout( R.layout.category_list );</code></pre><p>Can someone point me in the right direction?  Is it better to generate the TableLayout programatically?</p>","265669","","","","","2010-03-09 20:16:00","Android: (Newb Question) Programatically creating views based on xml","<android>","2","0","","",""
"2411924","1","2412066","","2010-03-09 19:27:40","-1","1122","<p>I want to launch my service with a voice command like the name of the app. Is it possible, can i listen such an event? I am affraid not but who knows.</p>","287020","","1101070","","2012-03-06 01:09:23","2012-03-06 01:09:23","Start android app with voice command","<android><speech-recognition><broadcastreceiver>","1","1","","",""
"2412022","1","","","2010-03-09 19:42:03","3","1068","<p>I would like to distribute my app to a group of beta testers but would like to watermark specific version (APK?) to each tester. Is there a way to do so?</p>","289948","","229044","","2010-03-09 19:51:02","2010-03-09 20:09:59","How do I watermark an Android app?","<android><watermark>","2","4","0","",""
"2412216","1","2412295","","2010-03-09 20:13:51","4","1240","<p>I am working on a home screen widget. I hope this widget can support auto rotation. For example, if the phone is in portrait mode, I want this home screen widget to be 2 cell * 2 cell on the home screen; if the phone is in landscape mode, I want this home screen widget changes be 3 cell * 1 cell on the home screen. Is it possible that I can make it?</p><p>Thanks.</p>","256239","","","","","2010-03-09 20:33:16","Does Android home screen widget support auto rotation?","<android>","2","0","1","",""
"2412352","1","2526167","","2010-03-09 20:34:37","5","8992","<p>I am having trouble getting the Android Development Tools to install.  I overcame one error involving the GEF.  I now have a new error.</p><p>Missing requirement: Android Development Tools 0.9.6.v201002051504-24846 (com.android.ide.eclipse.adt.feature.group 0.9.6.v201002051504-24846) requires 'org.eclipse.wst.xml.ui 0.0.0' but it could not be found</p><p>I am running Kubuntu 9.10 and Eclipse 3.5.  I have managed to get the Android DDMS to install.  But I keep running into blocks with the Development Tools.  I have the Android SDK installed.</p><p>What do I need to do in order get the missing component?</p>","289980","","","","","2012-10-26 15:50:18","Can't Install ADT. org.eclipse.wst.xml.ui is missing","<android><eclipse><adt>","7","0","3","",""
"2412393","1","2412903","","2010-03-09 20:41:20","2","1161","<p>It is easy to find on google which is the broadcast receiver to listen for sms messages. Is there also a similar receiver to listen for gtalk messages or new emails?</p><p>Thanks</p>","269585","","","","","2010-03-09 22:02:59","Broadcast receiver for gtalk/gmail message receive","<android><broadcastreceiver>","1","0","1","",""
"2412512","1","2412618","","2010-03-09 20:57:46","1","298","<p>I want my Android app to take a picture, as part of something larger it is doing.</p><p>Ideally, I would like to just send out an Intent saying ""snap a picture"" and get back an image file.</p><p>Is there an Activity that can handle that, or do I need to do all the low level work with the Camera class myself?</p><p>Thanks,</p><p>Peter</p>","253661","","253661","","2010-03-09 21:07:48","2010-03-09 21:14:58","Grabbing a picture from within an App?","<android><camera><image><snap>","1","0","1","",""
"2412997","1","2416608","","2010-03-09 22:16:53","0","2386","<p>I may be asking a bit much here but I have faith in the community so it's worth trying. I'm making a game and I'm trying to pick the connection type to use for communicating between a Java mobile client and a Java server backend.</p><p>Socket programing in Java is easy - there's a <a href=""http://java.sun.com/docs/books/tutorial/networking/sockets/index.html"" rel=""nofollow"">lovely tutorial</a> on the subject and two way communication is trivial.</p><p>Trouble is that on a mobile client (Android) it's not guaranteed that the cellular network will let you make TCP connections. That makes me think using an HTTP connection is the way to go. </p><p>HTTP connections are request based but I need a way to push notifications from the server to the client. It seems the solution to this problem is to use 'long polling' I have read a bit about it but have yet to see a simple example for what I'm trying to achieve.</p><p>Again I might be asking a lot but this seems like a fairly common problem, is there a library or framework I can import / use to wrap a Http connection and provide a two way long standing connection (That reconnects automatically etc). I read a bit about cometD but it doesn't seem to have a Java library that I can just pick up.</p><p>The communication I need is not heavy, not constant two way streams of data just occasional updates either way to keep the game going.</p><p>Thanks in advance for sifting through my ignorance,</p><p>Gavin</p>","111734","","","","","2010-03-10 11:56:13","How to use Http connections like a TCP Socket in Java","<java><android><http>","3","5","1","",""
"2413019","1","","","2010-03-09 22:20:13","3","8106","<p>I have a service that theoretically can work without an Activity associated to it (as ""services"" are intended on the Android platform).</p><p>This service uses Bluetooth, in particular registers a Bluetooth Service with a given Name that listens for communications. Of course to work it has to have the Bluetooth active.</p><p>As also shown on the Bluetooth api docs I'm using the <code>BluetoothAdapter.ACTION_REQUEST_ENABLE</code> to prompt the user to enable Bluetooth in case it's not on already. This, though, is an activity, and therefore needs to be called from another activity, i.e.:</p><pre><code>Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);InstanceOfAnActivity.startActivity(enableIntent);</code></pre><p>What I would want to achieve is to have the service (which, for example, starts up at boot), completely decoupled from any Activity, and therefore wouldn't have the <code>InstanceOfAnActivity</code> to start up the pop-up instructing the user to turn on Bluetooth.</p><p>Now, I know that there's the (infamous) call to <code>BluetoothAdapter.enable()</code>, but as the doc says it shouldn't be called directly.</p><p>So, any tip/solution to this dilemma? (Maybe it's easy and I'm just missing something...)</p>","274534","","20770","","2012-03-26 14:12:26","2012-03-26 14:13:22","Android Bluetooth from within Service","<android><service><bluetooth>","2","2","1","",""
"2413285","1","2413403","","2010-03-09 23:01:46","1","310","<p>not much of a programming question, but development related still,</p><p>I'm starting Android development and have been at it for just a little over a week. So far so go regarding progress, specially for someone who hadn't touched Java in his life (but have good C#, Objective-C, VB.NET and Fortran experience)</p><p>As I'm looking into a testing device I'm undecided on the phone to get. I need it to be unlocked, so I'm looking into Dev Phone 2 or Nexus One. The difference being $120~ish in price.</p><p>Anyone having one of those and using it for development? which do you consider is the best choice. Is the extra speed and screen in the Nexus One worth it?</p><p>I'm targetting SDK 1.6 but down the road I can see myself playing with 2.1.</p><p>Any input is appreciated</p><p>Regards</p>","98907","","31161","","2011-08-05 11:14:57","2011-08-05 11:14:57","Device for Android development","<android><nexus-one>","3","0","","2011-08-07 09:49:44",""
"2413426","1","","","2010-03-09 23:30:55","42","32344","<p>Is there any way to make Android emit a sound of arbitrary frequency (meaning, I don't want to have pre-recorded sound files)?</p><p>I've looked around and <a href=""http://developer.android.com/reference/android/media/ToneGenerator.html"">ToneGenerator</a> was the only thing I was able to find that was even close, but it seems to only be capable of outputting the standard DTMF tones.</p><p>Any ideas?</p>","76835","","","","","2013-08-16 16:27:41","Playing an arbitrary tone with Android","<android><audio>","6","2","53","",""
"2413966","1","","","2010-03-10 01:39:32","1","251","<p>I was wondering if it is possible to hook into the gmail and emailapplications and check to see if it contains text that matches aregular expression, and if it does, make that text into a link with aURI that would open my application. What i am thinking of is similarto how the gmail application can detect a web address or phone numberand make it a link. Is something like this possible?</p>","290135","","","","","2010-03-10 02:03:23","Adding links to an email message","<android>","1","0","","",""
"2414010","1","2414019","","2010-03-10 01:53:02","-1","1121","<p>Does anyone know know how to programatically get the local date and time of the Android device? With that local date and time, does anyone know how to convert that to milliseconds from 1970 in UTC time?</p>","157785","","","","","2010-03-10 04:18:50","Does anyone know how to get the local date and time from Android 2.1 device?","<java><android><datetime><date>","2","0","","",""
"2414134","1","2414165","","2010-03-10 02:31:57","14","32999","<p>I want to take a <code>byte</code> and append it to a resource ID to be able to get the image that corresponds to that numbered deck in the game.  It was easy to with paths on other devices, but with the Resource ID's I am unsure how I could go about do this.</p><p>Here's what I have now:</p><pre><code>switch(GameSettings.gameDeck)    {    case 1:        deckImage.setBackgroundResource(R.drawable.deck1);        break;    case 2:        deckImage.setBackgroundResource(R.drawable.deck2);        break;    case 3:        deckImage.setBackgroundResource(R.drawable.deck3);        break;    case 4:        deckImage.setBackgroundResource(R.drawable.deck4);        break;    }</code></pre><p>In my Blackberry version of this, I simply had:</p><pre><code>deckImage.setBitmap(Bitmap.getBitmapResource(""/path/deck"" + GameSettings.gameDeck + "".png""));</code></pre><p>Is there a way to accomplish something similar using Resource IDs on Android?</p>","288072","","","","","2011-08-29 08:35:57","Dynamically get drawables by ID","<java><android>","1","0","3","",""
"2414230","1","2414317","","2010-03-10 03:05:47","3","8147","<p>I am now working on a program for <strong>Android</strong> which is someting related to IMS.I want the Server to send back a nonce to the Client as a string and print it on the client side.In order to generate <strong>nonce</strong>, I tried using the code from this site.</p><p><a href=""http://www.exampledepot.com/egs/java.security/CreateSecureRandom.html"" rel=""nofollow"">http://www.exampledepot.com/egs/java.security/CreateSecureRandom.html</a></p><p>Part of my codes is as follow</p><pre><code>public static String generateNonce() {   try {   // Create a secure random number generator   SecureRandom sr = SecureRandom.getInstance(""SHA1PRNG"");   // Get 1024 random bits   byte[] bytes = new byte[1024/8];   sr.nextBytes(bytes);   // Create two secure number generators with the same seed   int seedByteCount = 10;   byte[] seed = sr.generateSeed(seedByteCount);   sr = SecureRandom.getInstance(""SHA1PRNG"");   sr.setSeed(seed);   SecureRandom sr2 = SecureRandom.getInstance(""SHA1PRNG"");   sr2.setSeed(seed);   } catch (NoSuchAlgorithmException e) {  }  //return NONCE;  return null; }</code></pre><p>I declared <code>NONCE = generateNonce();</code> in the begining.But the problem is instead of getting a nonce value, it print as <strong><em>null</em></strong> at the client side. When I tried to print it on the server side, it also appear as <strong><em>null</em></strong>.</p><p>Can someone enlighten me the error in my codes or help me with a better or more suitable coding, please. Thanks a lot in advance.</p><p>Regards,Sebby.</p>","290167","","166712","","2010-03-10 03:23:51","2010-03-10 03:27:06","how to generate NONCE and print it on client side in ANDROID","<java><android><client-server>","2","1","1","2013-04-14 05:03:03",""
"2414453","1","2419826","","2010-03-10 04:10:46","5","4036","<p>This code works perfectly in Ubuntu, Windows, and Mac OS X. It also works fine with a Nexus One running Android 2.1.1.</p><p>I start sending and listening multicast datagrams, and all the computers and the Nexus One will see each other perfectly. Then I <strong>run the same code on a Droid</strong> (Firmware 2.0.1), and <strong>everybody will get the packets sent by the Droid, but the droid will listen only to its own packets</strong>.</p><p>This is the <code>run()</code> method of a thread that's constantly listening on a Multicast group for incoming packets sent to that group.</p><p>I'm running my tests on a local network where I have multicast support enabled in the router.My goal is to have devices meet each other as they come online by broadcasting packages to a multicast group.</p><pre><code>public void run() {    byte[] buffer = new byte[65535];    DatagramPacket dp = new DatagramPacket(buffer, buffer.length);    try {        MulticastSocket ms = new MulticastSocket(_port);        ms.setNetworkInterface(_ni); //non loopback network interface passed        ms.joinGroup(_ia); //the multicast address, currently 224.0.1.16        Log.v(TAG,""Joined Group "" + _ia);        while (true) {            ms.receive(dp);            String s = new String(dp.getData(),0,dp.getLength());            Log.v(TAG,""Received Package on ""+ _ni.getName() +"": "" + s);            Message m = new Message();            Bundle b = new Bundle();            b.putString(""event"", ""Listener (""+_ni.getName()+""): \"""" + s + ""\"""");            m.setData(b);            dispatchMessage(m); //send to ui thread        }    } catch (SocketException se) {        System.err.println(se);    } catch (IOException ie) {        System.err.println(ie);    }}</code></pre><p>This is the code that sends the Multicast Datagram out of every valid network interface available (that's not the loopback interface).</p><pre><code>public void sendPing() {    MulticastSocket ms = null;    try {        ms = new MulticastSocket(_port);        ms.setTimeToLive(TTL_GLOBAL);        List&lt;NetworkInterface&gt; interfaces = getMulticastNonLoopbackNetworkInterfaces();        for (NetworkInterface iface : interfaces) {            //skip loopback            if (iface.getName().equals(""lo""))                continue;            ms.setNetworkInterface(iface);            _buffer = (""FW-""+ _name +"" PING (""+iface.getName()+"":""+iface.getInetAddresses().nextElement()+"")"").getBytes();            DatagramPacket dp = new DatagramPacket(_buffer, _buffer.length,_ia,_port);            ms.send(dp);            Log.v(TAG,""Announcer: Sent packet - "" + new String(_buffer) + "" from "" + iface.getDisplayName());        }    } catch (IOException e) {        e.printStackTrace();    } catch (Exception e2) {        e2.printStackTrace();    }}</code></pre><p><strong>Update (April 2nd 2010)</strong>I found a way to have the Droid's network interface to communicate using Multicast: <a href=""http://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock.html"" rel=""nofollow"">WifiManager.MulticastLock</a>.</p><pre><code>MulticastLock _wifiMulticastLock = ((WifiManager) context.getSystemService(Context.WIFI_SERVICE)).createMulticastLock(""multicastLockNameHere"");_wifiMulticastLock.acquire();</code></pre><p>Then when you're done...</p><pre><code>if (_wifiMulticastLock != null &amp;&amp; _wifiMulticastLock.isHeld())    _wifiMulticastLock.release();</code></pre><p>After I did this, the Droid started sending and receiving UDP Datagrams on a Multicast group.</p><p><strong>Update Jul-6-2010</strong></p><p>Per request, here's my current code, the next method exists on an abstract class that can be used for both Broadcast and Multicast receivers.</p><pre><code>public void run() {    onInit();    try {        byte[] data = new byte[65535];        while (isProcessing()) {            try {                DatagramPacket receivedDatagram = new DatagramPacket(data, data.length);                _socket.receive(receivedDatagram);                onDatagramReceived(receivedDatagram);                data = new byte[65535]; // This pattern is for saving memory allocation.            } catch (InterruptedIOException e) {                if (!isProcessing())                    break;            }        } // while    } catch (Exception e) {        Log.e(TAG, e.getMessage(), e);    } finally {        onStop();        _socket.close();        _socket.disconnect();    }}</code></pre><p>Your extending classes should implement <code>onInit()</code> and <code>onDatagramReceived()</code></p><p>For a <strong>Multicast</strong> receiver, <code>onInit()</code> <strong>looks something</strong> like this:</p><pre><code>_socket = new MulticastSocket(PORT_MULTICAST);InetAddress groupAddress = InetAddress.getByAddress(MULTICAST_GROUP_ADDRESS); InetAddress groupInetAddress = FrostWireUtils.fastResolveAddress(groupAddress); //reflection hack to not resolve ipstry {    _socket.setSoTimeout(500);    _socket.setTimeToLive(MULTICAST_TTL_GLOBAL);    _socket.setReuseAddress(true);    _socket.setNetworkInterface(        WifiUtils.getWifiNetworkInterface());    _socket.joinGroup(groupInetAddress);    WifiUtils.lockMulticast();} catch (Exception e) {    Log.e(TAG, e.getMessage(), e);}</code></pre>","188622","","496830","","2011-11-08 14:54:22","2012-02-19 13:42:49","Is Multicast broken for Android 2.0.1 (currently on the DROID) or am I missing something?","<java><android><multicast><datagram>","1","2","6","",""
"2414585","1","2415397","","2010-03-10 04:47:00","23","694","<p>I would like to distribute a beta version of my application to a small group of users.  Ideally this would be done through the market to make it easier for the beta testers.  </p><p>Is there a way to restrict an app's presence in the market?  The only solutions I could come up with were:</p><p>1 - Have users download the .adk from the web and install manually<br>2 - Release the beta version as a separate app in the market</p><p>The first option isn't ideal as you have to potentially walk the user through allowing apps from unknown sources.  Not to mention from a user perspective, you're then downloading an app from an untrusted source.</p><p>The second option isn't ideal as you then are potentially confusing other users by having multiple versions in the market, one of which might be flaky.  And then there's the inevitable comments about how something doesn't work in the market.  I guess you could add some sort of password to that version that you only distribute to your beta testers. </p><p>Are there any better solutions?  </p>","290204","","","","","2013-12-03 06:35:39","Is there a recommended strategy for releasing a beta version of an application to a limited number of users through the Android Market?","<android><release><beta><google-play>","3","0","8","",""
"2414599","1","3964993","","2010-03-10 04:50:58","4","1622","<p>For some reason I can't step through the code in the debugger. I am not trying to step through Android source code, just code that resides in my project. My build paths are setup to include it, but whenever I try stepping over anything it gives me a ""Source not found"" message. This is incredibly frustrating, and a prompt answer would be very well appreciated.</p>","266255","","","","","2010-10-19 02:51:34","Android Debugging Problem","<android><debugging><source>","2","0","","",""
"2414786","1","2415377","","2010-03-10 05:43:00","20","15574","<p>Is there a way we can <strong>update</strong> (not reinstall) a non-market apk on an Android device?I could only find an adb install (nothing like adb update)</p>","46297","","114066","","2011-02-08 09:55:00","2011-02-08 09:55:00","adb update a non-market apk?","<android><adb>","1","0","11","",""
"2415558","1","2415634","","2010-03-10 08:59:54","15","5400","<p>Is there a way to detect if the device I'm currently running on has a hardware keyboard installed?  </p><p>How do I query device capabilities anyway?</p>","103766","","114066","","2010-03-10 10:28:28","2010-03-10 10:28:28","How to detect hardware keyboard presence?","<android><keyboard><hardware><device>","1","0","5","",""
"2415619","1","2416360","","2010-03-10 09:09:06","143","110872","<p>How can I convert a Bitmap image to Drawable ?</p><p>Thanks,Farha</p>","285052","","2441810","","2013-07-24 16:17:00","2014-02-06 12:44:23","How to convert a Bitmap to Drawable in android?","<android><bitmap><android-drawable>","4","2","35","",""
"2415782","1","7190727","","2010-03-10 09:35:15","5","2957","<p>I ran into an interesting situation with using a ProgressBar in an App Widget...  The documentation (http://developer.android.com/guide/topics/appwidgets/index.html) says that ProgressBar is a supported widget class...</p><p>I have no problem getting the ProgressBar to display in my App Widget but the problem is that I want it to only be displayed as visual feedback to the user when background processing is happening.</p><p>On ImageViews I do this via RemoteViews.setViewVisibility() and everything works fine.  However, with ProgressBar I get an exception saying that ProgressBar can't use this method.</p><p>Is this intentional or is this a bug?  Is there any way to workaround this problem?</p>","249412","","","","","2011-08-25 12:56:39","ProgressBar in an AppWidget","<android><progress-bar><appwidget>","2","0","1","",""
"2415911","1","","","2010-03-10 09:59:01","-1","155","<p>It is the last problem I have before finishing my widget so I beg youto help me!I've created a widget wich can navigate in SMS/Inbox, and deletingthem...When I delete one at the position 5 for example, this one is deleted,the other next are at the position before and the messages before theone deleted don't change of position... All seem's to bee right... butthe sms at postion 5 is null and so can't be open... When I exit fromthe widget and relaunch it, all seem's normal, and the sms at position5 is the old at position 6, what is expected...I use the classic method:</p><pre><code>Uri uri=Uri.parse(""content://sms/Inbox"");Cursor cursor=getContentResolver()query(uri,null,null,null,null);cursor.moveToPosition(i);...</code></pre><p>But I think that there is a probleme because the sms database isn'tclose unless I close my widget.So can I force android to close it and reopen after, or shoold I use</p><pre><code>TWOpenHelper openHelper = new TWOpenHelper(context);SQLiteDatabase database = openHelper.getReadableDatabase();</code></pre><p>in this last case I think I need the real uri of sms database (data/data//databses) wich is?...</p><p>thank's for giving me your opinion and really hope a little help tofinish it. </p>","283517","","","","","2010-03-10 12:15:43","Problem to open SMS after deleting another with my widget","<android><delete><sms><widget>","1","0","","",""
"2416138","1","2417505","","2010-03-10 10:36:37","0","684","<p>I am working on a Http Connections. </p><p>I have a login form. When the enter a username and password. That values will be processed with the server and the user should be logged in. </p><p>Then it shows an users home page in a webview. How to do it?</p>","267269","","164901","","2010-05-09 04:58:49","2010-05-09 04:58:49","how to establish a connection to a webserver in android?","<android><http><login>","1","2","","",""
"2416276","1","2416388","","2010-03-10 11:01:20","4","2101","<p>I have a background color applied to a ListView </p><pre><code>&lt;style name=""CKButtons""&gt;    &lt;item name=""android:windowBackground""&gt;@color/window_background&lt;/item&gt;&lt;/style&gt;</code></pre><p>but everytime the list is scrolled the background color changes back to the system default (black). When the scrolling stops the color goes back to <code>@color/window_background</code>.</p><p>The style is applied in <code>AndroidManifest.xml</code>:</p><pre><code>&lt;activity android:name="".event.EventList""     android:theme=""@style/CKButtons""&gt;&lt;/activity&gt;</code></pre><p>and my ListView looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""   android:orientation=""vertical""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   &gt;&lt;ListView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:id=""@+id/android:list""/&gt;&lt;TextView    android:id=""@+id/android:empty""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:text=""@string/eventlist_no_items""/&gt;&lt;/LinearLayout&gt;</code></pre><p>How can I prevent this from happening?</p>","288980","","","","","2011-06-09 04:24:10","List Item background is changing on scroll","<xml><android><listview><styles>","2","0","2","",""
"2416365","1","12481629","","2010-03-10 11:17:40","4","2478","<p>I currently have a Loop back program for testing Audio on Android devices.</p><p>It uses AudioRecord and AudioTrack to record PCM audio from the Mic and play PCM audio out the earpiece.</p><p>Here is the code:</p><pre><code>public class Record extends Thread  {          static final int bufferSize = 200000;          final short[] buffer = new short[bufferSize];          short[] readBuffer = new short[bufferSize];          public void run() {              isRecording = true;            android.os.Process.setThreadPriority            (android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);            int buffersize = AudioRecord.getMinBufferSize(11025,            AudioFormat.CHANNEL_CONFIGURATION_MONO,            AudioFormat.ENCODING_PCM_16BIT);                           arec = new AudioRecord(MediaRecorder.AudioSource.MIC,                                           11025,                                           AudioFormat.CHANNEL_CONFIGURATION_MONO,                                           AudioFormat.ENCODING_PCM_16BIT,                                           buffersize);                           atrack = new AudioTrack(AudioManager.STREAM_VOICE_CALL,                                           11025,                                           AudioFormat.CHANNEL_CONFIGURATION_MONO,                                           AudioFormat.ENCODING_PCM_16BIT,                                           buffersize,                                           AudioTrack.MODE_STREAM);                           atrack.setPlaybackRate(11025);                           byte[] buffer = new byte[buffersize];                           arec.startRecording();                           atrack.play();                           while(isRecording) {                                   arec.read(buffer, 0, buffersize);                                   atrack.write(buffer, 0, buffer.length);                           }            }  }</code></pre><p>So as you can see in the creation of the AudioTrack and AudioRecord the Encoding is supplied via the AudioFormat but this only allows 16 bit or 8 bit PCM.</p><p>I have my own G711 Codec implementation now and I want to be able to encode the audio from the Mic and decode it going into the EarPiece, So I have <strong>encode(short lin[], int offset, byte enc[], int frames)</strong> and <strong>decode(byte enc[], short lin[], int frames)</strong> methods but I'm unsure as to how to use them to encode and the decode the audio from the AudioRecord and AudioTrack.</p><p>Can anyone help me or point me in the right direction?</p>","243999","","","","","2013-04-20 16:45:56","Android - How to add my own Audio codec to AudioRecord?","<java><android><audio><encode><codec>","2","0","2","",""
"2416456","1","2416588","","2010-03-10 11:31:03","3","4959","<p>I have 3 images that I want to add one after other on a canvas.This is my code:-</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ImageButton im1 = (ImageButton)findViewById(R.id.btnPN);     im1.setBackgroundDrawable(getImage());       }public BitmapDrawable getImage(){    Drawable image1 = getResources().getDrawable(R.drawable.imagename);    Drawable image2 = getResources().getDrawable(R.drawable.imagename);    Drawable image3 = getResources().getDrawable(R.drawable.imagename);    Bitmap bitmap = Bitmap.createBitmap(image1.getIntrinsicWidth()                      +image2.getIntrinsicWidth()+image3.getIntrinsicWidth(),          image1.getIntrinsicHeight(),Bitmap.Config.ALPHA_8);    Canvas canvas = new Canvas(bitmap);    image1.setBounds(0, 0, image1.getIntrinsicWidth(), image1.getIntrinsicHeight());    image1.draw(canvas);    image2.setBounds(image1.getIntrinsicWidth(), 0, image2.getIntrinsicWidth(),            image2.getIntrinsicHeight());    image2.draw(canvas);    image3.setBounds(image1.getIntrinsicWidth()+image2.getIntrinsicWidth(),                      0, image3.getIntrinsicWidth(),                      image3.getIntrinsicHeight());    image3.draw(canvas);    BitmapDrawable bu = new BitmapDrawable(bitmap);    return bu;    </code></pre><p>}</p><p>but this is not working.</p><p>Can someone please tell me what I am doing wrong here.</p><p>Thanks,Farha</p>","285052","","114066","","2010-03-10 11:35:49","2010-03-10 11:52:29","How to add 3 images in a canvas in android","<android>","1","0","","",""
"2416636","1","2417034","","2010-03-10 11:59:29","1","285","<p>My application needs to display the time. Rather then displaying time as 11:00 I am wondering whether it is possible to have to have static/paused/stopped analogue clock showing 11' o clock?</p>","290469","","114066","","2010-03-10 12:01:43","2010-03-10 13:03:37","Displaying paused/static analogue clock","<android>","1","0","","",""
"2416774","1","2417651","","2010-03-10 12:22:34","0","1121","<p>I am trying to create layout with the following layers (from bottom to top):</p><ol><li>Tab</li><li>Background image covering all the tab page</li><li>Foreground image covering 75% of the tab page</li><li>Table layout covering 90% of foreground image. This will display information.</li></ol><p>When the user scrolls the screen to the right layer 3 and 4 will be changed to display different image and information. If the user scrolls the left the original layer 3 and 4 will be displayed. </p><p>I understand how gesture and animation work so that is not a problem but how do I go about creating the layout?</p><p>Thanks.</p>","290469","","","","","2010-03-10 14:33:20","Layered layout problem","<android>","1","0","","",""
"2416782","1","2417455","","2010-03-10 12:24:24","18","5874","<p>I'm going to create widget which needs to update its content every minute (it shows time-related data).</p><p>However, there is no need to update widget if it is currently invisible, which means:</p><ul><li>screen is turned off</li><li>another app is running</li><li>widget is placed on another (invisible) home screen tab</li></ul><p>What is the best way to update only visible widget every minute - without waking up device nor doing unnecessary computations? After widget becomes visible, small lag before update is acceptable.</p>","7162","","","","","2011-01-21 11:38:11","Android - how update widget often but only when it is visible?","<android><widget><visible>","3","0","16","",""
"2416844","1","2419558","","2010-03-10 12:35:52","15","39868","<p>friends,</p><p>i have created custom title bar using following titlebar.xml file with code</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;TextView   xmlns:android=""http://schemas.android.com/apk/res/android""   android:id=""@+id/myTitle""   android:text=""This is my new title""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   android:textColor=""@color/titletextcolor""  android:layout_marginLeft=""25px""   android:paddingTop=""3px""    /&gt; </code></pre><p>and java code to display custom title bar on each activity.</p><pre><code>@Override    public void onCreate(Bundle savedInstanceState)    {requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);         getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mytitle);super.onCreate(savedInstanceState);        setContentView(R.layout.main);}</code></pre><p>now i want to set textview value dynamically in each activity can any one guide me how can i achieve this?</p><p>using findviewbyid here i dont get reference of that textview to set value because main layout does not contains any textbox with such a name but mytitle.</p><p>any help would be appriciated.</p>","249991","","","","","2011-10-24 07:49:51","how to set custom title bar TextView Value dynamically in android?","<android><layout><activity>","5","1","10","",""
"2417082","1","2418048","","2010-03-10 13:11:36","0","1057","<p>Dynamically I am creating the linear layout and adding the views to linear layout every 5 sec I need to update data to linear layout from database .  But When I checked the log output it is adding to linear layout but gui is not getting updated for every 5 sec. I am using scheduled fixed timer task .What should i do ?</p>","275791","","766108","","2012-08-23 11:45:01","2012-08-23 11:45:01","Dynamically added views in linearlayout","<android>","2","0","1","",""
"2417221","1","2417984","","2010-03-10 13:36:09","7","12229","<p>So my layout looks basically like this:</p><pre><code>&lt;ScrollView&gt;    &lt;RelativeLayout&gt;        &lt;BunchOfViews/&gt;        &lt;ImageView android:layout_alignParentBottom=""true""/&gt;    &lt;/RelativeLayout&gt;&lt;/ScrollView&gt;</code></pre><p>I have the ScrollView so all of the layout always is visible no matter the height of the screen. The problem is that on a very high screen, I still want my imageview to be at the bottom. However, a child of a ScrollView dont seem to have a defined bottom. The View is placed at the top of the layout. How can I solve this problem in a neat way?</p><p>Cheers,</p>","249871","","","","","2013-06-29 15:09:25","Adding view to bottom of layout inside a scrollview","<android><layout><scroll>","5","0","3","",""
"2417341","1","2418134","","2010-03-10 13:53:37","8","10757","<p>I have a code that works 99% of the time since is deploy in lots of clients, but sometimes I get the following:</p><blockquote>  <p>java.lang.reflect.InvocationTargetException    android.widget.LinearLayout.(LinearLayout.java:92)      java.lang.reflect.Constructor.constructNative(Native Method)      java.lang.reflect.Constructor.newInstance(Constructor.java:446)      android.view.LayoutInflater.createView(LayoutInflater.java:499)      com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)      android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)      android.view.LayoutInflater.rInflate(LayoutInflater.java:617)      android.view.LayoutInflater.inflate(LayoutInflater.java:407)      android.view.LayoutInflater.inflate(LayoutInflater.java:320)      com.mycode.mycode.MyClass.draw(xxxxxxx)  .....</p></blockquote><p>and on my code I have:</p><blockquote>  <p>LayoutInflater li = (LayoutInflater) this                      .getSystemService(Context.LAYOUT_INFLATER_SERVICE);<br>              theview = li.inflate(R.layout.partofthescreen,                      somecontainer, false);</p></blockquote><p>so the question is why I am getting InvocationTargetException.</p><p>Thanks</p>","237115","","","","","2012-05-02 10:53:15","InvocationTargetException on inflating an xml - android","<xml><android><inflate>","2","0","3","",""
"2417427","1","2418724","","2010-03-10 14:04:28","17","11304","<p>For automated testing (using Hudson) I have a script that generates a bunch of emulators for many combinations of Android OS version, screen resolution, screen density and language.<br>This works fine, except for the language part.</p><p>I need to find a way to change the Android system locale automatically.  Here's some approaches I can think of, in order of preference:</p><ul><li>Extracting/editing/repacking a QEMU image directly before starting the emulator</li><li>Running some sort of system-locale-changing APK on the emulator after startup</li><li>Changing the locale settings on the emulator filesystem after startup</li><li>Changing the locale settings in some SQLite DB on the emulator after startup</li><li>Running a key sequence (via the emulator's telnet interface) that would open the settings app and change the locale</li><li><em>Manually</em> starting the emulator for each platform version, changing the locale by hand in the settings, saving it and archiving the images for later deployment</li></ul><p>Any ideas whether this can be done, either via the above methods or otherwise?</p><p>Do you know where locale settings are persisted to/read from by the system?</p><hr><p><strong>Solution:</strong><br>Thanks to dtmilano's info about the relevant properties, and some further investigation on my part, I came up with a solution even better and simpler than all the ideas above!</p><p>I have updated his answer below with the details.</p>","234938","","234938","","2010-03-11 19:54:06","2010-03-18 09:12:38","Changing the Android emulator locale automatically","<android><android-emulator><qemu>","1","4","19","",""
"2417468","1","","","2010-03-10 14:12:35","30","13159","<p>My main activity <code>A</code> has as set <code>android:launchMode=""singleTask""</code> in the manifest. Now, whenever I start another activity from there, e.g. <code>B</code> and press the <code>HOME BUTTON</code> on the phone to return to the home screen and then again go back to my app, either via pressing the app's button or pressing the <code>HOME BUTTON</code>long to show my most recent apps it doesn't preserve my activity stack and returns straight to <code>A</code> instead of the expected activity <code>B</code>.</p><p>Here the two behaviors:</p><pre><code>Expected: A &gt; B &gt; HOME &gt; BActual: A &gt; B &gt; HOME &gt; A (bad!)</code></pre><p>Is there a setting I'm missing or is this a bug? If the latter, is there a workaround for this until the bug is fixed?</p><p>FYI: This question has already been discussed <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/9af9165ae679d337"">here</a>. However, it doesn't seem that there is any real solution to this, yet.</p>","184367","","","","","2013-07-01 07:11:33","Android: bug in launchMode=""singleTask""? -> activity stack not preserved","<android><activity-stack>","4","4","20","",""
"2417781","1","2417975","","2010-03-10 14:50:14","3","217","<p>I was wondering what settings an application can control to improve battery life in the Android environment.  On most laptops, you can control screen brightness, wireless adapter settings, etc, as a means to conserve battery life.  Are there any such controls in Android?</p><p>Thanks!</p>","231768","","418613","","2012-06-12 13:01:26","2012-06-12 13:01:26","What settings can my app control to conserve battery life?","<android><settings><power-management>","1","0","","",""
"2417944","1","2424046","","2010-03-10 15:09:16","2","334","<p>I am trying to use MapView and I want to show in the map some points of interest (like restaurants or stores) near my location. Is there a way in the api to get this kind of list? I know I can do this manually, but first I would need to get the geolocations. So which would be the best way to do this?</p>","265375","","","","","2010-03-11 10:08:57","Get a list of nearest business","<android>","1","2","1","",""
"2418181","1","2418226","","2010-03-10 15:39:59","0","1766","<p>I have this code..    <code><pre><br>            String you = buf.readLine();             Log.d(""STRING"", ikaw);            StringTokenizer st = new StringTokenizer(you);            double lat = Double.parseDouble(st.nextToken());            double lng = Double.parseDouble(st.nextToken());            int type = Integer.parseInt(st.nextToken());            String text = st.nextToken();            Log.d(""File Reading stuff"", ""success = "" + lat);            Log.d(""File Reading stuff"", ""success = "" + lng);            Log.d(""File Reading stuff"", ""success = "" + type);            Log.d(""File Reading stuff"", ""success = "" + text); </pre></code></p><p>How am i suppose to test if it is already the end of file?I don't know how many lines there are in my file and I need to print all of them. I know i should place my code inside a while loop, but I have no idea how to get the end of file. </p>","245385","","","","","2010-03-10 15:44:01","how to get end of file(EOF)","<android><file>","1","0","","",""
"2418679","1","2419298","","2010-03-10 16:39:52","0","1783","<p>i have a listView which uses a custom .xml for showing each item.</p><p>Fine, in this xml i have a CheckBox (with visibility set GONE) and a TextView with a text. </p><p>What i want is have an animation which moves the text to the right and shows the CheckBox.</p><p>I have the animation working fine for one item, but if i want to start it for all the items the problem comes.</p><p>I've tried with a loop over all the items but the animations start at different times (so visually is weird). Also, i've tried with an AnimationSet, but it moves the entire listview to the right instead the TextView (i can't launch the animationset from a single item because only moves that item then).</p><p>So.. anyone could help me?</p><p>Thanks</p>","258863","","","","","2010-08-09 23:07:04","Android Animation for all the items in a list","<android><listview><animation>","2","0","","",""
"2418683","1","2419127","","2010-03-10 16:40:20","9","13324","<p>Does anyone know how to implement a 3D Carousel selector?</p><p>Something like this:<br><img src=""http://cache.mars.sina.com.cn/nd/bbsdigi/attachments/year_09/month_05/2/f/initial.png"" alt=""alt text""> <img src=""http://www.spbsoftwarehouse.com/uploads/images/mobileshell/Screenshots/3/204.png"" alt=""alt text""></p>","243782","","243782","","2010-03-10 17:04:02","2012-11-05 11:27:25","3D Carousel for Android?","<android>","2","7","9","",""
"2419245","1","2419313","","2010-03-10 17:52:46","4","3741","<p>I've found that after changing the overlays on a <code>MapView</code>, the changes aren't seen until the user moves the Map, causing a redraw.  Is there a way to force this redraw?</p>","265669","","","","","2010-03-10 18:03:01","Android: Forcing a MapView to redraw","<android>","1","0","1","",""
"2419246","1","2419329","","2010-03-10 17:52:47","2","864","<p>I want some of the goodies in a ListView, like being able to use a ListAdapter, and item selection, etc, but I don't want the ScrollView portion of it.  I want to implement that part myself, in a different way (why or how I do this isn't really the point of this question, so please don't ask ""why"").</p><p>Is there a way to have a ListView that's not in a ScrollView or has the scrolling disabled?</p>","238849","","510491","","2011-04-08 13:42:11","2011-04-08 13:42:11","How do I create a ListView that's not in a ScrollView, or has the ScrollView disabled?","<android><listview><scrollview>","2","0","3","",""
"2419397","1","2419801","","2010-03-10 18:13:56","0","288","<p>Now that Google Earth has been released for Android 2.1, does anyone know what, if any, plans there are to extend the Google API's to support it in a future version?</p>","252631","","","","","2010-03-11 01:14:13","Does anyone know if Google plans to release an Earth API on Android?","<android><google-api><google-earth>","1","1","","",""
"2419556","1","","","2010-03-10 18:38:02","96","43995","<p>I've started developing Android apps a couple of months ago, and have a few under my belt.  While I can tolerate Java enough to keep developing, I was wondering what success the community has had getting other languages to run.</p><p>I've done some investigation as to how other JVM languages work, and it appears Dalvik messes them up pretty hard.  <a href=""http://clojure.org/"">Clojure</a> seems unable to run, <a href=""http://www.scala-lang.org/node/160"">Scala</a> seems to be one of the most successful. <a href=""http://www.infoworld.com/d/developer-world/ruby-apps-development-readied-android-720"">JRuby</a> has also had some luck, but they caution against anything major.  I've also checked out Scheme via  <a href=""http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-moby-compiler-smartphone/"">Moby</a> and <a href=""http://www.gnu.org/software/kawa/"">Kawa</a>, both of which seem to have some promise.</p><ul><li>What luck have any of you had?  Languages I'm missing, misrepresenting?</li><li>Any non-""Hello World"" apps you've written in non-Java?</li><li>Any snags in trying to get another language to run (e.g. ""as long as you don't use continuations, you're fine in X Scheme"").</li><li>Any particular snags in developing apps non-Java, once you get them to run?</li></ul><p>Thanks, hope you well ^_^</p>","196469","","","","","2013-03-22 09:47:43","Alternatives to Java for Android development?","<android><programming-languages><jvm>","13","1","31","2013-04-03 07:57:14",""
"2420044","1","2872013","","2010-03-10 19:51:37","1","235","<p>I am receiving a SecurityException since yesterday when I launch the service using signature protection level for permission with the default debug keystore. The strange thing is I wasn't receiving this error before yesterday and I didn't make any security related change.</p><p>On the other hand, my own keystore using for releases is still working good. Related AndroidManifest.xml part:</p><pre><code>&lt;permission android:name=""com.my.app.privateservices""    android:protectionLevel=""signature"" /&gt;    &lt;service android:name="".MyService""        android:permission=""com.my.app.privateservices"" /&gt;</code></pre>","40929","","","","","2010-05-20 08:14:56","throws SecurityException when signing with the default debug keystore","<android>","1","0","","",""
"2420181","1","","","2010-03-10 20:06:28","23","18589","<p>I have an EditText field which needs to be a numeric password field. Everything works OK in portrait mode; not in landscape. When the user selects the EditText field, the UI zooms into the field and when I type all the characters are visible.</p><p>I need a numeric keyboard also. I tried setting the input type to text password|number.If I remove ""number"" option everything works right; otherwise no.</p><p>Any suggestions?</p>","","user290861","15825","","2010-03-19 09:54:52","2014-01-02 01:37:05","Android numeric password field","<android><edittext>","7","0","9","",""
"2420288","1","2420299","","2010-03-10 20:21:26","5","5362","<p>Anyone have any idea how I would go about converting a timestamp in milliseconds from <code>1970</code> (from Android's <code>System.currentTimeMillis();</code>) to a UNIX timestamp? It need only be accurate to the day.</p><p>I figure I could divide by <code>1000</code> to get seconds, and then divide by <code>86400</code> (number of seconds in a day) to get the # of days. But I'm not sure where to go from there.</p><p>Many thanks.</p>","290666","","227536","","2013-04-11 08:57:11","2013-04-11 08:57:11","Milliseconds to UNIX timestamp","<java><android>","3","3","1","",""
"2420330","1","","","2010-03-10 20:27:44","1","562","<p>I am using Android 2.1 and Eclipse.</p><p>I have defined a LinearLayout with two components that have dimensions: 250 x 250.</p><pre><code>LinearLayout ll = new LinearLayout(this);ll.setOrientation(LinearLayout.VERTICAL);LinearLayout.LayoutParams llp =   new llp.LayoutParams(250, 250);meter1View = new MeterView(this, ""Meter 1"");ll.addView(meter1View, llp);meter2View = new MeterView(this, ""Meter 2"");ll.addView(meter2View, llp);   ScrollView scrollView = new ScrollView(this);scrollView.addView(ll);setContentView(scrollView);</code></pre><p>So far, so good.  I see two vertical compoments on my emulator screen.</p><p>However, in my Meter View class, the size of the canvas in onDraw is the size of my emulator screen, which is 480 by 800.</p><pre><code>@Overrideprotected void onDraw(Canvas canvas) {    int w = canvas.getWidth();    int h = canvas.getHeight();    Log.i(TAG, ""  onDraw, w: "" + w + "", h: "" + h);}</code></pre><p>I would like a canvas size to be 250 x 250, so that I can pass this canvas to drawing routines. Right now, my drawing routines are drawing outside the 250 x 250 bitmap that was defined by my LinearLayout.</p><p>I realize that I can make my canvas drawing routine to work by translating the canvas, but it would be cleaner if I could temporarily override the original canvas with a new one.</p><p>I understand that I can define my own canvas by:</p><pre><code>Bitmap b = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);Canvas c = new Canvas(b);</code></pre><p>How can I replace the canvas that is created by the View class with my new canvas?Any help will be greatly appreciated.</p><p>Charles</p>","274610","","","","","2010-03-10 21:41:33","How can I override the canvas in my View?","<android><canvas><drawing2d>","2","0","","",""
"2420561","1","","","2010-03-10 21:03:30","2","655","<p>Is it possible to make a service running in backgroud to be notified when an arbritary activity/application is started and ended by a user? I want to use it to log how often and for how long different applications are used in Android. </p>","290744","","126562","","2010-03-10 21:07:16","2012-02-25 12:48:40","Use a service to monitor when other activites/applications start or end","<android><service><activity><monitor><notify>","1","2","2","",""
"2420726","1","2421323","","2010-03-10 21:24:54","5","3645","<p>I'm experimenting with Android's audio recording and playback. Is there a way to enumerate the available audio parameters on my device?</p><p>Right now, when I pass a combination of parameters that the hardware (or emulator) doesn't like, I just get an error. So I am having to ""guess"":</p><pre><code>int bufferSize; int sampleRate;// does the audio hardware do 44 kHz? sampleRate = 44100;bufferSize = AudioRecord.getMinBufferSize(sampleRate,     AudioFormat.CHANNEL_CONFIGURATION_MONO,    AudioFormat.ENCODING_PCM_16BIT);if (bufferSize != AudioTrack.ERROR_BAD_VALUE) {    // Nope, how about 22 kHz?     sampleRate = 22050;}bufferSize = AudioRecord.getMinBufferSize(sampleRate,     AudioFormat.CHANNEL_CONFIGURATION_MONO,    AudioFormat.ENCODING_PCM_16BIT);if (bufferSize != AudioTrack.ERROR_BAD_VALUE) {     ...</code></pre><p>Surely there's a better way! </p><hr><p><a href=""http://developer.android.com/intl/de/guide/appendix/media-formats.html#core"">This chart</a> indicates that the <em>only</em> supported audio input sampling rate is 8 kHz? Is that correct? </p>","65295","","65295","","2010-03-11 02:06:04","2011-02-10 06:44:54","How do I determine audio capabilities on Android?","<android><audio>","1","0","1","",""
"2421060","1","2421184","","2010-03-10 22:16:15","0","5481","<p>I'm trying to populate a list, and my question is how do you bind the list row with multiple items.  So far I have:</p><pre><code>String[] homeLists = getResources().getStringArray(R.array.homeItems); setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.home_item, R.id.homeItemName, homeLists));</code></pre><p>home_item looks like this:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:orientation=""horizontal""&gt;&lt;TextView android:id=""@+id/homeItemName""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""10dp""    android:textSize=""16sp""/&gt;</code></pre><p></p><p>If I add another TextView say ""homeItemDec"", how will I bind both homeItemName and homeItemDesc in my setListAdapter call?</p>","406322","","","","","2013-07-24 00:39:52","Android: Populating multiple items in a listview row","<java><android><listview>","2","0","","",""
"2421189","1","","","2010-03-10 22:37:23","90","36197","<p>What is the version of SQLite used in Android?</p><p>Reason: Im wondering how to handle schema migrations. The newer SQLite versions support an ""ALTER TABLE"" SQL command which would save me having to copy data, drop the table, recreate table and re-insert data.</p>","246793","","179850","","2012-03-23 21:57:35","2013-12-11 03:36:47","Version of SQLite used in Android?","<database><android><sqlite><schema><migration>","3","4","58","",""
"2421432","1","","","2010-03-10 23:21:06","1","899","<p>I am doing a class project on Android OS 1.6. I am considering to use NyARToolkit (Java implementation of ARToolkit for Android). I need to know whether it is possible to get the distance between the camera and a fiducial marker. If possible, how can I get it?</p><p>Please help.</p>","264996","","","","","2010-11-16 19:54:34","Using NyARToolkit is it possible to get distance between camera and the marker?","<java><android><augmented-reality>","1","2","0","",""
"2421487","1","2471179","","2010-03-10 23:34:05","0","170","<p>i'm asking 1.5 and up</p><p>or is it dependant on what's in "".config"" when compiled for my phone?</p><p>(and yes, i know that android has to support processors with soft-float, but several libm on different phones do have hard-float libm)</p><p>(please provide -if possible- any link to/file name of context switching function for msm 7200A/7201A)</p>","194915","","","","","2010-03-25 01:49:06","does android 1.5 saves fpu regs on context switch","<android>","2","0","","",""
"2421496","1","2421554","","2010-03-10 23:35:59","1","304","<p>Besides a drag-and-drop UI designer are there any other missing features when developing for Android?  Does anybody have suggested plugins for Android development in Intellij 9?</p>","97901","","114066","","2010-03-11 08:50:03","2011-04-30 00:27:05","What features for Android development are missing in Intellij9 compared to Eclipse?","<android><eclipse><intellij-idea>","2","0","","2012-08-09 12:48:08",""
"2421572","1","2421627","","2010-03-10 23:52:11","1","1232","<p>I was thinking about this earlier and figured I'd ask.</p><p>If I made an application that has lots of resources, what would stop someone from extracting and adding/modifying the resources I ship with it?</p><p>Does an application that doesn't want its data manipulated have any sort of option to protect itself?</p>","128991","","","","","2010-03-11 00:02:54","Is there any facility to protect the contents of an APK from user modification?","<android><resources><drm><apk>","1","0","","",""
"2421636","1","2421669","","2010-03-11 00:05:11","2","821","<p>I am working on getting familiar with the Android SDK and I have having a hard time getting the UI side of things figured out. I am trying to create a <em>menu</em>, kind of like how apps are listed in the market place or how the contact list works. Where I would have basically a list view and treat each item in the list as a button, so I can display information based on their selection. </p><p>Does anyone have any good examples/tutorials/guides/resources I can look at to try and get a better idea of how this works?</p><p>Thanks,Rob</p>","289153","","14343","","2010-07-16 19:17:52","2013-04-13 21:03:22","Recommendations for Android programming resources","<android><android-ui>","3","1","3","2013-04-14 12:33:47",""
"2421639","1","","","2010-03-11 00:07:18","2","1024","<p>I have a database that I have already populated locally.  I want to bundle it with my applications and access it at runtime (never want to re-write it anywhere, nor write to the database, simply read).  What is the path of a file that I have added to the bundle? And, can i use that path with a SQLiteDatabase.openDatabase ?</p>","291059","","","","","2010-03-11 06:02:47","Android: is it possible to access a sqlite file that is bundled with my application?","<database><android><sqlite><package>","1","1","1","",""
"2421826","1","","","2010-03-11 00:53:43","33","77089","<p>What is Android's file system?</p>","291077","","1094541","","2013-09-25 04:49:20","2014-03-19 17:58:09","What is Android's file system??","<android><filesystems>","7","0","7","",""
"2421941","1","2422199","","2010-03-11 01:31:53","1","143","<p>I've got an Android app which has a periodic background Service.  I want this Service to react differently depending on whether <em>any</em> Activities in my application are open.  The issue is that the Service just keeps itself running via the <code>AlarmManager</code> making it on kind of on a separate ""track"" from the Activities, so I don't know whether the application is open when it runs.</p><p>The best solution I can think of is to flip a boolean on/off whenever onResume() or onPause() is called in all my Activities, but this seems like a lot of footwork.  Is there a simpler, more elegant solution?</p>","60261","","","","","2010-03-11 02:48:15","How can you tell if any Activity in your application is foregrounded?","<android><service>","1","0","","",""
"2422022","1","2422108","","2010-03-11 01:49:54","11","17386","<p>In the iPhone or Android, if you have a JQuery Slider, it doesn't quite work (touchscreen will move the screen instead of drag the slider.)</p>","179736","","","","","2012-10-22 06:20:45","How do I make a JQuery Slider-like feature on iPhone/Android web app?","<javascript><jquery><iphone><android><slider>","6","0","8","",""
"2422057","1","","","2010-03-11 02:00:40","0","357","<p>I have the following routine in a subclass of view:</p><p>It calculates an array of points that make up a line, then erases the previous lines, then draws the new lines (impact refers to the width in pixels drawn with multiple lines). The line is your basic bell curve, squeezed or stretched by variance and x-factor.</p><p>Unfortunately, nothing shows on the screen. A previous version with drawPoint() and no array worked, and I've verified the array contents are being loaded correctly, and I can see that my onDraw() is being triggered. </p><p>Any ideas why it might not be drawn? Thanks in advance! </p><pre><code> protected void drawNewLine( int maxx, int maxy, Canvas canvas, int impact, double  variance,  double xFactor, int color) {  // impact = 2 to 8; xFactor between 4 and 20; variance between 0.2 and 5  double x = 0;  double y = 0;  int cx = maxx / 2;  int cy = maxy / 2;  int mu = cx;  int index = 0;  points[maxx&lt;&lt;1][1] = points[maxx&lt;&lt;1][0];  for (x = 0; x &lt; maxx; x++) {   points[index][1] = points[index][0];   points[index][0] = (float) x;   Log.i(DEBUG_TAG, ""x: "" + x);   index++;   double root = 1.0 / (Math.sqrt(2 * Math.PI * variance));   double exponent = -1.0 * (Math.pow(((x - mu)/maxx*xFactor), 2) / (2 * variance));   double ePow = Math.exp(exponent);   y = Math.round(cy * root * ePow);   points[index][1] = points[index][0];   points[index][0] = (float) (maxy - y - OFFSET);   index++;  }  points[maxx&lt;&lt;1][0] = (float) impact;  for (int line = 0; line &lt; points[maxx&lt;&lt;1][1]; line++) {   for (int pt = 0; pt &lt; (maxx&lt;&lt;1); pt++) {    pointsToPaint[pt] = points[pt][1];   }   for (int skip = 1; skip &lt; (maxx&lt;&lt;1); skip = skip + 2)                                pointsToPaint[skip] = pointsToPaint[skip] + line;   myLinePaint.setColor(Color.BLACK);   canvas.drawLines(pointsToPaint, bLinePaint); // draw over old lines w/blk  }   for (int line = 0; line &lt; points[maxx&lt;&lt;1][0]; line++) {   for (int pt = 0; pt &lt; maxx&lt;&lt;1; pt++) {    pointsToPaint[pt] = points[pt][0];   }   for (int skip = 1; skip &lt; maxx&lt;&lt;1; skip = skip + 2)                           pointsToPaint[skip] = pointsToPaint[skip] + line;   myLinePaint.setColor(color);   canvas.drawLines(pointsToPaint, myLinePaint); / new color  } }</code></pre><p>update: Replaced the drawLines() with drawPoint() in loop, still no joy<br /></p><pre><code>    for (int p = 0; p&lt;pointsToPaint.length; p = p + 2) {      Log.i(DEBUG_TAG, ""x "" + pointsToPaint[p] + "" y "" + pointsToPaint[p+1]);      canvas.drawPoint(pointsToPaint[p], pointsToPaint[p+1], myLinePaint);    }///         canvas.drawLines(pointsToPaint, myLinePaint);</code></pre>","468291","","468291","","2010-03-11 02:25:17","2012-04-05 14:08:24","onDraw() triggered but results don't show","<android><drawing>","2","0","","",""
"2422120","1","","","2010-03-11 02:22:38","35","17698","<p>Is it possible to create an Android shape object with stroke on only certain sides?</p><p>Eg I have:</p><pre><code>&lt;stroke  android:width=""3dip""  android:color=""#000000""    android:dashWidth=""10dip""     android:dashGap=""6dip"" /&gt;</code></pre><p>Which is similar to this CSS:</p><pre><code>border: 3px dashed black;</code></pre><p>How can I set the stroke on just one side? This is how I would do it in CSS:</p><pre><code>border-left: 3px dashed black;</code></pre><p>How do you do this in Android XML?</p>","291112","","","","","2014-04-07 17:57:03","Open-sided Android stroke?","<android>","5","0","15","",""
"2422378","1","2431427","","2010-03-11 03:38:11","71","10620","<p>When I attempt to run the following test in <a href=""http://en.wikipedia.org/wiki/IntelliJ_IDEA"">IntelliJ IDEA</a> I get the message:</p><blockquote>  <p>!!! JUnit version 3.8 or later expected:</p></blockquote><p>It should be noted that this is an <a href=""http://en.wikipedia.org/wiki/Android_%28operating_system%29"">Android</a> project I am working on in IntelliJ IDEA 9.</p><pre><code>public class GameScoreUtilTest {    @Test    public void testCalculateResults() throws Exception {        final Game game = new Game();        final Player player1 = new Player();        {            final PlayedHole playedHole = new PlayedHole();            playedHole.setScore(1);            game.getHoleScoreMap().put(player1, playedHole);        }        {            final PlayedHole playedHole = new PlayedHole();            playedHole.setScore(3);            game.getHoleScoreMap().put(player1, playedHole);        }        final GameResults gameResults = GameScoreUtil.calculateResults(game);        assertEquals(4, gameResults.getScore());    }}</code></pre><p>The full stack trace looks like this...</p><pre><code>!!! JUnit version 3.8 or later expected:java.lang.RuntimeException: Stub!    at junit.runner.BaseTestRunner.&lt;init&gt;(BaseTestRunner.java:5)    at junit.textui.TestRunner.&lt;init&gt;(TestRunner.java:54)    at junit.textui.TestRunner.&lt;init&gt;(TestRunner.java:48)    at junit.textui.TestRunner.&lt;init&gt;(TestRunner.java:41)    at com.intellij.rt.execution.junit.JUnitStarter.junitVersionChecks(JUnitStarter.java:152)    at com.intellij.rt.execution.junit.JUnitStarter.canWorkWithJUnitVersion(JUnitStarter.java:136)    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:49)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:110)Process finished with exit code -3</code></pre>","97901","","63550","","2010-03-12 09:51:36","2013-06-14 21:03:58","IntelliJ IDEA with Junit 4.7 ""!!! JUnit version 3.8 or later expected:""","<java><android><junit><intellij-idea>","2","3","15","",""
"2422490","1","","","2010-03-11 04:12:01","0","180","<p>I'm having trouble getting the compressed jpeg image (stored as a blob in my database). </p><p>here is the snippet of code I use to output the image that I have in my database:</p><pre><code>if($row = mysql_fetch_array($sql)){    $size = $row['image_size'];    $image = $row['image'];    if($image == null){        echo ""no image!"";    } else {       header('Content-Type: content/data');       header(""Content-length: $size"");       echo $image;    }}</code></pre><p>here is the code that I use to read in from the server:</p><pre><code>        URL sizeUrl = new URL(MYURL);        URLConnection sizeConn = sizeUrl.openConnection();        // Get The Response        BufferedReader sizeRd = new BufferedReader(new InputStreamReader(sizeConn.getInputStream()));        String line = """";        while(line.equals("""")){            line = sizeRd.readLine();        }        int image_size = Integer.parseInt(line);        if(image_size == 0){            return null;        }        URL imageUrl = new URL(MYIMAGEURL);        URLConnection imageConn = imageUrl.openConnection();        // Get The Response        InputStream imageRd = imageConn.getInputStream();        byte[] bytedata = new byte[image_size];        int read = imageRd.read(bytedata, 0, image_size);        Log.e(""IMAGEDOWNLOADER"", ""read ""+ read + "" amount of bytes"");        Log.e(""IMAGEDOWNLOADER"", ""byte data has length "" + bytedata.length);        Bitmap theImage = BitmapFactory.decodeByteArray(bytedata, 0, image_size);        if(theImage == null){            Log.e(""IMAGEDOWNLOADER"", ""the bitmap is null"");        }        return theImage;</code></pre><p>My logging shows that everything has the right length, yet theImage is always null.I'm thinking it has to do with my content type. Or maybe the way I'm uploading?</p>","116305","","","","","2010-05-28 01:00:05","Reading in bytes produced by PHP script in Java to create a bitmap","<java><php><database><android><bitmap>","1","0","","",""
"2422562","1","","","2010-03-11 04:36:26","79","86814","<p>I was wondering if someone could help me out. I am trying to create a custom AlertDialog. In order to do this, I added the following line of code in styles.xml</p><p>   @drawable/color_panel_background </p><ul><li>color_panel_background.9.png is located in drawable folder. This is also available in Android SDK res folder.</li></ul><p>The following is the main activity.</p><pre><code>package com.customdialog;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.content.DialogInterface;import android.os.Bundle;public class CustomDialog extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        this.setTheme(R.style.CustomAlertDialog);        AlertDialog.Builder builder = new AlertDialog.Builder(this);        builder.setMessage(""HELLO!"");        builder .setCancelable(false)          .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {           public void onClick(DialogInterface dialog, int id) {               //MyActivity.this.finish();           }       })       .setNegativeButton(""No"", new DialogInterface.OnClickListener() {           public void onClick(DialogInterface dialog, int id) {               //dialog.cancel();           }       });        AlertDialog alertdialog = builder.create();        alertdialog.show();    }}</code></pre><p>In order to apply the theme to an AlertDialog, I had to set the theme to the current context.</p><p>However, I just can't seem to get the app to show customized AlertDialog. Can anyone help me out with this, and thank you very much in advance!</p>","291171","","842697","","2013-02-12 07:51:27","2014-03-07 18:34:03","How to change theme for AlertDialog","<android><dialog><themes><alert>","9","2","38","",""
"2422689","1","2423993","","2010-03-11 05:13:45","2","3628","<p>I have to create a custom compound button bar control in Android like the one <a href=""http://www.coated.com/wp-content/uploads/2009/11/slacker-radio-android-application.jpg"" rel=""nofollow"">here</a>. To create a button bar like this, I am thinking of extending a LinearLayout and add my buttons to it. The buttons have a black background but with a gradient fill; I am not keen on using PNGs since the color of the buttons can change at runtime. </p><p>How can I get similar effect in Android? </p><p>Thanks.</p>","291191","","","","","2010-03-11 10:00:36","Creating a Custom Compound Button Bar","<android>","1","0","2","",""
"2422869","1","","","2010-03-11 05:54:12","0","360","<p>Is there a particular flag that we can use to prevent apps showing up in marketplace which require the phone to have a camera flash /LED? Typical apps are ones which make the phone act like a torchlight in dark. I have seen a tag which prevents apps requiring autofocus in a camera from appearing in the marketplace. </p><p>Just looking to find out if there is something similar for camera flash.</p>","291215","","23897","","2010-03-11 05:57:35","2010-04-30 09:31:20","Prevent application requiring LED or camera flash from Android marketplace","<android><marketplace>","2","0","","",""
"2423006","1","","","2010-03-11 06:24:37","1","674","<p>I would like to program an application for Android that when installed would add an item to the context menu that pops up when you long-press on a call record in the call log tab in the built-in contacts program. Is this possible?</p><p>If so, any links that could point me in the right direction for the required code to add my option to that menu?</p>","291225","","1101070","","2012-03-06 01:00:09","2012-03-06 01:00:09","Add option to phone log context menu","<android><contextmenu>","1","1","2","",""
"2423193","1","2423619","","2010-03-11 07:12:38","1","1361","<p>My open-source Android application uses this in an SQL query:  </p><pre><code>String.format(""%f"", someDoubleValue);</code></pre><p>Unfortunately, in some languages the coma is "","" instead of ""."" and the SQL engine does not like it.</p><p>What is the best way to convert a double to a SQL-friendly string on Android?  </p>","226958","","56555","","2010-03-11 07:23:39","2010-03-11 09:31:19","Convert a double to a SQL-friendly string on Android?","<java><android><sqlite>","1","6","1","",""
"2423233","1","","","2010-03-11 07:22:09","2","647","<p>The views are not cached in a ViewFlipper. Is there a way wherein we can get an image of the view and show it to user so that he sees the Ui as we see on Home scrren(when we swipe the previous view also moves along and when we lift our finger, only then the next view is shown completely.)</p><p>What I want to do is that when the user starts moving his finegr on screen, the view should also move along(create an image of view).</p><p>I am not getting to do this, as when we swipe the present view goes and next view comes, we do not get both visible when we r moving our finger on screen.</p><p>Please if anyone gets what I am trying to do, do help me.</p><p>Thanks,Farha</p>","285052","","285052","","2010-03-11 08:31:48","2010-03-11 08:37:49","ViewFlipper caching issue","<android>","1","0","1","",""
"2423327","1","2426222","","2010-03-11 07:48:04","12","31224","<p>I am trying to draw an animation.  To do so I have extended View and overridden the onDraw() method.  What I would expect is that each time onDraw() is called the canvas would be in the state that I left it in and I could choose to clear it or just draw over parts of it (This is how it worked when I used a SurfaceView) but each time the canvas comes back already cleared.  Is there a way that I can not have it cleared?  Or maybe save the previous state into a Bitmap so I can just draw that Bitmap and then draw over top of it?</p>","236136","","881229","","2013-12-12 06:02:42","2013-12-12 06:02:42","Android View.onDraw() always has a clean Canvas","<android><android-canvas><android-ui>","3","0","8","",""
"2423498","1","2425764","","2010-03-11 08:31:07","12","26368","<p>I'm working on an application that needs to get the source of a web page from a link, and then parse the html from that page. </p><p>Could you give me some examples, or starting points where to look to start writing such an app?</p>","267269","","114066","","2010-03-11 09:22:31","2013-09-26 14:33:21","How to get the html-source of a page from a html link in android?","<html><android><android-emulator>","4","4","4","",""
"2423693","1","","","2010-03-11 09:12:44","0","198","<p>I'm trying to find the standard Android image used in Android 1.6 for an SMS action.  The one that can be seen under contact details that looks like a postcard.</p><p>I noticed that there was a standard image ""sys_action_sms"" which looked like a chat bubble in Android 1.0, but apparently that was removed at some point.</p>","291323","","","","","2010-03-11 09:37:01","Standard SMS image in Android 1.6+","<android>","1","0","","",""
"2423916","1","2425134","","2010-03-11 09:47:01","0","296","<p>I want to send video files from the Android via network to server. How can I serialize video files in Android?</p>","283494","","","","","2010-03-11 13:17:12","Android: Serializing video files","<android><serialization><video>","1","0","","",""
"2424149","1","","","2010-03-11 10:27:36","1","10009","<p>I have a TableLayout which is in a ScrollView, so I get vertical scroll. But when the columns exceed the screen with, I want the horizontal scroll also.</p><p>How can I do this? Please help.</p><p>Thanks,Farha</p>","285052","","","","","2013-05-29 05:04:53","Horizontal scroll required(Android)","<android>","5","1","2","",""
"2424153","1","2424218","","2010-03-11 10:28:17","1","4548","<p>Which permission needs my application to get access to the location of the user on Android?</p>","114066","","","","","2010-03-11 11:25:41","Which permission do I have to add to the manifest to get gps sensor readings?","<android><permissions><location><manifest>","1","0","1","",""
"2424251","1","","","2010-03-11 10:45:03","0","4154","<p>In my Android app, I have a LinearLayout View that contains other views.  The LinearLayout is clickable, but when it is clicked, it does not flash orange like it should.</p><p>How can I get it to flash?</p>","291323","","1101070","","2012-03-06 01:03:56","2012-03-06 01:03:56","Clickable LinearLayout not flashing on click","<android>","2","1","4","",""
"2424404","1","2424630","","2010-03-11 11:15:58","2","4215","<p>I try to send gps longitude and latitude to the android emulator with eclipse, but the values seem to never be set. Instead the onStatusChanged method of my listener is called. <strong>Edit</strong> I send those values through the emulator controls in the ddms view in eclipse.</p><p>If I send data via telnet I get the correct data shown and the onLocationChanged method of my listener is changed. </p>","114066","","114066","","2010-03-11 11:41:35","2013-07-11 10:19:31","I can't send gps values via the eclipse emulator control panel","<android><gps><android-emulator>","3","0","1","",""
"2424488","1","2427385","","2010-03-11 11:28:22","32","62493","<p>I have Activity <code>A</code> with <code>android:launchMode=""singleTop""</code> in the manifest.</p><p>If I go to Activity <code>B</code>, <code>C</code> and <code>D</code> there I have menu shortcuts to return to my applications root activity (<code>A</code>). </p><p>The code looks like this:</p><pre><code>Intent myIntent = new Intent(getBaseContext(), MainActivity.class);startActivity(myIntent);</code></pre><p>However, instead of returning to the already existing instance <code>A</code> of my <code>MainActivity.class</code> it creates a new instance -> it goes to <code>onCreate()</code> instead of <code>onNewIntent()</code>. </p><p>This is not the expected behavior, right?</p>","184367","","","","","2012-10-19 22:41:45","Android: new Intent() starts new instance with android:launchMode=""singleTop""","<android><activity><android-intent>","4","0","21","",""
"2424544","1","","","2010-03-11 11:40:10","0","450","<p>I want to run automated tests with location on the android emulator.<br>I can setup coordinates via Telnet, but that means starting up a console and manually configuring the emulator before running my junit tests.  </p><p>Is there a possibility to preconfigure the emulator with a KML file or something like that to ensure that there are always coordinates available? </p>","114066","","","","","2010-04-21 22:00:03","Preconfigure Android Emulator with location?","<android><unit-testing><location><android-emulator>","1","0","","",""
"2424564","1","4916433","","2010-03-11 11:43:06","18","8840","<p>Is it possible to activate the network location provider on the android emulator? Maybe with a fake cellid?</p>","114066","","","","","2011-02-07 14:11:24","Activating Network Location Provider in the Android Emulator?","<android><location><android-emulator>","2","5","3","",""
"2424809","1","","","2010-03-11 12:25:38","1","740","<p>I tried to construct SlidingDrawer widget programmatically, but had no luck. The JavaDoc says the constructor needs ""AttributeSet attrs"" parameter, which is ""a specified set of attributes defined in XML"". I provided my own implementation of AttributeSet interface, with all the attributes mentioned in JavaDoc, but got a weird ClassCastException - it seems that it assumes the attrs parameter is of type TypedArray, which seems to be impossible to use as base class (constructor hidden). Is there a way to construct SlidingDrawer programmatically and what is the correct contract to use it ? It is no way clear from the documentation. </p>","131115","","","","","2010-03-11 15:35:02","What is the contract for constructing SlidingDrawer widget?","<android>","1","0","1","","2010-03-11 12:25:38"
"2424945","1","8021985","","2010-03-11 12:45:52","5","2043","<p>I am porting a Python application to Android and, at some point, this application has to communicate with a Web Service, sending it compressed data.</p><p>In order to do that it uses the next method:</p><pre><code>def stuff(self, data):    ""Convert into UTF-8 and compress.""    return zlib.compress(simplejson.dumps(data))</code></pre><p>I am using the next method to try to emulate this behavior in Android:</p><pre><code>private String compressString(String stringToCompress){    Log.i(TAG, ""Compressing String "" + stringToCompress);    byte[] input = stringToCompress.getBytes();     // Create the compressor with highest level of compression     Deflater compressor = new Deflater();     //compressor.setLevel(Deflater.BEST_COMPRESSION);     // Give the compressor the data to compress     compressor.setInput(input);     compressor.finish();     // Create an expandable byte array to hold the compressed data.     // You cannot use an array that's the same size as the orginal because     // there is no guarantee that the compressed data will be smaller than     // the uncompressed data.     ByteArrayOutputStream bos = new ByteArrayOutputStream(input.length);     // Compress the data     byte[] buf = new byte[1024];     while (!compressor.finished())     {         int count = compressor.deflate(buf);         bos.write(buf, 0, count);     }     try {         bos.close();     } catch (IOException e)     {     }     // Get the compressed data     byte[] compressedData = bos.toByteArray();     Log.i(TAG, ""Finished to compress string "" + stringToCompress);    return new String(compressedData);}</code></pre><p>But the HTTP response from the server is not correct and I guess it is because the result of the compression in Java is not the same as the one in Python.</p><p>I ran a little test compressing ""a"" both with zlib.compress and deflate.</p><p>Python, zlib.compress() -> x%9CSJT%02%00%01M%00%A6</p><p>Android, Deflater.deflate -> H%EF%BF%BDK%04%00%00b%00b</p><p>How should I compress the data in Android to obtain the same value of zlib.compress() in Python?</p><p>Any help, guidance or pointer is greatly appreciated!</p>","222900","","222900","","2010-03-11 12:56:40","2011-11-05 17:40:58","Are zlib.compress on Python and Deflater.deflate on Java (Android) compatible?","<java><python><android><zlib><deflate>","3","1","","",""
"2424976","1","","","2010-03-11 12:51:56","1","1243","<p>Any one please help me to solve my camera preview issue. am using a nexus one am setting the camera parameters to 640,480. but its showing force close errormy code is as follows</p><pre><code>public class CameraPreview extends Activity {        private Preview mPreview;    public static ProgressDialog pdDetail;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // Hide the window title.        requestWindowFeature(Window.FEATURE_NO_TITLE);        // Create our Preview view and set it as the content of our activity.        mPreview = new Preview(this);        setContentView(mPreview);    }    public boolean onKeyDown(int keyCode, KeyEvent event) {        if (keyCode == KeyEvent.KEYCODE_BACK) {            if(mPreview.myIntent!=null){                setResult(android.app.Activity.RESULT_OK,mPreview.myIntent);                finish();            }            return super.onKeyDown(keyCode, event);        }        if (keyCode == KeyEvent.KEYCODE_SPACE ||keyCode == KeyEvent.KEYCODE_CAMERA || keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {            mPreview.captureImage();            pdDetail = ProgressDialog.show(this, null , null,true,false);            return true;        }        return false;    }}// ----------------------------------------------------------------------class Preview extends SurfaceView implements SurfaceHolder.Callback {    SurfaceHolder mHolder;    Camera mCamera;    Intent myIntent = null;    Context appContext;    Preview(Context context) {        super(context);        appContext = context;        // Install a SurfaceHolder.Callback so we get notified when the        // underlying surface is created and destroyed.        mHolder = getHolder();        mHolder.addCallback(this);        mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);    }    public void surfaceCreated(SurfaceHolder holder) {        // The Surface has been created, acquire the camera and tell it where        // to draw.        mCamera = Camera.open();        try {           mCamera.setPreviewDisplay(holder);        } catch (IOException exception) {            mCamera.release();            mCamera = null;            // Add more exception handling logic here        }    }    public void surfaceDestroyed(SurfaceHolder holder) {        // Surface will be destroyed when we return, so stop the preview.        // Because the CameraDevice object is not a shared resource, it's very        // important to release it when the activity is paused.        mCamera.stopPreview();        mCamera.release();        mCamera = null;    }    public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {        // Now that the size is known, set up the camera parameters and begin        // the preview.        //TODO Fix There is a simple work-around for HERO. In the surfaceChanged method simply swap the        //width and height in setPreviewSize when in portrait mode.        Camera.Parameters parameters = mCamera.getParameters();        parameters.setPictureSize(640,480);  //800,300        parameters.setPreviewSize(w, h);        mCamera.setParameters(parameters);        mCamera.startPreview();    }    Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() {        public void onPictureTaken(byte[] data, Camera c) {            myIntent = new Intent();            myIntent.putExtra(""bitmapData"", true);            Bitmap b = BitmapFactory.decodeByteArray(data, 0, data.length);            saveFile(b);//TODO Unable to Store Image. Problem with SD Card            //mCamera.startPreview();            if(CameraPreview.pdDetail.isShowing()){                CameraPreview.pdDetail.cancel();                //CameraPreview.pdDetail.dismiss();            }        }    };    private boolean saveFile(Bitmap bitmap){        boolean status = false;        try {            String externalStorageState = Environment.getExternalStorageState();            URI uri = null;            //String name = appContext.getFilesDir().getAbsolutePath()+""/""+""camera.jpg"";            if(externalStorageState.equalsIgnoreCase(""mounted"")){                //In SD Card                //uri = URI.create(""file://""+Environment.getExternalStorageDirectory()+""/ExpenseTracker/"");                //File sddir = new File(uri);                 /*File file = new File(uri);                if(!file.exists()){                    boolean mkdirs = file.mkdirs();                }*/                uri = URI.create(""file://""+Environment.getExternalStorageDirectory()+""/ExpenseTracker/""+""camera.jpg"");                File file = new File(uri);                file.mkdirs();                 file.delete();                file.createNewFile();                FileOutputStream fos = new FileOutputStream(file);                ByteArrayOutputStream baos = new ByteArrayOutputStream();                   //bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos); //bitmap is the bitmap object                    bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);                 byte[] b = baos.toByteArray();                  fos.write(b);                fos.flush();                fos.close();                status = true;            }else{                //uri = URI.create(""file://""+name);                /*FileOutputStream out = appContext.openFileOutput(""camera.jpg"", android.app.Activity.MODE_APPEND);                 BufferedOutputStream bos = new BufferedOutputStream(out,8192);                 bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);                 bos.flush();                 bos.close();*/                 status = true;            }        } catch (IOException ex) {         }        return status ;    }    public void captureImage(){        mCamera.takePicture(shutterCallback, rawCallback, mPictureCallback);    }    ShutterCallback shutterCallback = new ShutterCallback() {        public void onShutter() {            // Do something when the shutter closes.        }    };    PictureCallback rawCallback = new PictureCallback() {        public void onPictureTaken(byte[] _data, Camera _camera) {            // Do something with the image RAW data.        }    };}</code></pre><p>please help me to find my error .....</p>","244540","","13070","","2010-03-11 15:25:22","2011-06-09 16:14:56","camera preview parameters of Nexus one?","<android>","2","1","","",""
"2425472","1","","","2010-03-11 14:02:11","0","6780","<p>I am displaying some event data based on the todays event and a list of events in a week. Currently I am displaying all the events in form of list from the file, As the file contains out dated events as well but I want to display on the basis of today's date events and a week events then week after. In short I want to restrict the list on the basis of this and extract information. I know there is a class <code>java.util</code> containing <code>Date</code> class, but need some quick idea and help how can I do this? Can anyone quote example?</p><p>Thanks</p>","257580","","","","","2011-01-28 15:38:22","Using date functions in android application?","<android><eclipse><datetime>","2","0","0","",""
"2425741","1","2425842","","2010-03-11 14:34:28","0","1424","<p>I wanted to know what is the maximum size of the file that we can attach with e-mail in android? Or is the attachment limit completely dependent on E-mail that we have configured ???</p>","237577","","1069068","","2013-03-19 14:40:47","2013-03-19 14:40:47","What is the E-mail Attachment limitation in android?","<android>","2","0","","",""
"2425774","1","2426487","","2010-03-11 14:37:42","2","17065","<p>I am trying to open a Socket on Android but everytime I try I keep getting connection refused error no matter what way I try.</p><p>The error happens on the following line of code where I try to create the connection.</p><hr><pre><code>Socket socket = new Socket(getLocalIpAddressString(), 8008);</code></pre><hr><p>The following is the method I use to get the local ip address:</p><hr><pre><code>public static String getLocalIpAddressString() { try {     for (Enumeration&lt;NetworkInterface&gt; en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {         NetworkInterface intf = en.nextElement();         for (Enumeration&lt;InetAddress&gt; enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {             InetAddress inetAddress = enumIpAddr.nextElement();             if (!inetAddress.isLoopbackAddress()) {                 return inetAddress.getHostAddress().toString();             }         }     } } catch (SocketException ex) {     Log.e(""IPADDRESS"", ex.toString()); } return null;</code></pre><p>}</p><hr><p>And the error I get is:</p><hr><pre><code>WARN/System.err(3574): java.net.ConnectException: /192.168.2.163:8008 - Connection refusedWARN/System.err(3574):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:237)WARN/System.err(3574):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:199)WARN/System.err(3574):     at java.net.Socket.startupSocket(Socket.java:734)WARN/System.err(3574):     at java.net.Socket.&lt;init&gt;(Socket.java:157)WARN/System.err(3574):     at com.networks.phone.engine.SIPEngine.rtpTest(SIPEngine.java:1444)</code></pre><hr><p>I presume its an error with my Ipaddress and or port? But can anyone point me in the right direction as to what might be the cause?</p>","243999","","243999","","2010-04-27 08:23:12","2012-02-08 11:22:56","Android Socket connection refused","<java><android><sockets><ip-address>","4","6","1","",""
"2426305","1","2487721","","2010-03-11 15:38:45","3","228","<p>I have an XML based file format that I'm using to store and load instances of objects.  I'm interested in adding some scripting support to those objects so that they can respond to events.</p><p>That said, I also don't want to cripple performance.  Are there any well known scripting options for Android - maybe even ones where while loading, I can pre-compile and cache the scripts?</p>","128991","","","","","2010-03-21 16:08:09","What's the best way to add scripting to an Android app?","<android><scripting>","2","1","","",""
"2426456","1","2426999","","2010-03-11 15:54:50","1","604","<p>I am developing a small app for Android. I am creating my own view.</p><p>I am planning to design the layout to be:</p><pre><code>&lt;LinearLayout&gt;   &lt;MyView&gt;   &lt;Button&gt;&lt;Button&gt;&lt;/LinearLayout&gt;</code></pre><p>But when I run my program, my custom view will cover the whole screen. Is there anyway to avoid this?</p><p>I have already tried to add <code>android:layout_width</code>, <code>layout_height</code> to be <code>wrap_content</code>, <code>fill_partent</code>, but no luck.</p>","255300","","12707","","2010-03-11 15:55:49","2010-03-11 20:27:45","How to put Custom View above built in views in Android?","<android>","3","0","","",""
"2426797","1","","","2010-03-11 16:34:31","2","436","<p>I'm writing an Android game in Java and I need a robust way to save and load application state quickly. The question seems to apply to most OO languages.</p><p>To understand what I need to save: I'm using a Strategy pattern to control my game entities. The idea is I have a very general Entity class which e.g. stores the location of a bullet/player/enemy and I then attach a Behaviour class that tells the entity how to act:</p><pre><code>class Entiy { float x; float y; Behavior b; }abstract class Behavior { void update(Entity e); {}// Move about at a constant speedclass MoveBehavior extends Behavior { float speed; void update ... }// Chase after another entityclass ChaseBehavior extends Behavior { Entity target; void update ... }// Perform two behaviours in sequenceclass CombineBehavior extends Behavior { Behaviour a, b; void update ... }</code></pre><p>Essentially, Entity objects are easy to save but Behaviour objects can have a semi-complex graph of dependencies between other Entity objects and other Behaviour objects. I also have cases where a Behaviour object is shared between entities. I'm willing to change my design to make saving/loading state easier, but the above design works really well for structuring the game.</p><p>Anyway, the options I've considered are:</p><ul><li><p>Use Java serialization. This is meant to be really slow in Android (I'll profile it sometime). I'm worried about robustness when changes are made between versions however.</p></li><li><p>Use something like JSON or XML. I'm not sure how I would cope with storing the dependencies between objects however. Would I have to give each object a unique ID and then use these IDs on loading to link the right objects together? I thought I could e.g. change the ChaseBehaviour to store a ID to an entity, instead of a reference, that would be used to look up the Entity before performing the behaviour. </p></li></ul><p>I'd rather avoid having to write lots of loading/saving code myself as I find it really easy to make mistakes (e.g. forgetting to save something, reading things out in the wrong order).</p><p>Can anyone give me any tips on good formats to save to or class designs that make saving state easier?</p>","291669","","8047","","2010-08-31 19:32:41","2010-08-31 19:32:41","Robust way to save/load objects with dependencies?","<java><android>","2","1","","",""
"2427000","1","2427083","","2010-03-11 17:00:18","-1","1478","<p>i have this tag as input tag:</p><pre><code>&lt;a href=""controller.jsp?sid=127490C88DB5&amp;R=35144"" class=""11-link-dkred-bold""&gt;&lt;b&gt;Mr. John Q. Anderson&amp;nbsp;&amp;nbsp;&amp;nbsp;MBA 1977 E&lt;/a&gt;</code></pre><p>in this i want get the value</p><p><strong>Mr. John Q. Anderson&nbsp;&nbsp;&nbsp;MBA 1977 E</strong></p><p>wat is patten value for this in regex?</p>","267269","","","","","2013-04-07 05:49:29","what is Regex pattern for html tag in java or android?","<java><android><regex>","2","5","","",""
"2427089","1","2427224","","2010-03-11 17:10:47","0","133","<p>When you use the Google map api, it is not part of the Android SDK, and you have to mention it in your manifest xml file.</p><p>Do you have to do anything to access the jar file containing the map api code?  Or is that automatically present on the device or emulator, the way the SDK code is?</p><p>Do you need put the map api jar file in your class path, either when compiling or when executing?  Or is it kept somewhere where it is already visible, and the requirement of an XML mention is merely to remind you of the licensing issue?</p>","253661","","1777090","","2013-01-16 06:38:54","2013-01-16 06:38:54","Quick check on use of map api (android)","<android><api><map><classpath>","1","0","","",""
"2427122","1","","","2010-03-11 17:14:25","3","1551","<p>I'm writing an app that will host widgets. The app has custom view (which probably is the source of issue). I obtain AppWidgetHostView like this</p><pre><code>private AppWidgetHostView widget;...AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId);widget = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo); widget.setAppWidget(appWidgetId, appWidgetInfo);mView.addWidget(widget, appWidgetInfo);</code></pre><p>mView.addWidget() basically just remembers this AppWidgetHostView instance and then mView draws it directly onto canvas. Visually everything is fine - I can see the actual widget. But the issue is with reacting on UI events. Please advise what needs to be done in the parent view in order to correctly trigger handlers in the widgets like onClick().</p><p>Notes:</p><ol><li><p>I used standard widgets which normally react on click events. None worked.</p></li><li><p>I also created my own test widget with listener (via views.setOnClickPendingIntent(R.id.appwidget_text, pending);) and onClick() is successfully triggered if the widget is added on Homescreen, but doesn't work in my app.</p></li><li><p>mView correctly detects click event and I tried to call widget.performClick() there, which returns false meaning onClickListener is not registered in the widget. But according to source mAppWidgetHost.createView() would call updateAppWidget which would register its onClick listener..</p></li></ol><p>Please advise where to look at. Thanks</p>","291688","","291688","","2010-03-11 22:41:16","2010-07-13 03:34:26","Widget host app with custom view - onClick is not triggered in the app widget","<android><android-widget>","1","0","","",""
"2427127","1","","","2010-03-11 17:15:31","0","1453","<p>Tried posting this at android dev, wanted to go here too in case anyone knows. I'm trying to supply a custom background drawable for a dialog. I've created the following in my styles.xml file:</p><pre><code> &lt;style name=""CustomDlg"" parent=""@android:style/Theme.Dialog""&gt;    &lt;item name=""android:windowBackground""&gt;@drawable/my_background&lt;/item&gt;  &lt;/style&gt; </code></pre><p>This works fine on 1.6+. On my g1 running 1.5 (and the 1.5 emulator) the drawable is used, but the area around the dialog is opaque black instead of being translucent.</p><p>Is there something I'm missing here, or is this a bug with 1.5? Any work arounds? Is 1.5 just the ie6 of Android?</p><p>Thanks</p>","291701","","","","","2010-03-11 17:51:48","Setting a background drawable for a dialog?","<android>","1","1","","",""
"2427489","1","2427503","","2010-03-11 18:12:12","13","7746","<p>Does anyone have some helpful links to find out about Android Uri's?</p><p>For example, you get a Uri back from a ""take a picture"" Intent.   What does a URI look like and how do you use it.  Why are they used instead of filenames or file handles?</p><p>The Dev documentation on the Uri class is practically worthless.  <a href=""http://developer.android.com/reference/android/net/Uri.html"">http://developer.android.com/reference/android/net/Uri.html</a>   It is only clear if you already know exactly what it is, and how to use it.</p><p>Thanks for any links.</p>","253661","","","","","2012-12-14 10:16:43","Finding out all about Android Uri class - use and purpose","<android><uri>","2","1","2","",""
"2427810","1","","","2010-03-11 18:56:41","1","514","<p><br>I'm interested to switch between different sensor orientation speeds over time to optimize the program ie.. battery life.  The routine may be called very often.  I'm looking for the right practice.<br></p><pre><code>       sensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);       sensorManager.registerListener(sensorListener, SensorManager.SENSOR_ORIENTATION, SensorManager.SENSOR_DELAY_FASTEST);       //... 1) unregister then register new speed OR       //... 2) register new speed without registering       sensorManager.unregisterListener(sensorListener);</code></pre><p>Should I unregister the listener and then register with SensorManager.SENSOR_DELAY_NORMAL<br>OR<br>Should I not bother unregistering the listener?<br><br>thanks.</p>","280641","","","","","2010-03-11 18:56:41","Switching Android SensorManager speed. What's a good practice?","<android><orientation><registration><sensor><tilt-sensor>","0","3","","",""
"2428184","1","2428736","","2010-03-11 19:54:41","5","15075","<p>I know it's been asked around but I haven't found quite the answer yet (new to Android so sorry about the ignorance)</p><p>my app's launch Activity has an EditText (called searchbox) , a ListView (designations) and a Spinner (types)</p><p>I use the EditText as a searchbox, I have to pass the string through a custom editing to make searching more flexible. After that I match that against the closest approximation I find in 'designations' and do </p><pre><code>designations.setSelection(j);</code></pre><p>As expected, this sets the desired item to the top of designations. But I can't find a way to highlight it via code.</p><p>NOW, i do know that if the device is in touch mode the highlighting of a selected item won't occur. So the last 4 lines of my searchbox's onTextChanged event are:</p><pre><code>        designations.setFocusable(true);                    designations.setFocusableInTouchMode(true);        if (match==true)      designations.setSelection(j);        if (st.length()==0)   designations.setSelection(0);</code></pre><p>to no avail.</p><p>now, i don't have any code on searchbox's afterTextChanged(Editable s);</p><p>so could anyone give me a clue on this?</p><p>regards~dh</p>","98907","","98907","","2012-08-22 22:13:59","2012-08-22 22:13:59","Android ListView item highlight programmatically","<android><listview><highlight><listviewitem>","2","0","1","",""
"2428422","1","2428445","","2010-03-11 20:25:32","1","6281","<p>I just finished setting up my Eclipse with the Android plug-in.(i.e <a href=""https://dl-ssl.google.com/android/eclipse/"" rel=""nofollow"">https://dl-ssl.google.com/android/eclipse/</a>)</p><p>Now when I do the following1. Eclipse > Preferences > Android, I see a lot of ""Target Name"" like Android 1.1 - Android 2.1</p><p>However, in the book that I'm reading, I'm also supposed to see a ""Target Name"" called ""Google APIs"".I don't see that.</p><p>What am I missing? Is that a separate install?</p><p>Thank you,Tee</p>","166940","","","","","2012-04-23 01:52:20","Android - Eclipse setup missing Google APIs","<android><eclipse-plugin>","2","0","","",""
"2428682","1","","","2010-03-11 21:08:12","2","4646","<p>This is my first time on stack overflow, so I apologize if this question has been asked before, but is there an easy way to implement an RSS reader on the Google Android (API 1.5)?</p><p>I'm searched far and wide with the code sources I know of, and I've only found one implementation which takes 6 different classes and doesn't seem to compile on the current Android SDK's.</p><p>If I end up having to write my own, I'll be sure to post it here later on.</p><p>Thanks a lot.</p>","","user291888","","","","2010-06-02 14:56:19","Easiest way to implement RSS reader on Google Android?","<android><rss><android-emulator><android-widget>","3","0","2","",""
"2428713","1","","","2010-03-11 21:12:29","1","1124","<p>I've used this official <a href=""http://developer.android.com/guide/developing/device.html"" rel=""nofollow"">tutorial</a> to setup my machine so it could detect my Android devices. But from some reason ADB doesn't detects any of my devices properly(Hero and Magic), ie it doesn't show device's IMEI or Firmware version but a bunch of question marks: </p><blockquote>  <p>?????????????</p></blockquote><p>I've tried googling for a solution but I've found nothing.</p>","291899","","","","","2012-11-20 08:26:34","Kubuntu 9.10 Android device not properly detected","<android><kubuntu>","3","0","","",""
"2428729","1","2428806","","2010-03-11 21:14:20","3","3484","<p>I am trying to determine the most accurate location of a device, in the shortest time possible.</p><p>I am storing the data as a geopoint, and have it displayed on a mapview.</p><p>The last time I activated the GPS on my device and let it get a location lock, i was approx 80 miles from where I am now.</p><p>I have a location manager setup and a location listener.</p><p>If I do this, I get NULL.</p><pre><code>  myLocOverlay = new MyLocationOverlay(this, mapView);  GeoPoint test = myLocOverlay.getMyLocation();</code></pre><p>but in the next couple of lines;</p><pre><code>  myLocOverlay.enableMyLocation();        mapView.getOverlays().add(myLocOverlay);</code></pre><p>With this, the overlay on the map shows the current location. It is using the Network provider, but is also attempting to get a GPS fix (it can't as I am indoors and no where near the top floor).</p><p>If I construct the geopoint like this;</p><pre><code>    if(lm.getLastKnownLocation(""gps"") != null)     {     test = new GeoPoint(        (int) (lm.getLastKnownLocation(""gps"").getLatitude() * 1E6),         (int) (lm.getLastKnownLocation(""gps"").getLongitude() * 1E6));    }    else    {    if(lm.getLastKnownLocation(""network"") != null)     {     test = new GeoPoint(       (int) (lm.getLastKnownLocation(""network"").getLatitude() * 1E6),        (int) (lm.getLastKnownLocation(""network"").getLongitude() * 1E6));    }    //bad things    }</code></pre><p>Then I get confusing results. If I disable the devices GPS provider then the code moves onto the Network Provider and gives me a fairly accurate result. If I enable the GPS provider, then the geopoint comes back as the last place I allowed the device to get a GPS lock.</p><p>I want to avoid the above results, and so was looking at using;</p><pre><code>GeoPoint test = myLocOverlay.getMyLocation();</code></pre><p>BUT as I said above, I just get NULL from that.</p><p>Short of getting the geopoints from both GPS and Network and then comparing them, and disregarding the GPS result if it is say 1 mile out of the Network location - i'm a bit stuck. why doesn't getMyLocation() work, shouldnt that return the GeoPoint of what myLocOverlay is showing on the mapview?</p>","286424","","","","","2010-03-14 13:17:52","trying to get the most accurate device location from GPS or Network in Android","<android><gps><location><android-mapview><overlays>","2","1","4","",""
"2428800","1","","","2010-03-11 21:25:00","4","185","<p>I have an app, say MyApp Free.  I want to create MyApp Pro which I can charge for that has some additional functionality.  The obvious way is to have a library that contains almost all my app code, then two Android app projects for the Free and Pro versions which reference that library.</p><p>Suggestions?</p>","291910","","","","","2010-03-12 01:40:02","What's the recommended way of create Android libraries for use in apps?","<android>","3","0","2","",""
"2429262","1","2429304","","2010-03-11 22:37:03","0","176","<p>Hi guys i was looking at this code but im struggling to understand what the super keyword does , now i know it would call the superclass constructor but in this example there doesnt appear to  be a super class so im confused. So theres the customArray constructor and then its calling super but on what?</p><pre><code>public class customArray extends ArrayAdapter&lt;String&gt; { int resource; public customArray(Context cont, int _resource, List&lt;String&gt; items) {      super(cont, _resource, items);      resource = _resource; } @Override public View getView(int position, View convertView, ViewGroup parent) {      RelativeLayout rl;      String prod = getItem(position);      if (convertView == null) {           rl = new RelativeLayout(getContext());           LayoutInflater vi = (LayoutInflater) getContext().getSystemService(                     Context.LAYOUT_INFLATER_SERVICE);           vi.inflate(resource, rl, true);      } else {           rl = (RelativeLayout) convertView;      }      TextView t1 = (TextView) rl.findViewById(R.id.text12);      t1.setText(prod);      final Button b1 = (Button) rl.findViewById(R.id.widget29);      b1.setText(""efwrf"");      if (position == 2) {           b1.setOnClickListener(new View.OnClickListener() {                public void onClick(View v) {                Intent i = new Intent(this.class,Alarm.class);                startActivity(i);                //   Alarm al = new Alarm(); //                     b1.setText(""alarm set"");                }           });      }</code></pre>","264905","","","","","2010-03-11 22:44:07","android listview","<android>","1","1","","",""
"2429433","1","","","2010-03-11 23:30:44","-1","964","<p>How can I retrieve the last image in the SDcard (last one captured)?</p>","289823","","646382","","2011-08-24 15:52:49","2011-08-24 15:52:49","How to retrieve the last image from an SDcard in Android?","<java><android><image><retrieve>","1","0","2","",""
"2429595","1","2429753","","2010-03-12 00:06:01","3","3292","<p>I'm developing an application on a hardware device that has a built-in hardware keyboard that does not slide out so is always visible (like a blackberry).  Therefore, I NEVER want the soft keyboard to display for my entire application.  I'm aware of <a href=""http://stackoverflow.com/questions/1109022/how-to-close-hide-the-android-soft-keyboard"">another SO question</a> that gives the following lines of code:</p><pre><code>InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);</code></pre><p>But I don't know where to put this code to hide the soft keyboard in all places where it might possibly appear in my Activity. I have tried adding the code to <code>Activity.onUserInteraction</code> to no avail.  It seems the keyboard appears <i>after</i> the <code>onUserInteraction</code> executes.</p><p>I also tried adding the following to my <code>&lt;Activity&gt;</code>:</p><pre><code>&lt;activity     android:windowSoftInputMode=""stateAlwaysHidden""&gt;</code></pre><p>Soft keyboard still appears.</p>","9648","","9648","","2010-03-12 01:04:22","2013-05-10 09:52:12","How to stop the android soft keyboard from ever coming up in my entire application","<android><android-hardware>","5","2","1","",""
"2429609","1","","","2010-03-12 00:09:31","5","6431","<p>I have a TabActivity. Each tab point to a sub activity. This works great. </p><p>Is there any clever way to refresh one of the activity tabs? I just want to 'restart' the activity in tab #3 for example. Not sure of a good way to do this other than building in refresh support to the activity itself, or clearing ALL the tabs and recreating all of them.</p><p>Thanks,</p>","291701","","683261","","2012-02-18 06:36:54","2013-02-06 10:19:21","Restarting an activity in a single tab in a TabActivity?","<android><android-tabactivity>","4","0","6","",""
"2429641","1","2474738","","2010-03-12 00:15:29","2","2772","<p>I have been tasked with designing my web services client code to use the utility class UriMatcher in the Android SDK.  Unfortunately, the example in the Dev Guide does not relate to anything in my mind.  I know I am missing some fundamental points to the functionality and possibly about Uri itself.  If you can tie it to some web APIs that are accessible with HTTP POST request, that would be ideal.</p>","157804","","","","","2010-03-19 03:03:38","Can anyone explain UriMatcher (Android SDK)?","<android><http><uri><pattern-matching>","2","0","","",""
"2430045","1","2430468","","2010-03-12 02:05:43","27","21481","<p>So I want to create an Android app so it would be registered somewhere in android OS (or just would start on system start) and when phone user clicks on special button on a web page inside a web browser a la:</p><pre><code> &lt;a href=""myapp://mysettings""&gt;Foo&lt;/a&gt; </code></pre><p>my app would pop up and run using the params sent in that URL.</p><p>So how do I do such thing? </p><p>I need a tutorial with code!</p>","434051","","23897","","2010-03-12 02:08:37","2012-04-16 20:06:24","How to register some URL namespace (myapp://app.start/) for accessing your program by calling a URL in browser in Android OS?","<java><android><browser>","3","2","39","",""
"2430351","1","","","2010-03-12 03:36:14","-1","319","<p>I want to nest several viewflippers. is this possible?</p><p>I have not been successful thus far.   My first tier flips as required but when I flip to the first nested viewflipper its contents appear blank and I can't ""flip"" it</p><p>my views are </p><pre><code>V1V2V3 -&gt; H1 , H2, H3</code></pre><p>When I flip to V3 vertically, H1 does not appear. Where as H is my Horizontal flipper group.</p>","286285","","1101070","","2012-03-06 00:57:45","2012-03-06 00:57:45","Nesting ViewFlippers","<android><views>","1","1","","",""
"2430712","1","2433861","","2010-03-12 05:36:14","1","3664","<p>I am trying to get the value of a EditText in a dialog box.  A the ""*""'ed line in the following code, the safeNameEditText is null; i am assuming because the 'findVeiwById' is searching on the context of the 'AlertDialog.OnClickListener';  How can I get/change the context of that 'findViewById' call?</p><pre><code> protected Dialog onCreateDialog(int id) {  AlertDialog.Builder builder = new AlertDialog.Builder(this);  switch(id){   case DIALOG_NEW_SAFE:    builder.setTitle(R.string.news_safe);    builder.setIcon(android.R.drawable.ic_menu_add);    LayoutInflater factory = LayoutInflater.from(this);     View newSafeView = factory.inflate(R.layout.newsafe, null);    builder.setView(newSafeView);    builder.setPositiveButton(R.string.ok, new AlertDialog.OnClickListener(){     public void onClick(DialogInterface dialog, int which) { *     EditText safeNameEditText = (EditText) findViewById(R.id.new_safe_name);      String safeName = safeNameEditText.getText().toString();      Log.i(LOG, safeName);      setSafeDao(safeName);     }         });    builder.setNegativeButton(R.string.cancel, new AlertDialog.OnClickListener(){     public void onClick(DialogInterface dialog, int which) {      dialog.dismiss();     }     });    return(builder.create());   default:    return(null);  } }</code></pre>","291059","","60261","","2010-03-12 05:42:41","2010-03-12 15:47:12","Android change context for findViewById to super from inline class","<android><context>","2","0","","",""
"2430723","1","2634971","","2010-03-12 05:40:02","0","557","<p>Hi i am testing android E-mail application . I have configured an Exchange account where in i could find an option ""Sync Contacts from this account"" in Account settings. </p><p>According to my understanding if i check ""sync contacts from the account"" option , i must be able to access contacts in the exchange account i have configured. But i don't know how to get/access these contacts in android email application.</p><p>Can any one who have used this functionality or know about it can suggest to me how to make use of ""Sync contacts"" functionality. Or if you have any idea about, how i can test this functionality, i am very eager to here to you.</p><p>Kinds &amp; RegardsSanthosh Kumar H.E</p>","237577","","","","","2010-04-14 04:49:50","What is the functionality of ""sync contacts"" in Exchange account in Email application?","<android>","1","0","","",""
"2430848","1","2431362","","2010-03-12 06:07:02","5","2596","<p>I want to know that what will happen to my activity incase of an incoming phone call? Will the state of my activity be saved or I have to explicitly save it?</p><p>Another question is that will the activity resume after the call is disconnected?</p><p>Please help..!</p>","284372","","284372","","2010-05-06 05:35:22","2010-05-06 05:35:22","Android: What happens to my activity in case of incoming phone call?","<android><activity><state>","3","0","","",""
"2431420","1","2432750","","2010-03-12 08:49:21","1","639","<p>I am working on an Android service.I need to call RecognizerIntent from a service in order to use in the service the recognized text. I have no startActivityForResult() method in Service class so I have problem understanding how to achieve this task. Is it possible? </p><p>Many thanks</p>","269585","","269585","","2010-03-12 09:10:19","2010-03-12 12:45:35","Call RecognizerIntent from service","<android><service><speech-recognition>","1","0","","",""
"2431457","1","","","2010-03-12 08:57:41","6","4972","<p>I get the following stack trace when running my Android tests on the Emulator:</p><pre><code>java.lang.NoClassDefFoundError: client.HttpHelperat client.Helper.&lt;init&gt;(Helper.java:14)  at test.Tests.setUp(Tests.java:15)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:164)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:151)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:425)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1520)Caused by: java.lang.IllegalAccessError: cross-loader access from pre-verified classat dalvik.system.DexFile.defineClass(Native Method)at dalvik.system.DexFile.loadClass(DexFile.java:193)  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203)at java.lang.ClassLoader.loadClass(ClassLoader.java:573)at java.lang.ClassLoader.loadClass(ClassLoader.java:532)... 11 more</code></pre><p>I run my tests from an extra project. And it seems there are some problems with loading the classes from the other project. I have run the tests before but now they are failing. The project under tests runs without problems.</p><p>Line 14 of the Helper Class is:</p><pre><code>this.httpHelper = new HttpHelper(userProfile);</code></pre><p>I start a HttpHelper class that is responsible for executing httpqueries. I think somehow this helper class is not available anymore, but I have no clue why.</p>","114066","","114066","","2010-03-12 15:15:59","2012-09-05 22:30:11","Why do I get a Illegal Access Error when running my Android tests?","<android><unit-testing>","1","6","5","",""
"2431665","1","2431706","","2010-03-12 09:35:38","0","965","<p>As you know, you can't have capital letters in your image filenames that you use in your Android project (Ressource/Drawables folder).</p><p>I've got hundreds of small images (GOOG.GIF as an exemple) that I need to import into my project (I usually do a simple drag and drop from a desktop folder into Eclipse).</p><p>So here's the question : </p><p>How do I quickly change all the filenames (replace all capital letters to lower case) before importing into my project ?</p><p>So,</p><p>GOOG.GIF becomes goog.gif</p><p>AAPL.GIF becomes aapl.gif</p><p>etc.</p><p>Any quick command line solution or another tool to do just that ?</p><p>Thanks.</p>","116573","","","","","2013-03-15 13:50:39","Android : How to Remove all capital letters from image filenames before importing into Eclipse","<android><image><file>","2","0","","",""
"2432046","1","2432132","","2010-03-12 10:36:42","0","220","<p>I want to update a Application on Android App Market but the problem is I have a two builds on with the resources for one kind of Devices that is 320x480 and sdk1.5 and another one is for 480x800 and sdk2.1 now how m'I Supposed to do this and How is it Possible. Please Give me some light over this.</p>","92039","","","","","2010-03-12 10:48:38","Updating Android App on Android App Market","<android>","1","1","","",""
"2432130","1","2436803","","2010-03-12 10:48:29","1","4425","<p>I building an Https Client to send some data to a server, but I don't know what to pass in User-Agent. Should I use the webkit one's or do I have to build one explicitely for my App?I'm using <a href=""http://stackoverflow.com/questions/2253061/secure-http-post-in-android"">this handy post</a>Thanks for any help</p>","263521","","","","","2013-11-07 09:55:38","User Agent in http client Android","<android><http><client><user-agent>","2","2","","",""
"2432318","1","","","2010-03-12 11:22:10","-1","385","<p>I need to access HTTP site through code. I do not want to use Web Service of Android or iPhone.</p>","","user292305","1101070","","2012-03-06 00:54:41","2012-03-06 00:54:41","How to access http web sites through code","<android>","2","2","","",""
"2432812","1","","","2010-03-12 12:58:39","11","8373","<p>I'm trying to set up the android SDK to develop a simple program on the command line in Linux (Ubuntu 9.10). I tried eclipse, but it has know problems running on Ubuntu, so I gave up on it. Here's what I've done so far:</p><ol><li>downloaded  android-sdk_r05-linux_86.tgz  from   <a href=""http://developer.android.com/sdk/index.html"">http://developer.android.com/sdk/index.html</a></li><li>tar xvzf android-sdk_r05-linux_86.tgz</li><li>ln -s android-sdk-linux_86 android</li><li>in .tcshrc added setenv PATH .....:/home/user/android/tools</li><li>source .tcshrc</li><li>ran 'android'. This opened a gui. Under available packages: I installed everything,   and quit the gui.</li><li>ran 'android list targets' and It listed these:</li></ol><p><strong>Available Android targets:</strong></p><blockquote>  <p>id: 1 or ""android-3""       Name: Android 1.5       Type: Platform       API level: 3       Revision: 1       Skins: HVGA-P, HVGA (default), QVGA-P, QVGA-L, HVGA-L</p>    <p>id: 2 or ""Google Inc.:Google APIs:3""       Name: Google APIs       Type: Add-On       Vendor: Google Inc.       Revision: 3       Description: Android + Google APIs       Based on Android 1.5 (API level 3)       Libraries:        * com.google.android.maps (maps.jar)            API for Google Maps       Skins: QVGA-P, HVGA-L, HVGA (default), QVGA-L, HVGA-P</p>    <p>id: 3 or ""android-4""       Name: Android 1.6       Type: Platform       API level: 4       Revision: 1       Skins: HVGA (default), WVGA800, WVGA854, QVGA</p>    <p>id: 4 or ""Google Inc.:Google APIs:4""       Name: Google APIs       Type: Add-On       Vendor: Google Inc.       Revision: 2       Description: Android + Google APIs       Based on Android 1.6 (API level 4)       Libraries:        * com.google.android.maps (maps.jar)            API for Google Maps       Skins: WVGA854, HVGA (default), QVGA, WVGA800</p>    <p>id: 5 or ""android-6""       Name: Android 2.0.1       Type: Platform       API level: 6       Revision: 1       Skins: WQVGA432, HVGA (default), WVGA800, WVGA854, WQVGA400, QVGA id: 6  or ""Google Inc.:Google APIs:6""       Name: Google APIs       Type: Add-On       Vendor: Google Inc.       Revision: 1       Description: Android + Google APIs       Based on Android 2.0.1 (API level 6)       Libraries:        * com.google.android.maps (maps.jar)            API for Google Maps       Skins: WQVGA400, WVGA854, HVGA (default), WQVGA432, QVGA, WVGA800</p>    <p>id: 7 or ""android-7""       Name: Android 2.1       Type: Platform       API level: 7       Revision: 1       Skins: WQVGA432, HVGA (default), WVGA800, WVGA854, WQVGA400, QVGA</p>    <p>id: 8 or ""Google Inc.:Google APIs:7""       Name: Google APIs       Type: Add-On       Vendor: Google Inc.       Revision: 1       Description: Android + Google APIs       Based on Android 2.1 (API level 7)       Libraries:        * com.google.android.maps (maps.jar)            API for Google Maps       Skins: WQVGA400, WVGA854, HVGA (default), WQVGA432, QVGA, WVGA800</p></blockquote><p>I want to create a simple hello world program for my motorola droid. Which of these targets should I use?</p><p>How do I see the Skins?</p><p>If I run 'android' from the command line it says that that there are no virtual devices. Is a virtual device the same as a target?</p><p>How do I get a droid skin and/or a droid target and/or a droid virtual device?</p><hr><p>I THINK that I need to run something like 'android create avd --target 2 --name my_avd', but not sure. Is there a step-by-step list of how to do this somewhere?</p><p>thanks,Bob</p><p><strong>Later:</strong> </p><p>I figured out that I had to create targets (=virtual devices) like this:</p><blockquote>  <p>android create avd -t 1 -n myavd1<br/>  .......<br/>  android create avd -t 8 -n myavd8<br/></p></blockquote><p>This gave me 8 virtual devices in the gui when I ran 'android' from the command line.</p><p>Does anyone know what api level / platform to use for the Droid? And where to get the right skin? Is there anything hardware-specifications, that I need to know for Droid development?</p><p>Finally, are there any lists of steps to create a hello world app from the command line (linux) and run it on the emulator and then run it on a real phone?</p><p>Bob</p>","292344","","568613","","2011-04-12 04:34:21","2011-08-26 09:46:19","How to set up android SDK for command line development on linux?","<android><linux><android-emulator><motorola>","7","0","5","",""
"2432882","1","2447754","","2010-03-12 13:11:01","0","1752","<p>I have a vertically orientated LinearLayout with some Buttons in it:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:orientation=""vertical""&gt;      &lt;Button android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:id=""@+id/bt1"" android:text=""Button 1""&gt;&lt;/Button&gt;     &lt;Button android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:id=""@+id/bt2"" android:text=""Button 2""&gt;&lt;/Button&gt;    &lt;Button android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:id=""@+id/bt3"" android:text=""Button 3""&gt;&lt;/Button&gt;     &lt;Button android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:id=""@+id/bt4"" android:text=""Button 4""&gt;&lt;/Button&gt; &lt;/LinearLayout&gt;</code></pre><p>and I want this ""List"" of buttons to inherit the current style for ListView items. This is my current status of the stylesheet. The CKButton style gets applied over the Activity Theme.</p><pre><code>&lt;style name=""CKButton"" parent=""android:style/Widget.Button""&gt;    &lt;item name=""android:textSize""&gt;21sp&lt;/item&gt;    &lt;item name=""android:layout_margin""&gt;0dip&lt;/item&gt;    &lt;!--&lt;item name=""android:background""&gt;@drawable/button_background&lt;/item&gt;--&gt;    &lt;item name=""android:textColor""&gt;@color/button_text_normal&lt;/item&gt;    &lt;item name=""android:padding""&gt;10dip&lt;/item&gt;    &lt;item name=""android:gravity""&gt;left|center_horizontal&lt;/item&gt;&lt;/style&gt;</code></pre><p>As you see I tried to draw the button background myself, but depending on the system default theme the background-color changes and therefore defining a static color is not an option. Is there a way to inherit the default ListView Row background within that buttons?</p>","288980","","","","","2010-03-15 14:17:28","How do I style buttons in a LinearLayout like a ListView","<xml><android><styles><android-styles>","2","0","","",""
"2432951","1","2437483","","2010-03-12 13:20:20","8","39824","<p>I have an android application that shows a grid view that shows:</p><p>1</p><p>2</p><p>3</p><p>4</p><pre><code>GridView gridview=(GridView)findViewById(R.id.GridView_test);DataBaseHelper dbhelper=new DataBaseHelper(this);ArrayList&lt;String&gt; test=new ArrayList&lt;String&gt;(5);backlinksadapter.add(""1"");backlinksadapter.add(""2"");backlinksadapter.add(""3"");backlinksadapter.add(""4"");ArrayAdapter mAdapter=new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, test);gridview.setAdapter(mAdapter);</code></pre><p>By the moment is working, but i would like to show foreach line of the grid, 2 columns with the values of a 2 dimensional array (something like the GridView in ASP.Net - as datasource -). </p><p>I would like to show:</p><p>1 | Person 1</p><p>2 | Person 2</p><p>3 | Person 3</p><p>4 | Person 4</p><p>Any idea?</p>","79919","","114066","","2010-03-12 15:28:43","2013-06-20 21:32:17","How to display a two column ListView in Android?","<java><android><android-widget>","4","1","9","",""
"2433050","1","2433152","","2010-03-12 13:37:55","1","457","<p>I've a piece of code that launches an Intent. I'm wondering if there's any way to get return codes and/or catch exceptions? The particular scenario I'm facing is when I launch an Intent passing a 'rtsp' URL but it turns out the URL isn't available.</p>","235074","","","","","2010-03-12 13:56:13","Catching Intent exceptions and/or return codes?","<android>","1","0","","",""
"2433337","1","2433477","","2010-03-12 14:27:29","2","1142","<p>I'm clearly a newb, and I was wondering if anyone knows how I can detect a ""ring"" event on my cellphone through the android sdk?  Generally I want to do something with the phone when it begins ringing!  Any thoughts?</p><p>If you want to simply point me to a page in the api documents that would be a good answer for me, I just don't know how to start my research!</p>","213203","","213203","","2010-03-12 19:17:25","2010-03-12 19:17:25","(Android) How to catch a ""ring"" event?","<android>","1","0","1","",""
"2433338","1","","","2010-03-12 14:27:30","10","29924","<p>This is what the Java site <a href=""http://www.java.com"">www.java.com</a> says:</p><p>""KVM, the virtual machine for mobile devices, is the counterpart of JVM (Java virtual machine). It is used to run applets and applications written with Java technology on mobile devices. KVM must be installed by the manufacturer. It is NOT available for download or installation by consumers"".</p><p>Now Android has a customized virtual machine called DVM (Dalvik Virtual Machine). Can we compare it with KVM? Wonder if we can further reprogram DVM to incorporate features of KVM to run applets on Android?Same goes for Blacberry, is there a possibility?</p>","2355649","","21234","","2010-03-12 14:29:36","2013-06-13 11:08:05","Is there a possibility to run applets on Android or Blackberry?","<java><android><blackberry><applet>","6","1","5","",""
"2433432","1","2435217","","2010-03-12 14:40:49","5","6468","<p>I have a layout which does almost what I want. There's just one bug regarding the button at the bottom. I should stay at the bottom at all times. But whenever I bring up the soft-keyboard the button will be displayed above the keyboard. This is not what I want but it should become covered by the keyboard.</p><p>Moreover, I'd be happy if you could comment on how the layout's built.</p><p>Thanks,steff</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:orientation=""vertical""&gt;&lt;LinearLayout android:id=""@+id/l_layout_tags""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""horizontal""&gt;    &lt;TextView        android:text=""TAGS:""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" /&gt;    &lt;AutoCompleteTextView android:id=""@+id/actv_tags""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_weight=""1""        android:imeOptions=""actionDone"" /&gt;    &lt;ImageButton android:id=""@+id/btn_add_tag""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@android:drawable/ic_input_add""        android:onClick=""addTag""/&gt;&lt;/LinearLayout&gt;&lt;ScrollView android:id=""@+id/sv_scroll_contents""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@id/l_layout_tags""    android:scrollbarFadeDuration=""2000"" &gt;    &lt;TableLayout android:id=""@+id/t_layout_contents""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:stretchColumns=""1""        android:paddingRight=""5dip""&gt;        &lt;TableRow android:id=""@+id/tr_template""&gt;            &lt;ImageView android:id=""@+id/iv_blank""                android:src=""@android:color/transparent"" /&gt;            &lt;EditText android:id=""@+id/et_content1""                android:gravity=""top""                android:maxWidth=""200dp""                android:imeOptions=""actionDone"" /&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/ScrollView&gt;&lt;LinearLayout android:id=""@+id/l_layout_media_btns""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""horizontal""    android:layout_centerHorizontal=""true""    android:layout_below=""@id/sv_scroll_contents"" &gt;    &lt;ImageButton android:id=""@+id/btn_camera""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@android:drawable/ic_menu_camera""        android:onClick=""takePicture"" /&gt;    &lt;ImageButton android:id=""@+id/btn_video""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@android:drawable/ic_menu_camera"" /&gt;    &lt;ImageButton android:id=""@+id/btn_audio""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@android:drawable/ic_btn_speak_now"" /&gt;    &lt;ImageButton android:id=""@+id/btn_sketch""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@android:drawable/ic_menu_edit"" /&gt;&lt;/LinearLayout&gt; &lt;ImageButton android:id=""@+id/btn_save_note""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:src=""@android:drawable/ic_menu_upload"" /&gt;&lt;/RelativeLayout&gt;</code></pre>","289849","","","","","2012-08-09 12:51:43","Please verify my layout: bottom button keeps coming up over keyboard","<android><layout>","1","0","5","",""
"2433604","1","2434112","","2010-03-12 15:09:56","0","1529","<p>I have an android listview filled with items.</p><p>Every item has a button.</p><p>This is the template of the my listview.</p><pre><code>&lt;LinearLayout        xmlns:android=""http://schemas.android.com/apk/res/android""        android:paddingBottom=""6dip""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:orientation=""horizontal""        android:paddingLeft=""5px""        android:paddingTop=""5px""        android:paddingRight=""5px""        android:gravity=""left""&gt;        &lt;TextView android:id=""@+id/TextView_test1""            android:layout_width=""200dip""            android:paddingLeft=""0px""            android:layout_height=""wrap_content""/&gt;        &lt;TextView android:id=""@+id/TextView_test2""            android:layout_width=""250dip""            android:paddingLeft=""0px""            android:layout_height=""wrap_content""             android:layout_weight=""1""/&gt;        &lt;TextView android:id=""@+id/TextView_test3""            android:layout_width=""400dip""            android:paddingLeft=""0px""            android:layout_height=""wrap_content""              android:layout_weight=""1""/&gt;        &lt;Button        android:id=""@+id/Button_buttontest""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/Button_buttontest""/&gt;&lt;/LinearLayout&gt;</code></pre><p>How could i handle the click of each button in the activity code? Each button has the same id ""Button_buttontest""?</p><p>Thanks in advance.Best Regards.Jose</p>","79919","","","","","2010-03-12 16:25:47","android listview button control","<java><android><android-widget>","1","0","","",""
"2433684","1","2433801","","2010-03-12 15:19:16","1","1376","<p>I am getting some HTML text from a remote server which I am displaying inside a WebView. I need to format the text display and set a font size and color for the WebView.</p><p>The only way I can think of is: pre-pending the HTML string received with a  tag and specify the font information there. </p><p>What is the correct way to do this?</p>","236128","","114066","","2010-03-12 15:26:16","2010-03-12 15:39:07","Formatting webView content","<android><layout><webview>","1","0","","",""
"2433952","1","2434164","","2010-03-12 16:01:44","6","20531","<p>Im getting a -1 value when i try to get the selected item position on my listview that is already populated.</p><pre><code>list.setOnItemClickListener(   new AdapterView.OnItemClickListener()    {       public void onItemClick(AdapterView adapterView, View view,int arg2, long arg3)       {          int selectedPosition = adapterView.getSelectedItemPosition();          ShowAlert(String.valueOf(selectedPosition));       }   });</code></pre><p>To fill my list view i use the following code:</p><pre><code>SimpleAdapter mSchedule = new SimpleAdapter(          this,           mylist,           R.layout.listviewtest,          new String[] {""test1"", ""test2"", ""test3""},           new int[] {R.id.TextView_websitename, R.id.TextView_keywords, R.id.TextView_backlink});</code></pre><p>Any idea?</p><p>Thanks in advance.</p><p>Best Regards.</p><p>Jose.</p>","79919","","","","","2010-12-29 11:14:27","Android: List View Selected item -1","<android>","1","0","3","",""
"2434071","1","2434463","","2010-03-12 16:19:37","4","2555","<p>I'm trying to find a way to properly handle setting up an activity where its orientation is determined from data in the intent that launched it. This is for a game where the user can choose levels, some of which are int portrait orientation and some are landscape orientation. The problem I'm facing is that <code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)</code> doesn't take effect until the activity is fully loaded. This is a problem for me because I do some loading and image processing during startup, which I'd like to only have to do once.</p><p>Currently, if the user chose a landscape level: </p><ul><li>the activity starts onCreate(), defaulting to portrait</li><li>discovers from analysing its launching Intent that it should be in landscape orientation</li><li>continues regardless all the way to onResume(), loading information and performing other setup tasks</li><li>at this point setRequestedOrientation kicks in so the application runs through onPause() to onDestroy()</li><li>it then again starts up from onCreate() and runs to onResume() repeating the setup from earlier</li></ul><p>Is there a way to avoid that and have it not perform the loading twice? For example, ideally, the activity would know before even onCreate was called whether it should be landscape or portrait depending on some property of the launching intent, but unless I've missed something that isn't possible. I've managed to hack together a way to avoid repeating the loading by checking a <code>boolean</code> before the time-consuming loading steps, but that doesn't seem like the right way of doing it. I imagine I could override <code>onSaveInstanceState</code>, but that would require a lot of additional coding. Is there a simple way to do this?</p><p>Thanks!</p><hr><p>Solution:</p><p>As per Daniel's answer, this was actually quite easy to fix. I just needed to make a few small changes. In my 'menu' Activity, where the player would choose which level to play, I just had to add an if/else check to choose which class would be started by my Intent. This was done with a simple int representing portrait or landscape, determined when the player selected a level. I then created a second class extending my 'GameLogic' class; this is the class which contained most of the code for the game itself, rather than the menus, instructions, etc.</p><pre><code>public class GameLandscape extends GameLogic{}</code></pre><p>Literally that simple and completely empty. That way it inherited all the code from my previous activity where I had already coded it to handle things differently depending on the orientation. Lastly I just had to add a line to the manifest stating that GameLandscape would always run in landscape, and GameLogic would always run in portrait.</p><p>So a simple problem indeed.</p>","235654","","114066","","2010-03-17 10:54:29","2010-03-17 10:54:29","Gracefully handling screen orientation change during activity start","<android><layout><screen-orientation>","2","0","4","",""
"2434383","1","","","2010-03-12 17:01:42","-1","1827","<p>I would like to know how I can move a small image on the screen. The user clicks for instance  a small block and after that I would like to slide it over the screen.</p>","241217","","1101070","","2012-03-06 00:56:17","2012-03-06 00:56:17","Move a little image over the screen","<android><animation>","1","0","","",""
"2434532","1","2434737","","2010-03-12 17:24:14","14","17678","<p>When my user press ""ENTER"" on the virtual android ""user validate entry!"" keybord my keybord stay visible ! (Why?)<br /><br /></p><p>Here my Java code...</p><pre><code>private void initTextField() {    entryUser = (EditText) findViewById(R.id.studentEntrySalary);    entryUser.setOnKeyListener(new OnKeyListener() {        public boolean onKey(View v, int keyCode, KeyEvent event) {            if (event.getAction() == KeyEvent.ACTION_DOWN) {                switch (keyCode) {                    case KeyEvent.KEYCODE_DPAD_CENTER:                    case KeyEvent.KEYCODE_ENTER:                        userValidateEntry();                        return true;                }            }          return true;        }    });}private void userValidateEntry() {    System.out.println(""user validate entry!"");}</code></pre><p>... here my View</p><pre><code> &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;            &lt;EditText android:id=""@+id/studentEntrySalary"" android:text=""Foo"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" /&gt; &lt;/LinearLayout&gt;</code></pre><p>Maybe something wrong on my virtual device ?</p><p><img src=""http://img41.imageshack.us/img41/7051/keybord.jpg"" /></p>","119333","","590525","","2014-02-15 18:36:53","2014-02-15 18:36:53","android set hidden the keybord on press enter (in a EditText)","<java><android><keyboard>","3","0","8","",""
"2434988","1","2435162","","2010-03-12 18:45:06","8","10544","<p>Yes, I know you need a unique resource id when calling the version of these functions that requires a key, but I cannot for the life of me figure out how to create a resource id that can be used in this way. A final variable in my class wont work and neither will a hard coded value. Both threw an IllegalArgumentException. So what gives, how do you use these methods?</p><p>Spara</p>","292578","","","","","2010-03-12 23:56:58","Android: View.getTag/setTag and IllegalArgumentException","<android>","2","0","1","",""
"2435050","1","2446711","","2010-03-12 18:56:00","2","249","<p>I've got Activity A which fires up the Camera intent via:</p><pre><code>Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);startActivityForResult(intent, REQUEST_CAMERA);</code></pre><p>After the picture is taken I can easily grab the picture in:</p><pre><code>@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data)</code></pre><p>But I'd like to receive the result in Activity B in which the image can be edited.Right now I'm receiving the result in Activity A and pass it over to Activity B which results in showing the GUI of Activity A for a short while:</p><pre><code>Intent i = new Intent().setAction(""DisplayJPEG"");i.setClass(this, EditImageActivity.class);i.putExtra(""IMAGE_URI"", uri);startActivityForResult(i, REQUEST_EDIT_IMAGE);</code></pre><p>Of course, I will need the result from Activity B in Activity A after the image has been edited. But that should work with:</p><pre><code>setResult(resultCode, data);</code></pre><p>So there has to be a way to do what I need. Please point me into the right direction.</p>","289849","","918414","","2012-06-30 04:30:20","2012-06-30 04:30:20","How can I receive CameraActivities result in a DIFFERENT Activity (i.e. not in the launching one)?","<android><camera><android-intent>","3","0","2","",""
"2435312","1","2435366","","2010-03-12 19:37:23","0","1540","<p>I want to implement PDF viewer in my android application. My application has option of reading some document and i want to open those doc in PDF by default. My application .apk is ready and I have PDF viewer apk with me . What I want is to merge these 2 apk into a single project ? Can anyone help me.This will be really helpful.</p><p>Thanks in advance.</p><p>Regarda,Praween</p>","292605","","","","","2011-10-05 16:42:57","How can I merge two different package(.apk ) in an android appliation?","<android>","1","0","","",""
"2435383","1","2435441","","2010-03-12 19:47:07","0","465","<p>I have a class that extends View.  I override the onDraw method and allow the user to draw on the screen.  I am at the point where I want to save this view as an image.  I Can use buildDrawingCache and getDrawingCache to create a bitmap that I can write to the SD card.  However, the image is not good quality at a large size, it has jagged edges.  Since I have a View and I use Paths I can transform all by drawing to a bigger size.  I just don't know how to make the Canvas bigger so when I call getDrawingCache it doesn't crop all the paths I am just transformed.  What is happening is I transform all my paths but when I write the Bitmap to file I am only getting the ""viewport"" of the actual screen size.  I want something much bigger.  Any help in the right direction would be greatly appreciated.  I have been reading the docs and books and am at a loss.ThanksJon</p>","229342","","","","","2010-03-12 19:55:38","Write contents of custom View to large Image file on SD card","<android>","1","0","","",""
"2435548","1","","","2010-03-12 20:10:11","1","3857","<p>I am writing a home screen widget and want to update the home screen widget when the device orientation changes from portrait to landscape or the other way. How can I make it?</p><p>Currently, I tried to reigster to CONFIGURATION_CHANGED action like the code below, but the Android didn't allow me to do that by saying ""IntentReceiver components are not allowed to register to receive intents"". Can someone help me? Thanks.</p><pre><code>public class MyWidget extends AppWidgetProvider {    @Override    public void onEnabled(Context context) {        super.onEnabled(context);        this.registerReceiver(this, new IntentFilter(Intent.ACTION_CONFIGURATION_CHANGED));    }</code></pre>","256239","","","","","2012-02-23 10:17:28","How to detect orientation change in home screen widget?","<android>","3","0","1","",""
"2436338","1","2436544","","2010-03-12 22:33:35","0","438","<p>I am working on an Android app that utilizes the Google Maps API MapView, MapController, MapActivity, and ItemizedOverlay. I am basically trying to recreate certain functionalities of the Maps app (damn Google for not providing speech bubbles—for lack of a better name—for items!), particularly those speech bubbles.</p><p>I have an invisible XML structure for the speech bubble in the XML layout file containing my MapView. The first time I show a speech bubble I grab that XML and remove it from it's current parent, applying some ItemizedOverlay.LayoutParams to it, and add it to the MapView as an Overlay. I position it above the item that was selected, fill it with the proper text, then set it to visible.</p><p>This all works great. The goal here, though, is to also automatically animate the map to reveal any parts of a speech bubble that may be off-screen when it opens. So I'm trying popup.getWidth() (popup is the instance of my LinearLayout that is the speech bubble) after I do all the manipulation to the bubble, even after I display it to the user. Problem is, popup.getWidth() is returning me the width of the previously displayed popup, not the currently displayed one. I can't figure out why this would be happening if I'm fetching the width <em>after</em> I set it to visible with its new dimensions (which, by the way, are relative when I'm setting them with LayoutParams: fill_content for both width and height).. I have even tried forcing both the MapView and the ""popup"" to invalidate() before trying to fetch the width.</p><p>Any ideas why this may be happening? How can I force the View to settle into its new dimensions before trying to fetch them?</p><p>Thanks!Nick</p>","29297","","180538","","2010-08-23 10:04:08","2010-08-23 10:04:08","Attempting to calculate width of Map Overlays on the fly","<android><google-maps><map><overlay>","1","1","0","",""
"2436385","1","2436413","","2010-03-12 22:46:05","12","21627","<p>I'm trying to get from an Android Uri to a byte array. </p><p>I have the following code, but it keeps telling me that the byte array is 61 bytes long, even though the file is quite large - so I think it may be turning the Uri <strong>string</strong> into a byte array, rather than the file :(</p><pre><code>  Log.d(LOG_TAG, ""fileUriString = "" + fileUriString);  Uri tempuri = Uri.parse(fileUriString);  InputStream is = cR.openInputStream(tempuri);  String str=is.toString();  byte[] b3=str.getBytes();  Log.d(LOG_TAG, ""len of data is "" + imageByteArray.length     + "" bytes"");</code></pre><p>Please can someone help me work out what to do?</p><p>The output is ""fileUriString = content://media/external/video/media/53"" and ""len of data is 61 bytes"".</p><p>Thanks!</p>","267831","","","","","2013-05-12 10:13:09","Android - getting from a Uri to an InputStream to a byte array?","<android>","4","0","3","",""
"2436467","1","","","2010-03-12 23:06:29","0","2106","<p>I am trying to figure out what is the best way to go about creating dialogs.  I can either create my own Dialog class (which, to me, is more clean and organized), or I can use AlertDialog.Builder (which would be done inline, and funky looking)... What are the positivies and negatives of either implementation? The only thing I can think of is application size...</p>","291059","","","","","2010-03-12 23:30:12","AlertDialog.Builder vs class to extend AlertDialog - Application size","<android><dialog><size>","1","0","","",""
"2436574","1","","","2010-03-12 23:38:54","3","2718","<p>Using an Android Dev Phone 2, I'm using the GsmCellLocation.getCid() method to get the Cell ID on my network. When I run the command and get all the CellIDs for the NeighboringCellInfo I get this values: </p><p>597195726 <br> 597185722 <br>597195718 <br>597110191 <br>597101100 <br>597175726 <br></p><p>I'm running this using the SDK 1.6. </p><p>The problem is that when I run the Engineering Mode on a GSM modem that I have, running a command to obtain the Neighboring Cell IDs, I get this values: <br>34253 <br>0 <br>34223 <br>34262 <br>34181 <br>0 <br></p><p>What is the difference here? In what format is Android delivering the Cell IDs? </p><p>I tried doing a ""cell.getCid() &amp; 0xffff"" but now I'm getting the values: <br>21690 <br>31686 <br>37068 <br>11695 <br>11694 <br>31694 <br></p><p>Which are still different from the one that the GSM Modem is delivering with the Engineering Mode. </p><p>Obviously I tried this on at the same time, same location.</p><p>I'm trying to get the same Cell IDs that the external GSM modem I using is delivering</p><p>Please provide any help </p><p>Thanks in advance!</p>","278980","","","","","2010-03-14 07:08:54","Android delivering different Cell IDs (Neighboring Cell Info)","<android><manager><telephony><cellid>","1","2","3","",""
"2436613","1","2439433","","2010-03-12 23:52:31","2","2978","<p>I am trying speech recognition feature on android emulator but when I try to launch recognizer intent on my emulator with 2.1, no activity is present. Why is it not available out of the box? Is it normal? Is it possible to install support?</p><p>Thanks</p>","269585","","269585","","2010-03-13 15:09:58","2010-03-13 18:16:08","RecognizerIntent.ACTION_RECOGNIZE_SPEECH - no activity found to handle it on emulator","<android><speech-recognition>","1","4","","",""
"2436651","1","","","2010-03-13 00:03:35","0","262","<p>is it possible to create a skewed shape button?<br>(i.e like a stripe shape from bottom left of screen to top right of screen instead of the regular square or rectangle shape button)?</p><p>Something like this image <a href=""http://www.codeproject.com/KB/silverlight/SilverLightFAQPart2/9.JPG"" rel=""nofollow"">http://www.codeproject.com/KB/silverlight/SilverLightFAQPart2/9.JPG</a><br>And I need to make sure the clickable area is also just the colored one.</p><p>Thanks,</p><p>Tee</p>","166940","","166940","","2010-03-13 05:29:44","2010-07-03 15:00:05","Android - Skewed button","<android>","2","0","","",""
"2436722","1","","","2010-03-13 00:28:00","2","1359","<p>I have only .APK file of PDF Viewer and my requirement is to use pdf viewer for  reading document called through Web API . Is there any possibility to integrate these two in same package apart from source code ?</p>","292605","","288773","","2011-09-21 07:46:51","2011-09-21 07:46:51","How can I call the .apk file of PDF Viewer through intent of my application?","<android>","1","1","","",""
"2436935","1","","","2010-03-13 01:42:50","1","343","<p>Do I need to use a service like Skyhook if I want geolocation in my Android App over wi-fi or will it work out-of-the-box like with an iPhone?</p>","289221","","","","","2010-03-14 12:51:21","Do I need to use a service like Skyhook if I want geolocation in my Android App over wi-fi?","<android><geolocation>","1","0","","",""
"2437000","1","2440216","","2010-03-13 02:11:34","3","2609","<p>Can anybody recommend a good framework for handling events in Android?  These would be business logic events like UserUpdatedEvent.  I am looking for something similar to the EventBus provided by GWT-EVENT but for a JVM that supports weak-references.</p>","97901","","","","","2012-06-09 21:17:53","An EventBus framework for Android","<android><events>","4","1","2","2012-06-10 15:40:45",""
"2437008","1","2437104","","2010-03-13 02:14:11","0","162","<p>So I have a <code>TimerTask task</code> calling a function <code>onTimerComplete()</code> in its <code>run()</code></p><p><code>onTimerComplete()</code> looks something like this:</p><pre><code>private void onTimerComplete(){  myFunc1();  myFunc2();}</code></pre><p>I make a <code>Timer t</code> and I schedule the <code>TimerTask</code> with <code>t.schedule(task, 2000);</code></p><p>The problem is, when the timer is up and the task runs my <code>onTimerComplete()</code> but that function does not finish.  It runs <code>myFunc1()</code> but never finishes it nor does it ever call <code>myFunc2()</code></p><p>However, if I call <code>onTimerComplete()</code> directly, everything works.</p><p>What's the deal here?</p>","288072","","288072","","2010-03-14 19:23:26","2010-03-14 19:23:26","Java Timers - Functions called not completing!","<java><android><android-asynctask>","1","1","","",""
"2437244","1","","","2010-03-13 04:14:02","-3","122","<p>How do I put image and name in the list in Android?</p>","292799","","1101070","","2012-03-03 16:02:51","2012-03-03 16:02:51","list in android","<java><android><android-emulator><android-widget><android-manifest>","2","0","","",""
"2437251","1","","","2010-03-13 04:17:24","1","1833","<p>Does Android MediaPlayer can only work with file sources?  I would like play media (video) from a network stream,  but the stream comes in a non-standard protocol, so I have to somehow feed Android MediaPlayer with the data only.  </p><p>Is there anyway to do that?  I found a few web pages suggesting using a temporary file for the buffered media data etc. but I would like to minimize the I/O usage as much as I can, so I'm looking for a API only solution if there is any?  how about JNI? but looks like the permissions going to be an issue with that also.</p>","287597","","","","","2013-10-13 21:35:46","Android playing Video data from a custom network stream?","<java><android><linux><video><video-streaming>","2","0","1","",""
"2437271","1","","","2010-03-13 04:32:29","0","1910","<p>I did a <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Music.git"" rel=""nofollow"">git on the com.android.music</a> app and then created a project in eclipse from existing code.  I chose 2.1 as the sdk target but I am getting errors trying to compile.</p><p>Is the music app referencing code that is not part of the 2.1 sdk?  Can someone list the steps for how to compile in eclipse?</p><p><code>Description Resource Path Location TypeArrayListCursor cannot be resolved to a type PlaylistBrowserActivity.java Music/src/com/android/music line 529 Java ProblemMediaFile cannot be resolved AlbumBrowserActivity.java</code></p>","16340","","","","","2010-03-13 15:33:57","How to load com.android.music code into Eclipse and compile?","<android><eclipse>","2","0","","",""
"2437366","1","","","2010-03-13 05:29:09","29","71647","<p>I've been using this method to gain access to internet from my Android emulatoremulator <code>-http-proxy &lt;&lt;proxy-name&gt;&gt; -avd &lt;&lt;avd_name&gt;&gt;</code></p><p>It works but is that the best way to do it?It just doesn't feel right that I need to open the emulator from command line and can't just do it from Eclipse or something.</p><p>Can't seem to find an internet option on the ""AVD Manager"" either.</p><p>Thanks,</p><p>Tee</p>","166940","","439427","","2014-03-06 04:15:59","2014-03-06 04:15:59","How to set Internet options for Android emulator?","<android><android-emulator>","11","1","14","",""
"2437433","1","2437956","","2010-03-13 05:56:49","1","753","<p>I am using expandable listview i need to refresh as i am searching the list only for parent.I have searched for tutorial in which i can set visibility only for some parent but not all the expandable listview object .</p><p>Thanks in advance.</p>","95877","","","","","2010-03-13 10:17:14","Expandable listview Refreshing","<java><android>","1","1","","",""
"2437505","1","","","2010-03-13 06:28:01","4","6573","<p>how to read/write log data into a text file in android that file should be res folder .</p><p>Thanks in advance</p><p>Aswan</p>","1746300","","","","","2012-04-03 11:00:15","write /read log data into file in android","<android>","5","0","1","",""
"2437664","1","","","2010-03-13 07:42:56","5","8932","<p>I am having a problem getting my devices to pair in Android.  If I go into the settings and pair them manually I can get them to connect using the following code:</p><p><em><strong>Server</em></strong></p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.connect);    Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);    startActivityForResult(discoverableIntent, REQUEST_ENABLE_BT);}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data){    if(requestCode == REQUEST_ENABLE_BT)    {        if(resultCode == RESULT_CANCELED)        {            new AlertDialog.Builder(this)            .setTitle(R.string.error)            .setMessage(R.string.bluetooth_unavailable)            .setPositiveButton(android.R.string.ok, AndroidUtils.DismissListener)            .create()            .show();        }        else        {            mServerSocket = mAdapter.listenUsingRfcommWithServiceRecord(""Moo Productions Bluetooth Server"", mUUID);            mState = State.ACCEPTING;            BluetoothSocket socket = mServerSocket.accept();            mServerSocket.close();            connected(socket);        }    }}</code></pre><p><em><strong>Client</em></strong></p><pre><code>Set&lt;BluetoothDevice&gt; pairedDevices = mAdapter.getBondedDevices();BluetoothSocket socket = null;// Search the list of paired devices for the right onefor(BluetoothDevice device : pairedDevices){    try    {        mState = State.SEARCHING;        socket = device.createRfcommSocketToServiceRecord(mUUID);        mState = State.CONNECTING;        socket.connect();        connected(socket);        break;    }    catch (IOException e)    {        socket = null;        continue;    }}</code></pre><p>But if the devices hadn't already been paired it gets out of the foreach without connecting to a valid socket.  In that case I start discovering.</p><pre><code>// If that didn't work, discoverif(socket == null){    mState = State.SEARCHING;    mReceiver = new SocketReceiver();    mContext.registerReceiver(mReceiver, new IntentFilter(BluetoothDevice.ACTION_FOUND));    mAdapter.startDiscovery();}// ... Later ...private class SocketReceiver extends BroadcastReceiver{    @Override    public void onReceive(Context context, Intent intent)    {        if(BluetoothDevice.ACTION_FOUND.equals(intent.getAction()))        {            try            {                // Get the device and try to open a socket                BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);                BluetoothSocket socket = device.createRfcommSocketToServiceRecord(mUUID);                mState = State.CONNECTING;                socket.connect();                // This is our boy, so stop looking                mAdapter.cancelDiscovery();                mContext.unregisterReceiver(mReceiver);                connected(socket);            }            catch (IOException ioe)            {                ioe.printStackTrace();            }        }    }}</code></pre><p>But it will never find the other device.  I never get a pairing dialog and when I step through I see that it discovers the correct device, but it fails to connect with this exception <code>java.io.IOException: Service discovery failed</code>.  Any ideas as to what I'm missing?</p>","236136","","236136","","2010-03-16 17:23:03","2013-07-04 09:35:01","Android Bluetooth Fails to Pair","<android><bluetooth>","2","2","2","",""
"2437825","1","","","2010-03-13 09:10:46","1","267","<p>When I run my application the following error will occur sometimes, but only sometimes. Can you explain why it occurs only occasionally and what the solution for this is?</p><p>The error message is:</p><pre><code>03-13 14:38:18.055: WARN/System.err(1866): org.xml.sax.SAXParseException: expected: '&gt;' actual: '?' (position:END_TAG &lt;/Curre&gt;@137:35 in java.io.StringReader@438e0ef0) 03-13 14:38:18.064: WARN/System.err(1866):     at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:151)03-13 14:38:18.074: WARN/System.err(1866):     at com.fitzengineering.teslaworldnet.interfacelayer.ParseXMLString.convertPeoples(ParseXMLString.java:484)03-13 14:38:18.074: WARN/System.err(1866):     at com.fitzengineering.teslaworldnet.presentationlayer.People.onCreate(People.java:91)03-13 14:38:18.074: WARN/System.err(1866):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)03-13 14:38:18.084: WARN/System.err(1866):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)03-13 14:38:18.095: WARN/System.err(1866):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)03-13 14:38:18.104: WARN/System.err(1866):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)03-13 14:38:18.104: WARN/System.err(1866): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)03-13 14:38:18.114: WARN/System.err(1866):     at android.os.Handler.dispatchMessage(Handler.java:99)03-13 14:38:18.124: WARN/System.err(1866):     at android.os.Looper.loop(Looper.java:123)03-13 14:38:18.134: WARN/System.err(1866):     at android.app.ActivityThread.main(ActivityThread.java:3948)03-13 14:38:18.134: WARN/System.err(1866):     at java.lang.reflect.Method.invokeNative(Native Method)03-13 14:38:18.144: WARN/System.err(1866):     at java.lang.reflect.Method.invoke(Method.java:521)03-13 14:38:18.144: WARN/System.err(1866):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)03-13 14:38:18.154: WARN/System.err(1866):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)03-13 14:38:18.154: WARN/System.err(1866): </code></pre><p>Thanks in advance </p>","454808","","76835","","2010-03-13 09:15:40","2010-03-13 09:15:40","SAX Parser Exceprtion","<android>","0","2","","",""
"2437854","1","2437890","","2010-03-13 09:29:17","3","8206","<p>i can establish a connection using HttpUrlConnection. my code below.</p><pre><code>client = new DefaultHttpClient();URL action_url = new URL(actionUrl);conn = (HttpURLConnection) action_url.openConnection();conn.setDoOutput(true);conn.setDoInput(true);conn.setRequestProperty(""userType"", ""2"");conn.setRequestProperty(""Content-Type"",""application/x-www-form-urlencoded"");conn.setRequestMethod(HttpPost.METHOD_NAME);DataOutputStream ds = new DataOutputStream(conn.getOutputStream());String content = ""username=username1&amp;password=password11"";Log.v(TAG, ""content: "" + content);ds.writeBytes(content);ds.flush();ds.close();InputStream in = conn.getInputStream();//**getting filenotfound exception here.**BufferedReader reader = new BufferedReader(                new InputStreamReader(in));StringBuilder str1 = new StringBuilder();String line = null;while ((line = reader.readLine()) != null) {str1.append(line);Log.v(TAG, ""line:"" + line);}in.close();s = str1.toString();</code></pre><p>getting filenotfound exception. dont know why?</p><p>else give me some suggestion to pass username and  passwrod parameter to the url by code..</p>","267269","","267269","","2010-03-13 09:38:19","2010-03-13 09:44:48","how to pass the parameters to the urlconnection in java/android?","<java><android><url><stream>","1","1","2","",""
"2437922","1","2438098","","2010-03-13 09:57:52","5","3849","<p>How can I apply a ringtone to only the selected contact?</p><p>I have found a way to set the default ringtone that applies to all contacts, but that is not my goal. </p><p>I want an application to have a button (""Apply ringtone to contact"") that, when clicked, starts an <code>activityForResult</code> displaying a list of all contacts on the phone. When a contact is selected, the contact activity closes and returns with a URI to the contact. Then the app needs to apply the selected ringtone to that specific contact.</p><p>The code for displaying and selecting contacts by an activity is already implemented and seems to work on the app. </p>","133858","","20161","","2013-12-31 09:41:30","2013-12-31 09:41:30","How can I set a ringtone for an individual contact on Android?","<android><contacts><addressbook><ringtone>","1","1","8","",""
"2438072","1","","","2010-03-13 10:54:40","0","267","<p>How to suppress Spinner double clickable problem of Android.</p><p>Try launch any application that having Spinner.</p><p>Then double tap it.</p><p>It will show context menu twice.</p>","292904","","","","","2010-03-13 14:56:05","How to suppress Spinner double clickable problem of Android","<java><android><spinner>","1","0","","",""
"2438152","1","2438313","","2010-03-13 11:35:47","0","357","<p>do we want set permission to access the server with username password authendication in Androidmanifest file?</p>","267269","","","","","2010-03-13 12:32:45","do we want set permission to access the server in Androidmanifest file?","<android>","1","0","","",""
"2438647","1","2438654","","2010-03-13 14:23:49","0","446","<p>NSData means what? how to implements its characterstics in java?</p>","267269","","","","","2010-03-13 14:25:37","NSData means what? how to implements its characterstics in java?","<java><iphone><android>","1","0","","",""
"2438733","1","2438763","","2010-03-13 14:49:05","2","2062","<p>I'm developing chess game for Android (<a href=""http://androidchess.appspot.com"" rel=""nofollow"">androidchess.appspot.com</a>). If I want to add animations, should I use custom View extending Canvas (I do this now), or custom View extending SurfaceView?</p>","243225","","243225","","2010-03-13 14:59:17","2010-03-14 19:02:08","How to do animations in Android chess game","<android><animation>","1","1","0","",""
"2438815","1","2439018","","2010-03-13 15:14:07","0","419","<p>Can an Activity be bound to two different Services at the same time or do I have to unbind one Service before binding to the other one?</p>","283494","","","","","2010-03-13 16:14:54","Activity, Service binding","<android><service>","2","0","","",""
"2439068","1","2495901","","2010-03-13 16:31:17","3","3055","<p>I am making for my Graduation Project a <strong>low price</strong> Navigation device, using Android as Operating System  </p><p>I tried the Native Google's Map-view Control, but it works only Online ..<br>and of-course I want to store maps for offline navigation </p><p>So.. I want a map provider (like OpenStreetMap) that :</p><ul><li>I can use offline </li><li>Contain Searchable Street names (not only a rendered image)</li><li>for commercial use</li><li>Free or at low price</li></ul><p>The problem with OpenStreetMap that it doesn't provide detailed map for most cities in Egypt.</p>","234998","","234938","","2010-03-14 14:59:03","2014-04-16 13:40:29","Free Offline Map Provider (and not OpenStreetMap)","<android>","2","4","2","",""
"2439301","1","2439548","","2010-03-13 17:38:43","7","12042","<p>I would like to animate movement on a SurfaceView .  Ideally I would like to also be notified once the animation had finished.</p><p>For example:I might have a car facing North.  If I wanted to animate it so that it faces South for a duration of 500ms, how could I do that?</p><p>I am using a SurfaceView so all animation must be handled manually, I don't think I can use XML or the android Animator classes.</p><p>Also, I would like to know the best way to animate something continuously inside a SurfaceView (ie. a walk cycle)</p>","248521","","","","","2011-03-10 23:41:05","Animating and rotating an image in a Surface View","<android>","2","0","12","",""
"2439438","1","2443015","","2010-03-13 18:16:59","1","3754","<p>Ok right , i asked how to create a random number from 1-100 for android and i came to this </p><pre><code>    TextView tv = new TextView(this);    int random = (int)Math.ceil(Math.random()*101);     tv.setText(""Your Number Is...""+ random );</code></pre><p>What this does is create the default kinda ""hello world"" style text view and says ""Your Number Is.... [Then Random Number]  </p><p>My problem is that i cant change the layout of this text , because it is not defined in XML, if someone could tell me how to change the style , or like make the random number into a string so i could use it for any Textview layout that would be great ..</p><p>Thanks :)</p>","289230","","","","","2010-05-07 15:50:06","Change Layout Of Text Created In Java [Android]","<android><text><random><numbers>","5","0","","",""
"2439441","1","","","2010-03-13 18:18:46","2","1148","<p>I've determined an estimate of the size of my Android emulator's screen in pixels, although I think its resolution can be changed to other numbers.  Quite frankly though that doesn't eliminate the general problem of not knowing how many pixels on each axis I have to work with on my Android applications in general.</p><p>The main problem I'm trying to solve is this:  How do I make sure I don't use a faulty resolution on Android applications if I want to keep things' sizes constant (so that if the application screen shrinks, for instances, objects will still show up just as big - there just won't be as many of them being shown) if I wish to do this with a single universal resolution for each program?  Failing that, how do I make sure everything's alright if I try to do everything the same way with maybe a few different pre-set resolutions?</p><p>Mainly it seems like a relevant question that must be answered before I can come across a complete answer for the general problem is how big can I always make my application in pixels, NOT regarding if and when a user resizes the application's screen to something smaller than the maximum size permitted by the phone and its operating system.  </p><p>I really want to try to keep this simple.  If I were doing this for a modern desktop, for instance, I know that if I design the application with a 800x600 canvas, the user can still shrink the application to the point they're not doing themselves any favors, but at least I can basically count on it working right and not being too big for the monitor or something.  Is there such a magic resolution for Android, assuming that I'm designing for API levels 3+ (Android 1.5+)?</p><p>Thanks</p>","279112","","1228","","2013-08-15 15:12:32","2013-08-15 15:12:32","How big can I make an Android application's canvas in terms of pixels?","<android>","1","1","","",""
"2439610","1","2439651","","2010-03-13 19:01:45","3","221","<p>Extreme Android developer newbie here...well, new to Android development, not development in general.</p><p>I want to write an application that gets notified when emails come into the device, and takes various actions based on data in the email (subject, sender, to, etc).  I think what I have to do is create a BroadcastReceiver with an IntentFilter.  The problem I'm having is figuring out what Intent(s) I need to ""listen"" for.  Can anyone point me in the right direction?  Thanks.</p>","","user293086","","","","2010-03-13 19:27:18","Intents? How to register to be alerted for incoming emails?","<android>","1","0","","",""
"2439619","1","2808574","","2010-03-13 19:04:14","16","24407","<p>I am trying to collect power usage statistics for the Android G1 Phone. I am interested in knowing the values of Voltage and Current, and then able to collect statistics as reported in this <a href=""http://dl.google.com/io/2009/pres/W_0300_CodingforLife-BatteryLifeThatIs.pdf"">PDF</a>.  </p><p>I am able to get the value of Battery voltage through registering for an intent receiver to receive the Broadcast for ACTION_BATTERY_CHANGED. But the problem is that Android does not expose the value of current through this SDK interface. </p><p>One way I tried is via sysfs interface, where I can view the battery current value from adb shell, using the following command</p><pre><code>$cat /sys/class/power_supply/battery/batt_current449 </code></pre><p>But that too works only if the phone is connected via USB interface. If I disconnect the phone, I see the value of batt_current as '0'. I am not sure why the value of current reported is zero. It should be more than zero, right? </p><p>Any suggestion / pointers for getting battery current value? Also please correct me if I am wrong. </p>","11767","","","","","2014-03-21 18:30:34","Getting the battery current values for the Android Phone","<android><battery>","5","4","9","",""
"2439978","1","2440081","","2010-03-13 20:51:19","7","12708","<p>Is there something in the Android developer guidelines that disuades developers from providing the option to ""exit"" (stop running) an application <em>from within the application itself</em>?  </p><p>I love multitasking and all but it's not clear to me why:</p><ul><li>the vast majority of apps don't have their own Exit functions and hence just keep running forever</li><li>don't give you a choice about running when you turn on the phone - they just do by default </li></ul><p>Both of these things lead to memory usage constantly increasing and your device running with this performance burden <em>all of the time</em> despite the fact that you may only want certain apps to run <em>some of the time</em>.</p><p>Am I missing something? </p>","133247","","133247","","2010-03-14 01:48:40","2013-12-26 18:14:37","Why dont Android applications provide an ""Exit"" option?","<android>","6","1","1","",""
"2440080","1","2440371","","2010-03-13 21:22:58","3","422","<p>I need some help dealing with three Threads in Android</p><p>One thread is the main thread, the other is the GLThread, and the other is a WorkerThread I created to update the game state.</p><p>The problem I have is they all need to access the same LinkedList of game objects.  Both the GLThread and my WorkerThread only read from the LinkedList, so no problem there, but occasionally I have the main thread adding in another game object to the list.</p><p>How can I manage this? I tried using synchronized in front of the functions involved but it really slows down the application.</p><p>For some reason, just catching the errors and not rendering or updating the game state that frame, causes it to start lagging permanently.</p><p>Anyone have any great ideas?</p>","68572","","","","","2010-03-14 14:26:43","Thread help with Android game","<java><android><multithreading><thread-safety>","2","0","1","",""
"2440303","1","2440564","","2010-03-13 22:33:59","0","2999","<p>Just a quick question about how you would go about implementing this. I want there to be buttons at the bottom of the screen, but if the screen size is larger, more buttons would be added. </p><p>For example, at a small screen size, there might be 4-5 buttons at the bottom, but if you ran it on a tablet or something similar, there would be maybe 20 buttons. </p><p>Any suggestions? It can't scroll either, it just has to dynamically fill the layout with buttons.</p><p>Thanks.</p>","118241","","","","","2010-05-15 01:27:56","Android - Fill Layout with Buttons","<java><android><android-linearlayout>","3","0","1","",""
"2440548","1","2440811","","2010-03-13 23:43:28","3","10347","<p>Is there a way I can test if there are any other activities in my app still alive?  I am looking to stop a service in an onDestroy method, but only want to do this if there are no other activities from my app still alive on the stack.</p><p>I have the call stop the service in the main activity's onDestroy() method. This works perfect EXCEPT that if a user launches my app, then launches a few activities in my app, then hits the home screen and RELAUNCHES my app, they will subvert my order and the main activity will now be above other activities of my app. From this state, if they hit the back button and 'back out' of my home screen they will trigger the onDestroy() method and kill the service even though there are other activities open on the stack.  I want to avoid this by stopping the service ONLY if I am sure there are no other activities of mine open on the stack.  Possible?</p>","268648","","","","","2010-03-14 01:20:45","How to stop an Android Service ONLY when there are no other activities in my app running?","<android><android-service>","1","1","3","",""
"2440631","1","2440693","","2010-03-14 00:07:03","3","6518","<p>i have a question about using GalleryView. </p><p>At first, i set five ""default images"" to show from drawable directory. </p><p>But after, i want to run an Async Task in which i download the images, save them and show them in the gallery. </p><p>For that i created the following Adapter:</p><pre><code>    public class ImageAdapter extends BaseAdapter {    int mGalleryItemBackground;    private Context mContext;    private ArrayList&lt;Integer&gt; mImageIds = new ArrayList&lt;Integer&gt;();    private ArrayList&lt;Drawable&gt; mImageDrawables = new ArrayList&lt;Drawable&gt;();    public ImageAdapter(Context c) {        mContext = c;        TypedArray a = obtainStyledAttributes(R.styleable.Gallery1);        mGalleryItemBackground = a.getResourceId(                R.styleable.Gallery1_android_galleryItemBackground, 0);        a.recycle();    }    public void setPlaces(int count) {        for (int i = 0; i &lt; count; i++) {            mImageIds.add(R.drawable.tournoimg);            mImageDrawables.add(null);        }    }    public void setDrawable(String resource, int position) {        Drawable image = Drawable.createFromPath(resource);        mImageDrawables.add(position, image);    }    public int getCount() {        return mImageIds.size();    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {        ImageView i = new ImageView(mContext);        if (mImageDrawables.get(position) == null)            i.setImageResource(mImageIds.get(position));        else            i.setImageDrawable(mImageDrawables.get(position));        i.setLayoutParams(new Gallery.LayoutParams(60, 78));        i.setScaleType(ImageView.ScaleType.FIT_XY);        i.setBackgroundResource(mGalleryItemBackground);        return i;    }}</code></pre><p>}</p><p>and the following Async Task</p><pre><code>    private class FillImages extends AsyncTask&lt;ArrayList&lt;Place&gt;, Void, Void&gt; {    protected Void doInBackground(ArrayList&lt;Place&gt;... listplaces) {        ArrayList&lt;Place&gt; places = listplaces[0];        Iterator&lt;Place&gt; it = places.iterator();        int position = 0;        while (it.hasNext()) {            Place p = it.next();            saveImage(p.getImage(), p.getURLImage());            // Gallery g = (Gallery) findViewById(R.id.gallery);            mImageAdapter.setDrawable(p.getImage(), position);            position++;            mImageAdapter.notifyDataSetChanged();        }        return (null);    }</code></pre><p>But when i run it i have this error:  Caused by: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</p><p>Any idea?</p><p>Thanks</p>","258863","","","","","2013-08-06 05:25:15","Android Gallery View Update Images","<android><galleryview>","2","1","1","",""
"2440694","1","2443478","","2010-03-14 00:28:02","1","5019","<p>I've tried unsuccessfully for quite a few hours now to simply get a TableLayout to scale to the full screen. I've tried stretchColumns, shrinkColumns, (specifying the column index or using *) you name it.It's almost as if the parent element (TableLayout) is completely ignoring 'android:layout_width=""fill_parent""'.  </p><p>I've read through similar questions here, though they haven't solved it for me.The XML below has 3 rows, and the table always shrink wraps to the size of the content.</p><p>Apparently I'm too new to post pictures(?) Here is the XML rendered into the project i'm working on.<a href=""http://www.dashiva.com/images/Capture.png"" rel=""nofollow"">http://www.dashiva.com/images/Capture.png</a></p><p>What am I missing here, it's quite frustrating!</p><pre><code>&lt;TableLayoutxmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:stretchColumns=""*""&gt;&lt;TableRow&gt;    &lt;TextView android:id=""@+id/AmountText"" android:text=""@string/general_amount"" android:paddingRight=""8dip"" android:layout_gravity=""center""&gt;&lt;/TextView&gt;    &lt;TextView android:id=""@+id/CardText"" android:text=""@string/general_card"" android:paddingRight=""8dip"" android:layout_gravity=""center""&gt;&lt;/TextView&gt;    &lt;TextView android:text=""@string/general_date"" android:id=""@+id/DateText"" android:paddingRight=""8dip"" android:layout_gravity=""center""&gt;&lt;/TextView&gt;    &lt;TextView android:id=""@+id/ErrorText"" android:text=""@string/general_error"" android:paddingRight=""8dip"" android:layout_gravity=""center""&gt;&lt;/TextView&gt;&lt;/TableRow&gt;&lt;TableRow&gt;    &lt;TextView android:text=""Amount here..."" android:id=""@+id/AmountNum"" android:paddingRight=""8dip"" android:layout_gravity=""center""&gt;&lt;/TextView&gt;    &lt;TextView android:id=""@+id/CardNum"" android:text=""Num here..."" android:paddingRight=""8dip"" android:layout_gravity=""center""&gt;&lt;/TextView&gt;    &lt;TextView android:text=""date here..."" android:id=""@+id/DateDate"" android:paddingRight=""8dip"" android:layout_gravity=""center""&gt;&lt;/TextView&gt;    &lt;TextView android:text=""Code here..."" android:id=""@+id/ErrorCode"" android:paddingRight=""8dip"" android:layout_gravity=""center""&gt;&lt;/TextView&gt;&lt;/TableRow&gt;&lt;TableRow&gt;    &lt;ImageView android:id=""@+id/cc_image"" android:src=""@drawable/mastercard"" android:background=""@drawable/row_bg2"" android:layout_gravity=""center"" android:layout_weight=""1""&gt;&lt;/ImageView&gt;    &lt;TextView android:id=""@+id/ResponseText"" android:layout_span=""4"" android:text=""Response text here..."" android:textSize=""18dip"" android:layout_weight=""1""&gt;&lt;/TextView&gt;&lt;/TableRow&gt;&lt;ImageView android:layout_gravity=""center_vertical"" android:background=""@drawable/gradient_bg"" android:layout_height=""3dip"" android:layout_width=""fill_parent""&gt;&lt;/ImageView&gt;&lt;/TableLayout&gt;</code></pre>","293202","","","","","2010-09-29 07:34:02","Unable to stretch TableLayout to screen width","<xml><android><user-interface>","3","0","0","",""
"2440735","1","2440883","","2010-03-14 00:46:13","11","15597","<p>I'm looking into writing simple graphics code in Android and I've noticed some synchronized() blocks.</p><p>What is the reasoning behind this and how do I know when I should be ""synchronizing"" my code?</p>","128991","","44729","","2010-07-04 20:53:25","2010-07-04 20:53:25","When do I synchronize methods or use synchronized blocks in my methods in an Android game?","<android><opengl-es><canvas><synchronize>","1","0","6","",""
"2441145","1","2441702","","2010-03-14 04:08:08","10","54378","<p>I have a small test application I am working on which has a timer that updates a textview to countdown from 100 to 0.  That works fine, but now I am trying to pause the application if the user presses the back button on the phone and then restart the timer from where they left off when they reopen the app.  Here is the code I am using:</p><pre><code>@Overridepublic void onPause(){    if(this._timer_time_remaining &gt; 0) {        this.timer.cancel();    }    super.onPause();    Log.v(""Pausing"", String.format(""Pausing with %d"", this._timer_time_remaining));}@Overridepublic void onResume(){    Log.v(""Resuming"", String.format(""Resuming with %d"", this._timer_time_remaining));    if(this._timer_time_remaining &gt; 0) {        start_timer(this._timer_time_remaining);    }    super.onResume();}</code></pre><p>The start_timer() method creates a CountDownTimer which updates the textview in the onTick method and updates the this._timer_time_remaining int variable.</p><p>CountDownTimer and _timer_time_remaining are both declared at the class level like this:</p><pre><code>private CountDownTimer timer;private int _timer_time_remaining;</code></pre><p>From the Log.v() prints I see that the _timer_time_remaining variable has the correct number of seconds stored when onPause is called, but it is set back to 0 when onResume starts.  Why does the variable get reset?  I thought that the application would continue to run in the background with the same values.  Am I missing something?  This is all declared in a class that extends Activity.</p><p>Thanks in advance!</p><p>Note: Edited to clean up the code copying</p>","143310","","143310","","2010-03-14 04:19:55","2012-10-26 07:43:35","onPause/onResume activity issues","<android><timer>","5","0","6","",""
"2441203","1","2441745","","2010-03-14 04:35:08","13","8888","<p>Is it possible to configure an android app so that if a user has opened your app, launched numerous activities, then returns to the home screen and relaunches your app again, instead of going to the main activity they will instead be taken to the activity highest on the stack (the most recent activity in your app)?</p>","268648","","179850","","2011-02-21 19:13:15","2011-02-21 19:13:15","How to make an android app return to the last open activity when relaunched?","<android>","2","0","14","",""
"2441209","1","2441578","","2010-03-14 04:37:27","1","1068","<p>So, i'm having a problem (newbie one) with a CheckBox Listener AND a ListView. I need to request the '...long id) that passes through the Overriden method onListItemClick and put it into a OnCheckedChangeListener. How should i do that?</p><p>If you guys need the code i can post it!</p><p>Thanks in advance!!</p>","2443607","","","","","2010-03-15 15:22:39","ListView, CheckBoxes and the ID's","<android><listview><checkbox>","1","1","0","",""
"2441649","1","","","2010-03-14 08:51:45","6","992","<p>I would like to rewrite two of our programs for mobile devices, but am a bit lost as to which platform to target.</p><p>Complicating this decision:</p><ul><li>I would need to learn the relevant languages and IDEs - my coding to date has been almost all web based (PHP, JS, Actionscript, etc. Some ASPX).</li><li>Most users seem to be religious about their mobile decision, so oral conversations leave me more confused then enlightened.</li><li>I do not yet own a smartphone - will have to buy one once I know which platform to be aiming for.</li><li>Both of my programs are more for business users, (one is only useful for C.P.A.s). </li><li>I am a single developer, and cannot develop for more than one platform at a time. Getting it right is important.</li></ul><p>Based on what I've found on the web, I would've expected RIM to be a shoo-in, and the general order to be as follows:</p><ol><li>RIM Blackberry - More of them than any other brand.  Despite naysayers, they've had <a href=""http://www.betanews.com/joewilcox/article/BlackBerry-shipments-grew-five-times-faster-than-iPhone-in-Q3/1257447229"" rel=""nofollow"">double the sales (or perhaps 5X the sales)</a> of any other smartphone, and have continued to grow. And, they have business users.</li><li>Android - According to Schmidt, they have outsold everyone else except RIM (though I can't find where I read that now), and they are just getting started. According to Comscore, they are already at 8% of the market and expected to hit Shcmidt's claims within six months.</li><li>Nokia - The largest worldwide. If they would just make up between Maemo or Symbian, I would be far less confused.</li><li>iPhone - Much more competition by other apps, fewer sales to be had, and a overlord that can delay or cancel my app at any time. Is Cocoa hard to learn?</li><li>Windows Mobile - Word is that version 7 will <a href=""http://www.tomsguide.com/us/Windows-Phone-microsoft-Mobile-Kindel,news-6029.html"" rel=""nofollow"">not be</a> backwards compatible and losing market share. </li><li>Palm WebOS - Perhaps this should go first, as it is the only one that offers tools to make my life easy as a web application developer.  No competition in marketplace. But not very many users either.</li></ol><p>However, a search on StackOverflow shows a hugely disproportionate number of iPhone questions versus Blackberry.Likewise, there are clearly more apps on iPhone, so it must be getting developer love.</p><p>What is the one platform I should develop for?Please back up your answer with the logic.</p>","87520","","87520","","2010-03-14 10:08:52","2010-08-10 06:37:39","Which mobile operating system should I code for?","<iphone><android><blackberry><mobile-phones><nokia>","10","5","4","2012-08-09 12:44:01",""
"2441685","1","","","2010-03-14 09:13:06","2","1215","<p>In ContentProvider we explicity notify all registered observers to it by calling   </p><pre><code>getContext().getResolver().notifyChange(URI,ContentObserver);  </code></pre><p>I want to know if this is necessary. Is there any possibility that observers get notified, even we don't use that statement at all in our contentProvider.   </p><p>Is there any other way to do the same thing.</p>","273548","","","","","2011-04-28 16:51:22","Can content provider notify observer without calling NotifyChange() explicity - Android","<android>","1","0","1","",""
"2442046","1","","","2010-03-14 11:47:58","1","894","<p>This might be a ""duh"" question but I'm going to go ahead and ask it anyway.</p><p>I have an oversized (bigger than the screen) RelativeLayout, and I'm using swipes to start a TranslateAnimation from viewing one part of the layout to another. Say for instance the layout is two screen wide and two screens tall. After the nice animation to shift the screen, I was using View.scrollTo() to set the new position. This works fine going from the first screen (top left at 0,0) to one of the others. When I swipe to animate back to the first screen though, because the View.scrollTo() invalidated that part of the layout (I assume), that part of the layout is all black as I animate through it. I tried a couple things to get it to redraw itself after the scrollTo() but haven't had any luck, so I figured I'd ask here.</p><p>thanks!joe d</p>","","user293354","","","","2010-03-14 19:39:47","Android TranslateAnimation after scrollTo() = undrawn view","<android><animation>","1","0","","",""
"2442396","1","","","2010-03-14 14:03:07","4","1292","<p>how can i force the system to use 2g instead of 3g? there is an option for this in the system settings but i didn't find a function in the android-sdk to set this option!</p><p>thx</p>","293408","","","","","2010-03-14 14:36:47","set system setting ""use only 2g networks"" programatically","<android>","1","0","1","",""
"2442407","1","2442743","","2010-03-14 14:07:32","47","52909","<p>Does anyone know of a quick color picker widget that I could grab to use in my application? I've seen one in a few different applications that has a wheel with colors, and that you tap in the center to select, but I'm not sure where to find it. Google brings up nothing. Any color picker would be fine though.</p><p>Thanks.</p>","118241","","","","","2012-01-09 04:08:33","Android Color Picker","<java><android><colors>","6","0","22","2012-08-09 06:00:02",""
"2442713","1","","","2010-03-14 15:55:24","44","16504","<p>I just started developing a simple Android application while I'm still learning the platform.</p><p>I'm using Eclipse IDE with the ADT plugin 0.9.6.</p><p>I need to know if it's possible to view the <code>Activity</code> stack that is associated with a Task?</p><p>Is there any way through the DDMS tool or through any other technique?</p><p>Essentially what I need is to be able to see the stack activity of a task to make sure that the application behaves as expected.</p><p>I know that it's possible to control the task behavior in some extent through the use of flags in the <code>Intent</code> object and through some attributes of the <code>&lt;activity&gt;</code> element.</p><p>However it would be nice to have a sort of tool - especially in debug mode or so - that would allow developers to see the <code>Activity</code> stack straight forward.</p>","293442","","427763","","2012-08-09 18:15:54","2013-07-10 07:54:23","View the Task's activity stack","<android>","5","1","39","",""
"2442734","1","2443074","","2010-03-14 16:06:39","0","930","<p>I have a Seekbar and I want to save the state to database when the progress is changed. </p><p>I am wondering in which event to put my code <a href=""http://developer.android.com/intl/fr/reference/android/widget/SeekBar.OnSeekBarChangeListener.html"" rel=""nofollow"">onProgressChanged</a>  vs. <a href=""http://developer.android.com/intl/fr/reference/android/widget/SeekBar.OnSeekBarChangeListener.html"" rel=""nofollow"">onStopTrackingTouch</a>?</p>","243782","","","","","2010-03-14 17:44:30","When is better to complete a save of Seekbar onProgressChanged vs. onStopTrackingTouch?","<android>","3","0","","",""
"2442832","1","2443761","","2010-03-14 16:31:16","0","813","<p>the xml version below properly handles height and width and the java doesn't what is the java missing?</p><h1>xml</h1><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""fill_parent"" android:layout_width=""fill_parent""    android:orientation=""horizontal""&gt;    &lt;include android:id=""@+id/cell1"" layout=""@layout/grid_text_view"" /&gt;    &lt;include android:id=""@+id/cell2"" layout=""@layout/grid_text_view"" /&gt;&lt;/LinearLayout&gt;</code></pre><h1>java</h1><pre><code>LinearLayout ll = new LinearLayout(this);ll.setOrientation(LinearLayout.HORIZONTAL);ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));ll.addView((TextView)this.getLayoutInflater().inflate(R.layout.grid_text_view, null));ll.addView((TextView)this.getLayoutInflater().inflate(R.layout.grid_text_view, null));setContentView(ll);</code></pre><h1>grid_text_view</h1><pre><code>&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_height=""fill_parent""  android:layout_width=""0dip""  android:text=""1""  android:textSize=""20sp""  android:gravity=""center""  android:layout_weight=""1"" /&gt;</code></pre><p>I've tried a ll.invalidate() and it didn't work either? :(</p><p>screenshots at <a href=""http://www.flickr.com/photos/48409507@N06/sets/72157623618407586/"" rel=""nofollow"">http://www.flickr.com/photos/48409507@N06/sets/72157623618407586/</a></p>","293443","","","","","2010-03-14 20:58:37","xml vs java LinearLayout fills","<xml><android><gui><android-linearlayout>","1","1","1","",""
"2443207","1","2443755","","2010-03-14 18:25:52","1","1865","<p>I am having trouble finding information related to which i should choose, OpenGL ES 1.1 or 2.0 for 2D graphics.</p><p>OpenGL ES 1.1 on Android is a bit limited to my knowledge, and based purely on sprite count the only useful renderer is draw_texture() <em>(as far as i know)</em>. However, that does not have rotation and rotation is very important to me.</p><p>Now with the NDK adding support for OpenGL ES 2.0, i am trying to figure out if there is anything that preforms as well as draw_texture(), but can handle rotation.</p><p>Anyone have any information on if 2.0 can help me in this area?</p>","80943","","44729","","2010-07-04 20:53:12","2010-07-04 20:53:12","OpenGL ES 1.1 vs 2.0 for 2D Graphics, with rotated sprites?","<android><opengl-es>","2","0","","",""
"2443364","1","2443375","","2010-03-14 19:07:23","9","5045","<p>I have an activity which shows some List entries. When I click on a list item my app checks which connection type is available (""WIF"" or ""MOBILE""), through NetworkInfo.getTypeName(). As soon as I call this method I get a NullpointerException. Why? </p><p>I tested this on the emulator, cause my phone is currently not available (it's broken...). I assume this is the problem? This is the only explanation that I have, if that's not the case I have no idea why this would be null.</p><p>Here's some code snippet:</p><pre><code>public class VideoList extends ListActivity{ ... public void onCreate(Bundle bundle){  final ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);  ...  listview.setOnItemClickListener(new OnItemClickListener(){   public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {    ...    NetworkInfo ni = cm.getActiveNetworkInfo();    String connex = ni.getTypeName(); //Nullpointer exception here    if(connex.equals(""WIFI"")doSomething();   }  }); }}</code></pre>","283494","","","","","2010-07-01 09:19:12","Android, NetworkInfo.getTypeName(), NullpointerException","<android><networking><nullpointerexception>","4","0","1","",""
"2443524","1","2444917","","2010-03-14 19:53:10","2","6978","<p>I use the telephony manager to get the phone number, in the sdk all works perfectly, on some devices like my hero with 1.5 it returns null, on the  tattoo with 1.6 it works but on some other tattoos it returns null...<br>I start to get crazy... why is this happening? Is there is another way for get the phone number?</p>","293543","","114066","","2010-03-15 08:29:41","2011-05-28 18:14:35","getLine1Number return null but not always","<android><sim-card>","2","2","1","",""
"2443730","1","2443902","","2010-03-14 20:52:25","4","7785","<p>How do I set up a OnClickListener to simply tell me which index button was pressed from an array of buttons.  I can change text and color of these buttons using the array.  I set them up like this.</p><pre><code> TButton[1] = (Button)findViewById(R.id.Button01); TButton[2] = (Button)findViewById(R.id.Button02); TButton[3] = (Button)findViewById(R.id.Button03);</code></pre><p>up to 36.</p>","293565","","","","","2011-11-17 07:35:06","Android which button index from array was pressed","<android><arrays><button>","1","0","4","",""
"2443834","1","2444720","","2010-03-14 21:21:40","3","1028","<p>I have been using a SAX parser for a while now to get data from various XML, but today i'm banging my head on a new problem with a hudge XML (compared to the previous ones . here around 12k lines) with a lot of repetitive items in it. Most of the time, the items are part of a block :</p><pre><code>  &lt;content&gt;  &lt;item lbl=""blabla""&gt;    &lt;item lbl=""blabla""/&gt;    &lt;item lbl=""blabla""/&gt;  &lt;/item&gt;  &lt;item lbl=""blabla""&gt;    &lt;item lbl=""blabla""/&gt;    &lt;item lbl=""blabla""/&gt;    &lt;item lbl=""blabla""/&gt;    &lt;item lbl=""blabla""/&gt;    &lt;item lbl=""blabla""/&gt;    &lt;item lbl=""blabla""/&gt;  &lt;/item&gt;&lt;/content&gt;</code></pre><p>The blabla part is of course changing...But, I would like to keep the structure of items (they are titles and subtitles). And for that, I append each blabla with a starting and ending tag <code>&lt;itemx&gt;blabla&lt;/itemx&gt;</code>, where x is the position in the tree of items (1, 2, 3 or 4).The slightly problematic part is that with that, I'm creating thousands of useless objects and the garbage collector doesn't have time to clean after the parser, and the inevitable OutOfMemory comes in my face...I have no  idea of how to deal with it; The best technique would be if I could take the whole content of <code>&lt;content&gt;&lt;/content&gt;</code>, but i'm not sure that this is possible with a SAX parser.</p><p>Any help is welcome and any solution deeply thanked...</p>","263521","","13070","","2010-03-14 21:49:27","2010-03-15 02:17:19","Use of SAX parser in Android - OutOfMemory Issue","<android><parsing><sax><out-of-memory>","2","0","","",""
"2444040","1","2444188","","2010-03-14 22:25:33","33","34841","<p>I think I'm getting senile because I was convinced that to give a name to your application, you had to fill this part of the manifest:</p><pre><code>&lt;application android:icon=""@drawable/icon""  android:label=""MyApplicationName""&gt;</code></pre><p>However for a reason I don't understand, my application gets the name of my first activity, in which I load data, thus, it is called ""Loading"", defined as follows in the manifest: </p><pre><code>&lt;activity android:name=""AccueilSplash"" android:label=""Loading""&gt;</code></pre><p>             </p><p>Any idea why that is?</p>","263521","","1542891","","2014-04-08 15:40:27","2014-04-18 13:39:05","Naming my application in android","<android><manifest>","3","0","5","",""
"2444258","1","2450973","","2010-03-14 23:23:46","2","6973","<p>In searching the web I came across <a href=""http://groupaware.mobi/iphone"" rel=""nofollow"">http://groupaware.mobi/iphone</a> whichhas a sample iphone navigation site. </p><p>Is there someplace I can find a similar thing for android? i.e.sample web pages with css, sample templates, navigation etc.</p><p>If not, what suggestions would you have to offer to someone lookingto build a web page for android?</p>","59842","","","","","2012-10-20 22:21:56","where can i find some android web page templates, css or html to use as a starter page","<html><css><android><themes>","2","0","2","",""
"2444411","1","","","2010-03-15 00:20:23","1","2196","<p>I'll start by saying that i'm REALLY new to OpenGL ES (I started yesterday =), but I do have some Java and other languages experience.</p><p>I've looked a lot of tutorials, of course Nehe's ones and my work is mainly based on that. </p><p>As a test, I started creating a ""tile generator"" in order to create a small Zelda-like game (just moving a dude in a textured square would be awsome :p).</p><p>So far, I have achieved a working tile generator, I define a char map[][] array to store wich tile is on :</p><pre><code>private char[][] map = {            {0, 0, 20, 11, 11, 11, 11, 4, 0, 0},            {0, 20, 16, 12, 12, 12, 12, 7, 4, 0},            {20, 16, 17, 13, 13, 13, 13, 9, 7, 4},            {21, 24, 18, 14, 14, 14, 14, 8, 5, 1},            {21, 22, 25, 15, 15, 15, 15, 6, 2, 1},            {21, 22, 23, 0, 0, 0, 0, 3, 2, 1},            {21, 22, 23, 0, 0, 0, 0, 3, 2, 1},            {26, 0, 0, 0, 0, 0, 0, 3, 2, 1},            {0, 0, 0, 0, 0, 0, 0, 0, 0, 1},            {0, 0, 0, 0, 0, 0, 0, 0, 0, 1}    };</code></pre><p>It's working but I'm no happy with it, I'm sure there is a beter way to do those things :</p><p><strong>1) Loading Textures :</strong></p><p>I create an ugly looking array containing the tiles I want to use on that map :</p><pre><code>private int[] textures = {            R.drawable.herbe, //0            R.drawable.murdroite_haut, //1            R.drawable.murdroite_milieu, //2            R.drawable.murdroite_bas, //3            R.drawable.angledroitehaut_haut, //4            R.drawable.angledroitehaut_milieu,  //5    };</code></pre><p>(I cutted this on purpose, I currently load 27 tiles)</p><p>All of theses are stored in the drawable folder, each one is a 16*16 tile.</p><p>I then use this array to generate the textures and store them in a HashMap for a later use :</p><pre><code>int[] tmp_tex = new int[textures.length]; gl.glGenTextures(textures.length, tmp_tex, 0); texturesgen = tmp_tex; //Store the generated names in texturesgen for(int i=0; i &lt; textures.length; i++){     //Bitmap bmp = BitmapFactory.decodeResource(context.getResources(), textures[i]);    InputStream is = context.getResources().openRawResource(textures[i]);    Bitmap bitmap = null;    try {        //BitmapFactory is an Android graphics utility for images        bitmap = BitmapFactory.decodeStream(is);    } finally {        //Always clear and close        try {            is.close();            is = null;        } catch (IOException e) {        }    }     // Get a new texture name     // Load it up     this.textureMap.put(new Integer(textures[i]),new Integer(i));     int tex = tmp_tex[i];     gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);     //Create Nearest Filtered Texture    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);    //Different possible texture parameters, e.g. GL10.GL_CLAMP_TO_EDGE    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);    //Use the Android GLUtils to specify a two-dimensional texture image from our bitmap    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);    bitmap.recycle();} </code></pre><p>I'm quite sure there is a better way to handle that... I just was unable to figure it. If someone has an idea, i'm all ears.</p><p><strong>2) Drawing the tiles</strong></p><p>What I did was create a single square and a single texture map :</p><pre><code>/** The initial vertex definition */    private float vertices[] = {                                 -1.0f, -1.0f, 0.0f,     //Bottom Left                                1.0f, -1.0f, 0.0f,      //Bottom Right                                -1.0f, 1.0f, 0.0f,      //Top Left                                1.0f, 1.0f, 0.0f        //Top Right                                                };    private float texture[] = {                     //Mapping coordinates for the vertices              0.0f, 1.0f,              1.0f, 1.0f,              0.0f, 0.0f,              1.0f, 0.0f                                };</code></pre><p>Then, in my draw function, I loop through the map to define the texture to use (after pointing to and enabling the buffers) :</p><pre><code>for(int y = 0; y &lt; Y; y++){    for(int x = 0; x &lt; X; x++){        tile = map[y][x];        try             {                 //Get the texture from the HashMap                int textureid = ((Integer) this.textureMap.get(new Integer(textures[tile]))).intValue();                 gl.glBindTexture(GL10.GL_TEXTURE_2D, this.texturesgen[textureid]);             }                catch(Exception e)             {                 return;             }        //Draw the vertices as triangle strip        gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertices.length / 3);                    gl.glTranslatef(2.0f, 0.0f, 0.0f); //A square takes 2x so I move +2x before drawing the next tile    }    gl.glTranslatef(-(float)(2*X), -2.0f, 0.0f); //Go back to the begining of the map X-wise and move 2y down before drawing the next line}</code></pre><p>This works great by I really think that on a 1000*1000 or more map, it will be lagging as hell (as a reminder, this is a typical Zelda world map : <a href=""http://vgmaps.com/Atlas/SuperNES/LegendOfZelda-ALinkToThePast-LightWorld.png"" rel=""nofollow"">http://vgmaps.com/Atlas/SuperNES/LegendOfZelda-ALinkToThePast-LightWorld.png</a> ).</p><p>I've read things about Vertex Buffer Object and DisplayList but I couldn't find a good tutorial and nodoby seems to be OK on wich one is the best / has the better support (T1 and Nexus One are ages away).</p><p>I think that's it, I've putted a lot of code but I think it helps.</p><p>Thanks in advance !</p>","293632","","390177","","2012-05-26 15:26:49","2012-05-26 15:26:49","Better way to generate tiles","<android><opengl-es><textures><tiles>","1","0","1","",""
"2444639","1","3142584","","2010-03-15 01:53:52","3","3466","<p>Is there a way in Android to load KML files from Google Earth into a map widget?</p><p>Specifically I am looking to load saved shapes created in Google Earth overtop a map widget as easily as possible.  Has anybody ever tried this before?</p>","97901","","97901","","2010-03-15 19:35:10","2010-07-28 16:38:13","Does the Android API support KML files?","<java><android><kml><google-earth>","1","0","","",""
"2444770","1","","","2010-03-15 02:35:11","0","41","<p>I have a live marketplace version of my application, and now want to start developing my next version, but want to be able to have the newer dev 'upgrade' (for testing) and existing live version (for demoing) both on the same device, but I dont want to create a whole separate project to do this.</p><p>Any ideas?</p>","","user293670","","","","2010-03-15 10:33:13","want a dev branch to run on phone along with live version (android)","<android>","1","0","","",""
"2445032","1","2464107","","2010-03-15 04:07:41","1","376","<p>I have written a small app that puts my bluetooth in discoverable mode for a long time (G1 - API 1.6). I use that along with small program on windows to lock/unlock the computer if the phone is close by. Recently i try to port this app to my nexus one but it seems like i have to pop up the message every 300s to enable device to go to discoverable mode. does anyone know how i can suppress that?</p><p>I'm ok with saying ok for the first time but not every 300s :)</p>","282882","","","","","2010-03-17 16:42:24","New Bluetooth API question","<android><bluetooth>","2","0","","",""
"2445491","1","","","2010-03-15 06:41:14","0","379","<p>I am tring to update name of existing contact in android 2.1 emulator with the following code but always getting ""<strong>java.lang.IllegalArgumentException: Emplty values</strong>"" Exception.</p><p>ContentValues contactValues = new ContentValues();contactValues.put(People.NAME, ""rishabh""); getContentResolver().update(UpdateContactUri, contactValues, null, null);</p><p>UpdateContactUri is the uri of existing contact with id 4.It is working on emulator 1.6 but not on 2.1.</p><p>One more thing i need to ask how can i access indivisual fields of Name(first, middle, last) and Address(Street, city, state, zip, country) in 2.1 </p>","177571","","","","","2011-05-17 20:49:27","Not able to update contact name in emulator 2.1","<android><android-emulator>","1","0","","",""
"2445562","1","","","2010-03-15 07:03:59","0","1842","<p>I want to open up options menu by clicking upon my own created button, is this possible?</p>","293766","","1101070","","2012-03-06 01:35:57","2012-03-06 01:35:57","Options menu in an Android application","<android><menu><options>","2","3","","",""
"2445835","1","2446411","","2010-03-15 08:31:18","0","1491","<p>I am using Mark Murphy's DroidEx tool to project my android device screen; is there a way to supply a skin(e.g. a HTC Hero skin that we use with Android emulator) to DroidEx?</p><p>I have also asked this question on the google group for DroidEx project. </p><p>Thanks!</p>","236128","","80274","","2012-04-22 21:38:47","2012-04-22 21:38:47","Project Android Screen with DroidEx","<android><droidex>","2","0","","",""
"2445838","1","2445912","","2010-03-15 08:32:10","1","454","<p>I have a button that plays an audio file on its click listener. If the button is clicked again and again while the audio file is being played then the app crashes. What's the solution?</p><p>Here is some code for reference:</p><pre><code> private OnClickListener btnMercyListener = new OnClickListener()    {        public void onClick(View v)        {                                   // Toast.makeText(getBaseContext(),              //       ""Mercy audio file is being played"",                //       Toast.LENGTH_LONG).show();            if (status==true)            {                mp.stop();                mp.release();                status = false;            }             else            {            mp = MediaPlayer.create(iMEvil.this,R.raw.mercy);           //mp.start();            try{                mp.start();                status= true;                 //mp.release();               }catch(NullPointerException e)               {                   Log.v(""MP error"",e.toString());               }            }            mp.setOnCompletionListener(new OnCompletionListener(){                    // @Override                    public void onCompletion(MediaPlayer arg0) {                       mp.release();                      status = false;                   }               }          );         }    };</code></pre>","2355649","","56285","","2014-01-27 22:11:44","2014-01-27 22:11:44","How to handle runtime exception on playing audio files?","<java><android><audio><android-mediaplayer>","1","3","","",""
"2445999","1","2446070","","2010-03-15 09:13:08","8","1329","<p>I want to hide the titlebar of my app in some of my views. What do I have to add to the layout files I want to hide the titlebar in? Can you provide an example?</p>","114066","","114066","","2010-03-15 09:25:45","2013-10-30 15:59:54","What do I have to add to a layout to hide the titlebar?","<android><layout><title>","5","0","3","",""
"2446248","1","2466662","","2010-03-15 10:00:28","121","34946","<p>According to Google, I must ""<em>deactivate any calls to Log methods in the source code</em>"" before publishing my Android app. Extract from section 5 of the <a href=""http://developer.android.com/guide/publishing/preparing.html"">publication checklist</a>:</p><blockquote>  <p>Make sure you deactivate logging and disable the debugging option before you build your application for release. You can deactivate logging by removing calls to Log methods in your source files.</p></blockquote><p>My open-source project is large and it is a pain to do it manually every time I release. Additionally, removing a Log line is potentially tricky, for instance:</p><pre><code>if(condition)  Log.d(LOG_TAG, ""Something"");data.load();data.show();</code></pre><p>If I comment the Log line, then the condition applies to the next line, and chances are load() is not called. Are such situations rare enough that I can decide it should not exist?</p><p>This is on the official checklist, so I guess many people do this on a regular basis.<br>So, is there a tool that removes all Log lines?<br>Preferably one that is not tricked by code like the above.</p>","226958","","226958","","2012-10-22 06:00:03","2013-12-19 22:03:25","Remove all debug logging calls before publishing: are there tools to do this?","<android><logging>","9","8","125","",""
"2446270","1","2447209","","2010-03-15 10:06:38","30","17356","<p>How can i change the star colors and how can i change the size of the stars ?</p>","216431","","216431","","2010-03-15 17:41:37","2014-02-19 06:00:49","Android RatingBar change star colors","<android><rating>","5","3","12","",""
"2446322","1","2446694","","2010-03-15 10:18:38","0","131","<p>I have a list of 'n' contact ids corresponding to which I need to obtain the contact details. One simple way to make n queries using the contact ids and retrieve those contacts. But this will be very time-consuming especially if n is large. I would like to know if there is any simpler way to obtain these results (like batch query etc).</p>","266272","","","","","2010-03-15 11:28:08","Getting contacts when ids are known","<android><contacts>","1","0","","",""
"2446373","1","2447707","","2010-03-15 10:30:21","15","29330","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2445999/what-do-i-have-to-add-to-a-layout-to-hide-the-titlebar"">What do I have to add to a layout to hide the titlebar?</a>  </p></blockquote><p>How do I remove the title below the battery, time bar from showing up?</p><p>Not sure the terminology for that bar, but on this picture it is the ""Nested XML Layout"" bar:</p><p><img src=""http://ezmobile.files.wordpress.com/2009/02/020209-2053-isthereanyw72.png"" alt=""""></p>","166940","","121364","","2010-03-15 10:33:14","2013-05-05 21:45:28","Android title bar removal","<android>","2","1","","2012-07-20 13:23:46",""
"2446414","1","","","2010-03-15 10:35:35","2","8766","<p>WARN/WindowManager(61): No focus window, dropping: KeyEvent{action=0 code=82 repeat=0 meta=0 scancode=229 mFlags=8}</p>","268741","","","","","2011-12-22 03:00:14","android emulator is start but window show blank screen","<android><emulator>","4","0","","",""
"2446423","1","2447440","","2010-03-15 10:37:34","1","1132","<p>I want to rename an context private file created with openFileOutput() but I don't know how...</p><p>I tried that:</p><pre><code>File file = getFileStreamPath(optionsMenuView.getPlaylistName()); // this file already exists                try {                    FileOutputStream outStream = openFileOutput(newPlaylistName, Context.MODE_WORLD_READABLE); // i create a new file with the new name                    outStream.close();                }                catch (FileNotFoundException e) {                    Log.e(TAG, ""file not found!"");                    e.printStackTrace();                }                 catch (IOException e) {                    Log.e(TAG, ""IO exception"");                    e.printStackTrace();                }                                           Log.e(TAG, ""rename status: "" + file.renameTo(getFileStreamPath(newPlaylistName))); //it return true </code></pre><p>This code throw FileNotFoundException but the documentation said ""Open a private file associated with this Context's application package for writing. <strong>Creates the file if it doesn't already exist</strong>."" so the new file should be created on disk. The problem: When I try to read from the new renamed file I got FileNotFoundException!</p><p>Thank you!</p>","217360","","","","","2012-09-16 06:58:51","How to rename an private file of my application?","<android>","2","0","0","",""
"2446544","1","2447236","","2010-03-15 10:57:18","136","85630","<p>I want to have 5 lines for the height of the text area. I am using the following code.</p><pre><code>&lt;EditText    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center""    android:singleLine=""false""    android:lines=""5""    android:layout_marginLeft=""10dip""    android:layout_marginRight=""10dip"" /&gt;</code></pre><p>The text area looks fine, but the problem is that the cursor is blinking in the middle of the text field. I want it to blink at first line, at the first character of the text field.</p>","216431","","356895","","2012-08-16 17:03:07","2013-09-11 04:47:33","Android: Vertical alignment for multi line EditText (Text area)","<android><edittext><vertical-alignment><android-edittext><multiline>","6","1","23","",""
"2446805","1","2446881","","2010-03-15 11:47:38","8","3692","<p>In a Android application I want to use Scanner class to read a list of floats from a text file (it's a list of vertex coordinates for OpenGL). Exact code is:</p><pre><code>Scanner in = new Scanner(new BufferedInputStream(getAssets().open(""vertexes.off"")));final float[] vertexes = new float[nrVertexes];for(int i=0;i&lt;nrVertexFloats;i++){    vertexes[i] = in.nextFloat();}</code></pre><p>It seems however that this is incredibly slow (it took 30 minutes to read 10,000 floats!) - as tested on the 2.1 emulator. What's going on?I don't remember Scanner to be that slow when I used it on the PC (truth be told I never read more than 100 values before). Or is it something else, like reading from an asset input stream?</p><p>Thanks for the help!</p>","292921","","","","","2011-10-15 22:42:15","Is java.util.Scanner that slow?","<java><android>","6","4","2","",""
"2446910","1","","","2010-03-15 12:09:01","-1","933","<p>How to get image source from cdata xmlnode?</p><p>the xmlnode: </p><pre><code>&lt;description&gt;&amp;lt;a href=&amp;quot;http://www.site.com/id/?id=41564&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://www.site.com//news/images/2010/03_march/imagestock/thumb/22.jpg&amp;quot; align=&amp;quot;left&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;  more text comes here &lt;/description&gt;</code></pre><p>I'm trying to get the <a href=""http://www.site.com//news/images/2010/03_march/imagestock/thumb/22.jpg"" rel=""nofollow"">http://www.site.com//news/images/2010/03_march/imagestock/thumb/22.jpg</a> out from the description node..</p>","1514062","","1514062","","2013-04-08 13:31:09","2013-04-08 13:31:09","Get image source from cdata xmlnode","<xml><android><split>","1","2","1","",""
"2446932","1","2446969","","2010-03-15 12:13:12","0","565","<p>Hi  I want to create a Button otherthan creating it from xml layout.i want to create the button in java class otherthan using any resources folder .please anyone help me to solve this</p>","244540","","","","","2010-03-15 12:20:57","How to create a Button in android otherthan from Xml files?","<android>","1","0","","",""
"2447044","1","2448262","","2010-03-15 12:32:31","2","1060","<p>I'm trying to convert an old Delphi program I wrote into Java to compile and run on my Android phone. I'm running the Android 2.1 operating system but am using version 1.6 of the SDK.</p><p>I have a routine in Delphi where I set the colour of pixels on a canvas individually along the lines of:</p><pre><code>image1.canvas.pixels[x, y] := GetMyTColor(x, y);</code></pre><p>Is there a Java equivalent to the property on the Canvas:</p><pre><code>property Pixels[X, Y: Integer]: TColor</code></pre>","117859","","133802","","2010-03-15 12:37:38","2010-03-15 16:00:42","Delphi To Java code conversion: image.canvas.pixels","<java><android><delphi>","2","0","1","",""
"2447086","1","","","2010-03-15 12:39:41","0","4086","<p>I am building an application for Android (1.5) that, after quering a webservice, shows to the user a big amount of data that should be displayed in a ""grid"" or ""table"" style.</p><p>I must show a result of about 7 columns and 50 rows (for example a customer list with names, addresses, telephone number, sales amount last year and so).</p><p>Obviously, the 7 columns will not fix in the screen and I would like the user would be able to scroll up/down and LEFT/RIGHT (important because of the number of columns) to explore the grid results.</p><p>Cell selection level is NOT necessary, as much I would need row selection level.</p><p>What is the best approach to get this interface element? <code>Listview</code> / <code>GridView</code> / <code>TableLayout</code>?</p>","","user293958","69802","","2011-05-28 22:28:47","2013-12-21 19:14:28","Best approach to show big amount of ""grid"" data in Android","<android><listview><gridview><tablelayout>","5","0","1","",""
"2447564","1","2447665","","2010-03-15 13:48:37","3","8301","<p>Greets, </p><p>Does anyone how I go about detecting when a user presses on a bitmap which is inside a canvas?</p><p>Thanks</p>","84278","","","","","2013-09-29 09:57:28","Detect touch on bitmap","<android>","3","0","2","",""
"2447588","1","2480248","","2010-03-15 13:51:23","6","1374","<p>This is a very weird problem. My app that runs just fine but somehow if I leave my phone for an hour or two while my app is running, I get the following error when I come back to it later:</p><pre><code>java.lang.NoClassDefFoundError: yoga.database.Manageratyoga.YogaActivity.openDatabase(YogaActivity.java:294)atyoga.YogaActivity.initData(YogaActivity.java:275)atyoga.YogaActivity.onCreate(YogaActivity.java:102)atandroid.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)atandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)at android.app.ActivityThread.access$2100(ActivityThread.java:116)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:4203)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)atcom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I know for a fact that my yoga.database.Manager class was loaded at the time when the app was launched, but somehow the class must have been unloaded by the system as I left the phone. </p><p>Does Android unload classes automatically after certain periods? What can I do when my class gets unloaded? </p><p>The above error causes my app to crash, but I can easily re-launch it and it runs just fine. </p><p>The problem occurs mostly on my HTC Magic phone running Android 1.6. </p><p>Any insight is highly appreciated. </p><p>Thank you,</p>","277827","","218159","","2010-03-15 15:03:18","2010-03-19 20:03:42","Android: When do classes get unloaded by the system?","<java><android><class><noclassdeffounderror><unload>","2","0","","",""
"2447595","1","2448098","","2010-03-15 13:52:12","1","1011","<p>My question is about restoring complex activity related data when coming back to the activity using the ""back"" button"".Activity A has a ListView which is connected to ArrayAdapter serving as its data source - this happens in onCreate().</p><ol><li>By default, if I move to activity B and press ""back"" to get back to activity A, does my list stay intact with all the data or do I just get visual ""copy"" of the screen but the data is lost?</li><li>What can I do when more than activities are involved? Let's say activity A starts activity B which starts activity C and then I press ""back"" twice to get to A. How do I ensure the integrity of the A's data when it gets back to the foreground? PrefsManager does not seem to handle complex object very intuitively. </li></ol><p>Thanks, Rob </p>","283630","","","","","2010-03-15 15:07:16","Android: How to restore List data when pressing the ""back"" button?","<android><activity>","2","0","","",""
"2447897","1","2448101","","2010-03-15 14:41:16","1","1544","<p>Im making an asynchronous call from a class to another.</p><p>Here is my actual code:</p><pre><code>public class HttpRequestHelper extends AsyncTask{  @Override  protected Object doInBackground(Object... params)   {   try    {      // Create a URL for the desired page      URL url = new URL(""http://www.google.com"");      // Read all the text returned by the server      BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));      String str;      while ((str = in.readLine()) != null)       {      }      in.close();    }     catch (MalformedURLException e)     {    }        return null;   }   protected void onPostExecute(Long result)   {        String hello=""hello world"";      }}</code></pre><p>Im using the class above from another class using:</p><pre><code>HttpRequestHelper helper=new HttpRequestHelper();helper.execute(""whatever"");</code></pre><p>But after execute, i dont know when the execution is finished, how could i suscribe to the callback of the asynchronous operation?</p><p>Thanks in advance.</p><p>Best Regards.Josema.</p>","79919","","14343","","2010-07-13 01:57:31","2010-07-13 01:57:31","Android Asynchronous calls","<android>","2","0","","",""
"2447998","1","2449673","","2010-03-15 14:54:16","1","1395","<p>I'm trying to record audio</p><pre><code>this.recorder = new android.media.MediaRecorder();this.recorder.setAudioSource(android.media.MediaRecorder.AudioSource.MIC);      this.recorder.setOutputFormat(android.media.MediaRecorder.OutputFormat.DEFAULT);this.recorder.setAudioEncoder(android.media.MediaRecorder.AudioEncoder.DEFAULT);this.recorder.setOutputFile(""pruebaAudioRecorder.mp4"");**this.recorder.prepare();**this.recorder.start();</code></pre><p>but when i call prepare method throws the FileNotFound exception.</p><ul><li>Should I create the file before prepare method? something like <code>new File(...)</code></li><li>If so, which should be the file path?</li></ul><p>thx a lot.</p>","269671","","246246","","2012-06-06 00:10:01","2013-04-07 05:41:47","Android - Audio recorder FileNotFound","<android><audio><file-not-found><recorder>","1","0","","",""
"2448002","1","2448163","","2010-03-15 14:55:05","1","2328","<p>The user <strong>must login</strong> through the WebView. Of course, the session is for that WebView.But, what if I need to make REST API calls during my Android application?</p><p>Those REST API calls need the session to be authenticated , otherwise those will not work.  Is there any way I can attach the cookies of WebView into everything I do in Android?</p>","179736","","","","","2010-03-15 15:14:01","How do I use the session in WebView in my other stuff (Android)?","<java><android><api><rest><webview>","1","0","2","",""
"2448103","1","2452083","","2010-03-15 15:07:48","3","2013","<blockquote>  <p>drawPosText(char[] text, int index,  int count, float[] pos, Paint  paint)  Draw the text in the array, with each  character's <strong>origin specified</strong> by the  pos array.</p></blockquote><p>Does anyone know where exactly does drawPosText consider the ""origin"" to be, since you are specifying ""origin"" as coordinate pairs; i.e., is it bottom-left of character, center, what? </p><p>Also how does drawPosText calculate character height when it draws?   </p>","216672","","","","","2010-03-16 04:17:32","drawPosText() in android.graphics.Canvas, What is origin?","<android>","1","0","","",""
"2448213","1","2448531","","2010-03-15 15:22:45","48","36613","<p>Say I want to define that an URI such as:</p><pre>myapp://path/to/what/i/want?d=This%20is%20a%20test</pre><p>must be handled by my own application, or service. Notice that the scheme is ""myapp"" and not ""http"", or ""ftp"". That is precisely what I intend: to define my own URI schema globally for the Android OS. Is this possible?</p><p>This is somewhat analogous to what some programs already do on, e.g., Windows systems, such as Skype (skype://) or any torrent downloader program (torrent://).</p>","49346","","46926","","2013-12-29 14:14:35","2013-12-29 14:15:08","How to implement my very own URI scheme on Android","<android><browser><uri>","2","2","39","",""
"2448700","1","2448889","","2010-03-15 16:25:18","0","2166","<p>Can you please tell me how can I setHeight for a ViewGroup?I see there is a layout(l,t,r,b);</p><p>But that is different form setHeight(), since I don't know where should be the top/bottom of the viewGroup. I need to set the height of the ViewGroup and return that to ListAdapter.</p><p>Thank you.</p>","286802","","","","","2011-11-25 06:29:27","How to setHeight for a ViewGroup","<android>","1","0","","",""
"2448922","1","2449069","","2010-03-15 16:56:53","0","1018","<p>I have created an App Widget for Android 1.5.  It uses a TextView to present a number of individual Text Links using ClickableSpans.  However, the onClick event handler on the ClickableSpan is never called, it appears that you can not select individual components on the widget just the whole widget.</p><p>This approach works fine for a normal app, so what I do I need to change to make this work for a widget?</p>","294123","","","","","2010-03-15 17:20:39","ClickableSpan on TextView in App Widget","<android><android-widget>","2","0","","",""
"2449930","1","2450000","","2010-03-15 19:38:06","1","438","<p>I like to know on which version of SDK does support 'AudioTrack' class? Does 'AudioTrack' can be used from 1.5 SDK, 1.6 SDK and 2.0 SDK?</p><p>Thanks.</p>","187532","","","","","2010-03-15 19:49:03","Android:AudioTrack support?","<android>","1","0","","",""
"2450520","1","2450656","","2010-03-15 21:11:13","0","1441","<p>So I have a fairly complex activity the parent being a linearlayout with a table with some basic info and buttons. Then a couple listviews that the user can add items to. So these listviews grow more and more as the user uses the app. The problem I'm running into is the Linearlayout is bigger then the resolution of the screen and so it needs to scroll. So the scrolling doesn't work on the Listviews. I've tried playing with changing the layout_height of the listview and its child element with no success. Is there a way to make these couple listviews expand out to the amount of children? Or am I going about this all wrong? If so what other controls can I use?</p><p>I'm open to any ideas. I really just don't know how to go about this.</p><p>Thanks</p>","255123","","","","","2012-03-27 15:20:14","How to get ListView to grow to the size of content","<android><listview>","2","0","","",""
"2450596","1","2458791","","2010-03-15 21:23:36","1","2208","<p>I can't get Ubuntu 9.10 to recognize the Nexus One as a debug device.  I tried following the instructions found here but they are not working: <a href=""http://alan.lamielle.net/2010/01/22/nexus-one-usb-in-ubuntu-9-10"" rel=""nofollow"">http://alan.lamielle.net/2010/01/22/nexus-one-usb-in-ubuntu-9-10</a></p><p>Anyone know of a link or know how to get the Nexus One to debug correctly in Ubuntu 9.10?</p>","234933","","65732","","2010-03-15 21:33:46","2010-10-28 01:49:18","Nexus One Android Debugging in Ubuntu 9.10","<android><linux><ubuntu>","4","1","","",""
"2450601","1","2450622","","2010-03-15 21:24:08","8","5332","<p>When I wanted to get Android source code, I knew that I have to use ""repo"". So what is repo? Why do they use repo and not just use GIT?, and is there a GUI for repo that enables me to pause/resume syncing, because every time I get disconnected occasionally it seems that repo starts syncing from the beginning!</p>","292942","","37971","","2010-03-15 21:27:42","2013-09-16 14:37:05","What is Repo and Why does Google use it?","<android><git><repository>","4","0","","",""
"2450697","1","","","2010-03-15 21:41:02","0","596","<p>I am new to android programming and i am trying to make an app that will interface with a website i have. It is a movie website with all of its information stored in SQL database. I know how to write the requests and queries in .asp but dont know how to get information from the database in my app. I want the user to be able to enter a movie title, and through a couple of stored procedures that are in my SQL database, return the info on that movie(actor, budget, genre....). I would like to have little info stored on the device, have all of the queries being sent to my SQL server and just have the info being returned.</p><p>So my question boils down to, how do i link my existing SQL database with an android app.</p><p>Any help would be great.</p><p>ThanksBasketball4567</p>","294324","","","","","2011-06-15 22:44:04","Existing SQL database android help","<android>","1","0","","",""
"2451017","1","","","2010-03-15 22:48:27","1","2224","<p>I've written an app, thats loading images either using the android gallery app or by taking a photo using the cam.</p><p>When I now load an image using the gallery, everything is fine. When the code is being executed a second time (for loading another image), the application crashes.</p><pre><code>            try {            Uri data = intent.getData();            ContentResolver cr = this.getContentResolver();            Bitmap mBitmap = null;            mBitmap = Media.getBitmap(cr, data);            imageView.setImageBitmap(mBitmap);        } catch(Exception e){            showToast(this, ""Failed loading image from gallery"");            return;        }</code></pre><p>The code crashes at the line <code>mBimap = Media.getBitmap(cr, data);</code>. Everything is initialized, there are no null values etc. The strange thing is: no exception is thrown, I don't get into the catch block to determine whats going wrong.</p><p>Does anyone have an idea about this? Am I not allowed to ""re-use"" the content resolver? Do I have to free it after the first usage or something like this?</p>","294355","","","","","2010-08-07 14:18:26","Why does my Android App crash when loading image from gallery the 2nd time?","<android><image><gallery>","1","3","","",""
"2451119","1","","","2010-03-15 23:13:49","0","1866","<p>I would like to be able to close the editpreference dialog (as shown here <a href=""http://twitpic.com/18ttdp"" rel=""nofollow"">http://twitpic.com/18ttdp</a>) by pressing the 'Done' button on the keyboard.</p><p>Currently, pressing 'Done' just dismisses the keyboard but leaves the dialog.</p><p>In other parts of my application I use code similar to the following to intercept the 'Done' key press and execute actions in my activity:</p><pre><code>text.setOnEditorActionListener(new TextView.OnEditorActionListener() {        @Override        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {            if (actionId == EditorInfo.IME_ACTION_DONE) {                //do stuff here                return true;            }            return false;        }    });</code></pre><p>However, I am unsure of how to do achieve this same effect in my preference activity or layout xml. </p>","227228","","","","","2011-03-19 13:02:48","Dismiss android preferences dialog on Keyboard ACTION_DONE press","<android><keyboard><preferences>","2","2","1","",""
"2451281","1","2451564","","2010-03-15 23:52:28","3","2345","<p>I am building a MapView and I want my custom overlay items to display the name of the location they are marking when the user taps them, like the Android Maps app.</p><p>I setup the onTap listener and the floating TextView to hold the location name.  I still need to set it up so that it redraws the label when the user moves the map, etc.</p><p>Anyway, I am wondering if I am reinventing the wheel here.  Is there a built-in method I am unaware of?  I would think that most implementations of MapView have labels.</p><p>For reference, my implementation so far:</p><p>in map xml:</p><pre><code>&lt;LinearLayout android:id=""@+id/mapBubbleWrap""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:layout_alignParentTop=""true""&gt;    &lt;TextView android:id=""@+id/mapBubble""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:visibility=""gone""         android:background=""#ffffff""         android:textColor=""#ff0000""/&gt;&lt;/LinearLayout&gt;</code></pre><p>in my extended ItemizedOverlay:</p><pre><code>public boolean onTap(int index) {    this.setFocus( mOverlays.get(index) );          return true;}</code></pre><p>in my Activity onFocus:</p><pre><code>public void onFocusChanged( ItemizedOverlay overlay, OverlayItem item ) {    if( item != null) {        mapBubble.setText(item.getTitle());        Point newPoint = mapView.getProjection().toPixels(item.getPoint(), null);        mapBubbleWrap.setPadding(newPoint.x, newPoint.y-10, 0, 0);        mapBubble.setVisibility(View.VISIBLE);    }}</code></pre>","265669","","","","","2010-03-16 01:19:56","Android: Map Overlay Labels","<android>","1","0","2","",""
"2451384","1","2451689","","2010-03-16 00:21:32","1","9975","<p>Does anyone know how to create a 1:1 disk image of an Android phone? I am taking a forensics course and our final project involves creating tools to recover information from a suspect's Android based phone, however to do this we need to be able to create a 1:1 image of the phone's disk for baseline comparisons. Also would the image be loadable into AVD?</p>","294388","","164901","","2010-05-09 04:42:15","2010-10-19 19:42:34","Creating an image of an Android phone","<android><android-emulator><disk-imaging>","2","0","1","",""
"2451442","1","2451655","","2010-03-16 00:39:27","2","2503","<p>I'm trying to use a standard Intent that will take a picture, then allow approval or retake.  Then I want to save the picture into a file.</p><p>Here's the Intent I am using:</p><pre><code>Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );startActivityForResult( intent, 22 );</code></pre><p>The <a href=""http://developer.android.com/reference/android/provider/MediaStore.html#ACTION_IMAGE_CAPTURE"" rel=""nofollow"">documentation</a> says:</p><blockquote>  <p>The caller may pass an extra EXTRA_OUTPUT to control where this  image will be written. If the EXTRA_OUTPUT is not present, then a  small sized image is returned as a Bitmap object in the extra field. If  the EXTRA_OUTPUT is present, then the full-sized image will be  written to the Uri value of EXTRA_OUTPUT.</p></blockquote><p>I don't pass extra output, I hope to get a Bitmap object in the extra field of the Intent passed into <code>onActivityResult()</code> (for this request).  So where/how do you extract it?  Intent has a <code>getExtras()</code>, but that returns a Bundle, and Bundle wants a key string to give you something back.</p><p>What do you invoke on the Intent to extract the bitmap?</p>","253661","","68727","","2010-03-16 00:55:48","2010-05-21 20:08:40","How to save a picture to a file?","<android><file><camera><save>","2","3","","",""
"2451582","1","","","2010-03-16 01:28:51","0","897","<p>The Eclipse build for my 1.6 application project is succeeding and theAnt build is failing.  I'm looking for help on why they aren'tbehaving the same way.</p><p>We are developing on Mac OSX 10.5.8 with Eclipse 3.5 against SDK 1.6 +Google APIs.  There are no setting changes in Eclipse, either atworkspace or project level.  Similarly, our ant is also a vanilla-flavored unmodified installation of 1.7.1.  JDK is 1.5.0_22.  TheCLASSPATH environment variable is not set.  JAVA_HOME is /Library/Java/Home</p><p>The application was initially created by a team member using theEclipse plugins.  The application references two jar files, one ofwhich has a dependency on javax.xml.bind.annotation.XmlSeeAlso, whichis not defined anywhere in our code or in android.jar.  The other jarfile has an explicit dependency on android.jar.  I generated the Antbuild file using android update.</p><p>The Eclipse project builds an apk and runs the application in theemulator.  I think this is incorrect behavior.</p><p>The Android ant project fails to build.  I think this is correct behavior.MyClass.java:98: cannot access javax.xml.bind.annotation.XmlSeeAlso   [javac] file javax/xml/bind/annotation/XmlSeeAlso.class not found</p><p>Any ideas as to why the two build methods are behaving differently?  Iwould expect them both to fail.</p><p>Thanks!</p><p>-Amy</p>","294417","","","","","2010-03-16 10:59:00","Android App Build system differences between Eclipse and Ant?","<android><eclipse><ant>","2","0","","",""
"2451744","1","2453748","","2010-03-16 02:26:18","4","16276","<p>I am using a list view in Android 1.5 to show a list of images and text next to the image.  I am trying to vertically center the text but the text is at the top of the row instead of centered.  Below is my layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/row""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:padding=""10dip""&gt;    &lt;ImageView android:id=""@+id/item_image"" android:layout_width=""wrap_content""         android:layout_height=""wrap_content""  android:paddingRight=""10dip""         android:src=""@drawable/default_image"" android:layout_alignParentLeft=""true""        android:layout_alignParentTop=""true""        android:layout_alignParentBottom=""true""        android:layout_centerVertical=""true""        android:gravity=""center_vertical""/&gt;    &lt;TextView android:id=""@+id/item_title""         android:layout_width=""wrap_content"" android:layout_height=""wrap_content""         android:layout_toRightOf=""@id/item_image""         android:layout_alignParentTop=""true""        android:layout_alignParentBottom=""true""        android:layout_centerVertical=""true""        android:gravity=""center_vertical""        /&gt;&lt;/RelativeLayout&gt;</code></pre><p>It seems strange that I need to set alignParentTop=""true"" when I'm trying to vertically center the text, but if I don't the text does not even show up.  What am I doing wrong?</p>","240566","","","","","2012-04-05 14:08:42","How do I vertically align an item within a list using relative layout?","<android><listview><relativelayout>","3","0","1","",""
"2451763","1","","","2010-03-16 02:33:24","1","2450","<p>I got the follow error when I run setAudioSource and setVideoSource.</p><p>03-16 10:26:25.302: ERROR/audio_input(52): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value</p><p>03-16 10:26:25.302: ERROR/audio_input(52): VerifyAndSetParameter failed</p><p>03-16 10:26:25.302: ERROR/CameraInput(52): Unsupported parameter(x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value)</p><p>03-16 10:26:25.302: ERROR/CameraInput(52): VerifiyAndSetParameter failed on parameter #0</p><p>This error happen on both emulator and the device. (I am using Google nexus one)</p><p>I have set the CAMERA and RECORD_AUDIO user permission already. I spent many days but I still cannot figure out what is the cause of this runtime error.</p>","","user294438","","","","2012-09-14 23:30:22","(Android SDk 2.1) Getting error when I use setAudioSource and setVideoSource","<android><video><audio><sdk>","1","0","","",""
"2451797","1","","","2010-03-16 02:44:48","1","605","<p>I'm trying to port one of my iPhone apps over to the Android. It was all going along swimmingly until I came to AlertDialogs. In the iPhone app, sometimes there will be more than one alert to pass to the user. When this happens, the first alert dialog will come up, and when they click it away the next one will come up.I can't seem to get more than one dialog box to come up like that in Android. Is it possible to display back to back AlertDialogs where a second one pops up as soon as the first is finished? </p>","294445","","","","","2010-03-16 16:20:18","How do I display consecutive AlertDialogs in Android?","<android>","1","2","","",""
"2451840","1","2454136","","2010-03-16 02:57:08","2","14266","<p>I downloaded the most recent version of Android for linux (android-sdk_r05-linux_86.tgz).  I was trying to use the the Android Ant task(s) for packaging, building, and deploying my code.  I should mention that I'm running AMD64, but have the 32-bit libraries installed.  The Android Ant tasks are all broken.</p><p>First, the start-emulator task never gets the emulator running.  It does get past starting adb, but then just sits there.</p><p>Second, the SDK is missing the aapt binary in the tools directory.  So, the example notepad sample application will not even package correctly.java.lang.IllegalStateException: Can't find aapt inside the sdk at /home/user/bin/android-sdk-linux_86 at com.googlecode.autoandroid.lib.AndroidTools.locateTool(AndroidTools.java:116) at com.googlecode.autoandroid.lib.AndroidTools.startTool(AndroidTools.java:103) at com.googlecode.autoandroid.lib.AndroidTools.startTool(AndroidTools.java:91) at com.googlecode.autoandroid.lib.UnixAndroidTools.aapt(UnixAndroidTools.java:9)</p><p>I have all the dependencies configured for Android.  I can run it from the command line just fine.</p><p>I assume the Ant code is out of sync with the recent SDK updates.  Can anyone shed some light on this problem?  At this point, I'm considering writing my own Python scripts to interact with the Android SDK.  Ugh.</p>","294453","","","","","2013-09-13 00:00:40","What happened to Android aapt?","<java><android><exception><ant>","2","1","0","",""
"2452017","1","","","2010-03-16 03:52:13","1","4472","<p>I have a sqlite database, and i put this file  in ""assets"" folder.</p><p>The code like below, Pls help and tell what's wrong in this code, </p><p>How to use my own sqlite database. </p><pre><code>public class DataBaseHelper extends SQLiteOpenHelper {     private static String DB_PATH = ""/data/data/com.SGMalls/databases/"";     private static String DB_NAME = ""mallMapv2.sqlite"";     private SQLiteDatabase myDataBase;     private final Context myContext;     public DataBaseHelper(Context context) {             super(context, DB_NAME, null, 1);             this.myContext = context;     }     public void createDataBase() throws IOException {               File dbDir = new File(DB_PATH);             if (!dbDir.exists()) {                 dbDir.mkdir();             }             boolean dbExist = checkDataBase();             if (dbExist) {             } else {                     this.getReadableDatabase();                     try {                             copyDataBase();                     } catch (IOException e) {                             throw new Error(""Error copying database"");                     }             }             close();     }     private boolean checkDataBase() {             SQLiteDatabase checkDB = null;      boolean isnull=false;             try {                     String myPath = DB_PATH + DB_NAME;                     checkDB = SQLiteDatabase.openDatabase(myPath, null,                                     SQLiteDatabase.OPEN_READONLY);             } catch (SQLiteException e) {                     // database does't exist yet.             }             if (checkDB != null) {        isnull=true;                     checkDB.close();             }             return isnull;     }     private void copyDataBase() throws IOException {             InputStream myInput = myContext.getAssets().open(DB_NAME);             String outFileName = DB_PATH + DB_NAME;             OutputStream myOutput = new FileOutputStream(outFileName);             byte[] buffer = new byte[1024];             int length;             while ((length = myInput.read(buffer)) &gt; 0) {                     myOutput.write(buffer, 0, length);             }             // Close the streams             myOutput.flush();             myOutput.close();             myInput.close();     }     public void openDataBase() throws SQLException {             // Open the database             String myPath = DB_PATH + DB_NAME;             myDataBase = SQLiteDatabase.openDatabase(myPath, null,                             SQLiteDatabase.OPEN_READONLY);     }     @Override     public synchronized void close() {             if (myDataBase != null)                     myDataBase.close();             super.close();     }     @Override     public void onCreate(SQLiteDatabase db) {     }     @Override     public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {     }  }public class GetData {      private static String DB_PATH = ""/data/data/com.SGMalls/databases/mallMapv2.sqlite"";         // private static String DB_NAME = ""mallMapv2.sqlite"";     public static ArrayList&lt;Mall&gt; getMalls() {             ArrayList&lt;Mall&gt; mallsList = new ArrayList&lt;Mall&gt;();             SQLiteDatabase malldatabase = SQLiteDatabase.openDatabase(DB_PATH,                             null, SQLiteDatabase.OPEN_READONLY);              String queryString=""select id,title from malls order by title"";              Cursor cursor=malldatabase.rawQuery(queryString, null);               if(cursor!=null){                        cursor.moveToFirst();                        while(!cursor.isLast()){                                Mall mall=new Mall();                               mall.setMallid(cursor.getInt(0));                                mall.setMallname(cursor.getString(0));                                mallsList.add(mall);                                cursor.moveToNext();                        }                }               malldatabase.close();             return mallsList;     } } </code></pre><p>The error message: </p><blockquote>  <p>ERROR/Database(725): sqlite3_open_v2(""/data/data/com.SGMalls/databases/   mallMapv2.sqlite"", &amp;handle, 1, NULL) failed </p>    <p>03-15 22:34:11.747: ERROR/AndroidRuntime(725): Uncaught handler:   thread main exiting due to uncaught exception </p>    <p>03-15 22:34:11.766: ERROR/AndroidRuntime(725): java.lang.Error: Error   copying database </p></blockquote><p>Thanks very much </p><hr><p>The all log error message</p><pre><code>03-16 16:19:18.871: ERROR/vold(550): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)03-16 16:19:18.871: ERROR/vold(550): Error bootstrapping switch '/sys/class/switch/test2' (m)03-16 16:19:18.871: ERROR/vold(550): Error opening switch name path '/sys/class/switch/test' (No such file or directory)03-16 16:19:18.871: ERROR/vold(550): Error bootstrapping switch '/sys/class/switch/test' (m)03-16 16:19:19.091: ERROR/flash_image(558): can't find recovery partition03-16 16:19:33.100: ERROR/MemoryHeapBase(577): error opening /dev/pmem: No such file or directory03-16 16:19:33.100: ERROR/SurfaceFlinger(577): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake03-16 16:19:33.151: ERROR/GLLogger(577): couldn't load &lt;libhgl.so&gt; library (Cannot find library)03-16 16:19:33.261: ERROR/GLLogger(577): couldn't load &lt;libhgl.so&gt; library (Cannot find library)03-16 16:19:36.471: ERROR/BatteryService(577): Could not open '/sys/class/power_supply/usb/online'03-16 16:19:36.471: ERROR/BatteryService(577): Could not open '/sys/class/power_supply/battery/batt_vol'03-16 16:19:36.471: ERROR/BatteryService(577): Could not open '/sys/class/power_supply/battery/batt_temp'03-16 16:19:36.850: ERROR/EventHub(577): could not get driver version for /dev/input/mouse0, Not a typewriter03-16 16:19:36.880: ERROR/EventHub(577): could not get driver version for /dev/input/mice, Not a typewriter03-16 16:19:36.950: ERROR/System(577): Failure starting core service03-16 16:19:36.950: ERROR/System(577): java.lang.SecurityException03-16 16:19:36.950: ERROR/System(577):     at android.os.BinderProxy.transact(Native Method)03-16 16:19:36.950: ERROR/System(577):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)03-16 16:19:36.950: ERROR/System(577):     at android.os.ServiceManager.addService(ServiceManager.java:72)03-16 16:19:36.950: ERROR/System(577):     at com.android.server.ServerThread.run(SystemServer.java:163)03-16 16:19:36.959: ERROR/AndroidRuntime(577): Crash logging skipped, no checkin service03-16 16:19:38.219: ERROR/LockPatternKeyguardView(577): Failed to bind to GLS while checking for account03-16 16:19:39.790: ERROR/jdwp(623): Failed sending req to debugger: Broken pipe (-1 of 27)03-16 16:19:39.790: ERROR/jdwp(623): Failed sending reply to debugger: Broken pipe03-16 16:19:42.960: ERROR/ApplicationContext(577): Couldn't create directory for SharedPreferences file shared_prefs/wallpaper-hints.xml03-16 16:19:44.051: ERROR/ActivityThread(621): Failed to find provider info for android.server.checkin03-16 16:19:45.341: ERROR/ActivityThread(621): Failed to find provider info for android.server.checkin03-16 16:19:45.432: ERROR/ActivityThread(621): Failed to find provider info for android.server.checkin03-16 16:19:51.651: ERROR/Database(715): sqlite3_open_v2(""/data/data/com.SGMalls/databases/mallMapv2.sqlite"", &amp;handle, 1, NULL) failed03-16 16:19:51.701: ERROR/AndroidRuntime(715): Uncaught handler: thread main exiting due to uncaught exception03-16 16:19:51.710: ERROR/AndroidRuntime(715): java.lang.Error: Error copying database03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at Unit.DataBaseHelper.createDataBase(DataBaseHelper.java:47)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at com.Test.Test.onCreate(Test.java:23)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at android.os.Handler.dispatchMessage(Handler.java:99)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at android.os.Looper.loop(Looper.java:123)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at android.app.ActivityThread.main(ActivityThread.java:3948)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at java.lang.reflect.Method.invokeNative(Native Method)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at java.lang.reflect.Method.invoke(Method.java:521)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)03-16 16:19:51.710: ERROR/AndroidRuntime(715):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","275788","","847363","","2012-02-09 09:21:21","2012-02-09 13:37:43","Using my own SQLite Database","<android><database><sqlite>","2","3","1","",""
"2452661","1","","","2010-03-16 07:20:40","2","2977","<p>I want to listen to the changes occured in file system.I am using FileObserver.Here is my code: </p><p>Code: </p><pre><code>class MyDirObserver extends FileObserver {    String superPath;    public MyDirObserver(String path) {        super(path, ALL_EVENTS);        this.superPath = path;    }    public void onEvent(int event, String path) {        Log.e(""onEvent of Directory"", ""=== onEvent ==="");        try {            _Dump(""dir"", event, path, superPath);        } catch (NullPointerException ex) {            Log.e(""ERROR"", ""I am getting error"");        }    }}private void _Dump(final String tag, int event, String path, String superPath) {    Log.d(tag, ""=== dump begin ==="");    Log.d(tag, ""path="" + path);    Log.d(tag, ""super path="" + superPath);    Log.d(tag, ""event list:"");    if ((event &amp; FileObserver.OPEN) != 0) {        Log.d(tag, ""  OPEN"");    }    if ((event &amp; FileObserver.CLOSE_NOWRITE) != 0) {        Log.d(tag, ""  CLOSE_NOWRITE"");    }    if ((event &amp; FileObserver.CLOSE_WRITE) != 0) {        Log.d(tag, ""  CLOSE_WRITE"");        Log.i(""NEWFILEOBSERVER"", ""File is Modified"");        if (path != null) {            Log.d(""---------FilePath"", superPath + path);        }    }    if ((event &amp; FileObserver.CREATE) != 0) {        isCreate = true;        Log.i(""NEWFILEOBSERVER"", ""File is Created "");        if (path != null) {            Log.d(""---------FilePath"", superPath + path);        }        Log.d(tag, ""  CREATE"");    }    if ((event &amp; FileObserver.DELETE) != 0) {        Log.i(""NEWFILEOBSERVER"", ""File is deleted"");        if (path != null) {            Log.d(""---------FilePath"", superPath + path);        }        //  startMyActivity(""A new file is deleted thats=""+superPath);         Log.d(tag, ""  DELETE"");    }    if ((event &amp; FileObserver.DELETE_SELF) != 0) {        Log.d(tag, ""  DELETE_SELF"");    }    if ((event &amp; FileObserver.ACCESS) != 0) {        Log.d(tag, ""  ACCESS"");    }    if ((event &amp; FileObserver.MODIFY) != 0) {        if (!isModified)            isModified = true;        if (isModified &amp;&amp; isOpen)            isAgainModified = true;        Log.d(tag, ""  MODIFY"");    }    if ((event &amp; FileObserver.MOVED_FROM) != 0) {        Log.d(tag, ""  MOVED_FROM"");        if (path != null) {            Log.d(""---------FilePath"", superPath + path);        }    }    if ((event &amp; FileObserver.MOVED_TO) != 0) {        Log.d(tag, ""  MOVED_TO"");        if (path != null) {            Log.d(""---------FilePath"", superPath + path);        }    }    if ((event &amp; FileObserver.MOVE_SELF) != 0) {        Log.d(tag, ""  MOVE_SELF"");    }    if ((event &amp; FileObserver.ATTRIB) != 0) {        Log.d(tag, ""  ATTRIB"");    }    Log.d(tag, ""=== dump end ==="");}</code></pre><p>it stops after some time.I dont get the exact time but doesnt work always though I call startWatching() in service in a loop which runs for all the folders of sdcard and calls startWatching() for each of them. It shows unpredictable behaviour and stops listening for some folders and runs perfectly for the others.</p><p>I hope you guys help me. I tried many ways but it doesn't work perfectly. Am I doing something wrong? Or is there some other way to do this.</p>","208436","","2218452","","2013-05-30 13:07:05","2013-05-30 13:07:05","File observer stops working after some time","<android><fileobserver>","1","1","","",""
"2452767","1","2456065","","2010-03-16 07:45:48","0","1233","<p>i am working on an application that needs to scan bar codes as a functionality..I have integrated all the code of zxing with my app code and now when i try to install it on my device(OS 1.6) it gives me an ""INSTALL_FAILED_CPU_ABI_INCOMPATIBLE"" error...</p><p>i cant use intents to use the barcode application because that will create a necessity to have zxing installed on the device..i want my application to be standalone..</p><p>Please suggest what do i do???</p>","152867","","","","","2010-03-16 16:15:42","Integrate zxing code with the application and install in on Android os higher than 1.5","<android>","1","0","","",""
"2452809","1","","","2010-03-16 07:58:37","3","4422","<p>I have a ListView in my android activity. And I populate the ListView by sub-class the BaseAdaptor (which returns a View in getView() method).</p><p>What if in my click listener of a button in a list item view, I </p><ul><li>change the text of the TextView in the List item viewor</li><li>change the dimension of the list item view by adding/removing children of the list item view</li></ul><p>What is an efficient to refresh my listView? I don't want the listView to re-trigger a query since there is no data change.</p><p>Thank you.</p>","286802","","133802","","2010-03-16 08:02:59","2010-03-16 08:36:30","Refresh a ListView if I change the content of the ListItem","<android>","2","0","3","",""
"2452937","1","","","2010-03-16 08:32:53","0","1730","<p>I'd like to know how the key event is handled in Android platform.From 'when user type key 'a' on software keyboard',To 'view draw the character 'a' on itself'.</p><p>Probably, the key event is generated by IME,And it will be sent to parent view,Finally, view(such as EditText) displays chracters.</p><p>Please somebody explains about these entire key event handling process.</p>","280137","","","","","2010-03-17 13:50:16","Key event handling process","<android>","2","1","2","",""
"2453316","1","2453337","","2010-03-16 09:52:57","0","1501","<p>I am working on a on-screen keyboard for Android, and I need to recognize starting points, turning points and end points of lines drawn by the user on the keyboard. A simple straightening function would be nice, as it is difficult to draw a perfectly straight line even with a stylus, not to mention finger-only touchscreens today.</p><p>What I am trying to write is something like Swype.</p><p>Any good libraries that I can use or make reference to?</p>","206681","","321731","","2013-10-22 17:56:14","2013-10-22 17:56:14","Any simple shape recognition libraries for Java?","<java><android><keyboard><shape>","1","0","0","2013-09-09 20:16:00",""
"2453398","1","2457028","","2010-03-16 10:04:47","5","9508","<p>Hi Im trying to start android market via my app to search similar products. I'm using this code.    </p><pre><code>    Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(""http://market.android.com/search?q=pub:\""some txt\"""")); c.startActivity(intent);</code></pre><p>This works fine but when I hit on Home button with in the market and goto home phone home screen.When I open again the app it still shows market results. (i want to goto main menu)</p><p>Whats the solution?thanks</p>","274107","","","","","2010-12-29 16:12:49","Android new Intent","<android><new-operator><android-intent><google-play>","3","0","1","",""
"2453439","1","2453496","","2010-03-16 10:10:16","0","1227","<p>I want install Android version 1.6 SDK. I already have Android development setup with Eclipse and Android 1.5 SDK.Wherever i search in Google to download Android 1.6 SDK, it finally goes to link: <a href=""http://developer.android.com/intl/zh-CN/sdk/index.html"" rel=""nofollow"">http://developer.android.com/intl/zh-CN/sdk/index.html</a></p><p>This link has three setup SDK zip files, but no where mentioned what version of SDK setup are those? Why such confusions in this Android website for showing just version of SDK setup files? Where i can get exactly Android 1.6 SDK setup download? Could someone point out me clearly?</p><p>Is there any special steps that i need to follow to overwrite 1.6 SDK with my existing setup environment?</p><p>Thank you.</p>","187532","","","","","2010-03-18 19:32:31","Android:Where is exactly Android 1.6 SDK download?","<android>","4","0","","",""
"2453465","1","2453623","","2010-03-16 10:13:21","1","1050","<p>I have a selection for some items using a spinner widget. At the moment the spinner will load a simple Textview and show the name of the item.<br>It is possible to define an own view to show inside the spinner row? I would suspect it being similar to a custom List row.  </p><p>I simply want to show an individual icon left from the spinner text for each item in the list. </p>","114066","","","","","2011-03-25 12:26:21","How to show own view in Spinner Widget instead of Text View?","<android><layout><view><spinner>","2","0","","",""
"2453543","1","","","2010-03-16 10:28:13","11","20628","<p>I am trying to create an AppWidget, in which the background color of a TextView changes at random at specified periodic interval.   </p><p>The TextView is defined in layout xml file as</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8"" ?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/widget""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical"" &gt;    &lt;TextView          android:id=""@+id/message""        android:background=""#ff99ff""        android:text=""Hello Widget"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>In update method, i have loaded the layout as</p><pre><code>RemoteViews remoteView=new RemoteViews(context.getPackageName(),R.layout.widget_message);</code></pre><p>To change the background of TextView i used the following statement</p><pre><code>remoteView.setInt(R.id.message, ""setBackgroundResource"", R.color.col_1);</code></pre><p>But i am getting a widget saying problem loading widget. If i remove the above line everything works fine.  </p><p>LogCat says:  </p><blockquote>  <p>updateAppWidget couldn't find any  view, using error view</p>    <p>android.widget.RemoteViews$ActionException:  view: android.widget.TextView can't  use method with RemoteViews:  setBackgroundResource(int)</p></blockquote>","273548","","273548","","2010-04-01 05:05:50","2013-10-03 07:45:16","Android AppWidget TextView: How to set background color at run time","<android>","7","0","5","",""
"2453620","1","2453661","","2010-03-16 10:41:26","11","14151","<p>I have a list view filled with data. I set up a context menu for the listview using the following code:</p><pre><code>list.setOnCreateContextMenuListener(  new View.OnCreateContextMenuListener()   {        public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo)         {       AdapterContextMenuInfo mi =(AdapterContextMenuInfo) menuInfo;       menu.add(0, 0, 0, ""Delete item"");                    }   });</code></pre><p>I have the following method override to control de contextmenu menuitem selected:</p><pre><code>@Overridepublic boolean onContextItemSelected(MenuItem item) {  switch(item.getItemId())   {   case 0:     ShowAlert(""hello from delete item"");    break;   default:   return super.onContextItemSelected(item);   }   return true; }</code></pre><p>In this overrided method, how could i find the item of the list view that was clicked?</p><p>Thanks in advance.Best Regards.Jose</p>","79919","","","","","2010-03-16 10:47:58","Android: How to find the position clicked from the context menu","<android><android-emulator>","2","0","9","",""
"2453658","1","","","2010-03-16 10:47:41","0","3142","<p>Basically I'm wondering how I'm able to do what I've written in the topic. I've looked through many tutorials on AsyncTask but I can't get it to work. I have a little form (EditText) that will take what the user inputs there and make it to a url query for the application to lookup and then display the results. </p><p>What I think would seem to work is something like this: In my main activity i have a string called responseBody. Then the user clicks on the search button it will go to my search function and from there call the GrabUrl method with the url which will start the asyncdata and when that process is finished the onPostExecute method will use the function activity.this.setResponseBody(content). </p><p>This is what my code looks like simpliefied with the most important parts (I think).</p><pre><code>public class activity extends Activity {   private String responseBody;       @Override   public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);      initControls();   }   public void initControls() {      fieldSearch = (EditText) findViewById(R.id.EditText01);      buttonSearch = (Button)findViewById(R.id.Button01);      buttonSearch.setOnClickListener(new Button.OnClickListener() { public void onClick (View v){ search();    }});  }    public void grabURL(String url) {    new GrabURL().execute(url);}    private class GrabURL extends AsyncTask&lt;String, Void, String&gt; {       private final HttpClient client = new DefaultHttpClient();       private String content;       private boolean error = false;       private ProgressDialog dialog = new ProgressDialog(activity.this);       protected void onPreExecute() {        dialog.setMessage(""Getting your data... Please wait..."");        dialog.show();       }   protected String doInBackground(String... urls) {      try {         HttpGet httpget = new HttpGet(urls[0]);     ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();     content = client.execute(httpget, responseHandler);      } catch (ClientProtocolException e) {     error = true;     cancel(true);      } catch (IOException e) {     error = true;     cancel(true);      }      return content;   }   protected void onPostExecute(String content) {      dialog.dismiss();      if (error) {             Toast toast = Toast.makeText(activity.this, getString(R.string.offline), Toast.LENGTH_LONG);         toast.setGravity(Gravity.TOP, 0, 75);         toast.show();      } else {     activity.this.setResponseBody(content);      }    }     }        public void search() {          String query = fieldSearch.getText().toString();          String url = ""http://example.com/example.php?query="" + query; //this is just an example url, I have a ""real"" url in my application but for privacy reasons I've replaced it           grabURL(url); // the method that will start the asynctask          processData(responseBody); // process the responseBody and display stuff on the ui-thread with the data that I would like to get from the asyntask but doesn't obviously         }</code></pre>","294661","","294661","","2010-03-16 21:52:25","2013-03-15 03:28:47","Fetching data (responsebody) with a HttpClient in an AsyncTask and returning the data outside the AsyncTask to the UI-thread","<java><android><httpwebrequest><return-value><android-asynctask>","1","9","","",""
"2453923","1","","","2010-03-16 11:35:09","1","648","<p>I have a MapView with a MapItemizedOverlay, like this :</p><pre><code>Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);itemizedOverlay = new MapItemizedOverlay(drawable);OverlayItem overlayitem = new OverlayItem(p, """", """");itemizedOverlay.addOverlay(overlayitem);        mapOverlays.add(itemizedOverlay); </code></pre><p>I want to know when the user touches the AndroiMarker, so I can show some info about that specific place. How do I do that ?</p><p>Tks in advance! </p>","294701","","","","","2010-03-16 20:42:35","OnTouchEvent in a MapItemizedOverlay","<android><overlay><android-mapview>","1","0","","",""
"2453949","1","","","2010-03-16 11:40:03","51","28621","<p>How do I monitor network traffic sent and received from my android emulator?</p>","294706","","114066","","2010-03-31 09:14:57","2014-04-03 14:27:06","Android emulator: How to monitor network traffic?","<android><networking><emulator><traffic><sniffer>","7","0","30","",""
"2453989","1","2454084","","2010-03-16 11:45:22","27","56340","<p>I am just trying to display a list from an array that I have in my arrays.xml. When I try to run it in the emulator, I get a force close message. </p><p>If I define the array in the java file </p><p><code>String[] testArray = new String[] {""one"",""two"",""three"",""etc""};</code> </p><p>it works, but when I use </p><p><code>String[] testArray = getResources().getStringArray(R.array.testArray);</code></p><p>it doesnt work.</p><p>Here is my Java file:</p><pre><code>package com.xtensivearts.episode.seven;import android.app.ListActivity;import android.os.Bundle;import android.widget.ArrayAdapter;public class Episode7 extends ListActivity { String[] testArray = getResources().getStringArray(R.array.testArray); /** Called when the activity is first created. */ @Override protected void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  // Create an ArrayAdapter that will contain all list items  ArrayAdapter&lt;String&gt; adapter;  /* Assign the name array to that adapter and      also choose a simple layout for the list items */   adapter = new ArrayAdapter&lt;String&gt;(    this,    android.R.layout.simple_list_item_1,    testArray);  // Assign the adapter to this ListActivity  setListAdapter(adapter); }}</code></pre><p>Here is my arrays.xml file</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;      &lt;resources&gt;       &lt;array name=""testArray""&gt;      &lt;item&gt;first&lt;/item&gt;      &lt;item&gt;second&lt;/item&gt;      &lt;item&gt;third&lt;/item&gt;      &lt;item&gt;fourth&lt;/item&gt;      &lt;item&gt;fifth&lt;/item&gt;       &lt;/array&gt;    &lt;/resources&gt;</code></pre>","294703","","457982","","2011-03-05 06:38:12","2013-04-28 12:36:59","Help in getting String Array from arrays.xml file","<java><android><arrays>","3","0","13","",""
"2454224","1","2459696","","2010-03-16 12:24:55","5","4832","<p>I have a list view and want to put stuff both above(on the y axis) and below(y axis) it including images, text views, and a row of buttons.  Below is a simplified version of what I am creating.  Unfortunately the list covers(i.e. above on the z axis) the header so the header text is not visible instead of being underneath (on the y axis)</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;    &lt;TextView android:id=""@+id/footer""         android:text=""footer""        android:layout_height=""wrap_content""         android:layout_width=""fill_parent""         android:layout_alignParentBottom=""true""        /&gt;    &lt;ListView  android:id=""@+id/list_view""         android:layout_height=""fill_parent""         android:layout_width=""fill_parent""        android:layout_above=""@id/footer""        android:background=""#ff9999ff""/&gt;    &lt;TextView android:id=""@+id/header""         android:text=""header""        android:layout_height=""wrap_content""         android:layout_width=""fill_parent""         android:layout_alignParentTop=""true""        android:layout_above=""@id/list_view""        android:baselineAlignBottom=""false""        /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Here is the corresponding Activity class:</p><pre><code>public class SampleListActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.list_activity);    }}</code></pre>","240566","","240566","","2010-03-17 03:18:03","2013-04-15 06:11:28","How do I place widgets above and below a listview?","<android><listview><layout>","3","0","2","",""
"2454296","1","2454439","","2010-03-16 12:36:09","3","5466","<p>I am trying to play audio buffered sound (.wav) using AudioTrack. Please see the code below. I need to call this function under a Thread to support simultaneous play. It is fine being under a Thread. It is working fine playing the sound normally. But if i execute playing the sound using AudioTrack one after another continuously(i.e. executing second play before completing the first play sound), produces device crash (force close unexpectedly error).Does anyone come across such problems and resolve it in a way?</p><pre><code>private void PlayAudioTrack(String filePath) throws IOException{    if (filePath==null)        return;    byte[] byteData = null;    File file = null;     file = new File(filePath); // sdcard path    byteData = new byte[(int) file.length()];    FileInputStream in = null;    try {        in = new FileInputStream( file );        in.read( byteData );        in.close();     } catch (FileNotFoundException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    int intSize = android.media.AudioTrack.getMinBufferSize(8000, AudioFormat.CHANNEL_CONFIGURATION_MONO,            AudioFormat.ENCODING_PCM_8BIT);    at = new AudioTrack(AudioManager.STREAM_MUSIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO,                        AudioFormat.ENCODING_PCM_8BIT, intSize, AudioTrack.MODE_STREAM);    at.play();    at.write(byteData, 0, byteData.length);    at.stop();              }</code></pre><p>Appreciate your response.</p><p>Thanks.</p>","187532","","","","","2010-03-16 12:55:38","Android:Playing AudioTrack multiple times producing crash","<android>","1","0","1","",""
"2454337","1","2454430","","2010-03-16 12:41:28","23","12946","<p>I'm using a ListView that is setup like this:</p><pre><code>&lt;ListView android:id=""@android:id/list"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:longClickable=""false""    android:choiceMode=""singleChoice""&gt;&lt;/ListView&gt;</code></pre><p>In my code I add an OnItemSelectedListener to the ListView like this:</p><pre><code>getListView().setAdapter(adapter);getListView().setOnItemSelectedListener(this);</code></pre><p>my Activity implements the listener like that:</p><pre><code>@Overridepublic void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {    Log.d(""Tag"", ""ListItemSelected: Parent: "" + parent.toString() + "" View: ""            + view.toString() + "" Position: "" + "" Id: "" + id);}</code></pre><p>My hope was, that I would see this debug output the moment I click on something in the list. But the debug output is never shown in LogCat.</p>","114066","","114066","","2012-01-27 08:40:50","2014-04-16 07:27:16","Why is my onItemSelectedListener not called in a ListView?","<android><android-listview><listener>","2","0","2","",""
"2454433","1","","","2010-03-16 12:54:45","4","420","<p>With my current code base I'd like to build two or more different versions of my Android app (free, premium, ...). For the iPhone (XCode) I can definte different targets. Is there something similar implemented in Eclipse?</p>","184367","","","","","2011-02-24 13:21:12","Android: building different versions of my app (free, premium, etc.) with Eclipse","<java><android><eclipse>","3","0","2","",""
"2454477","1","2458059","","2010-03-16 13:04:25","5","2924","<p>I get a lot of requests in my application to allow for custom icons packs from BetterCut / Open Home.  The way it seems to work is you install BetterCut or Open Home, then you can install tons of these free icon packs from the market.  Once installed both those apps (and other apps) will poll for those icon packs and use the icons. </p><p>I want to know how to poll the install applications for the asset folders that are available.  I have opened up a few of the icon packs and verified that there is an assets folder in there and they are full of all the icon png files.</p><p>I've searched on here, other code sites, google, etc but havn't found any leads.</p><p>UPDATE:</p><p>From the answer below I have written some code to try and list a file from my own projects assets directory but it does not seem to work.</p><pre><code>Resources r = this.getResources();AssetManager a = r.getAssets();String[] list = a.list(""/"");Log.d(""test"", ""Length of / is ""+list.length);for (String s : list) {    Log.d(""test"", s);}Log.d(""test"", ""Length of /assets is ""+a.list(""/assets"").length);Log.d(""test"", ""Length of /assets/ is ""+a.list(""/assets/"").length);Log.d(""test"", ""Length of /assets/ is ""+a.list(""/assets/"").length);Log.d(""test"", ""Length of ./assets/ is ""+a.list(""./assets/"").length);Log.d(""test"", ""Length of ./assets is ""+a.list(""./assets"").length);</code></pre><p>This is the output:</p><pre><code>03-16 12:25:04.591: DEBUG/test(13526): Length of / is 603-16 12:25:04.591: DEBUG/test(13526): AndroidManifest.xml03-16 12:25:04.591: DEBUG/test(13526): META-INF03-16 12:25:04.591: DEBUG/test(13526): assets03-16 12:25:04.591: DEBUG/test(13526): classes.dex03-16 12:25:04.591: DEBUG/test(13526): res03-16 12:25:04.591: DEBUG/test(13526): resources.arsc03-16 12:25:04.614: DEBUG/test(13526): Length of /assets is 003-16 12:25:04.637: DEBUG/test(13526): Length of /assets/ is 003-16 12:25:04.661: DEBUG/test(13526): Length of /assets/ is 003-16 12:25:04.692: DEBUG/test(13526): Length of ./assets/ is 003-16 12:25:04.716: DEBUG/test(13526): Length of ./assets is 0</code></pre><p>UPDATE 2 99% There!!!:</p><p>I figured out that you can read from the assets directory without actually using the folder name:</p><pre><code>InputStream is = assetManager.open(""test.png"");</code></pre><p>I also tried this with an asset in Appliction 2 from Application 1, where the folder path is /asset/icon/image.png:</p><pre><code>InputStream is = assetManager.open(""icon/image.png"");</code></pre><p>Next I figured out that you can list a directory inside assets:</p><pre><code>String[] list = assetManager.list(""icons"");</code></pre><p>That also works great.  The only thing failing right now is how to list the base directory assets.</p>","242904","","242904","","2010-03-16 20:23:13","2010-03-16 20:54:15","Access Assests from another application?","<android>","3","0","2","",""
"2454617","1","2454638","","2010-03-16 13:23:53","7","1336","<p>I've already written some small Android Applications, most of them in one Activity and nearly no data that should be persistent on the device. </p><p>Now I'm writing an application that needs more Activities and I'm a bit puzzled about how to organize all this. My app will download some data parse it show it to the user and then show other activities depending on the data and the user interaction. Some of that data could be cached, some of it has to be downloaded every time. Some of that data should not be downloaded freshly at the moment the orientation changes, but it should on the moment the activity is created...</p><p>Another thing I'm confused about are things like a httpClient. I now for example create a new httpclient for every activity, the same thing for locationlisteners. </p><p>Are there books, a blogs or documentations with patterns, examples and advice on organizing larger apps build on android? Everything I found until now are get startet tutorials leaving me alone after 60 lines of code...</p><p>I would be very happy if some of you could provide some good resources.</p>","114066","","114066","","2010-03-17 14:45:07","2010-03-17 14:45:07","Best practices for developing bigger applications on Android","<android>","2","1","1","","2010-03-16 13:23:53"
"2454852","1","2455057","","2010-03-16 13:54:08","4","1637","<p>I'm thinking about using a ViewFlipper for an Wizard like Activity. But I see one problem with this approach. The back button. Will the back button go back to the last shown activity or will the the Viewflipper somehow catch the back button event and only change to the last shown activity? </p><p>I suspect the ViewFlipper to be treated as one Activity on the BackStack so is seems that is the wrong aproach for a wizard. Is this correct?</p>","114066","","","","","2010-03-16 14:19:07","How is the Viewflipper handling the back button in Android?","<android><viewflipper>","1","0","","",""
"2454884","1","","","2010-03-16 13:58:53","2","1688","<p>I want to create a better <code>NumberPicker</code> then the one used in <code>DatePicker. I looked at the HTC Sense Alarm clock Roller (looks like the</code>iPhone` Spinner/Roller), I want to create something like that.</p><p>I've created a <code>ListView</code> that looks right, but I need a way to get the current id of the middle row. <code>ListView.getFirstVisiblePosition()</code> kind of does what I want but it will give me +-1 errors. Another problem is that the scrolling should lock into a certain row when ""dying"" out. These are of course related and I hope I can solve this by using a custom <code>ListView</code>, but it's hid in the API.</p><p>Any thoughts on how to solve this?</p>","294796","","493939","","2012-05-09 18:55:19","2012-05-09 18:55:19","Creating an iPhone like roller in Android using ListView","<android><android-listview><custom-controls>","3","0","2","",""
"2455102","1","2455212","","2010-03-16 14:25:56","11","32412","<p>I'm trying to write a file from an Http post reply to a file on the <strong>sdcard</strong>.Everything works fine until the byte array of data is retrieved.</p><p>I've tried setting WRITE_EXTERNAL_STORAGE permission in the manifestand tried many different combinations of tutorials I found on the net.</p><p>All I could find was using the openFileOutput("""",MODE_WORLD_READABLE) method, of the activitybut how my app writes file is by using a thread.Specifically, a thread is invoked from another thread when a file has to be written,so giving an activity object didn't work even though I tried it.</p><p>The app has come a long way and I cannot change how the app is currently written.Please, someone help me?</p><p>CODE:</p><pre><code>    File file = new File(bgdmanip.savLocation);    FileOutputStream filecon = null;            filecon = new FileOutputStream(file);</code></pre><p>// bgdmanip.savLocation holds the whole files path</p><pre><code>        byte[] myByte;        myByte = Base64Coder.decode(seReply);        Log.d(""myBytes"", String.valueOf(myByte));        bos.write(myByte);        filecon.write(myByte);        myvals = x * 11024;</code></pre><p>seReply is a string reply from HttpPost response.the second set of code is looped with reference to x.the file is created but remains 0 bytes</p>","132347","","127013","","2010-11-05 09:44:05","2014-01-13 16:06:51","Writing a file to sdcard","<android><file><file-io>","3","0","7","",""
"2455552","1","","","2010-03-16 15:13:02","4","2264","<p>I have a WebView. I'm not quite sure how caching works for it. Ideally I'd like to load a webpage from the network once (images included), then from then on only ever load it from the local cache. I'm not sure if we have this level of control over webview. Will it at some point just auto-clear the cache? How could I tell? I need to be sure that it's really keeping the page cached between different runs of my application.</p><p><a href=""http://developer.android.com/reference/android/webkit/WebSettings.html"" rel=""nofollow"">http://developer.android.com/reference/android/webkit/WebSettings.html</a></p><p>the cache modes there don't seem to specify if the cache persists between runs of the application or not?</p><p>Thanks</p>","246114","","","","","2010-09-15 05:49:10","Will WebView cache persist between application runs?","<android>","1","2","1","",""
"2455987","1","","","2010-03-16 16:05:40","2","704","<p>I've been trying to use the <a href=""http://developer.android.com/reference/android/webkit/CacheManager.html"" rel=""nofollow"">CacheManager</a> for caching some httprequests but it failed every time with a nullpointer exception. Aftersome digging I believe I found out why:</p><p><code>CacheManager.getCacheFileBaseDir()</code> always returns null so when I tryto use <code>CacheManager.getCacheFile()</code> or <code>CacheManager.saveCacheFile()</code>they fail.</p><p><code>CacheManager.cacheDisabled()</code> returns false.</p><p>I hadn 't created a cache partition via the AVD manager so I thoughtthe problem lie there. But after creating a cache partition<code>getCacheFile()</code> still return null:</p><pre><code>03-16 00:25:16.321: ERROR/AndroidRuntime(296): Caused by: java.lang.NullPointerException03-16 00:25:16.321: ERROR/AndroidRuntime(296): at android.webkit.CacheManager.getCacheFile(CacheManager.java:296)</code></pre><p>What could be the problem? I've got the code posted here:<a href=""http://pastebin.com/eaJwfXEK"" rel=""nofollow"">http://pastebin.com/eaJwfXEK</a>But it's a bit messy because I've been trying tons of stuff.</p><p>Why does <code>CacheManager.getCacheFileBaseDir()</code> return null and not a File object?</p>","294916","","114066","","2010-06-16 08:22:06","2011-09-06 22:20:08","CacheManager.getCacheFileBaseDir() always returns null","<android><caching><httpwebrequest>","2","0","1","",""
"2456069","1","2456089","","2010-03-16 16:16:24","1","3062","<p>I use two Spinner in my App. One of them is initially disabled because I need the user to select something in the first spinner to load the content of the second one. </p><p>I would like to change the design of the second spinner to show the user that the spinner is not active, eg. grey the spinner out. How can I achieve this?</p><p>If this is not possible how would you change this dialog to make it clear to the user that she has to select something in the first spinner?</p>","114066","","","","","2010-03-16 17:40:23","How to grey out spinner in Android?","<android><layout><spinner>","2","0","","",""
"2456216","1","2582133","","2010-03-16 16:33:57","0","548","<p>I'm looking to design an application that will require some deep control over IP packets. Looking over the reference guide on the developers site at Android I see very limited control over packets from java.net:SocketOptions and java.net:DatagramPacket. Specifically I'm looking to control the individual bits within the packet to set TCP Flags, SYN/ACK/RST, and so forth. Based on the docs I am assuming I cannot do this within the Java API provided by Android and I'm guessing I'll have to do it some other way?</p><p>Anyone have any insight on this?</p>","294923","","243782","","2010-03-16 16:38:03","2010-04-06 01:28:27","How to gain greater control of network packets on Android","<java><android><tcp><network-programming><packets>","1","2","","",""
"2456344","1","","","2010-03-16 16:50:13","67","64258","<p>I got very frustrated when I realized that Android is not able to display PDFs (in a WebView or whatever) out-of-the-box.</p><p>So my question is: are there any (OS) JARs or classes to display a PDF document within an app?</p><p>Does anybody have experience with using some of the standard Java PDF viewer libraries on Android? The libraries don't need to be free, only usable with Android phones.</p><p>I heard that iText got ported over to Android. Have any of you done something with it yet?</p>","272089","","1427098","","2012-06-22 09:39:13","2014-01-27 14:25:24","Display PDF within app on Android?","<android><pdf>","5","2","57","",""
"2456413","1","2456529","","2010-03-16 16:57:03","0","1464","<p>I'm putting together a simple test made up of two tutorials available online for OpenGL ES on Android.  This is really just so that I can learn about the basics of OpenGL ES to better understand how I have to design my program.</p><p>Right now, when it tries to render, the mouse movement effect works, but I get no square drawn on the screen.</p><p>Here are the two source files I'm dealing with:</p><pre><code>import javax.microedition.khronos.egl.EGLConfig;import javax.microedition.khronos.opengles.GL10;import android.opengl.GLSurfaceView;import android.opengl.GLU;//Simple clear-screen renderer.class ClearRenderer implements GLSurfaceView.Renderer {    private float mRed;    private float mGreen;    private float mBlue;    private TileUI testTile;    public ClearRenderer() {        this.testTile = new TileUI();    }    public void onSurfaceCreated(GL10 gl, EGLConfig config) {        gl.glShadeModel(GL10.GL_SMOOTH);        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);        gl.glClearDepthf(1.0f);        gl.glEnable(GL10.GL_DEPTH_TEST);        gl.glDepthFunc(GL10.GL_LEQUAL);        gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);     }    public void onSurfaceChanged(GL10 gl, int w, int h) {        gl.glViewport(0, 0, w, h);        gl.glMatrixMode(GL10.GL_PROJECTION);        gl.glLoadIdentity();        // Calculate The Aspect Ratio Of The Window        GLU.gluPerspective(gl, 45.0f, (float)w / (float)h, 0.1f, 100.0f);        gl.glMatrixMode(GL10.GL_MODELVIEW);        gl.glLoadIdentity();    }    public void onDrawFrame(GL10 gl) {        gl.glClearColor(mRed, mGreen, mBlue, 1.0f);        gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);        gl.glLoadIdentity();        gl.glTranslatef(0.0f, 0.0f, 0.0f);        testTile.draw(gl);    }    public void setColor(float r, float g, float b) {        mRed = r;        mGreen = g;        mBlue = b;    }}</code></pre><p>The second one is the tile object itself:</p><pre><code>import java.nio.ByteBuffer;import java.nio.ByteOrder;import java.nio.FloatBuffer;import javax.microedition.khronos.opengles.GL10;public class TileUI {    private float[] vertices = {        -1.0f, -1.0f,  0.0f,        // Bottom left         1.0f, -1.0f,  0.0f,        // Bottom right        -1.0f,  1.0f,  0.0f,        // Top left         1.0f,  1.0f,  0.0f         // Top right    };    private FloatBuffer vertexBuffer;    public TileUI() {        ByteBuffer byteBuf = ByteBuffer.allocateDirect(vertices.length * 4);        byteBuf.order(ByteOrder.nativeOrder());        vertexBuffer = byteBuf.asFloatBuffer();        vertexBuffer.put(vertices);        vertexBuffer.position(0);    }    // Performs the actual drawing of a Tile.    public void draw(GL10 gl) {        // Set the face rotation.        gl.glFrontFace(GL10.GL_CW);        // Point to our vertex buffer.        gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);        // Enable vertex buffer.        gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);        // Draw the vertices as a triangle strip.        gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertices.length / 3);        // Disable the client state before leaving.        gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);          }}</code></pre><p>I will definitely apologize in advance, this is a bit of a Frankenstein, any help and explanation about what's going on here would be greatly appreciated.</p>","128991","","","","","2010-03-16 17:12:36","Simple 2D tile not rendering on Android","<android><opengl-es>","1","0","","",""
"2456500","1","","","2010-03-16 17:07:59","0","2676","<p>I'd like to be able to create a special user account that would exist on an android device.  Since it is based on the Linux kernel, I was hoping there was a way to create a group account and then create a user account.  Is it possible ? </p>","70711","","","","","2011-07-15 01:35:35","Is there a way to create a new user account within Android?","<android>","1","0","","",""
"2456562","1","2456660","","2010-03-16 17:16:55","6","9594","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2247998/noclassdeffounderror-eclipse-and-android"">NoClassDefFoundError - Eclipse and Android</a>  </p></blockquote><p>I'm seeing this question is getting asked a lot in many different contexts.  Perhaps we can set some strategies for locating and fixing it?  I'm noobish myself so all I can contribute are horror stories and questions, sorry...</p><p>It seems this is thrown when a class is visible at compile time but not at run time... how can this happen?</p><p>In my case I am developing an app that uses the Google APIs, in Eclipse, for the Android platform.  I've configured the Project Properties / Java Build Path / Libraries to include the  gdata .jars and all is well.  When I execute in the emulator I get a force close and the logcat shows a NoClassDefFoundError on a simple new ContactsService(""myApp"");  I've also tried a new CalendarService(""myApp"") with the same results.</p><p>Is it possible or desirable to statically bind at compile time to avoid the problem?</p><p>How could dynamic binding of an add-on library work in the mobile environment anyway?  Either it has to be bound into my .apk or else I need to ""install"" it? ... hmmm.</p><p>Advice much appreciated.</p>","294973","","","","","2012-03-15 18:21:16","Approach for fixing NoClassDefFoundError?","<java><android><eclipse><gdata-api><noclassdeffounderror>","4","0","","2012-03-16 11:53:42",""
"2456741","1","","","2010-03-16 17:42:13","0","527","<p>My problem is the following: I have a component that extends DialogPreference. If I change the associated preference from outside the UI...</p><pre><code>SharedPreferences.Editor ed= sharedPreferences.Edit();ed.putInteger(""Setting"",aValue);ed.commit();</code></pre><p>...then, when I open the dialog the selected preference has not changed. Even if the shared preference value is modified, it still contains the previously set value.</p><p>Does anyone have any idea what could be causing this?</p>","284609","","500478","","2013-04-12 13:05:08","2013-04-12 13:05:08","Preferences Not Saved in DialogPreference","<android>","0","2","","",""
"2456793","1","","","2010-03-16 17:51:15","0","448","<p>when I compile android (<a href=""http://source.android.com/download"" rel=""nofollow"">http://source.android.com/download</a>) it does not compile some source files. For example there is external/bluetooth/bluez/sbc/sbc.c which is not compiled. There are also other such files.</p><p>It's possible those files need not to be compiled. Or it might be that I need some special configuration to compile them.</p><p>Either way, if it is possible, I'd like to compile them. Is there some way to do it? Maybe some ""compile_all"" make target? </p><p>(I believe the reason why I want to compile all source files is not important)</p>","295013","","","","","2010-03-16 17:57:42","How to compile all source files (default make target does not compile all of them)","<android>","1","0","","",""
"2456802","1","2457217","","2010-03-16 17:52:47","7","19880","<p>i'm trying the camera preview</p><p>This is my code and it doesn't throw any error, but the screen is still black.  Any ideas?</p><pre><code>this.setContentView(R.layout.camerapreview);    SurfaceView cameraSurface = (SurfaceView)findViewById(R.id.cpPreview);SurfaceHolder holder = cameraSurface.getHolder();holder.addCallback(this);holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);this.camera = Camera.open();this.camera.setPreviewDisplay(holder);this.camera.startPreview();</code></pre><p>camerapreview.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;    &lt;SurfaceView        android:id=""@+id/cpPreview""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:layout_gravity=""center""&gt;    &lt;/SurfaceView&gt;&lt;/LinearLayout&gt;</code></pre>","269671","","82118","","2011-03-21 19:20:05","2011-03-21 19:20:05","Android - Camera Preview","<android><camera><preview>","1","0","9","",""
"2456858","1","","","2010-03-16 18:00:52","1","1149","<p>Is it possible to receive an explicit intent with the component option set?Example:</p><pre><code>Starting activity: Intent { action=android.intent.action.VIEW data=http://example.org flags=0x10000000 comp={com.android.browser/com.android.browser.BrowserActivity} }</code></pre><p>The reason why i want to this this is because i want receive this intent above, launch another browser than the default one, and drop the intent before it starts the default browser. In another words, i want to make another browser the default one.</p><p>If this is impossible, any other ideas how i can accomplish this?</p><p>Thanks!</p>","216573","","","","","2010-03-16 18:36:10","Receive explicit intent. Android","<android><android-intent><broadcastreceiver>","1","0","","",""
"2456861","1","","","2010-03-16 18:01:09","1","9023","<p>I'm new to Android.</p><p>I would like to simply know where on a page the user has scrolled. When a certain point on the web page appears at the bottom of the screen, I want to trigger an event. But this code causes an exception. I know that WebView inherits getScrollY() from View. Am I not implementing it correctly?</p><p>Thanks in advance.</p><pre><code>public class Scroll extends Activity {    public WebView webview;    public float yPos;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        WebView webview = new WebView(this);        setContentView(webview);        webview.loadUrl(""file:///android_asset/Scroll.html"");    }    public boolean onTouchEvent(final MotionEvent event) {        if (event.getAction() == MotionEvent.ACTION_MOVE) {            yPos = webview.getScrollY();            Log.v(""Scroll"", ""yPos = "" + yPos);         }        return false;    }}</code></pre>","295021","","","","","2013-11-17 06:17:34","Android: Get the scroll position of a WebView","<android><webview>","2","0","1","",""
"2457079","1","","","2010-03-16 18:33:16","2","608","<p>I can use the SensorManager and SensorEventListener to get the azimuth.  I am wondering if the built in Intent to capture an image provides the azimuth or orientation?ThanksJon</p>","229342","","","","","2010-03-16 19:40:27","android Get the azimuth of phone when picture was taken","<android>","1","0","1","",""
"2457215","1","","","2010-03-16 18:54:53","22","10400","<p>I have a preferences.xml that looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen  xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;EditTextPreference  android:name=""Sample""  android:enabled=""true""  android:persistent=""true""  android:summary=""Sample""  android:defaultValue=""3.0""  android:title=""Sample""  android:key=""sample"" /&gt;&lt;/PreferenceScreen&gt;</code></pre><p>When I do sp.getString(""sample"", ""3.0""), it works fine and returns a string, but it shouldn't be a string, it should be a float.  Running sp.getFloat(""sample"", 3.0f) throws a ClassCastException because it is a string.</p><p>What should I put in the XML so that the preference is stored as a float?</p>","281519","","","","","2010-03-17 09:26:37","How does one declare the type of an Android preference?","<android><preferences><classcastexception>","3","0","3","",""
"2457262","1","2547706","","2010-03-16 19:00:26","0","1271","<p>Long time reader never posted until now.Im having some trouble with Android, im implementing a library called JJIL its an open source imaging library.</p><p>My problem is this i need to run some analysis on an image and to doso i need to have it in jjil.core.image format and once thoseprocesses are complete i need to convert the changed image fromjjil.core.image to java.awt.image.I cant seem to find a method of doing this does anyone have any ideasor have any experience with this?</p><p>I would be grateful of any help.</p><p>Danny</p>","295050","","295050","","2010-03-22 19:25:03","2010-03-30 18:37:48","Android Image Problem and threshold","<android><image><image-processing>","2","2","","",""
"2457334","1","2457358","","2010-03-16 19:12:39","1","1436","<p>Friends,</p><p>I like to know using which version of Android SDK we can develop multi touch handling. Does Android SDK 1.6 support multi touch? If yes, can i get some sample code, where i can have multiple imagebuttons placed on screen and clicking on all the imagebuttons at a time should detect multiple touch events?</p><p>Thank you.</p>","187532","","","","","2010-03-16 19:20:20","Android:Multi touch event handling is supported in Android 1.6 SDK?","<android>","2","0","1","",""
"2457619","1","","","2010-03-16 19:53:30","0","474","<p>ok, in menu.add, you add an integer menuitem id.</p><p>But when you specify the menu in xml, @+id can't take an integer, so you can't test the id for the menu item as an integer in a switch statement.</p><p>What obvious thing am I missing, because surely an inconsistency this bone-stupid couldn't have passed muster with all those wonderful geniuses at Google.</p><p>on top of that, when I give the menu item a name like ""@+id/myMenuItem"", item.getItemId() returns an integer, a long one, which I guess is a representation of the hex pointer.</p><p>M</p>","215883","","","","","2011-03-21 14:35:28","menuitem id in xml format can't be an integer? huh. really?","<android><menu><menuitem>","3","0","","",""
"2457737","1","2458612","","2010-03-16 20:11:24","1","158","<p>I am working with the sample Home application project on <a href=""http://developer.android.com/resources/samples/Home/index.html"" rel=""nofollow"">http://developer.android.com/resources/samples/Home/index.html</a></p><p>I've added another value to the THUMBS_IDS and IMAGE_IDS Integer arrays in the Wallpaper class for a total of four wallpaper options.</p><p>When I run the application with Device API version 7, Skin: HVGA, hw.lcd.density: 160, in portrait layout, the fourth wallpaper option is not shown.</p><p>I need to use the directional keys in the emulator to see the 4th wallpaper option, because the first option is centered.</p><p>I have modified only the wallpaper.xml file with a variety of android:layout_* options with no success at this point.</p><p>How do I show all four of my wallpaper options?</p>","88757","","","","","2010-03-16 22:25:58","How do I change the number of thumbnails seen in the Android sample Home application?","<java><android><layout><sample>","1","0","","",""
"2458056","1","2458452","","2010-03-16 20:53:28","1","1705","<p>I'm trying to send messages generated by Google Protocol Buffer code via a simple HTTP scheme to a server. What I have currently have implemented is here (forgive the obvious incompletion...):</p><pre><code> HttpClient client = new DefaultHttpClient(); String url = ""http://192.168.1.69:8888/sdroidmarshal""; HttpPost postRequest = new HttpPost(url); String proto = offers.build().toString(); List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(1); nameValuePairs.add(new BasicNameValuePair(""sdroidmsg"", proto)); postRequest.setEntity(new UrlEncodedFormEntity(nameValuePairs)); try {   ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();   String responseBody = client.execute(postRequest, responseHandler); } catch (Throwable t) { }</code></pre><p>I'm not that experienced with communications over the internet and no more so with HTTP - while I do understand the basics... So my question, before I blindly develop the rest of the application around this, is whether or not this is particularly efficient? I ideally would like to keep messages small and I assume toString() adds some unnecessary formatting.</p>","235157","","","","","2010-03-16 21:56:09","Efficiently sending protocol buffer messages with http on an android platform","<android><http><protocol-buffers>","1","2","1","",""
"2458483","1","2458552","","2010-03-16 22:01:24","1","458","<p>I have a clickable TextView with a drawable as its background. I'm looking for the right way to implement a down-state drawable so the background changes when the user presses down. I have been able to almost perfectly replicate this behavior by listening for MotionEvents and changing the background when the user is pressing down.. The only thing that doesn't match up with system-wide down state behavior here is that if the user keeps holding down and moves their finger off the button, the state remains down until they release their finger from the screen... whereas in Maps overlays or Buttons or ListViews or anything else the state immediately goes back to off when the finger moves from the object.</p><p>I know there must be some proper way to go about doing this... A nudge in the right direction would be great!</p><p>Thanks,Nick</p>","29297","","","","","2012-08-10 23:56:20","Down state on clickable TextView","<android>","2","0","","",""
"2458750","1","2459161","","2010-03-16 22:56:21","1","8836","<p>How do I install the app that I'm making on an actual device?</p><p>I'm on Mac Snow Leopard with a Nexus One phone and I've followed the steps here <a href=""http://developer.android.com/intl/zh-TW/guide/developing/device.html"" rel=""nofollow"">http://developer.android.com/intl/zh-TW/guide/developing/device.html</a></p><p>So I added:<br>1. android:debuggable=""true""<br>2. Turn on ""USB Debugging"" on your device.  </p><p>However, when I go to the terminal and do ""adb devices"" only the emulator shows up there.<br>I'm supposed to see my device name too right?<br>What am I missing?</p>","166940","","488657","","2012-10-05 16:27:33","2012-10-05 17:47:17","Android - Debugging on device","<android>","4","0","1","",""
"2458833","1","","","2010-03-16 23:09:27","1","10637","<p>Im making an app, and i want it to make a sound when a activity is opened , the sound file is in <code>R.raw.sound_file</code> , if someone could do some example code to make my app play a sound that would be great.</p>","289230","","1101070","","2012-03-06 00:52:53","2014-04-13 14:11:01","How do i get a .wav sound to play?","<java><android><file><audio><.wav>","3","0","1","",""
"2458843","1","2459229","","2010-03-16 23:11:34","1","3207","<p>i need to create a object Image from import javax.microedition.lcdui.Image; using a file .png placed in drawable folder. How can i do that?</p><p>Thanks</p>","258863","","","","","2010-03-17 00:48:03","Android Load Image from Drawable","<android><image>","1","1","","",""
"2458931","1","2458966","","2010-03-16 23:29:40","4","10288","<p>I have an Android project that branched into three different applications, <code>app-1</code>, <code>app-2</code> and <code>app-3</code>, that apply some customizations. Currently there is a lot of code duplication, making maintenance a nightmare: do the changes in one of the branches, and then merge the other two.</p><p>So we create a library project, named <code>app-core</code>, that factors out most of the duplicated code. So far so good.</p><p>When I launch this into an emulator where the application was already loaded (before the refactoring), I get this exception:</p><p><code>Re-installation failed due to different application signatures</code></p><p>A different signature? But I just added a line in the <code>.classpath</code> to link to the <code>app-core</code> Java project!</p><p>The main question is: are the existing users going to be bothered by this too?</p><p>And the side question: Why is it a different signature?</p>","106342","","","","","2013-09-27 18:57:18","Why does the app signature change in Android after a classpath change?","<android><classpath><reinstall>","4","1","1","",""
"2458967","1","2630521","","2010-03-16 23:38:26","0","169","<p>Is it ok to drop PendingIntents in android if they are never used. Such as in an AppWidgetProvider where a PendingIntent that was never used be overwritten by a new PendingIntent.</p><p>Or should we call cancel on all unused PendingIntents to clean up memory appropriately?</p>","42005","","","","","2010-04-13 14:52:11","Dropping PendingIntents","<android><android-pendingintent>","1","0","","",""
"2459247","1","","","2010-03-17 00:54:32","0","285","<p>I have been looking for a solution, but the only format that I can get a response to the profile API is in HTML.  That is not very reliable for getting something like a list of the blogger's reading list.</p><p>I have been able to get the default/blogs with my auth token and have the result returned in JSON.  I then used that to get the author's blog-id .. and then .. the profile (which has the reading list).  Howver, when I request it in JSON (i.e., ?v=2/alt=json) at the end of the URI, it still returns HTML.</p><p>Is there a better way to get this done?</p>","295278","","1101070","","2012-03-06 01:38:44","2012-03-06 01:38:44","Can one get the list of following blogs from blogger api or gdata api?","<android><json><blogger>","1","1","","",""
"2459326","1","2459483","","2010-03-17 01:21:52","4","5105","<p>Is there a way I can remove the background bar image in the SeekBar android widget?</p><p>I just want it to show a slider with no progress bar behind it.</p><p><img src=""http://img121.imageshack.us/img121/3639/ss20100316212103.png"" alt=""Remove this""></p><p>Any help?</p>","118241","","","","","2013-09-26 00:33:08","Android Remove SeekBar Background","<java><android><seekbar>","5","0","1","",""
"2459448","1","2459543","","2010-03-17 01:56:17","0","903","<p>The new Android 2.1 SDK (version 7) has a new class called SignalStrength: <a href=""http://developer.android.com/reference/android/telephony/SignalStrength.html"" rel=""nofollow"">http://developer.android.com/reference/android/telephony/SignalStrength.html</a></p><p>I updated my SDK in Eclipse to include the 2.1 add-on, and now I am trying to use this new class.  However, when I go to do an import android.telephony.SignalStrength, it can't find it.  Do I have to somehow reset my project to refresh the SDK so it knows about the new libraries?  How can I get it to recognize this new class?  Thanks.</p>","234933","","","","","2010-03-17 02:31:04","How get Android 2.1 SDK to recognize new class: SignalStrength","<android><signal-strength>","1","0","","",""
"2459476","1","2459666","","2010-03-17 02:03:15","0","137","<p>I'm getting started with OpenGL ES on Android and I'd looking to learn some techniques to have a game map larger than the visible area.</p><p>I'm assuming I've somehow got to ensure that the system isn't rendering the entire scene, including what's outside of the visible area.  I'm just not sure how I'd go about designing this!</p><p>This is for simple 2D top-down tile based rendering.  No real 3D except what's inherent in OpenGL ES itself.</p><p>Would anyone be able to get me started on the right path?  Are there options that might scale nicely when I decide to start tilting my perspective and doing 3D?</p>","128991","","","","","2010-03-17 03:05:38","What are some techniques to create scrollable areas?","<java><android><opengl-es>","1","2","","",""
"2459524","1","2459624","","2010-03-17 02:19:34","48","24311","<p>In my activity, I create a <code>Bitmap</code> object and then I need to launch another <code>Activity</code>,How can I pass this <code>Bitmap</code> object from the sub-activity (the one which is going to be launched)?</p>","286802","","493939","","2012-05-12 16:08:05","2013-12-08 23:13:45","How can I pass a Bitmap object from one activity to another","<android><bitmap><parcelable>","5","0","15","",""
"2459595","1","2459599","","2010-03-17 02:39:00","0","98","<p>I called my main activity Main, and Eclipse created Main.java and res/layout/main.xml for the layout.</p><p>Is there any reason why Eclipse dropped the uppercase ""M"" for the layout file?</p><p>Was I wrong to use upper case M for the name of my Main class (a Java convention, types start with uppercase, objects with lower case)?</p>","253661","","","","","2010-03-17 03:00:57","Why the letter case inconsistency between src and res/layout?","<xml><android><layout>","2","0","","",""
"2459847","1","2461301","","2010-03-17 04:06:08","1","2155","<p>I have a class that extends android.app.Dialog, the layout is done in an xml file, and the setup (button listeners, etc) is done on the onCreate method.  My problem is that whenever the dialog is displayed, then dismissed, and displayed again, the Editable TextViews are still populated with the information that was displayed previously.  What is the common way to clear these text fields?  Remember - this is a separate class that extends Dialog - so there is no 'onDialogCreate' like Activity has.</p><p>Or, perhaps I am extending the wrong class?  There is just a lot of processing being done, and do not want to have all the code in the main Activity.  I would like it to be in a separate Class.  I tried to extend AlertDialog, but it does not create the border like Dialog does.  Any help would be great.  </p><p>The dialog is shown via the Activity:</p><pre><code>    protected Dialog onCreateDialog(int id) {        switch(id){            case DIALOG_NEW_SAFE:                return(new NewSafeDialog(this));            default:                return(null);        }    }</code></pre>","291059","","","","","2010-12-02 19:22:34","Android Class which extends Dialog, how to clear TextViews before it is displayed","<android><dialog>","3","0","1","",""
"2459848","1","2459967","","2010-03-17 04:06:16","19","25619","<p>I have an activity that contains several user editable items (an EditText field, RatingBar, etc).  I'd like to prompt the user if the back/home button is pressed and changes have been made that have not yet been saved.  After reading through the android documentation, it seems like this piece of code should go in the onPause method.  I've tried putting an AlertDialog in the onPause however the dialog gets shown and then immediately tears down because nothing is there to block the pause from completing.  </p><p>This is what I've come up with so far: </p><pre><code>@Overrideprotected void onPause() {    super.onPause();    AlertDialog ad = new AlertDialog.Builder(this).setMessage(            R.string.rating_exit_message).setTitle(            R.string.rating_exit_title).setCancelable(false)            .setPositiveButton(android.R.string.ok,                    new DialogInterface.OnClickListener() {                        public void onClick(DialogInterface dialog,                                int whichButton) {                            // User selects OK, save changes to db                        }                    }).setNeutralButton(android.R.string.cancel,                    new DialogInterface.OnClickListener() {                        public void onClick(DialogInterface dialog,                                int whichButton) {                            // User selects Cancel, discard all changes                        }                    }).show();}</code></pre><p>Am I on the right track or is there another way to accomplish what I'm trying to do here?  Any help would be great! </p>","293227","","","","","2013-03-22 10:42:47","Android: Prompt user to save changes when Back button is pressed","<java><android>","3","0","6","",""
"2459873","1","","","2010-03-17 04:15:19","7","4722","<p>is posible download Android SDK components without the Android SDK manager?in windows xp</p>","295355","","114066","","2010-03-17 10:53:39","2011-03-14 06:34:55","download Android SDK components without the Android SDK manager","<android>","1","1","3","",""
"2459916","1","3292810","","2010-03-17 04:32:52","147","70063","<p>In android, an ImageView is a rectangle by default. How can I make it a rounded rectangle (clip off all 4 corners of my Bitmap to be rounded rectangles) in the ImageView? </p>","286802","","2807573","","2013-12-18 18:39:23","2014-03-09 09:27:31","How to make an ImageView to have rounded corners","<android><layout><imageview><rounded-corners>","14","0","122","",""
"2460074","1","","","2010-03-17 05:29:35","3","9728","<p>I've created a combo box control with a edittext and spinner. I'm trying to let the android:prompt attribute be passed onto the spinner, which means I need to catch it in the constructor which passes my the AttributeSet and set it on the spinner. I can't figure out how to get the value of the prompt. I'm trying, </p><pre><code>int[] ra = { android.R.attr.prompt };TypedArray ta = context.getTheme().obtainStyledAttributes(ra); int id = ta.getResourceId(0, 0); </code></pre><p>I get back 0, which means it didn't find the attribute.I also did a ta.count() which returned 0. So I'm not getting anything back.</p><p>My XML simply defines an android:prompt value.</p><p>Thanks </p>","295392","","114066","","2010-03-17 10:48:50","2010-04-23 01:50:38","How to retrieve XML attribute for custom control","<android><custom-controls>","2","0","1","",""
"2460534","1","","","2010-03-17 07:38:16","0","1174","<p>I am trying to design an application for Android that makes use of the SlidingDrawer, but I have not been able to use the form (layout?) designer to add this element without producing an exception ""IllegalArgumentException: The handle attribute is required and must refer to a valid child.""</p><p>As of March 17th, I believe I have everything up to date (Eclipse, and the Android SDK).</p><p>All the SDK components have been installed.</p><p>I have created two Android virtual devices, One for version 1.0, and one for version 2.1 when I figured out that 1.0 didn't support the SlidingDrawer.</p><p>I have tried importing the samples provided in the SDK, as well as several other layouts from the web that I have found, all of which produce this same exception.</p><p>My programming background is mostly C++, and I consider myself to be a novice programmer, so feel free to talk to me as if I were an idiot so that I will understand.  ^^;</p>","295447","","","","","2012-03-21 08:21:19","Android SlidingDrawer in Eclipse IDE","<android><eclipse><exception><illegalargumentexception><slidingdrawer>","1","0","1","",""
"2460560","1","","","2010-03-17 07:44:49","6","1658","<p>I'm building a Sat-View that draws a small bar-chart for available satellites and their signal strength (or better: their signal-to-noise-ratio / SNR).</p><p>The <a href=""http://developer.android.com/reference/android/location/GpsSatellite.html#getSnr%28%29"">javadoc</a> doesn't say what value-range to expect for the SNR. The <a href=""http://www.gpsinformation.org/dale/nmea.htm"">NMEA</a>-Standard says 0-99, but even in best conditions my G1 doesn't reach that value. I also read that different manufacturers use different value-ranges for the SNR, so is that true for android-devices, too? Or is there a unified value range on that plattform and if so, what is it? </p><p>The lack of information in the docs leads me to suspect I just get the ""raw"" SNR from the driver, in which case I'd like to know: What do you think is the best approach to visualize that unknown value-range in a bar-chart?</p>","269462","","","","","2010-08-29 23:08:40","GpsSatellite.getSnr() - What is the value range?","<android><gps>","1","0","2","",""
"2460671","1","5485818","","2010-03-17 08:11:31","0","3776","<p>I don't see any method like setStyle for class RatingBar. How can I set the rating style from code?</p>","216431","","1101070","","2012-03-03 16:07:04","2012-03-05 16:55:55","Set ratingbar style from code","<android><coding-style><rating>","2","2","2","",""
"2460928","1","","","2010-03-17 09:11:50","6","6204","<p>I want to display an image from an url with an Webview at Android.</p><p>With Android phones with Version 1.5 and 1.6 there is no problem. but the same pic and the same code on an AndroidPhone with Version 2.0 and the pic is totaly pixelated.</p><p>Like Android is resizing the image first to a smaller one and then resizing it back to ""normal"" size.</p><p>Unfortunately its important to display the pic without any quality loss.</p><p>I tried to integrate it in the sourcefolder to show it as an normal image, but at Android 2.0 i get an exception because the image is to big. (At Android 1.6 there is no problem)</p><p>Any ideas how i can display the image without quality loss with Android 2.0 ?</p>","295505","","","","","2012-10-23 11:05:36","Android: Image displayed at Webview from Url with high quality loss","<android><image><webview>","4","1","2","",""
"2461330","1","","","2010-03-17 10:10:52","0","2240","<p>I'd like to limit the text length of EditText widget,And if user type more charactes than the limited length,I want to show a kind of warning popup, however I can't show popup.</p><p>The problem is that we can't show popup while typing,Probably, many people think a way of utilizing OnKeyListener or OnKeyDown.But, when the word is composing, nothing come into OnKeyListener or OnKeyDown,So, we can't show popup when we want to.</p><p>Is there anyone who have smart idea to solve this problem?</p>","280137","","114066","","2010-03-17 10:50:09","2010-03-17 13:49:11","how to hook key event","<android><keyboard-events>","2","1","","",""
"2461473","1","","","2010-03-17 10:34:17","-2","746","<p>I want to make piano application in Android phone, I want to record piano voice.</p><p>How I record own phone voice.</p>","883588","","1101070","","2012-03-03 16:19:12","2012-03-03 16:19:12","How to Record piano voice in Android","<java><android><record><phone><voice>","1","0","1","",""
"2461533","1","","","2010-03-17 10:42:59","0","3668","<p>Simply say, is there any example about 'OnKeyboardActionListener'?</p><p>I want to call my method, whenever user type any character on keyboard.OnKeyListener or OnKeyDown is not called when the word is composing. &lt;- it's a problem.So, I'm trying to use 'OnKeyboardActionListener' to solve the problem above.</p>","280137","","114066","","2010-03-17 10:49:27","2010-11-26 03:35:25","How to use OnKeyboardActionListener?","<android><keyboard-events>","2","1","","",""
"2461742","1","2462025","","2010-03-17 11:19:23","3","8349","<p>First of all, I am aware my issue is against the philosophy of Android, but I have no choice, this application will run on a embedded car gps and I need to bring an activity to prevent from car accident, for example, when it's happen around the user. I have to put other activity on the back and bring my alert pop up without user manipulation like notification on the front.</p><p>Is there a way to bring manually an activity to the front, by resuming it like when you click on the android task switcher?</p>","295605","","","","","2011-03-20 20:25:15","How can I bring an activity to the front from a background service","<android>","2","0","2","",""
"2461824","1","2462218","","2010-03-17 11:35:25","30","10356","<p>I would like to programmatically set <code>maxLength</code> property of <code>TextView</code> as I don't want to hard code it in the layout. I can't see any <code>set</code> method related to <code>maxLength</code>. </p><p>Can anyone guide me how to achieve this?</p>","249991","","1068167","","2012-08-23 18:33:24","2012-08-23 18:33:24","How to programmatically set maxLength in Android TextView?","<android><textview><maxlength>","1","0","5","",""
"2461949","1","2461979","","2010-03-17 11:56:32","6","7369","<p>In my application you can navigate through several Activities until the Activity stack is quite deep.</p><p>We'd like a button on every Activity that will take you straight back to the main menu - i.e. pop all Activities from the stack except the first one.</p><p>I've put the button in a View that I can easily put on every Activity in the application, but I can't figure out how to close several Activities in one fell swoop.</p><p>(If possible, it would be good if the View could work out how many Activities to close by itself - i.e. detect how deep on the stack its own Activity is.)</p>","15825","","","","","2010-12-10 13:28:46","Closing several android activities simultaneously","<android>","2","0","6","",""
"2461988","1","2463934","","2010-03-17 12:02:24","5","2567","<p>I have an ordinary project with JUnit tests that are connected to the classes in my Android Project. I want my server to run some JUnit tests in my testproject everytime I commit my code from my Android Project. </p><p>Is there a best practise to do this?So far I only managed to run the tests when they are a part of a while the JUnit tests and Android classes are separated into 2 different projects, since JUnit runs on JVM and Android in an emulator on DVM (Dalvik Virtual Machine).</p>","270273","","","","","2013-01-07 05:52:08","Automated testing in Android development","<android><junit><jvm><automated-tests><dalvik>","1","0","4","",""
"2462051","1","2463503","","2010-03-17 12:11:05","0","1116","<p>Hi    HiI'm trying to build a layout where some shapes will popup every 2seconds. If the user will click one of these shapes, they have todisappear.</p><p>What is the correct way of doing this? I thought about a thread, but imissed out.Here's my code at the moment (is not working):</p><pre><code>public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         l = new LinearLayout(this);         setContentView(l);     int counter = 1;     View v = new CustomDrawableView(this,20,50);     l.addView(v);     Thread t = new Thread() {          public void run() {                  while (true) {                        Log.i(""THREAD"",""INSIDE"");                        View h = new CustomDrawableView(c,                        (int)Math.round(Math.random()*100),                        (int)Math.round(Math.random()*100));                        SystemClock.sleep(2000);                        l.addView(h);                   }              }         };         t.start();    }</code></pre>","295525","","295525","","2010-04-20 06:05:24","2010-04-20 06:05:24","Multiple shapes on Android","<android><shapes><drawable>","1","0","1","",""
"2462097","1","2463780","","2010-03-17 12:20:31","2","1305","<p>I have the following code through which i am able to retrieve phone numbers. Somehow , i am not able to retrieve email addresses by using android.provider.Contacts.People API. Any ideas?</p><pre><code>import android.app.AlertDialog;import android.app.ExpandableListActivity;import android.content.ContentUris;import android.content.Context;import android.database.Cursor;import android.net.Uri;import android.os.Bundle;import android.provider.Contacts.People;import android.view.View;import android.widget.ExpandableListAdapter;import android.widget.SimpleCursorTreeAdapter;import android.widget.TextView;import android.widget.ExpandableListView.OnChildClickListener;public class ShowContacts extends ExpandableListActivity implements OnChildClickListener {    private int mGroupIdColumnIndex;     private String mPhoneNumberProjection[] = new String[] {             People.Phones._ID, People.NUMBER // CHANGE HERE     };     private ExpandableListAdapter mAdapter;     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         // Query for people         Cursor groupCursor = managedQuery(People.CONTENT_URI,                 new String[] {People._ID, People.NAME}, null, null, null);         // Cache the ID column index         mGroupIdColumnIndex = groupCursor.getColumnIndexOrThrow(People._ID);         // Set up our adapter         mAdapter = new MyExpandableListAdapter(groupCursor,                 this,                 android.R.layout.simple_expandable_list_item_1,                 android.R.layout.simple_expandable_list_item_1,                 new String[] {People.NAME}, // Name for group layouts                 new int[] {android.R.id.text1},                 new String[] {People.NUMBER}, // AND CHANGE HERE                 new int[] {android.R.id.text1});         setListAdapter(mAdapter);     }     public class MyExpandableListAdapter extends SimpleCursorTreeAdapter {         public MyExpandableListAdapter(Cursor cursor, Context context, int groupLayout,                 int childLayout, String[] groupFrom, int[] groupTo, String[] childrenFrom,                int[] childrenTo) {             super(context, cursor, groupLayout, groupFrom, groupTo, childLayout, childrenFrom,                     childrenTo);         }         @Override         protected Cursor getChildrenCursor(Cursor groupCursor) {             // Given the group, we return a cursor for all the children within that group             // Return a cursor that points to this contact's phone numbers             Uri.Builder builder = People.CONTENT_URI.buildUpon();            ContentUris.appendId(builder, groupCursor.getLong(mGroupIdColumnIndex));             builder.appendEncodedPath(People.Phones.CONTENT_DIRECTORY);             Uri phoneNumbersUri = builder.build();             return managedQuery(phoneNumbersUri, mPhoneNumberProjection, null, null, null);         }     }     @Override      public boolean onChildClick(android.widget.ExpandableListView parent,                View v, int groupPosition, int childPosition, long id) {           AlertDialog dialog = new AlertDialog.Builder(ShowContacts.this)                     .setMessage(((TextView) v).getText().toString())                     .setPositiveButton(""OK"", null).create();           dialog.show();           return true;      } }</code></pre>","2355649","","109702","","2010-03-17 12:28:49","2010-03-17 15:58:05","Android: How can i access email addresses in android","<android><email>","2","0","2","",""
"2462955","1","2463350","","2010-03-17 14:21:02","1","1268","<p>I have a problem with two Textviews on the same height in a RelativeLayout running into each other. </p><p>I use the following Layout. </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout        xmlns:android=""http://schemas.android.com/apk/res/android""       android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;&lt;ImageView        android:id=""@+id/logo""        android:layout_width=""wrap_content""       android:layout_height=""wrap_content""        android:adjustViewBounds=""true""       android:scaleType=""centerInside""       android:src=""@drawable/icon"" /&gt;&lt;TextView        android:id=""@+id/name""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""        android:text=""NameNameNameNameNameNameName""       android:layout_alignParentTop=""true""       android:layout_toRightOf=""@id/logo""       android:gravity=""clip_horizontal""        android:lines=""1"" /&gt;&lt;TextView       android:id=""@+id/information""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:text=""Distance""      android:layout_alignParentRight=""true""      android:layout_alignParentTop=""true"" /&gt;&lt;TextView      android:id=""@+id/nrcoupons""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:text=""Number""      android:layout_alignRight=""@id/information""      android:layout_alignBottom=""@id/logo"" /&gt;&lt;TextView      android:id=""@+id/subcategory""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""       android:text=""Subcategory""      android:layout_alignLeft=""@id/name""      android:layout_alignBottom=""@id/logo"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>This gives me this view: </p><p><img src=""http://janusz.de/~janusz/view.png"" alt=""alt text""></p><p>Everything is as I need it except the two textviews name and information are displayed on the same screen space with the one on top of the other.  </p><p>How can I avoid this? </p>","114066","","","user1370109","2012-05-15 14:33:44","2012-05-15 14:33:44","Why TextViews running into each other in RelativeLayout","<android><layout><relativelayout>","2","0","","",""
"2463175","1","2463746","","2010-03-17 14:46:48","92","57890","<p>I'm writing my first Android application and trying to get my head around communication between services and activities. I have a Service that will run in the background and do some gps and time based logging. I will have an Activity that will be used to start and stop the Service. </p><p>So first, I need to be able to figure out if the Service is running when the Activity is started. There are some other questions here about that, so I think I can figure that out (but feel free to offer advice).</p><p>My real problem: if the Activity is running and the Service is started, I need a way for the Service to send messages to the Activity. Simple Strings and integers at this point - status messages mostly. The messages will not happen regularly, so I don't think polling the service is a good way to go if there is another way. I only want this communication when the Activity has been started by the user - I don't want to start the Activity from the Service. In other words, if you start the Activity and the Service is running, you will see some status messages in the Activity UI when something interesting happens. If you don't start the Activity, you will not see these messages (they're not that interesting).</p><p>It seems like I should be able to determine if the Service is running, and if so, add the Activity as a listener. Then remove the Activity as a listener when the Activity pauses or stops. Is that actually possible? The only way I can figure out to do it is to have the Activity implement Parcelable and build an AIDL file so I can pass it through the Service's remote interface. That seems like overkill though, and I have no idea how the Activity should implement writeToParcel() / readFromParcel().</p><p>Is there an easier or better way? Thanks for any help.</p><p>EDIT: For anyone who's interested in this later on, there is sample code from Google for handling this via AIDL in the samples directory: /apis/app/RemoteService.java</p>","64193","","64193","","2010-03-19 13:54:28","2014-04-09 22:37:28","How to have Android Service communicate with Activity","<android>","7","0","79","",""
"2463271","1","2463318","","2010-03-17 14:58:19","4","417","<p>My application uses GPS updates while it is running and I would like that to stop when the user back out of the app as I assume it will continue wasting a lot of battery power. I've tried intercepting the back button press but it doesn't seem to work. I'm not sure if this is because it's not executing the code or I'm using the wrong command. Any help would be appreciated. </p><pre><code>public boolean OnKeyDown(int keyCode, KeyEvent event){    if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; event.getRepeatCount() == 0){    lm.removeUpdates(this);        return true;        }    return super.onKeyDown(keyCode, event);}</code></pre>","290666","","","","","2010-03-17 15:03:24","Stopping GPS on back button press","<android>","1","1","","",""
"2463329","1","","","2010-03-17 15:05:09","2","441","<p>Is there any way that i can access the email accounts that are savedin the default email client of android.</p><p>Basically I want to access the inbox and display their mails withoutasking for username and password.</p><p>Does AccountManager class thats available in android version 2 answermy query? and if yes then is there any alternative for v1.5 or v1.6.</p>","481405","","1101070","","2012-03-06 01:22:43","2012-03-06 01:22:43","Access email account info","<android>","1","9","","",""
"2463345","1","","","2010-03-17 15:06:39","1","4368","<p>Android: How to Add Static row in list view I have a requirement where i need to add the Static row as first row in list view</p><p>Thanks in advance for help..</p>","288156","","","","","2013-12-17 10:08:48","Android: How to Add Static row in list view","<android><listview>","4","0","1","",""
"2463420","1","2463469","","2010-03-17 15:14:37","6","135","<p>Can an attacker attach a debugger to my app after installing it to the market, or does the app have to be marked as debuggable first?  How secure is this?  Are there ways to get around it?</p>","238849","","47550","","2010-03-17 15:40:26","2010-03-17 20:58:47","Question about debugger security","<android><security><debugging>","2","0","","",""
"2463575","1","","","2010-03-17 15:31:57","-1","1647","<p>hii i have set up virtual host in apache and  and added relevent information in windows host file. it works  fine  for desktop browsers  but  i am not able to access this from android simulator's browser. as a example  a  i created a virtual host ""testweb"" i  added this information in widows hosts file also  so in desktop browser it works fine with the url <a href=""http://testweb/"" rel=""nofollow"">http://testweb/</a>  but in android simulator browser it displays  error tht page has been moved .... so plz give me solution  what i shud do to work it and where i am getting wrong...plz help me</p>","278606","","1101070","","2012-03-07 03:00:40","2012-03-07 03:00:40","Access name-based virtual host in Android","<android><android-emulator><virtualhost>","1","1","","",""
"2463687","1","2464360","","2010-03-17 15:45:53","3","2625","<p>I am using PBE encryption to encrypt and decrypt some text on an Android application but I get the BadPaddingException: with the ""pad block corrupted"" message when I use the wrong private key to decrypt the text.  My question, since I am not well versed with encryption in Java, is if this is the normal behavior of the encryption API, because I need to do some logic in the case when the wrong key is entered, but I do not know the private key, nor do I store it anywhere (storing just the encrypted and decrypted check text).</p><p>Thanks,Mihai</p>","151690","","","","","2010-03-17 17:37:51","Java Encryption issue","<java><android><encryption>","3","0","","",""
"2463705","1","2463839","","2010-03-17 15:48:07","1","481","<p>My layout contains a ListView (the parent is a LinearLayout). I have defined a certain drawable to be the ListView's background.<br>When I press an empty space below the last row, all the list rows turn black.<br>I'd like to attach screenshots but for some reason it adding images here doesn't work for me...</p><ol><li>Can someone explain how to attach screenshot? </li><li>Any idea why this happens? Couldn't catch any click event in this activity...  </li></ol><p>Thanks, Rob</p>","283630","","283630","","2010-03-17 15:54:40","2010-03-17 17:10:33","Android: Clicking an empty space in the ListView blackens existing items","<android><listview>","2","2","","",""
"2463743","1","","","2010-03-17 15:54:07","0","170","<p>Here's my use case:<br>The app starts at a login screen.  You enter your credentials and hit the ""Login"" button.  Then a progress dialog appears and you wait for some stuff to download.  Once the stuff has downloaded, you are taken to a new activity.  Exactly which activity you are taken to depends on the server response.</p><p>Here's my problem:<br>If you go HOME during this login/download process, at some point in the near future your download will complete and will invoke <code>startActivity()</code>.  <strong>So then the new activity will be pushed to the foreground, rudely interrupting the user.</strong>  I can't start the activity before I start the download, because, as I mentioned earlier, the activity I start depends on the result of the download.</p><p>I would obviously not like to interrupt the user like this.  One way to solve this is to refrain from calling  <code>startActivity()</code> until the user returns to the app.  I can do this by keeping track of the LoginActivity's <code>onStop()</code> and <code>onRestart()</code>.  <strong>But I'm wondering, is there any way to create the activity while it is in the background?</strong>  That way the user returns to the app and he is ready to go... otherwise he would have to wait for the new activity to be created (which could take some time because the <em>new</em> activity <em>also</em> has to download and display some data).</p><p><strong>Update:</strong>Guess what?  I LIED!  I could have sworn that starting this activity was causing it to come to the foreground, but I went back to test it again and the problem has magically disappeared.  I tested in both 1.6 and 2.0.1 and both OSes were smart enough not to bring a backgrounded task to the front.</p>","213525","","213525","","2010-03-18 18:00:25","2010-03-18 18:00:25","Can I create an activity for a particular task without that task coming to the foreground?","<android>","2","0","","",""
"2463777","1","","","2010-03-17 15:58:00","4","4844","<p>I am working on an app which uses tags. Accessing those should be as simple as possible. Working with an AutoCompleteTextView seems appropriate to me. What I want:</p><ul><li>existing tags should be displayed in a selectable list with a CheckBox on each item's side</li><li>existing tags should be displayed UPON FOCUS of AutoCompleteTextView (i.e. not after typing a letter)</li></ul><p>What I've done so far is storing tags in a dedicated sqlite3 table. Tags are queried resulting in a Cursor. The Cursor is passed to a SimpleCursorAdapter which looks like this:</p><pre><code>Cursor cursor = dbHelper.getAllTags();startManagingCursor(cursor);String[] columns = new String[] { TagsDB._TAG};int[] to = new int[] { R.id.tv_tags};SimpleCursorAdapter cursAdapt = new SimpleCursorAdapter(this, R.layout.tags_row, cursor, columns, to);actv.setAdapter(cursAdapt);</code></pre><p>As you can see I created <strong>tags_row.xml</strong> which looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:paddingLeft=""4dip"" android:paddingRight=""4dip""    android:orientation=""horizontal""&gt;    &lt;TextView android:id=""@+id/tv_tags"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_weight=""1""        android:textColor=""#000"" android:onClick=""actv_item_click"" /&gt;    &lt;CheckBox android:id=""@+id/cb_tags"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:onClick=""actv_item_checked"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>It looks like this:</p><p><img src=""http://img708.imageshack.us/img708/5992/devicem.png"" alt=""image""></p><p>So the results are displayed just as I'd want them to. But the TextView's onClick listener does not respond. And I don't have a clue on how to access the data once an item is (de-)selected.</p><p>Behaviour of the list should be the following:</p><ul><li>tapping a CheckBox item should insert/append the corresponding tag into the AutoCompleteTextView (tags will be semicolon-seperated)</li><li>tapping a TextView item should insert/apped the corresponding tag into the AutoCompleteTextView AND close the list.</li></ul><p>So please help me out. Thanks in advance,steff</p>","289849","","289849","","2010-04-01 19:35:41","2014-03-25 21:55:17","AutoCompleteTextView with custom list: how to set up OnItemClickListener","<xml><android><custom-controls><cursor><autocompletetextview>","1","0","4","",""
"2463928","1","4793786","","2010-03-17 16:18:10","3","122","<p>I was wondering...</p><p>So if you start a new activity via an intent, the intent has to be serialized and deserialized because you may have to send the intent to a separate VM instance via IPC.  But what if the PackageManager <em>knows</em> that your new activity will be created on the current task?  It seems like a reasonably Googly optimization would be not to serialize the intent at all, since it's all happening inside the same VM.  But then again, you can't just allow the new activity to use the same instance of each parcelable, because any changes made by the new activity would show up in the old activity and the programmer might not be expecting this.</p><p>So, is this optimization being done?  Or do the extras always get marshalled and unmarshalled, no matter what?</p>","213525","","","","","2011-01-25 12:56:07","Does an Intent's extras still get flattened into a Parcel even if the new activity is being started within the same task?","<android>","1","0","","",""
"2464056","1","2464559","","2010-03-17 16:34:02","14","49507","<p>How can I change the font size in a ListView element? In my main.xml file, I have tried several different values in for android:textSize (pt,px,sp,dp) and nothing seems to change it.</p><p>Here is what I have currently for the  in my main.xml:</p><pre><code>&lt;ListView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/list""    android:textColor=""#ffffff""    android:background=""#000080""     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     android:clickable=""true""     android:dividerHeight=""1px""    android:layout_marginTop=""5px""     android:textSize=""8px""/&gt;</code></pre><p>Here is my Java:</p><pre><code>package com.SorenWinslow.TriumphHistory;import android.app.ListActivity;import android.os.Bundle;import android.widget.ArrayAdapter;public class TriumphHistory extends ListActivity {    String[] HistoryList;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ArrayAdapter&lt;String&gt; adapter;        HistoryList = getResources().getStringArray(R.array.history);        adapter = new ArrayAdapter&lt;String&gt; (this,android.R.layout.simple_list_item_1,HistoryList);        setListAdapter(adapter);    }}</code></pre>","294703","","","","","2012-06-22 07:52:01","Change font size in ListView - Android/Eclipse","<java><android><eclipse><listview>","5","0","3","",""
"2464079","1","2701491","","2010-03-17 16:36:55","11","9666","<p>On iPhone, iPod touch and (presumably) iPad, Apple has <a href=""http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW22"" rel=""nofollow"">multi-touch event handling</a> available via JavaScript in Mobile Safari. I know the Nexus One recently added multi-touch support via an update, and I believe webOS is also multi-touch enabled. Do Android 2.1 and/or webOS have access to multi-touch in the browser, or is this currently exclusive to Apple devices?</p>","140","","","","","2012-06-18 17:01:28","Do Android/webOS devices support multi-touch Javascript events?","<javascript><iphone><android><webos><multi-touch>","6","0","5","",""
"2464313","1","","","2010-03-17 17:09:21","-1","293","<p>Can the adp2 that I just bought through the Android Market be flashed with Android 2.0?  I can't find anything anywhere.  The HTC developer support only has system images for the adp1 and adp2 phones up to 1.6.</p><p>If it can't I will be sending the phone back for a full refund.</p>","295869","","1101070","","2012-03-06 01:08:47","2012-03-06 01:08:47","Can the adp2 device be flashed with 2.0?","<android><operating-system><adp>","1","1","","",""
"2464342","1","2470800","","2010-03-17 17:15:10","1","1497","<p>Hi all i've ran into another problems with <code>VideoView</code>. Then video is playing, and i put device asleep, using hard button, <code>onPause</code> is called. But it followed by</p><blockquote>  <p>03-17 11:26:33.779: WARN/ActivityManager(884): Activity pause timeout for HistoryRecord{4359f620 com.package/com.package.VideoViewActivity}</p></blockquote><p>And then i have <code>onStart</code>/<code>onResume</code> again and Video starts playing. I've try to move code around <code>onStart</code>/<code>onStop</code> - doesn't seems to make difference.</p><p>sample code :</p><pre><code>public class VideoViewActivity extends Activity {    private String path = """";    private VideoView mVideoView;    private static final String MEDIA_URL = ""media_url"";    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.videoview);        mVideoView = (VideoView)findViewById(R.id.surface_view);        path = getIntent().getStringExtra(MEDIA_URL);    }    @Override    public void onResume() {        super.onResume();        mVideoView.setVideoPath(path);        mVideoView.setMediaController(new MediaController(this));        mVideoView.requestFocus();        mVideoView.start();    }    @Override    public void onPause() {        super.onPause();        mVideoView.stopPlayback();        mVideoView.setMediaController(null);    }}</code></pre>","176761","","12707","","2010-03-17 17:17:05","2010-03-18 15:00:59","Problems with Acitivity LifeCycle with VideoView playback","<android><video-streaming><videoview>","1","2","","",""
"2464374","1","2464446","","2010-03-17 17:21:36","0","1793","<p>I want to make some changes to the stock Mms Android application and install it on my device. However, I have problems with compiling the <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Mms.git;a=summary"" rel=""nofollow"">code checkout obtained from git</a>. I have created a new Eclipse Android project with ""use existing sources"", setting the target framework to 2.1. However, Eclipse does not find some needed framework classes, e.g. <a href=""http://developer.android.com/reference/android/telephony/SmsManager.html"" rel=""nofollow"">android.telephony.SmsManager</a>.</p><p>I have the whole Android toolchain set up and working (make finished without errors), Eclipse is running on Sun Jdk 1.5.</p><p>Perhaps my mistake was that I did not <a href=""http://source.android.com/using-eclipse"" rel=""nofollow"">copy the .classpath file</a> into the new project, I will check this. Never the less, should I succeed, will I be able to install this .apk into a non-rooted device?</p>","3205","","","","","2010-03-17 17:33:02","How can I compile Android stock Mms App into an .apk?","<android><eclipse><sms><apk>","1","0","","",""
"2464725","1","2465438","","2010-03-17 18:12:35","5","4965","<p>I created an Android project a few months ago and now have to automate the build process with Hudson. The Android dev guide mentions a build.xml file that gets created when you generate a project (http://developer.android.com/guide/developing/other-ide.html) but I dont see one in my project. Will I have to create this by hand or can I run a command to generate it?</p>","246793","","","","","2013-08-02 08:17:06","Does the ADT plugin automatically create an ant build file?","<xml><android><ant><build><adt>","3","0","2","",""
"2464736","1","","","2010-03-17 18:14:00","0","177","<p>Am currently writing an App for Android and in one of the layouts I have a users name and beside it a couple of tags.</p><p>If both the users name and the tags are short enough, they fit neatly into one line.  However, when either of the two are longer I want the name to stay fixed to the left, and the tags to drop to a line below and align to the right.</p><p>Currently I have the following code:</p><pre><code>    &lt;TextView        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:id=""@+id/name""        android:textColor=""#000000""        android:singleLine=""true""        android:textAppearance=""?android:attr/textAppearanceSmall"" /&gt;    &lt;TextView        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:singleLine=""true""        android:id=""@+id/tags""        android:textColor=""#000000""        android:layout_toRightOf=""@+id/name""        android:layout_alignTop=""@+id/name""        android:textAppearance=""?android:attr/textAppearanceSmall"" /&gt;</code></pre><p>This just simply displays both on one line.  I presume I'll need to do the text wrapping in the java or is there a neat XML solution?</p><p>Thanks for any comments.</p>","295930","","","","","2011-05-29 01:12:18","Android - Wrapping a complete line, not just words","<android><layout><wrapping>","1","0","0","",""
"2464766","1","2464817","","2010-03-17 18:19:05","0","418","<p>I have a picture in res/drawable directory: res/drawable/picture.jpeg.</p><p>Can I dynamically update this picture.jpeg from code? i.e. I want to use another picture to replace this picture in the drawable directory dynamically. </p><p>If I can, what path should I use to access the picture? Should I use ""res/drawable/picture.jpeg""?</p><p>Thanks.</p>","256239","","","","","2010-03-17 18:24:07","Can I update an image in the drawable directory from code?","<android>","1","0","","",""
"2464773","1","","","2010-03-17 18:20:07","0","221","<p>I am developing an android game right now, and it requires very precise timing and synchronization. That said, it is essential that there is no lag during the game. However I sometimes get lag spikes in the game, and I know its not the GC because I have run the ddms tool, and eliminated all the GC calls. However, I do see alot of background services popping up in my ddms logcat. Is there anyway to pause all services when my game is running?</p><p>I would appreciate any other solutions.</p><p>Thanks</p>","172082","","","","","2010-03-17 18:23:22","Stopping background services during an android activity","<java><android><mobile><background-service>","1","0","","",""
"2465180","1","","","2010-03-17 19:19:13","0","560","<p>I'm working in Android and starting the video camera activity using ACTION_VIDEO_CAPTURE. Is there any way I can limit the length (in time) of the videos the user can take?</p><p>I think this is possible if you use MediaRecorder, but I don't really fancy doing that since it's so much more complicated than using the simple ACTION_VIDEO_CAPTURE.</p><p>Current code:</p><pre><code>Intent videoCaptureIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); startActivityForResult(videoCaptureIntent,1); </code></pre><p>If it's not possible, does anyone know whether I could set a timer (TimerTask?) in Java and then show a Toast message after a certain length of time warning the user that they need to stop filming? (I'm a Java newbie, so I don't know if this is exactly what I need.)</p>","267831","","","","","2011-06-16 06:44:28","Android: videocamera, limit length of videos taken","<android>","1","0","1","",""
"2465200","1","","","2010-03-17 19:22:13","1","741","<p>Help me in resolving the below issue. </p><p>I have three image buttons on screen. All these three buttons controlled under ontouchlistner as below. </p><p>buttonOne.setOnTouchListener(this);buttonTwo.setOnTouchListener(this); buttonThree.setOnTouchListener(this); </p><p>I override ""public boolean onTouch(View v, MotionEvent event)"". Under this i check for these three image buttons touch events like below. </p><pre><code>ImageButton imageBtn = (ImageButton) v;   if ( imageBtn == buttonOne ) // first button touch                 ..Log..             else if ( imageBtn == buttonTwo )                  ..Log..   else if ( imageBtn == buttonThree ) // first button touch                 ..Log.. </code></pre><p>My problem is, as it is under multi touch event handler like above, it does not detect when touch all three button at a time to try to produce multi touch effect, instead it detects only one imagebutton touch at a time even though i touch all three image buttons. As i am developing this project on Android 1.6 SDK, is there any problem accessing my requirement(multi touch) (or) it is a known issue? I am hoping that, when it works for single button touch, why shouldn't it work when clicking three imagebuttons at a time to produce three logs printed as per my above code? </p><p>How do i resolve it for my case? </p><p>Please don't question me why i am still developing on 1.6 for such a requirement. </p><p>Thank you. Appreciate your suggestions !</p>","187532","","","","","2010-05-27 12:00:07","Android:Multi touch doesn't work as expected?","<android>","1","0","0","",""
"2465285","1","2465387","","2010-03-17 19:36:38","12","18029","<p>I have an existing project that builds fine using my IDE.  I'd like to use the ""<a href=""http://developer.android.com/intl/fr/guide/developing/other-ide.html#UpdatingAProject"">android update</a>"" command to generate an ant buildfile for this project.</p><p>The buildfile is generated fine, but the build fails because it's not building with some jarfiles I have in my libs directory.</p><p>I'd like to figure out the proper way to tell ant to build with some external jar files in my libs directory.  How should I do this?  Is it a property in build.properties?  Do I need to modify build.xml somehow?  Or is there a different solution entirely?</p>","82156","","","","","2013-08-29 10:28:34","How to build an android app with external libraries using ant?","<android><ant>","5","0","7","",""
"2465432","1","3986001","","2010-03-17 20:00:47","35","52334","<p>I have a WebView in one of my Activities, and when it loads a webpage, the page gathers some background data from Facebook.</p><p>What I'm seeing though, is the page displayed in the application is the same on each time the app is opened and refreshed.</p><p>I've tried setting the WebView not to use cache and clear the cache and history of the WebView.</p><p>I've also followed the suggestion here: <a href=""http://stackoverflow.com/questions/1790254/how-to-empty-cache-for-webview"">How to empty cache for WebView?</a></p><p>But none of this works, does anyone have any ideas of I can overcome this problem because it is a vital part of my application.</p><pre><code>    mWebView.setWebChromeClient(new WebChromeClient()    {           public void onProgressChanged(WebView view, int progress)           {               if(progress &gt;= 100)               {                   mProgressBar.setVisibility(ProgressBar.INVISIBLE);               }               else               {                   mProgressBar.setVisibility(ProgressBar.VISIBLE);               }           }    });    mWebView.setWebViewClient(new SignInFBWebViewClient(mUIHandler));    mWebView.getSettings().setJavaScriptEnabled(true);    mWebView.clearHistory();    mWebView.clearFormData();    mWebView.clearCache(true);    WebSettings webSettings = mWebView.getSettings();    webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);    Time time = new Time();    time.setToNow();    mWebView.loadUrl(mSocialProxy.getSignInURL()+""?time=""+time.format(""%Y%m%d%H%M%S""));</code></pre><p>So I implemented the first suggestion (Although changed the code to be recursive)</p><pre><code>private void clearApplicationCache(){    File dir = getCacheDir();    if(dir!= null &amp;&amp; dir.isDirectory())    {        try        {            ArrayList&lt;File&gt; stack = new ArrayList&lt;File&gt;();            // Initialise the list            File[] children = dir.listFiles();            for(File child:children)            {                stack.add(child);            }            while(stack.size() &gt; 0)            {                Log.v(TAG, LOG_START+""Clearing the stack - "" + stack.size());                File f = stack.get(stack.size() - 1);                if(f.isDirectory() == true)                {                    boolean empty = f.delete();                    if(empty == false)                    {                        File[] files = f.listFiles();                        if(files.length != 0)                        {                            for(File tmp:files)                            {                                stack.add(tmp);                            }                        }                    }                    else                    {                        stack.remove(stack.size() - 1);                    }                }                else                {                    f.delete();                    stack.remove(stack.size() - 1);                }            }        }        catch(Exception e)        {            Log.e(TAG, LOG_START+""Failed to clean the cache"");        }    }}</code></pre><p>However this still hasn't changed what the page is displaying. On my desktop browser I am getting different html code to the web page produced in the WebView so I know the WebView must be caching somewhere.</p><p>On the IRC channel I was pointed to a fix to remove caching from a URL Connection but can't see how to apply it to a WebView yet.</p><p><a href=""http://www.androidsnippets.org/snippets/45/"" rel=""nofollow"">http://www.androidsnippets.org/snippets/45/</a></p><p>If I delete my application and re-install it, I can get the webpage back up to date, i.e. a non-cached version. The main problem is the changes are made to links in the webpage, so the front end of the webpage is completely unchanged.</p>","295996","","321731","","2014-03-19 20:24:05","2014-03-19 20:24:05","Android Webview - Completely Clear the Cache","<android><caching><webview>","6","1","37","",""
"2465862","1","2466087","","2010-03-17 20:59:38","5","618","<p>I'm considering taking mobile phone software development course at my university. The course uses J2ME with an emulator. I'm interested in software development for mobile phones, but I get the impression that J2ME is somewhat stale and limited in comparison to the newer platforms like the iPhone and Android. I'm most interested in Android, as I dislike the closed nature of the iPhone. </p><p>So if I take the course, how well would the skills acquired transfer to a platform like Android? </p><p>And I have a related question. I'm pretty comfortable with Java (and various other programming languages), but I haven't used J2ME. Is there anything that makes it particularly painful to program with? (Not that Java is that pleasant anyway :))</p>","239348","","","","","2011-05-02 05:08:10","How well does knowledge of J2ME generalize to other mobile platforms?","<android><java-me><mobile><phone>","2","0","","",""
"2466437","1","2466601","","2010-03-17 22:44:15","4","3735","<p>I have a module called MyApp, and another module called MyAppTests which has a dependency on MyApp.  Both modules produce APKs, one named MyApp.apk and the other MyAppTests.apk.</p><p>I normally build these in IntelliJ or Eclipse, but I'd like to create an ant buildfile for them for the purpose of continuous integration.</p><p>I used ""android update"" to create a buildfile for MyApp, and thanks to <a href=""http://stackoverflow.com/questions/2465285/how-to-build-an-android-app-with-external-libraries-using-ant/"">commonsware's answer</a> to my previous question I've been able to build it successfully using ant.</p><p>I'd now like to build MyAppTests.apk using ant.  I constructed the buildfile as before using ""android update"", but when I run it I get an error indicating that it's not finding any of the classes in MyApp.</p><p>Taking a que from my previous question, I tried putting MyApp.apk into my MyAppTests/libs, but unfortunately that didn't miraculously solve the problem.</p><p>What's the best way to build a test app APK using ant when it depends on classes in another APK?</p><pre><code>$ ant debugBuildfile: build.xml    [setup] Project Target: Google APIs    [setup] Vendor: Google Inc.    [setup] Platform Version: 1.5    [setup] API level: 3    [setup] WARNING: No minSdkVersion value set. Application will install on all Android versions.dirs:     [echo] Creating output directories if needed...resource-src:     [echo] Generating R.java / Manifest.java from the resources...aidl:     [echo] Compiling aidl files into Java classes...compile:    [javac] Compiling 5 source files to /Users/mike/Projects/myapp/android/MyAppTests/bin/classes    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/GsonTest.java:3: cannot find symbol    [javac] symbol  : class MyApplication    [javac] location: package com.myapp    [javac] import com.myapp.MyApplication;    [javac]                ^</code></pre>","82156","","","","","2010-03-17 23:15:51","How to build an android test app with a dependency on another app using ant?","<android><unit-testing><ant>","1","0","1","",""
"2466516","1","","","2010-03-17 23:01:21","13","7750","<p>I have 2 activities, A and B. When A starts, it checks for a condition and if true, it calls <code>startActivityForResult()</code> to start B. B only takes text input so it makes sense for the soft keyboard to automatically pop up when B start. When the activity starts, the EditText already has focus and it ready for input. </p><p>The problem is that the keyboard never shows up, even with <code>windowSoftInputMode=""stateAlwaysVisible""</code> set in the manifest under the <code>&lt;activity&gt;</code> tag for B. I also tried with the value set to <code>stateVisible</code>. Since it doesn't show up automatically, I have to tap the EditText to make it show. </p><p>Anyone know what the solution might be?</p>","240251","","","","","2012-06-21 09:45:20","Show soft keyboard when Activity starts","<android><keyboard><soft-keyboard>","5","2","5","",""
"2466538","1","2466551","","2010-03-17 23:05:36","1","2202","<p>I seem to be missing something obvious here, why would I want more than one activity per application in Android?  Does somebody have some solid examples?</p>","97901","","114066","","2010-03-18 09:08:53","2011-01-19 07:36:21","An example of when to have multiple ""activities"" in an Android application","<android><layout>","3","0","1","",""
"2466562","1","","","2010-03-17 23:10:14","8","11670","<p>I have a Bitmap object and want to render it to a Canvas object with varying levels of translucency (i.e. make the whole bitmap partially see through). For example, I have sprites in a game (that are drawn over the top of a bitmap background) that I want to fade out from being opaque to being invisible. Can I do this without having to resort to OpenGL?</p>","296109","","","","","2010-07-26 08:17:10","Drawing translucent bitmaps using Canvas (Android)","<java><android>","2","0","2","",""
"2466727","1","","","2010-03-17 23:50:15","4","3884","<p>Any ideas what could be causing the message from ActivityManager, ""Activity destroy timeout for HistoryRecord"" when attempting to end an activity. This prevents the activity from restarting.</p><p>I'm stuck. Don't even have an idea where to look.</p>","295392","","1101070","","2012-03-06 01:02:10","2013-01-04 05:59:52","Cannot start activity - activity destroy timeout for historyrecord","<android>","1","4","1","",""
"2467374","1","2467428","","2010-03-18 03:20:04","14","6998","<p>I'm making pretty heavy use of JSON parsing in an app I'm writing.  Most of what I have done is already implemented using Android's built in JSONObject library (is it json-lib?).</p><p>JSONObject appears to create instances of absolutely everything in the JSON string... even if I don't end up using all of them.</p><p>My app currently runs pretty well, even on a G1.</p><p>My question is this: are the speed and memory benefits from using a stream parser like Jackson worth all the trouble?</p><p>By trouble, I mean this:  As far as I can tell, there are three downsides to using Jackson instead of the built in library:</p><ol><li>Dependency on an external library.  This makes your .apk bigger in the end.  Not a huge deal.</li><li>Your app is more fragile.  Since the parsing is not done automatically, it is more vulnerable to changes in the JSON text that it's parsing (perhaps I'm wrong about this).</li><li>Writing code to parse JSON via a stream parser is ugly and tedious.</li></ol>","238849","","59501","","2010-03-22 16:57:14","2013-09-25 17:16:42","JSON: Jackson stream parser - is it really worth it?","<android><json><jackson>","3","5","4","2012-10-12 21:31:48",""
"2467464","1","","","2010-03-18 04:02:10","2","4561","<p>I'm having some trouble with the Spinner widget. Given the following code:</p><pre><code>    ArrayList&lt;Person&gt; people= new ArrayList&lt;Person&gt;();    Person = null;    for(int i = 0; i!= 10; i++) {        p = new Person();        s.setID(i);        s.setName(""Name "" + i);        people.add(s);    }</code></pre><p>I'm using the following code to bind it to a Spinner:</p><pre><code> Spinner spinner1 = (Spinner) findViewById  (R.id.spinner);        ArrayAdapter&lt;Person&gt; adapter = new ArrayAdapter&lt;Person&gt;(this, android.R.layout.simple_spinner_item, people);                            spinner1.setAdapter(adapter);  </code></pre><p>What I would like is for the value (id) to be hidden but passed when selected, and the name to appear. Any help is appreciated.</p><p>Thanks.</p>","223411","","","","","2011-09-01 06:18:32","Android Bind Spinner to Class","<android><spinner>","2","0","4","",""
"2467495","1","","","2010-03-18 04:16:33","0","967","<p>Hi we get an event when new sms come in android but can we get any event when user send a messages, in short is there any receiver to track sending sms as we track incoming sms.</p>","193583","","6330","","2010-03-18 04:28:41","2012-02-18 05:40:46","Any receiver for sent SMS messages?","<android>","2","0","1","",""
"2467579","1","","","2010-03-18 04:46:50","12","21333","<p>I want to get the overall CPU usage on Android, similar to what Windows' Task Manager does. I can parse the output of the <code>top</code> program included in Android, but if there is a API call that  does the same thing, it would be better.</p><p>Any pointers?</p>","11238","","","","","2012-04-22 16:14:20","How to get CPU usage statistics on Android?","<android><cpu-usage><processor><performance-monitor>","2","0","7","",""
"2467972","1","2468239","","2010-03-18 06:44:46","1","1279","<p>What is the difference when a class extend from Handler and Thread?</p><p>As described in developer.android.com<br><code>...Each Handler instance is associated with a single thread and that thread's message queue. ...</code></p><p>Does the thread has no message queue ?</p><p>Any benefit for a class extend from Handler?</p>","206630","","243782","","2010-03-18 07:45:24","2010-03-18 11:36:19","What is the difference when a class extend from Handler and Thread? (In Android framework)","<android>","2","0","","",""
"2468075","1","","","2010-03-18 07:11:10","3","2945","<p>I have written an application and added 2 contacts on emulator, but iam not able to update their names on android 2.1, code is working onandroid 1.6 platform with the following code.</p><pre><code>ContentValues contactValues = new ContentValues();contactValues.put(Contacts.People.NAME, firstName+"" ""+lastName);getContentResolver().update(UpdateContactUri, contactValues, null,null);</code></pre><p>In android 1.6 i am getting Uri for those two contacts are ""content://contacts/people/1"" and ""content://contacts/people/2"".</p><p>but in 2.1 I am getting these values are ""content://contacts/people/8""and ""content://contacts/people/9"" and while updating its giving""java.IllegalArgumentException, Empty values"" exception.</p><p>When i tried to put a static Uri like ""content://contacts/people/1"",code was debugged sucessfully but contact was not updated.</p><p>How can i resolve it, why i am not getting uri like 1.6 platform ?</p><p>Thanks in advance...</p>","177571","","243782","","2010-03-18 07:44:23","2011-08-30 00:29:02","how can i get proper Uri of a particular contact in android 2.1","<android><android-emulator>","3","0","1","",""
"2468099","1","2469543","","2010-03-18 07:18:55","0","348","<p>I recently came across a forum post in the android developers group. (link below)  <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/ef3bdebcb715b385"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/ef3bdebcb715b385</a></p><p>It has one post which contains following xml. It is xml file which can be used in drawable folder. </p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;!-- Non focused states --&gt;&lt;item android:state_focused=""false"" android:state_selected=""false""android:state_pressed=""false""android:drawable=""@drawable/tab_unselected"" /&gt;&lt;item android:state_focused=""false"" android:state_selected=""true""android:state_pressed=""false""android:drawable=""@drawable/tab_selected"" /&gt;&lt;!-- Focused states --&gt;&lt;item android:state_focused=""true"" android:state_selected=""false""android:state_pressed=""false"" android:drawable=""@drawable/tab_focus""/&gt;&lt;item android:state_focused=""true"" android:state_selected=""true"" android:state_pressed=""false"" android:drawable=""@drawable/tab_focus""/&gt;&lt;!-- Pressed --&gt;&lt;item android:state_pressed=""true"" android:drawable=""@drawable/tab_press"" /&gt;&lt;/selector&gt;</code></pre><p>Now my question is, where is the documentation which tells me that i can use the following xml tags <code>&lt;selector&gt; , &lt;item&gt;, &lt;color&gt;, &lt;integer-array&gt;, &lt;string-array&gt;</code> and many others tag to create xml resources...?</p><p>I hope, i have explained what i want to know ?</p>","255721","","","","","2010-03-18 11:53:05","possible xml elements in Android resources xmls?","<xml><android><resources>","1","0","","",""
"2468100","1","2468115","","2010-03-18 07:19:04","84","124501","<p>How do I listen to click event on a ListView?</p><p>This is what I have now</p><pre><code>ListView list = (ListView)findViewById(R.id.ListView01);  ...  list.setAdapter(adapter);  </code></pre><p>When I do the following  </p><pre><code>list.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {     public void onItemSelected(AdapterView parentView, View childView,                                                          int position, long id)    {         setDetail(position);     }   public void onNothingSelected(AdapterView parentView) {     }  });  </code></pre><p>That doesn't seem to do anything on click.<br>And all those code live within a class that extends Activity.  </p>","166940","","766570","","2013-06-28 12:28:03","2014-04-05 09:52:29","Android - ListView click HOWTO?","<android><listview><click>","6","0","19","",""
"2468283","1","2469568","","2010-03-18 08:12:26","1","5396","<p>my app involves some work with the camera, therefore it needs to handle capturing of images with different resolution. My targets are 1.6 - onwards. Does anyone know what to pass in the value argument for </p><pre>Camera.Parameters.set(""picture-size"", value)</pre><p>I have look at the Donut release of the Camera app, however, it was not very clear what exactly has been used there as the value is retrieved from the SharedPreferences.</p><p><code> // Set picture size parameter.String pictureSize = mPreferences.getString(CameraSettings.KEY_PICTURE_SIZE,                                    getString(R.string.pref_camera_picturesize_default));mParameters.set(PARM_PICTURE_SIZE, pictureSize);</code></p><p>Lookin at the strings.xml I can see that <code>R.string.pref_camera_picturesize_default = 2048x1536</code>, however, I'm not sure what other values can be passed there? Is it any resolution you fancy, or are they only certain resolutions the drivers can handle? Thanks.</p>","224956","","","","","2010-03-18 11:57:31","What values does Camera.Parameters.set(""picture-size"", ?) take?","<android><camera>","1","0","","",""
"2468449","1","2468472","","2010-03-18 08:52:23","3","913","<p>i have released a version 1 on some app in the market. Can anyone tell me how to give an update of it?</p><p>thanks</p>","274107","","","","","2010-03-18 09:38:06","Process in updating my app in the market","<android><version><google-play>","3","0","0","",""
"2468524","1","2469580","","2010-03-18 09:06:37","1","205","<p>I need to post some text to a remote server over HTTP, this server in turn puts these comment on a Wordpress page. I am still waiting for interface details.</p><p>Is it possible to post comments directly on a Wordpress page from an Android or Java application?</p><p>Links to relevant documentation, tutorials etc. is appreciated.</p><p>Thanks.</p>","296339","","","","","2014-01-21 10:46:56","Post comments on a WordPress page from Android application","<android><http><wordpress>","1","0","","",""
"2468576","1","2469192","","2010-03-18 09:14:37","3","6088","<p>Most of the idea is in the title, I just would like to know if it is possible to start 2 emulators at the same time with 2 different locale (to test the I18n of my app). If there was a way of doing it in Eclipse, that would be greater...</p><p>Something like <img src=""http://i.stack.imgur.com/nU5x0.jpg"" alt=""This""></p>","263521","","1077364","","2014-01-09 13:41:32","2014-01-09 13:41:32","Start two Android emulators with different locale","<android><android-emulator><locale><emulator><qemu>","3","0","2","",""
"2468874","1","2469646","","2010-03-18 10:04:31","24","20048","<p>I am trying to create a simple Android application that has a ActivityList of information, when the application starts, I plan to start a Service that will be constantly calculating the data (it will be changing) and I want the ActivityList to be in sync with the data that the service is calculating for the life of the app.</p><p>How can I set up my Activity to be listening to the Service? Is this the best way to approach this problem?</p><p>For example, if you imagine a list of stock prices - the data would be being changed regularly and need to be in sync with the (in my case) Service that is calculating/fetching the data constantly.</p><p>Thanks in advance</p>","258813","","114066","","2012-01-27 08:52:03","2014-02-10 08:27:13","How can I update information in an Android Activity from a background Service","<java><android><android-listview><observer-pattern>","4","0","27","",""
"2468909","1","2492978","","2010-03-18 10:10:43","2","772","<p>Is there any document visualization toolkit available for android?</p>","296395","","21234","","2010-03-18 10:11:28","2012-01-21 01:06:11","Document Visualization in android?","<android><document><visualization>","2","5","2","",""
"2468995","1","","","2010-03-18 10:27:00","-1","526","<pre><code>// startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.donate_url))));startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(""http://www.google.com"")));</code></pre><p>When I use the first,app will crash in emulator but the second run well, how can I fix the first?</p>","293790","","1101070","","2012-03-06 01:10:11","2012-03-06 01:10:11","Can I parse uri from resource?","<android><uri>","1","1","","",""
"2469105","1","","","2010-03-18 10:42:57","2","7569","<p>I have setup for Android development with 1.5 SDK on Mac O.S X - Eclipse 3.5. I want to upgrade the SDK, so as i followed to choose Window->Android SDK and AVD Manager from Eclipse. But it throws error as follows:</p><blockquote>  <p>XML verification failed for  <a href=""https://dl-ssl.google.com/android/repository/repository.xml"" rel=""nofollow"">https://dl-ssl.google.com/android/repository/repository.xml</a>.  Error: cvc-elt.1: Cannot find the declaration of element 'sdk:sdk- repository'. Failed to fetch URL</p></blockquote><p>I tried ""http"" instead of https, but still getting the same error. I don't know why such crap error comes. If i see Android website,<a href=""http://developer.android.com/intl/zh-CN/sdk/index.html"" rel=""nofollow"">http://developer.android.com/intl/zh-CN/sdk/index.html</a>its confusing.</p><p>Could someone guide me easily to update Android SDK to 2.x or later without uninstalling my current setup environment.</p><p>Thanks. I appreciate your kind suggestions.</p>","187532","","187532","","2010-03-18 12:10:02","2011-11-01 05:24:09","Android:How to avoid XML verification failed error and Upgrading to 2.x SDK successfully?","<android>","3","0","","",""
"2469235","1","2510173","","2010-03-18 11:01:56","1","1076","<p>This is the code that I'm using to generate a DH keypair:</p><pre><code>KeyPairGenerator keyGen = KeyPairGenerator.getInstance(""DH"");keyGen.initialize(1024, new SecureRandom());KeyPair ackp = keyGen.generateKeyPair();</code></pre><p>(without the needed try/catch, of course).</p><p>I've done some tests running such code iteratively and varying the key size (in particular ramping up from 128 with a 128 step up to 1024. 1024 would be the desired size.</p><p>First of all, running each size generation 10 times to have some minimal std deviation on the results gives HIGH fluctuation of results, on average, anyway, the time needed for creating the keys (<strong>1024 bit</strong>) is: 683027ms, which rounds up to around <strong>11 minutes</strong> for creating a key.</p><p>The questions are: </p><ol><li>Is anyone else getting the same results? </li><li>Is there some optimization to be run in order to achieve lower times?</li><li>What is the high fluctuation dependent of? (i.e. for generating a 1024bit key it can take from 18 seconds to 30 minutes...)</li></ol><p>Tests have been run on a Nexus-One phone</p><p>Thanks in advance for shedding some light on the ""issue""</p><p>Regards</p>","274534","","","","","2010-10-26 09:32:33","DH Keypair generation time on Android","<android><time><nexus-one><diffie-hellman>","1","0","2","",""
"2469299","1","2474154","","2010-03-18 11:11:46","4","400","<p>If a user uninstalls an app from his phone, which data is explicitly deleted? </p><p>I know that preferences are deleted. What about files on the sd card and about databases created by this app?</p><p>If the data on the sd card is not deleted how can I avoid cluttering the users phone if I write larger amounts of data, like images on the sd card? </p>","114066","","","","","2010-03-19 00:38:59","Which data will be deleted, if a user uninstalls an android application","<android><persistence>","2","0","1","",""
"2469363","1","2469481","","2010-03-18 11:22:49","1","415","<p>I am currently sending and receiving SIP messages across a network.</p><p>When I want to add SDP data to a SIP message I use the SessionDescription object in jrtp.</p><p>This object is then added to the SIP message.</p><p>But when I get a SIP message from the server its SDP is in a byte[] array.</p><p>So I'm wondering is there anyway to convert the byte[] back into a SessionDescription object so I can use the SessionDescription object's methods to parse the data?</p>","243999","","","","","2010-03-18 11:42:19","Convert SDP data from byte[] into Object?","<java><android><byte><sdp>","1","0","","",""
"2469466","1","2469920","","2010-03-18 11:39:11","5","16376","<p>Hi   I'm trying to add views dynamically to a linearlayout.I see through getChildCount() that the views are added to the layout, but even calling invalidate() on the layout doesn't give me the childs showed up.</p><p>Am I missing something?</p>","295525","","82118","","2010-06-09 16:39:15","2010-12-08 23:03:01","Refreshing a LinearLayout after adding a view","<android><drawable><android-linearlayout>","2","2","3","",""
"2470072","1","2470289","","2010-03-18 13:24:18","33","28458","<p>Im trying to make a gradient that emits from the middle of the screen in white, and turns to black as it moves toward the edges of the screen.</p><p>As I make a ""normal"" gradient like this, I have been experimenting with different shapes:</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""    android:shape=""rectangle""&gt;    &lt;gradient android:startColor=""#E9E9E9"" android:endColor=""#D4D4D4""        android:angle=""270""/&gt;&lt;/shape&gt;</code></pre><p>When using the ""oval""-shape I at least got a round shape, but there were no gradient effect. How can I achieve this?</p><p>Cheers,</p>","249871","","","","","2013-01-18 05:32:16","Circular gradient in android","<android><gradient>","2","0","12","",""
"2470316","1","","","2010-03-18 13:59:12","0","288","<p>I'm completely stumped on this one. I have three different lists that need to be displayed on the screen.I've tried using a ScrollView with a LinearLayout child, and putting my ListViews in the LinearView, but all of the ListViews lock to a fixed height with scroll bars. Using other kinds of Layouts means no scrolling.</p>","296511","","","","","2010-03-18 23:06:22","i want to display this listview on scrolling","<android>","1","2","","",""
"2470357","1","2470449","","2010-03-18 14:03:28","0","705","<pre><code>03-18 19:31:55.883: VERBOSE/HttpSample_View(298): java.io.IOException: SSL handshake failure: Failure in SSL library, usually a protocol error03-18 19:31:55.883: VERBOSE/HttpSample_View(298): error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:585 0xaf586674:0x00000000)</code></pre><p>why i got it?</p>","267269","","","","","2010-03-18 14:14:57","got IOException in android?","<java><android><exception><ioexception>","1","0","1","",""
"2470520","1","2470679","","2010-03-18 14:24:54","0","1027","<p>I have an application App1 which defines class A and uses instances of this class. What I want to achieve is - after App1 is installed on the device to be able to load App2 which defines and implements class B which is subclass of class A (imported from App1 package); and be able to get an instance of class B in the App1. Class B doesn't add any new interfaces, so using it as class A is ok. But I am not sure how to pass the instance of class B to App1 (preferrably without any user interaction).</p><p>Can anyone advise if this is feasible?</p>","291688","","","","","2010-12-08 06:50:53","Passing class instances between applications in Android","<java><android><class><ipc>","1","0","","",""
"2470703","1","2586996","","2010-03-18 14:49:33","0","945","<p>How does one tell it where to put the AVD?  by default it is creating it in my windows home directory under a .android folder.</p><p>i cannot start my avd if its located over a \unc path\to\avd.</p><p>our sys admins put all of your home directories on another shared server.</p><p>Thanks in advance,</p><p>Kirby</p>","104993","","","","","2010-04-06 17:40:43","AVD is located over UNC path and cannot start","<android><eclipse-plugin><android-emulator><avd>","1","1","1","",""
"2470870","1","3772987","","2010-03-18 15:10:41","25","34231","<p>For an unknown reason, I can't get my application leaving properly so that when I push the home button and the app icon again, I resume where I was in the app. <em>I would like to force the application to restart on the first Activity.</em></p><p>I suppose this has something to do with onDestroy() or maybe onPause() but I don't know what to do.</p>","263521","","321731","","2014-03-19 17:59:55","2014-03-19 17:59:55","Force application to restart on first activity","<android>","6","0","24","",""
"2470902","1","","","2010-03-18 15:13:17","0","747","<p>I am trying to send rtp audio data from my Android application.</p><p>I currently can send 1 RTP packet with the code below and I also have another class that extends Thread that listens to and receives RTP packets.</p><p>My question is how do I continuously send my updated buffer through the packet payload without blocking the receiving thread?</p><pre><code>public void run() {        isRecording = true;      android.os.Process.setThreadPriority      (android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);      int buffersize = AudioRecord.getMinBufferSize(8000,              AudioFormat.CHANNEL_CONFIGURATION_MONO,               AudioFormat.ENCODING_PCM_16BIT);              Log.d(""BUFFERSIZE"",""Buffer size = "" + buffersize);              arec = new AudioRecord(MediaRecorder.AudioSource.MIC,                          8000,                          AudioFormat.CHANNEL_CONFIGURATION_MONO,                          AudioFormat.ENCODING_PCM_16BIT,                          buffersize);    short[] readBuffer = new short[80];    byte[] buffer = new byte[160];    arec.startRecording();    while(arec.getRecordingState() == AudioRecord.RECORDSTATE_RECORDING){     int frames = arec.read(readBuffer, 0, 80);     @SuppressWarnings(""unused"")     int lenghtInBytes = codec.encode(readBuffer, 0, buffer, frames);      RtpPacket rtpPacket = new RtpPacket();    rtpPacket.setV(2);    rtpPacket.setX(0);      rtpPacket.setM(0);      rtpPacket.setPT(0);      rtpPacket.setSSRC(123342345);      rtpPacket.setPayload(buffer, 160);            try {                rtpSession2.sendRtpPacket(rtpPacket);            } catch (UnknownHostException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (RtpException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }      }    }</code></pre><p>So when I send on one device and receive on another I get decent audio, but when I send and receive on both I get broken sound like its taking turns to send and receive audio.</p><p>I have a feeling it could be to do with the while loop? it could be looping around in there and not letting anything else run?</p>","243999","","243999","","2010-03-19 14:25:15","2012-09-21 10:06:22","how to continuously send data without blocking?","<java><android><data><send><rtp>","0","3","","",""
"2470948","1","2471033","","2010-03-18 15:19:07","1","3665","<p>I have a button that launches the google maps app on my device via an intent. I want to be able to pass it a php page that generates a KML file.</p><p>I have done this on a website before using the googlemaps api in JS - but it doesn't seem to work on Android.</p><p>My php file is as follows;</p><pre><code>&lt;?php     echo '&lt;kml xmlns=""http://www.google.com/earth/kml/2""&gt;';     echo '&lt;Placemark&gt;';     echo '&lt;name&gt;Google Inc.&lt;/name&gt;';     echo '&lt;description&gt;1600 Amphitheatre Parkway, Mountain View, CA 94043&lt;/description&gt;';     echo '&lt;Point&gt;';     echo '&lt;coordinates&gt;-122.0841430, 37.4219720, 0&lt;/coordinates&gt;';     echo '&lt;/Point&gt;';     echo '&lt;/Placemark&gt;';     echo '&lt;/kml&gt;';?&gt;  </code></pre><p>Launching with:</p><pre><code>final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(""geo:0,0?q=http://website.com/kml_gen.php""));startActivity(myIntent);</code></pre><p>It launches maps, finds the file - but won't display it 'because it contains errors'.</p><p>Is this just not possible, or are there other ways to construct the intent that might work?</p>","286424","","1466188","","2012-06-27 15:06:24","2012-06-27 15:06:24","getting maps to accept a dynamically generated KML file?","<php><android><android-intent><kml><google-maps>","1","1","2","",""
"2471344","1","2473562","","2010-03-18 16:03:04","2","604","<p>There are tons of pay and free bluetooth toggles on the market that work with Android 1.5 (SDK level 3).  The problem is there is no visible API for this!</p><p>Does anyone have any working code snippits on how to enable and disable bluetooth that works on Android 1.5?  I assume you must have to use some kind of reflection for it.  There are some examples over on anddev.org, but they only work with Android 1.1 or lower.</p><p>This is for Android 1.5 (SDK level 3) and not Android 2.0 or greater.  In Android 2.0 or later Google added easy to use APIs.</p>","242904","","14343","","2010-07-14 12:35:09","2010-07-14 12:35:09","Turn Bluetooth On and Off in Android 1.5 (SDK level 3)?","<android>","1","0","","",""
"2471403","1","2471679","","2010-03-18 16:08:30","1","352","<p>Does switching activities in Android start a fresh JVM?  It seems like each activity is meant to run as its own ""main"" method.  If I have a singleton (via Guice, not an actual singleton in this case) should I expect to be re-creating it every time I switch activities?</p>","97901","","","","","2010-03-18 16:40:28","Does switching activities in Android start a fresh JVM","<android>","1","0","","",""
"2471417","1","","","2010-03-18 16:09:59","98","61190","<p>I would like to make a free version of the Android app I have, but would like to embed ad on it. I am not sure where I should start? Is there a well known mobile ad company out there that is specialized in mobile advertising? </p>","294180","","142879","","2012-05-27 20:32:45","2014-02-16 18:16:53","Embedding ads on Android app?","<android><mobile-phones><advertising><mobile-application><mopub>","10","3","69","",""
"2471429","1","","","2010-03-18 16:11:34","0","563","<p>How can I write a Broadcast Receiver that will be invoked when user clicks on any application icon?</p><p>I tried by writing:</p><pre><code>&lt;receiver android:name = ""myreceiver""&gt;     &lt;intent-filter&gt;         &lt;action android:name = ""android.intent.action.MAIN""&gt;     &lt;/intent-filter&gt; &lt;/receiver&gt; </code></pre><p>But it is not called. </p><p>I tried, by using <code>Packagemanager</code> I will get <code>ApplicationInfo</code>. From that I can know all the application starting activity name and package names. I thought I can use them to registerReceiverand my receiver will listen by its launching activity and package name. But I strucked. I am unable to do that. I think I lost the way.</p><p>What can I do to solve this problem?</p>","296687","","63550","","2010-03-18 17:04:48","2010-03-18 17:04:48","How can I write a Broadcast Receiver that will be invoked when user clicks on any application icon?","<android>","1","0","","",""
"2471875","1","2472179","","2010-03-18 17:09:41","12","12571","<p>I <a href=""http://stackoverflow.com/questions/2082998/how-to-implement-a-button-on-an-android-widget"">saw this topic</a> and implement IntentService as describes, but what if I want more that one button? How can I distinguish button from each other?I'm trying to setFlags, but cannot read it at onHandleIntent() method:</p><pre><code>public static class UpdateService extends IntentService {...    @Override    public void onHandleIntent(Intent intent) {        ComponentName me = new ComponentName(this, ExampleProvider.class);        AppWidgetManager manager = AppWidgetManager.getInstance(this);        manager.updateAppWidget(me, buildUpdate(this));    }    private RemoteViews buildUpdate(Context context) {        RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.main_layout);        Intent i = new Intent(this, ExampleProvider.class);        PendingIntent pi = PendingIntent.getBroadcast(context, 0, i, 0);        updateViews.setOnClickPendingIntent(R.id.button_refresh, pi);        i = new Intent(this, ExampleProvider.class);         pi = PendingIntent.getBroadcast(context, 0, i, 0);        updateViews.setOnClickPendingIntent(R.id.button_about, pi);        return updateViews;    }}</code></pre><p>At this little piece of code I have two PendingIntent linked with setOnClickPendingIntent, can I distinguish this intent for different actions and processing?Thanks for help</p>","186529","","","","","2012-03-31 07:15:37","Processing more than one button click at Android Widget","<android><widget>","1","1","16","",""
"2471935","1","16293557","","2010-03-18 17:18:06","145","169513","<p>How do you use an image referenced by URL in an <code>ImageView</code>?</p>","267269","","815724","","2013-01-28 16:49:40","2014-04-17 08:55:15","How to load an ImageView by URL in Android?","<android><bitmap><imageview>","22","1","80","",""
"2472016","1","","","2010-03-18 17:27:46","0","3775","<p>Greetings everyone!I'm getting rather fed up with android's ConnectivityManager class. I've been trying for 5 hours to get the requestRouteToHost to work. I'm running my code on the emulator but the requestRouteToHost always fails. I know I have connectivity because I called getActiveNetworkInfo() and it was connected. I've added the ACCESS_NETWORK_STATE and CHANGE_NETWORK_STATE permissions to no avail. Any tips would be greatly appreciated.</p><p>EDIT--------The method InetAddress.isReachable fails as well. I was using the hostname java.sun.com as specified in the docs. I think this is a problem with the emulator.Sam</p>","151166","","151166","","2010-03-18 21:26:06","2012-04-10 17:34:18","requestRouteToHost android","<java><android><networking>","3","4","","",""
"2472059","1","2822665","","2010-03-18 17:32:35","25","25457","<p>I have a module that builds an app called MyApp.  I have another that builds some testcases for that app, called MyAppTests.  They both build their own APKs, and they both work fine from within my IDE.  I'd like to build them using ant so that I can take advantage of continuous integration.</p><p>Building the app module works fine.  I'm having difficulty getting the Test module to compile and run.</p><p>Using Christopher's tip from a <a href=""http://stackoverflow.com/questions/2466437/how-to-build-an-android-test-app-with-a-dependency-on-another-app-using-ant"">previous question</a>, I used <code>android create test-project -p MyAppTests -m ../MyApp -n MyAppTests</code> to create the necessary build files to build and run my test project.  This seems to work great (once I remove an unnecessary test case that it constructed for me and revert my AndroidManifest.xml to the one I was using before it got replaced by <code>android create</code>), but I have two problems.</p><p>The first problem: The project doesn't compile because it's missing libraries.</p><pre><code>$ ant run-testsBuildfile: build.xml    [setup] Project Target: Google APIs    [setup] Vendor: Google Inc.    [setup] Platform Version: 1.6    [setup] API level: 4    [setup] WARNING: No minSdkVersion value set. Application will install on all Android versions.-install-tested-project:    [setup] Project Target: Google APIs    [setup] Vendor: Google Inc.    [setup] Platform Version: 1.6    [setup] API level: 4    [setup] WARNING: No minSdkVersion value set. Application will install on all Android versions.-compile-tested-if-test:-dirs:     [echo] Creating output directories if needed...-resource-src:     [echo] Generating R.java / Manifest.java from the resources...-aidl:     [echo] Compiling aidl files into Java classes...compile:    [javac] Compiling 1 source file to /Users/mike/Projects/myapp/android/MyApp/bin/classes-dex:     [echo] Converting compiled files and external libraries into /Users/mike/Projects/myapp/android/MyApp/bin/classes.dex...     [echo]          -package-resources:     [echo] Packaging resources [aaptexec] Creating full resource package...-package-debug-sign:[apkbuilder] Creating MyApp-debug-unaligned.apk and signing it with a debug key...[apkbuilder] Using keystore: /Users/mike/.android/debug.keystoredebug:     [echo] Running zip align on final apk...     [echo] Debug Package: /Users/mike/Projects/myapp/android/MyApp/bin/MyApp-debug.apkinstall:     [echo] Installing /Users/mike/Projects/myapp/android/MyApp/bin/MyApp-debug.apk onto default emulator or device...     [exec] 1567 KB/s (288354 bytes in 0.179s)     [exec]     pkg: /data/local/tmp/MyApp-debug.apk     [exec] Success-compile-tested-if-test:-dirs:     [echo] Creating output directories if needed...    [mkdir] Created dir: /Users/mike/Projects/myapp/android/MyAppTests/gen    [mkdir] Created dir: /Users/mike/Projects/myapp/android/MyAppTests/bin    [mkdir] Created dir: /Users/mike/Projects/myapp/android/MyAppTests/bin/classes-resource-src:     [echo] Generating R.java / Manifest.java from the resources...-aidl:     [echo] Compiling aidl files into Java classes...compile:    [javac] Compiling 5 source files to /Users/mike/Projects/myapp/android/MyAppTests/bin/classes    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/GsonTest.java:4: package roboguice.test does not exist    [javac] import roboguice.test.RoboUnitTestCase;    [javac]                      ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/GsonTest.java:8: package com.google.gson does not exist    [javac] import com.google.gson.JsonElement;    [javac]                       ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/GsonTest.java:9: package com.google.gson does not exist    [javac] import com.google.gson.JsonParser;    [javac]                       ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/GsonTest.java:11: cannot find symbol    [javac] symbol: class RoboUnitTestCase    [javac] public class GsonTest extends RoboUnitTestCase&lt;MyApplication&gt; {    [javac]                               ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/HttpTest.java:6: package roboguice.test does not exist    [javac] import roboguice.test.RoboUnitTestCase;    [javac]                      ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/HttpTest.java:7: package roboguice.util does not exist    [javac] import roboguice.util.RoboLooperThread;    [javac]                      ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/HttpTest.java:11: package com.google.gson does not exist    [javac] import com.google.gson.JsonObject;    [javac]                       ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/HttpTest.java:15: cannot find symbol    [javac] symbol: class RoboUnitTestCase    [javac] public class HttpTest extends RoboUnitTestCase&lt;MyApplication&gt; {    [javac]                               ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/LinksTest.java:4: package roboguice.test does not exist    [javac] import roboguice.test.RoboUnitTestCase;    [javac]                      ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/LinksTest.java:12: cannot find symbol    [javac] symbol: class RoboUnitTestCase    [javac] public class LinksTest extends RoboUnitTestCase&lt;MyApplication&gt; {    [javac]                                ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java:4: package roboguice.test does not exist    [javac] import roboguice.test.RoboUnitTestCase;    [javac]                      ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java:5: package roboguice.util does not exist    [javac] import roboguice.util.RoboAsyncTask;    [javac]                      ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java:6: package roboguice.util does not exist    [javac] import roboguice.util.RoboLooperThread;    [javac]                      ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java:12: cannot find symbol    [javac] symbol: class RoboUnitTestCase    [javac] public class SafeAsyncTest extends RoboUnitTestCase&lt;MyApplication&gt; {    [javac]                                    ^    [javac] /Users/mike/Projects/myapp/android/MyApp/bin/classes/com/myapp/activity/Stories.class: warning: Cannot find annotation method 'value()' in type 'roboguice.inject.InjectResource': class file for roboguice.inject.InjectResource not found    [javac] /Users/mike/Projects/myapp/android/MyApp/bin/classes/com/myapp/activity/Stories.class: warning: Cannot find annotation method 'value()' in type 'roboguice.inject.InjectResource'    [javac] /Users/mike/Projects/myapp/android/MyApp/bin/classes/com/myapp/activity/Stories.class: warning: Cannot find annotation method 'value()' in type 'roboguice.inject.InjectView': class file for roboguice.inject.InjectView not found    [javac] /Users/mike/Projects/myapp/android/MyApp/bin/classes/com/myapp/activity/Stories.class: warning: Cannot find annotation method 'value()' in type 'roboguice.inject.InjectView'    [javac] /Users/mike/Projects/myapp/android/MyApp/bin/classes/com/myapp/activity/Stories.class: warning: Cannot find annotation method 'value()' in type 'roboguice.inject.InjectView'    [javac] /Users/mike/Projects/myapp/android/MyApp/bin/classes/com/myapp/activity/Stories.class: warning: Cannot find annotation method 'value()' in type 'roboguice.inject.InjectView'    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/GsonTest.java:15: cannot find symbol    [javac] symbol  : class JsonParser    [javac] location: class com.myapp.test.GsonTest    [javac]         final JsonParser parser = new JsonParser();    [javac]               ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/GsonTest.java:15: cannot find symbol    [javac] symbol  : class JsonParser    [javac] location: class com.myapp.test.GsonTest    [javac]         final JsonParser parser = new JsonParser();    [javac]                                       ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/GsonTest.java:18: cannot find symbol    [javac] symbol  : class JsonElement    [javac] location: class com.myapp.test.GsonTest    [javac]         final JsonElement e = parser.parse(s);    [javac]               ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/GsonTest.java:20: cannot find symbol    [javac] symbol  : class JsonElement    [javac] location: class com.myapp.test.GsonTest    [javac]         final JsonElement e2 = parser.parse(s2);    [javac]               ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/HttpTest.java:19: cannot find symbol    [javac] symbol  : method getInstrumentation()    [javac] location: class com.myapp.test.HttpTest    [javac]         assertEquals(""MyApp"", getInstrumentation().getTargetContext().getResources().getString(com.myapp.R.string.app_name));    [javac]                              ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/HttpTest.java:62: cannot find symbol    [javac] symbol  : class RoboLooperThread    [javac] location: class com.myapp.test.HttpTest    [javac]         new RoboLooperThread() {    [javac]             ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/HttpTest.java:82: cannot find symbol    [javac] symbol  : method assertTrue(java.lang.String,boolean)    [javac] location: class com.myapp.test.HttpTest    [javac]         assertTrue(result[0], result[0].contains(""Search""));    [javac]         ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/HttpTest.java:87: cannot find symbol    [javac] symbol  : class JsonObject    [javac] location: class com.myapp.test.HttpTest    [javac]         final JsonObject[] result = {null};    [javac]               ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/HttpTest.java:90: cannot find symbol    [javac] symbol  : class RoboLooperThread    [javac] location: class com.myapp.test.HttpTest    [javac]         new RoboLooperThread() {    [javac]             ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/HttpTest.java:117: cannot find symbol    [javac] symbol  : class JsonObject    [javac] location: class com.myapp.test.HttpTest    [javac]         final JsonObject[] result = {null};    [javac]               ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/HttpTest.java:120: cannot find symbol    [javac] symbol  : class RoboLooperThread    [javac] location: class com.myapp.test.HttpTest    [javac]         new RoboLooperThread() {    [javac]             ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/LinksTest.java:27: cannot find symbol    [javac] symbol  : method assertTrue(boolean)    [javac] location: class com.myapp.test.LinksTest    [javac]             assertTrue(m.matches());    [javac]             ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/LinksTest.java:28: cannot find symbol    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String)    [javac] location: class com.myapp.test.LinksTest    [javac]             assertEquals( map.get(url), m.group(1) );    [javac]             ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java:19: cannot find symbol    [javac] symbol  : method getInstrumentation()    [javac] location: class com.myapp.test.SafeAsyncTest    [javac]         assertEquals(""MyApp"", getInstrumentation().getTargetContext().getString(com.myapp.R.string.app_name));    [javac]                              ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java:27: cannot find symbol    [javac] symbol  : class RoboLooperThread    [javac] location: class com.myapp.test.SafeAsyncTest    [javac]         new RoboLooperThread() {    [javac]             ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java:65: cannot find symbol    [javac] symbol  : method assertEquals(com.myapp.test.SafeAsyncTest.State,com.myapp.test.SafeAsyncTest.State)    [javac] location: class com.myapp.test.SafeAsyncTest    [javac]         assertEquals(State.TEST_SUCCESS,state[0]);    [javac]         ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java:74: cannot find symbol    [javac] symbol  : class RoboLooperThread    [javac] location: class com.myapp.test.SafeAsyncTest    [javac]         new RoboLooperThread() {    [javac]             ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java:105: cannot find symbol    [javac] symbol  : method assertEquals(com.myapp.test.SafeAsyncTest.State,com.myapp.test.SafeAsyncTest.State)    [javac] location: class com.myapp.test.SafeAsyncTest    [javac]         assertEquals(State.TEST_SUCCESS,state[0]);    [javac]         ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java:113: cannot find symbol    [javac] symbol  : class RoboLooperThread    [javac] location: class com.myapp.test.SafeAsyncTest    [javac]         new RoboLooperThread() {    [javac]             ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java:144: cannot find symbol    [javac] symbol  : method assertEquals(com.myapp.test.SafeAsyncTest.State,com.myapp.test.SafeAsyncTest.State)    [javac] location: class com.myapp.test.SafeAsyncTest    [javac]         assertEquals(State.TEST_SUCCESS,state[0]);    [javac]         ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java:154: cannot find symbol    [javac] symbol  : class RoboLooperThread    [javac] location: class com.myapp.test.SafeAsyncTest    [javac]         new RoboLooperThread() {    [javac]             ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java:187: cannot find symbol    [javac] symbol  : method assertEquals(com.myapp.test.SafeAsyncTest.State,com.myapp.test.SafeAsyncTest.State)    [javac] location: class com.myapp.test.SafeAsyncTest    [javac]         assertEquals(State.TEST_SUCCESS,state[0]);    [javac]         ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/StoriesTest.java:11: cannot access roboguice.activity.GuiceListActivity    [javac] class file for roboguice.activity.GuiceListActivity not found    [javac] public class StoriesTest extends ActivityUnitTestCase&lt;Stories&gt; {    [javac]                                                      ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/StoriesTest.java:21: cannot access roboguice.application.GuiceApplication    [javac] class file for roboguice.application.GuiceApplication not found    [javac]         setApplication( new MyApplication( getInstrumentation().getTargetContext() ) );    [javac]                         ^    [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/StoriesTest.java:22: incompatible types    [javac] found   : com.myapp.activity.Stories    [javac] required: android.app.Activity    [javac]         final Activity activity = startActivity(intent, null, null);    [javac]                                                ^    [javac] 39 errors    [javac] 6 warningsBUILD FAILED/opt/local/android-sdk-mac/platforms/android-1.6/templates/android_rules.xml:248: Compile failed; see the compiler error output for details.Total time: 24 seconds</code></pre><p>That's not a hard problem to solve.  I'm not sure it's the right thing to do, but I copied the missing libraries (roboguice and gson) from the MyApp/libs directory to the MyAppTests/libs directory and everything seems to compile fine.</p><p>But that leads to the second problem, which I'm currently stuck on.  The tests compile fine but they won't run:</p><pre><code>$ cp ../MyApp/libs/gson-r538.jar libs/$ cp ../MyApp/libs/roboguice-1.1-SNAPSHOT.jar libs/0 10:23 /Users/mike/Projects/myapp/android/MyAppTests $ ant run-testsBuildfile: build.xml    [setup] Project Target: Google APIs    [setup] Vendor: Google Inc.    [setup] Platform Version: 1.6    [setup] API level: 4    [setup] WARNING: No minSdkVersion value set. Application will install on all Android versions.-install-tested-project:    [setup] Project Target: Google APIs    [setup] Vendor: Google Inc.    [setup] Platform Version: 1.6    [setup] API level: 4    [setup] WARNING: No minSdkVersion value set. Application will install on all Android versions.-compile-tested-if-test:-dirs:     [echo] Creating output directories if needed...-resource-src:     [echo] Generating R.java / Manifest.java from the resources...-aidl:     [echo] Compiling aidl files into Java classes...compile:    [javac] Compiling 1 source file to /Users/mike/Projects/myapp/android/MyApp/bin/classes-dex:     [echo] Converting compiled files and external libraries into /Users/mike/Projects/myapp/android/MyApp/bin/classes.dex...     [echo]          -package-resources:     [echo] Packaging resources [aaptexec] Creating full resource package...-package-debug-sign:[apkbuilder] Creating MyApp-debug-unaligned.apk and signing it with a debug key...[apkbuilder] Using keystore: /Users/mike/.android/debug.keystoredebug:     [echo] Running zip align on final apk...     [echo] Debug Package: /Users/mike/Projects/myapp/android/MyApp/bin/MyApp-debug.apkinstall:     [echo] Installing /Users/mike/Projects/myapp/android/MyApp/bin/MyApp-debug.apk onto default emulator or device...     [exec] 1396 KB/s (288354 bytes in 0.201s)     [exec]     pkg: /data/local/tmp/MyApp-debug.apk     [exec] Success-compile-tested-if-test:-dirs:     [echo] Creating output directories if needed...-resource-src:     [echo] Generating R.java / Manifest.java from the resources...-aidl:     [echo] Compiling aidl files into Java classes...compile:    [javac] Compiling 5 source files to /Users/mike/Projects/myapp/android/MyAppTests/bin/classes    [javac] Note: /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/SafeAsyncTest.java uses unchecked or unsafe operations.    [javac] Note: Recompile with -Xlint:unchecked for details.-dex:     [echo] Converting compiled files and external libraries into /Users/mike/Projects/myapp/android/MyAppTests/bin/classes.dex...     [echo]          -package-resources:     [echo] Packaging resources [aaptexec] Creating full resource package...-package-debug-sign:[apkbuilder] Creating MyAppTests-debug-unaligned.apk and signing it with a debug key...[apkbuilder] Using keystore: /Users/mike/.android/debug.keystoredebug:     [echo] Running zip align on final apk...     [echo] Debug Package: /Users/mike/Projects/myapp/android/MyAppTests/bin/MyAppTests-debug.apkinstall:     [echo] Installing /Users/mike/Projects/myapp/android/MyAppTests/bin/MyAppTests-debug.apk onto default emulator or device...     [exec] 1227 KB/s (94595 bytes in 0.075s)     [exec]     pkg: /data/local/tmp/MyAppTests-debug.apk     [exec] Successrun-tests:     [echo] Running tests ...     [exec]      [exec] android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests:INSTRUMENTATION_RESULT: shortMsg=Class ref in pre-verified class resolved to unexpected implementation     [exec] INSTRUMENTATION_RESULT: longMsg=java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation     [exec] INSTRUMENTATION_CODE: 0BUILD SUCCESSFULTotal time: 38 seconds</code></pre><p>Any idea what's causing the ""Class ref in pre-verified class resolved to unexpected implementation"" error?</p>","82156","","82156","","2010-05-12 20:43:54","2013-04-01 09:49:30","Can't build and run an android test project created using ""ant create test-project"" when tested project has jars in libs directory","<android><unit-testing><ant>","8","0","14","",""
"2472289","1","","","2010-03-18 18:09:14","5","2404","<p>I've done changes in an Android native library and installed a new system.img file but am now getting an unrelated Error on startup. I can get past it by swallowing the error but I wanted to know if anyone can explain what the issue is.</p><p><a href=""http://www.google.com/codesearch/p?hl=en#atE6BTe41-M/libcore/logging/src/main/java/java/util/logging/Logger.java&amp;q=android%20Logger.java&amp;sa=N&amp;cd=3&amp;ct=rc&amp;l=452"" rel=""nofollow"">The Android implementation of Logger.java claims</a> that it is Forcing the LogManager to be initialized since its class init code performs necessary one-time setup. But this forced initialization results in a NoClassDefFoundError. I'm thinking that it has something to do with the class not having been preloaded by Zygote yet but am not that familiar with the whole class loaders and VM business.</p><p>If anyone has some insight it would be greatly appreciated. Thanks.</p><pre><code>I/Zygote  ( 1253): Preloading classes...D/skia    ( 1253): ------ build_power_table 1.4D/skia    ( 1253): ------ build_power_table 0.714286W/dalvikvm( 1253): Exception Ljava/lang/StackOverflowError; thrown during Ljava/util/logging/LogManager;.&lt;clinit&gt;W/dalvikvm( 1253): Exception Ljava/lang/NoClassDefFoundError; thrown during Ljava/security/Security;.&lt;clinit&gt;W/dalvikvm( 1253): Exception Ljava/lang/ExceptionInInitializerError; thrown during Landroid/net/http/HttpsConnection;.&lt;clinit&gt;E/Zygote  ( 1253): Error preloading android.net.http.HttpsConnection.E/Zygote  ( 1253): java.lang.ExceptionInInitializerErrorE/Zygote  ( 1253): at java.lang.Class.classForName(Native Method)E/Zygote  ( 1253): at java.lang.Class.forName(Class.java:237)E/Zygote  ( 1253): at java.lang.Class.forName(Class.java:183)E/Zygote  ( 1253): at com.android.internal.os.ZygoteInit.preloadClasses(ZygoteInit.java:295)E/Zygote  ( 1253): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)E/Zygote  ( 1253): at dalvik.system.NativeStart.main(Native Method)E/Zygote  ( 1253): Caused by: java.lang.ExceptionInInitializerErrorE/Zygote  ( 1253): at javax.net.ssl.KeyManagerFactory$1.run(KeyManagerFactory.java:57)E/Zygote  ( 1253): at javax.net.ssl.KeyManagerFactory$1.run(KeyManagerFactory.java:56)E/Zygote  ( 1253): at java.security.AccessController.doPrivilegedImpl(AccessController.java:264)E/Zygote  ( 1253): at java.security.AccessController.doPrivileged(AccessController.java:84)E/Zygote  ( 1253): at javax.net.ssl.KeyManagerFactory.getDefaultAlgorithm(KeyManagerFactory.java:55)E/Zygote  ( 1253): at org.apache.harmony.xnet.provider.jsse.SSLParameters.(SSLParameters.java:142)E/Zygote  ( 1253): at org.apache.harmony.xnet.provider.jsse.SSLContextImpl.engineInit(SSLContextImpl.java:82)E/Zygote  ( 1253): at android.net.http.HttpsConnection.initializeEngine(HttpsConnection.java:101)E/Zygote  ( 1253): at android.net.http.HttpsConnection.(HttpsConnection.java:65)E/Zygote  ( 1253): ... 6 moreE/Zygote  ( 1253): Caused by: java.lang.NoClassDefFoundError: java.util.logging.LogManagerE/Zygote  ( 1253): at java.util.logging.Logger.initHandler(Logger.java:419)E/Zygote  ( 1253): at java.util.logging.Logger.log(Logger.java:1094)E/Zygote  ( 1253): at java.util.logging.Logger.warning(Logger.java:906)E/Zygote  ( 1253): at org.apache.harmony.luni.util.MsgHelp.loadBundle(MsgHelp.java:61)E/Zygote  ( 1253): at org.apache.harmony.luni.util.Msg.getString(Msg.java:60)E/Zygote  ( 1253): at java.io.BufferedInputStream.read(BufferedInputStream.java:316)E/Zygote  ( 1253): at java.io.FilterInputStream.read(FilterInputStream.java:138)E/Zygote  ( 1253): at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:157)E/Zygote  ( 1253): at java.io.BufferedInputStream.read(BufferedInputStream.java:243)E/Zygote  ( 1253): at java.util.Properties.load(Properties.java:302)E/Zygote  ( 1253): at java.security.Security$1.run(Security.java:80)E/Zygote  ( 1253): at java.security.Security$1.run(Security.java:67)E/Zygote  ( 1253): at java.security.AccessController.doPrivilegedImpl(AccessController.java:264)E/Zygote  ( 1253): at java.security.AccessController.doPrivileged(AccessController.java:84)E/Zygote  ( 1253): at java.security.Security.(Security.java:66)E/Zygote  ( 1253): ... 15 moreW/dalvikvm( 1253): threadid=3: thread exiting with uncaught exception (group=0x2aac6170)</code></pre>","205941","","665800","","2011-08-15 16:43:29","2011-08-15 16:43:29","Class initialization issues loading java.util.logging.LogManager in Android Dalvik VM","<java><android><jvm><noclassdeffounderror><dalvik>","3","1","1","",""
"2472402","1","2477716","","2010-03-18 18:30:09","1","1891","<p>I am creating an application which tracks the users location using GPS, stores the longitude and latitude in a database using a content provider then output the first long and lat to a mapview. </p><p>I am able to create the cursor using this line of code: </p><pre><code>Cursor c = getContentResolver().query(GPSContentProvider.CONTENT_URI,                                                      null, null, null, null);startManagingCursor(c);</code></pre><p>However, when I make a call to move to the first row in the database or even try to close the cursor using <code>c.close();</code> I receive a <code>NullPointerException</code>. </p><p>Edit: Just to make it clear, I can store the longitude, latitude and time in milli's within the database, the problem is then taking the data out of the database and displyaing this on a map.</p><h3>Updated code:</h3><pre><code>public static final String AUTHORITY = ""application.android.prototype"";// followed by the CONTENT_URIpublic static final Uri CONTENT_URI = Uri.                    parse(""content://"" + AUTHORITY + ""/gpspoints"");</code></pre><h3>Updated permissions:</h3><pre><code>&lt;provider android:name=""GPSDataContentProvider"" android:authorities=""application.android.prototype""&gt;&lt;/provider&gt;</code></pre>","296810","","166712","","2010-03-19 02:48:06","2010-03-19 13:41:30","Receiving a NullPointerException when calling a cursor in Android","<java><sql><android><cursor><android-contentprovider>","1","7","0","",""
"2472415","1","","","2010-03-18 18:33:49","2","418","<p>I know from reading this:</p><p><a href=""http://stackoverflow.com/questions/1230457/is-there-a-size-limit-for-ota-android-market-downloads/1232145#1232145"">http://stackoverflow.com/questions/1230457/is-there-a-size-limit-for-ota-android-market-downloads/1232145#1232145</a></p><p>That there wasn't a limit to the size of an application that could be downloaded over the air (OTA) but I wonder if a limit, like that imposed by the Apple App Store (20MB) exists now that the Nexus one is running on AT&amp;T's 3G network as of today.</p><p>Thanks in advance for your help/</p><p>Truk</p>","296815","","31161","","2011-08-05 11:15:00","2011-08-05 11:15:00","Is there a limit to the size of an application in the Android Marketplace?","<android><nexus-one>","3","0","","",""
"2472582","1","","","2010-03-18 18:58:32","2","7760","<p>I am trying to make an Android application which would try to recover deleted content from the SD Card. How feasible is it? I have the following methods in mind: </p><ol><li>Since, the files are not actually deleted, can I access the file system to see files which has been marked to be overwritten. </li><li>Or will I have to do header/footer file carving? Is it possible from the application layer of android? </li></ol><p>I am concerned about files stored on contiguous sectors and not the fragmented ones. I want to do a basic file retrieval. </p><p>Please let me know some resources which I can use to make this application?  </p>","","user296840","26853","","2010-03-18 19:17:09","2014-03-12 03:59:43","Recovering the deleted data from Android SD Card?","<android><data><recovery>","3","1","","",""
"2472617","1","2473747","","2010-03-18 19:05:23","9","5766","<p>I want to use XMPP to push data to my client which would translate to a notification for the user, and plan on using their google-id for login to my application.  The way I understand XMPP is that its a simple message that goes directly to the adress, but I want the client to get it as instructions and turn it into gamestate information.  </p><p>It would be very frustrating for a user to get a bunch of command tuples or hex garbage in their google chat!  Am I misunderstanding the way this all works?</p>","279159","","","","","2010-04-27 23:23:51","Using XMPP for push user notifications on Android - any way to target these so they don't go to Google Talk etc","<android><google-app-engine><xmpp>","2","2","6","",""
"2473174","1","2473337","","2010-03-18 20:34:53","0","132","<p>I'm currently trying to get a grip on Android development and working my way through Notepad example part 2 when this warning popped up and I can't fix it.</p><pre><code>[2010-03-18 21:26:47 - androidTest] ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined[2010-03-18 21:26:47 - androidTest] ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined</code></pre><p>What should I do? I'm using Eclipse with the Android ADT plugins and developing for my Hero-emulator, running Android 1.5.</p>","197657","","","","","2010-03-18 21:04:09","Android development","<android><android-emulator>","1","0","","",""
"2473213","1","","","2010-03-18 20:41:05","-1","188","<p>I am trying to follow the instructions on this page ""<a href=""http://developer.android.com/guide/developing/device.html"" rel=""nofollow"">Developing on a device</a>"". After I finished all the steps, and executes command ""adb devices"", my Droid is not listed. Is there anything else that I need to do if my device is Droid? It seems there are discussions on this issue but I could not find any definitive answer.</p>","296904","","1101070","","2012-03-06 01:28:30","2012-03-06 01:28:30","Setting up Droid for development","<android>","1","0","","",""
"2473492","1","","","2010-03-18 21:35:11","0","900","<p>I'd like to use different row descriptors (from the XML layout resource) in one ListView. Can I and how?</p><p>Also, I'd like to be able to programmatically change the size of the rows, based on  the data in each row, in a ListView. Can I and how?</p><p>Thank you in advance--I LOVE stackoverflow. </p><p>M</p>","215883","","","","","2010-03-18 21:56:29","ListView and dynamic row sizes","<android><listview><layout><activity><resources>","1","0","","",""
"2473527","1","2473903","","2010-03-18 21:43:53","0","615","<p>i have an ImageView in which the picture switches every 5s, i am trying to add a pause and </p><p>resume button that can stop and restart the action.  i am using a Handler, Runnable, and </p><p>postDelay() for image switch, and i put the code on onResume.  i am thinking about using </p><p>wait and notify for the pause and resume, but that would mean creating an extra thread.  so </p><p>far for the thread, i have this:</p><p>class RecipeDisplayThread extends Thread     {        boolean pleaseWait = false;</p><pre><code>    // This method is called when the thread runs    public void run() {        while (true) {            // Do work            // Check if should wait            synchronized (this) {                while (pleaseWait) {                    try {                        wait();                    } catch (Exception e) {                    }                }            }            // Do work        }    }}   </code></pre><p>and in the main activity's onCreate():</p><pre><code>        Button pauseButton = (Button) findViewById(R.id.pause);        pauseButton.setOnClickListener(new View.OnClickListener()         {            public void onClick(View view)             {                while (true) {                synchronized (thread)                 {                    thread.pleaseWait = true;                    }                }            }        });        Button resumeButton = (Button) findViewById(R.id.resume);        resumeButton.setOnClickListener(new View.OnClickListener()         {            public void onClick(View view)             {                while (true) {                // Resume the thread                synchronized (thread)                 {                    thread.pleaseWait = false;                    thread.notify();                }                }            }        });</code></pre><p>the pause button seems to work, but then after that i can't press any other button, such as </p><p>the resume button.</p><p>thanks.</p>","270811","","21234","","2010-03-18 22:02:19","2010-03-20 00:41:00","how to pause and stop a changing ImageView","<android>","2","1","","",""
"2473553","1","","","2010-03-18 21:47:43","14","33537","<p>I'm new to Android and Eclipse.I'm Trying to run the SDK Samples on the Emulator in Eclipse 3.5</p><p>Most of the time the AVD Manager hangs when I try to create a new AVD.When I manage to create an AVD and try to start the emulator I get this:</p><p><strong>emulator: ERROR: no search paths found in this AVD's configuration</strong> </p><p><strong>weird, the AVD's config.ini file is malformed. Try re-creating it.</strong></p><p>I'm running the latest version of the SDK on Win7 32 bit. Any Ideas?</p><p><strong>Update:</strong></p><p>Hi Everyone.</p><p>Thanks so much for all your attention and for trying to help. I think I found the source of the problem. I'm running a Hebrew version of WIN 7. My user name is in Hebrew. Apparently this causes a problem for Eclipse. Once I started to suspect that was the problem, I created a new user on the system called DEV and tried to run the emulator under that user... Went like butter.</p><p>So that's it. thanks you guys. By now...</p>","296937","","54680","","2010-03-24 20:09:23","2013-08-14 09:34:18","Trouble getting Android emulator to run in eclipse","<android><eclipse><emulator>","17","2","3","",""
"2473751","1","2474170","","2010-03-18 22:22:34","1","2971","<p>I currently able to create a Medium size TextAppearanceSpan, But how can I set the text color to a specified RBG color (say #c71585)? </p><pre><code>new TextAppearanceSpan(context, android.R.style.TextAppearance_Medium);</code></pre><p>I see there is a constructor for</p><pre><code>public TextAppearanceSpan(Context context, int appearance,                          int colorList) {</code></pre><p>But what is the int for colorList? Is there any example for this?</p><p>Thank you.</p>","286802","","","","","2010-06-30 20:37:04","How can I set the TextColor of a TextAppearanceSpan?","<android>","3","0","","",""
"2473999","1","","","2010-03-18 23:17:08","0","202","<p>Can you please tell me how can I set the RBG value of android.R.styleable.Theme_textColorDimfor my android application?</p><p>Thank you.</p><p>I have added this styles.xml file in my project:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;resources&gt;&lt;style name=""ApplicationStyle"" parent=""android:Theme""&gt;  &lt;item name=""android:textColorDim""&gt;#00ff00&lt;/item&gt;&lt;/style&gt;&lt;/resources&gt;</code></pre><p>But when I compile it, I get this error:</p><blockquote>  <p>res/values/styles.xml:19: error:  Error: No resource found that matches  the given name: attr  'android:textColorDim'.</p></blockquote><p>So how can I set the textColorDim?</p>","286802","","286802","","2010-03-19 08:30:08","2010-03-19 08:30:08","Set the RBG value of android.R.styleable.Theme_textColorDim","<android>","1","0","","",""
"2474012","1","2474136","","2010-03-18 23:19:34","7","5087","<p>Is there anyway to wrap a TextView around an image?It's the typical thing that people do in CSS like this <a href=""http://www.echoecho.com/htmlimages08.htm"">http://www.echoecho.com/htmlimages08.htm</a></p><p>Thanks,<br>Tee</p>","166940","","","","","2013-06-19 11:43:42","Android - UI for text wrap an image","<android>","3","1","5","",""
"2474143","1","2693503","","2010-03-18 23:53:17","28","15016","<p>I'm working with a Droid / Android 2.0.1 and encountering an issue apparently many people have: I'm unable to discover services using the one pure-Java zeroconf library I know of, jmDNS. (Apple's Bonjour, while it works on Linux and Windows Java, I believe would be harder to port to Android because of reliance on native code.)</p><p>I can create services, but not discover them. I'm trying to make sense of what's going on. </p><p>There is an ongoing issue report here; related to multicast and IPv6, but seems to be throwing users of jmDNS, too:<a href=""http://code.google.com/p/android/issues/detail?id=2323"">http://code.google.com/p/android/issues/detail?id=2323</a></p><p>Any idea why this person might be having success? See comment 22 in the bug report. (I'm new to SO, so can't post more than one URL.)</p><p>I have tested their code, but without any luck.</p><p>Has anyone successfully accomplished zeroconf service discovery on Android, using jmDNS or another library?</p><p>Is it possible my discovery issue is related to the IPv6 multicast problem?</p>","297001","","102703","","2010-03-19 01:30:00","2014-02-28 15:50:19","How can I discover zeroconf (Bonjour) services on Android? I'm having trouble with jmDNS","<android><bonjour><zeroconf>","5","5","28","",""
"2474367","1","2474383","","2010-03-19 00:58:10","6","1943","<p>In Android 2.2 (Level 7) the function PowerManager.IsScreenOn() returns a boolean that is true if the screen is turned on and false if the screen is turned off. I am developing code for Android 1.5 (Level 3). How do I accomplish the same task in older versions of Android? I do not want to turn the screen on or off in my code. I just want to know what it is.</p>","297020","","","","","2013-06-27 16:42:58","How can I tell if the screen is on in android?","<android>","3","0","","",""
"2474475","1","2474524","","2010-03-19 01:37:22","4","6683","<p>I created a native Android app that basically hosts a webView control.  That webView is then used to load a page that calls window.openDatabase from JavaScript.  I can successfully confirm that the API exists by verifying window.openDatabase.</p><p>Calling this method returns a null when called in a hosted webView control.  Calling the same method in the Android Browser returns an instance of the database.</p><p>Does anyone know the permessions in the manifest or settings on the webView control that need to be set to access the database?  Is this even possible in a native app.</p>","2723","","","","","2011-07-29 13:47:16","How do I call window.openDatabase from a webView hosted in an android application?","<javascript><android>","2","0","4","",""
"2474584","1","2477151","","2010-03-19 02:12:48","2","8272","<p>I have an <code>AsyncTask</code> that acts as a countdown timer for my game.  When it completes the countdown it displays the out of time end screen and it also updates the timer displayed on the screen.  Everything works fine, except I need to be able to pause and resume this when the pause button in the game is pressed.</p><p>If I cancel it and try to re-execute it, it crashes with an <code>IllegalStateException</code>.If I cancel it and instantiate a new AsyncTask in its place the old one begins to run again and the new one runs at the same time.</p><p>Is there a way to cancel/pause the timer and restart it using <code>AsyncTask</code>s or is there a different way I should be going about doing this?</p><p>EDIT:</p><p>This is what I did for a solution:</p><p><code>mhandler = new Handler();</code></p><pre><code>        mtimerTask = new Runnable(){                public void run(){                    mtimer -= 1;                    if(mtimer == 0)                    {                        mhandler.removeCallbacks(this);                    }                    mhandler.postDelayed(this, 1000);                }        };        mhandler.removeCallbacks(mtimerTask);        mhandler.post(_timerTask)`</code></pre><p>Not sure if it's the best way to go about it, but it worked for me.</p>","288072","","288072","","2011-08-26 05:01:41","2013-09-08 18:38:33","Pause and Resume AsyncTasks? (Android)","<java><android>","3","0","1","",""
"2474612","1","","","2010-03-19 02:24:17","0","2471","<p>I want to use following code to get a widget id, but getAppWidgetIds always return an empty array, the num is always 0, what wrong?</p><p>Thanks!</p><pre><code>public class test extends Activity implements  OnTouchListener {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);         .....        AppWidgetManager mAppWidgetManager;     AppWidgetHost mAppWidgetHost;         mAppWidgetManager = AppWidgetManager.getInstance(this.getApplicationContext());        ComponentName THIS_APPWIDGET =new ComponentName(""com.android.music"", ""com.android.music.MediaAppWidgetProvider"");               int[] appWidgetId=mAppWidgetManager.getAppWidgetIds(THIS_APPWIDGET);        int num=appWidgetId.length;</code></pre>","266884","","266884","","2010-03-19 05:04:40","2011-02-15 02:22:23","android getAppWidgetIds failed, what wrong?","<android>","1","1","","",""
"2474622","1","2475117","","2010-03-19 02:28:41","14","2123","<p>I know this may be a dumb question, but my background is more in c++ and managing my own memory.</p><p>I am currently cutting down every single allocation that I can from one of my games to try and reduce the frequency of garbage collection and perceived ""lag"", so for every variable that I create that is an Object (String and Rect for example) I am making sure that I create it before hand in my constructor and not create temporary variables in simple 10line functions... (I hope that makes sense)</p><p>Anyways I was working though it some more tonight and I realized that I may be completely wrong about my assumption on garbage collection and primitive types (int, boolean, float) are these primitive type variables that I create in a 10 line function that gets called 20times a second adding to my problem of garbage collection?</p><p>So a year ago every few seconds I would see a message in logcat like</p><blockquote>  <p>GC freed 4010 objects / 484064 bytes in  101ms</p></blockquote><p>Now I see that message every 15-90 seconds or so...</p><p>So to rephrase my question: Are primitive types (int, float, boolean, etc) included when seeing this message?</p>","3494","","","","","2011-06-20 18:41:52","Are primitive types garbage collected in Android?","<android><garbage-collection><dalvik>","3","0","1","",""
"2474709","1","2474830","","2010-03-19 02:51:39","1","1162","<p>I created a project, probably as an Android project without thinking.  I then did a lot of work bringing in source, etc. but it is not an Android target.  However, when I start up Eclipse, it keeps popping-up a dialog reminding me that I have not established the Adroid device settings.  How can I make it stop -- without restarting the workspace?</p>","157804","","","","","2011-04-28 08:59:50","Eclipse thinks my project is an Android project - can I remove without starting over?","<android><eclipse><project-settings>","2","0","","",""
"2474904","1","2474936","","2010-03-19 03:56:48","4","1677","<p>I'm building a jar so that other developers can use the view I create in their Android applications. I'm wondering if it is possible to use a layout resource in my jar so I can build the layout of my view or if I need to build up my view programmatically. Similarly, can I include image resources in my jar file? </p>","211292","","","","","2012-10-11 06:53:55","It is possible to include layout and other resources in an Android jar?","<java><android><jar>","2","0","","",""
"2474967","1","","","2010-03-19 04:23:49","0","885","<p>please suggest me a way to handle widget long press event &amp; its movement in user defined home screen .i.e i have activity whose background handles the long click and then we can choose the approprait widget from the list ,but the problem is that i am not able to implement the long click on widget and its movement in my activity.for code reference see the link below</p><p><a href=""http://www.google.com/support/forum/p/Android+Market/thread?tid=25992cd433e6b826&amp;hl=en"" rel=""nofollow"">http://www.google.com/support/forum/p/Android+Market/thread?tid=25992cd433e6b826&amp;hl=en</a>thanks </p>","297082","","","","","2010-03-19 04:23:49","android : widget long press & movement handling in user activity","<android><android-widget>","0","2","","",""
"2475016","1","","","2010-03-19 04:39:11","0","3817","<p>i am developing an application which uses sqlite db for storing records. I am developing this application on SDK 1.5.. when i test the application on 1.5 device it works good but when i try to run it on a 1.6 device i get a force close message with following logcat output:</p><p>03-19 09:31:35.206: ERROR/AndroidRuntime(224): Uncaught handler: thread main exiting due to uncaught exception</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.abc.android/com.abc.android.app}: android.database.sqlite.SQLiteException: unable to open database file</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2454)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.os.Handler.dispatchMessage(Handler.java:99)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.os.Looper.loop(Looper.java:123)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.app.ActivityThread.main(ActivityThread.java:4310)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at java.lang.reflect.Method.invokeNative(Native Method)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at java.lang.reflect.Method.invoke(Method.java:521)03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at dalvik.system.NativeStart.main(Native Method)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224): Caused by: android.database.sqlite.SQLiteException: unable to open database file</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1697)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:738)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:760)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:753)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:473)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at <strong>com.abc.android.DbAdapter.open(DbAdapter.java:101)</strong></p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at <strong>com.abc.android.class1.onCreate(class1.java:105)</strong></p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)</p><p>03-19 09:31:35.226: ERROR/AndroidRuntime(224):     ... 11 more</p><p><strong>DBAdapter.java</strong></p><pre><code>public DbAdapter open() throws SQLException {        Log.d(""DbAdapter"", ""in DbAdapter open()"");        mDbHelper = new DatabaseHelper(mCtx);        mDb = mDbHelper.getWritableDatabase();        // line 101        return this;    } DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION);  } @Override public void onCreate(SQLiteDatabase db) {    db.execSQL(DATABASE_QUERY); }              </code></pre><p><strong>class1.java</strong></p><pre><code>mDB = new DbAdapter(Class1.this);mDB.open();             // line 105</code></pre><p>Please help..what do i do????</p>","152867","","301832","","2010-07-21 09:56:39","2011-10-26 07:07:29","Problem with sqlite database on android platform","<android><sqlite>","1","3","","",""
"2475494","1","2475956","","2010-03-19 06:56:41","12","3466","<p>The default floating point type in Java is the double.  If you hard code a constant like <code>2.5</code> into your program, Java makes it a double automatically.  When you do an operation on floats or ints that could potentially benefit from more precision, the type is 'promoted' to a double.</p><p>But in the Android API, everything seems to be a float from sound volumes to rectangle coordinates.  There's a structure called <code>RectF</code> used in most drawing;  the F is for float.  It's really a pain for programmers who are casting promoted doubles back to <code>(float)</code> pretty often.  Don't we all agree that Java code is messy and verbose enough as it is?</p><p>Usually math coprocessors and accelerators prefer double in Java because it corresponds to one of the internal types.  Is there something about Android's Dalvik VM that prefers floats for some reason?  Or are all the floats just a result of perversion in API design?</p>","8959","","","","","2010-03-19 17:26:37","Why are there so many floats in the Android API?","<android><floating-point><dalvik>","5","0","4","",""
"2475615","1","2476584","","2010-03-19 07:28:37","3","2493","<p>I want to make an activity that allows orientation changes on some condition, but not otherwise. More exactly I want to prevent restarting the activity when a background thread is busy.</p><p>I have put the <code>configChanges</code> attribute on the activity manifest, and <code>onConfigurationChanged</code> is called when the orientation changes. However I want to allow the app to change the orientation <strong>when allowed</strong>.</p><pre><code>@Overridepublic void onConfigurationChanged(Configuration newConfig) {    super.onConfigurationChanged(newConfig);    if (orientationChangeAllowed) {        // how do I restart this activity?    } else {        // don't do anything    }}</code></pre>","11238","","11238","","2010-03-19 07:37:27","2010-03-19 10:49:44","Conditional restart on Activity onConfigurationChanged","<android><activity><restart><onconfigurationchanged>","1","0","","",""
"2475754","1","2475896","","2010-03-19 08:02:41","1","779","<p>I want to create a search box with the search button directly to the right of the <code>EditText</code> without any spacing, like how like the address bar on the internal browser application looks (see image below).  Is this possible or do I need to create it myself?</p><p><img src=""http://img220.imageshack.us/img220/7338/gp2.png"" alt=""Screenshot of the Android browser search bar""></p>","11238","","623518","","2012-05-01 08:26:26","2012-05-01 08:26:26","Create a split control like the one in the Browser's address bar","<android><search><address-bar>","2","0","1","",""
"2475756","1","2475817","","2010-03-19 08:02:44","8","14962","<p>I've followed this tutorial: <a href=""http://anandhansubbiah.com/blog/writing-your-first-android-application/"">http://anandhansubbiah.com/blog/writing-your-first-android-application/</a>, but no matter what I do, and what I change, when I run the app, all I see is the image below. Is there something I must press to start developing? Did I add starting code. I'm completely stumped...</p><p><img src=""http://img196.imageshack.us/img196/1700/stuckl.jpg"" alt=""Screen I see""></p>","146366","","","","","2014-03-12 17:15:35","Stuck on emulator screen in Eclipse with Android Development?","<java><android><eclipse>","4","0","1","",""
"2475768","1","","","2010-03-19 08:05:55","0","1833","<p>The adapter in my code as follows, I extends the base adapter:</p><pre><code>@Override public View getView(final int position, View convertView, ViewGroup parent) {  ViewHolder vHolder;  // if (convertView == null) {  vHolder = new ViewHolder();  convertView = mInflater.inflate(R.layout.home_item, null);  vHolder.albumIcon = (ImageView) convertView    .findViewById(R.id.albumIcon);    try {   Bitmap icon = aws.getAlbumImg(itemInfolist.get(position)     .getAlbumInfoCol().get(0).getAlbumID(), 0);   if (icon != null) {    vHolder.albumIcon.setImageBitmap(icon);   } else {    vHolder.albumIcon.setImageBitmap(BitmapFactory.decodeResource(      context.getResources(), R.drawable.album));   }  } catch (Exception e) {   vHolder.albumIcon.setImageBitmap(BitmapFactory.decodeResource(     context.getResources(), R.drawable.album));  }      convertView.setTag(vHolder);  return convertView; }</code></pre><p>However, I download the imagine asynchronously, </p><p>When invoke<strong>Bitmap icon = aws.getAlbumImg(itemInfolist.get(position).getAlbumInfoCol().get(0).getAlbumID(), 0);</strong></p><p>Some pictures which haven't downloaded will use the default image, after these picutures have downloaded in another Web Service Bean, I want the Web Service bean sends a message to invoke the getView method in this adapter in order to implement the auto refresh function.</p><p>But if I change the Web Service Download Bean as follows,it will cause the exception</p><p><strong>03-19 07:46:33.241: ERROR/AndroidRuntime(716): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</strong></p><pre><code>HomeAdapter mHomeAdapter; public AlbumWS(HomeAdapter homeAdapter) {  mHomeAdapter = homeAdapter; }And after download,public boolean getAlbumImgWS(final ArrayList&lt;Integer&gt; albumIDs) {  new Thread(new Runnable() {   @Override   public void run() {    // TODO Auto-generated method stub    AlbumInfoWS aiws = new AlbumInfoWS();    for (int i = 0; i &lt; albumIDs.size(); ++i) {     if (ABSCENTALBUMIMGS.contains(albumIDs.get(i))) {      continue;     }     if (FunctionUtil.isExist(albumIDs.get(i))) {      continue;     }     String urlPath = aiws.getAlbumImage(""en_US"",       Config.IMG_ATTIBUTETYPE, albumIDs.get(i));     boolean ret = FunctionUtil.simpleDownload(Config.HOST       + urlPath, ""/data/data/com.greysh.amped/img/""       + albumIDs.get(i) + "".jpg"");     if (!ret) {      if (!ABSCENTALBUMIMGS.contains(albumIDs.get(i))) {       ABSCENTALBUMIMGS.add(albumIDs.get(i));      }     }     mHomeAdapter.notifyDataSetChanged();    }   }  }).start();  return true; }</code></pre>","297145","","243782","","2010-03-19 08:36:08","2010-03-19 10:44:02","How to invoke the getView method in the baseAdapter in Android from another WebService Bean?","<java><android><adapter>","1","0","","",""
"2475978","1","2476171","","2010-03-19 08:51:12","27","30300","<p>In android, are using static variables a recommended practice?E.g, implementing a Singleton pattern in Java, I usually do:</p><pre><code>private static A the_instance;public static A getInstance() {    if (the_instance == null) {       the_instance = new A();    }    return the_instance;}</code></pre><p>Also, when does this get cleaned up by the Android JVM?</p><p>Thank you.</p>","286802","","26853","","2010-03-19 17:38:09","2010-09-03 20:00:28","Using static variables in Android","<java><android><dalvik>","4","0","14","",""
"2476005","1","2477166","","2010-03-19 08:58:16","6","9978","<p>I'm working on establishing a two-way communication between an Activity and a Service which runs in a different process.</p><p>Querying the process from the Activity is no big deal. But I want the process to notify the Activity on events. The idea behind it is this: the service runs independently from the actual app. It queries a webserver periodically. If a new task is found on the webserver the process should notify the activity.</p><p>I found <a href=""http://www.anddev.org/viewtopic.php?p=18781"">this thread</a> over at AndDev.org but it doesn't seem to work for me. I've been messing around with BroadcastReceiver. I've implemented an interface which should notify the Activity but the problem is that the listener is always null since the Broadcast from the process is done via Intent, hence the class that extends BroadcastReceiver will be newly instantiated.</p><p>How can I establish a 2-way communication? This has to be possible.Thanks for any help,</p><p>steff</p>","289849","","","","","2010-03-19 12:25:44","How to establish a two-way communication between Activity and Service in different process?","<android><process><service><activity><android-intent>","3","1","7","",""
"2476347","1","2476485","","2010-03-19 10:06:30","6","3057","<p>i working on map view. i want to put overlay item  on the map view.  that overlay items are all depends on currently showing map view and zoom level. how to get current map view's longitude and latitude of that four corner and how to analyze how many overlay item inside it. also we have to check thee zoom level.Any Idea? how to do it?</p>","267269","","","","","2013-02-07 22:30:56","how to get the long & lat value of four corners in the mapview in android?","<android><google-maps><android-mapview><overlayitem>","3","0","8","",""
"2476424","1","2593017","","2010-03-19 10:20:57","2","505","<p>I'm having some trouble getting a hold of the drawable a certain OverlayItem is using so I can calculate the height of it and properly offset the note that shows onTap. Here is my code to try to get that drawable:</p><pre><code>Drawable marker = item.getMarker(android.R.attr.state_focused);if (marker != null) int markerHeight = marker.getIntrinsicHeight();</code></pre><p>marker ends up null.</p><p>I'm using a drawable XML file with a selector for the different states of the OverlayItem's drawable. In it I'm specifying a drawable for the null state, state_focused, and state_pressed.</p><p>Thanks for any help!</p><p>-Nick</p>","29297","","","","","2010-04-07 13:57:53","Trouble getting height of OverlayItem Drawable","<android>","1","2","","",""
"2476610","1","2476962","","2010-03-19 10:54:25","2","1582","<p>I created and binded a service in an activity and I would like to know how I can avoiding the android application to stop when I press the back button.</p><p>When the back button is pressed the onDestroy method is called and I unbinded the service in this method.I try to prevent it by taking care of the back button event and manually call for onStop() method but it always called onDestroy after, why?</p>","297290","","","","","2011-04-29 08:00:41","Android - Avoiding a service to stop when pressing back button","<android>","1","0","","",""
"2476642","1","2477218","","2010-03-19 11:00:07","0","1302","<p>i want set the visibility to itemized overlay in map view. if the zoom level is less than 10 i want to set visibility of overlay is GONE else VISIBLE. how to do that?  and also cant set zoom level Listener. </p>","267269","","267269","","2010-03-19 11:16:45","2012-01-10 10:43:47","how to handle the visibility of the ItemizedOverlay in mapview in android?","<android><visibility><android-mapview><itemizedoverlay><android-maps>","2","0","","",""
"2476930","1","2477423","","2010-03-19 11:51:46","1","645","<p>Hi I got something wrong in my code and I don't know whyMy program have 2 spinner box and 1 textview.when I choose something in both spinner it should call method from getrate inner classwhich return some value to textview.This getrate class working on my java app but it's don't working on android app.</p><p>here is my code</p><pre><code>public class BTS extends Activity {/** Called when the activity is first created. */ int i=0; int j=0; String[] li={""1"",""2"",""3""}; getrate gr;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main); final Spinner combo = (Spinner)findViewById(R.id.widget30); final Spinner combo2 = (Spinner)findViewById(R.id.widget32); final TextView rate = (TextView) findViewById(R.id.widget31);  ArrayAdapter&lt;String&gt; a = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item, li);  ArrayAdapter&lt;String&gt; b = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item, li);        combo.setAdapter(a);        combo2.setAdapter(b);        combo.setOnItemSelectedListener(new OnItemSelectedListener() {   @Override   public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,     int arg2, long arg3) {    // TODO Auto-generated method stub    i = (int) combo.getSelectedItemId();    if(i==0||j==0){rate.setText(""???????????????????????????????"");}    else {rate.setText(""????????????? : ""+gr.get(i, j)+"" ???"");}   }   @Override   public void onNothingSelected(AdapterView&lt;?&gt; arg0) {    // TODO Auto-generated method stub   }  });        combo2.setOnItemSelectedListener(new OnItemSelectedListener() {   @Override   public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,     int arg2, long arg3) {    // TODO Auto-generated method stub    j = (int) combo2.getSelectedItemId();    if(i==0||j==0){rate.setText(""???????????????????????????????"");}    else {rate.setText(""????????????? : ""+gr.get(i, j)+"" ???"");}   }   @Override  public void onNothingSelected(AdapterView&lt;?&gt; arg0) {    // TODO Auto-generated method stub   }  });    }}class getrate { private String[][] list; int c2=0; String[] ct={""1"",""2"",""3""}; getrate(){ } public String get(int i,int j){  return ct[i]; }}</code></pre><p>Ps. Sry for my english ;D</p>","169736","","24054","","2010-03-19 11:55:45","2010-03-19 13:01:20","Problem about getting value from inner class in Android","<java><android>","1","0","0","",""
"2476951","1","2477290","","2010-03-19 11:54:06","2","311","<p>In short, I am looking for the implementation of the IAlarmManager.</p><p>I am interested in the scheduling done by the AlarmManager.setInexactRepeating method and so I started looking for the implementation but I haven't been able to find anything.  Internally to AlarmManager, I can see that the actual work is being done by an android.app.IAlarmManager interface.  After googling around for a bit there seems to reference to an implementing class called android.app.IAlarmManager.Stub but that is as far I get.I am working with Android 1.6.</p>","248216","","","","","2010-03-19 12:41:49","Cannot find certain implementing classes in Android","<android>","1","0","","",""
"2477294","1","2530851","","2010-03-19 12:42:04","1","1689","<p>I'm using a thumbnail loader in my project the one mentioned below. The problem is that the it loads all the thumbnails properly except the ones who's size is of about 40K. When our back end is giving that sort of thumbnails are not generated and sometimes this eventually leads to a Crash too.</p><p>What m I supposed to do with this ?</p><pre><code>public class ThumbnailManager  {private final Map&lt;String, Bitmap&gt; drawableMap;public static Context context;private Resources res;private int thumbnail_size;public ThumbnailManager(){    drawableMap = new HashMap&lt;String, Bitmap &gt;();       res = new Resources(context.getAssets(), null, null);    thumbnail_size = res.getInteger(R.ThumbnailManager.THUMBNAIL_SIZE);}public Bitmap fetchBitmap(String urlString){    if(drawableMap.containsKey(urlString))    {        return (drawableMap.get(urlString));    }    //Log.d(getClass().getSimpleName(), "" Image URL :: ""+ urlString);    try    {        InputStream is = fetch(urlString);        android.util.Log.v(""ThumbnailManager"", ""ThumbnailManager "" + urlString);        drawableMap.put(urlString, BitmapFactory.decodeStream(is));//Bitmap.createScaledBitmap(BitmapFactory.decodeStream(is), thumbnail_size, thumbnail_size, false));        return drawableMap.get(urlString);    }    catch(Exception e)    {        android.util.Log.v(""EXCEPTION"", ""EXCEPTION"" + urlString);        return null;    }}public void fetchBitmapOnThread(final String urlString, final ImageView imageView){    if(drawableMap.containsKey(urlString))    {        imageView.setImageBitmap(drawableMap.get(urlString));        return;    }    if(urlString.compareTo(""AUDIO"") == 0)    {        Bitmap audioThumb = BitmapFactory.decodeResource(context.getResources(), R.drawable.timeline_audio_thumb);        drawableMap.put(urlString, Bitmap.createScaledBitmap(audioThumb, thumbnail_size, thumbnail_size, false));        imageView.setImageBitmap(drawableMap.get(urlString));        return;    }    final Handler handler = new Handler()    {        public void handleMessage(Message message)        {            imageView.setImageBitmap((Bitmap) message.obj);        }    };    Thread thread = new Thread()    {        public void run()        {            Bitmap urlBitmap = fetchBitmap(urlString);            Message message = handler.obtainMessage(1, urlBitmap);            handler.sendMessage(message);        }    };    thread.start();}public InputStream fetch(String urlString) throws IOException, MalformedURLException{    final URL url = new URL(urlString);    final URLConnection conn = url.openConnection();    HttpURLConnection httpConn = (HttpURLConnection) conn;    httpConn.setAllowUserInteraction(true);    httpConn.setInstanceFollowRedirects(true);    httpConn.setRequestMethod(""GET"");    httpConn.connect();    return(conn.getInputStream());}}</code></pre>","92039","","19750","","2010-03-19 12:44:25","2010-03-27 20:41:49","Android Thumbnail Loading Problem","<android><thumbnails>","1","2","","",""
"2477308","1","","","2010-03-19 12:44:20","3","4879","<p>I'm trying to build a gadget that detects pistol shots using Android. It's a part of a training aid for pistol shooters that tells how the shots are distributed in time and I use a HTC Tattoo for testing.</p><p>I use the MediaRecorder and its getMaxAmplitude method to get the highest amplitude during the last 1/100 s but it does not work as expected; speech gives me values from getMaxAmplitude in the range from 0 to about 25000 while the pistol shots (or shouting!) only reaches about 15000. With a sampling frequency of 8kHz there should be some samples with considerably high level.</p><p>Anyone who knows how these things work? Are there filters that are applied before registering the max amplitude. If so, is it hardware or software?</p><p>Thanks,    /George</p>","297348","","","","","2014-04-19 23:55:34","Microphone input","<android>","4","5","2","",""
"2477477","1","2478869","","2010-03-19 13:08:15","4","5848","<p>I would like to pausing or putting the application on background when pressing the back button, I don't want the application to go through the destroy state. Things are when I override onKeyDown and when I force to pause or stop the application by using onPause, I have some issuees with the wakelock and application crash, but when I press home button I go through onPause method and I have no exception, it's weird!! </p>","297290","","","","","2013-03-08 19:38:12","Android - Avoiding an activity to destroy, just stopping or pausing it when pushing the back button","<android>","2","5","3","",""
"2477646","1","","","2010-03-19 13:32:06","3","9837","<p>I am using List View in my project where i have used a xml file which is used to create the list item.Then i have used it programmatically in my class which is extended by ListActivity.But the problem is i have to add a button in the bottom of screen which is not related to list view but List view covers all the screen.So,is there any way to add button in bottom with list view in android.</p><p>My Code is :- </p><pre><code>import android.app.ListActivity;import android.content.Intent;import android.os.Bundle;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ImageView;import android.widget.ListView;import android.widget.TextView;import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.view.Window;public class Options extends ListActivity {    String[] items;    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        requestWindowFeature(Window.FEATURE_RIGHT_ICON);        items = getResources().getStringArray(R.array.chantOption_array);        setListAdapter(new IconicAdapter());        ListView lv = getListView();        lv.setTextFilterEnabled(true);        lv.setBackgroundResource(R.drawable.ichant_logo);        setFeatureDrawableResource(Window.FEATURE_RIGHT_ICON, R.drawable.icon_t);        lv.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view,                    int position, long id) {                // When clicked, show a toast with the TextView text                Toast.makeText(getApplicationContext(),                        items[position], Toast.LENGTH_SHORT).show();                if (""Gayatri Mantra"".equals(items[position].toString())) {                    int[] timeintervals = { 23900, 24000 };                    // startChantActivity(TotalMala_loop,Total_Bead_Loop,BacgroundImage,Icon,Title,BeadsTotalTimeIntervals+totalTimeDurationOfAudio)                    startChantActivity(2, 108, R.drawable.gayatri,                            R.raw.gayatri, R.drawable.icon_gayatri,                            ""Gayatri Mantra"", timeintervals);                }                if (""Om Mani Padme Hum"".equals(items[position].toString())) {                    int[] timeintervals = { 5500, 8200, 11100, 13900, 34100,                            36700, 39500, 42300, 59300, 62000, 64800, 67600,                            124600 };                    // startChantActivity(TotalMala_loop,Total_Bead_Loop,BacgroundImage,Icon,Title,BeadsTotalTimeIntervals+totalTimeDurationOfAudio)                    startChantActivity(2, 108, R.drawable.ommanipadmehum,                            R.raw.om_mani, R.drawable.icon_padme,                            ""Om Mani Padme Hum"", timeintervals);                }                if (""Sai Ram"".equals(items[position].toString())) {                    // Audio time interval for bead+total time duration of audio                    int[] timeintervals = { 4800, 7500, 10400, 12600, 15800,                            18600, 21600, 24400, 25000 };                    // startChantActivity(TotalMala_loop,Total_Bead_Loop,BacgroundImage,Icon,Title,BeadsTotalTimeIntervals+totalTimeDurationOfAudio)                    startChantActivity(2, 108, R.drawable.sairam, R.raw.sairam,                            R.drawable.icon_sairam, ""Sai Ram"", timeintervals);                }                if (""Aum"".equals(items[position].toString())) {                    // Audio time interval for bead+total time duration of audio                    int[] timeintervals = { 12850, 13000 };                    // startChantActivity(TotalMala_loop,Total_Bead_Loop,BacgroundImage,Icon,Title,BeadsTotalTimeIntervals+totalTimeDurationOfAudio)                    startChantActivity(2, 108, R.drawable.aum, R.raw.aum,                            R.drawable.ico_aum, ""Aum"", timeintervals);                }            }        });    }    class IconicAdapter extends ArrayAdapter {        IconicAdapter() {            super(Options.this, R.layout.list_item, items);        }        public View getView(int position, View convertView, ViewGroup parent) {            LayoutInflater inflater = getLayoutInflater();            View row = inflater.inflate(R.layout.list_item, parent, false);            TextView label = (TextView) row.findViewById(R.id.label);            label.setText("" ""+items[position]);            ImageView icon = (ImageView) row.findViewById(R.id.icon);            if (items[position].equals(""Gayatri Mantra"")) {                icon.setImageResource(R.drawable.icon_gayatri);            }            if (items[position].equals(""Om Mani Padme Hum"")) {                icon.setImageResource(R.drawable.icon_padme);            }            if (items[position].equals(""Sai Ram"")) {                icon.setImageResource(R.drawable.icon_sairam);            }            if (items[position].equals(""Aum"")) {                icon.setImageResource(R.drawable.ico_aum);            }            return (row);        }    }    protected void startChantActivity(int mala_loop, int beads_loop,            int background, int media, int titleIcon, String title,            int[] timeintervals) {        Bundle bundle = new Bundle();        bundle.putInt(""mala_loop"", mala_loop);        bundle.putInt(""beads_loop"", beads_loop);        bundle.putInt(""background"", background);        bundle.putInt(""media"", media);        bundle.putInt(""titleIcon"", titleIcon);        bundle.putString(""title"", title);        bundle.putIntArray(""intervals"", timeintervals);        Intent intent = new Intent(this, ChantBliss.class);        intent.putExtras(bundle);        startActivityForResult(intent, this.getSelectedItemPosition());    }}</code></pre><p>And Corresponding xml file is:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:orientation=""horizontal""&gt;&lt;ImageViewandroid:id=""@+id/icon""android:layout_width=""wrap_content""android:paddingLeft=""2px""android:paddingRight=""2px""android:paddingTop=""2px""android:layout_height=""wrap_content""/&gt;&lt;TextViewandroid:id=""@+id/label""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:textSize=""22sp""android:textColor=""#ff000000""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Thanks in Advance:Sandeep</p>","302676","","13070","","2010-03-19 13:50:20","2010-03-22 07:43:40","Set List View Size Android","<android><listview><button><size>","2","0","2","",""
"2477647","1","2477895","","2010-03-19 13:32:37","17","75770","<p>Common problem I'm sure, but I can't figure it out.  In my AndroidManifest.xml and main.xml I'm getting the no resource found that matches the given name.  I've double checked for typos and it used to work, but now I'm popping up with all these errors saying it can't find my strings in my strings.xml.  </p><p>These are the ones I'm getting errors for in my main.xml.</p><pre><code>    &lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_marginTop=""10dip""    android:text=""@string/instructions""    /&gt;    &lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_marginTop=""10dip""    android:text=""@string/level_prompt""    /&gt;    &lt;Spinner             android:id=""@+id/spinner""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:prompt=""@string/level_array""    /&gt;</code></pre><p>These are the ones I'm getting for my androidmanifest.xml.</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;&lt;activity android:name="".HelloFormStuff"" android:label=""@string/title""&gt;</code></pre><p>This is what my strings.xml looks like.</p><pre><code>&lt;string name=""title""&gt;Title&lt;/string&gt;&lt;string name=""app_name""&gt;Application name&lt;/string&gt;&lt;string name=""instructions""&gt;Enter instructions here.&lt;/string&gt;&lt;string name=""level_prompt""&gt;Choose an item&lt;/string&gt;&lt;string-array name=""level_array""&gt;        &lt;item&gt;Item One&lt;/item&gt;        &lt;item&gt;Item Two&lt;/item&gt;        &lt;item&gt;Item Three&lt;/item&gt;        &lt;item&gt;Item Four&lt;/item&gt;&lt;/string-array&gt;</code></pre><p>Any ideas?  Any help would be appreciated!!</p>","297387","","","","","2013-03-20 11:58:20","Error using eclipse for Android - No resource found that matches the given name","<android>","14","0","2","",""
"2477770","1","","","2010-03-19 13:49:57","2","306","<p>How can I email an XML string (or an in-memory file) in android as a file attachment without actually creating a physical File?</p><p>I want to just build an XML data string (backup data) and have the user email it.</p>","61525","","61525","","2010-09-01 13:08:31","2011-07-04 15:37:30","android: Email an XML string (in-memory file) as an attachment","<android><email-attachments>","1","0","","",""
"2477889","1","2478028","","2010-03-19 14:08:40","3","5730","<p>Hi    I have an already built application and I want to add a feature that has to be started when a call ends.How can I achieve that?I thought that declaring in my manifest something like this</p><pre><code>&lt;activity android:name=""Filter""&gt;    &lt;intent-filter&gt;            &lt;category android:name=""android.intent.SOMETHING"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>could be enough, but what kind of intent I have to put on the filter?</p><p>Looking in the documentation I found only the intents that detects when a call is started.</p><p>Is what I'm looking for possible?</p><p>Thanks</p>","295525","","","","","2013-11-26 23:33:07","Intent to be fired when a call ends?","<android><call><android-intent>","2","2","3","",""
"2477992","1","2478034","","2010-03-19 14:24:38","1","1062","<p>I know how to create and apply styles and themes thanks to <a href=""http://developer.android.com/guide/topics/ui/themes.html"" rel=""nofollow"">http://developer.android.com/guide/topics/ui/themes.html</a>. However, this method only works for our own activity or application.</p><p>I'd like to create themes that could dress the whole system (i.e. all activities). Of course, I'd like to select one of these theme by programing. If I could customize the status bar as well, it would be perfect.</p><p>I didn't find out documentation about that. Can you help me?</p><p>Thanks!</p>","297428","","","","","2010-03-19 14:30:44","How to create and manage custom themes for whole Android system?","<android>","1","0","","",""
"2478180","1","2478194","","2010-03-19 14:51:16","1","1015","<p>Understanding how incredibly dangerous this question is, I'd like to know if it is possible to programmatically issue a factory reset, as available in Droid and G1.  Does anyone know how this is implemented?  Is this implemented using the standard Android SDK, a Motorola-specific function, or something else?</p>","252631","","","","","2012-03-30 15:00:07","Is there a way to programmatically perform a factory reset on an Android device?","<android>","2","0","1","",""
"2478418","1","2478556","","2010-03-19 15:19:45","12","11323","<p>I want to do a custom action when pressing on the <code>Menu</code> button on the phone.</p><p>Is it possible to set an onClickListener (or similar) on the button and if so, how?</p><p><code>onCreateOptionsMenu</code> is only called the first time the button is pressed - I've already tried this.</p>","288980","","26853","","2010-03-19 15:22:56","2010-03-19 15:37:06","Android: How can I set a listener to the MenuButton?","<java><android><optionmenu>","3","0","3","",""
"2478482","1","2907807","","2010-03-19 15:28:27","2","958","<p>I would like to write an Android application that can be activated by sending it a command from a web site.  Is this possible?  Actually, the app would be running on the phone and I would be sending it a command via HTTP.</p>","121678","","121678","","2010-03-19 15:57:13","2010-05-25 19:20:27","Can I write an Android app that receives a command from a web site?","<android>","5","2","1","",""
"2478503","1","","","2010-03-19 15:30:20","8","26576","<p>I need an example of how to display the strings that I have marked up with simple html into a TextView. I have found ""Spanned fromHtml(String source)"", but I don't know how to plug it into my java code.</p><p>Here is my Java:</p><pre><code>package com.SorenWinslow.TriumphHistory;import android.app.ListActivity;import android.os.Bundle;import android.widget.ArrayAdapter;public class TriumphHistory extends ListActivity {    String[] HistoryList;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ArrayAdapter&lt;String&gt; adapter;        HistoryList = getResources().getStringArray(R.array.history);        adapter = new ArrayAdapter&lt;String&gt; (this,R.layout.historylistlayout,HistoryList);        setListAdapter(adapter);    }}</code></pre><p>Here is a sample of history:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;string-array name=""history""&gt;&lt;item&gt;&lt;b&gt;1883&lt;/b&gt;&lt;br/&gt;Some stuff happened&lt;/item&gt;&lt;item&gt;&lt;b&gt;1884&lt;/b&gt;&lt;br/&gt;Some more stuff happened &lt;i&gt;before&lt;/i&gt; the other stuff&lt;/item&gt;&lt;resources&gt;</code></pre><p>Here is my historylistlayout.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/text1""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:textAppearance=""?android:attr/textAppearanceLarge""    android:gravity=""center_vertical""    android:textColor=""#ffffff""    android:background=""#000050""    android:layout_marginTop=""5px""    android:minHeight=""?android:attr/listPreferredItemHeight""    android:padding=""3px""     android:textSize=""8pt"" android:layout_gravity=""top|left""/&gt;</code></pre><p>And here is my main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:textColor=""#ffffff""    android:background=""#000080""     android:isScrollContainer=""true""     android:layout_height=""fill_parent""     android:layout_width=""fill_parent"" android:scrollbarStyle=""insideOverlay""&gt;  &lt;ListView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/list""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     android:clickable=""true""     android:dividerHeight=""1px""/&gt;&lt;/LinearLayout&gt;</code></pre>","294703","","156869","","2011-03-11 09:17:56","2013-02-28 09:01:53","Display HTML Formatted String","<java><android><eclipse><android-arrayadapter>","5","0","3","",""
"2478517","1","2478662","","2010-03-19 15:32:35","107","87000","<p>Yes I know there's AlertDialog.Builder, but I'm shocked to know how difficult (well, at least not programmer-friendly) to display a dialog in Android.</p><p>I used to be a .Net developer, and I'm wondering is there any Android-equivalent of the following?</p><pre><code>if (MessageBox.Show(""Are You Sure?"", """", MessageBoxButtons.YesNo) == DialogResult.Yes){                //Do something...}</code></pre><p>Thanks for your input.</p>","297469","","3110575","","2014-02-23 05:43:57","2014-02-23 05:43:57","How to display a Yes/No dialog box in Android?","<android><alertdialog>","7","1","32","",""
"2478615","1","2480558","","2010-03-19 15:43:46","11","13906","<p>I need to set the TextView maximum height (either using maxHeight or maxLines). And if there are more lines of text the scrollbars should be shown. What markup should I use for this?</p><p>Initial idea was to wrap TextView with ScrollView, but ScrollView has no maxHeight attribute.</p>","62192","","","","","2013-03-22 15:17:31","Android TextView with scrollbars and maxHeight","<android>","1","0","3","",""
"2478866","1","2480985","","2010-03-19 16:21:41","0","1832","<p>I am currently building an application that allows users to track where their phone has been on a Google Map. At the moment, when the onLocationChanged() method is called, the application stores the current GPS longitude and latitude in a database and calls the animateTo() method to the current position. </p><p>Using SDK 1.5, how would I go about connecting these points with a coloured line drawn on the MapView using an Overlay?. </p>","296810","","","","","2010-03-23 21:51:50","Connecting GPS coordinates taken from a database in Android using Overlay","<java><android><overlay><android-mapview>","1","0","","",""
"2478923","1","","","2010-03-19 16:30:38","2","4615","<p>I have a couple of third party classes which serve as a library I can build my application upon. They are contained in a folder which was added Java Build Path -> Libraries (in Eclipse) with ""Add Class Folder"". It works fine so far an my app compiles. But the produced .apk contains only my classes and therefore the application does not run. </p><p>How can I tell Eclipse to package the third party classes into the .apk as well?</p>","170448","","","","","2012-05-18 13:26:03","How to include third party classes into the Android apk?","<android><apk>","2","2","1","",""
"2479353","1","2495404","","2010-03-19 17:34:33","0","4232","<p>I'm currently working on <a href=""http://mangler.org"" rel=""nofollow"">Mangler's</a> Android implementation.</p><p>I have a java class that looks like so:</p><pre><code>public class VentriloEventData { public short type; public class _pcm {  public int   length;     public short  send_type;     public int  rate;     public byte  channels; }; _pcm pcm;}</code></pre><p>The signature for my pcm object:</p><pre><code>$ javap -s -p VentriloEventData...org.mangler.VentriloEventData$_pcm pcm;  Signature: Lorg/mangler/VentriloEventData$_pcm;</code></pre><p>I am implementing a native JNI function called getevent, which will write to the fields in an instance of the VentriloEventData class. For what it's worth, it's defined and called in Java like so:</p><pre><code>public static native int getevent(VentriloEventData data);VentriloEventData data = new VentriloEventData();getevent(data);</code></pre><p>And my JNI implementation of getevent:</p><pre><code>JNIEXPORT jint JNICALL Java_org_mangler_VentriloInterface_getevent(JNIEnv* env, jobject obj, jobject eventdata) { v3_event *ev = v3_get_event(V3_BLOCK); if(ev != NULL) {  jclass event_class = (*env)-&gt;GetObjectClass(env, eventdata);  // Event type.  jfieldID type_field = (*env)-&gt;GetFieldID(env, event_class, ""type"", ""S"");  (*env)-&gt;SetShortField(   env,    eventdata,    type_field,    1234  );  // Get PCM class.  jfieldID pcm_field = (*env)-&gt;GetFieldID(env, event_class, ""pcm"", ""Lorg/mangler/VentriloEventData$_pcm;"");  jobject pcm =   (*env)-&gt;GetObjectField(   env,    eventdata,    pcm_field  );  jclass pcm_class = (*env)-&gt;GetObjectClass(env, pcm);  // Set PCM fields.  jfieldID pcm_length_field = (*env)-&gt;GetFieldID(env, pcm_class, ""length"", ""I"");  (*env)-&gt;SetIntField(   env,   pcm,   pcm_length_field,   1337  );  free(ev); } return 0;}</code></pre><p>The code above works fine for writing into the type field (that is not wrapped by the _pcm class). Once getevent is called, data.type is verified to be 1234 at the java side :)</p><p>My problem is that the assertion ""pcm != NULL"" will fail. Note that pcm_field != NULL, which probably indicates that the signature to that field is correct... so there must be something wrong with my call to GetObjectField. It looks fine though if I compare it to the <a href=""http://java.sun.com/docs/books/jni/html/fldmeth.html"" rel=""nofollow"">official JNI docs</a>.</p><p>Been bashing my head on this problem for the past 2 hours and I'm getting a little desperate.. hoping a different perspective will help me out on this one. </p><p>edit1: This won't work with any nested object, even a simple 'Ljava/lang/String;' will fail.<br />edit2: Both ExceptionOccurred and ExceptionCheck return JNI_FALSE.<br />edit3: Won't work with static fields either.</p>","51133","","51133","","2010-03-19 23:14:28","2010-03-22 20:17:25","JNI - GetObjectField returns NULL","<java><android><jni>","1","0","","",""
"2479355","1","2479437","","2010-03-19 17:34:47","1","655","<p>Hi I'd like to programatically increase the height allocated to a TextView, and have the activity layout redrawn accordingly (the text view has a maximum height until the user clicks it, then it takes up all height required, wrap_content).</p><p>setHeight() isn't working, even coupled with invalidate() or postInvalidate(). I am able to change the contents of the TextBox with setText() but it isn't altering the existing specified height.</p><p>Android 1.5 under the 1.6 SDK.</p>","82515","","","","","2010-03-19 17:48:57","Changing the height of an existing, visible TextView","<android>","1","1","1","",""
"2479370","1","2479457","","2010-03-19 17:36:57","0","265","<p>I am trying to reuse the header layout for contact details display view.</p><p>I was able to add the widget of ContactHeaderWidget to my XML file as it is in this <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=blob;f=res/layout-finger/contact_card_layout.xml;h=6e7056134a5167e7b7cf4981ca21f8e6f8059190;hb=HEAD"" rel=""nofollow"">file</a> and it shows up empty when I run the apk.</p><p><strong>But now how do I set the name of the contact, and the image of the contact?</strong></p><p>I've tried the method in line 197 <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=blob;f=src/com/android/contacts/ViewContactActivity.java;h=ca3c08a4f010e9f6d7623c5eeda5f216f141d198;hb=HEAD"" rel=""nofollow"">here</a> but I couldn't import the necessary files as that would be line 28, which is not available for me.</p><pre><code>import com.android.internal.widget.ContactHeaderWidget;</code></pre>","243782","","","","","2010-03-19 17:51:37","Proper reuse of ContactHeaderWidget","<android>","1","0","","",""
"2479504","1","","","2010-03-19 18:00:18","20","17833","<p>I am trying to force the Soft Keyboard open in an Activity and grab everything that is entered as I want to handle the input myself, I don't have an EditText.  Currently I have tried this but it does not work.  I would like the Soft Keyboardto open below mAnswerTextView (Note: it is a TextView not EditText).</p><pre><code>    InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);    // only will trigger it if no physical keyboard is open    mgr.showSoftInput(mAnswerTextView, InputMethodManager.SHOW_IMPLICIT);</code></pre><ol><li>how do I force the Soft Keyboard open</li><li>How do I gab everything that is entered so that I can handle each character.  I would like to flush each character from the Soft Keyboard after I have handled it. ie, the user should not be able to enter whole words in the Soft Keyboard.</li></ol>","248521","","","","","2012-12-07 22:14:18","Forcing the Soft Keyboard open","<android>","3","1","4","",""
"2479545","1","2496437","","2010-03-19 18:05:56","2","672","<p>I have seen this example:</p><pre><code>@*android:color/secondary_text_light</code></pre><p>What's that * asterisk doing there? What is the difference when using or not?</p>","243782","","","","","2010-03-22 23:15:58","Setting color in two different ways @*android:color/color1 vs @android:color/color1","<android>","1","0","","",""
"2479550","1","2479583","","2010-03-19 18:06:44","14","21088","<p>When developing for Android do you typically need to stop the emulator and restart it every time you make a change to your Java code or is there a faster way?  The emulator takes about 1.5 minutes to start for me, is this normal?</p>","97901","","","","","2014-01-28 16:26:55","How long does the Android Emulator take to start? Do you need to close/start if every time you change Java code?","<android><android-emulator>","9","2","2","",""
"2479696","1","2484589","","2010-03-19 18:28:52","1","20254","<p>I seem to be having a problem with using ItemizedOverlay and OveralyItems in it.</p><p>I can get the first overlayItem to appear on the map but not any items after that.</p><p>Code sample is on: <a href=""http://www.anddev.org/multiple_overlay_items-t12171.html"" rel=""nofollow"">http://www.anddev.org/multiple_overlay_items-t12171.html</a></p><p>Quick overview here:</p><pre><code>public class Markers extends ItemizedOverlay { private Context ctx; private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;(); public Markers(Drawable defaultMarker, Context cont) {      super(boundCenterBottom(defaultMarker));      this.ctx = cont;      // TODO Auto-generated constructor stub } @Override protected OverlayItem createItem(int i) {      // TODO Auto-generated method stub      return mOverlays.get(i); } @Override public boolean onTap(GeoPoint p, MapView mapView) {      // TODO Auto-generated method stub      return super.onTap(p, mapView); } @Override protected boolean onTap(int index) {      // TODO Auto-generated method stub      Toast.makeText(this.ctx, mOverlays.get(index).getTitle().toString()+"", Latitude: ""+mOverlays.get(index).getPoint().getLatitudeE6(), Toast.LENGTH_SHORT).show();      return super.onTap(index);          } @Override public int size() {      // TODO Auto-generated method stub      return mOverlays.size(); } public void addOverlay(OverlayItem item) {      mOverlays.add(item);      setLastFocusedIndex(-1);      populate(); } public void clear() {      mOverlays.clear();      setLastFocusedIndex(-1);      populate(); }}</code></pre><p>Samples of how it's used:</p><pre><code>Markers usersMarker = new Markers(user,overview.this); GeoPoint p = new GeoPoint((int) (lat * 1E6),(int) (lon * 1E6));OverlayItem item = new OverlayItem(p,userData[0],userData[3]);item.setMarker(this.user);usersMarker.addOverlay(item); </code></pre><p>the first marker shows up on the map but if I add any more they don't show up? Is there a problem with the populate() method? I tried calling it manually after adding all markers but it still didn't help. Please, if you have any idea what could be wrong, say so.</p>","297616","","60261","","2010-03-19 19:54:36","2010-07-23 13:14:20","Multiple overlay items in android","<android><map><overlay><item>","3","2","7","",""
"2480043","1","2739164","","2010-03-19 19:26:29","0","938","<p>Hi   I have built an application that listen to call state changes, and I want to notify a service when the call_state became IDLE.</p><p>All the components I have are functional, I just need to notify (not start) a service for this.</p><p>What's the correct practice, maybe using AIDL?</p><p>Because, in a PhoneStateListener, I can't bind to a service. Do I have to start an activity for that?</p>","295525","","857361","","2012-07-26 10:15:02","2012-07-26 10:15:02","Notify a service from a PhoneStateListener","<android><service><android-intent><handler><phone-state-listener>","2","0","1","",""
"2480187","1","2483925","","2010-03-19 19:53:32","3","6022","<p>in iPhone, this would be simple---each view has a scrollViewDidScroll method. I am trying to find the equivalent in Android.</p><p>My code works, but it isn't giving me what I want. I need to execute code the entire duration that a view is scrolling. So, even though I use OnGestureListener's onScroll method, it only fires when the finger is on the screen (it's not really named correctly---it should be called ""onSlide"" or ""onSwipe"", focusing on the gesture rather than the UI animation). It does not continue to fire if the user flicks the view and it is still scrolling for a few moments after the user lifts his finger.</p><p>is there a method that is called at every step of the scroll?</p><pre><code>public class Scroll extends Activity implements OnGestureListener {public  WebView         webview;public  GestureDetector gestureScanner;public  int         currentYPosition;public  int         lastYPosition;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    webview = new WebView(this);    setContentView(webview);    webview.loadUrl(""file:///android_asset/Scroll.html"");    gestureScanner = new GestureDetector(this);    currentYPosition = 0;    lastYPosition = 0;}public boolean onTouchEvent(final MotionEvent me) {    return gestureScanner.onTouchEvent(me);}public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {    // I do stuff here.    return true;}</code></pre>","295021","","161161","","2010-03-19 21:21:40","2010-10-07 10:15:30","Android: how to tell if a view is scrolling","<android><scroll><webview>","3","0","2","",""
"2480244","1","2480553","","2010-03-19 20:03:16","1","3104","<p>i'am working on an autogrowing listview. Everytime before i call </p><pre><code>    mAdapter.notifyDataSetChanged();</code></pre><p>i toggle the latest item on the list with a progress circle.</p><pre><code>    /**    * displays a progress banner instead of the last item.    * @param reload boolean    */    protected void showReloadView(boolean reload){         View item = mListView.getChildAt(onLastItem);         //View item = mListView.getAdapter().getView(onLastItem, null, null);         content = item.findViewById(id.itemContent);         loading = item.findViewById(id.itemLoading);         if(reload){           content.setVisibility(View.GONE);           loading.setVisibility(View.VISIBLE);        }else{           content.setVisibility(View.VISIBLE);           loading.setVisibility(View.GONE);   }</code></pre><p>My Problem here is that i'am recycling my views as mentioned in the SDK as EfficientAdapter.Therefore my ListView object currently holds no more than 8 items (cause there are no more visible)</p><p>The first run is ok, because ""onLastItem"" is 7 (visible items - 1), but the second run </p><pre><code>    ListView.getChildCount() </code></pre><p>returns just 6 items. So why is my ListView getting smaller? Because of Visibility.GONE?Am i doing smth wrong?</p><p>I've tried to use the uncommented line as well. My Adapter knows the real size of the list and i can even get the view. But setting the visibility on these views has no effect. </p><p>Thx in advance</p>","288324","","","","","2010-03-19 21:00:09","Problem with setting visibility in a Listview & BaseAdapter","<android><listview><adapter>","2","0","","",""
"2480288","1","2480307","","2010-03-19 20:09:38","110","103890","<p>Is there a way to get the phone number that is running my app's number within the app?</p>","293388","","1318946","","2014-02-01 12:06:00","2014-03-27 00:51:45","How can I programmatically obtain the number of the Android phone with the API?","<android><telephonymanager>","8","0","68","",""
"2480312","1","2480386","","2010-03-19 20:13:58","4","1691","<p>I am assigning to an ImageView contacts images using this code:</p><pre><code>mPhotoView = (ImageView) findViewById(R.id.photo);mPhotoView.setImageURI(objItem.getPhotoUri());</code></pre><p>If the contact has no image, this does nothing, and no error is raised.</p><p>When there is no image, I want to add a default image. So I need to check either if the image was added to the view, or check that the URI holds some image data</p><p>How do I achieve that?</p><p>Than I will set default image by this:</p><pre><code>mPhotoView.setImageResource(R.drawable.ic_contact_picture_2);</code></pre>","243782","","","","","2014-03-11 13:38:42","How to check if Contact has Image?","<android>","3","2","2","",""
"2480412","1","2551968","","2010-03-19 20:31:49","0","363","<p>I know that eclipse can do this, can Intellij via the new Android support do this?</p>","97901","","","","","2011-07-28 09:45:27","Can you redeploy an Android application via Intellij 9 Ultimate's Android support?","<android><intellij-idea><android-emulator>","1","0","","",""
"2480596","1","2495781","","2010-03-19 21:08:37","19","7569","<p>Android <a href=""http://source.android.com/source/code-style.html"">Code Style Guide</a> defines ""Android Code Style Rules"".<br>To conform to these rules one have to change quite a number of settings of the Java Code Formatter (Window->Preferences->Java->Code Style->Formatter) default profile (in Eclipse IDE).</p><p>Did anyone manage to configure the formatter to follow the ""Android Code Style Rules"" already?<br>If yes, please export the Formatter profile and publish to be used by community.</p><p>PS: I've tried to do this myself but I've found that there are too many formatter options available, and most of them are not mentioned in the Code Style Guide :-(</p>","297710","","241475","","2011-01-27 07:16:24","2012-03-17 21:22:01","Did anyone create the Java Code Formatter Profile for Eclipse IDE that conforms to the Android Code Style Rules?","<android><eclipse><coding-style>","5","0","17","",""
"2480761","1","2480896","","2010-03-19 21:42:36","3","1689","<p>My application is used on multiple platforms so it saves it preferences to a file (rather than to the standard Android SharedPreferences).</p><p>Is there any easy of reusing the PreferenceActivity to save preferences to a file or is it a case of creating a whole new activity to do the job? If the latter is the case is there a layout I can use that will make the activity look like the normal preferences screen? PreferenceActivity uses com.android.internal.R.layout.preference_list_content but this doesn't appear to be available to apps for reuse.</p>","219525","","","","","2011-08-16 07:45:27","How to save preferences to somewhere other than SharedPreferences","<android>","3","0","","",""
"2481083","1","2482698","","2010-03-19 23:04:19","7","4668","<p>From the documentation for android.app.Application:</p><p>""Base class for those who need to maintain global application state""</p><p>I am using my own subclass to maintain an object that I'm using to query a server.  Also from the documentation:</p><p>""onTerminate() Called when the application is stopping.""</p><p>However, onTerminate() in my class is never called.  I press the back button while viewing my main activity, and everything seems to shut down.  My main Activity's onDestroy() method is called and isFinishing() returns true, but my android.app.Application's onTerminate() method is never called.  </p><p>Why is this?  What am I missing?  Is there something that is keeping it open?</p>","238849","","","","","2012-10-02 04:49:42","android.app.Application subclass, onTerminate is not being called","<android>","2","2","","",""
"2481322","1","2482048","","2010-03-20 00:19:51","1","3980","<p>Alright, I'm trying to query a sqlite database. I was trying to be good and use the query method of SQLiteDatabase and pass in the values in the selectArgs parameter to ensure everything got properly escaped, but it wouldn't work. I never got any rows returned (no errors, either).</p><p>I started getting curious about the SQL that this generated so I did some more poking around and found <a href=""http://developer.android.com/reference/android/database/sqlite/SQLiteQueryBuilder.html"" rel=""nofollow"">SQLiteQueryBuilder</a> (and apparently Stack Overflow doesn't handle links with parentheses in them well, so I can't link to the anchor for the buildQuery method), which I assume uses the same logic to generate the SQL statement. I did this:</p><pre><code>  SQLiteQueryBuilder builder = new SQLiteQueryBuilder();  builder.setTables(BarcodeDb.Barcodes.TABLE_NAME);  String sql = builder.buildQuery(new String[] { BarcodeDb.Barcodes.ID, BarcodeDb.Barcodes.TIMESTAMP, BarcodeDb.Barcodes.TYPE, BarcodeDb.Barcodes.VALUE },    ""? = '?' AND ? = '?'"",    new String[] { BarcodeDb.Barcodes.VALUE, barcode.getValue(), BarcodeDb.Barcodes.TYPE, barcode.getType()},    null, null, null, null);  Log.d(tag, ""Query is: "" + sql);</code></pre><p>The SQL that gets logged at this point is:</p><pre><code>SELECT _id, timestamp, type, value FROM barcodes WHERE (? = '?' AND ? = '?')</code></pre><p>However, here's what the documentation for SQLiteQueryBuilder.buildQuery says about the selectAgs parameter:</p><blockquote>  <p>You may include ?s in selection, which  will be replaced by the values from  selectionArgs, in order that they  appear in the selection.</p></blockquote><p>...but it isn't working. Any ideas?</p>","297468","","297468","","2010-03-20 17:13:26","2010-03-20 17:13:26","SQLiteQueryBuilder.buildQuery not using selectArgs?","<sql><database><android><sqlite>","2","0","","",""
"2481455","1","3002321","","2010-03-20 01:04:47","82","115226","<p>I'm trying to use Java (<em>not XML</em>) to create a LinearLayout with buttons that fill the screen, and have margins. Here is code that works without margins:</p><pre><code>  LinearLayout buttonsView = new LinearLayout(this);  buttonsView.setOrientation(LinearLayout.VERTICAL);  for (int r = 0; r &lt; 6; ++r)  {   Button btn = new Button(this);   btn.setText(""A"");   LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT); // Verbose!   lp.weight = 1.0f; // This is critical. Doesn't work without it.   buttonsView.addView(btn, lp);  }  ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);  setContentView(buttonsView, lp);</code></pre><p>So that works fine, but how on earth do you give the buttons margins so there is space between them? I tried using <code>LinearLayout.MarginLayoutParams</code>, but that has no <code>weight</code> member so it's no good. And it doesn't work if you pass it <code>lp</code> in its constructor either.</p><p>Is this impossible? Because it sure looks it, and it wouldn't be the first Android layout task you can only do in XML.</p>","265521","","","","","2013-10-07 09:35:01","Set margins in a LinearLayout programmatically","<java><android><layout><view><margin>","4","2","18","",""
"2481527","1","","","2010-03-20 01:26:58","5","1178","<p>I am trying to synchronize the positions of two ScrollViews.  I'm trying to do this to display a tv guide listing.</p><p>I have created a custom class that extends RelativeLayout to display the guide.  This relative layout has four children: an imageview in the top left corner, a HorizontalScrollView to display the column headers in the top right, a ScrollView to display the row headers at the bottom left, and a ScrollView in the bottom right that contains the listings.  This ScrollView then contains a HorizontalScrollView, which in turn contains a LinearLayout with multiple child views that display the data.  I hope this explains it clearly, but here's a diagram to make it clearer:</p><pre><code> ____________|__|___hsv___||  |         ||  | sv -&gt;   ||  |  hsv -&gt; ||sv|   ll -&gt; ||  |    etc  ||  |         ||__|_________|</code></pre><p>I set it up like this because I wanted the guide listings to scroll both horizontally and vertically, but there's no scroll view that does this.  Also, I want the row and column headers to display no matter what position the guide listings are at, but I want them to be lined up properly.  So I'm trying to find a way to synchronize the positions of the two hsv's, and to also synchronize the positions of the two sv's.  I'm also trying to do it in a way that avoids just running a handler every few milliseconds to poll one view and call scrollTo on the other.</p><p>I'm in no way sure that this is the best way to do it, but this is what I've come up with.  If anybody has any other suggestions, please feel free!</p>","297822","","","","","2013-06-27 14:51:23","Synchronize the position of two ScrollView views","<android><views><scroll><scrollview><horizontalscrollview>","4","1","3","",""
"2481713","1","","","2010-03-20 02:49:16","4","829","<p>I am relatively new to the Android world and am having some difficultly understanding how the whole screen orientation cycle works. I understand that when the orientation changes from portrait to landscape or vice versa the activity is destroyed and then re-created. Thus all the code in the onCreate function will run again. So here's my situation: I have an app that I am working on where it logs into a website, retrieves data, and displays it to the user. While this is all done in background threads, the code that starts these threads is in the onCreate function. Now, the problem lies in that whenever the user changes the screen orientation, the app will log in, retrieve the data, and display it to the user again. What I would like to do is set a boolean that tells the app if it is logged in or not so it knows whether or not it must log in when the onCreate function is called. So long as the app is in memory the HttpClient will exist and contain the cookies from logging the user in but when the app is killed by the system those will go away. So I would assume that I need to do something like setting the logged in boolean to false when the app is killed but since onDestroy is called when the screen is rotated how is this possible? I also looked into the finalize function and isFinishing() but those seem to not be working.</p><p>Shorter version: How can I distinguish between when an app is being killed from memory from when an activity is being rotated and different code for each event?</p><p>Any help or a point in the right direction is greatly appreciated. Thank you!</p>","297843","","","","","2010-03-20 10:43:52","Android: Determine when an app is being finalized vs destroyed for screen orientation change","<android><screen-orientation>","2","0","1","",""
"2481755","1","","","2010-03-20 03:13:49","1","1017","<p>I need to draw a child view containing a rectangle and button  on top of the content view at particular location on the parent (content view).</p><p>How can I do this?  Did not find an explicit way to set origin of child view?</p>","274926","","1101070","","2012-03-06 00:45:49","2012-03-06 00:45:49","Adding a child view at particular location in parent view","<android>","1","0","","",""
"2481793","1","","","2010-03-20 03:30:17","19","12364","<p>I've racked my brain for hours over this issue.  I have created a main.xml and designed one for the res/layout-land (landscape) format and another one for portrait in res/layout.</p><p>When I rotate the emulator (ctrl-F11), my app rotates properly to landscape using the correct main.xml, but a subsequent rotation back to portrait just keeps the landscape mail.xml.</p><p>This was done in a 2.0 AVD..</p><p>Out of despiration I downloaded the new Sample Code for Multiple Resolutions and had to create a new 2.1 AVD, to my surprise rotation with this app works correctly as expected.  So I then decided to try my app on the 2.1 AVD and it works perfectly.</p><p>So, is this a Bug in a 2.0 AVD or is there something special I need to be doing for &lt; 2.1 SDK versions?</p><p>This is driving me crazy because no where did anyone mention this issue.</p><p>Thanks in advance</p>","297856","","180538","","2010-11-04 14:09:26","2012-06-14 16:34:52","Screen orientation landscape back to portrait not working","<android><android-emulator>","7","1","4","",""
"2481823","1","2481958","","2010-03-20 03:43:58","1","1460","<p>i'm trying to write an unit test for my Android's RelativeLayout. Currently, my testcode setup is as follow:</p><pre><code>public class SampleRelativeLayoutTest extends AndroidTestCase {private ViewGroup testView;private ImageView icon;private TextView  title;@Overrideprotected void setUp() throws Exception {    super.setUp();    // inflate the layout    final Context context = getContext();    final LayoutInflater inflater = LayoutInflater.from(context);    testView = (ViewGroup) inflater.inflate(R.layout.sample_layout,            null);    // manually measure and layout    testView.measure(500, 500);    testView.layout(0, 0, 500, 500);    // init variables    icon = (ImageView) testView.findViewById(R.id.icon);    title = (TextView) testView.findViewById(R.id.title);}</code></pre><p>However, I encountered NullPointerException with the following stack trace</p><pre><code>java.lang.NullPointerExceptionat android.widget.RelativeLayout.onMeasure(RelativeLayout.java:427)at android.view.View.measure(View.java:7964)at com.dqminh.test.view.SampleRelativeLayoutTest.setUp(SampleRelativeLayoutTest.java:33)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)</code></pre><p>What should I change in my setUp() code to make the test run properly ?</p>","108841","","","","","2012-10-20 07:56:25","Android's RelativeLayout Unit Test setup","<android>","4","1","","",""
"2481942","1","2482674","","2010-03-20 04:38:01","0","81","<p>I'm starting to design my object graph for an OpenGL ES 1.1 app on Android.</p><p>What's advisable when it comes to actually drawing my triangles and controlling their size?  Should I store all the vertices in units relative to each other and then multiply them by a value I pass during a draw(GL10 gl)?</p><p>Would this approach have any impact when it comes time to do frustum culling?</p>","128991","","321731","","2014-04-04 08:56:12","2014-04-04 08:56:12","How do I define and standardize units in my 3D app?","<java><android><opengl-es><scenegraph>","1","0","","",""
"2482631","1","3595163","","2010-03-20 10:23:07","7","4586","<p>I have code to read contact details and to read birthdays. But how do I get a list of contacts in order of their upcoming birthday?</p><p>For a single contact identified by <code>id</code>, I get details and birthday like this:</p><pre><code>Cursor c = null;  try {   Uri uri = ContentUris.withAppendedId(     ContactsContract.Contacts.CONTENT_URI, id);   c = ctx.getContentResolver().query(uri, null, null, null, null);   if (c != null) {    if (c.moveToFirst()) {     DatabaseUtils.cursorRowToContentValues(c, data);    }   }   c.close();   // read birthday   c = ctx.getContentResolver()     .query(       Data.CONTENT_URI,       new String[] { Event.DATA },       Data.CONTACT_ID + ""="" + id + "" AND ""         + Data.MIMETYPE + ""= '""         + Event.CONTENT_ITEM_TYPE + ""' AND ""         + Event.TYPE + ""="" + Event.TYPE_BIRTHDAY,       null, Data.DISPLAY_NAME);   if (c != null) {    try {     if (c.moveToFirst()) {      this.setBirthday(c.getString(0));     }    } finally {     c.close();    }   }   return super.load(id);  } catch (Exception e) {   Log.v(TAG(), e.getMessage(), e);   e.printStackTrace();   return false;  } finally {   if (c != null)    c.close();  }</code></pre><p>and the code to read all contacts is:</p><pre><code>public Cursor getList() {        // Get the base URI for the People table in the Contacts content        // provider.        Uri contacts = ContactsContract.Contacts.CONTENT_URI;        // Make the query.        ContentResolver cr = ctx.getContentResolver();        // Form an array specifying which columns to return.        String[] projection = new String[] { ContactsContract.Contacts._ID,                ContactsContract.Contacts.DISPLAY_NAME };        Cursor managedCursor = cr.query(contacts, projection, null, null,                ContactsContract.Contacts.DISPLAY_NAME                        + "" COLLATE LOCALIZED ASC"");        return managedCursor;    }</code></pre>","243782","","112","","2010-03-21 03:46:50","2010-10-26 07:10:54","How to get contacts in order of their upcoming birthdays?","<java><android><sqlite><android-contentresolver>","5","0","5","",""
"2482797","1","","","2010-03-20 11:17:36","2","1445","<p>I wrote a simple custom view for rows in ListView. It works fine, but when I try to scroll the list, I see only white rows without content. And when scrolling is over, rows continue to show again. </p><p>This is how I draw a custom view: </p><pre><code> @Override  protected void onDraw(Canvas canvas) {       if(poster != null) {            canvas.drawBitmap(poster, padding, padding, paint);       }       canvas.drawText(title, 55 + padding, 16 + padding, paint);  }</code></pre><p>Maybe I missed something? </p><p>P.S. This is short screencast (400kb) <a href=""http://dl.dropbox.com/u/190203/test.mpeg"" rel=""nofollow"">http://dl.dropbox.com/u/190203/test.mpeg</a></p>","107977","","","","","2010-05-13 12:11:16","Custom view in ListView disappears while scrolling in Android","<java><android>","1","2","","",""
"2482848","1","2483001","","2010-03-20 11:36:41","41","50398","<p>I've created a PreferenceActivity that allows the user to choose the theme he wants to apply to the entire application.</p><p>When the user selects a theme, this code is executed:</p><pre><code>if (...) {    getApplication().setTheme(R.style.BlackTheme);} else {    getApplication().setTheme(R.style.LightTheme);}</code></pre><p>But, even though I've checked with the debugger that the code is being executed, I can't see any change in the user interface.</p><p>Themes are defined in <code>res/values/styles.xml</code>, and Eclipse does not show any error.</p><pre><code>&lt;resources&gt;    &lt;style name=""LightTheme"" parent=""@android:style/Theme.Light""&gt;    &lt;/style&gt;    &lt;style name=""BlackTheme"" parent=""@android:style/Theme.Black""&gt;    &lt;/style&gt;    &lt;/resources&gt;</code></pre><p>Any idea about what could be happening and how to fix it?Should I call <code>setTheme</code> at any special point in the code? My application consists of several Activities if that helps.</p>","12388","","815724","","2013-01-20 19:51:35","2013-06-12 22:21:57","How to change current Theme at runtime in Android","<android><themes>","7","0","25","",""
"2483097","1","2484139","","2010-03-20 13:04:23","0","373","<p>i am developing one chat form in my apps displying the chats i was taken linear laout but i need to refresh that chat msg every 5 seconds for that i am using timer.while dynamically adding it is showing getting values from db and add to layout but in gui i am not able to get those messages for that what i have to do. is there any way for chat application refreshing page .how to update the values to layout in android .pl it's very urgent to me</p><p>Thanks in advance</p><p>Aswan </p>","1746300","","","","","2010-03-20 18:06:35","how to implement chating applicaiton in android","<android>","1","0","","",""
"2483226","1","2483269","","2010-03-20 13:43:49","2","576","<p>I want to set a menu option icon for a drawable that is in another jar inside an xml file.</p><pre><code>&lt;item android:id=""@+id/my_location""      android:title=""My Location""      android:icon=""@+drawable/my_location""&gt;</code></pre><p>Instead of drawable/my_location have something like com.somelib.R.drawable.someDrawable.</p><p>I can set this in onCreateOptionsMenu but was just wondering if it could be done via the xml file.</p>","297762","","","","","2010-03-20 13:55:16","Is it possible to set an android icon from a drawable in a separate jar?","<android>","1","0","","",""
"2483363","1","2483825","","2010-03-20 14:22:27","2","1989","<p>I am developing a chess game for Android (<a href=""http://androidchess.appspot.com"" rel=""nofollow"">http://androidchess.appspot.com</a>), using <code>SurfaceView</code> for the chessboard. I have a drawing <code>Thread</code>, that draws the chessboard in a loop. The problem is that when there are no active animations (this is more that 90% of time), it makes no sense to waste CPU and battery for drawing. How should I solve this? Maybe somehow pausing and resuming the drawing <code>Thread</code>?</p>","243225","","","","","2010-03-20 16:45:27","Pause and resume thread drawing to SurfaceView","<java><android><multithreading>","2","1","3","",""
"2483382","1","2483468","","2010-03-20 14:29:12","2","355","<p>So I have a very simple android activity that starts a timer when you hit a button. </p><p><code>Timer timer = new Timer();<br>timer.schedule(new TimerTask() {<br>    @Override<br>    public void run() {<br>        doStuff();<br>   }<br>}, 15 * 60 * 1000);</code></p><p>So this worked reasonably well for me when I was testing but as it turns out when the screen becomes inactive so does the timer.  I was a bit surprised by this.  I understand you need to create a service to have anything running in the background but I hadn't realized this is required for an activity in the foreground when the phone has inactivated the screen due to lack of activity. What confuses me is I think this worked as I expected originally and just in the last few weeks or so has the timer been affected by the phone saving power.  I could be wrong though..</p><p>So basically my questions are: am I seeing expected behavior?  Do I need to create all timers as services or somehow disallow powersaving?</p><p>thanks for any advice,Patrick</p>","274370","","","","","2010-03-20 14:55:24","Timer appears to be pausing when screen becomes inactive","<android>","1","0","","",""
"2483631","1","","","2010-03-20 15:39:14","2","2953","<p>I want to make a custom build of Android for a custom application. Is there a guide somewhere? Anybody have any tips?</p>","298060","","1101070","","2012-03-03 15:56:35","2012-03-03 15:56:35","Custom Android build how-to","<android><build-process><build><source>","2","2","1","",""
"2483683","1","2483698","","2010-03-20 15:53:20","5","632","<p>Do any libraries or other development resources exist that can help reduce the effort involved in porting applications between various mobile platforms?  In particular, I am interested in supporting iPhone, Android, and Windows Phone 7.  Some areas of concern include UI, client-server communication, and hardware support (e.g., camera, GPS, etc).</p>","3126","","3126","","2011-02-07 22:13:32","2011-02-07 22:13:32","Portability among mobile platforms","<iphone><android><windows-phone-7><portability>","5","0","","",""
"2483732","1","2484382","","2010-03-20 16:04:57","8","47954","<p>So I copied this tutorial example thing right from Google's android site and I ma getting an error that R.id cannot be resolved. </p><p>Here is my Java file</p><pre><code>package com.TestApp.HelloWebView;import android.app.Activity;import android.os.Bundle;import android.webkit.WebView;public class HelloWebView extends Activity {    WebView mWebView;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mWebView = (WebView) findViewById(R.id.webview);        mWebView.getSettings().setJavaScriptEnabled(true);        mWebView.loadUrl(""http://www.google.com"");    }}</code></pre><p>Here is my <code>res/layout/main.xml</code></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;WebView android:id=""@+id/webview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""/&gt;</code></pre>","294703","","14122","","2010-03-20 16:13:18","2013-01-11 19:32:19","R.id cannot be resolved","<java><android><eclipse>","17","0","2","2013-02-18 15:02:52",""
"2483848","1","","","2010-03-20 16:44:03","2","1200","<p>I recently upgraded my Android app to support multiple resolutions.  Previously, my Android.manifest file had a line:</p><p></p><p>To support multiple density and resolution devices, I changed this to:</p><pre><code>&lt;supports-screens android:smallScreens=""false"" android:normalScreens=""true"" android:largeScreens=""true"" android:anyDensity=""true""/&gt;&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""4"" /&gt;</code></pre><p>I then added a couple of new directories, like drawable-hdpi-v4 and drawable-long-hdpi-v4 that includes the high-res versions of the graphics.  That's about it.</p><p>Ever since releasing this update, there have been a decent number of users complaining about various problems:  </p><ul><li>the app icon doesn't appear  (I did not create a high res version of the icon)  </li><li><p>the home screen widget no longer works, even if they delete and re-add it (this code did not change with the update).  I've had a user send me their error log, which shows:</p><p><code>03-19 20:59:41.617 W/ActivityManager( 1854): Unable to launch app com.alt12.babybump/10078 for broadcast Intent { action=android.appwidget.action.APPWIDGET_UPDATE flags=0x4 comp={com.alt12.babybump/com.alt12.babybump.WidgetGirl} (has extras) }: process is bad</code></p></li></ul><p>There is one questionable section in my existing widget code that may be relevant:</p><pre><code>@Override public void onReceive(Context context, Intent intent) {  // v1.5 fix that doesn't call onDelete Action  final String action = intent.getAction();  if (AppWidgetManager.ACTION_APPWIDGET_DELETED.equals(action)) {   final int appWidgetId = intent.getExtras().getInt(     AppWidgetManager.EXTRA_APPWIDGET_ID,     AppWidgetManager.INVALID_APPWIDGET_ID);   if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) {    this.onDeleted(context, new int[] { appWidgetId });   }  } else {   super.onReceive(context, intent);  } }</code></pre><p>And perhaps most troublesome: <code>the sqlite database is no longer accessible/writeable for some users so their data is no longer available</code>.  I did add the <code>WRITE_EXTERNAL_STORAGE</code> permission to the manifest.  This is only happening to certain users and it tends to be HTC Eris users.  In that error log I see things such as:</p><pre><code>03-19 16:00:56.173 E/FlurryAgent( 4791): java.io.FileNotFoundException: /data/data/com.alt12.babybump/files/.flurryagent.-2333f5cb03-19 16:00:56.173 E/FlurryAgent( 4791): at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:231)03-19 16:01:09.393 E/Database( 4791): sqlite3_open_v2(""/data/data/com.alt12.babybump/databases/uitematmamad.db"", &amp;handle, 6, NULL) failed03-19 16:01:09.393 W/System.err( 4791): android.database.sqlite.SQLiteException: unable to open database file</code></pre><p>It's as if the update has caused a new process and it can't access the old process's data, or something.</p><p>Any help appreciated!  </p>","298080","","243782","","2010-03-20 19:27:01","2010-04-10 12:23:50","Android: manifest targetSdkVersion change resulted in: icon not visible, widget no longer works, and cannot access data","<android><android-widget><android-manifest>","1","0","","",""
"2483879","1","","","2010-03-20 16:53:14","2","3646","<p>Is there an example Hello Sound project for Android that will show how to create beep sounds of a variable tone and duration?</p>","298084","","","","","2013-09-05 04:48:24","Android sound starter project for Eclipse","<android><audio><beep>","2","0","","",""
"2484079","1","2484301","","2010-03-20 17:51:40","44","14310","<p>I'm performance tuning interactive games in Java for the Android platform.  Once in a while there is a hiccup in drawing and interaction for garbage collection.  Usually it's less than one tenth of a second, but sometimes it can be as large as 200ms on very slow devices.</p><p>I am using the ddms profiler (part of the Android SDK) to search out where my memory allocations come from and excise them from my inner drawing and logic loops.  </p><p>The worst offender had been short loops done like,</p><pre><code>for(GameObject gob : interactiveObjects)    gob.onDraw(canvas);</code></pre><p>where every single time the loop was executed there was an <code>iterator</code> allocated.  I'm using arrays (<code>ArrayList</code>) for my objects now.  If I ever want trees or hashes in an inner loop I know that I need to be careful or even reimplement them instead of using the Java Collections framework since I can't afford the extra garbage collection.  That may come up when I'm looking at priority queues.</p><p>I also have trouble where I want to display scores and progress using <code>Canvas.drawText</code>.  This is bad,</p><pre><code>canvas.drawText(""Your score is: "" + Score.points, x, y, paint);</code></pre><p>because <code>Strings</code>, <code>char</code> arrays and <code>StringBuffers</code> will be allocated all over to make it work.  If you have a few text display items and run the frame 60 times a second that begins to add up and will increase your garbage collection hiccups.  I think the best choice here is to keep <code>char[]</code> arrays and decode your <code>int</code> or <code>double</code> manually into it and concatenate strings onto the beginning and end.  I'd like to hear if there's something cleaner.</p><p>I know there must be others out there dealing with this.  How do you handle it and what are the pitfalls and best practices you've discovered to run interactively on Java or Android?  These gc issues are enough to make me miss manual memory management, but not very much.</p>","8959","","310574","","2010-03-20 18:08:23","2013-12-15 08:27:18","How can I avoid garbage collection delays in Java games? (Best Practices)","<java><android><garbage-collection><performance>","6","4","29","2013-07-10 05:06:26",""
"2484092","1","2484172","","2010-03-20 17:55:08","1","2622","<p>I currently have implemented an overlayitem that shows an icon for geopoint on a map application in Android. When the icon is clicked, it brings up an AlertDialog from the onTap method below. I have the following questions:</p><ol><li>Does anyone know how to display a map message bubble directly above the icon overlayitem with 2 callout buttons one to the left of the title and one to the right of the bubble?</li><li>Does anyone know how to make the overlayitem draggable so I can press and hold it and drag it across the map. I am trying to duplicate the draggable icon behavior that's available on the iPhone.</li></ol><p>If so, please share some sample code. Thanks</p><p>protected boolean onTap(int index) {<br>        OverlayItem item = mOverlays.get(index);<br>        AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);<br>        dialog.setTitle(item.getTitle());<br>        dialog.setMessage(item.getSnippet());         dialog.show();<br>        return true;    }</p>","157785","","","","","2010-08-27 09:48:09","Does anyone know how to create a message bubble with 2 buttons appears on top of an overlayitem for map application using android 2.1?","<android><google-maps><button><overlay><overlayitem>","1","0","","",""
"2484286","1","2484627","","2010-03-20 18:51:24","0","966","<p>Hi   I have an aidl file defined as follows:</p><pre><code>package com.erbedo.callalert;interface RemoteCallAlert {    void notifyCallEnded();}</code></pre><p>The service is:</p><pre><code>package com.erbedo.callalert;public class CallAlert extends Service {    Filter callListener;    private final RemoteCallAlert.Stub mBinder = new RemoteCallAlert.Stub() {        @Override        public void notifyCallEnded() throws RemoteException {                  // TODO        }        };    @Override    public IBinder onBind(Intent intent) {        return mBinder;    }    @Override    public void onCreate() {        super.onCreate();        Toast.makeText(this, ""CallAlert Created"", Toast.LENGTH_LONG).show();    }    @Override    public void onDestroy() {        super.onDestroy();        Toast.makeText(this, ""CallAlert Destroyed"", Toast.LENGTH_LONG).show();    }    @Override    public void onStart(Intent intent, int startId) {        super.onStart(intent, startId);        Toast.makeText(this, ""CallAlert Started"", Toast.LENGTH_LONG).show();        callListener = new Filter();        TelephonyManager tm =             (TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);        tm.listen(this.callListener, PhoneStateListener.LISTEN_CALL_STATE);    }    public void callEnded() {          // TODO    }}</code></pre><p>and the Activity that has to bind to the service is:package com.erbedo.callalert;</p><pre><code>public class DummyStart extends Activity {    Filter callListener;    RemoteCallAlert mService;    private ServiceConnection mConnection = new ServiceConnection() {        public void onServiceConnected(ComponentName className,                IBinder service) {            Log.d(""CONNECT"",""OK"");        }        public void onServiceDisconnected(ComponentName className) {        }    };    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        LinearLayout l = new LinearLayout(this);        setContentView(l);        this.startService(new Intent(this, CallAlert.class));    }   }</code></pre><p>The onServiceConnected isn't called. Am I missing something obvious?</p>","295525","","","","","2012-01-18 05:19:24","Can't bind to Service","<android><service><aidl>","3","0","1","",""
"2484386","1","","","2010-03-20 19:23:32","1","264","<p>Whenever I try to press a radio button on my emulator, it just force closes!</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button b = (Button)this.findViewById(R.id.btn_confirm);        b.setOnClickListener(this);        RadioButton radio_ctf = (RadioButton) findViewById(R.id.radio_ctf);        RadioButton radio_ftc = (RadioButton) findViewById(R.id.radio_ftc);        radio_ctf.setOnClickListener(this);        radio_ftc.setOnClickListener(this);    }    @Override    public void onClick(View v)    {     TextView tv = (TextView)this.findViewById(R.id.tv_result);     EditText et = (EditText)this.findViewById(R.id.et_name);     RadioButton radio_ctf = (RadioButton) findViewById(R.id.radio_ctf);        RadioButton radio_ftc = (RadioButton) findViewById(R.id.radio_ftc);     double y = 0;     int x = Integer.parseInt(et.getText().toString());     if(radio_ctf.isChecked())     {      y = ((double)x * 1.8) + 32;     }     if(radio_ftc.isChecked())     {      y = ((double)x - 32) * 0.555;     }     String text = ""Result:"" + y;     tv.setText(text);</code></pre>","298131","","243782","","2010-03-20 19:30:23","2010-03-21 12:25:11","Force close on clicking on radio button","<android><android-emulator>","2","1","","",""
"2484718","1","2485035","","2010-03-20 20:47:23","0","146","<p>I am looking for an example of <a href=""http://d.android.com/reference/android/provider/ContactsContract.DataColumnsWithJoins.html"" rel=""nofollow"">DataColumnsWithJoins</a> usage? Do you know any?</p>","243782","","","","","2010-03-20 22:31:41","I am looking for an example of DataColumnsWithJoins usage?","<android>","1","0","","2014-03-25 07:46:02",""
"2485141","1","2485167","","2010-03-20 23:04:31","7","25466","<p>I trying to put together an Android app that will take a picture and process it in some way.  I'd like the layout to be similar to Google Goggles.  Meaning, camera preview on the top, and some controls on the bottom using portrait orientation.</p><p>I've built a first version using code sample from <a href=""http://www.androidph.com/2008/11/camera-capture.html"">here</a>.  This works, but I want to add a button on the bottom.</p><p>I've modified my main.xml to look as follows (based on comments from this post):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""                android:layout_width=""fill_parent""                 android:layout_height=""fill_parent"" &gt;      &lt;android.view.SurfaceView android:id=""@+id/preview""                              android:layout_width=""fill_parent""                              android:layout_height=""fill_parent""                              android:layout_alignParentTop=""true"" /&gt;    &lt;Button android:id=""@+id/snap""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:text=""Snap""            android:layout_alignParentBottom=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>But when I run this code I get the following exception:</p><pre><code>E/AndroidRuntime(  199): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(  199): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.beerometer/com.beerometer.ImageCapture}: android.view.InflateException: Binary XML file line #6: Error inflating class Android.view.SurfaceViewE/AndroidRuntime(  199):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)E/AndroidRuntime(  199):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)E/AndroidRuntime(  199):    at android.app.ActivityThread.access$2200(ActivityThread.java:119)E/AndroidRuntime(  199):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)E/AndroidRuntime(  199):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  199):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  199):    at android.app.ActivityThread.main(ActivityThread.java:4363)E/AndroidRuntime(  199):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  199):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  199):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime(  199):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime(  199):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  199): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class Android.view.SurfaceViewE/AndroidRuntime(  199):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)E/AndroidRuntime(  199):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)E/AndroidRuntime(  199):    at android.view.LayoutInflater.inflate(LayoutInflater.java:407)E/AndroidRuntime(  199):    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)E/AndroidRuntime(  199):    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)E/AndroidRuntime(  199):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)E/AndroidRuntime(  199):    at android.app.Activity.setContentView(Activity.java:1622)E/AndroidRuntime(  199):    at com.beerometer.ImageCapture.onCreate(ImageCapture.java:37)E/AndroidRuntime(  199):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)E/AndroidRuntime(  199):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)E/AndroidRuntime(  199):    ... 11 moreE/AndroidRuntime(  199): Caused by: java.lang.ClassNotFoundException: Android.view.SurfaceView in loader dalvik.system.PathClassLoader@44bfc7b0E/AndroidRuntime(  199):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)E/AndroidRuntime(  199):    at java.lang.ClassLoader.loadClass(ClassLoader.java:573)E/AndroidRuntime(  199):    at java.lang.ClassLoader.loadClass(ClassLoader.java:532)E/AndroidRuntime(  199):    at android.view.LayoutInflater.createView(LayoutInflater.java:466)E/AndroidRuntime(  199):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)E/AndroidRuntime(  199):    ... 20 more</code></pre><p>When I replace the SurfaceView above with something else, e.g. a TextView, that it displays, but in landscape.</p><p>How can I get a camera preview on part of the screen using portrait view?</p><p>Thanks</p>","9435","","9435","","2010-03-21 18:35:22","2011-10-22 19:08:13","Using android.view.SurfaceView with a camera on part of the screen","<android><camera>","3","0","6","",""
"2485229","1","","","2010-03-20 23:48:21","2","2035","<p>I've run this on a device and on the emulator. The app stops unexpectedly on both.</p><p>I have not a clue what is wrong currently.</p><p>It uses Google API Maps I compiled with Google Api 7.</p><p>I followed this tutorial <a href=""http://developer.android.com/guide/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/views/hello-mapview.html</a>(made some alterations clearly)</p><p>I did use the correct API Key That the final apk is signed with</p><p><a href=""http://poppoob.com/uploads/0627b940de.zip"" rel=""nofollow"">This is the source</a>(If you compile it shouldn't work as it is unsigned)</p><p><a href=""http://poppoob.com/uploads/f69c29d9d3.apk"" rel=""nofollow"">This is the compiled signed apk</a></p><p>Log</p><pre><code>03-21 00:30:38.912: INFO/ActivityManager(54): Starting activity: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.chris.stryker.worldly/.com.poppoob.WorldlyMap }03-21 00:30:39.173: INFO/ActivityManager(54): Start proc com.chris.stryker.worldly for activity com.chris.stryker.worldly/.com.poppoob.WorldlyMap: pid=287 uid=10031 gids={3003, 1015}03-21 00:30:39.532: DEBUG/ddm-heap(287): Got feature list request03-21 00:30:40.185: WARN/dalvikvm(287): Unable to resolve superclass of Lcom/chris/stryker/worldly/com/poppoob/WorldlyMap; (17)03-21 00:30:40.193: WARN/dalvikvm(287): Link of class 'Lcom/chris/stryker/worldly/com/poppoob/WorldlyMap;' failed03-21 00:30:40.205: DEBUG/AndroidRuntime(287): Shutting down VM03-21 00:30:40.223: WARN/dalvikvm(287): threadid=3: thread exiting with uncaught exception (group=0x4001b188)03-21 00:30:40.223: ERROR/AndroidRuntime(287): Uncaught handler: thread main exiting due to uncaught exception03-21 00:30:40.252: ERROR/AndroidRuntime(287): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.chris.stryker.worldly/com.chris.stryker.worldly.com.poppoob.WorldlyMap}: java.lang.ClassNotFoundException: com.chris.stryker.worldly.com.poppoob.WorldlyMap in loader dalvik.system.PathClassLoader@45a1393803-21 00:30:40.252: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at android.os.Handler.dispatchMessage(Handler.java:99)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at android.os.Looper.loop(Looper.java:123)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.main(ActivityThread.java:4363)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at java.lang.reflect.Method.invokeNative(Native Method)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at java.lang.reflect.Method.invoke(Method.java:521)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at dalvik.system.NativeStart.main(Native Method)03-21 00:30:40.252: ERROR/AndroidRuntime(287): Caused by: java.lang.ClassNotFoundException: com.chris.stryker.worldly.com.poppoob.WorldlyMap in loader dalvik.system.PathClassLoader@45a1393803-21 00:30:40.252: ERROR/AndroidRuntime(287):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)03-21 00:30:40.252: ERROR/AndroidRuntime(287):     ... 11 more03-21 00:30:40.300: INFO/Process(54): Sending signal. PID: 287 SIG: 303-21 00:30:40.312: INFO/dalvikvm(287): threadid=7: reacting to signal 303-21 00:30:40.396: INFO/dalvikvm(287): Wrote stack trace to '/data/anr/traces.txt'03-21 00:30:49.002: WARN/ActivityManager(54): Launch timeout has expired, giving up wake lock!03-21 00:30:49.685: WARN/ActivityManager(54): Activity idle timeout for HistoryRecord{458ab6d0 com.chris.stryker.worldly/.com.poppoob.WorldlyMap}</code></pre>","106697","","15168","","2010-03-21 06:06:44","2010-06-17 14:36:24","Application stopped unexpectedly at launch","<android><overlay><google-maps><itemizedoverlay>","2","2","","",""
"2485394","1","","","2010-03-21 00:55:10","-1","1572","<p>could anyone point me to some examples on how to achieve Tableview with section and Index on Section, <a href=""http://www.iphonesdkarticles.com/2009/01/uitableview-indexed-table-view.html"" rel=""nofollow"">similar to how it's done on the iPhone</a></p>","298231","","1101070","","2012-03-06 01:31:32","2013-03-25 13:35:19","TableView with section & Index","<android>","1","1","","",""
"2485697","1","3210469","","2010-03-21 02:47:59","14","23019","<p>I've been playing around with Android development and one of the things I'd like to be able to do is dynamically create a background image for my windows, similar to the one below.</p><p><img src=""http://i43.tinypic.com/2s1acrb.png"" alt=""alt text""></p><p>This is from my BlackBerry app. It consists of three separate parts, the bottom right logo, the top left watermark, and the bottom right name. It works independent of screen size because the BlackBerry app just gets all three parts and generates an appropriately sized bitmap using the screen width and height.</p><p>Since Android has quite a bit more screen resolution possibilities I need to be able to generate backgrounds on the fly like this. However, I have not found any way to get the height/width of the window in Android. I can get the screen resolution, but that includes the application title bar and the notification bar, which is unacceptable.</p><p>I'd like to know how to get the size of my window, or screen resolution minus the title and notification bars. I think this might be possible using the dimensions of my layout managers but I cannot get the height/width of them in the onCreate method so I'm not sure what to do exactly.</p><p>Thanks.</p>","143987","","143987","","2010-03-21 02:59:32","2011-08-02 05:26:08","Getting the size of the window WITHOUT title/notification bars","<android><gui>","5","1","3","","2010-03-21 02:59:32"
"2485865","1","2486903","","2010-03-21 03:56:18","1","120","<p>I posted a question yesterday about determining when an app is being finalized vs destroyed for screen orientation change. Thanks to the answers I received I was able to resolve my problem with the screen orientation change. However, I am still running into a roadblock.This app I am working on logs into a website with an HttpClient. As long as the app remains in memory the HttpClient will retain the cookies from logging in. However, once it is killed, it would need to log in again.My question: How can I determine when the app is being killed from memory so I can set a boolean to false telling the app it has been removed from memory so the next time it starts it will read this and determine is must log in again? Or is it possible to serialize an HttpClient and put that in the savedInstanceState bundle? May extract the cookies from the client and put those in the savedInstanceState bundle? Is there something I'm completely missing here maybe?Any help or a point in the right direction is greatly appreciated because this one has me stumped. Thank you!</p>","298280","","","","","2010-03-21 11:38:55","Android: Determine when app is being finalized","<android>","1","0","","",""
"2486023","1","2486086","","2010-03-21 05:10:04","6","343","<p>I am working on a site that must be designed with mobile accessibility in mind.  As part of our brainstorming, we wondered whether it's possible to detect, for a mobile browser (i.e. Mobile Safari or the Android browser), when the viewing device has changed orientation, and to use that as a trigger to change page content?  As the title of this question implies, our best-case scenario is the ability to detect the orientation change and use it to alter the CSS on the fly so as to present a slightly different page for landscape versus portrait.  </p><p>Of course we can just design for a page that looks good one way and make it obvious that it's supposed to be viewed that way, but the cool-stuff factor of a page that looks good either way is pretty appealing.  </p><p>Is this idea implementable?  Practical?</p>","244494","","","","","2010-11-03 17:14:48","Is It Possible To Use Javascript/CSS To Swap Style Sheets When A Mobile Device Rotates?","<javascript><iphone><css><android>","3","0","1","",""
"2486113","1","2530736","","2010-03-21 05:55:52","2","1466","<p>Is there a trick to making 9patch images with single pixel borders? </p><p>I'm not talking about the single pixel black borders that you use to define the stretchable and content areas.  I'm talking about the image itself.  If I create an image that has a 1 pixel border around it, often times android will pick one of the edges and stretch it to 2 (or sometimes more) pixels, even though I specifically left the edges out of the stretchable area in the draw9patch utility.</p><p>Here is a screenshot of what I mean; in this screenshot I've got two buttons in a vertical LinearLayout with the same background image.  The top button obviously has a thicker border, though it shouldn't.</p><p><a href=""http://www.vimtips.org/media/button_ss.png"" rel=""nofollow"">http://www.vimtips.org/media/button_ss.png</a></p><p>Here is a closeup of the screenshot button (on the left) and the actual 9patch image (on the right).</p><p><a href=""http://vimtips.org/media/images/buttoncmp.png"" rel=""nofollow"">http://vimtips.org/media/images/buttoncmp.png</a></p><p>Buttons are not the only place I've seen this.  If I create a background image with a 1 pixel border and use it as the background for ListView rows, sometimes the border appears to be 2pixels instead of just 1.</p><p>It's hard to get a UI to look exactly how you want it with these problems.  There's got to be a way to get it to appear how you think it should.</p>","238849","","238849","","2010-03-25 20:31:41","2010-03-27 20:01:56","9patch border issues","<android>","1","2","3","",""
"2486416","1","2486908","","2010-03-21 08:29:23","2","3606","<p>I am trying to install Eclipse Galileo on my MacBook running OS X v10.6 (Snow Leopard) and set it up with ADT plugin. I downloaded 64-bit cocoa version of ""Eclipse Galileo for Java EE developers"" and ADT v0.9.6 from the respective offical sites. When I try to add this new plugin-archive in Eclipse, I get the following error:  </p><blockquote>  <p>Cannot complete the install because  one or more required items could not  be found ....missing requirement: ADT  requires 'org.eclipse.wst.sse.core  0.0.0' but it could not be found.</p></blockquote><p>AFAIK, one gets this error when a required Eclipse-plugin is missing. I checked the official site and saw that wst-plugin is actually bundled with ""Eclipse for Java EE developers"" download package <a href=""http://www.eclipse.org/downloads/moreinfo/compare.php"" rel=""nofollow"">compare Eclipse packages</a>. Not sure what I am missing here.  </p><p>EDIT: My mac is not connected to the internet so I guess adding resource URLs to the ""Available Software sites"" section wouldn't help. I would have to download anything required on my PC and then copy it onto my mac</p>","236128","","472792","","2013-05-25 15:18:17","2013-05-25 15:18:17","Installing Eclipse and setting up Android ADT on OS X v10.6 Snow Leopard","<android><eclipse><osx><eclipse-plugin><adt>","1","0","1","",""
"2486547","1","2486665","","2010-03-21 09:32:56","9","9946","<p>I would like to add details to the incoming call screen on android.lets say I have a string 'x', so I want 'x' to show up on the incoming call screen under the name of the person who is currently calling.</p><p>I know this is possible because of these apps:<a href=""http://www.youtube.com/watch?v=LaRrJoqcVU4"">CallerId</a>,<a href=""http://android.vringo.com/"">Vringo</a> </p><p>I'm pretty new to this area, so I need to know what is the process to achieve that, for example: get the event of incoming call, go to the incoming call interface and so on.</p><p>Thanks!</p>","178016","","178016","","2010-03-21 13:42:10","2013-11-05 20:20:21","android incoming call screen","<android>","2","0","8","",""
"2486692","1","2487150","","2010-03-21 10:26:32","12","14750","<p>I have a particular situation:a service started by a broadcast receiver starts an activity. I want to make it possible for this activity to communicate back to the service. I have chosen to use AIDL to make it possible. Everything seems works good except for <code>bindService()</code> method called in <code>onCreate()</code> of the activity. bindService(), in fact, throws a null pointer exception because <code>onServiceConnected()</code> is never called while <code>onBind()</code> method of the service is. Anyway <code>bindService()</code> returns true. The service is obviously active because it starts the activity.I know that calling an activity from a service could sound strange, but unfortunately this is the only way to have speech recognition in a service.</p><p>Thanks in advance </p>","269585","","","","","2014-02-17 13:07:41","onServiceConnected never called after bindService method","<android><binding><service><speech-recognition>","8","0","2","",""
"2486898","1","2487004","","2010-03-21 11:36:43","2","1760","<p>I have built my interface by using ViewStubs, which I inflate during onCreate.</p><p>But later in my app, I want to change the View completely, by loading different View into the same place. How do I achieve that?</p>","243782","","","","","2010-03-21 12:13:27","How to replace a view after I've inflated?","<android>","1","0","1","",""
"2486934","1","2488427","","2010-03-21 11:51:41","22","18887","<p>After I do some change in my database, that involves significant change in my views, I would like to redraw, re-execute onCreate.  </p><p>How is that possible?</p>","243782","","","","","2013-06-12 18:30:18","Programmatically relaunch/recreate an activity?","<android>","10","0","3","",""
"2486935","1","2486953","","2010-03-21 11:51:50","2","658","<p>When I take pictures using android.hardware.camera and I save them to the following location /sdcard/dcim/camera/ they don't appear when I launch the gallery. Is there a process for getting them to show up in the gallery that I missed?</p><p>I can see my images using a file explorer and know they have been saved.</p>","67605","","","","","2010-03-21 12:40:46","Camera pics not appearing in Gallery app","<android>","1","0","","",""
"2486936","1","2487340","","2010-03-21 11:51:58","67","52649","<p>I am wondering how to add shadow on text in android?</p><p>I have the following code which is applied on a bitmap and I wanted to be shadowed...</p><pre><code>paint.setColor(Color.BLACK);paint.setTextSize(55);paint.setFakeBoldText(false);paint.setShadowLayer(1, 0, 0, Color.BLACK); //This only shadows my whole view...</code></pre><p>Thankful for any tips!</p>","294118","","","","","2013-04-23 23:30:02","Android - shadow on text?","<android>","3","3","40","",""
"2487008","1","","","2010-03-21 12:14:38","5","2282","<p>I'm using a combination of alarm (set with <code>AlarmManager</code>) and background service to periodically synchronize data in my application.</p><p>The only problem I have is that when sleep policy terminates Wi-Fi connection the synchronization no longer works.</p><p>Is there a way to ""wake up"" the Wi-Fi connection that has been put to sleep? GMail somehow manages to do that because it notifies me about new e-mail even if the phone entered sleep mode.</p>","139298","","","","","2012-12-05 04:49:41","Network access when the Android phone is asleep","<android><sleep><wifi>","1","0","1","",""
"2487128","1","2533882","","2010-03-21 13:00:15","0","811","<p>At the moment I am experimenting with SurfaceView for my chess game with animations. I am getting only about 8 FPS in the emulator. I draw a chess board and 32 chess pieces and rotate everything (to see how smooth it is), I am using antialiasing. On the Droid I'm getting about 20FPS, so it's not very smooth. Is it possible to implement a game with very scarce and simple animations without having to use OpenGL?</p><p>This is what I do every frame:</p><pre><code>// scale and rotatematrix.setScale(scale, scale);rotation += 3;matrix.postRotate(rotation, 152, 152);canvas = surfaceHolder.lockCanvas();canvas.setDrawFilter(new PaintFlagsDrawFilter(0, Paint.FILTER_BITMAP_FLAG));canvas.setMatrix(matrix);canvas.drawARGB(255, 255, 255, 255); // fill the canvas with whitefor (int i = 0; i &lt; sprites.size(); i++) {    sprites.get(i).draw(canvas); // draws chessboard and chess pieces}</code></pre>","243225","","243225","","2010-03-21 13:16:25","2010-03-28 17:54:05","Should I use OpenGL for chess with animations?","<java><android><opengl-es><chess><surfaceview>","2","1","2","",""
"2487148","1","2489042","","2010-03-21 13:07:24","3","2430","<p>I'm writing an android application that draws directly to the canvas on the onDraw event of a View.</p><p>I'm drawing something that involves drawing each pixel individually, for this I use something like: </p><pre><code>for (int x = 0; x &lt; xMax; x++) {  for (int y = 0; y &lt; yMax; y++){    MyColour = CalculateMyPoint(x, y);    canvas.drawPoint(x, y, MyColour);  }}</code></pre><p>The problem here is that this takes a long time to paint as the CalculateMyPoint routine is quite an expensive method.</p><p>Is there a more efficient way of painting to the canvas, for example should I draw to a bitmap and then paint the whole bitmap to the canvas on the onDraw event? Or maybe evaluate my colours and fill in an array that the onDraw method can use to paint the canvas?</p><p>Users of my application will be able to change parameters that affect the drawing on the canvas. This is incredibly slow at the moment.</p>","117859","","243782","","2010-03-21 13:32:32","2011-09-19 19:22:03","Drawing to the canvas","<java><android><drawing>","1","5","3","",""
"2487263","1","2487480","","2010-03-21 13:40:22","15","14646","<p>I added some UI elements to the main.xml file in the res\layout folder and when I try to access them through the call, <code>R.layout.my_uielement</code>, the UI element that I created is not there. Even when I add a new xml file with UI elements, it still doesn't show up in the <code>R.layout</code> class. I have made checked the ids on them and they have the correct format (I think): <code>android:id=""@+id/my_button""</code>. What could be the problem? Do I need to compile the code first?<br><b>UPDATE</b>:<br>I have already tried <code>adb kill-server</code> then <code>adb start-server</code>. It doesn't seem to help. I have also tried <code>R.id.my_uielement</code>, it doesn't register either.</p>","200477","","200477","","2010-03-21 14:41:16","2014-02-12 06:23:14","R.java file not updating with UI element's id","<android><adb>","7","4","2","",""
"2487281","1","2487766","","2010-03-21 13:46:38","3","408","<p>I have an application that will accept URLs from the built in web browser via the ""Share page"" menu item. I'm using the send intent and it works just fine. However, I'd like to accept a URL and process it in the background without bringing my application to the front. I don't want the user to have to actually leave the web browser. It will notify the user it has finished processing the URL with a Toast message. I'm just not sure what type of activity should be used for this. </p><p>A good example of this behavior is the ""Read Later"" instapaper application in the android market. Any help would be greatly appreciated.</p>","298447","","","","","2011-06-30 04:41:21","Share Link - Perform action in background","<java><android>","2","0","1","",""
"2487663","1","2487750","","2010-03-21 15:55:18","2","570","<p>I've read through the FAQ of Android Dev Guid <a href=""http://developer.android.com/guide/appendix/faq/commontasks.html#opennewscreen"" rel=""nofollow"">(http://developer.android.com/guide/appendix/faq/commontasks.html#opennewscreen</a>) but I'm not sure how can I open a new screen with additional parameters passed into it. </p><p>Let's say I'm going to open screen2, with a variable indicating the current user name so that I could greet the users. Is it possible?</p><pre><code>Intent i; i = new Intent(this, screen2.class);  //How to pass variable to screen2?startActivity(i); </code></pre>","297469","","","","","2010-03-21 16:19:52","How to open a new screen with additional parameters?","<android>","3","0","","",""
"2487690","1","2535041","","2010-03-21 16:01:52","8","10151","<p>I'm beginning to think that to get a ProgressDialog to work the AsyncTask has to be an inner class within an Activity class.  True? [Edited much later...the answer is False and I'm not sure if this is a bug or what.  I'm using Android 1.5.  I'm going to read up on Services.]</p><p>I have an activity the uses a database to manipulate information.  If the database is populated all is well.  If it is not populated then I need to download information from a website, populate the database, then access the populated database to complete the Views in onCreate.</p><p>Problem is without some means to determine when the AsyncTask thread has finished populating the database, I get the following Force Close error message:  Sorry!  The application has stopped unexpectedly.  I click on the Force Close button, the background AsyncTask thread continues to work, the database gets populated, and everything works ok.</p><p>I need to get rid of that error message and need some help on how to do this.  Here's some psuedo code:</p><pre><code>public class ViewStuff extends Activity{  onCreate  {     if(database is populated)      do_stuff    else    {      FillDB task = null;      if(task == null || task.getStatus().equals(AsyncTask.Status.FINISHED))       {                         task = new FillDB(context);         task.execute(null);       }    }  continue with onCreate using information from database to properly display  } // end onCreate} // end class</code></pre><p>In a separate file:</p><pre><code>public class FillDB extends AsyncTask&lt;Void, Void, Void&gt;{    private Context context;    public FillDB (Context c)  //pass the context in the constructor{    context = c;}    public void filldb ()    {      doInBackground();    }    @Override    protected void onPreExecute()    {                 ProgressDialog progressDialog = new ProgressDialog(context);       //crashes with the following line       progressDialog.show(context, ""Working.."", ""Retrieving info"");    }    @Override    protected Void doInBackground(Void... params)    {  // TODO Auto-generated method stubtry     etc etc etc    } }</code></pre><p>Here's the stack trace from the emulator:</p><pre><code>----- pid 846 at 2010-03-21 19:58:25 -----Cmd line: com.trialDALVIK THREADS:""main"" prio=5 tid=3 NATIVE | group=""main"" sCount=1 dsCount=0 s=0 obj=0x40018e70 | sysTid=846 nice=0 sched=0/0 handle=-1098855268 at android.os.BinderProxy.transact(Native Method) at      android.app.ActivityManagerProxy.handleApplicationError(ActivityManagerNative.java:2103) at com.android.internal.os.RuntimeInit.crash(RuntimeInit.java:302) at   com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:75) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:887) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:884) at dalvik.system.NativeStart.main(Native Method) ""Binder Thread #3"" prio=5 tid=15 NATIVE | group=""main"" sCount=1 dsCount=0 s=0 obj=0x43733d88 | sysTid=852 nice=0 sched=0/0 handle=1486928 at dalvik.system.NativeStart.run(Native Method)""Binder Thread #2"" prio=5 tid=13 NATIVE | group=""main"" sCount=1 dsCount=0 s=0 obj=0x437313c8 | sysTid=851 nice=0 sched=0/0 handle=1492472 at dalvik.system.NativeStart.run(Native Method)""Binder Thread #1"" prio=5 tid=11 NATIVE | group=""main"" sCount=1 dsCount=0 s=0 obj=0x4372b9b0 | sysTid=850 nice=0 sched=0/0 handle=1492664 at dalvik.system.NativeStart.run(Native Method)""JDWP"" daemon prio=5 tid=9 VMWAIT | group=""system"" sCount=1 dsCount=0 s=0 obj=0x4372a2a0 | sysTid=849 nice=0 sched=0/0 handle=1490176 at dalvik.system.NativeStart.run(Native Method)""Signal Catcher"" daemon prio=5 tid=7 RUNNABLE| group=""system"" sCount=0 dsCount=0 s=0 obj=0x4372a1e8| sysTid=848 nice=0 sched=0/0 handle=1487888 at dalvik.system.NativeStart.run(Native Method)""HeapWorker"" daemon prio=5 tid=5 VMWAIT | group=""system"" sCount=1 dsCount=0 s=0 obj=0x427d03c0 | sysTid=847 nice=0 sched=0/0 handle=1487592 at dalvik.system.NativeStart.run(Native Method) ----- end 846 -----</code></pre><p>What am I doing wrong?</p><p>Mr. Snowflake,</p><p>Tried:</p><pre><code>@Overrideprotected void onPreExecute(){Activity.this.runOnUiThread(new Runnable() {      public void run() {        ProgressDialog progressDialog = new ProgressDialog(context);        //crashes with the following line        progressDialog.show(context, ""Working.."", ""Retrieving info"");      }    });}</code></pre><p>Activity.this is flagged as an error:No enclosing instance of the type Activity is accessible in scope</p><p>I am thinking I need to FillDB extends Activity then create a private class within FillDB extending AsyncTask?  That wont' work.  No assurance when the FillDB activity will start and can't use startActivityForResult since no result is returned from AsyncTask when it is completed.</p><p>Update:  Tried creating a private class in the calling class.  Still can't show a ProgressDialog.  One of the errors is:  Unable to add window -- token null is not for an application.  I have no idea what token is being referred to.</p>","278350","","278350","","2010-03-21 22:38:48","2013-04-25 14:54:10","ProgressDialog not working in external AsyncTask","<android><android-asynctask>","4","5","1","",""
"2487710","1","2493186","","2010-03-21 16:05:45","6","4420","<p>How do I use gl.gluUnproject in my OpenGL ES 1.1 android app to determine what is selected when the user touches the screen?</p><p>My understanding is that the touch event results in a line and I have to find the first ""thing"" it intersects with.</p><p>Are there any tutorials on how to do this?</p>","128991","","","","","2012-04-26 12:17:29","How do I determine what is touched in 3D space from the screen?","<android><opengl-es>","4","0","5","",""
"2487816","1","2488031","","2010-03-21 16:38:58","0","808","<p>In my activity I respond to an onClick() by replacing the current view with a new one (setContentView()). For some reason when I do this and then go back to the original view later the button I originally pressed still looks like it is pressed.</p><p>If you 'refresh' it somehow (e.g. scroll over it with the trackball) then it reverts to the unpressed state. It's as if the button doesn't get the 'touch-up' event.</p><p>The weird thing is: This only happens on my T-Mobile Pulse (android 1.5). It doesn't happen on the emulator. </p><p>I've tried calling invalidate()/postInvalidate() on the view when I show it but it doesn't have any effect.</p>","265521","","","","","2010-07-16 20:54:37","Why do my buttons stay pressed?","<android><graphics><button><state>","2","1","","",""
"2487821","1","2487903","","2010-03-21 16:40:41","4","1708","<p>I have a ListView with multiple choice entries where some are checked from the beginning using </p><pre><code>setItemChecked(position, true);</code></pre><p>I combine this with the filtering option</p><pre><code>setTextFilterEnabled(true)</code></pre><p>so it's easy to find a specific entry in the list.</p><p>The problem is that when I filter the list the entries switch position in the list view. Take for example three entries: 'A', 'B' and 'C' where 'C' is checked beforehand (i.e. the entry at position 3 in the list). When I type a 'C' on the keyboard, only the 'C' entry is displayed (as intended). Now 'C' is not checked anymore, since the entry has moved from the checked position 3 to the unchecked position 1 in the list.</p><p>This behavior leads to some not very welcome effects in the app. Is there a way to ""move the selection with the filtering"", i.e. bind the checked state to the entry and not to its initial position in the list? Or do I need to find a new approach?</p><p>Thanks,</p><p>Linus</p>","91098","","","","","2011-12-21 10:29:37","Wrong item checked when filtering ListView in android","<android><listview><checkbox><filtering>","2","3","0","",""
"2488506","1","2488618","","2010-03-21 20:02:49","0","3424","<p>I have a reciever that works well, but I can't seem to show a proper UI, although the toast appears correctly. As far as I can tell, this is caused by Android requiring the class to extend Activity, however, the class already extends BroadcastReciever, so I can't do this.So, I tried to do an Intent, but this failed too. There are no errors, but the screen doesn't show. Source code is below, and any help would be most appreciated.</p><p><em>Broadcast (Method in AndyRoidAlarm)</em></p><pre><code>public void setAlarm(){    Intent intent = new Intent(AndyRoidAlarm.this, Reciever.class);    PendingIntent sender = PendingIntent.getBroadcast(AndyRoidAlarm.this,                0, intent, 0);    // We want the alarm to go off 30 seconds from now.    Calendar calendar = Calendar.getInstance();    calendar.setTimeInMillis(System.currentTimeMillis());    calendar.add(Calendar.SECOND, 10);    // Schedule the alarm!    AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);    am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);    // Tell the user about what we did.    if (mToast != null) {        mToast.cancel();    }    mToast = Toast.makeText(AndyRoidAlarm.this, ""Alarm Scheduled for 30secs"", Toast.LENGTH_LONG);    mToast.show();}</code></pre><p><em>Reciever</em></p><pre><code>public class Reciever extends BroadcastReceiver{    @Override    public void onReceive(Context context, Intent intent)    {        Toast.makeText(context, ""Alarm Recieved"", Toast.LENGTH_LONG).show();        Intent i = new Intent();        i.setClass(context, AlarmRing.class);    }}</code></pre><p><em>Reciever V2</em></p><pre><code>@Override    public void onReceive(Context context, Intent intent)    {        Toast.makeText(context, ""Alarm Recieved"", Toast.LENGTH_LONG).show();        Intent foo = new Intent(context, AlarmRing.class);        //foo.putExtra(""id"", ""id"");//example, if you wish to pass custom variables        context.startActivity(foo);    }</code></pre><p><em>AlarmRing</em></p><pre><code>public class AlarmRing extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.alarm);        MediaPlayer mp = MediaPlayer.create(getBaseContext(), R.raw.sweetchild);        mp.start();    }</code></pre><p><em>Manifest</em></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.comaad.andyroidalarm""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".AndyRoidAlarm""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                   &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;receiver android:name=""com.comaad.andyroidalarm.Reciever"" android:enabled=""true""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""com.comaad.andyroidalarm.Reciever""&gt;&lt;/action&gt;            &lt;/intent-filter&gt;        &lt;/receiver&gt;        &lt;activity android:name="".AlarmRing""&gt;&lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt; }</code></pre>","298272","","298272","","2010-03-21 22:59:34","2010-04-28 12:32:54","Get from Android BroadcastReciever to a UI","<java><android><broadcastreceiver>","2","0","1","",""
"2488636","1","2488680","","2010-03-21 20:44:27","0","172","<p>I show to user a list of categories, he must choose one.<br>How to force the user to choose before pressing back?  </p>","243782","","","","","2010-04-12 08:26:48","How to force the user to complete a task before pressing back?","<android>","4","0","","",""
"2488668","1","2496242","","2010-03-21 20:55:03","1","375","<p>I published several free and paid app in the Market. I recently getseveral complains from customers about not finding my app in the 2.1Market. Even if they have bought them before, they can't find it inthe market or their download list after updating to 2.1.</p><p>Can anyone tell me what the problem is? My apps only require minimal SDK 3..</p><p>Thanks a lot!!</p><p><strong>Update:</strong>It looks like that they are not shown because they have copy protection enabled. Is this a bug in the Market?</p>","298611","","750613","","2012-06-26 08:57:03","2012-06-26 08:57:39","App not shown in 2.1 Market","<android><google-play>","3","3","","",""
"2488813","1","2488897","","2010-03-21 21:34:55","5","3535","<p>Is there a standard way to do database schema migrations on Android? For example, user installs newer version of my Android app but the new version needs to make updates to the database schema (and wiping the user's database and starting over is not an option!). So I need to run some ALTER statements and/or copy tables the first time my new version runs.</p>","246793","","246793","","2010-03-21 21:55:57","2014-02-25 11:15:23","How to do database schema migrations in Android?","<database><android><migration>","6","1","1","",""
"2488830","1","2488918","","2010-03-21 21:39:36","0","958","<p>I am re-using ListPreference for a setting which I store only in the database. How can I prevent it from storing/persisting any data to the preference file?</p>","243782","","963396","","2013-01-04 17:51:08","2013-01-04 17:51:08","How to make a Preference not save to SharedPreferences?","<android><sharedpreferences><android-preferences><preference><listpreference>","2","0","","",""
"2489057","1","2489095","","2010-03-21 22:43:04","1","2747","<p>I get records from the system by quering a ContentResolver. I maintain the order of the items in the database. So I want to display the items in the order taken from my database.</p><p>How do I merge these two informations? </p><p><strong>EDIT 1</strong></p><p>I am looking after an alternative way now. As what I ideally want is:  </p><ul><li>get order of contacts by a custom order held in my database (this involves joining CR with my DB cursor, and doing an order by, later seams it's not possible with CursorJoiner)</li><li>but there is more, if the join is not unique I want to sort by contact's name as last measure</li></ul><p>which is impossible using Cursor and Joiners, because of the missing feature of order bys, also I need to return a Cursor, as I will be using the in an ExpandableList</p><p>Also this translated to TSQL it would look like</p><pre><code>select * from contactsdata left join category on contactsdata.catid=category.idorder by category.pos asc, contact.display_name asc</code></pre><p>So I am looking now after an alternative.<br>I have in mind to load in a temporary DB table all data from CR, then do the query on the temporary table where I can join tables and do order bys? How does this sound to you?</p>","243782","","243782","","2010-03-25 22:56:01","2010-03-25 22:56:01","How to join a ContentResolver Cursor with a Database Cursor?","<android><cursor><android-contentresolver>","1","0","","",""
"2489382","1","2489394","","2010-03-22 00:27:48","2","784","<p>I have two question to put forward:</p><ol><li><p>I was very interested, even intrigued by the Maps application on the android emulator. Where can I get the source code for it? </p></li><li><p>There is a Maps Editor on the Android Market, it cannot be downloaded to the emulator. But again, where can I find the source code to that?</p></li></ol>","298685","","23897","","2010-03-22 00:30:11","2010-03-22 02:37:44","Where can I get source code for apps on the Android emulator?","<android><android-emulator>","1","0","","",""
"2489459","1","2490434","","2010-03-22 01:01:25","0","602","<p>Eclipse is complaining about my Android project saying all my references to resources are unresolved, even though R.java does exist. For example:</p><pre><code>signin_btn=(Button)findViewById(R.id.signin_btn); signin_btn.setOnClickListener(this);</code></pre><p>I definately have signin_btn defined in my resources. Dont know why Eclipse is not seeing my R class anymore. How to fix?</p>","246793","","750613","","2012-06-26 08:53:45","2012-06-26 08:53:45","Why are my resources suddenly unresolved in my Android project?","<android><class><resources><unresolved>","2","1","1","",""
"2489767","1","","","2010-03-22 02:51:49","1","267","<p>I'm porting my native C engine to <code>android 2.1 using NDK r6</code>, but I can't use the commands like: <code>adb root</code> or <code>adb remout</code> to my Nexus one. How should I do to upload my engine (.so file) to Nexus one?</p>","298737","","750613","","2012-06-26 08:50:21","2012-06-26 08:50:21","How do I upload my own library to Nexus one?","<android><android-ndk><nexus-one>","1","2","0","",""
"2489789","1","2490425","","2010-03-22 02:57:44","1","1869","<p>I'm starting an activity when a button is pressed, and normally (in other apps) haven't had an issue.  But when I press the button in this app, I get an ""unable to marshal value"" error.</p><p>Exact(ish) error from LogCat:</p><blockquote>  <p>03-22 02:49:02.883:  WARN/System.err(252):  java.lang.RuntimeException: Parcel:  unable to marshal value  {CLASSNAME}@44dcf1b8</p></blockquote><p>I feel that this might be related to the extra that I'm passing to the intent.  I'm passing an ArrayList as a serializable to this new intent.  My concern is that the data structure that the ArrayList contains isn't being serialized (as it's a personal data structure).</p><p>Is the array list content data structure causing this?  Something else that I'm missing?</p>","231768","","","","","2011-04-25 18:58:31","Error when starting an activity","<android><arraylist><activity><marshalling>","2","0","","",""
"2489869","1","2490559","","2010-03-22 03:21:11","1","423","<p>I have a ListView that is populated using an XML file.  However, I want each item, when clicked, to start a new Activity related to that item.</p><p>I understand how to use OnItemClick to start a Toast that shows the selected item's text.  However, since the ListView is populated from an XML there is not a specific Id for each item in the list.</p><p>So, how would I associate an Activity with each item in the ListView when the items do not have Ids?</p>","","user298749","","","","2010-03-22 07:28:22","Associate an Activity with an item in XML ListViews in Android","<android><listview><android-widget><listviewitem>","1","0","","",""
"2489966","1","","","2010-03-22 04:05:07","0","688","<p>I'm currently developing on minimum sdk version 3 (Android 1.5 - cupcake) and I'm having a strange unexplained issue that I have not been able to solve on my own. It is now becoming a rather urgent issue as I've already missed 1 deadline...</p><p>I'm writing a high-level library to make long term android development easier and quicker. The one specific module has to capture images for a application... I've gotten everything right so far over the last couple months, except this one little thing and I don't know what to do any more:</p><p>When I use the Camera object and implement a SurfaceHolder.Callback, the methods surfaceCreated() and surfaceChanged() are called one after the other. Then when the activity finishes, surfaceDestroyed() is called. This is how it should be, but when I stick the exact same code in my library (plain Java library that references the Android API - not in an activity), surfaceDestroyed() is called directly after created and changed.</p><p>As a result - the camera object is closed before I can use it and the application force closes. What a pain. I can't do anything! This method call is controlled by the device.. Why does the surface close for no reason? Even when I post it to run on the activity thread through my own invokeAndWait(Runnable) method, like I do for many other things.</p><p>I have 5 different working examples of different ways and implementations of capturing images in android but I still get the same issue when I plug it into my library. I don't understand what the difference is. The code is pretty much the same - and I post all the related code to the UI thread so its not a thread handling issue or anything like that. I've rewritten it about 20 times in different ways - same issue every time..</p><p>The only other way to approach it that I know of is creating a new Camera and setting it to the VideoView. The android source (c++ native code) however provides no Camera constructor, only an open() method which automatically forwards the camera's state to 'prepared' but I can only set the camera to the VideoView from the 'initialized' state. Pretty silly, I know, but there is no way around it unless I modify the Android library source code haha. not an option! The API does not allow for this method - you are expected to use it like my first example. </p><p>So essentially - i just need to understand exactly why surfaceDestroyed() is called out of turn and if there is anything I can do to avoid it closing? If i can just understand the exact logic behind it and how it works! The documentation isn't much help! Secondly, if someone knows of any alternative ways to do it, as my second example, but hopefully one which the API actually allows for? haha</p><p>Thanks guys. I would post code, but its fairly complicated, a couple thousand lines for this specific class and it would probably take a couple days to explain with all the threading and event listeners and what not. I just need help with this 1 single thing. Please let me know if you have any questions.</p>","298755","","950427","","2014-02-17 03:24:42","2014-02-17 03:24:42","Android's surfaceDestroyed called out of turn","<android>","0","2","","",""
"2490338","1","2490415","","2010-03-22 06:24:27","0","2103","<p>I am using custom row view in <code>ListView</code> widget.</p><p>I am having <code>getView</code> method in my implementation.</p><p>What I want is that I want to hide divider image of 2nd row how can I do it ?</p>","216431","","1727831","","2013-04-04 11:09:21","2013-04-04 11:09:21","Android Listview ArrayAdapter example","<android><listview><divider>","1","0","","",""
"2490339","1","2490628","","2010-03-22 06:24:51","1","7355","<p>How do I create a transparent textview on click at the bottom of the running screen?</p>","302676","","869912","","2012-08-15 15:27:40","2012-08-15 15:27:40","How do I create a transparent textview on click at the bottom of the running screen?","<android><screen><transparent><textview>","2","2","1","",""
"2490343","1","","","2010-03-22 06:25:44","0","3266","<p>I have Android development eclipse setup on Mac OS X. I recently did Android SDK upgrade from 1.5 to available versions such as 1.6, 2.0.1 and 2.1 and docs. After did upgrade, automatically restarted my Macbook and installed all new versions. After this, when i try to launch ""Windows->Android SDK and AVD Manager"", it doesn't launch at all. What might be the reason? Does anyone has the solution?The reason why i'm trying to launch Android SDK and AVD Manager is, i need to add new Android virtual device(avd) target for 2.0.1 and 2.1 versions, for that i'm trying to launch Android SDK and AVD Manager.</p><p>Thank you in advance.</p>","187532","","750613","","2012-06-26 08:42:39","2012-11-23 21:05:09","Android:Android SDK and AVD Manager doesn't launch after did SDK upgrade?","<android>","6","0","1","",""
"2490630","1","","","2010-03-22 07:51:27","2","2749","<p>We are able to run instrumentation tests of Android from the command line on Windows by launching:  </p><pre><code>adb shell am instrument -w &lt;package.test&gt;/android.test.InstrumentationTestRunner</code></pre><p>This gives us good results. </p><p>Using the same architecture, we are unable to run the same in Kubuntu. We have the same setup in Kubuntu. </p><ol><li>Can someone let us know, if there are packages with same name.. Then what package will the adb shell point?</li><li>How will the emulator connect with adb shell from cmd line?</li><li>DO we need to do any changes to do so in Kubuntu ?</li></ol>","264123","","234938","","2010-03-23 10:20:25","2010-07-11 07:19:45","How to run Android instrumentation tests from the command line (in Kubuntu)?","<android><android-emulator><instrumentation><kubuntu>","1","0","","",""
"2491020","1","","","2010-03-22 09:22:03","0","3723","<p>I am implementing Bluetooth support via implementing a task which searches for devices in the background and provides a list when the search is complete. However, this list occasionally contains a <code>No devices found</code> entry (added only when <code>ACTION_DISCOVERY_FINISHED</code> is received with no devices already in the list) before listing other devices!</p><pre><code>private BroadcastReceiver mBlueToothInfoDiscoveryListener = new BroadcastReceiver() {  /**   * This is an overridden function called by the framework whenever there   * is some broadcast message for Bluetooth info discovery listener   */  @Override  public void onReceive(Context context, Intent intent) {    String action = intent.getAction();    // When discovery finds a device    if (BluetoothDevice.ACTION_FOUND.equals(action)) {      // Get the BluetoothDevice object from the Intent      BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);      // If it's already paired, skip it, because it's been listed      // already      if (device.getBondState() != BluetoothDevice.BOND_BONDED) {        mNewBtDevicesArrayAdapter.add(device.getName() + ""\n"" + device.getAddress());      }    } else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) {      // When discovery is finished, change the Activity title      setProgressBarIndeterminateVisibility(false);      setTitle(""device list"");      if (mNewBtDevicesArrayAdapter.getCount() == 0) {        String noDevices = ""No devices found"";        mNewBtDevicesArrayAdapter.add(noDevices);      }    }  }};</code></pre><p>I don't expect <code>ACTION_DISCOVERY_FINISHED</code> to ever come <em>before</em> a <code>ACTION_FOUND</code> event, so why would the <code>No devices found</code> string be added to the list before a device is located?</p>","297082","","14122","","2010-03-22 10:03:33","2012-06-26 08:42:03","android bluetooth discovery: ACTION_FOUND happening after ACTION_DISCOVERY_FINISHED","<java><android><bluetooth>","1","1","1","",""
"2491144","1","","","2010-03-22 09:49:24","0","2557","<p>On the iPhone, if an option is too long for the area, instead of wrappeing you get a ""..."" at the end of the ""<strong>drop down</strong>"" and the user will know there is more text than is shown.</p><p>I want to recreate this with android but am new to it so cant see how.</p><p>I want the heights of ""<strong>rows</strong>"" in my layout to be uniform hence not able to wrap the text.</p><p>Thanks in advance.</p>","298895","","750613","","2012-06-26 08:45:00","2012-06-26 08:45:00","Truncated string in android spinners","<android><spinner>","4","0","","",""
"2491288","1","","","2010-03-22 10:09:45","-1","1340","<p>If I want to use the opengl interface in android ndk, then will it be possible to show me a simple tutorial to let me master the android ndk?</p><p>I just wanna know how to operate in android ndk first.</p>","165273","","1101070","","2012-03-06 01:07:44","2012-03-06 01:07:44","How do I use the opengl interface in Android ndk","<android><android-ndk>","1","0","","",""
"2491546","1","2491929","","2010-03-22 10:50:12","0","4984","<p>I read about<a href=""http://developer.android.com/intl/fr/reference/android/provider/ContactsContract.CommonDataKinds.GroupMembership.html"" rel=""nofollow"">ContactsContract.CommonDataKinds.GroupMembership</a>, but I can't figure out what URI use to insert to.</p><p>I have prepared this method:</p><pre><code>public static Uri addToGroup(ContentResolver resolver, long personId,            long groupId) {        ContentValues values = new ContentValues();        values.put(ContactsContract.CommonDataKinds.GroupMembership.CONTACT_ID, personId);        values.put(ContactsContract.CommonDataKinds.GroupMembership.GROUP_ROW_ID, groupId);        return resolver.insert(uri, values);//URI is not known    }</code></pre><p>Can someone tell me what URI to use in SDK 2.0+?</p>","243782","","","","","2011-01-02 14:20:58","How do I add contact to a group on Android?","<android><android-sdk-2.1>","1","5","2","",""
"2491851","1","2491903","","2010-03-22 11:40:40","2","6752","<p>How to remove item from a list view? how to reload the list after removal?</p>","298968","","298968","","2010-03-23 10:06:43","2010-03-23 10:06:43","Android List adapter issue","<android><listview>","3","0","2","",""
"2491904","1","2492072","","2010-03-22 11:50:48","0","540","<p>I'm trying to make a notification in Android. But i get the error in the title by using:</p><pre><code>   Notification notif = new Notification(R.drawable.stat_notify_calendar, tickerText,           System.currentTimeMillis());</code></pre><p>Do i need to define something before i try to draw it?</p>","298983","","","","","2010-03-22 12:14:13","Type R.drawable.stat_notify_calendar cannot be resolved","<android>","1","0","","",""
"2491980","1","2492210","","2010-03-22 12:01:04","4","10521","<p>I'm try to change text color and align item in spinner to center of it how can I do this</p><p>here is my code </p><pre><code>    String[] li={""1"",""2"",""3""};final Spinner combo = (Spinner)findViewById(R.id.widget30);ArrayAdapter&lt;String&gt; a = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item, li);combo.setAdapter(a);</code></pre><p>Thanks</p>","169736","","750613","","2012-06-26 08:32:43","2012-06-26 08:32:43","How to color and alignment spinner item on android?","<android><spinner><android-spinner>","1","0","2","",""
"2492076","1","2549222","","2010-03-22 12:15:39","58","94625","<p>I am making an HTTP get request to a website for an android application I am making.</p><p>I am using a DefaultHttpClient and using HttpGet to issue the request. I get the entity response and from this obtain an InputStream object for getting the html of the page.</p><p>I then cycle through the reply doing as follows:</p><pre><code>BufferedReader r = new BufferedReader(new InputStreamReader(inputStream));String x = """";x = r.readLine();String total = """";while(x!= null){total += x;x = r.readLine();}</code></pre><p>However this is horrendously slow.</p><p>Is this inefficient? I'm not loading a big web page - <strong>www.cokezone.co.uk</strong> so the file size is not big. Is there a better way to do this?</p><p>Thanks</p><p>Andy</p>","265683","","750613","","2012-06-26 08:31:35","2014-01-14 00:53:17","Android Reading from an Input stream efficiently","<java><android><input><stream><bufferedreader>","6","0","24","",""
"2492132","1","2492608","","2010-03-22 12:24:19","2","1491","<p>i have the following problem. I fill a ListView with a custom ArrayAdapter with data from a BD. However, in background, i'm updating those datas from the info provided by an API, so the idea is when the update finish, the adapter shows the updated data instead its ""<strong>old version</strong>"".</p><p>The problem is that when i do that, i notice a lag while the adapter is updating itself. Is the any efficient solution to avoid this?</p><p>Thanks</p>","258863","","750613","","2012-06-26 08:31:00","2012-06-26 08:31:00","Android ListAdapter Repaint","<android><listview>","1","0","1","",""
"2492303","1","2492461","","2010-03-22 12:56:10","0","917","<p>I have problems getting some of my views aligned in a relative layout that I use inside a row of my listview. </p><p>Here is a screenshot from the layout builder in Eclipse, this is what I think it should look like: </p><p><img src=""http://janusz.de/~janusz/eclipse.png"" alt=""alt text""></p><p>The next image is from the emulator. Now the TestTestTest View is at the top and covers the name and distance Textviews. </p><p><img src=""http://janusz.de/~janusz/emulator.png"" alt=""alt text""></p><p>This is my layout: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:padding=""4dip""&gt;&lt;ImageView android:id=""@+id/logo"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:adjustViewBounds=""true""    android:scaleType=""centerInside"" android:src=""@drawable/icon""    android:layout_centerVertical=""true"" android:layout_alignParentLeft=""true""    android:background=""@color/green"" /&gt;&lt;TextView android:id=""@+id/distance"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:text=""Distance""    android:layout_alignParentRight=""true"" android:layout_alignParentTop=""true""    android:paddingRight=""4dip"" android:background=""#000000"" /&gt;&lt;TextView android:id=""@+id/name"" android:layout_width=""fill_parent""    style=""@style/ListHeadText"" android:layout_height=""wrap_content""    android:text=""Name""    android:layout_alignTop=""@id/distance"" android:layout_toRightOf=""@id/logo""    android:layout_toLeftOf=""@id/distance"" android:gravity=""clip_horizontal""    android:lines=""1"" android:paddingLeft=""4dip"" android:background=""@color/red"" /&gt;&lt;TextView android:id=""@+id/number"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:text=""Number""    android:paddingRight=""4dip"" android:layout_alignRight=""@id/distance""    android:background=""@color/darkred"" android:layout_below=""@id/distance"" /&gt;&lt;TextView android:id=""@+id/subcategory"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:text=""Subcategory""    android:paddingLeft=""4dip"" android:layout_alignLeft=""@id/name""    android:lines=""1"" android:gravity=""clip_horizontal""    android:layout_below=""@id/distance"" android:background=""@color/green"" /&gt;&lt;TextView android:id=""@+id/test"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:text=""TestTestTest""    android:paddingLeft=""4dip""     android:layout_alignParentBottom=""true"" android:gravity=""bottom""    android:background=""@color/red"" /&gt;</code></pre><p></p><p>Shouldnt align_parent_bottom put the view at the bottom of the cell in the list?</p>","114066","","114066","","2010-03-29 12:22:45","2010-03-29 12:22:45","Why are some of my views not aligned correctly at the bottom of my relative layout?","<android><layout>","1","0","","",""
"2492457","1","2492638","","2010-03-22 13:17:49","2","2401","<p>I am planning on developing my specific voip app for android.</p><p>Here's the scenario:when a phone call occurs I want to hear the person who's calling on my local pc speakers and I want to speak to him via my own pc microphone / headset. So I need to send the audio stream of both me and the person I am talking to via the wlan network.</p><p>Something like this:</p><pre><code>...onCallStateChanged(int state, String phoneNumber){ while(state == PhoneListener.CALL_STATE_OFFHOOK){ //while phone call is happening  //send incoming speech via wlan to pc  //receive audiostream from pc microphone and direct it to the phone call }}...</code></pre><p>Is this possible with the current Android API? (Actually it should be since voip apps are available in the market)I did some research in the Android API and all I found was the AudioManager which has constant named </p><pre><code>public static final int  STREAM_VOICE_CALL; //The audio stream for phone calls </code></pre><p>But I don't know how to use it our how it should give me access to the actual audiostreams which I can send via network. How do I manage to do this?</p><p>The connection would be realised by TCP sockets.  </p>","283494","","","","","2010-08-09 10:27:10","Android, phone call audio stream via wlan","<android><networking><voip>","1","1","1","",""
"2492771","1","2495931","","2010-03-22 14:04:19","2","1695","<p>I'm trying to make the LED of the HTC Legend color blue along with my notification.</p><pre><code>    notif.ledARGB = color.BLUE;     notif.ledOnMS = 100;    notif.ledOffMS = 100;    notif.flags |= Notification.FLAG_SHOW_LIGHTS;</code></pre><p>The led just keeps flashing green (and not in the requested pattern). Is there something wrong with the code or doesn't the Legend support controlling the LED?</p>","298983","","","","","2010-03-22 21:33:27","LED-color HTC Legend","<android><led>","2","1","0","",""
"2492840","1","","","2010-03-22 14:13:08","0","9098","<p>I have managed to set up a tabbed view for my app (woo!)</p><p>and have the following xml for the UI</p><pre><code>&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@android:id/tabhost""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""5dp""&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""     /&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""    /&gt;&lt;/LinearLayout&gt;</code></pre><p></p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:orientation=""vertical""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""&gt;    &lt;Spinner android:id=""@+id/areaSpinner""             android:layout_width=""fill_parent""             android:layout_height=""@dimen/one_row""     /&gt;     &lt;Spinner android:id=""@+id/cragSpinner""              android:layout_width=""fill_parent""              android:layout_height=""@dimen/one_row""     /&gt;     &lt;Spinner android:id=""@+id/routeSpinner""              android:layout_width=""fill_parent""              android:layout_height=""@dimen/one_row""     /&gt;     &lt;DatePicker android:id=""@+id/dateClimbed""                  android:layout_width=""fill_parent""                  android:layout_height=""wrap_content""     /&gt;     &lt;Spinner android:id=""@+id/styleSpinner""              android:layout_width=""fill_parent""              android:layout_height=""@dimen/one_row""     /&gt;     &lt;Spinner android:id=""@+id/detailsSpinner""              android:layout_width=""fill_parent""              android:layout_height=""@dimen/one_row""     /&gt;     &lt;TextView android:id=""@+id/climbNotes""             android:layout_width=""fill_parent""             android:layout_height=""@dimen/three_row""   /&gt;&lt;/LinearLayout&gt;</code></pre><p>yet am seemingly unable to scroll down to see the rest of the form (cuts off at one of the spinners, why is this? and how do i fix it?</p>","298895","","13070","","2010-03-22 14:43:45","2010-06-23 21:01:47","How do you set tab view to scroll?","<android><scrolling>","2","0","","",""
"2492896","1","2493537","","2010-03-22 14:21:14","1","814","<p>I would like to embed user-specific data on-the-fly when distributing an APK from my website (NOT from the Market). </p><p>My current idea is simply to embed a unique ID in the APK filename. This is simple enough and changing the filename doesn't break the code signing. My current issue is trying to retrieve the filename (APK or DEX) so that I can read this ID. </p><p>I've tried most of the standard methods -- poking around PackageInfo, ApplicationContext, ProtectionDomain but I can't seem to get anything to work. Ideas?</p>","299080","","","","","2010-10-16 06:17:16","Programmatically determining running APK (or DEX)'s filename?","<android><filenames><apk>","1","0","","",""
"2492909","1","2493569","","2010-03-22 14:22:34","11","8534","<p>I am fetching lots of thumbnails from a remote server and displaying them in a grid view, using AsyncTask. The problem is, my grid view displays 20 thumbnails at a time, so that creates 20 AsyncTasks and starts 20 executes, one per thumbnail. </p><p>I get <code>RejectedExecution</code> exception in my code. I recall reading somewhere that there is a limit to number of tasks that AsyncTask can have in its queue at a time, i might be hitting that. Was this bar lifted? </p><p>Is there a way to increase this limit? Is it safe to just ignore this exception?(by having an empty <code>catch(RejectedException e){}</code> block?)</p><p>I am running this code on Android 1.6 emulator and the API level in my code(minSDKVersion is 3). [EDIT: Added SDK and API level info]</p>","236128","","236128","","2010-03-22 15:23:23","2012-05-14 17:57:47","AsyncTask, RejectedExecutionException and Task Limit","<android><error-handling><android-asynctask>","4","0","2","",""
"2493331","1","3689883","","2010-03-22 15:13:32","208","60654","<p>What would be considered the best practices when executing queries on an SQLite db within an Android app?</p><p>Is it safe to run inserts, deletes and select queries from an AsyncTask's doInBackground ? Or should I use the UI Thread ? I suppose that db queries can be ""heavy"" and should not use the UI thread as it can lock up the app - resulting in an ANR.</p><p>If I have several AsyncTasks, should they share a connection or should they open a connection each?</p><p>Are there any best practices for these scenarios?</p>","133858","","403455","","2012-06-22 19:31:21","2014-04-19 17:16:16","What are the best practices for SQLite on Android?","<android><database><sqlite><sqlite3>","6","2","178","",""
"2493572","1","2493726","","2010-03-22 15:40:17","1","637","<p>Suppose I only had the regular J2SE http libraries but wanted to write a client for comet, say in Android etc, but not limited to that, i.e. not using a WebView. Since there's no browser I'm assuming you'd have to open the long term connections yourself ... is this feasible?</p>","250340","","","","","2012-06-04 12:57:01","Comet without AJAX","<android><comet>","1","0","","",""
"2493824","1","2494317","","2010-03-22 16:12:20","5","474","<p>I am writing and publishing my apps on android and would like to provide help document (manual) to users of my apps.  I've seen apps open up external web pages as their help, or use html view to open local html documents.  Are these the ways we are supposed to deliver manual to our users?</p>","133616","","","","","2010-03-22 19:19:37","Is There a Standard Help Document/Manual in Android?","<android><documentation><manual>","2","1","1","",""
"2494171","1","12709496","","2010-03-22 17:01:44","12","10548","<p>I have this code to show a dialog with singlechoice(radio) options.</p><pre><code>AlertDialog ad = new AlertDialog.Builder(this).setCancelable(false).setIcon(R.drawable.alert_dialog_icon).setTitle(R.string.choose_one).setSingleChoiceItems(seq, pos,null).setPositiveButton( R.string.ok, new DialogInterface.OnClickListener() {   public void onClick( DialogInterface dialog, int whichButton)   {     // dialog dismissed  }  }).create();</code></pre><p>How do I get the choice that has been selected?</p>","243782","","","","","2013-01-24 13:20:58","How to get selected item of a singlechoice Alert Dialog?","<android><alertdialog>","5","0","4","",""
"2494396","1","2530533","","2010-03-22 17:33:40","2","4404","<p>I have used all the Standard Network related code for Getting Images of about <code>45KB to 75KB</code> but all are failing these methods work fine for Files of about <code>3-5KB</code> size of Images. How can I achieve Downloading Image of <code>45 - 75KB</code> for displaying them on an ImageView in Android for my Network Operations the Things I have used are </p><pre><code>final URL url = new URL(urlString);final URLConnection conn = url.openConnection();HttpURLConnection httpConn = (HttpURLConnection) conn;httpConn.setAllowUserInteraction(true);httpConn.setInstanceFollowRedirects(true);httpConn.setRequestMethod(""GET"");httpConn.connect();</code></pre><p>and the Second option that I have had used is::</p><pre><code>DefaultHttpClient httpClient = new DefaultHttpClient();HttpGet getRequest = new HttpGet(urlString);HttpResponse response = httpClient.execute(getRequest);</code></pre><p>why is this code functional for Smaller Sized Images and not for Larger Size Images. ?</p>","92039","","750613","","2012-06-26 08:28:33","2012-06-26 08:28:33","Android Image Getter for Larger Images","<android><thumbnails>","2","0","2","",""
"2494499","1","","","2010-03-22 17:48:03","28","10633","<p>We're implementing a program for Android phones that plays audio streamed from the internet.  Here's approximately what we do:</p><ol><li>Download a custom encrypted format.</li><li>Decrypt to get chunks of regular MP3 data.</li><li>Decode MP3 data to raw PCM data in a memory buffer.</li><li>Pipe the raw PCM data to an AudioTrack</li></ol><p>Our target devices so far are Droid and Nexus One.  Everything works great on Nexus One, but the MP3 decode is too slow on Droid.  The audio playback starts to skip if we put the Droid under load.  We are not permitted to decode the MP3 data to SD card, but I know that's not our problem anyways.</p><p>We didn't write our own MP3 decoder, but used MPADEC (http://sourceforge.net/projects/mpadec/).  It's free and was easy to integrate with our program.  We compile it with the NDK.</p><p>After exhaustive analysis with various profiling tools, we're convinced that it's this decoder that is falling behind.</p><p>Here's the options we're thinking about:</p><ol><li><p>Find another MP3 decoder that we can compile with the Android NDK.  This MP3 decoder would have to be either optimized to run on mobile ARM devices or maybe use integer-only math or some other optimizations to increase performance.</p></li><li><p>Since the built-in Android MediaPlayer service will take URLs, we might be able to implement a tiny HTTP server in our program and serve the MediaPlayer with the decrypted MP3s.  That way we can take advantage of the built-in MP3 decoder.</p></li><li><p>Get access to the built-in MP3 decoder through the NDK.  I don't know if this is possible.</p></li></ol><p>Does anyone have any suggestions on what we can do to speed up our MP3 decoding?</p><p>--Rob Sz</p>","299234","","","","","2011-12-29 02:02:36","MP3 Decoding on Android","<android><mp3><decode><android-ndk>","3","4","7","",""
"2494787","1","2494888","","2010-03-22 18:34:33","1","5400","<p>Specifically I want to change the text and background colors. Is it possible to change the colors of the 'animated progress wheel' too? Can I use a theme to do this? Can anyone point me to an example theme I can look at?</p>","246793","","","","","2010-03-22 18:49:21","How to customize the top status bar in an Android app?","<android><colors><themes><statusbar><skin>","2","1","","",""
"2495657","1","2495800","","2010-03-22 20:52:49","3","1060","<p>I am wondering if Android's ContentResolver supports using SQL functions over the columns when you query a ContentProvider. Such as SQLite3 date functions, to get a specific date format, or datediff?</p><p>What do you know about this?</p>","243782","","","","","2010-03-22 21:13:32","Am I able to run SQL functions on a ContentResolver columns query?","<android><android-contentprovider><android-contentresolver>","1","0","1","",""
"2495812","1","","","2010-03-22 21:16:33","4","11532","<p>I have similar question like this one: <a href=""http://stackoverflow.com/questions/2079074/update-layout-with-the-animation"">http://stackoverflow.com/questions/2079074/update-layout-with-the-animation</a></p><p>Basically: I have one vertical LinearLayout View with edittext, button and then list. I'd like to hide exittext after pressing button to make more space for list (button will go up). On second press edittext should be visible again. Edittext and button have ""wrap_content"" height.</p><p>I'd like to hide and show edittext with animation.</p><p>I succeeded to animate hiding by overloading Animation's applyTransformation:</p><pre><code>final float edittextheight= edittext.getHeight();[....]@Overrideprotected void applyTransformation(float interpolatedTime,        Transformation t){    super.applyTransformation(interpolatedTime, t);    android.view.ViewGroup.LayoutParams lp = edittext.getLayoutParams();    lp.height = (int)(edittextheight*(1.0-interpolatedTime));    edittext.setLayoutParams(lp);}</code></pre><p>Problem:</p><p>I don't know how to calculate height to animate showing - edittext.getHeight(); returns 0 when widget is hidden and in layout definition I'm using ""wrap_content"".</p><p>Help?</p>","7162","","1023783","","2012-08-08 03:36:33","2012-08-08 03:36:33","Android: how to hide and then show View with animation effect?","<android><animation><layout><hide>","2","0","2","",""
"2495928","1","2496324","","2010-03-22 21:32:50","0","2483","<p>I'm working with a ListView, trying to get the convertView / referenceHolder optimisation to work properly but it's giving me trouble. (This is the system where you store the R.id.xxx pointers in as a tag for each View to avoid having to call findViewById). I have a ListView populated with simple rows of an ImageView and some text, but the ImageView can be formatted either for portrait-sized images (tall and narrow) or landscape-sized images (short and wide). It's adjusting this formatting for each row which isn't working as I had hoped.</p><p>The basic system is that to begin with, it inflates the layout for each row and sets the ImageView's settings based on the data, and includes an int denoting the orientation in the tag containing the R.id.xxx values. Then when it starts reusing convertViews, it checks this saved orientation against the orientation of the new row. The theory then is that if the orientation is the same, then the ImageView should already be set up correctly. If it isn't, then it sets the parameters for the ImageView as appropriate and updates the tag.</p><p>However, I found that it was somehow getting confused; sometimes the tag would get out of sync with the orientation of the ImageView. For example, the tag would still say portrait, but the actual ImageView would still be in landscape layout. I couldn't find a pattern to how or when this happened; it wasn't consistent by orientation, position in the list or speed of scrolling. I can solve the problem by simply removing the check about convertView's orientation and simply always set the ImageView's parameters, but that seems to defeat the purpose of this optimisation.</p><p>Can anyone see what I've done wrong in the code below?</p><pre><code>static LinearLayout.LayoutParams layoutParams;(...)public View getView(int position, View convertView, ViewGroup parent){    ReferenceHolder holder;    if (convertView == null){        convertView = inflater.inflate(R.layout.pick_image_row, null);        holder = new ReferenceHolder();        holder.getIdsAndSetTag(convertView, position);        if (data[position][ORIENTATION] == LANDSCAPE) {            // Layout defaults to portrait settings, so ImageView size needs adjusting.             // layoutParams is modified here, with specific values for width, height, margins etc            holder.image.setLayoutParams(layoutParams);        }        holder.orientation = data[position][ORIENTATION];    } else {        holder = (ReferenceHolder) convertView.getTag();        if (holder.orientation != data[position][ORIENTATION]){  //This is the key if statement for my question            switch (image[position][ORIENTATION]) {            case PORTRAIT:                // layoutParams is reset to the Portrait settings                holder.orientation = data[position][ORIENTATION];                break;            case LANDSCAPE:                // layoutParams is reset to the Landscape settings                holder.orientation = data[position][ORIENTATION];                break;            }            holder.image.setLayoutParams(layoutParams);        }                   }    // and the row's image and text is set here, using holder.image.xxx    // and holder.text.xxx    return convertView;}static class ReferenceHolder {    ImageView image;    TextView text;    int orientation;    void getIdsAndSetTag(View v, int position){        image = (ImageView) v.findViewById(R.id.pickImageImage);        text = (TextView) v.findViewById(R.id.pickImageText);        orientation = data[position][ORIENTATION];        v.setTag(this);    }}</code></pre><p>Thanks!</p>","235654","","235654","","2010-03-22 23:23:22","2010-03-22 23:23:22","ListView: convertView / holder getting confused","<android><listview>","1","0","","",""
"2496026","1","","","2010-03-22 21:50:06","0","881","<p>I want to install a Bluetooth Application over my G1 device in linux environment. What is the correct procedure for this?</p><p>Whenever I am installing the application the following error is thrown:-</p><p><strong>adb install /home/parveen/workspace/BluetoothChat/bin/BluetoothChat.apk<br>        337 KB/s (28084 bytes in 0.081s)<br>        pkg: /data/local/tmp/BluetoothChat.apk<br>Failure [INSTALL_FAILED_ALREADY_EXISTS]**</strong></p>","292605","","597607","","2012-06-26 14:12:27","2012-06-26 14:12:27","How to load a Bluetooth .apk file in Android G1 phone through Linux OS?","<android><bluetooth>","1","0","","",""
"2496119","1","","","2010-03-22 22:06:12","1","8458","<p>In an Android app I am using a TabView and one of the tabs shows a WebView. But the page is blank until the web page loads. How would one show a progress bar until the page loads? It cannot be in the title bar because that is hidden by the tab host.</p>","286587","","623518","","2012-05-01 08:52:41","2012-05-01 08:52:41","Show a progress bar on a child tab until the WebView loads","<android><webview><progress-bar><android-tabhost>","4","0","2","",""
"2496286","1","","","2010-03-22 22:43:14","-1","1711","<p>I'm looking to find out how to stop an activity instead of resuming upon the click of the item on the notification list.  Any ideas?</p>","280641","","1101070","","2012-03-06 01:05:05","2012-03-06 01:36:54","Close activity via click on Android notification list","<android><activity><notifications><android-intent>","2","0","","",""
"2496506","1","2496576","","2010-03-22 23:30:17","3","414","<p>The thing is this, in Android 1.5 and 1.6 we had the <a href=""http://developer.android.com/guide/practices/ui_guidelines/icon_design.html"" rel=""nofollow"" title=""Icon Design Guidelines"">Icon Design Guidelines</a>. In this guide there are specifications for application icons. Every application should conform to this. However, in recent Android versions (2.0 and 2.1) icons have changed from the old to this new flat 2D style. Every icon in Nexus One has this style, so not even Google is conforming to the <a href=""http://developer.android.com/guide/practices/ui_guidelines/icon_design.html"" rel=""nofollow"" title=""Icon Design Guidelines"">guideline</a>. To see the differences between high and low density icons see this <a href=""http://smarterware.org/wp-content/uploads/2010/01/android21-menucube.png"" rel=""nofollow"" title=""Android 2.1 Launcher App"">image</a> and compare Evernote icon with the rest. </p><p>I've been able to use different icons by using two directories with different icons: <code>drawables-hdpi/icon.png</code> and <code>drawables/icon.png</code>, BUT not every Android 2.x is going to be HDPI and not every 1.x Android device is going to be low pixel density. So the question is:</p><p>Should I deploy different icons for different Android platform version within my apk file? and if I should, How do I do it?</p>","75928","","","","","2010-03-22 23:49:03","What kind of icon should I deploy with my Android 1.x and 2.x application?","<android><design><user-interface>","1","1","3","",""
"2496698","1","","","2010-03-23 00:21:13","16","10904","<p>Data being pulled from a local DB, then mapped using a cursor. Custom Adapter displays data similar to a ListView. As items are added/deleted from the DB, the adapter is supposed to refresh. The solution attempted below crashes the application at launch. Any suggestions?</p><p>Thanks in advance,-D</p><pre><code> @Override public View getView(int position, View convertView, ViewGroup parent) {   View v = convertView;   ViewGroup p = parent;               if (v == null) {     LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);     v = vi.inflate(R.layout.items_row, p);   }   int size = mAdapter.getCount();   Log.d(TAG, ""position "" + position + "" Size "" + size);   if(size != 0){     if(position &lt; size) return mAdapter.getView(position, v, p);     Log.d(TAG, ""-position "" + position + "" Size "" + size);   }   return null; }</code></pre><p>Exception:</p><pre><code>03-23 00:14:10.392: ERROR/AndroidRuntime(718): java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView03-23 00:14:10.392: ERROR/AndroidRuntime(718):     at android.widget.AdapterView.addView(AdapterView.java:461)03-23 00:14:10.392: ERROR/AndroidRuntime(718):     at android.view.LayoutInflater.inflate(LayoutInflater.java:415)03-23 00:14:10.392: ERROR/AndroidRuntime(718):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)03-23 00:14:10.392: ERROR/AndroidRuntime(718):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)03-23 00:14:10.392: ERROR/AndroidRuntime(718):     at com.xyz.abc.CustomSeparatedListAdapter.getView(CustomSeparatedListAdapter.java:90)...</code></pre>","299500","","14302","","2011-03-14 15:48:26","2012-05-27 15:39:42","Android: Custom ListAdapter extending BaseAdapter crashes on application launch","<android>","2","0","2","",""
"2496901","1","2498772","","2010-03-23 01:12:23","47","36707","<p>One of my apps has an ""opening screen"" (basically a menu) that has an <code>EditText</code> followed by several <code>Button</code>s. The problem is that several of my users are reporting that when they open the app it's automatically popping up the on-screen keyboard without them even touching the <code>EditText</code>. As far as I can tell, all of these users are using the <a href=""http://www.htc.com/www/product/hero/overview.html"">HTC Hero</a>. </p><p>Is this a bug in 1.5? Is there anything I can do about it?</p>","76835","","981555","","2013-04-24 13:10:24","2013-04-24 13:10:24","Android on-screen keyboard auto popping up","<android><android-softkeyboard>","3","2","20","",""
"2497203","1","","","2010-03-23 02:31:50","3","8263","<p>Where to get streaming (live) video and audio from camera example for Android?</p><p>Suppose I want to create some live video streaming service app so I'll have some cool server at the back end. And I know how to do that part. Suppose I have some stand alone app for PCs now I want to go on to mobile devices. So I want to see some sample app grabing audio and video streams from Phone, Synchronizing them, encoding somehow, and sending LIVE stream to server. I need any Open-Source sample that will do this or something like this. Where can I get such one?</p>","434051","","434051","","2010-03-23 18:48:51","2011-09-19 02:03:10","Where to get streaming (live) video and audio from camera example app for Android?","<java><android><video><streaming><live>","2","0","3","",""
"2497205","1","2621390","","2010-03-23 02:32:26","114","139860","<p>I have 3 classes in my example:Class A, the main activity.  Class A calls a startActivityForResult:</p><pre><code>Intent intent = new Intent(this, ClassB.class);startActivityForResult(intent, ""STRING"");</code></pre><p>Class B, this class is a TabActivity:</p><pre><code>Intent intent = new Intent(this, ClassC.class);tabHost.addTab...</code></pre><p>Class C, this class is a regular Activity:</p><pre><code>Intent intent = this.getIntent();intent.putExtra(""SOMETHING"", ""EXTRAS"");this.setResult(RESULT_OK, intent);finish();</code></pre><p>onActivityResult is called in Class A, but the resultCode is <code>RESULT_CANCELED</code> instead of <code>RESULT_OK</code> and the returned intent is null.  How do I return something from the Activity inside a TabHost?</p><p>I realize that the problem is that my Class C is actually running inside of Class B, and Class B is what is returning the <code>RESULT_CANCELED</code> back to Class A.  I just don't know a work around yet.</p>","242904","","609782","","2012-12-20 13:16:01","2013-08-14 14:36:51","How to return a result (startActivityForResult) from a TabHost Activity?","<android>","4","0","62","",""
"2497452","1","2498078","","2010-03-23 03:48:47","4","879","<p>Up to now, I've only distributed a few apps by sending .apk files around.  I was wondering how Android Market prevents users from distributing a paid application to other people.</p>","231768","","","","","2014-02-08 04:23:20","How does Android Market secure my application against distribution?","<android><distribution><protection><google-play>","1","0","1","",""
"2497677","1","2497689","","2010-03-23 04:58:49","31","44611","<p>I have a query that selects rows in a <code>ListView</code> without having a limit. But now that I have implemented a <code>SharedPreferences</code> that the user can select how much rows will be displayed in the <code>ListView</code>, my SQLite query doesn't work. I'm passing the argument this way:</p><pre><code>return wDb.query(TABELANOME, new String[] {IDTIT, TAREFATIT, SUMARIOTIT}, CONCLUIDOTIT + ""=1"", null, null, null, null, ""LIMIT='"" + limite + ""'"");</code></pre><p>Help, please!</p>","2443607","","1349048","","2012-08-19 06:23:07","2012-08-19 06:23:07","Using the LIMIT statement in a SQLite query","<android><sqlite>","2","0","6","",""
"2497895","1","2497911","","2010-03-23 06:05:46","0","307","<p>I heard this term recently. What are subscription applications(for a mobile platform). Does this term fall under standard usage? Are there any examples of such a mobile application?</p><p>Thanks.</p>","236128","","","","","2010-03-23 06:15:42","What are subscription applications?","<iphone><android><blackberry><mobile-application>","2","0","","",""
"2497945","1","2498329","","2010-03-23 06:20:23","0","926","<p>Any one please help me to build a horizontal bar graph in my android platform</p>","244540","","","","","2012-12-06 08:41:39","How to add a Horizontal BarGraph in Android platform?","<android>","2","1","","",""
"2497959","1","","","2010-03-23 06:23:43","0","2723","<p>I have more than one question, but I'll start with the more important and problematic one:</p><p>I have a FrameLayout with a ImageView inside it. I need to get the size of the ""usable area"" of the screen my activity is ocupping, so I set the <code>onSizeChanged</code> on my View (I extended the <code>ImageView</code> class). Everything worked fine here. Now I have a 1000x1000 image that I want to show on the screen, but without scaling. I want it to be clipped, really. If I set the <code>ImageView</code> dimensions using <code>viewObject.setLayoutParams</code>(<code>new Gallery.LayoutParams(1000, 1000));</code> I get the image being showed correctly, but then the <code>onSizeChanged</code> event returns me always the ""1000 x 1000"" custom size rather than the real screen size value.  Any ideas of how can I show an image with its real size (no scale!) and still get the view to report the screen available space? I can change the layout as needed as well, of course.</p><p>.  Amplexos.</p>","248970","","1050058","","2012-11-01 10:41:35","2012-11-01 10:41:35","Moving views inside a layout/view in Android","<android><layout><view><imageview>","1","0","","",""
"2498100","1","2498479","","2010-03-23 06:56:17","0","1796","<p>I have setup background image for a button as below.</p><pre><code>// declarations globally declared...ImageButton sampleButton;int sampleFirstImage = 0;int sampleSecondImage = R.drawable.imageSecond;............................................................................sampleFirstImage = R.drawable.imageFirst;sampleButton.setImageResource(sampleImage);</code></pre><p>In certain cases, i want to replace this image with the another second image if the first image is set. As i need to check the condition as first image set or not for button, i need to know what image is already being set for the button. So i want to GET, image set for the button? Is there any API which gets image id set for a control?</p><p>Thanks. Appreciate if you know and can explain it to me!</p>","187532","","","","","2010-03-23 08:40:24","Android:How to get back image set for a button programmatically?","<android>","1","0","","",""
"2498157","1","2499367","","2010-03-23 07:09:02","-1","585","<p>I opened my application after I am not doing any kind of operation. I leave the mobile 5 min. After 5 min when I touch the my application it is showing black screen. Is there any way to avoid this idle state?</p>","1746300","","436938","","2012-11-13 19:39:06","2012-11-13 19:39:06","Black screen is displaying in Android","<android>","1","3","","",""
"2498420","1","","","2010-03-23 08:26:22","0","255","<p>My problem is that the zoom controls don't appear on the mapview after one click, i.e the first click after the application loads. (I am using the deprecated version.)</p><p>In my application, on a click I position a pushpin on the touched location and also generate a toast with the co-ordinates. After I click the map, the pin is re-loacated and the toast are generated (albeit a bit late, I guess because of the time for which they have to say on screen) </p><p>What is happening wrong? What gives? Are the two activities (pin and toast) stealing the touch event? </p><p>Can you suggest any alternatives?</p>","299715","","63550","","2010-03-23 09:36:11","2010-03-24 06:15:43","Zoom controls not appearing after first click, for later clicks","<android><android-emulator>","1","0","","",""
"2498494","1","","","2010-03-23 08:43:22","4","8814","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2034822/android-opengl-es-transparent-background"">Android OpenGL ES Transparent Background</a>  </p></blockquote><p>I'd like to display some 3d object on top of the normal 2d ui layout screen.</p><p>The 2d ui screen has background image, and GLSurfaceView is child of the content layout.</p><p>I tried the same technique of the Translucent GLSurfaceView in ApiDemos sample,</p><p>but GLSurfaceView clears all and shows black background.</p><hr><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""        android:background=""@drawable/my_background_image""&gt;...&lt;android.opengl.GLSurfaceView android:id=""@+id/glview""      android:layout_width=""fill_parent""    android:layout_height=""300px""    android:windowIsTranslucent=""true"" (i'm not sure this is right)/&gt;&lt;/LinearLayout&gt;</code></pre><hr><pre><code>setContentView(R.layout.main);...glview = (GLSurfaceView) findViewById(R.id.glview);glview.setEGLConfigChooser(8, 8, 8, 8, 16, 0);glview.getHolder().setFormat(PixelFormat.TRANSLUCENT);glview.setRenderer(this);...gl.glClearColor(0, 0, 0, 0);...</code></pre><hr><p>Can I preserve the underlying background image in this situation?</p>","2556909","","44729","","2011-05-26 15:45:09","2012-07-15 20:37:12","Android, Transparent sub-GLSurfaceView in layout?","<android><opengl-es><background><transparent>","1","0","8","2012-07-16 00:46:32",""
"2498538","1","","","2010-03-23 08:54:57","0","1525","<p>I have managed to get a working video player that can stream rtsp links, however im not sure how to display the videos current time position in the UI, i have used the getDuration and getCurrentPosition calls, stored this information in a string and tried to display it in the UI but it doesnt seem to work</p><pre><code>**in main.xml:**    TextView android:id=""@+id/player""           android:layout_width=""wrap_content""            android:layout_height=""wrap_content""           android:layout_margin=""1px""           android:text=""@string/cpos""          /&gt;**in strings.xml:** string name=""cpos""&gt;"""" /string&gt;**in Player.java**private void playVideo(String url) {  try {   media.setEnabled(false);   if (player == null) {    player = new MediaPlayer();    player.setScreenOnWhilePlaying(true);   } else {    player.stop();      player.reset();   }   player.setDataSource(url);   player.getCurrentPosition();   player.setDisplay(holder);   player.setAudioStreamType(AudioManager.STREAM_MUSIC);   player.setOnPreparedListener(this);   player.prepareAsync();   player.setOnBufferingUpdateListener(this);   player.setOnCompletionListener(this);  } catch (Throwable t) {   Log.e(TAG, ""Exception in media prep"", t);   goBlooey(t);   try {    try {     player.prepare();    } catch (IOException e) {     // TODO Auto-generated catch block     e.printStackTrace();    }    Log.v(TAG, ""Duration: ===&gt; "" + player.getDuration());   } catch (IllegalStateException e) {    // TODO Auto-generated catch block    e.printStackTrace();   }  } }private Runnable onEverySecond = new Runnable() {  public void run() {   if (lastActionTime &gt; 0    &amp;&amp; SystemClock.elapsedRealtime() - lastActionTime &gt; 3000) {    clearPanels(false);   }   if (player != null) {    timeline.setProgress(player.getCurrentPosition());    //stores getCurrentPosition as a string    cpos = String.valueOf(player.getCurrentPosition());    System.out.print(cpos);   }   if (player != null) {    timeline.setProgress(player.getDuration());    //stores getDuration as a string    cdur = String.valueOf(player.getDuration());    System.out.print(cdur);   }   if (!isPaused) {    surface.postDelayed(onEverySecond, 1000);   }  } };</code></pre>","299737","","996493","","2012-05-03 05:17:35","2012-05-03 05:17:35","is it possible to display video information from an rtsp stream in an android app UI","<android><timestamp><video-streaming>","3","0","","",""
"2498697","1","","","2010-03-23 09:25:04","1","1092","<p>i am stuck with a problem creating buttons dynamically in android. This is what i want to do-</p><p>I want to create 8 x 10 array of buttons. Since declaring 80 buttons in main.xml isn't efficient, I want to do this in the program itself. The biggest problem is placing/aligning the buttons like a grid. I can create button objects but how do I align them in the program?</p><pre><code>Button b = new Button(this); b.setId(i);b.setText(""Button "" + i); </code></pre><p>Like this-</p><pre><code>1 1 1 1 1 1 1 1 1 12 2 2 2 2 2 2 2 2 2...10 10 10 10 10 10 10 10 10 10</code></pre><p>Any help in doing this ""programtically"" will be appreciated</p>","299752","","133802","","2010-03-23 09:30:13","2010-03-30 03:43:46","Help: 8 X 10 2-dimensional array of buttons in android","<java><android><user-interface><button>","1","3","","",""
"2498985","1","","","2010-03-23 10:15:25","17","36148","<p>How to integrate Facebook Connect and API with Android Application?</p>","281307","","1765573","","2013-07-19 08:12:07","2013-07-19 08:12:07","How to Integrate Facebook Connect with Android","<android><facebook><integration><facebook-android-sdk>","5","1","4","",""
"2499324","1","2499382","","2010-03-23 11:09:49","6","10662","<p>I'm trying to build an android app that would do a local search on google.</p><p>I know there is a <a href=""http://code.google.com/p/gsearch-java-client/"">Google Search API for Java</a>, and I am able to use it for a desktop application. However, when I use the same jar file (gsearch.jar) in my android project, Some problems arise.</p><p>When I call the .localSearch() method of my gsearch.Client object, a runtime error is occurring. The error message is: ""java.lang.VerifyError: gsearch.Client"". This message is occurring in the Dalvik Debug Monitor log.</p><p>So what is the problem here? Can I not use the search API on the android? </p><p>More importantly, how do I do a local search from an android app? Does the android sdk have search APIs inbuilt? I could only find the Maps api, and Map search is not what I'm looking for..</p><p>Thanks for the help,</p><p>jrh</p>","2119053","","","","","2010-10-06 08:32:14","Google Search api for Android systems","<android><google-search-api>","1","2","5","",""
"2499412","1","","","2010-03-23 11:26:30","2","336","<p>I have an activity in my app, when i call the line</p><pre><code>EditText username = (EditText)findViewById(R.id.usernameText);</code></pre><p>the app crashes, why is this?</p>","298895","","","","","2010-03-23 16:39:09","Getting EditText field from XML","<android><edittext>","3","1","","",""
"2499480","1","","","2010-03-23 11:35:36","0","440","<p>I am trying to create and remove tabs dynamically. Usually an activity should be set for each tab created in TabSpec. But how to do it when the tabs are created dynamically? Here I am using a frame layout to display tab content. If I try to use the same activity by setting the tab content, the text is getting overlapped. Here I have to read the text from the EditText view and set it as the tab content and that content should be shown whenever I navigate to that tab.</p>","298968","","58792","","2010-03-23 11:37:27","2010-03-23 11:37:27","How to create an activity for each tab that is created dynamically?","<android><tabwidget>","0","3","","",""
"2499595","1","","","2010-03-23 11:56:33","1","514","<p>I'm interested in developing android applications. I've a background of Java/Swing/C++/ajax developer so I think I may find myself at home. As I installed the SDK I noticed that I can't follow my usual java development scheme: building base libraries, then the final app. In fact I'd like to develop libs and test them in a more convenient environment like, Swing. There is no way I can use android libs in pure swing apps...Do you have any suggestion about these topics and what's your development process?</p>","138606","","","","","2010-03-23 12:06:27","Suggest a good Android development workflow","<java><android>","1","0","","",""
"2499679","1","2585241","","2010-03-23 12:07:33","1","2352","<p>Anyone know how to solve this problem?</p><pre><code>    03-23 13:03:20.585: WARN/googleanalytics(3430): Problem with socket or streams.03-23 13:03:20.585: WARN/googleanalytics(3430): java.net.SocketException: Broken pipe03-23 13:03:20.585: WARN/googleanalytics(3430):     at org.apache.harmony.luni.platform.OSNetworkSystem.sendStreamImpl(Native Method)03-23 13:03:20.585: WARN/googleanalytics(3430):     at org.apache.harmony.luni.platform.OSNetworkSystem.sendStream(OSNetworkSystem.java:498)03-23 13:03:20.585: WARN/googleanalytics(3430):     at org.apache.harmony.luni.net.PlainSocketImpl.write(PlainSocketImpl.java:585)03-23 13:03:20.585: WARN/googleanalytics(3430):     at org.apache.harmony.luni.net.SocketOutputStream.write(SocketOutputStream.java:59)03-23 13:03:20.585: WARN/googleanalytics(3430):     at org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:87)03-23 13:03:20.585: WARN/googleanalytics(3430):     at org.apache.http.impl.io.AbstractSessionOutputBuffer.flush(AbstractSessionOutputBuffer.java:94)03-23 13:03:20.585: WARN/googleanalytics(3430):     at org.apache.http.impl.AbstractHttpClientConnection.doFlush(AbstractHttpClientConnection.java:168)03-23 13:03:20.585: WARN/googleanalytics(3430):     at org.apache.http.impl.AbstractHttpClientConnection.flush(AbstractHttpClientConnection.java:173)03-23 13:03:20.585: WARN/googleanalytics(3430):     at com.google.android.apps.analytics.PipelinedRequester.sendRequests(Unknown Source)03-23 13:03:20.585: WARN/googleanalytics(3430):     at com.google.android.apps.analytics.NetworkDispatcher$DispatcherThread$AsyncDispatchTask.dispatchSomePendingEvents(Unknown Source)03-23 13:03:20.585: WARN/googleanalytics(3430):     at com.google.android.apps.analytics.NetworkDispatcher$DispatcherThread$AsyncDispatchTask.run(Unknown Source)03-23 13:03:20.585: WARN/googleanalytics(3430):     at android.os.Handler.handleCallback(Handler.java:587)03-23 13:03:20.585: WARN/googleanalytics(3430):     at android.os.Handler.dispatchMessage(Handler.java:92)03-23 13:03:20.585: WARN/googleanalytics(3430):     at android.os.Looper.loop(Looper.java:123)03-23 13:03:20.585: WARN/googleanalytics(3430):     at android.os.HandlerThread.run(HandlerThread.java:60)03-23 13:03:21.088: WARN/googleanalytics(3430): Dispatcher thinks it finished, but there were 543 failed events</code></pre><p><strong>Specially the last line explain why there is lost so much data, as the dispatcher thinks it is done, but have 543 events not dispatched...</strong></p><p>The application have a good internet connection and there is no problem reaching the app server-side api.</p><p>I see in analytics that lots of startups and click-events the past few days are lost, even I know the traffic is normal since i can see statistics from the the server api.</p><p>In the analytics reports I see a day by day under-reporting. So the problems seems to be spreading/growing to all the devices using this application.</p><p>Im wondering why google does not answer this in their mail-groups - several people have complained about this...well, well...</p><p>But, I'm still not sure if there is anything I can do to fix it or not. If there is nothing I can do to fix it, I guess its not my fault that it got broken. But i got a feeling it is, since the problem got dramatically worse on the last deploy to Android market.</p><p>Anyone else with experience on Google Analytics for android ? </p>","133858","","133858","","2010-04-07 14:30:26","2010-04-07 14:31:51","Problem with Google Analytics for Android : ""Dispatcher thinks it finished, but there were 543 failed events""","<android><exception><google-analytics><dispatcher>","1","1","2","2010-05-24 10:23:32",""
"2499960","1","","","2010-03-23 12:53:02","53","42707","<p>Is there any way to create <code>PDF</code> Files from an <strong>Android Application</strong>? </p><p>So far I've found nothing, I am now sort of writing all the code from scratch.</p><p>Is there any API I can use, that works on android?</p>","","user299908","1318946","","2013-10-24 06:51:12","2014-02-17 04:40:56","How to create PDFs in Android SDK?","<android><pdf>","5","3","37","",""
"2500320","1","","","2010-03-23 13:41:50","2","228","<p>I can't seem to get my AVD built.</p><p>I got all the tools. I even have GIT, but when I try to do the command <code>avd devices</code> it will say: <code>no such command</code>.</p>","299948","","807423","","2014-04-02 21:41:38","2014-04-02 21:41:38","Building Android AVD","<android>","2","0","1","",""
"2500488","1","2501249","","2010-03-23 14:03:40","3","5467","<p>I have a settings menu that pops up and in it is a ListPreference type menu. It is associated with a settings.xml file where there are 'array-strings' within it. It all works good but I don't know how to retrieve the users preference.</p><p>As an example, let's say the user picks a color (red, green, or blue). The list that I've made within my 'array-strings' contain the text red, green, and blue. Within my code, I would like to do something if the user has chosen red, something else if they choose blue, etc., etc. Would I use a 'case' statement or an 'if' statement? And most importantly, how would I retrieve the users preference - the key? (am I checking for a boolean?)</p>","237863","","77914","","2011-03-15 04:41:58","2011-03-15 04:41:58","android: using ListPreference and retrieving key string","<android><android-preferences>","2","2","","",""
"2500879","1","2505738","","2010-03-23 14:56:46","3","5172","<p>I am developing an application which requires to add Calendar event. I have written the code for inserting event to the calendar. But whenever i run my application, everytime i get error that ""Fail to find provider info for Calendar"" and it also throws me <strong>NullPointerException</strong> error. So, what it means and i found that emulator doesn't provide Calendar application in-built. </p><p>I think if the Android Emulator doesn't have Calender API, so, naturally, it will not have any database URI in the emulator whereas the Contact has URI <strong>--""content://contacts/people"".</strong> I also found the URI for Calendar as <strong>""content://calendar/calendars""</strong> but it doesn't work and it means that it gives me error cause of missing Calendar application.</p><p>Can anybody clarify me, with suggestions regarding Calendar Event?</p><p>Which is the way to test my application with Calendar Event?</p>","230262","","1288","","2011-03-28 12:19:28","2011-03-28 12:19:28","How to test Calendar Event on emulator?","<android><calendar><android-emulator>","2","1","2","",""
"2501229","1","2505881","","2010-03-23 15:36:41","5","4948","<p>I was wondering if anyone could advise on a good pattern for loading textures in an Android Java &amp; OpenGL ES app.</p><p>My first concern is determining how many texture names to allocate and how I can efficiently go about doing this prior to rendering my vertices.</p><p>My second concern is in loading the textures, I have to infer the texture to be loaded based on my game data.  This means I'll be playing around with strings, which I understand is something I really shouldn't be doing in my GL thread.</p><p>Overall I understand what's happening when loading textures, I just want to get the best lifecycle out of it.  Are there any other things I should be considering?</p>","128991","","","","","2011-11-23 01:49:33","Loading textures in an Android OpenGL ES App","<java><android><opengl-es><textures>","2","0","7","",""
"2501307","1","4702152","","2010-03-23 15:44:30","14","10399","<p>I'm interested in creating a horizontal scroll view that ""snaps"" to the viewed item, so only one item is ever shown at a time. The user can touch-drag left/right and will see previous/next views, switching to it if there's enough velocity. This interaction is exactly like what the new weather/news widget that comes with the Nexus One does for navigating between its ""tabs"".</p><p>Are there any existing view widgets that do this?</p><p>Update: found a copy of the news/weather widget (GenieWidget) and they seem to have implemented their own widget to accomplish this which they call <code>com.google.android.apps.genie.geniewidget.ui.FlingableLinearLayout</code> which is part of their own custom <code>com.google.android.apps.genie.geniewidget.ui.TabView</code>. As that source isn't available, that's not looking too hopeful a direction.</p>","90934","","90934","","2010-03-23 16:32:57","2011-09-24 15:39:42","Horizontal ""tab""ish scroll between views","<android><layout><user-interface><android-widget>","6","2","20","",""
"2501335","1","2501388","","2010-03-23 15:47:53","2","480","<p>I am curious if there is a way from within a WebView when a button is clicked it display a new view on top of the current display. </p><p>I have a web site and when the user clicks the signature field I want to be able to capture the signature on the device. From the best I can tell the easiest way is to write this section in the Android SDK. I'm trying to avoid rewriting the entire website.</p><p>Any help is greatly appreciated.</p>","267101","","","","","2010-03-23 19:25:57","Android Web View","<android><view><webview>","2","0","1","",""
"2501450","1","","","2010-03-23 15:57:33","31","10669","<p>I know this has been asked before but I still don't have a solution.My first app: developed and debugged on my moto droid and then followed all the release steps, (exported from Eclipse, using my key to sign) including removing the debug in the manifest xml.</p><p>I copied the resulting apk to the droid, disconnected the usb and installed it by double clicking on the file using Astro.</p><p>I get the ""Waiting for Debugger"" message like when I am debugging but it never goes away.</p><p>Doing something real stupid I know but I can't figure it out.  Any help would be appreciated.Thanks,Tom</p>","300081","","","","","2013-05-22 18:17:39","Android Release Version and ""Waiting for Debugger""","<android><release>","5","0","4","",""
"2501884","1","2502070","","2010-03-23 16:53:21","1","164","<p>Sorry for the title, I couldn't argue something better.</p><p>Here is my question: Is it possible to launch a browser on Android and don't give the option to change page?</p><p>For instance, if I launch a browser to stackoverflow.com, i want the user to navigate on the site, but don't give the ability to go to another site.</p><p>Is this feasible?</p>","295525","","","","","2010-03-23 17:18:07","Launching a reduced browser","<android><browser><navigation>","1","0","1","",""
"2501929","1","2502149","","2010-03-23 16:59:32","0","1467","<p>Greets, </p><p>Made some app on android. I for the life of me can't get it to install on the phone as a stand alone application. It runs fine when I deploy from eclipse but never remains on the device. any idea whats happening? </p><p>I put the apk file on a web server, went to the address downloaded and installed but still it wasn't to be found. </p><p>I'm lost! </p>","84278","","","","","2010-03-23 17:27:33","Can't find my installed application","<android>","1","0","","",""
"2502194","1","2502261","","2010-03-23 17:34:51","0","3317","<p>Is there a way to get the current content of a WebView?</p><p>What about Cookies for a specific host+url?</p>","238849","","","","","2010-03-23 17:55:23","Getting WebView content, or cookies","<android>","2","0","1","",""
"2502431","1","2502487","","2010-03-23 18:09:13","0","853","<p>I have not used Twitter enough to become familiar with its terminology or the way it works, so please help me in understanding the problem I have at hand.</p><p>I am getting last 20 status updates posted by some Twitter user via RSS feed, the feed XML is parsed and the statuses are displayed in a ListView. Which means that I have the original tweet in a String variable(row of ListView). When I click a ListView item, I get the option of ""Re-tweeting"" and ""post reply"". </p><p>As, I understand it, when re-tweeting I will have to just update <em>my</em> *status* as:</p><pre><code>RT @orig-poster &lt;original tweet&gt;</code></pre><p>and when posting a reply I will have to just update <em>my status</em> as:</p><pre><code>@orig-poster &lt;my tweet&gt;</code></pre><p>I skimmed through the JavaDocs of the Jwitter library(Twitter class) and found a <code>setStatus(String)</code> method. I dont think I will have to make use of retweet() or reply() functions of the Twitter class in JTwitter library. </p><p>Is my understanding correct?  Please correct me if I am wrong here or missing anything.</p><p>Thanks!</p>","236128","","","","","2010-05-24 10:34:02","Re-tweets and replies with JTwitter","<android><twitter><jtwitter>","4","0","","",""
"2502443","1","3746091","","2010-03-23 18:10:43","30","8853","<p>In a long-running operation, I'm showing a popup dialog (created from <code>ProgressDialog</code> to prevent other operations from happening).</p><p>I have made it non-cancellable with <code>setCancelable(false)</code>, so I can't close it using the back button, but surprisingly, the Search hardware button dismisses the dialog!</p><p>More exactly, the global search application is displayed, and when I come back to my app, the dialog has been dismissed. </p><p>Any idea how to prevent the dialog from being dismissed?</p>","11238","","293280","","2013-09-24 04:54:34","2013-09-24 04:54:34","Prevent ProgressDialog from being dismissed when I click the search button (Android)","<android><dialog><progressdialog>","3","2","10","",""
"2502800","1","2503142","","2010-03-23 19:00:02","8","12501","<p>Is it possible to set the TabWidget height and have the tab labels adjust?  </p><p>If I set the TabWidget height too small, then the labels are hidden from view.  </p><pre><code>&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/tabhost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;        &lt;LinearLayout            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp""&gt;            &lt;TabWidget                android:id=""@android:id/tabs""                android:layout_width=""fill_parent""                android:layout_height=""30px"" /&gt;            &lt;FrameLayout                android:id=""@android:id/tabcontent""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:padding=""5dp"" /&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Thanks</p>","131640","","131640","","2010-03-23 19:07:15","2012-10-08 18:05:51","TabWidget Height","<android>","4","0","2","",""
"2502807","1","2503211","","2010-03-23 19:01:01","9","11812","<p>I know that Android has a JSON parser baked in but I was wondering if it was worth using something that offered better performance (like Jackson - see <a href=""http://jackson.codehaus.org/"">http://jackson.codehaus.org/</a>) ? Anybody tried that ?</p>","246793","","","","","2012-09-01 10:08:43","Replace standard Android JSON parser for better performance?","<android><json><parsing><jackson>","5","2","3","",""
"2502874","1","2503286","","2010-03-23 19:13:11","2","1518","<p>I am running into an issue with the way my asynctasks are executed. Here's the problem code:</p><pre><code>firstTask = new background().new FirstTask(context);    if(firstTask.execute().get().toString().equals(""1""))      secondTask = new background().new SecondTask(context);</code></pre><p>What I'm doing here is creating a new asynctask object, assigning it to firstTask and then executing it. I then want to fire off a separate asynctask when the first one is done and making sure it returns a success value (1 in this case).This works perfectly on Android 2.0 and up. However, I am testing with Android 1.5 and problems start popping up. The code above will run the first asynctask but doInBackground() is never called despite onPreExecute() being called. If I am to execute the first task without the get() method, doInBackground() is called and everything works as expected. Except now I do not have a way to determine if the first task completed successfully so that I can tell the second task to execute.Is it safe to assume that this is a bug with asynctask on Android 1.5? Especially since the API (http://developer.android.com/intl/de/reference/android/os/AsyncTask.html#get%28%29) says that the get method has been implemented since API 3.Is there any way to fix this? Or another way to determine that the first task has finished?</p>","298280","","298280","","2010-03-23 20:15:34","2010-03-23 20:17:35","Android 1.5: Asynctask doInBackground() not called when get() method is called","<android><android-asynctask>","1","0","","",""
"2503271","1","","","2010-03-23 20:15:36","2","598","<p>I need to call a web service using ksoap2, from Android! The real problem I am facing is that, I have to use a complex data type. ( a class containing two strings ). Does anybody have an example of passing a complex type to a webservice, preferably, only using SoapObject?</p>","299944","","1101070","","2012-03-06 01:21:26","2012-03-06 01:21:26","Invoke .NET C# web service from Android, using complex data type","<c#><.net><android>","0","0","1","",""
"2503324","1","","","2010-03-23 20:23:04","0","2721","<p>I'm stuck at a point where I'm trying to get my project to read a preference value (from a ListPreference listing) and then use that value in a basic mathematical subtraction instance.  The problem is that the ""seek"" preference is not being seen by my Java code, and yet the default value is (I've tried the default value with 3000 and now 0).  Am i missing something, is there a bug here, known or unknown?</p><p>Here is my Java code chunk where the issues manifests itself:</p><pre><code>public static final String PREF_FILE_NAME = ""preferences"";seekback.setOnClickListener(new Button.OnClickListener() {@Overridepublic void onClick(View view) {try {   SharedPreferences preferences = getSharedPreferences(PREF_FILE_NAME, MODE_PRIVATE); Integer storedPreference = preferences.getInt(""seek"", 0);(mediaPlayer.getCurrentPosition()-storedPreference);} catch (Exception e) { e.printStackTrace();} }});</code></pre><p>Here are some other code bits for my project:</p><p>From preferences file:</p><pre><code> &lt;ListPreference android:entries=""@array/seconds"" android:entryValues=""@array/seconds_values"" android:summary=""sets the seek interval for the seekback and seekforward buttons"" android:title=""Seek Interval"" android:defaultValue=""5000"" android:key=""@string/seek""&gt; &lt;/ListPreference&gt;</code></pre><p>From strings file:</p><pre><code>&lt;string name=""seek""&gt;seek&lt;/string&gt;</code></pre><p>From an array file:</p><pre><code>&lt;resources&gt;    &lt;string-array      name=""seconds""&gt;      &lt;item&gt;Five seconds&lt;/item&gt;      &lt;item&gt;Fifteen seconds&lt;/item&gt;      &lt;item&gt;Thirty seconds&lt;/item&gt;      &lt;item&gt;Sixty seconds&lt;/item&gt;    &lt;/string-array&gt;    &lt;string-array      name=""seconds_values""&gt;      &lt;item&gt;5000&lt;/item&gt;      &lt;item&gt;15000&lt;/item&gt;      &lt;item&gt;30000&lt;/item&gt;      &lt;item&gt;60000&lt;/item&gt;    &lt;/string-array&gt;&lt;/resources&gt;</code></pre><p><em>let me know if you need to see more code to figure this one out</em></p><p>Thanks in advance for any help that can be offered.  I've worked over this issue now for a few hours and I'm burnt, a second pair of eyes on it would be very much appreciated.</p>","227604","","7872","","2011-04-27 11:05:58","2011-04-27 11:05:58","getSharedPreferences not working for me with concerns to ListPreferences and Integers","<android><sharedpreferences><integer><listpreference>","2","0","","",""
"2503628","1","2528718","","2010-03-23 21:06:02","37","24732","<p>I'm having issues with <code>BitmapFactory.decodeStream(inputStream)</code>. When using it without options, it will return an image. But when I use it with options as in <code>.decodeStream(inputStream, null, options)</code> it never returns Bitmaps.</p><p>What I'm trying to do is to downsample a Bitmap before I actually load it to save memory.I've read some good guides, but none using <code>.decodeStream</code>.</p><ul><li><p><em><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/1e9d19c3adf1a768/afef1c8341a63ad2?lnk=gst&amp;q=samuh#afef1c8341a63ad2"">Handling large Bitmaps</a></em></p></li><li><p><a href=""http://nornalbion.Scom/blog/?p=143"">And here</a></p></li><li><p><em><a href=""http://kfb-android.blogspot.com/2009/04/image-processing-in-android.html"">Image Processing in Android</a></em></p></li></ul><p><strong>WORKS JUST FINE</strong></p><pre><code>URL url = new URL(sUrl);HttpURLConnection connection  = (HttpURLConnection) url.openConnection();InputStream is = connection.getInputStream();Bitmap img = BitmapFactory.decodeStream(is, null, options);</code></pre><p><strong>DOESN'T WORK</strong></p><pre><code>InputStream is = connection.getInputStream();Bitmap img = BitmapFactory.decodeStream(is, null, options);InputStream is = connection.getInputStream();Options options = new BitmapFactory.Options();options.inJustDecodeBounds = true;BitmapFactory.decodeStream(is, null, options);Boolean scaleByHeight = Math.abs(options.outHeight - TARGET_HEIGHT) &gt;= Math.abs(options.outWidth - TARGET_WIDTH);if (options.outHeight * options.outWidth * 2 &gt;= 200*100*2){    // Load, scaling to smallest power of 2 that'll get it &lt;= desired dimensions    double sampleSize = scaleByHeight    ? options.outHeight / TARGET_HEIGHT    : options.outWidth / TARGET_WIDTH;    options.inSampleSize =        (int)Math.pow(2d, Math.floor(        Math.log(sampleSize)/Math.log(2d)));}// Do the actual decodingoptions.inJustDecodeBounds = false;Bitmap img = BitmapFactory.decodeStream(is, null, options);</code></pre>","300314","","190309","","2013-08-20 08:42:53","2014-04-03 11:39:17","BitmapFactory.decodeStream returning null when options are set","<java><android><image><bitmap>","4","5","12","",""
"2503892","1","","","2010-03-23 21:51:53","0","3006","<p>I think I am going crazy right now.  I am trying to create a spinner populated by a datatable but for some reason the dropdown list items text is not being displayed.  I have looked all over and have seen other posts with people having this same problem.  Can anyone help??  </p><pre><code>speciesList = (Spinner) findViewById(R.id.speciesList);    spinnerCursor = nsfdb.fetchAllSpecies();    startManagingCursor(spinnerCursor);    //String []cArrayList = new String[]{""dog"", ""cat"", ""horse"", ""other""};    String[] from = new String[]{""species""};    int[] to = new int[]{R.id.text1};    SimpleCursorAdapter locations = new SimpleCursorAdapter(this, R.layout.loc_row, spinnerCursor, from, to);    locations.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    speciesList.setAdapter(locations);</code></pre><p>The spinner gets created just fine and is populated with 4 items but whenever I click on the spinner I see 4 items with no text and just radiobuttons.  If I select any of them I am getting the correct selected item value but there is just no data displayed. </p>","","user300339","683261","","2012-01-18 05:06:54","2012-01-18 05:06:54","Android Spinner not displaying list items","<android><android-widget><spinner>","4","0","","",""
"2504064","1","","","2010-03-23 22:29:33","29","31159","<p>How do I make sure my app is only for vertical layout?<br>I added this android:screenOrientation=""portrait"" but that doesn't seem to do the trick.</p>","166940","","243782","","2010-03-23 22:31:27","2013-06-19 15:30:25","Android - Vertical layout only","<android>","8","1","8","",""
"2504429","1","","","2010-03-23 23:39:26","18","37053","<p>I have some Android code that needs to get the best available location QUICKLY, from GPS, network or whatever is available. Accuracy is less important than speed. </p><p>Getting the best available location is surely a really standard task. Yet I can't find any code to demonstrate it. The Android location code expects you to specify criteria, register for updates, and wait - which is fine if you have detailed criteria and don't mind waiting around. </p><p>But my app needs to work a bit more like the Maps app does when it first locates you - work from any available provider, and just check the location isn't wildly out of date or null.</p><p>I've attempted to roll my own code to do this, but am having problems. (It's inside an IntentService where an upload happens, if that makes any difference. I've included all the code for info.) What's wrong with this code?</p><pre><code>@Overrideprotected void onHandleIntent(Intent arg0) {    testProviders();    doUpload();}private boolean doUpload() {       int j = 0;       // check if we have accurate location data yet - wait up to 30 seconds       while (j &lt; 30) {           if ((latString == """") || (lonString == """")) {               Log.d(LOG_TAG, ""latlng null"");               Thread.sleep(1000);               j++;       } else {                Log.d(LOG_TAG, ""found lat "" + latString + "" and lon "" + lonString);            break;       }       //do the upload here anyway, with or without location data       //[code removed for brevity]}public boolean testProviders() {    Log.e(LOG_TAG, ""testProviders"");    String location_context = Context.LOCATION_SERVICE;    locationmanager = (LocationManager) getSystemService(location_context);    List&lt;String&gt; providers = locationmanager.getProviders(true);    for (String provider : providers) {        Log.e(LOG_TAG, ""registering provider "" + provider);        listener = new LocationListener() {            public void onLocationChanged(Location location) {                // keep checking the location - until we have                // what we need                //if (!checkLoc(location)) {                Log.e(LOG_TAG, ""onLocationChanged"");                locationDetermined = checkLoc(location);                //}            }            public void onProviderDisabled(String provider) {            }            public void onProviderEnabled(String provider) {            }            public void onStatusChanged(String provider, int status,                    Bundle extras) {            }        };        locationmanager.requestLocationUpdates(provider, 0,                0, listener);    }    Log.e(LOG_TAG, ""getting updates"");    return true;}private boolean checkLoc(Location location) {    float tempAccuracy = location.getAccuracy();    int locAccuracy = (int) tempAccuracy;    Log.d(LOG_TAG, ""locAccuracy = "" + locAccuracy);    if ((locAccuracy != 0) &amp;&amp; (locAccuracy &lt; LOCATION_ACCURACY)) {        latitude = location.getLatitude();        longitude = location.getLongitude();        latString = latitude.toString();        lonString = longitude.toString();        return true;    }    return false;}public void removeListeners() {    // Log.e(LOG_TAG, ""removeListeners"");    if ((locationmanager != null) &amp;&amp; (listener != null)) {        locationmanager.removeUpdates(listener);    }    locationmanager = null;    // Log.d(LOG_TAG, ""Removed "" + listener.toString());}@Overridepublic void onDestroy() {    super.onDestroy();    removeListeners();}</code></pre><p>Unfortunately, this finds the network provider, but only ever outputs <code>latlng null</code> 30 times - it never seems to get a location at all. I never even get a log statement of <code>locationChanged</code>.</p><p>It's funny, because from ddms I can see output like:</p><pre><code>NetworkLocationProvider: onCellLocationChanged [305,8580]NetworkLocationProvider: getNetworkLocation(): returning cache location with accuracy 75.0</code></pre><p>seeming to suggest that the network provider does have some location info after all, I'm just not getting at it.</p><p>Can anyone help? I think working example code would be a useful resource for the Android/StackOverflow community.</p>","267831","","","","","2013-07-17 09:21:06","Android: get current location from best available provider","<android>","2","1","8","",""
"2504726","1","7617143","","2010-03-24 01:10:37","4","2881","<p>I want to update/insert a new image for an album in MediaStore but i can't get it work..</p><p>This is my code:</p><pre><code>public void updateAlbumImage(String path, int albumID) {  ContentValues values = new ContentValues();  values.put(MediaStore.Audio.Albums.ALBUM_ART, path);  int n = contentResolver.update(MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI, values, MediaStore.Audio.Albums.ALBUM_ID + ""="" + albumID, null);  Log.e(TAG, ""updateAlbumImage("" + path + "", "" + albumID + ""): "" + n); }</code></pre><p>The error is: </p><pre><code>03-24 03:09:46.323: ERROR/AndroidRuntime(5319): java.lang.UnsupportedOperationException: Unknown or unsupported URL: content://media/external/audio/albums03-24 03:09:46.323: ERROR/AndroidRuntime(5319):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:131)03-24 03:09:46.323: ERROR/AndroidRuntime(5319):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:111)03-24 03:09:46.323: ERROR/AndroidRuntime(5319):     at android.content.ContentProviderProxy.update(ContentProviderNative.java:405)03-24 03:09:46.323: ERROR/AndroidRuntime(5319):     at android.content.ContentResolver.update(ContentResolver.java:554)03-24 03:09:46.323: ERROR/AndroidRuntime(5319):     at com.liviu.app.smpp.managers.AudioManager.updateAlbumImage(AudioManager.java:563)03-24 03:09:46.323: ERROR/AndroidRuntime(5319):     at com.liviu.app.smpp.ShowAlbumsActivity.saveImageFile(ShowAlbumsActivity.java:375)03-24 03:09:46.323: ERROR/AndroidRuntime(5319):     at com.liviu.app.smpp.ShowAlbumsActivity.onClick(ShowAlbumsActivity.java:350)</code></pre><p>Thank you!</p>","217360","","243782","","2010-03-24 10:09:02","2011-09-30 23:46:14","How can I update the album art path using contentResolver?","<android>","1","0","4","",""
"2504737","1","2504807","","2010-03-24 01:13:06","6","9260","<p>I have a custom <code>Dialog</code> that contains only a <code>TextView</code> to display some text in my application.  <a href=""http://developer.android.com/intl/fr/resources/faq/commontasks.html#selectingtext"" title=""The documentation"">The documentation</a> lists that only the <code>b</code>, <code>i</code>, <code>u</code>, <code>tt</code>, <code>big</code>, <code>small</code>, <code>sup</code>, <code>sub</code>, and <code>strike</code> tags are supported.  I really need to add some newlines for readability.  Do I need to change to a more complicated layout, or is there some way to encode newlines in the resource?  I tried adding <code>br</code> tags, but that did not help.</p>","4673","","","","","2010-03-24 01:33:54","Add newlines to a text resource in Android?","<android><layout><dialog><resources><textview>","1","0","1","",""
"2504895","1","2504901","","2010-03-24 02:01:44","7","5442","<p>Should I use 32-bit Eclipse or 64-bit Eclipse for Android development? Im on a MacBook Pro (Core 2 Duo). Does it matter which version for Android coding?</p>","246793","","","","","2010-03-24 13:30:42","Which Eclipse for Android?","<android><eclipse><64bit><version><32-bit>","3","0","1","",""
"2505081","1","","","2010-03-24 03:06:33","2","580","<p>I recently formatted my computer and updated to Windows 7. I backed up my keystore and tried to sign my apk with it but it gave me an error that said my certificate expires in 22yrs. which is just shy of what the market requires to upload the apk. So now I am stuck not being able to update my app...</p><p>How did this happen?</p><p>Is there a way to extend the lifetime of certificates so that I can update my app?</p><p>Is there a way to verify this certificate against an old apk that has been uploaded to the market so that I can be sure I am trying to sign with the same certificate and I didn't have a mix up?</p><p><a href=""http://7842005178648529855-a-1802744773732722657-s-sites.googlegroups.com/site/rgrandy/home/Untitled.png?attachauth=ANoY7coTpb0WLPu6fd154Anh44Dff94VhvS_I4vMpELBTwZAajjkNVPu5Lt-f57FltleNooyeMfO7fiE0sqlP0ap51ti1MgJbEoHa9iPIvbWM7k5DY1u4sAs8artBn3k2tVoFIcV2025r6jHEwb__dV9Rblg3yD-QBMgyx2Nn4Xv3-cYV89nYNF2edp40In7M1Kmp2HSTODD&amp;attredirects=0"" rel=""nofollow"">Error Pic</a></p>","247304","","","","","2010-03-24 11:50:13","Android Certificate Changed?","<android><certificate><apk><google-play>","1","0","","",""
"2505179","1","","","2010-03-24 03:37:27","1","547","<p>I'm up and running in Eclipse, have worked through several tutorials and would like to start developing my first marketable app.  Is there anyplace I can find a comprehensive list or catalog of what's available on the Android marketplace?  I'd hate to waste a lot of development time building an app that has twelve free versions already available.</p>","300490","","","","","2013-08-04 14:26:03","Can Anyone point me to a Android Market catalog or application list","<android><list><catalog><marketplace>","4","0","","",""
"2505207","1","","","2010-03-24 03:45:03","14","38756","<p>i had a EditText , a button and a spinner . When click the button , the spinner will add a new item with name you entered in the EditText. But here is the question,  my adapter.add() method seems doesn't work...here is my code:</p><pre><code>public class Spr extends Activity {Button bt1;EditText et;ArrayAdapter&lt;CharSequence&gt; adapter;Spinner spinner;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    bt1 = (Button)this.findViewById(R.id.bt1);    et = (EditText)this.findViewById(R.id.et);      spinner = (Spinner)this.findViewById(R.id.spr);    adapter = ArrayAdapter.createFromResource(            this, R.array.planets_array, android.R.layout.simple_spinner_item);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spinner.setAdapter(adapter);    bt1.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            String temp = et.getText().toString();            adapter.add(temp);            adapter.notifyDataSetChanged();            spinner.setAdapter(adapter);        }    });    spinner.setOnItemSelectedListener(new Spinner.OnItemSelectedListener(){        @Override        public void onItemSelected(AdapterView&lt;?&gt; parent, View view,                int pos, long id) {            Toast.makeText(parent.getContext(), ""The planet is "" +                      parent.getItemAtPosition(pos).toString(), Toast.LENGTH_LONG).show();        }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {        }});}</code></pre><p>}</p><p>thanks! ...still waitting</p>","300477","","300477","","2010-03-25 10:06:52","2014-04-14 20:01:28","how to add item to Spinner's ArrayAdapter?","<android><add><adapter><android-arrayadapter>","4","6","4","",""
"2505393","1","","","2010-03-24 04:47:21","9","38478","<p>I have a WebView and 2 urls to open it it. What I want to do is, when i set a zoom level for 1st url, and then i go to 2nd url, it should also have the same zoom level. Right now, the zoom level resets for both.</p><p>Thanks,Farha</p>","285052","","","","","2014-01-03 12:44:16","Set zoom for Webview","<android>","5","0","6","",""
"2505449","1","2505623","","2010-03-24 05:01:51","2","2512","<p>hi therei want to start an application on receiving sms from a particular number.i am trying it with  onMessageWaitingIndicatorChanged(boolean mwi){ } method buti m struggling.so, anyone there to help me in detail?Thanks </p>","281307","","","","","2010-03-24 05:50:41","Start application on receiving sms from particular number","<android><sms>","1","0","2","",""
"2505653","1","2506598","","2010-03-24 06:00:13","1","724","<p>I want to find out when a user clicks an internal link in a url currently opened in webview. How can I do that?</p><p>Thanks,Farha</p>","285052","","","","","2013-05-19 20:40:06","Internal links in WebView","<android>","1","0","","",""
"2505800","1","2546104","","2010-03-24 06:39:35","2","3495","<p>I have a ListView with a custom Adapter that extends ArrayAdapter. It's a ArrayAdapter of Type Artist. </p><p>Artist is a very small class that has a name and an id. The Artist Class has toString() overridden to return just the name.  </p><p>I have an EditText. The EditText has an TextChangeListener where i call .getFilter().filter(chars, callback) on my adapter. </p><p>In the Filter.Filterlistener().onComplete() callback i print the count and it looks really good. As i type the count decreases. So it seams everything works as advertised, but the List stays the same. I tried to call artistAdapter.notifyDataSetChanged() to force the list to redraw, but nothing happens. [see 2.)]</p><p>I am tinkering around for days now! I am desperate.. Hopefully someone can have a look on my code and tell me what i am doing wrong!</p><p>Thanks!</p><p>Here is what i have done:</p><p>1.) Defined a ListView and an EditText like this:</p><pre><code>&lt;EditText xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/list_search_text""    android:layout_width=""fill_parent""    android:layout_height=""35dip""    android:layout_below=""@id/header""&gt;&lt;/EditText&gt;       &lt;ListView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/list_search""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;&lt;/ListView&gt;</code></pre><p>2.) Setup my ListView in the Activities onCreate():</p><pre><code>private ListView listView = null;private ArtistAdapter artistAdapter = null;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.search_artists);    artistAdapter = new ArtistAdapter(this, R.layout.row, list); // 'list' is an ArrayList&lt;Artist&gt;    listView = (ListView) findViewById(R.id.list_search);    listView.setAdapter(artistAdapter);    listView.setFastScrollEnabled(true);    listView.setTextFilterEnabled(true);    listView.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; av, View v, int position, long id) {            // do something        }    });    EditText txtSearch = (EditText) findViewById(R.id.list_search_text);    txtSearch.addTextChangedListener(new TextWatcher() {        public void afterTextChanged(Editable arg0) { }        public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) { }        public void onTextChanged(CharSequence chars, int start, int before, int count) {            artistAdapter.getFilter().filter(chars, new Filter.FilterListener() {                public void onFilterComplete(int count) {                    Log.d(Config.LOG_TAG, ""filter complete! count: "" + count);                    artistAdapter.notifyDataSetChanged();                }            });        }    });}</code></pre><p>3.) This is my ArtistAdapter in short. I added an remove() and add() method:</p><pre><code>public class ArtistAdapter extends ArrayAdapter&lt;Artist&gt; implements SectionIndexer {    private List&lt;Artist&gt; items;    /* other stuff like overridden getView, getPositionForSection, getSectionForPosition and so on */    @Override    public void remove(Artist object) {        super.remove(object);        items.remove(object);    }    @Override    public void add(Artist object) {        super.add(object);        items.add(object);    }}    </code></pre><p>4.) My artist has also the toString() overridden:</p><pre><code>public class Artist implements Comparable&lt;Artist&gt; {    public String   uid;    public String   name;    public Artist(String id, String name) {        this.uid = id;        this.name = name;    }    public int compareTo(Artist another) {        return this.name.compareToIgnoreCase(another.name);    }    @Override    public String toString() {        return this.name;    }}</code></pre>","300572","","73488","","2010-11-05 03:02:39","2012-01-18 15:59:56","Filtered ListView not updated","<android><listview><filter><android-arrayadapter>","3","0","","",""
"2505921","1","2511655","","2010-03-24 07:13:51","0","2178","<p>as titled, like function calls, application behavior when running</p>","184427","","","","","2011-03-14 08:13:18","What is a good android disassember that can produce infomative results","<java><android><disassembler>","5","0","3","2012-08-26 11:01:13",""
"2505989","1","","","2010-03-24 07:30:08","0","1368","<p>I have an Activity that keeps running after the HOME button is pressed (naturally) and of-course the focus is in the home screen, and when the running process ends i need to restore the focus on that activity.</p>","300592","","1101070","","2012-03-06 01:41:28","2012-03-06 01:41:28","Set focus on a runing Activity","<android><focus><background><foreground>","1","2","1","",""
"2506100","1","2506682","","2010-03-24 07:54:46","3","3731","<p>I can't believe there is no way to change the orientation of the SeekBar widget. I've been perusing this widget's properties and I can't find anything that allows me to change its orientation to vertical.</p><p>So, am I missing something obvious? Do I have to write my own implementation of a seekbar to have its thumb slide up/down instead of left/right?</p>","219985","","","","","2012-05-18 07:23:47","Android seekbar widget: no vertical orientation?","<java><android><android-widget><seekbar>","2","0","","",""
"2506316","1","","","2010-03-24 08:50:53","1","2722","<p>I'm trying to write an application using Bluetooth on Android 1.6. Since it's not officially supported, I found the backport of android.bluetooth API ( <a href=""http://code.google.com/p/backport-android-bluetooth"" rel=""nofollow"">http://code.google.com/p/backport-android-bluetooth</a> ). But when I deploy the sample chat application (modified for backport) LogCat gives me the error below:</p><p>My question is, how I can use backport-android-bluetooth on 1.6 and is there any working samples?</p><p>Thanks!</p><pre><code>    11-30 14:03:19.890: ERROR/AndroidRuntime(1927): Uncaught handler: thread main exiting due to uncaught exception11-30 14:03:19.906: ERROR/AndroidRuntime(1927): java.lang.ExceptionInInitializerError11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at backport.android.bluetooth.BluetoothSocket.&lt;init&gt;(BluetoothSocket.java:69)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at backport.android.bluetooth.BluetoothServerSocket.&lt;init&gt;(BluetoothServerSocket.java:16)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at backport.android.bluetooth.BluetoothAdapter.listenUsingRfcommWithServiceRecord(BluetoothAdapter.java:513)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at com.example.bluetooth.BluetoothChatService$AcceptThread.&lt;init&gt;(BluetoothChatService.java:237)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at com.example.bluetooth.BluetoothChatService.start(BluetoothChatService.java:109)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at com.example.bluetooth.BluetoothChat.onResume(BluetoothChat.java:138)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1225)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at android.app.Activity.performResume(Activity.java:3559)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2838)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2866)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at android.os.Handler.dispatchMessage(Handler.java:99)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at android.os.Looper.loop(Looper.java:123)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at android.app.ActivityThread.main(ActivityThread.java:4203)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at java.lang.reflect.Method.invokeNative(Native Method)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at java.lang.reflect.Method.invoke(Method.java:521)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at dalvik.system.NativeStart.main(Native Method)11-30 14:03:19.906: ERROR/AndroidRuntime(1927): Caused by: java.lang.UnsatisfiedLinkError: classInitNative11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at android.bluetooth.RfcommSocket.classInitNative(Native Method)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     at android.bluetooth.RfcommSocket.&lt;clinit&gt;(RfcommSocket.java:152)11-30 14:03:19.906: ERROR/AndroidRuntime(1927):     ... 21 more</code></pre>","109797","","","","","2011-12-21 12:27:45","Using backport-android-bluetooth on Android 1.6","<android><bluetooth><backport>","4","0","","",""
"2506603","1","","","2010-03-24 09:45:56","0","465","<p>I am looking for a solution to automatically create .m3u playlists for each music folder in my sdcard so that the music player can play music by folders. I had written a simple VB.Net app in the past that does exactly the above but apparently, it has to be run from Windows. Since I have no Java nor Android developing experience I found it quite hard to try to write a similar app that can be run directly from the phone. In a few words, the app does the following:</p><p>1) Searches the SD and lists all folders that contain 2 or more .mp3 files (just for user verification)2) Creates in every listed folder above, a .m3u file that simply lists line-by-line all the mp3 files that exist in the specific folder.</p><p>Is there such an app or could someone spare some time and give me some rough instructions on how to create it in Eclipse 3.5.2 environment? (device used: Motorola Droid/Milestone, Android 2.1) I don't care about any graphics or complex UI, just a script to execute the above procedure that would give every ""playlist-supporting"" music player in Android, the precious ability to play music by folders. I know it is too much to ask but just in case!</p><p>Thanx in advance.</p>","300677","","17971","","2010-03-24 22:18:18","2010-03-24 22:18:18","auto m3u creation","<android><m3u>","1","1","","",""
"2506661","1","2506829","","2010-03-24 09:57:07","5","13824","<p>i want to load some photos into my sd card image in the emulator. how to do this by command prompt.how to do that?</p>","267269","","13992","","2010-04-12 07:48:25","2013-09-08 14:13:14","how to import files into the sdcard on emulator in android?","<android><android-emulator>","5","1","5","",""
"2506876","1","2507069","","2010-03-24 10:31:57","94","31328","<p>when i use toast to display some text on screen it displays little bit above the bottom(default position).</p><p>now i want to display it in the middle of screen or according to my choice can any one guide me how to achieve this?</p><p>any help would be appreciated.</p>","249991","","243782","","2010-03-24 19:23:38","2013-04-26 16:19:56","how to change position of Toast in android?","<android><toast>","2","0","28","",""
"2507217","1","2521346","","2010-03-24 11:31:35","4","988","<p>I'm on developing a twitter kind of Application where in I want that the user would be displayed the timelines and the Textview in the Lists require to perform clicks on (http://)URLs, (@)usernames, and (#)hasTags and I want to invoke custom methods over these actions, I have used the Linkify class and the actions but where of no use because the customization that i require cannot be incorporated.</p>","92039","","","","","2012-10-03 16:00:58","Android Twitter Application Development and Usage of TextView and Linkify","<android><twitter>","3","3","1","",""
"2507246","1","","","2010-03-24 11:36:12","2","795","<p>Greets, </p><p>I have a custom view which is drawing some bitmaps on screen. I want to scale the bitmaps depending on some sensor data. Can anyone suggest to me the best way (performance wise) to scale the bitmaps. </p><p>Right now I'm creating the bitmaps in the constructor of the view but if I start to scale it in the onDraw method I believe I'll just be re-drawing the bitmaps (Which will be a memory / cpu hog). </p><p>Any suggestions for what I should do. </p>","84278","","","","","2010-03-24 13:44:12","Best way to scale a bitmap in a view?","<android>","1","0","","",""
"2507322","1","2507365","","2010-03-24 11:49:38","1","7481","<p>I have my own custom Content Provider that loads a database which contains the settings information for my application.</p><p>I load the settings from the ContentProvider on the creation of my Settings activity.</p><p>My Settings activity is made up of a PreferenceScreen and Dialog based EditText's.</p><p>The following code shows how I use the preference screen and edit texts.</p><p>So as you can see from the first image this works and displays the menu with the information underneath.</p><p>The problem is in image two, when I click on a choice in the menu the dialog pops up but it is empty, I would like to be able to load the data from my content provider into the edit text in the dialog, so in image one it shows ""Donal"" as the user name so in image two ""Donal"" should also appear in the edit text in the dialog.</p><p>I would also like to be able to listen to the OK button in the dialog so when a user changes a setting I can update the data in my content provider.</p><p>Can anyone help me with what I'm trying to do?</p><hr><p><strong>Code</strong></p><pre><code>public class PreferencesApp extends PreferenceActivity {String name;EditTextListener etl;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    loadSettingsFromProvider();    etl = new EditTextListener(this);    setPreferenceScreen(createPreferenceHierarchy());}private PreferenceScreen createPreferenceHierarchy() {    // Root    PreferenceScreen root = getPreferenceManager().createPreferenceScreen(this);    // Dialog based preferences    PreferenceCategory dialogBasedPrefCat = new PreferenceCategory(this);    dialogBasedPrefCat.setTitle(R.string.dialog_based_preferences);    root.addPreference(dialogBasedPrefCat);    // Edit text preference    EditTextPreference editTextPref = new EditTextPreference(this);    editTextPref.setDialogTitle(R.string.dialog_title_edittext_preference);    editTextPref.setKey(""edittext_preference"");    editTextPref.setTitle(R.string.title_edittext_preference);    editTextPref.setSummary(name);    dialogBasedPrefCat.addPreference(editTextPref);    return root;}public class EditTextListener extends EditTextPreference{    public EditTextListener(Context context){        super(context);    }    @Override    //When the dialog is closed, perform the relevant actions    protected void onDialogClosed(boolean positiveResult) {        if (positiveResult) {         String text=getEditText().getText().toString();         Log.d(""DIALOG CLOSED"", ""OK"");         }        else {         // cancel hit         Log.d(""DIALOG CLOSED"", ""CANCEL"");        }    }       }</code></pre>","243999","","12388","","2010-07-24 15:27:32","2010-07-24 15:27:32","Android - Using PreferenceScreen to display and save settings to/from ContentProvider","<android><dialog><edittext><android-contentprovider><preference>","1","0","1","",""
"2507379","1","2507601","","2010-03-24 11:59:32","3","4062","<p>I'm looking for a user interface for a MediaPlayer which should be able to play video as well as audio files.<br>Furthermore it needs the following things (nothing fancy):  </p><ul><li>TextView for playing time</li><li>Progress Bar for progress visulization</li><li>Play/Pause/Stop buttons</li><li><strong>NO</strong> playlist functionality required, the player will <em>only</em> play a single item (that's why I don't need next/previous buttons).</li></ul><p>It sounds pretty much like the standard audio-player of Android >= 2.0. Sure, I could try to find its source code but that would require to tediously check out the entire source. I'm just asking for a more efficient way.</p><p>Thanks in advance,<br>steff</p>","289849","","","","","2010-03-24 12:47:24","Open source VideoPlayer / AudioPlayer / MediaPlayer GUI / UI resource available?","<android><gui><open-source><resources><media-player>","1","0","2","",""
"2507552","1","","","2010-03-24 12:23:59","4","285","<p>I am developing an application that gets notified when an <code>Activity</code> chosen by a user is started. For this to work, the best approach would be to register a <code>BroadcastReceiver</code> for <code>ACTION_MAIN</code> explicit <code>Intent</code>s, which as far as I know doesn't work (because these <code>Intent</code>s have specific targets). Another, probably less efficient approach, is to use the system <code>ActivityManager</code> and poll on the <code>getRunningTask()</code> which returns a list of all running tasks at the moment. The polling can be done by a background service. By monitoring the changes in this list, I can see whether an activity is running or not, so that my application can get notified. The downside is of course the polling. I have not tried this yet, but I think that this last approach will probably work.</p><p>Does anyone know of a better approach(es) or suggestions which are less intensive?</p>","290744","","559850","","2011-07-21 15:48:31","2011-07-21 16:09:51","Get notified/receive explicit intents when an activity starts","<android>","1","1","1","",""
"2507712","1","","","2010-03-24 12:49:00","0","1981","<p>I have a <code>LinearLayout</code> View with a <code>OnClick</code>handler and I want to add a View after the LinearLayout programatically when the OnClick event is fired.</p><pre><code>public void onClick(View view) {    LayoutInflater li = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);    LinearLayout info = (LinearLayout) li.inflate(R.layout.infolayer, null);    // view.addViewAfter(info)}</code></pre><p><code>info</code> is the View i want to add. <code>view</code> is the View on which the click goes and after which I want to add <code>info</code>.</p><p>How can I do that?</p>","288980","","","","","2014-01-09 19:30:28","Android: Add view onclick after the view itself","<android><layout><onclick><android-linearlayout>","3","0","0","",""
"2507798","1","2507873","","2010-03-24 13:01:41","15","3285","<p>How do I prevent a TextView, or any visual object, from wrapping to the screen and instead have them chopped off the sides? Is there some XML attribute or code to do this or is it impossible to have anything overflow from the screen?</p><p>For example, you have this:</p><p><img src=""http://i43.tinypic.com/6xwyzd.jpg"" alt=""text being wrapped""></p><p>But you really want this:</p><p><img src=""http://i43.tinypic.com/i5rc51.jpg"" alt=""text being cropped""></p><p>Any ideas?</p>","80428","","","","","2010-03-24 15:02:45","Stop objects from wrapping in Android","<android>","3","0","3","",""
"2507898","1","2508138","","2010-03-24 13:17:42","182","111972","<p>This question was originally asked for Android 1.6.</p><p>I am working on photos options in my app. </p><p>I have a button and an ImageView in my Activity. When I click the button it would redirect to gallery and I would be able to select an image. The selected image would appear in my ImageView. </p><p>How to do that? Any ideas?</p>","267269","","1279334","","2012-09-22 12:55:04","2014-03-07 05:08:25","How to pick an image from gallery (SD Card) for my app in Android?","<android><android-image><android-gallery>","7","0","137","",""
"2507958","1","","","2010-03-24 13:26:01","2","1574","<p>I have a View in an Android application, which is used to show a graphic. This View is being animated by a translation animation, specified in an XML file. In my case, the translation is moving the View from right to left across the screen.</p><p>I'd like to be able to tell where on the screen the View is when a touch event occurs, but I can't find any method which would let me do this. I've tried View.getLeft() and View.getTop(), and I've tried getting position settings by overriding onLayoutChanged().</p><p>I can see that back in 2008 this sort of thing wasn't possible, but was planned:</p><p><a href=""http://code.google.com/p/android/issues/detail?id=321"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=321</a></p><p>...but can't see if it's ever made it into Android. Anyone know how I might do this?</p>","300823","","","","","2010-03-24 13:26:01","How can I find the current position of a View when it's being translated by a tweening animation?","<android><animation><view><translation><tween>","0","1","1","",""
"2507960","1","2508110","","2010-03-24 13:26:11","87","166683","<p>After android installs an application from the Marketplace, does it keep the .apk file?</p><p>Is there a standard location where Android would keep such files?</p>","188622","","","","","2013-12-27 06:04:16","Does Android keep the .apk files? if so where?","<android><packages><apk><installer>","11","0","42","",""
"2508008","1","2508342","","2010-03-24 13:33:56","0","1059","<p>I'm building an Android application that's based around an enhanced WebView (based on PhoneGap).  I've enhanced the WebView so that from JavaScript running inside you can invoke the native contact picker to choose a phone number (which may be supplied by Facebook for example).</p><p>The problem I have is that the native contact picker runs in an activity in another process and the Android docs say that while another activity is open my activity may get destroyed due to memory constraints.  I haven't actually seen this happen in my application but if it did then I'm guessing my WebView's state would be destroyed and the code that was waiting for the picked contact would be terminated.</p><p>It seems a bit crazy that the activity requesting a contact could be destroyed while the contact picker is open.  Does anyone know if that does indeed happen?  Is there a way to persist the state of the WebView if it does?</p><p>Thanks,</p><p>-Shaun</p>","300834","","115145","","2010-03-24 14:15:11","2010-03-24 14:15:11","How should I deal with persisting an Android WebView if my activity gets destroyed while showing another one?","<android><phonegap>","2","0","","",""
"2508681","1","2508768","","2010-03-24 14:55:59","2","108","<p>I come from a PHP background and I'm just getting my teeth into some Java. I was wondering how I could implement the following in Java as simply as possible, just echoing the results to a terminal via the usual ""<code>System.out.print()</code>"" method.</p><pre><code>&lt;?php$Results[0]['title'] = ""No Country for Old Men"";$Results[0]['run_time'] = ""122 mins"";$Results[0]['cert'] = ""15"";$Results[1]['title'] = ""Old School"";$Results[1]['run_time'] = ""88 mins"";$Results[1]['cert'] = ""18"";// Will basically show the above in order.foreach($Results as value) {     echo $Results[$value]['title'];     echo $Results[$value]['run_time'];     echo $Results[$value]['cert'];}// Lets add some more as I need to do this in Java too$Results[2]['title'] = ""Saving Private Ryan"";$Results[2]['run_time'] = ""153 mins"";$Results[2]['cert'] = ""15"";// Lets remove the first one as an example of another need$Results[0] = null;?&gt;</code></pre><p>I hear there are ""list iterators"" or something that are really good for rolling through data like this. Perhaps it could be implemented with that?</p><p>A fully working <code>.java</code> file would be most handy in this instance, including how to add and remove items from the array like the above.</p><p>P.S. I do plan on using this for an Android App in the distant future, so, hopefully it should all work on Android fine too, although, I imagine this sort of thing works on anything Java related :).</p>","231248","","2598","","2010-03-24 15:36:21","2010-03-24 20:10:32","How do I perform this MutliArray setup in Java?","<java><php><android><arrays><arraylist>","2","0","","",""
"2508879","1","2508944","","2010-03-24 15:19:26","6","10095","<p>i', trying to make a simple 3d game for android, and i want to use jmonkeyengine, Can i do this? How can i do it? Someboy can show me an example?</p><p>thanks!!!</p>","300935","","324625","","2011-12-22 03:56:42","2013-05-24 06:27:04","Can i use jmonkeyengine on android?","<java><android><3d><jmonkeyengine>","2","0","0","2013-06-20 08:10:53",""
"2509162","1","2512797","","2010-03-24 15:53:22","3","1005","<p>I am trying to make a simple 3D game for Android, and I want to use jMonkeyEngine. Can I do this? How? Can someone show me an example?</p><p>Thanks!</p>","300935","","1287593","","2012-04-27 06:33:39","2012-11-15 09:05:48","Can I use jMonkeyEngine for Android Devices?","<android><jmonkeyengine>","2","0","","",""
"2509189","1","","","2010-03-24 15:56:19","0","1432","<p>hi groupThis may be a simple question but i am a beginner ,i need your  suggestion on this. i have two Activities A1 and A2 .When i click the image on A1 screen i have to display progress bar until A2 screen appears(A2 activity has huge task to do).I tried </p><pre><code> image.setOnClickListener(new ImageView.OnClickListener() {            public void onClick(View v)            {             myProgressDialog = ProgressDialog.show(A1.this,                             ""Please wait..."", ""Loading..."", true);              new Thread() {                   public void run() {                        try{                        Intent i = new Intent(A1.this,.A2.class);                        startActivity(i);                        } catch (Exception e) {  }                        // Dismiss the Dialog                        myProgressDialog.dismiss();                   }              }.start();             }        });</code></pre><p>This couldn't display progress bar .I know that i am making a mistake but i couldn't figure out  </p>","286044","","13070","","2010-03-24 17:33:26","2011-08-09 14:22:49","cannot display progress bar at the time of loading another Activity in Android","<android><progress-bar>","2","0","","",""
"2509349","1","2509385","","2010-03-24 16:15:37","2","390","<p>I just want to show text ""please wait"" while app is searching for satellite and show ""ready"" when we found and connected to satellite.How can I do it?</p>","169736","","","","","2010-03-24 16:20:21","How to know that satellite is already found or searching on android?","<android><gps>","1","0","","",""
"2509429","1","2509589","","2010-03-24 16:26:11","0","647","<p>Is it possible to pack resources in a way that they get distributed with apk? I know it's impossible to use subfolders in res's directories (drawable, raw, etc)... so I was wondering if I can create folder (data) and somehow tell compiler to include all resources from that folder - and later access them with InputStream (without using R.)</p><p>Thanks!</p>","237858","","","","","2010-03-24 16:45:00","Android - Pack resources into apk","<android>","1","0","","",""
"2509688","1","","","2010-03-24 16:57:03","3","2659","<p>I would like to know if OMA DM features are supported in Android APIs; well, I have seen that reading certain values from Settings.Secure is possible, but writing is not. I am interested in changing the email,APN,WAP,and mms Settings remotely without displaying the interference to users... Any APIs are available for removing ,listing,and installing applications? Same thing for locking the phone and wiping its content.</p><p>Thank you!</p>","301029","","","","","2011-04-17 06:11:55","OMA DM features supported in ANDROID APIs?","<android><oma-dm>","1","2","1","",""
"2510170","1","2510643","","2010-03-24 17:53:13","1","329","<p>I understand the title may sound confusing, but the goal is very clear:</p><p>I am building an application that requires two tables: tracks and waypoints.</p><p>A user enters the track name via a textfield and the table generates an ID under track_id. </p><p>in the waypoints table there is a column called track_id_fk. When the OnLocationChanged() method is called, the longitude and latitude is entered into the table, along with the time.</p><p>I want to add the track_id of the newest track entry in the track table to the track_id_fk column in the waypoints table.</p><p>I am using the following code:</p><pre><code>SQLiteDatabase db = waypoints.getWritableDatabase();        ContentValues waypointvalues = new ContentValues();        waypointvalues.put(LONGITUDE, loc.getLongitude());        waypointvalues.put(LATITUDE, loc.getLatitude());        waypointvalues.put(TIME, System.currentTimeMillis());        waypointvalues.put(TRACK_ID_FK, ""last inserted trackid"");        db.insertOrThrow(TABLE_NAME, null, waypointvalues);</code></pre><p>I am unsure as to what the value should be where ""last inserted trackid"" is.</p><p>Thanks</p>","296810","","243782","","2010-03-24 18:34:55","2010-03-24 19:05:01","How to insert the latest row_id of a table into a different table using Android and SQLite","<java><android><sqlite><join>","1","0","","",""
"2510354","1","2510442","","2010-03-24 18:22:56","4","2179","<p>I'm developing an Activity with a simple LinearLayout with a button. When I try the activity on my hardware (WVGA 480x800 screen) the activity only fills the standard size (480x320) while the OS itself fills the whole screen.</p><p>What could be the issue.</p><p>Thanks,</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:background=""#FFF""                    android:fitsSystemWindows=""true""&gt;          &lt;Button android:text=""@+id/Button01"" android:id=""@+id/Button01""                          android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","301094","","","","","2010-03-24 18:36:17","Android activity won't fill WVGA screen","<android><layout><screen>","1","0","1","",""
"2510717","1","2517329","","2010-03-24 19:14:40","0","701","<p>i am a newbie trying to learn android by doing a todo application.so far i have:</p><ul><li>list all todos</li><li>create a todo(insert into database)</li></ul><p>i need help adding a delete featuremy xml structure for todo list is that i have a TableLayout. and to display my todo list, i put my todo in a textview and i put that textview into a tablerow and i put that tablerow into my tablelayout.</p><p>now i want to add a delete button to the right of my todo list. my question is<strong>is there a default delete button that i can use? how do i handle the onclick event, i mean like if a click on a delete button, how do i know which todo this button is for?and is my layout correct?</strong></p>","157332","","","","","2011-12-25 05:16:17","android todo list application question","<android>","2","0","1","",""
"2510900","1","","","2010-03-24 19:45:17","3","475","<p>An Android Java project placed in a git repository and built in an Android tree in <code>/packages/apps</code> needs to have the project files located at the root of the git repository.</p><p>This is problematic for creating a complementary Test project, which should ideally be included in the same git repository so commits are atomic for both code and tests.  Eclipse gets very unhappy if you include the Test project as a subdirectory.</p><p>Is there an appropriate approach for dealing with this other than creating a second repository?</p>","288557","","288557","","2010-03-25 05:08:08","2010-04-25 00:26:21","Android Eclipse test projects cannot be used with a project being built in an Android build tree","<java><android><eclipse><git>","2","0","1","",""
"2511045","1","","","2010-03-24 20:13:02","12","21258","<p>I'm trying to write a light-weight <code>HTTP</code> server in my app to <code>feed</code> dynamically generated <code>MP3</code> data to the built-in <code>Android</code> <code>MediaPlayer</code>.  I am not permitted to store my content on the <code>SD card</code>.</p><p>My input data is essentially of an infinite length.  I tell <code>MediaPlayer</code> that its data source should basically be something like <code>""http://localhost/myfile.mp3""</code>.  I've a simple server set up that waits for <code>MediaPlayer</code> to make this request.  However, <code>MediaPlayer</code> isn't very cooperative.  At first, it makes an <code>HTTP GET</code> and tries to grab the whole file.  It times out if we try and simply dump data into the <code>socket</code> so we tried using the <code>HTTP</code> Range header to write data in chunks.  <code>MediaPlayer</code> doesn't like this and doesn't keep requesting the subsequent chunks.</p><p>Has anyone had any success streaming data directly into <code>MediaPlayer</code>?  Do I need to implement an <code>RTSP</code> or <code>Shoutcast</code> server instead?  Am I simply missing a critical <code>HTTP header</code>?  What strategy should I use here?</p><p>Rob Szumlakowski</p><p>-- Later, I managed to solve the problem:</p><p>The <code>HTTP</code> Server was indeed hosted on the phone itself.  It was very simple: just a <code>thread</code> listening on a socket for an <code>HTTP GET</code> request.  When it got the <code>HTTP</code> request, it would one a <code>new socket</code>, write back some <code>HTTP</code> headers and start dumping the <code>MP3</code> audio data back to the <code>socket</code>.  This <code>HTTP</code> server didn't do anything else.</p><p>The <code>Android Media Player</code> was playing the music as I was streaming to it.  The <code>Media Player</code> behaved very poorly if its playback <code>buffer</code> was emptied while it was playing audio.  It was very important for me to make sure my <code>HTTP</code> server kept writing data into that <code>socket</code>.I moved bytes into the socket in small chunks (10 kB). The headers on my <code>HTTP</code> response ended up looking like this:</p><pre><code>// Build response headersStringBuilder sb = new StringBuilder();sb.append( ""HTTP/1.1 200 OK\r\n"");sb.append( ""Content-Type: audio/mpeg\r\n"");sb.append( ""Connection: close\r\n"" );sb.append( ""Accept-Ranges: bytes\r\n"" );sb.append( ""Content-Length: "" + totalFileSize + ""\r\n"" );sb.append( ""Content-Disposition: inline; filename=xxxxx.mp3\r\n\r\n"");</code></pre><p>As long as I kept the pipe stoked, the <code>Android Media Player</code> kept consuming it without complaint.  Playing audio only required one request and response.  It ended up working pretty well.</p>","299234","","517247","","2011-11-30 10:49:26","2012-10-30 09:40:15","Streaming to the Android MediaPlayer","<android><http><stream><media-player>","2","2","12","",""
"2511145","1","2512568","","2010-03-24 20:27:50","2","21387","<p>Ok this is my application :</p><p>An Android app to allow me to submit CokeZone codes into CokeZone.co.uk from a mobile app instead of from the website.</p><p>So I wrote this section of code to do the post logon command and then check to see if im logged in after.</p><p>Problem is - the html I get from the homepage after I send the post command is the default - as if im not logged in - so something is going wrong.</p><p>Can anyone please help! Its probably the URL im sending the POST to, or the params within the POST command - I havent done much of this stuff so its probably something obvious.</p><p>Below is my code so far:</p><pre><code> DefaultHttpClient httpclient = new DefaultHttpClient();    HttpGet httpget = new HttpGet(url);    HttpResponse response = httpclient.execute(httpget);    HttpEntity entity = response.getEntity();    thisResponse = printPage(entity.getContent());    Log.e(""debug"",thisResponse);    System.out.println(""Login form get: "" + response.getStatusLine());    if (entity != null) {        entity.consumeContent();    }    System.out.println(""Initial set of cookies:"");    List&lt;Cookie&gt; cookies = httpclient.getCookieStore().getCookies();    if (cookies.isEmpty()) {        System.out.println(""None"");    } else {        for (int i = 0; i &lt; cookies.size(); i++) {            System.out.println(""- "" + cookies.get(i).toString());        }    }    HttpPost httpost = new HttpPost(""https://secure.cokezone.co.uk/home/blank.jsp?_DARGS=/home/login/login.jsp"");    List &lt;NameValuePair&gt; nvps = new ArrayList &lt;NameValuePair&gt;();    nvps.add(new BasicNameValuePair(""_dyncharset"", ""ISO-8859-1""));    nvps.add(new BasicNameValuePair(""/grlp/login/LoginHandler.loginFormBean.name"",""renegadeandy%40gmail.com""));    nvps.add(new BasicNameValuePair(""_D:/grlp/login/LoginHandler.loginFormBean.name"", ""+""));    nvps.add(new BasicNameValuePair(""/grlp/login/LoginHandler.cookiedUser"", ""false""));    nvps.add(new BasicNameValuePair(""_D:/grlp/login/LoginHandler.cookiedUser"", ""+""));    nvps.add(new BasicNameValuePair(""/grlp/login/LoginHandler.loginFormBean.password"", ""passwordval""));    nvps.add(new BasicNameValuePair(""_D:/grlp/login/LoginHandler.loginFormBean.password"", ""+""));    nvps.add(new BasicNameValuePair(""/grlp/login/LoginHandler.rememberMe"", ""yes""));    nvps.add(new BasicNameValuePair(""_D:/grlp/login/LoginHandler.rememberMe"", ""false""));    nvps.add(new BasicNameValuePair(""/grlp/login/LoginHandler.aSuccessURL"", ""http://www.cokezone.co.uk/home/index.jsp""));    nvps.add(new BasicNameValuePair(""_D:/grlp/login/LoginHandler.aSuccessURL"", ""+""));    nvps.add(new BasicNameValuePair(""/grlp/login/LoginHandler.aErrorURL"", ""http://www.cokezone.co.uk/home/index.jsphttps://secure.cokezone.co.uk/home/index.jsp""));    nvps.add(new BasicNameValuePair(""/grlp/login/LoginHandler.aErrorURL"", ""+""));    nvps.add(new BasicNameValuePair(""/grlp/login/LoginHandler.explicitLogin"", ""true""));    nvps.add(new BasicNameValuePair(""_D:/grlp/login/LoginHandler.explicitLogin"", ""+""));    nvps.add(new BasicNameValuePair(""/grlp/login/LoginHandler.fICLogin"", ""login""));    nvps.add(new BasicNameValuePair(""_D:/grlp/login/LoginHandler.fICLogin"", ""+""));    nvps.add(new BasicNameValuePair(""/grlp/login/LoginHandler.fICLogin"", ""LOGIN""));    nvps.add(new BasicNameValuePair(""_D:/grlp/login/LoginHandler.fICLogin"", ""+""));    nvps.add(new BasicNameValuePair(""_DARGS"", ""/home/login/login.jsp""));    httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));    response = httpclient.execute(httpost);    entity = response.getEntity();    System.out.println(""Login form get: "" + response.getStatusLine());    if (entity != null) {      thisResponse = printPage(entity.getContent());      entity.consumeContent();    }    Log.e(""debug"",thisResponse);    Log.e(""debug"",""done"");    httpget = new HttpGet(""http://www.cokezone.co.uk/home/index.jsp"");    response = httpclient.execute(httpget);    entity = response.getEntity();  TextView points = (TextView)findViewById(R.id.points);  points.setText(getPoints(entity.getContent()).toString());  debug.setText(thisResponse);    System.out.println(""Post logon cookies:"");    cookies = httpclient.getCookieStore().getCookies();    if (cookies.isEmpty()) {        System.out.println(""None"");    } else {        for (int i = 0; i &lt; cookies.size(); i++) {            System.out.println(""- "" + cookies.get(i).toString());        }    }</code></pre>","265683","","","","","2010-05-26 16:00:20","DefaultHttpClient GET and POST commands Java Android","<java><android><http><post><httpwebrequest>","1","0","3","",""
"2511195","1","2511215","","2010-03-24 20:35:08","0","868","<p>m.google.com somehow requests the current location when loaded in Android's browser.</p><p>I want to do the same thing from a web page being loaded into a WebView in my own application.  Is the only way to go about this with <code>WebView.addJavascriptInterface()</code>, or is there already a javascript interface available for webapps to use?</p>","238849","","243782","","2010-03-24 20:39:37","2010-03-24 20:39:37","Getting location via a web application being run in a WebView","<android><html5><geolocation>","1","0","","",""
"2511371","1","","","2010-03-24 21:00:25","3","465","<p>I have a really strange problem.</p><p>I need to build custom sqlite3 database engine under Android OS, but I also want to use database provider implementation. Unfortunately when examining sources of Android 1.6 I noticed that it's not so easy.</p><p>Many classes including android.database.<em>; packages use original provider, also many other parts of framework use android.database.sqlite.</em>; packages directly, wich ofcourse make this abstraction a bit confusing and unnesesary.</p><p>But going to my question. If there is any way that I could extend database interfaces to use custom implmentation of sqlite (or any other database)?</p>","301207","","","","","2010-08-13 03:24:24","How to build custom sqlite with provider under Android?","<android><sqlite><build>","1","0","2","",""
"2512010","1","","","2010-03-24 22:52:36","7","9793","<p>I have come across some very unexpected (and incredibly frustrating) functionality while trying to restore the state of a list of CheckBoxes after a screen rotation.  I figured I first would try to give a textual explanation without the code, in case someone is able to determine a solution without all the gory details.  If anyone needs more details I can post the code.</p><p>I have a scrolling list of complex Views that contain CheckBoxes.  I have been unsuccessful in restoring the state of these check boxes after a screen rotation.  I have implemented onSaveInstanceState and have successfully transfered the list of selected check boxes to the onCreate method.  This is handled by passing a long[] of database ids to the Bundle.</p><p>In onCreate() I check the Bundle for the array of ids.  If the array is there I use it to determine which check boxes to check when the list is being built.  I have created a number of test methods and have confirmed that the check boxes are being set correctly, based on the id array.  As a last check I am checking the states of all check boxes at the very end of onCreate().  Everything looks good... unless I rotate the screen.</p><p>When I rotate the screen, one of two things happens: 1) If any number of the check boxes are selected, except for the last one, all check boxes are off after a rotation. 2) If the last check box is checked before rotation, then all check boxes are <em>checked</em> after rotation.</p><p>Like I said, I check the state of the boxes at the very end of my onCreate().  The thing is, the state of the boxes at the end of onCreate is <em>correct</em> based on what I selected before the rotation.  However, the state of the boxes on the screen does not reflect this.</p><p>In addition, I have implemented each check box's setOnCheckChangedListener() and I have confirmed that my check boxes' state's are being altered <em>after</em> my onCreate method returns.</p><p>Anyone have an idea of what is going on?  Why would the state of my check boxes change after my onCreate method returns?</p><p>Thanks in advance for your help.  I have been trying to degub this for a couple days now.  After I found that my check boxes were apparently changing somewhere outside my own code I figured it was time to ask around.</p>","301282","","","","","2013-01-24 11:15:44","Android CheckBox -- Restoring State After Screen Rotation","<android><checkbox><rotation><restore>","7","1","5","",""
"2512436","1","2512595","","2010-03-25 00:44:53","0","2431","<p>I have created an expandable list in my Android application using the SimpleExpandableListAdapter type.But I'm at a complete loss as to how I detect events when one of the child entries has been selected/clicked.</p><p>I've tried all the usual OnClickListener/OnChildClickListener etc, but can't seem to find (by experimentation, or half an hour googling) what the correct handler routines should be.</p><p>Any help greatfully appreciated.</p>","301331","","","","","2010-06-08 20:24:30","How to handle Android SimpleExpandableListAdapter entry selection","<android><event-handling><handler>","2","0","","",""
"2512734","1","2512880","","2010-03-25 02:16:58","3","500","<p>I have an <code>ArrayAdapter</code> powering a <code>ListView</code>. I would like to change the data behind the <code>ArrayAdapter</code> and update the <code>ListView</code>'s. Sounds like <code>notifyDataSetChanged();</code> would be exactly what I am looking for, but it updates the entire <code>ListView</code>, and I would prefer to update on a row-by-row basis. </p><p>Is there a way to do this with <code>ArrayAdapter</code>, or do I need to manage my data some other way if I want this functionality? </p>","119592","","","","","2010-03-25 03:20:11","How to avoid re-drawing all views in an ArrayAdapter","<android><listview><android-arrayadapter>","1","0","","",""
"2513172","1","2515183","","2010-03-25 05:01:53","4","1268","<p>I have a Web Service and an Android application that uses this web service. I want to make this applicationsubscription based. The user would subscribe to the service and would be able to use ittill their subscription is valid.</p><p>I understand that to create such an application, we would have to integrate necessary checks in the service and validate a subscription every time it is used on the backend.</p><p>But is it possible to do all(well, at least most of) this, on the handset itself? Is it possible to achieve the following in an Android application?</p><ol><li>Make the application work only for a limited period of time(till the subscription is valid).If yes, how?</li><li>How to maintain data about the subscription and where?</li></ol><p>What could be the best approach to creating such an application?   </p><p>Please advise.<br>Thanks!    </p><p>[Note: this is a follow-up of <a href=""http://stackoverflow.com/questions/2497895/what-are-subscription-applications"">this</a> question I'd asked before]</p>","236128","","","","","2011-03-23 01:14:41","Approaches to writing subscription based applications in Android","<android><mobile-application>","2","0","3","",""
"2513490","1","","","2010-03-25 06:28:09","1","263","<p>I have a difficult time trying to install Hebrew/Arabic fonts on my level 7 (API 2.1) or ""Nexus emulator"". After rw mount/remount I can do it for level 3 devices, but not for Nexus! Why? What can be done? People using real physical devices already got this to work on the hardware.</p><p>That's what must be done for some of us:</p><ol><li>We need system image saved on exit for tomorrow to continue the work</li><li>Open emulator to work in peace</li><li>cp command included with the SDK.</li></ol><p>Please make me happy and give the chance to install the fonts. Any help would be appreciated.</p>","284517","","31161","","2011-08-04 15:03:29","2011-08-04 15:03:29","Installing fonts","<android><fonts><arabic><hebrew>","0","4","","",""
"2513518","1","","","2010-03-25 06:38:34","4","11800","<p>Is it possible to show two activities on the same screen at the same time?I need each activity to show data that changes with time.</p>","297082","","996592","","2013-08-05 00:28:03","2013-08-05 00:28:03","Display multiple activities on same screen","<android><activity>","3","0","1","",""
"2513578","1","2517565","","2010-03-25 06:53:35","3","18757","<p>I am using gesture detector to catch ""flings"" and using a view flipper to change the screen when this happens. Some of my child views contain list views. The the gesture detector wont recognize a swipe if you swipe on the list view. But it will recognize it if it is onTop of TextView's or ImageView's. Is there a way to implement it so that it will recognize the swipes even if they are on top of another view that has a ClickListener?</p>","277215","","","","","2010-11-23 00:39:26","Android ViewFlipper + Gesture Detector","<android><layout><gesture><swipe><viewflipper>","3","0","5","",""
"2513645","1","2568420","","2010-03-25 07:06:56","0","583","<p>I have an Android application that connects to Facebook to request authorization of an Application.</p><p>I use the following setting in the WebView, but once the view is loaded, I can't type in login details. What I am missing?</p><pre><code>WebView webview;webview = (WebView) findViewById(R.id.facebookview);webview.getSettings().setJavaScriptEnabled(true);webview.setWebViewClient(new FacebookWebViewClient());webview    .loadUrl(""http://www.connect.facebook.com/login.php?return_session=1&amp;nochrome=1&amp;fbconnect=1&amp;extern=2&amp;connect_display=popup&amp;api_key=""            + FConnect.API_KEY            + ""&amp;v=1.0&amp;next=""            + FConnect.SUCCESS_URL            + ""%3Ffb_login%26fname%3D_opener&amp;cancel_url=""            + FConnect.CANCEL_URL            + ""%23fname%3D_opener%26%257B%2522t%2522%253A3%252C%2522h%2522%253A%2522fbCancelLogin%2522%252C%2522sid%2522%253A%25220.741%2522%257D&amp;channel_url=""            + FConnect.XD_RECEIVER);</code></pre><p><img src=""http://img100.imageshack.us/img100/2100/facebookconnect.png"" alt=""alt text""></p>","243782","","","","","2010-05-26 21:00:06","Webview can't type in, is that because of missing setting?","<java><android><facebook><webview>","1","0","","",""
"2513713","1","2517003","","2010-03-25 07:26:13","15","45347","<p>How to use 3G Connection in Android Application instead of Wi-fi?</p><p>I want to connect a 3G connection, is there any sample code to connect to 3G instead of Wi-fi?</p>","212809","","","Roger Pate","2010-03-26 15:41:54","2014-02-11 13:38:21","How to use 3G Connection in Android Application instead of Wi-fi?","<android><android-emulator>","7","2","14","",""
"2513720","1","","","2010-03-25 07:28:36","2","2447","<p>I am looking for a way to connect to Android devices via Bluetooth without user intervention(assuming at least on device is set to ""Discoverable""). Since 2.0, it seems the devices prompt for a random pin to be entered when connecting to each other for the first time. I've tried some Bluetooth projects, but none seem to work as the underlying Bluetooth Adapter code always kicks in.</p><p>Is there any way around this? Thanks.</p>","249531","","","","","2012-11-01 10:09:38","Android: Any way to auto-pair to another device over Bluetooth without prompting for a pin?","<android><bluetooth>","2","0","1","",""
"2513743","1","","","2010-03-25 07:35:13","0","295","<p>I am new in android and had developed an app which get images from the website and display it. I got it working in emulator but not in real phones. In some device, it will crash or take very long loading period. Can anyone please help me or guide me in improving it as i'm not sure whether the way i loads the images is correct or not.</p><p>Here are the code i use to get the images from the web and display accordingly.</p><pre><code>if (xmlURL.length() != 0) { try {    URL url = new URL(xmlURL);     SAXParserFactory spf = SAXParserFactory.newInstance();    SAXParser sp = spf.newSAXParser();/* Get the XMLReader of the SAXParser we created. */XMLReader xr = sp.getXMLReader();/* * Create a new ContentHandler and apply it to the * XML-Reader */xr.setContentHandler(myExampleHandler);/* Parse the xml-data from our URL. */xr.parse(new InputSource(url.openStream()));/* Parsing has finished. *//* * Our ExampleHandler now provides the parsed data to * us. */ParsedExampleDataSet parsedExampleDataSet = myExampleHandler.getParsedData(); } catch (Exception e) {   }  }  if (s.equalsIgnoreCase(""wallpapers"")) {   Context context = helloAndroid.this.getBaseContext();   for (int j = 0; j &lt;= myExampleHandler.filenames.size() - 1; j++) {    if (myExampleHandler.filenames.elementAt(j).toString() != null) {     helloAndroid.this.ed = myExampleHandler.thumbs.elementAt(j)       .toString();     if (helloAndroid.this.ed.length() != 0) {      Drawable image = ImageOperations(context,        helloAndroid.this.ed, ""image.jpg"");      file_info = myExampleHandler.filenames        .elementAt(j).toString();      author = ""\nby ""        + myExampleHandler.authors.elementAt(j)          .toString();      switch (j + 1) {      case 1:       ImageView imgView1 = new ImageView(context);       imgView1 = (ImageView) findViewById(R.id.image1);       if (image.getIntrinsicHeight() &gt; 0) {        imgView1.setImageDrawable(image);       } else        imgView1          .setImageResource(R.drawable.empty_wallpaper);       tv = (TextView) findViewById(R.id.filename1);       tv.setText(file_info);       tv = (TextView) findViewById(R.id.author1);       tv.setText(author);       imgView1         .setOnClickListener(new View.OnClickListener() {          public void onClick(View view) {           // Perform action on click           Intent myIntent1 = new Intent(             helloAndroid.this,             galleryFile.class);           Bundle b = new Bundle();           b.putString(""fileID"",myExampleHandler.fileid.elementAt(0).toString());           b.putString(""page"", ""1"");           b.putString(""family"", s);           b.putString(""fi"",myExampleHandler.folder_id.elementAt(folder).toString());           b.putString(""kw"", keyword);           myIntent1.putExtras(b);        startActivityForResult(             myIntent1, 0);          }         });       break;      case 2:       ImageView imgView2 = new ImageView(context);       imgView2 = (ImageView) findViewById(R.id.image2);       imgView2.setImageDrawable(image);       tv = (TextView) findViewById(R.id.filename2);       tv.setText(file_info);       tv = (TextView) findViewById(R.id.author2);       tv.setText(author);       imgView2         .setOnClickListener(new View.OnClickListener() {          public void onClick(View view) {           // Perform action on click           Intent myIntent1 = new Intent(             helloAndroid.this,             galleryFile.class);           Bundle b = new Bundle();           b.putString(""fileID"",myExampleHandler.fileid.elementAt(1).toString());           b.putString(""page"", ""1"");           b.putString(""family"", s);           b.putString(""fi"",myExampleHandler.folder_id.elementAt(folder).toString());           b.putString(""kw"", keyword);           myIntent1.putExtras(b);        startActivityForResult(             myIntent1, 0);          }         });       break;      case 3:       //same code   break;  } }}  }  }    private Drawable ImageOperations(Context ctx, String url,   String saveFilename) {  try {   InputStream is = (InputStream) this.fetch(url);   Drawable d = Drawable.createFromStream(is, ""src"");   return d;  } catch (MalformedURLException e) {   e.printStackTrace();   return null;  } catch (IOException e) {   e.printStackTrace();   return null;  } } public Object fetch(String address) throws MalformedURLException,   IOException {  URL url = new URL(address);  Object content = url.getContent();  return content; }</code></pre>","679696","","","","","2010-03-25 22:11:58","problem in loading images from web","<android><time><loading><long-integer>","1","6","","",""
"2513832","1","2515263","","2010-03-25 07:59:18","1","6050","<p>I am writing an application to listen the SMS inbox in android with one activity and one BroadcastReceiver.Once the SMS comes the Receiver is showing alert message.But i want to send the message information from Receiver to Activity.I don't know how to achieve this.Anybody knows it please help me.</p>","131062","","","","","2012-01-26 19:22:44","How to send data from BroadcastReceiver to an Activity in android?","<android>","2","0","2","",""
"2514282","1","2514386","","2010-03-25 09:25:29","1","696","<p>I have a simple question. I am trying to design a simple Android app, which based on keywords searches something and shows a listing view of results. Currently it merely searches SMSes in the cellphone.</p><p>Here are some of the things I am faced with:</p><ul><li><p>I have a simple first page with a textbox and a submit button. It's rendered by ""Activity"" inherited class call SMSFinder.</p></li><li><p>Once I have the results present with me, I want them to be binded to a list view. Showing preview text to limited characters, say 20 chars. Clicking on the same should ""ideally"" open the inbox (or outbox or whatever) and open the SMS, however that meant I cannot come back to my app easily. So I would rather open the whole SMS in my own app. So clicking on the app should open the SMS in a new screen with complete message, sender info etc. Few questions here, </p></li></ul><blockquote>  <p>If I wanted to can I actually open a  SMS directly in inbox? How? (Any code  snippets will be wonderful)</p>    <p>Assuming I wanted to bind this  result list    with an ListActivity;  can Activity    and ListActivity  co-exist in same    app? How? In  anycase, what is the    best way to  design this kind of UI    stuff in  android. I am a rookie so I    am not  sure, how it goes.</p></blockquote><p>For generic Android phone apps, what are the best practices to make UI as compliant to as many phones? Like what kind of views should I use? </p><p>Any help will be much appreciated.</p>","57847","","114066","","2012-01-27 08:44:20","2012-01-27 08:44:20","Design Clarification in Android. List Activity vs Activity","<android><design><android-listview>","1","0","","",""
"2514708","1","","","2010-03-25 10:31:25","-4","79","<p>When i give the scrollbar height as 320sp in andoir ,it is okay for my application in android but in droid the same  code for that scroll bar but it is too small in that how can i adjust ? Give me some suggestions.</p>","454808","","1101070","","2012-03-06 01:23:38","2012-03-06 01:23:38","how we can adjust the screens to both droid and android symultaneously","<android>","1","2","","2013-02-11 13:40:15",""
"2514733","1","","","2010-03-25 10:34:21","0","150","<p>Since Android is built on Linux Kernel.Are there any functionality of Linux which we can use in our application?</p>","281307","","","","","2010-03-25 12:04:52","Can we use any feature of linux in our app?","<android><linux><kernel>","2","2","","",""
"2514750","1","2522835","","2010-03-25 10:38:13","1","8058","<p>I have created an activity which sends a number of notifications to status bar. Each notification contains an intent with a bundle. Here is the code:</p><pre><code> String ns = Context.NOTIFICATION_SERVICE;    NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);    int icon = R.drawable.icon;         long when = System.currentTimeMillis();    Notification notification = new Notification(icon, ""Test Notification"", when);    Context context = getApplicationContext();          Bundle bundle = new Bundle();    bundle.putString(""action"", ""view"");    Intent notificationIntent = new Intent(this, MainActivity.class);    notificationIntent.putExtras(bundle);    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, Intent.FLAG_ACTIVITY_NEW_TASK);    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);         mNotificationManager.notify(1, notification);</code></pre><p>When user clicks this notifications, I read the bundle string ""action"" and performs that action. Here is the code:</p><pre><code> Bundle bundle = this.getIntent().getExtras();    if(bundle != null)    {        String action = bundle.getString(""action"");            performAction(action)    }</code></pre><p>Everything works as expected. But, when I minimize the app using ""arrow"" button on device and then press and hold home button and clicks on my app icon the application starts and performs the same last action which have been performed by clicking the last notification. I figured out that when we click the app icon the application starts with last intent triggered by the notification. Can anyone help in this? </p>","278194","","112705","","2012-12-04 15:37:31","2012-12-04 15:37:31","Android - Clicking on notification in status bar binds the intent with the target activity","<android>","2","0","","",""
"2515027","1","2515199","","2010-03-25 11:33:26","1","480","<p>I want to access files in the /sys, to be exact in the /sys/class folder. I just need to read some values there.I tried the Context.openFileInput method, but got only exceptions and I understand this is not the right way.</p><p>thanks for replying!</p>","281294","","","","","2010-03-25 11:58:01","How can I access files in the /sys folder of milestone/droid from java?","<android>","1","0","","",""
"2515360","1","2693794","","2010-03-25 12:24:37","24","28746","<p>I'm using Xcode for a while, and I'd like to start developing Android Applications. However, the SDK is for Eclipse. I personally don't like Eclipse, because of the UI and it starts to suck on my iMac. I was wondering if it is possible to create Android Applications with the Xcode Tools so I can stay with my old friend Xcode (and maybe even Interface Builder (very unlikely) ö). Can anyone tell me? Thanks.</p>","","user142019","","","","2012-10-12 09:42:12","Create Android Applications using Xcode?","<android><xcode><osx><mobile>","3","1","7","2012-10-12 13:11:37",""
"2515375","1","2515484","","2010-03-25 12:26:55","1","6995","<p>I am trying to populate a ListView in a separate class with data taken from a SQLite database held in another class. What would be the easiest way to do so?</p><p>Thanks</p>","296810","","","","","2010-03-25 12:41:08","Populating a ListView from a SQLite database in Android","<java><android><sqlite><listview>","1","0","0","",""
"2515392","1","2516547","","2010-03-25 12:29:32","1","8008","<p>I have a 320x480 image which I`d like to fit the whole screen. This is the main.xml code</p><pre><code>&lt;ImageView   xmlns:android=""http://schemas.android.com/apk/res/android""&gt;        android:id='@+id/splash_medium'        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         android:src=""@drawable/wallpaper320x480""         /&gt;</code></pre><p>The screen shows the image but there is a considerable padding to the left and to the right, and a little bit to the top and to the bottom. I have tried setting android:padding to 0dip with no result.</p><p>Link to image, I can`t post images yet: <a href=""http://i40.tinypic.com/29g08qd.jpg"" rel=""nofollow"">screenshot</a></p><p>Any help would be appreciated.</p>","218473","","","","","2010-03-25 14:55:52","Image won`t fit screen","<android><imageview>","1","3","","",""
"2515597","1","","","2010-03-25 12:54:03","0","151","<p>Thank u But after the Edit Text I use the Icons also .So,when i give Wrap_content for that Edittext The icons are displayed only half   ,In below my code is there see that one once</p><pre><code>&lt;TableRow   android:layout_width=""wrap_content""     android:layout_height=""fill_parent""&gt;&lt;TextView     android:id=""@+id/TextViewEmail""    android:text=""Email""     android:textSize=""15sp""     android:paddingRight=""4dip""     android:textStyle=""bold""     android:layout_width=""wrap_content""     android:textColor=""@android:color/white""     android:layout_gravity=""right|center"" /&gt; &lt;EditText     android:id=""@+id/EditTextEmail""        android:editable=""false""     android:clickable=""false""     android:textSize=""15sp""     android:layout_height=""wrap_content""     android:singleLine=""true"" android:layout_width=""150sp""/&gt;</code></pre><p>          </p><p></p>","454808","","454808","","2010-03-26 05:30:55","2010-03-26 05:30:55","How we see the total content in EditText in android","<android>","1","0","","",""
"2516142","1","","","2010-03-25 14:04:47","3","1940","<p>I need a good way of sending information TO the Android device that doesn't use a special server that has XML data. I would like to base this around email functionality. Lets say I send an email with some special text/link that when clicked starts and intent on the phone.</p><p>I don't want to replace the users current email application. A clickable link would be the best thing ""intent://data1:data2"" or something along these lines.</p><p>Speculations/solutions on how to proceed.</p>","301746","","","","","2010-03-25 17:50:19","Start Android intent from email","<android><email><data><android-intent>","1","1","","",""
"2516225","1","2516573","","2010-03-25 14:17:18","0","1205","<p>i have been developing iphone apps for a while now. I just started on android and have about half of my app done.</p><p>My app calls the native datepicker which the user selects the date then on the selection of the date a particular image is show in the format 2010-3-24, same as android output. </p><p>I have used the date picker tutorial to get the datepicker working and displaying the selected text in textview. </p><p>What i need is to display the particular image that corresponds to the selected date. The images are local to the app. I have looked for tutorials that would possibly help me out but so far no such luck. It is a very simple problem, i am just new to the platform.</p>","301760","","","","","2010-03-25 14:58:41","Android: imageview and datepicker, Set image based on datepicker output","<android><imageview><android-datepicker>","1","2","","",""
"2516499","1","2516542","","2010-03-25 14:50:52","0","960","<p>I have been working on Android for the past couple of months getting to know how various components work.</p><p>One area I am completely lacking in knowledge is any sort of User Interface or graphical interface creation.</p><p>As an excercise I have been asked to break down the HTC call screen into what components it contains and rebuild as close as possible.</p><p>Here is a picture of the HTC call screen:</p><p><img src=""http://img688.imageshack.us/img688/7663/incall.png"" alt=""HTC Dialer""></p><p>From my understanding the above UI has a custom title bar where ""Meteor"" and the call time appears.</p><p>Then the main image in the middle block along with a text view showing the called party, in this case ""Voice Mail"" and the number.</p><p>The bottom is then a custom view maybe with three custom buttons used within it.</p><p>Would I be correct in my above assumptions?</p><p>So the parts I should look into start programming are a custom title bar and a custom view with three custom buttons to place at the bottom?</p><p>What layout would be reccomended?</p><p>I hope this question is seen as relative to Stack Overflow, if it is not then I will delete it.</p><p>Thanks in advance</p>","243999","","","","","2010-03-25 19:42:55","Android - need UI help/advice","<xml><android><layout><user-interface><custom-component>","3","1","0","",""
"2516942","1","2517498","","2010-03-25 15:38:35","2","3162","<p>I am trying to swap two LinearLayouts by setting their visibility properties to ""VISIBLE"" and ""GONE"" respectively. I am also using an animation while the layouts are being swapped. The animation completes successfully and I see the correct layout. However, the previous Layout which has its visibility property set to ""GONE"" still receives clicks even though it's not visible. At the same time, the layout which is ""VISIBLE"" receives clicks only when clicked in area where the ""GONE"" layout isn't clickable. I am also calling the requestFocus method on the ""VISIBLE"" layout. But it doesn't help.</p><p>Moreover, if I skip the animation part and just set the visibility properties, everything works correctly. </p><p>What am I missing here?</p>","301784","","82118","","2010-07-26 16:02:22","2010-10-28 11:24:16","Android LinearLayout Visibility issues with Animation","<android><animation><click><visibility><android-linearlayout>","1","0","3","",""
"2517415","1","","","2010-03-25 16:34:56","1","555","<p>I am using commons-httpclient-3.1 jar file to Post multipart file to twitpic , iam getting Image not found exception here is my code  HttpClient client = new HttpClient();                client.getHttpConnectionManager().getParams().setConnectionTimeout(100000); </p><pre><code>            PostMethod method = new PostMethod(""http://twitpic.com/api/uploadAndPost"");            FilePart photo = new FilePart(""photo"", new ByteArrayPartSource(""photo"", b));            photo.setContentType(""image/jpeg"");            photo.setCharSet(null);             Part[] parts = { new StringPart(""service"", ""Android mobile""),                    new StringPart(""username"", ""xxxxxx""),                    new StringPart(""password"", ""xxxxxx""),                    new StringPart(""message"", ""Test message""),                     photo };             try { method.setRequestEntity(new MultipartRequestEntity(parts, method.getParams()));  client.executeMethod(method); responseString = method.getResponseBodyAsString(); method.releaseConnection();} catch (HttpException e) { Log.v(""e"",e.toString()); e.printStackTrace();} catch (IOException e) { Log.v(""e2"",e.toString()); e.printStackTrace();} finally {                method.releaseConnection();        }  Log.v( ""Response status: "" , responseString);</code></pre><p>Any suggestion ,why i am getting this error and why i cannot post images?thanks ganesh</p>","286044","","","","","2010-03-25 16:34:56","Image not found exception while posting to twitpic using httpclient","<android><httpclient><twitpic>","0","2","","",""
"2517468","1","2517528","","2010-03-25 16:39:55","7","2194","<p>In an Activity, I need to call a web service every 30 seconds or so, and use the data to update the UI.</p><p>Is there a recommended approach on how to schedule a repetitive task? </p><p>Thanks</p>","131640","","","","","2011-02-12 01:47:13","Android Repetitive Task","<android>","3","1","2","",""
"2517493","1","","","2010-03-25 16:42:59","12","33668","<p>While implementing the BluetoothChat application .apk inside G1 device, it always pops up a message:</p><pre><code>$adb install -r /home/parveen/workspace/BluetoothChat/bin/BluetoothChat.apk -bash: adb: command not found</code></pre><p>I am not getting clearly why this error is popping up every time.Please help me.</p><p>Thanks in advance.Praween</p>","292605","","99492","","2010-03-25 16:47:20","2013-05-24 22:53:29","adb command not found in linux environment","<android>","11","1","4","",""
"2517589","1","","","2010-03-25 16:54:19","16","11590","<p>Is there a way that I can specify a triangle shape in an xml file?</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android"" android:shape=""triangle""&gt;  &lt;stroke android:width=""1dip"" android:color=""#FFF"" /&gt;  &lt;solid android:color=""#FFF"" /&gt;&lt;/shape&gt;</code></pre><p>can we do this with a path shape or something? I just need an equilateral triangle.</p><p>Thanks</p>","291701","","1470567","","2013-11-21 18:58:16","2014-01-22 11:45:36","Making a triangle shape using xml definitions?","<android><xml>","5","3","3","",""
"2517607","1","","","2010-03-25 16:56:02","2","929","<p>I am trying to play the bigger size audio wav file(which is >20 mb) using the following code(AudioTrack) on my Android 1.6 HTC device which basically has less memory. But i found device crash as soon as it executes reading, writing and play. But the same code works fine and plays the lesser size audio wav files(10kb, 20 kb files etc) very well. P.S: I should play PCM(.wav) buffer sound, the reason behind why i use AudioTrack here.</p><p>Though my device has lesser memory, how would i read bigger audio files bytes by bytes and play the sound to avoid crashing due to memory constraints.</p><pre><code>private void AudioTrackPlayPCM() throws IOException</code></pre><p>{</p><p>String filePath = ""/sdcard/myWav.wav""; // 8 kb file</p><p>byte[] byteData = null;<br>File file = null; </p><p>file = new File(filePath);</p><p>byteData = new byte[(int) file.length()];</p><p>FileInputStream in = null;</p><p>try {in = new FileInputStream( file );in.read( byteData );in.close(); </p><p>} catch (FileNotFoundException e) {</p><p>// TODO Auto-generated catch blocke.printStackTrace();</p><p>}</p><p>int intSize = android.media.AudioTrack.getMinBufferSize(8000, AudioFormat.CHANNEL_CONFIGURATION_MONO,AudioFormat.ENCODING_PCM_8BIT);     </p><p>AudioTrack at = new AudioTrack(AudioManager.STREAM_MUSIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO,AudioFormat.ENCODING_PCM_8BIT, intSize, AudioTrack.MODE_STREAM);        </p><p>at.play();</p><p>at.write(byteData, 0, byteData.length);<br>at.stop();</p><p>at.release();</p><p>}</p><p>Could someone guide me please to play the AudioTrack code for bigger size wav files?</p>","187532","","","","","2010-10-31 01:47:16","Android:Playing bigger size audio wav sound file produces crash","<android>","1","0","1","",""
"2517641","1","2518915","","2010-03-25 17:00:17","15","16009","<p>I want to draw a bitmap on a canvas with bigger size than it is. I can use canvas.drawBitmap(bitmap, null, destRect, null); but that gives a poor quality, as the result is pixelated, if the source image is sightly smaller than the destination rectangle. </p><p>How can i draw my bitmap using bilinear or bicubic resampling?</p><p>Any help would be appreciated, thanx.</p>","","user301895","","","","2010-03-25 19:57:48","How to draw and scale a bitmap on a canvas using bicubic interpolation in Android?","<android><drawing><resize><bitmap><bicubic>","1","0","6","",""
"2517729","1","","","2010-03-25 17:07:55","1","325","<p>I have a project with some Android test code in it (with the appropriate elements, <code>&lt;uses-library&gt;</code> and <code>&lt;instrumentation&gt;</code>, added to <code>AndroidManifest.xml</code>).  This works fine in Eclipse.  However, it fails to build with <code>mm</code>, claiming that it can't find the test-runner classes:</p><pre><code>/home/orospakr/code/my-android/packages/apps/MyApp/src/ca/orospakr/myapp/test/functional/MyActivityTest.java:5: cannot find symbolsymbol  : class ActivityInstrumentationTestCase2location: package android.testimport android.test.ActivityInstrumentationTestCase2;                   ^</code></pre>","288557","","288557","","2010-03-25 18:38:56","2012-09-26 11:47:12","Compiler can not find AndroidInstrumentationTestCase2 when building Android app test code with Android makefile build system","<android><android-manifest><android-build>","1","0","","",""
"2518055","1","2520241","","2010-03-25 17:48:23","2","4318","<p>i can pick a image and its path using intent. with the use of that path of an image. i have to set that image as attachment of the mail's body content. how its possible in android??? </p>","267269","","","","","2011-11-04 16:13:53","image attachment to a mail.. how in android?","<android><email><android-sdcard><android-gallery>","1","0","3","",""
"2518181","1","","","2010-03-25 18:05:19","2","1081","<p>The currently key  events listener provided by android ""onKeyUp"", ""onKeyDown"" are associated to an activity , so they are notified of the key events if the activity's views are focused . What I want is to be able to increase/decrease the volume by pressing some of the device's key , without  writing a listener in every activity , especially as my application has a lot of activities . Is there a way to write a ""listener/piece of code"" for key events that will be called always during the life of an application when a key is pressed, no matter what the user is doing at that time ?</p>","284609","","","","","2010-09-30 11:59:05","key event in Android","<android>","1","0","","",""
"2518238","1","2518688","","2010-03-25 18:14:11","7","2290","<p>Does startService() create a new Service instance or using the existing one?For example, in the following code, does it create two UpdateService instances or just one UpdateService instance?Thanks.</p><pre><code>    int[] appWidgetIds = new int[] {1, 2};      for (int appWidgetId : appWidgetIds) {        Intent intent = new Intent(context, UpdateService.class);        intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);        context.startService(intent);    }</code></pre>","256239","","","","","2011-02-16 03:13:07","Does startService() create a new Service instance or using the existing one?","<android>","2","0","1","",""
"2518740","1","","","2010-03-25 19:30:45","0","6964","<p>I am creating an application that checks the installation of a package and then launches the market-place with its id.</p><p>When I try to launch market place with id of an application say com.mybrowser.android by throwing an intent android.intent.action.VIEW with url: market://details?id=com.mybrowser.android, the market place application does launches but crashes after launch.</p><p>Note: the application com.mybrowser.android doesn't exists in the market-place.</p><p>MyApplication is my application.</p><pre><code>$ adb logcatI/ActivityManager( 1030): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=myapp.testapp/.MyApplication }I/ActivityManager( 1030): Start proc myapp.testapp for activity myapp.testapp/.MyApplication: pid=3858 uid=10047 gids={1015, 3003}I/MyApplication( 3858): [ Activity CREATED ]I/MyApplication( 3858): [ Activity STARTED ]I/MyApplication( 3858): onResumeD/dalvikvm( 1109): GC freed 6571 objects / 423480 bytes in 73msI/MyApplication( 3858): Pressed OK buttonI/MyApplication( 3858): Broadcasting Intent: android.intent.action.VIEW, data: market://details?id=com.mybrowser.androidI/ActivityManager( 1030): Starting activity: Intent { act=android.intent.action.VIEW dat=market://details?id=com.mybrowser.android flg=0x10000000 cmp=com.android.vending/.AssetInfoActivity }I/MyApplication( 3858): onPauseI/ActivityManager( 1030): Start proc com.android.vending for activity com.android.vending/.AssetInfoActivity: pid=3865 uid=10023 gids={3003}I/ActivityThread( 3865): Publishing provider com.android.vending.SuggestionsProvider: com.android.vending.SuggestionsProviderD/dalvikvm( 1030): GREF has increased to 701I/vending ( 3865): com.android.vending.api.RadioHttpClient$1.handleMessage(): Handle DATA_STATE_CHANGED event: NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: trueI/ActivityManager( 1030): Displayed activity com.android.vending/.AssetInfoActivity: 609 ms (total 7678 ms)D/dalvikvm( 1030): GC freed 10458 objects / 676440 bytes in 128msI/MyApplication( 3858): [ Activity STOPPED ]D/dalvikvm( 3865): GC freed 3538 objects / 254008 bytes in 84msW/dalvikvm( 3865): threadid=19: thread exiting with uncaught exception (group=0x4001b180)E/AndroidRuntime( 3865): Uncaught handler: thread AsyncTask #1 exiting due to uncaught exceptionE/AndroidRuntime( 3865): java.lang.RuntimeException: An error occured while executing doInBackground()E/AndroidRuntime( 3865):        at android.os.AsyncTask$3.done(AsyncTask.java:200)E/AndroidRuntime( 3865):        at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)E/AndroidRuntime( 3865):        at java.util.concurrent.FutureTask.setException(FutureTask.java:124)E/AndroidRuntime( 3865):        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)E/AndroidRuntime( 3865):        at java.util.concurrent.FutureTask.run(FutureTask.java:137)E/AndroidRuntime( 3865):        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)E/AndroidRuntime( 3865):        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)E/AndroidRuntime( 3865):        at java.lang.Thread.run(Thread.java:1096)E/AndroidRuntime( 3865): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime( 3865):        at com.android.vending.AssetItemAdapter$ReloadLocalAssetInformationTask.doInBackground(AssetItemAdapter.java:845)E/AndroidRuntime( 3865):        at com.android.vending.AssetItemAdapter$ReloadLocalAssetInformationTask.doInBackground(AssetItemAdapter.java:831)E/AndroidRuntime( 3865):        at android.os.AsyncTask$2.call(AsyncTask.java:185)E/AndroidRuntime( 3865):        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)E/AndroidRuntime( 3865):        ... 4 moreI/Process ( 1030): Sending signal. PID: 3865 SIG: 3I/dalvikvm( 3865): threadid=7: reacting to signal 3I/dalvikvm( 3865): Wrote stack trace to '/data/anr/traces.txt'I/DumpStateReceiver( 1030): Added state dump to 1 crashesD/AndroidRuntime( 3865): Shutting down VMW/dalvikvm( 3865): threadid=3: thread exiting with uncaught exception (group=0x4001b180)E/AndroidRuntime( 3865): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime( 3865): java.lang.NullPointerExceptionE/AndroidRuntime( 3865):        at com.android.vending.controller.AssetInfoActivityController.getIdDeferToLocal(AssetInfoActivityController.java:637)E/AndroidRuntime( 3865):        at com.android.vending.AssetInfoActivity.displayAssetInfo(AssetInfoActivity.java:556)E/AndroidRuntime( 3865):        at com.android.vending.AssetInfoActivity.access$800(AssetInfoActivity.java:74)E/AndroidRuntime( 3865):        at com.android.vending.AssetInfoActivity$LoadAssetInfoAction$1.run(AssetInfoActivity.java:917)E/AndroidRuntime( 3865):        at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime( 3865):        at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime( 3865):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 3865):        at android.app.ActivityThread.main(ActivityThread.java:4363)E/AndroidRuntime( 3865):        at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 3865):        at java.lang.reflect.Method.invoke(Method.java:521)   E/AndroidRuntime( 3865):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime( 3865):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime( 3865):        at dalvik.system.NativeStart.main(Native Method)I/Process ( 1030): Sending signal. PID: 3865 SIG: 3W/ActivityManager( 1030): Process com.android.vending has crashed too many times: killing!D/ActivityManager( 1030):   Force finishing activity com.android.vending/.AssetInfoActivityI/dalvikvm( 3865): threadid=7: reacting to signal 3D/ActivityManager( 1030): Force removing process ProcessRecord{44e48548 3865:com.android.vending/10023} (com.android.vending/10023)</code></pre><p>However, when I try to launch the market place for a package that exists in the market place say com.opera.mini.android, everything works. Log for this case:</p><pre><code>D/dalvikvm(  966): GC freed 2781 objects / 195056 bytes in 99msI/MyApplication( 1165): Pressed OK buttonI/MyApplication( 1165): Broadcasting Intent: android.intent.action.VIEW, data: market://details?id=com.opera.mini.androidI/ActivityManager(   78): Starting activity: Intent { act=android.intent.action.VIEW dat=market://details?id=com.opera.mini.android flg=0x10000000 cmp=com.android.vending/.AssetInfoActivity }I/AndroidRuntime( 1165): AndroidRuntime onExit calling exit(0)I/WindowManager(   78): WIN DEATH: Window{44c72308 myapp.testapp/myapp.testapp.MyApplication paused=true}I/ActivityManager(   78): Process myapp.testapp (pid 1165) has died.I/WindowManager(   78): WIN DEATH: Window{44c72958 myapp.testapp/myapp.testapp.MyApplication paused=false}D/dalvikvm(   78): GC freed 31778 objects / 1796368 bytes in 142msI/ActivityManager(   78): Displayed activity com.android.vending/.AssetInfoActivity: 214 ms (total 22866 ms)W/KeyCharacterMap(  978): No keyboard for id 65540W/KeyCharacterMap(  978): Using default keymap: /system/usr/keychars/qwerty.kcm.binV/RenderScript_jni(  966): surfaceCreatedV/RenderScript_jni(  966): surfaceChangedV/RenderScript(  966): setSurface 480 762 0x573430D/ViewFlipper(  966): updateRunning() mVisible=true, mStarted=true, mUserPresent=true, mRunning=trueD/dalvikvm(  978): GC freed 10065 objects / 624440 bytes in 95ms</code></pre><p>Any ideas?</p>","302015","","114066","","2010-07-22 15:25:12","2013-01-06 01:32:56","Launch market place with id of an application that doesn't exist in the android market place","<android><marketplace>","4","1","1","",""
"2518818","1","","","2010-03-25 19:42:03","5","4918","<p>Hi    I want to publish my application (ABC). Its an audiobook file(just for example.) wrapped as apk. When the user install this application it needs to check whether another application (XYZ) already installed or not. If not let the user know they have to install the application XYZ first before installing ABC.</p><p>Thanks in advance</p><p>Rajesh</p>","278445","","","","","2011-12-03 12:42:00","Android check for dependent application during installation?","<android><installation>","2","0","1","",""
"2519172","1","2530702","","2010-03-25 20:37:32","2","488","<p>I'm writing a custom compound control that extends RelativeLayout. Inside this component, there is an ImageView. I add a OnClickListener to this ImageView to animate it when the user clicks on it. But when I am in an activity using this control and I add a OnClickListener on the control, this listener is never called. It only works when I remove the other listener I have on the ImageView. Does anybody knows how to ""propagate"" the event to the other listeners when I catch it inside the control?</p><p>Thanks!</p><p>PS: I would also like to know if there is an existing control that looks like the icons on the Android desktop. Like an icon with text underneath.</p>","289214","","","","","2010-03-27 19:48:37","Android Compound Control internal click events","<android>","1","0","2","",""
"2519317","1","","","2010-03-25 20:59:19","12","10011","<p>I have a ListView which is connected to a ArrayAdapter where Artist is a simple class of mine, that has only an id and a name.</p><p>Now I want to filter the ListView so I call:</p><pre><code>artistAdapter.getFilter().filter(""bla"", new Filter.FilterListener() {    public void onFilterComplete(int count) {        Log.d(Config.LOG_TAG, ""filter complete! count: "" + count); // returns 8        Log.d(Config.LOG_TAG, ""adapter count: "" + artistAdapter.getCount()); // return 1150    }});</code></pre><p>The first debug statement prints a count of 8. That's the corrent count for listitems that start with ""bla"" but the adapter does not get it. The second debug statement prints a count 1150 items. That's the complete number of items in the list.</p><p>So somehow the filter does not tell the adapter that it has filtered the underlying data.</p><p>I want to know now: do I have do code something in my adapter so it gets the updates from the filter? Do I have to write a custom filter? What do I have to do?</p>","300572","","67022","","2011-03-23 17:02:56","2012-12-27 17:38:53","How to write a  custom filter for ListView with ArrayAdapter","<android><listview><android-arrayadapter>","2","2","14","",""
"2519374","1","2519659","","2010-03-25 21:07:08","34","21408","<p>I recently uploaded my application to the android market however it's refusing to run when downloaded due to the error</p><blockquote>  <p>Package file was not signed correctly</p></blockquote><p>I first published the packet using eclipse, right click export, creating a keystore then publishing, however it refuses to work.</p><p>I then downloaded the keytool and jarsigner and used them to sign an upgrade which I posted instead. However this gives the same error.</p><p>I have no idea what I've done wrong, and since I cannot delete the application I cannot try and start again can anyone help me?</p><p>Thanks</p>","245737","","","","","2014-02-10 01:53:42","Published Android apk gives error ""Package file was not signed correctly""","<android><keytool><jarsigner>","8","2","3","",""
"2519449","1","","","2010-03-25 21:15:24","2","14862","<p>I want to use Android 2.1 to connect to an external Bluetooth device, wich is offering an SPP portto me. In this case it is an external GPS unit.When I'm trying to connect I can't connect an established socket while being in the ""client"" mode. Then if I try to set up a socket (being in the server role), to RECEIVE text from my PC everything works just fine. TheComputer can connect as the client to the Socket on the Phone via SPP using the SSP UUID or some random UUID.So the Problem is not that I'm using the wrong UUID.</p><p>But the other way around (e.g. calling connect on the established client socket) <code>createRfcommSocketToServiceRecord(UUID uuid)</code>) just doesn't work. Sadly Idon't have the time to inspect the problem further. It would be greate If somebody could point me the right way.Phone: Samsung Galaxy Spica I-5700 Android 2.1In the following part of the Logfile has to be the Problem.</p><p>Greets PhilDev</p><p>P.S. I'm going to be present during the Office hours.</p><p>Here the log file:</p><hr><pre><code>03-21 03:10:52.020: DEBUG/BluetoothSocket.cpp(4643): initSocketFromFdNative03-21 03:10:52.025: DEBUG/BluetoothSocket(4643): connect03-21 03:10:52.025: DEBUG/BluetoothSocket(4643): doSdp03-21 03:10:52.050: DEBUG/ADAPTER(2132): create_device(01:00:00:7F:B5:B3)03-21 03:10:52.050: DEBUG/ADAPTER(2132): adapter_create_device(01:00:00:7F:B5:B3)03-21 03:10:52.055: DEBUG/DEVICE(2132): Creating device [address = 01:00:00:7F:B5:B3] /org/bluez/2132/hci0/dev_01_00_00_7F_B5_B3 [name = ]03-21 03:10:52.055: DEBUG/DEVICE(2132): btd_device_ref(0x10c18): ref=103-21 03:10:52.065: INFO/BluetoothEventLoop.cpp(1914): event_filter: Received signal org.bluez.Adapter:DeviceCreated from /org/bluez/2132/hci003-21 03:10:52.065: INFO/BluetoothService.cpp(1914): ... Object Path = /org/bluez/2132/hci0/dev_01_00_00_7F_B5_B303-21 03:10:52.065: INFO/BluetoothService.cpp(1914): ... Pattern = 00001101-0000-1000-8000-00805f9b34fb, strlen = 3603-21 03:10:52.070: DEBUG/DEVICE(2132): *************DiscoverServices********03-21 03:10:52.070: INFO/DTUN_HCID(2132): dtun_client_get_remote_svc_channel: starting discovery on  (uuid16=0x0011)03-21 03:10:52.070: INFO/DTUN_HCID(2132):    bdaddr=01:00:00:7F:B5:B303-21 03:10:52.070: INFO/DTUN_CLNT(2132):     Client calling DTUN_METHOD_DM_GET_REMOTE_SERVICE_CHANNEL (id 4)03-21 03:10:52.070: INFO/(2106): DTUN_ReceiveCtrlMsg: [DTUN] Received message [BTLIF_DTUN_METHOD_CALL] 435403-21 03:10:52.070: INFO/(2106): handle_method_call: handle_method_call :: received DTUN_METHOD_DM_GET_REMOTE_SERVICE_CHANNEL (id 4), len 13403-21 03:10:52.075: ERROR/BTLD(2106): ****************search UUID = 1101***********03-21 03:10:52.075: INFO//system/bin/btld(2103):         btapp_dm_GetRemoteServiceChannel()03-21 03:10:52.120: DEBUG/BluetoothService(1914): updateDeviceServiceChannelCache(01:00:00:7F:B5:B3)03-21 03:10:52.120: DEBUG/BluetoothEventLoop(1914): ClassValue: null for remote device: 01:00:00:7F:B5:B3 is null03-21 03:10:52.120: INFO/BluetoothEventLoop.cpp(1914): event_filter: Received signal org.bluez.Adapter:PropertyChanged from /org/bluez/2132/hci003-21 03:10:52.305: WARN/BTLD(2106): bta_dm_check_av:003-21 03:10:56.395: DEBUG/WifiService(1914): ACTION_BATTERY_CHANGED pluggedType: 203-21 03:10:57.440: WARN/BTLD(2106): SDP - Rcvd conn cnf with error: 0x4  CID 0x4303-21 03:10:57.440: INFO/BTL-IFS(2106): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_DTUN_SIGNAL_EVT (CTRL) 13 pbytes (hdl 10)03-21 03:10:57.445: INFO/DTUN_CLNT(2132): dtun-rx signal [DTUN_SIG_DM_RMT_SERVICE_CHANNEL] (id 42) len 1503-21 03:10:57.445: INFO/DTUN_HCID(2132): dtun_dm_sig_rmt_service_channel: success=1, service=0000000003-21 03:10:57.445: ERROR/DTUN_HCID(2132): discovery unsuccessful!</code></pre><hr><pre><code>package de.phil_dev.android.BT;import java.io.BufferedInputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.util.UUID;import android.app.Activity;import android.bluetooth.BluetoothAdapter;import android.bluetooth.BluetoothClass;import android.bluetooth.BluetoothDevice;import android.bluetooth.BluetoothServerSocket;import android.bluetooth.BluetoothSocket;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.widget.Toast;public class ThinBTClient extends Activity {    private static final String TAG = ""THINBTCLIENT"";    private static final boolean D = true;    private BluetoothAdapter mBluetoothAdapter = null;    private BluetoothSocket btSocket = null;    private BufferedInputStream inStream = null;    private BluetoothServerSocket myServerSocket;    private ConnectThread myConnection;    private ServerThread myServer;    // Well known SPP UUID (will *probably* map to    // RFCOMM channel 1 (default) if not in use);    // see comments in onResume().    private static final UUID MY_UUID = UUID            .fromString(""00001101-0000-1000-8000-00805F9B34FB"");    // .fromString(""94f39d29-7d6d-437d-973b-fba39e49d4ee"");    // ==&gt; hardcode your slaves MAC address here &lt;==    // PC    // private static String address = ""00:09:DD:50:86:A0"";    // GPS    private static String address = ""00:0B:0D:8E:D4:33"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        if (D)            Log.e(TAG, ""+++ ON CREATE +++"");        mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();        if (mBluetoothAdapter == null) {            Toast.makeText(this, ""Bluetooth is not available."",                    Toast.LENGTH_LONG).show();            finish();            return;        }        if (!mBluetoothAdapter.isEnabled()) {            Toast.makeText(this,                    ""Please enable your BT and re-run this program."",                    Toast.LENGTH_LONG).show();            finish();            return;        }        if (D)            Log.e(TAG, ""+++ DONE IN ON CREATE, GOT LOCAL BT ADAPTER +++"");    }    @Override    public void onStart() {        super.onStart();        if (D)            Log.e(TAG, ""++ ON START ++"");    }    @Override    public void onResume() {        super.onResume();        if (D) {            Log.e(TAG, ""+ ON RESUME +"");            Log.e(TAG, ""+ ABOUT TO ATTEMPT CLIENT CONNECT +"");        }        // Make the phone discoverable        // When this returns, it will 'know' about the server,        // via it's MAC address.        // mBluetoothAdapter.startDiscovery();        BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);        Log.e(TAG, device.getName() + "" connected"");//       myServer = new ServerThread();//       myServer.start();        myConnection = new ConnectThread(device);        myConnection.start();    }    @Override    public void onPause() {        super.onPause();        if (D)            Log.e(TAG, ""- ON PAUSE -"");        try {            btSocket.close();        } catch (IOException e2) {            Log.e(TAG, ""ON PAUSE: Unable to close socket."", e2);        }    }    @Override    public void onStop() {        super.onStop();        if (D)            Log.e(TAG, ""-- ON STOP --"");    }    @Override    public void onDestroy() {        super.onDestroy();        if (D)            Log.e(TAG, ""--- ON DESTROY ---"");    }    private class ServerThread extends Thread {        private final BluetoothServerSocket myServSocket;        public ServerThread() {            BluetoothServerSocket tmp = null;            // create listening socket            try {                tmp = mBluetoothAdapter                        .listenUsingRfcommWithServiceRecord(                                ""myServer"", MY_UUID);            } catch (IOException e) {                Log.e(TAG, ""Server establishing failed"");            }            myServSocket = tmp;        }        public void run() {            Log.e(TAG, ""Beginn waiting for connection"");            BluetoothSocket connectSocket = null;            InputStream inStream = null;            byte[] buffer = new byte[1024];            int bytes;            while (true) {                try {                    connectSocket = myServSocket.accept();                } catch (IOException e) {                    Log.e(TAG, ""Connection failed"");                    break;                }                Log.e(TAG, ""ALL THE WAY AROUND"");                try {                    connectSocket = connectSocket.getRemoteDevice()                            .createRfcommSocketToServiceRecord(MY_UUID);                    connectSocket.connect();                } catch (IOException e1) {                    Log.e(TAG, ""DIDNT WORK"");                }                // handle Connection                try {                    inStream = connectSocket.getInputStream();                    while (true) {                        try {                            bytes = inStream.read(buffer);                            Log.e(TAG, ""Received: "" + buffer.toString());                        } catch (IOException e3) {                            Log.e(TAG, ""disconnected"");                            break;                        }                    }                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                    break;                }            }        }        void cancel() {        }    }    private class ConnectThread extends Thread {        private final BluetoothSocket mySocket;        private final BluetoothDevice myDevice;        public ConnectThread(BluetoothDevice device) {            myDevice = device;            BluetoothSocket tmp = null;            try {                tmp = device.createRfcommSocketToServiceRecord(MY_UUID);            } catch (IOException e) {                Log.e(TAG, ""CONNECTION IN THREAD DIDNT WORK"");            }            mySocket = tmp;        }        public void run() {            Log.e(TAG, ""STARTING TO CONNECT THE SOCKET"");            setName(""My Connection Thread"");            InputStream inStream = null;            boolean run = false;            //mBluetoothAdapter.cancelDiscovery();            try {                mySocket.connect();                run = true;            } catch (IOException e) {                run = false;                Log.e(TAG, this.getName()                        + "": CONN DIDNT WORK, Try closing socket"");                try {                    mySocket.close();                } catch (IOException e1) {                    Log.e(TAG, this.getName() + "": COULD CLOSE SOCKET"", e1);                    this.destroy();                }            }            synchronized (ThinBTClient.this) {                myConnection = null;            }            byte[] buffer = new byte[1024];            int bytes;            // handle Connection            try {                inStream = mySocket.getInputStream();                while (run) {                    try {                        bytes = inStream.read(buffer);                        Log.e(TAG, ""Received: "" + buffer.toString());                    } catch (IOException e3) {                        Log.e(TAG, ""disconnected"");                    }                }            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            // starting connected thread (handling there in and output        }        public void cancel() {            try {                mySocket.close();            } catch (IOException e) {                Log.e(TAG, this.getName() + "" SOCKET NOT CLOSED"");            }        }    }}</code></pre><hr><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""de.phil_dev.android.BT"" android:versionCode=""1""    android:versionName=""1.0""&gt;    &lt;uses-permission android:name=""android.permission.BLUETOOTH_ADMIN"" /&gt;    &lt;uses-permission android:name=""android.permission.BLUETOOTH"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""/&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;        &lt;activity android:name="".ThinBTClient"" android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt; </code></pre>","298178","","298178","","2010-03-26 00:44:22","2010-08-03 16:43:06","SPP Socket createRfcommSocketToServiceRecord will not connect","<android><bluetooth><rfcomm>","4","1","2","",""
"2519494","1","2550161","","2010-03-25 21:20:52","5","4525","<p>Let's say I have following text in TextView:</p><pre>Hey there, visit www.example.com</pre><p>If I set TextView's attribute autoLink=""all"" www.example.com will be properly detected. However, if I now touch TextView, TextView's text that's not link  ('Hey there, visit' part) will go gray. Is there a way to prevent this behavior?</p><p>Thanks!</p>","237858","","","","","2012-05-03 06:34:25","Android - Linkify, autoLink remove text color change on touch","<android>","5","0","1","",""
"2519677","1","","","2010-03-25 21:52:45","1","604","<p>I would like to write a application for mobile devices (blackberry and android). Is there a (free) client to connect to a MOM? The MOM should guarantee message delivery even if the connection is closed and reopened.</p><p>We thought about using jms, but is there a free client that works on these platforms?XMPP could be another alternative.</p>","125756","","","","","2012-01-26 10:42:35","Message Oriented Middleware for Mobile Device Development","<android><blackberry><jms><xmpp><mom>","1","1","","",""
"2519760","1","","","2010-03-25 22:04:58","9","5507","<p>I am trying to do something similar to this <a href=""http://stackoverflow.com/questions/1001944/android-remote-code-loading"">stackoverflow posting</a>. What I want to do is to read the definition of an activity or service from the SD card. To avoid manifest permission issues, I create a shell version of this activity in the .apk, but try to replace it with an activity of the same name residing on the SD card at run time.  Unfortunately, I am able to load the activity class definition from the SD card using DexClassLoader, but the original class definition is the one that is executed.  Is there a way to specify that the new class definition replaces the old one, or any suggestions on avoiding the manifest permission issues without actually providing the needed activity in the package?  The code sample:</p><pre><code>    ClassLoader cl = new DexClassLoader(""/sdcard/mypath/My.apk"",            getFilesDir().getAbsolutePath(),            null,            MainActivity.class.getClassLoader());    try {        Class&lt;?&gt; c = cl.loadClass(""com.android.my.path.to.a.loaded.activity"");        Intent i = new Intent(getBaseContext(), c);        startActivity(i);    }    catch (Exception e) {</code></pre><p>Intead of launching the <code>com.android.my.path.to.a.loaded.activity</code> specified in <code>/sdcard/mypath/My.apk</code>, it launches the activity statically loaded into the project.</p>","252631","","","","","2013-05-29 17:49:03","Android, how to use DexClassLoader to dynamically replace an Activity or Service","<android><auto-update>","1","1","7","",""
"2519794","1","","","2010-03-25 22:11:34","3","7643","<p>I recently struggled with an apparently simple Android layout: I wanted a <code>WebView</code> above a <code>Button</code>. It worked fine with the following parameters:</p><pre><code>WebView:  Height: wrap-content  Weight: unset (by the way, what is the default?)Button:  Height: wrap-content  Weight: unset</code></pre><p>However if the web page became too big it spilled out over the button. I tried various combinations of weights and heights, and all except one either completely hide the button, or partially cover it. This is the one that works (copied from <a href=""http://code.google.com/p/apps-for-android/source/browse/trunk/Samples/WebViewDemo/res/layout/main.xml"" rel=""nofollow"">http://code.google.com/p/apps-for-android/source/browse/trunk/Samples/WebViewDemo/res/layout/main.xml</a>):</p><pre><code>WebView:  Height: 0  Weight: 1Button:  Height: wrap-content  Weight: unset</code></pre><p>If you change any of those, e.g. give button a weight or change the <code>WebView</code> height to wrap-content then it doesn't work. My question is: Why? Can someone please explain what on Earth the android layout system is thinking?</p>","265521","","","","","2014-03-21 03:45:33","LinearLayout of a WebView and a Button","<android><layout><button><webview><android-linearlayout>","3","0","1","",""
"2519975","1","2520113","","2010-03-25 22:43:46","1","2294","<p>I made an android project using eclipse. It looks like:</p><pre><code>src/   ActivityMain.java   lib/      Square.java      Circle.java</code></pre><p>I want to export only the /lib package really as a jar (don't want to include stuff at the top level like ActivityMain.java). Are there any special rules I need to be aware of before jar-ing this for use in another android project, or I should be all set?</p><p>Thanks</p>","246114","","","","","2010-03-25 23:15:28","Making a jar of an android project to use in another android project?","<android>","1","1","","",""
"2519992","1","2523298","","2010-03-25 22:47:41","0","919","<p>I am using EndlessAdapter from commonsguy with a SimpleAdapter. I can load data when I make a scroll down without problems, but I have a NullPointerException when I make a scroll up. The problem is in the method</p><pre><code>    @Override public View getView(int position, View convertView,ViewGroup parent) {  return wrapped.getView(position, convertView, parent); }</code></pre><p>from the class <code>AdapterWrapper</code>. </p><p>The call to <code>wrapped.getView(position, convertView,parent)</code> raises the exception and I don´t know why.</p><p>This is my implementation of <code>EndlessAdapter</code>:</p><pre><code>//Inner class in SearchTextActivity    class DemoAdapter extends EndlessAdapter {      private RotateAnimation rotate = null;      DemoAdapter(ArrayList&lt;HashMap&lt;String, String&gt;&gt; result) {       super(new SimpleAdapter(SearchTracksActivity.this,         result,         R.layout.textlist_item,         PROJECTION_COLUMNS,         VIEW_MAPPINGS));       rotate = new RotateAnimation( 0f,         360f,         Animation.RELATIVE_TO_SELF,         0.5f,         Animation.RELATIVE_TO_SELF,         0.5f);       rotate.setDuration(600);       rotate.setRepeatMode(Animation.RESTART);       rotate.setRepeatCount(Animation.INFINITE);      }      @Override      protected View getPendingView(ViewGroup parent) {       View row=getLayoutInflater().inflate(R.layout.textlist_item, null);       View child=row.findViewById(R.id.title);       child.setVisibility(View.GONE);       child=row.findViewById(R.id.username);       child.setVisibility(View.GONE);       child=row.findViewById(R.id.throbber);       child.setVisibility(View.VISIBLE);       child.startAnimation(rotate);       return row;      }      @Override      @SuppressWarnings(""unchecked"")      protected void rebindPendingView(int position, View row) {       HashMap&lt;String, String&gt; res = (HashMap&lt;String, String&gt;)getWrappedAdapter().getItem(position);       View child=row.findViewById(R.id.title);       ((TextView)child).setText(res.get(""title""));       child.setVisibility(View.VISIBLE);           child=row.findViewById(R.id.username);       ((TextView)child).setText(res.get(""username""));       child.setVisibility(View.VISIBLE);       ImageView throbber=(ImageView)row.findViewById(R.id.throbber);       throbber.setVisibility(View.GONE);       throbber.clearAnimation();      }      boolean mFinal = true;      @Override      protected boolean cacheInBackground() {       EditText searchText = (EditText)findViewById(R.id.searchText);       String textToSearch = searchText.getText().toString();       Util.getSc().searchText(textToSearch , offset, limit, new ResultListener&lt;ArrayList&lt;Text&gt;&gt;() {        @Override        public void onError(Exception e) {         e.toString();         mFinal = false;        }        @Override        public void onSuccess(ArrayList&lt;Text&gt; result) {         if(result.size() == 0){          mFinal = false;         }else{          texts.addAll(result);          offset++;         }        }       });       return mFinal;      }      @Override      protected void appendCachedData() {       for(Text text : texts){        result.add(text.getMapValues());       }       texts.clear();      }     }</code></pre><p>And I use it this way:</p><pre><code>public class SearchTextActivity extends AbstractListActivity { private static final String[] PROJECTION_COLUMNS = new String[] {  TextStore.Text.TITLE,  TextStore.Text.USER_NAME}; private static final int[] VIEW_MAPPINGS = new int[] {  R.id.Text_title,  R.id.Text_username}; ArrayList&lt;HashMap&lt;String, String&gt;&gt; result; static ArrayList&lt;Text&gt; texts; static int offset = 0; static int limit = 1; @Override void onAbstractCreate(Bundle savedInstance) {  setContentView(R.layout.search_tracks);  setupViews(); } private void setupViews() {  ImageButton searchButton = (ImageButton)findViewById(R.id.searchButton);  updateView(); } SimpleAdapter adapter; void updateView(){  if(result == null) {   result = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();  }  if(tracks == null) {   texts = new ArrayList&lt;Text&gt;();  } } public void sendQuery(View v){  offset = 0;  texts.clear();  result.clear();  setListAdapter(new DemoAdapter(result)); }}</code></pre><p>Does anybody knows what could be the problem?</p>","241911","","321731","","2014-02-08 15:01:43","2014-02-08 15:01:43","NullPointerException using EndlessAdapter with SimpleAdapter","<android><endlessadapter>","1","2","","",""
"2520021","1","","","2010-03-25 22:55:29","4","1288","<p>I'm using listpreference in my android app and getting my key values and all is well and works good (now that you guys have helped me) BUT - when my listpreference menus popup, they only contain a cancel button.</p><p>Let's say the user is choosing between red, blue, and green. When the listpreference dialog first pops-up, the dialog only shows a cancel button. Because of that, the dialog disappears as soon as the user selects their choice. I would like it so that when the user chooses their setting, they see the radio button get highlighted and then they go ahead and click the ok button...but I don't have an ok button and can't figure out why. Any help would be awesome...al </p>","237863","","","","","2014-04-03 00:31:53","Using listpreference and getting the key works but no ok button","<android><android-preferences>","2","0","","",""
"2520042","1","","","2010-03-25 23:01:56","4","3964","<p>Android has the Gmail push features, which means the new message arrives in the mailbox without checking or refreshing the mailbox.</p><p>As I understand, the sync processes are like these:<br />1) User turns on the sync<br />2) There will be a alert msg and the sync flag in the Gmail DB of this device will be True<br />3) When a new email reach the Gmail Server, it will check if the device sync value, if it's True then send the email</p><p>OK, here, I don't quite understand how exactly does it work, <br />For a WiFi and cell signal connection, does the phone has a TCP socket open keep listening to the Gmail Server, or when a new email arrives the Server and it sends a SMS alert to the phone, and the phone will open the data channel to fetch the email? Do the two ways of connections have different approaches?</p><p>And second question is which method is the priority one? <br />Say when you are in the middle of receiving data(emails), and suddenly the phone connect to a wireless network, will the data socket be closed and then reopened for the WiFi one? What's the behavior for the case when carrier's data channel and WiFi flips?</p><p>I have also downloaded the source code, anyone knows which part should I be looking into in order to solves my questions? I found a folder called ""email"" inside the folder ""package"", should I be looking at its code?</p><p>I know I asked quite some questions here, I'd appreciate if you know the answer for any of them, thanks very much!</p>","279937","","","","","2010-03-26 05:15:13","Gmail Sync on Android phone","<android><gmail>","1","1","2","",""
"2520418","1","2524471","","2010-03-26 00:25:43","8","8762","<p>When I use a <code>RelativeLayout</code> with either <code>fill_parent</code> or <code>wrap_content</code> as height and an element which specifies: <code>android:layout_alignParentBottom=""true""</code> it is ignored and it is aligned at the top. Setting the height of the <code>RelativeLayout</code> to an explicit value makes it work. Any clues?</p>","253583","","","","","2011-10-20 10:41:45","android:layout_alignParentBottom is ignored when used without explicit layout height as a row in ListView","<android><layout>","4","0","1","",""
"2520558","1","2521154","","2010-03-26 01:09:01","0","1382","<p>I have this piece of code which I'm hoping will be able to tell me how much data I have downloaded (and soon put it in a progress bar), and then parse the results through my Sax Parser. If I comment out basically everything above the <em>//xr.parse(new InputSource(request.getInputStream()));</em> line and swap the xr.parse's over, it works fine. But at the moment, my Sax parser tells me I have nothing. Is it something to do with is.<strong>read</strong> (buffer) section?</p><p>Also, just as a note, request is a HttpURLConnection with various signatures.</p><pre><code>                 /*Input stream to read from our connection*/                  InputStream is = request.getInputStream();                 /*we make a 2 Kb buffer to accelerate the download, instead of reading the file a byte at once*/                  byte [  ]  buffer = new byte [ 2048 ] ;                 /*How many bytes do we have already downloaded*/                  int totBytes,bytes,sumBytes = 0;                  totBytes = request.getContentLength () ;                  while  ( true )  {                       /*How many bytes we got*/                          bytes = is.read (buffer);                         /*If no more byte, we're done with the download*/                          if  ( bytes  &lt;= 0 )  break;                                sumBytes+= bytes;                         Log.v(""XML"", sumBytes + "" of "" + totBytes + "" "" + (  ( float ) sumBytes/ ( float ) totBytes ) *100 + ""% done"" );                  }                 /* Parse the xml-data from our URL. */                 // OLD, and works if comment all the above                  //xr.parse(new InputSource(request.getInputStream()));                 xr.parse(new InputSource(is))                 /* Parsing has finished. */;</code></pre><p>Can anyone help me at all??</p><p>Kind regards,</p><p>Andy</p>","231248","","231248","","2010-03-26 01:17:14","2012-09-24 05:56:39","Why does my Sax Parser produce no results after using InputStream Read?","<java><android><sax><httpurlconnection>","4","0","","",""
"2520672","1","2520680","","2010-03-26 01:39:53","3","2356","<p>I am trying to make an imageview that rotates while sliding across the screen. I setup a rotate animation for 180 degrees, and it works by itself. I setup a translate animation and it works by itself. When I combine them I get an imageview that makes a big spiral. I would like the imageview to rotate around the center of the imageview while being translated. </p><pre><code>        AnimationSet animSet = new AnimationSet(true);        //Translate upwards and to the right.           TranslateAnimation anim =            new TranslateAnimation(                    Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, +80.0f,                    Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, -100.0f                    );            anim.setInterpolator(new DecelerateInterpolator());             anim.setDuration(400);            animSet.addAnimation(anim);            //Rotate around center of Imageview            RotateAnimation ranim = new RotateAnimation(0f, 180f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); //, 200, 200); // canvas.getWidth() / 2, canvas.getHeight() / 2);            ranim.setDuration(400);            ranim.setInterpolator(new DecelerateInterpolator());            animSet.addAnimation(ranim);            imageBottom.startAnimation(animSet);</code></pre>","92212","","","","","2012-10-09 11:10:06","How do I get an imageview to rotate while translating in Android?","<java><android><animation>","1","0","","",""
"2520891","1","16039615","","2010-03-26 02:48:36","27","5455","<p>My open source Android application has internationalization done the Android way, with strings.xml files.</p><p>The community has many people from many countries, and they are willing to contribute/improve translations using a collaborative website.</p><p>There is <a href=""https://translations.launchpad.net"">Launchpad</a> but it only supports the gettext format so we would have to use scripts, not very convenient.</p><p>What website is convenient for translating open source Android applications?<br>Anybody must be able to start contributing without any sort of prior approval.</p>","226958","","881229","","2013-12-12 06:37:10","2013-12-12 06:37:10","Any collaborative tool/website to localize an Android app?","<android><localization><collaboration>","12","1","9","2013-11-10 14:15:38",""
"2520962","1","2521565","","2010-03-26 03:14:08","1","1278","<p>My app needs to save files that will range from about 2-20mb.  When I tried to do this I was getting an OutOfMemoryException.  I did some reading and it's looking like Android has a file size limit of 1mb.  Is this correct?  If so, is there a way around this limitation, other than splitting up every file into 1mb chunks?  </p>","289204","","","","","2010-03-26 17:58:16","Way around 1mb file size restriction?","<android>","2","3","","",""
"2521101","1","2521140","","2010-03-26 04:10:07","0","2522","<p>How do I set the intent of menu items defined in an Android menu xml file?  For example I currently have...</p><pre><code>&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android"" android:name=""Main Menu""&gt;    &lt;item android:title=""@string/resume_game"" android:icon=""@drawable/resume""&gt;&lt;/item&gt;    &lt;item android:title=""@string/play_golf"" android:icon=""@drawable/play_golf""&gt;&lt;/item&gt;    &lt;item android:title=""@string/my_rounds"" android:icon=""@drawable/my_rounds""&gt;&lt;/item&gt;&lt;/menu&gt;</code></pre><p>And in my Activity I have the following method overriden...</p><pre><code>   @Override    public boolean onCreateOptionsMenu(Menu menu) {        super.onCreateOptionsMenu(menu);        getMenuInflater().inflate(R.menu.main_menu, menu);        final MenuItem menuItem = (MenuItem) menu.findItem(R.id.about_item);        return true;    }</code></pre>","97901","","","","","2011-11-09 21:55:46","How do I set the intent of menu items defined in an Android menu xml file?","<android><android-widget>","2","0","","",""
"2521298","1","","","2010-03-26 05:31:42","-1","1751","<p>I have added one contact to android by following code.</p><pre><code> ContentValues values = new ContentValues(); Uri rawContactUri = getContentResolver().insert(RawContacts.CONTENT_URI, values); long rawContactId = ContentUris.parseId(rawContactUri); values.clear(); values.put(Data.RAW_CONTACT_ID, rawContactId); values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE); values.put(StructuredName.DISPLAY_NAME, ""Mike Sullivan""); getContentResolver().insert(Data.CONTENT_URI, values);</code></pre><p>It shows up on emulator 2.1, but when i am going to delete it manually by ""delete contact"" option, its not deleteing from emulator.</p><p>If I edit some thing on it then only it deletes.</p><p>How can i directly delete it from menu ?</p><p>Thanks in advance...</p>","177571","","12707","","2010-03-26 06:28:39","2012-01-19 04:36:58","How to delete a contact in android 2.1","<android><android-emulator>","4","1","","",""
"2521708","1","2522147","","2010-03-26 07:41:18","1","635","<p>I'm generating about 6 wav audio files at runtime. I want to store them in internal memory. Is a blob to sqlite the right/recommended way?</p>","42085","","","","","2013-05-28 12:45:58","Android, store a couple of wav files","<database><android><sqlite><audio>","1","0","","",""
"2521775","1","","","2010-03-26 08:00:41","5","5222","<p>I am creating a list .. the elements of the list are drawn from sqlite database .. I populate the list using ArrayList and ArrayAdapter ...upon clicking the items on the list I want to be able to fire an intent containing info about the item clicked ... info like the index number of the item .. </p><p>using the method :onItemClick(AdapterView av, View v, int index, long arg)</p><p>I do get index of the item clicked . however it is of the list currently displayed . the problem comes when I do setFilterTextEnabled(true) , and on the app type in some text to to search some item ..and then click it ..rather than giving me the index of the item on the original list it gives me the index on filtered list.. </p><p>following is the snippet of code:</p><pre><code>myListView.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; av, View v, int index, long arg) {            Intent lyricsViewIntent = new Intent(iginga.this, LyricsPage.class);            lyricsViewIntent.putExtra(""title"", songList.get((int)arg).getTitle());            lyricsViewIntent.putExtra(""id"", songList.get((int)arg).getSongId());            startActivity(lyricsViewIntent);        }    });    myListView.setTextFilterEnabled(true);</code></pre><p>Is there any way I can get the original index /position of the item instead of the one showing in filtered text ...when filtered.</p>","302356","","","","","2013-02-17 02:44:42","onItemClick gives index/ position of item on visible page ... not actual index of the item in list ..problem on enabling setTextFilterEnabled .. android","<android><sqlite><listview><index><position>","6","0","2","",""
"2521959","1","2524243","","2010-03-26 08:41:15","142","140731","<p>In Android, I defined an <code>ImageView</code>'s <code>layout_width</code> to be <code>fill_parent</code> (which takes up the full width of the phone).</p><p>If the image I put to <code>ImageView</code> is bigger than the <code>layout_width</code>, Android will scale it, right? But what about the height? When Android scales the image, will it keep the aspect ratio?</p><p>What I find out is that there is some white space at the top and bottom of the <code>ImageView</code> when Android scales an image which is bigger than the <code>ImageView</code>. Is that true? If yes, how can I eliminate that white space?</p>","286802","","999400","","2013-07-22 08:01:16","2014-04-08 08:29:21","How to scale an Image in ImageView to keep the aspect ratio","<android><android-imageview><image-scaling>","14","0","56","",""
"2521991","1","2522959","","2010-03-26 08:48:52","0","2556","<p>Im working on a small application to try out an idea that I have. The idea is to periodically update the UI when event of some sort occurs. In the demo I've created, I'm updating a ProgressDialog every 2 seconds for 15 turns.  </p><p>The problem I am having, which I don't quite understand is that when an event is handled, I send a message to the handler which is supposed to update the message in the ProgressDialog. When this happens however, I get an exception which states that I can't update the UI from that thread.</p><p>The following code appears in my Activity:</p><pre><code>ProgressDialog diag;String diagMessage = ""Started loading..."";final static int MESSAGE_DATA_RECEIVED = 0;final static int MESSAGE_RECEIVE_COMPLETED = 1;final Handler handler = new Handler(){    @Override    public void handleMessage(Message msg){        diag.setMessage(diagMessage);        switch(msg.what){            case MESSAGE_DATA_RECEIVED:                break;            case MESSAGE_RECEIVE_COMPLETED:                dismissDialog();                killDialog();                break;        }    }};Boolean isRunning = false;/** * Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setupDialog();    if(isRunning){        showDialog();    }    setContentView(R.layout.main);}void setupDialog(){    if(diag == null){        diag = new ProgressDialog(ThreadLoading.this);        diag.setMessage(diagMessage);    }}void showDialog(){    isRunning = true;    if(diag != null &amp;&amp; !diag.isShowing()){        diag.show();    }}void dismissDialog(){    if(diag != null &amp;&amp; diag.isShowing()){        diag.dismiss();    }}void killDialog(){    isRunning = false;}public void onStart(){    super.onStart();    showDialog();    Thread background = new Thread(new Runnable(){        public void run(){            try{                final ThreadRunner tr = new ThreadRunner();                tr.setOnDataReceivedListener(new ThreadRunner.OnDataReceivedListener(){                    public void onDataReceived(String message){                        diagMessage = message;                        handler.handleMessage(handler.obtainMessage(MESSAGE_DATA_RECEIVED));                    }                });                tr.setOnDataDownloadCompletedEventListener(new ThreadRunner.OnDataDownloadCompletedListener(){                    public void onDataDownloadCompleted(String message){                        diagMessage = message;                        handler.handleMessage(handler.obtainMessage(MESSAGE_RECEIVE_COMPLETED));                    }                });                tr.runProcess();            }            catch(Throwable t){                throw new RuntimeException(t);            }        }    });    background.start();}@Overridepublic void onPause(){    super.onPause();    dismissDialog();}</code></pre><p>For curiosity sake, here's the code for the ThreadRunner class:</p><pre><code>public interface OnDataReceivedListener {    public void onDataReceived(String message);}public interface OnDataDownloadCompletedListener {    public void onDataDownloadCompleted(String message);}private OnDataReceivedListener onDataReceivedEventListener;private OnDataDownloadCompletedListener onDataDownloadCompletedEventListener;int maxLoop = 15;int loopCount = 0;int sleepTime = 2000;public void setOnDataReceivedListener(OnDataReceivedListener onDataReceivedListener){    this.onDataReceivedEventListener = onDataReceivedListener;}public void setOnDataDownloadCompletedEventListener(OnDataDownloadCompletedListener onDataDownloadCompletedListener){    this.onDataDownloadCompletedEventListener = onDataDownloadCompletedListener;}public void runProcess(){    for(loopCount = 0; loopCount &lt; maxLoop; loopCount++){        try{            Thread.sleep(sleepTime);            onDataReceivedEventListener.onDataReceived(Integer.toString(loopCount));        }        catch(Throwable t){            throw new RuntimeException(t);        }    }    onDataDownloadCompletedEventListener.onDataDownloadCompleted(""Download is completed"");}</code></pre><p>Am I missing something? The logic makes sense to me and it looks like everything should work, I'm using a handler to update the UI like it is recommended.</p><p>Any help will be appreciated.</p><p>Thanks,Tyrone</p><p>P.S. I'm developing for Android 1.5</p>","171926","","","","","2010-03-26 11:45:30","Update UI from an event with a thread","<android>","1","2","1","",""
"2522034","1","","","2010-03-26 09:01:28","0","917","<p>i want to draw a graph in a area and i used a linear layout as area.i want to set the size of the graph area,which should be compatible to small,medium ,default emulators etc.i need to set the size for graph  area,how can i do it in xml file</p><p>for eg in blackberry we use Display.getWidth();Similar is there way to get the width of the display either programmatically or in xml</p><p>To expand my area, i did like this, in below image (just added label,which gets an height)</p><p><a href=""http://www.filefactory.com/file/b0da255/n/testAndroid1.JPG"" rel=""nofollow"">image</a></p><p>To expand it ,i added somemore like this </p><p><a href=""http://www.filefactory.com/file/b0da256/n/testAndroid2.JPG"" rel=""nofollow"">image1</a></p><p>Regards</p><p>Rakesh Shankar.p</p>","138030","","138030","","2010-03-26 09:15:24","2011-09-02 13:03:56","How to draw the graph in android based on its height and size","<android>","1","0","","",""
"2522369","1","3479753","","2010-03-26 10:07:41","3","7697","<p>I know the attribute which makes the text ""disapear"" on the left part of the Edittext to maintain a single line, (singleLine=""true""). But my issue is when I fill the edittext before the view is displayed... in this case, my edittexts are all going out of the screen...any ideas?thx!</p><p>This is what is get when fill the empty Edittext. Everything stays put, and the text is vanishing on its left side</p><p><a href=""http://www.freeimagehosting.net/image.php?1f6d9de832.png"" rel=""nofollow"">Screenshot</a></p><p>and when I prefill from my DB</p><p><a href=""http://www.freeimagehosting.net/image.php?87a63b1b21.png"" rel=""nofollow"">Screenshot</a></p><p>here is the code of the edittext :</p><pre><code>&lt;EditText android:id=""@+id/InscripChampNom""android:layout_height=""wrap_content"" android:textSize=""14px""android:inputType=""textPersonName"" android:layout_marginRight=""20dip""android:singleLine=""true"" android:textColor=""@color/background""&gt;&lt;/EditText&gt;</code></pre><p>The tableLayout is defined as follows:</p><pre><code>&lt;TableLayout android:layout_width=""fill_parent""android:stretchColumns=""1"" android:layout_height=""fill_parent""&gt;</code></pre><p>I also tried with the attribute </p><pre><code>android:layout_width=""fill_parent""</code></pre><p>and</p><pre><code>android:layout_width=""wrap_content""</code></pre><p>no success at all...</p><p>Maybe there is a conflict between input type and singleline?</p><p><strong>EDIT  Here is the full code of my issue :</strong>  </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""android:scrollbars=""vertical"" android:background=""@color/backgroundzen""android:layout_gravity=""fill"" android:layout_height=""fill_parent""android:layout_width=""fill_parent"" android:paddingLeft=""6dip""android:paddingRight=""6dip""&gt;&lt;TableLayout style=""@style/LayoutWhiteBgrdFillWrap""    android:paddingLeft=""6dip"" android:paddingRight=""6dip""    android:stretchColumns=""1""&gt;    &lt;TextView android:id=""@+id/NomFormationConference"" style=""@style/textViewTitleRedzenBold""        android:text=""Nom conférence""&gt;&lt;/TextView&gt;    &lt;TableRow android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/DateSession"" android:textColor=""@color/textezenrouge""            android:layout_height=""wrap_content"" android:layout_width=""wrap_content""            android:text=""date début""&gt;&lt;/TextView&gt;        &lt;TextView android:id=""@+id/speakerConf"" android:textColor=""@color/textezenrouge""            android:layout_height=""wrap_content"" android:layout_width=""wrap_content""            android:text=""speaker""&gt;&lt;/TextView&gt;    &lt;/TableRow&gt;    &lt;TableRow android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/InscripNom"" android:layout_width=""wrap_content""            android:textColor=""@color/background"" android:layout_height=""wrap_content""            android:text=""@string/nom"" android:textStyle=""bold""&gt;&lt;/TextView&gt;        &lt;EditText android:id=""@+id/InscripChampNom""            android:layout_height=""wrap_content"" android:textSize=""14sp""            android:layout_width=""fill_parent"" android:inputType=""textPersonName""            android:layout_marginRight=""20dip"" android:hint=""@string/nomh""            android:singleLine=""true"" android:textColor=""@color/background""&gt;&lt;/EditText&gt;    &lt;/TableRow&gt;</code></pre><p>//The last tablerow is repeated 5 times with various data inside.        </p><p>The style is like that :  </p><pre><code>&lt;style name=""LayoutWhiteBgrdFillWrap""&gt;    &lt;item name=""android:background""&gt;@color/backgroundzen&lt;/item&gt;    &lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;    &lt;item name=""android:layout_height""&gt;fill_parent&lt;/item&gt;&lt;/style&gt;</code></pre><p>And here is how I fill the <code>EditText</code> :  </p><pre><code>misc = SQLiteDatabase.openDatabase(""/data/data/com.mobile.zen/databases/"" + Constants.UNVERSIONNED_DATABASE, null,            SQLiteDatabase.OPEN_READONLY);    Cursor c = misc.query(""MISC"", null, null, null, null, null, null);    if (c.moveToFirst()) {        do {            nomInscrit.setText(c.getString(1));        } while (c.moveToNext());    }    c.close();    misc.close();</code></pre>","263521","","60004","","2010-08-20 02:56:50","2012-11-21 23:33:16","How to make Edittext size stay put? Android","<android><size><edittext>","6","6","1","",""
"2522775","1","2524770","","2010-03-26 11:16:22","0","346","<p>The main concept goes like this. I have four listviews with its owndata loaded at the same time. Only one listview will be visible to theuser. Now, when the user presses a button, not only the currentlistview but also other three listviews should be minimized and thenuser can just scroll just as in Gallery and select the listview thatone wants to open.</p><p>I hope you all have understood what I want.</p><p>Let me know if someone have some idea of implementing such a UserInterface in Android.</p>","261566","","1471203","","2013-01-09 10:55:11","2013-01-09 10:55:11","Integrate IPhone Safari like view in Android?","<iphone><android><safari><view><gallery>","1","2","1","",""
"2522829","1","","","2010-03-26 11:24:44","1","587","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2536194/android-image-exif-reader-3rd-party-api"">android image exif reader 3rd party api</a>  </p></blockquote><p>ExifInterface is available from platform 1.7 how to read exif tags from image on platform 1.5, 1.6 ?</p>","216431","","","","","2010-04-03 11:30:52","android ExifInterface platform 1.5, 1.6","<android><image><geolocation>","0","1","0","2011-08-29 01:58:27",""
"2523186","1","","","2010-03-26 12:28:39","-1","1430","<p>analogous to this thread:<a href=""http://stackoverflow.com/questions/2093594/opengl-extensions-available-on-different-android-devices"">OpenGL extensions available on different Android devices</a>I would like to collect the different PixelFormats the android devices use.</p><p>To find out you must do the following:</p><pre><code>Parameters camParams = camera.getParameters();int format = camParams.getPreviewFormat();</code></pre><p>Now you got to find the number in the following list:developer.android.com/reference/android/graphics/PixelFormat.html#A_8</p><p>How to generally open the camera is described here:<a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html</a></p><p>I'll have a start:</p><p>device: T-mobile G1 / HTC Dream<br>android: 1.6 (cyanogen mod)<br>format: YCbCr_420_SP</p><p>So what formats do your android phones use?thanks in advance :D</p>","302500","","1101070","","2012-03-07 03:02:18","2012-03-07 03:02:18","Android PixelFormat per device","<android><camera><preview><pixelformat>","2","0","1","",""
"2523459","1","2524046","","2010-03-26 13:17:01","81","17805","<p>I'm confused as to when one would choose AsyncTask over a Handler.  Say I have some code I want to run every n seconds which will update the UI.  Why would I choose one over the other?  </p>","131640","","","","","2013-07-13 14:08:45","Handler vs AsyncTask","<android>","5","1","35","",""
"2523904","1","2524123","","2010-03-26 14:19:50","3","1862","<p>I am posting some data to a server using <code>DefaultHttpClient</code> class and in the response stream I am getting a HTML file. I save the stream as a string and pass it onto another activity which contains a WebView to render this HTML on the screen:</p><pre><code>response = httpClient.execute(get);InputStream is = response.getEntity().getContent();BufferedReader br = new BufferedReader(new InputStreamReader(is,""utf-8""));StringBuffer sb = new StringBuffer();String line;while((line=br.readLine())!=null){    sb.append(line);    sb.append(""\n"");}is.close();Intent intent = new Intent(this,Trial.class);intent.putExtra(""trial"",sb.toString());startActivity(intent);Log.i(""SB"",sb.toString());</code></pre><p>In Second Activity, the code to load the WebView reads:</p><pre><code>WebView browser = ((WebView)findViewById(R.id.trial_web));browser.getSettings().setJavaScriptEnabled(true); browser.loadData(html,""text/html"", ""utf-8"");</code></pre><p>When I run this code, the WebView is not able to render the HTML content properly. It actually shows the HTML string in URL encoded format on the screen. Interestingly, If I copy the Loggers output to HTML file and then load this HTML in my WebView(using <code>webview.loadurl(file:///assets/xyz.html)</code>) everything works fine. </p><p>I suspect some problem with character encoding. </p><p>What is going wrong here? Please help.</p><p>Thanks.</p>","236128","","","","","2010-03-26 14:52:22","HTML inside webView","<html><android><character-encoding><webview>","1","0","","",""
"2524051","1","2524156","","2010-03-26 14:41:08","6","8915","<p>Does anyone know how to override the default style for AlertDialog buttons? I've looked through the Android source for <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/themes.xml;h=6b3d7407d1c895a3c297e60d5beac98e2d34c271;hb=HEAD"">themes</a> and <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/styles.xml;h=d7b654e49809cb97a35682754b1394af5c8bc88b;hb=HEAD"">styles</a> and experimented with different things but I haven't been able to find a way that works.</p><p>What I've got below works for changing the backgrounds, but doesn't do anything with the buttons. <code>myTheme</code> is applied to the whole <code>&lt;application&gt;</code> via the manifest. (Some other items were deleted for clarity, but they only relate to the title bar.)</p><pre><code>&lt;style name=""myTheme"" parent=""android:Theme""&gt;    &lt;item name=""android:buttonStyle""&gt;@style/customButtonStyle&lt;/item&gt;    &lt;item name=""android:alertDialogStyle""&gt;@style/dialogAlertTheme&lt;/item&gt;&lt;/style&gt;&lt;style name=""dialogAlertTheme"" parent=""@android:style/Theme.Dialog.Alert""&gt;    &lt;item name=""android:fullDark""&gt;@drawable/dialog_loading_background&lt;/item&gt;    &lt;item name=""android:topDark""&gt;@drawable/dialog_alert_top&lt;/item&gt;    &lt;item name=""android:centerDark""&gt;@drawable/dialog_alert_center&lt;/item&gt;    &lt;item name=""android:bottomDark""&gt;@drawable/dialog_alert_bottom&lt;/item&gt;    &lt;!-- this last line makes no difference to the buttons --&gt;    &lt;item name=""android:buttonStyle""&gt;@style/customButtonStyle&lt;/item&gt; &lt;/style&gt;</code></pre><p>Any ideas?</p>","235654","","","","","2012-12-07 11:39:14","Button style in AlertDialogs","<android><alertdialog>","2","0","2","",""
"2524287","1","2608206","","2010-03-26 15:12:25","1","7461","<p>I have an Android application with version 1.6 I take the wallpaper and show it on my application.(I do that programatically by calling getWallpaper() on the Activity)</p><p>When this is installed on a 2.1 phone, that has live wallpaper, the live wallpaper is not returned by getWallpaper() , because it just returns a Drawable, and live wallpaper probably is another thing.</p><p>So the question is, is it possible to show a live wallpaper on the background of a 1.6 application? How?</p><p>Thanks</p><p>========================================================================================</p><p>So far I haven't found a solution for this.I am adding this to better understand the question</p><p>To be clear: The app is written for 1.6 so it will work on all 1.6 and higher.  The question is: can we write an app with 1.6 as the target, but support live wallpapers if its being run on a 2.1 device??</p><p>Thanks</p>","237115","","237115","","2010-04-01 15:44:10","2010-04-09 14:21:03","Live wallpaper on 1.6 android application","<android><wallpaper>","3","0","1","",""
"2524304","1","2606665","","2010-03-26 15:14:54","4","4289","<p>I'm working on an application that requires support for forward locking of media files on Android (1.6 and above). Of course, there appears to be no documentation in the APIs on how this might work.</p><p>The two questions I have are firstly whether forward locking is supported on Android (and in which versions of the platform) and secondly how to implement it in a program that, for example, downloads DRMed ringtones and wallpapers.</p>","39368","","","","","2010-07-08 09:30:38","How to implement OMA forward lock on Android?","<android><drm><oma>","3","1","2","",""
"2524444","1","2537084","","2010-03-26 15:32:22","12","4410","<p>My activity needs to communicate with a java server located on my dev machine. Actually, using the emulator, I can access the server socket via the special 10.0.2.2 address. Now I'd like to test my app on my phone connected via usb, but it seems like I can't use 10.0.2.2 to access my dev machine localhost anymore.Naturally using a wifi router and a proper lan addressing does the trick, but I need to use usb connection instead. Any hint ?</p><p>edit:<br/>Just added different scenarios to let everyone understand better:</p><p><strong>1. Emulator-based scenario:</strong></p><ul><li>standard java server running on my pc @localhost:15000</li><li>android java client running on my emulator.</li></ul><p>When the android app needs to contact the server it uses 10.0.2.2:15000 like specified <a href=""http://developer.android.com/intl/fr/guide/developing/tools/emulator.html#emulatornetworking"">here</a>. Everything works fine.</p><p><strong>2. Proper wifi scenario with physical connected device:</strong></p><ul><li>standard java server running on my pc @192.168.1.10:15000.</li><li>android java client running on my device with 192.168.1.11 address assigned.</li></ul><p>When the android app needs to contact the server it uses 192.168.1.10:15000 and everything works fine too.</p><p><strong>3. Desired scenario:</strong></p><ul><li>standard java server running on my pc @localhost:15000.</li><li>android java client running on my device connected via usb cable. No network is active.</li></ul><p>When the android app needs to contact the server it tries to connect to 10.0.2.2:15000 but instead an exception is thrown (Network unreachable). It seems like special address 10.0.2.2 works only for emulator instances.</p><p>I just wonder if in the adb/adt suite there's a way to access pc address from the device connected via usb cable.I hope it's a bit more clear now.Thanks.</p>","302645","","302645","","2010-03-26 17:45:52","2010-06-20 11:00:13","Access dev machine localhost via usb","<java><android><networking><usb>","2","0","2","",""
"2524683","1","2525085","","2010-03-26 16:00:44","5","6703","<p>One of our views has a <code>ScrollView</code> as its root layout. When the device is rotated and <code>onConfigurationChanged()</code> is called, we'd like to be able to get the <code>ScrollView</code>'s new width/height. Our code looks like this:</p><pre><code>@Overridepublic void onConfigurationChanged(Configuration newConfig) {    Log.d(TAG, ""Width: '"" + findViewById(R.id.scrollview).getWidth() + ""'"");    Log.d(TAG, ""Height: '"" + findViewById(R.id.scrollview).getHeight() + ""'"");    super.onConfigurationChanged(newConfig);    Log.d(TAG, ""Width: '"" + findViewById(R.id.scrollview).getWidth() + ""'"");    Log.d(TAG, ""Height: '"" + findViewById(R.id.scrollview).getHeight() + ""'"");}</code></pre><p>The relevant section of our AndroidManifest.xml looks like this:</p><pre><code>&lt;activity android:name="".SomeActivity""    android:configChanges=""keyboardHidden|orientation""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.MAIN"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>And finally, the relevant portion of our layout looks like this:</p><pre><code>&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/scrollview""    android:layout_height=""fill_parent""    android:layout_width=""fill_parent""    &gt;    &lt;LinearLayout android:id=""@+id/container""        android:orientation=""vertical""        android:layout_height=""fill_parent""        android:minHeight=""200dip""        android:layout_width=""fill_parent""        &gt;</code></pre><p>On our Droid, we expected to see the ScrollView's width go to 854 when switched into landscape, and to 480 when switched back to portrait (and the height do the equivalent switch, minus the menu bar). However, we're seeing the opposite. Here's our LogCat:</p><pre><code>// Switching to landscape:03-26 11:26:16.490: DEBUG/ourtag(17245): Width: '480'  // Before super03-26 11:26:16.490: DEBUG/ourtag(17245): Height: '778' // Before super03-26 11:26:16.529: DEBUG/ourtag(17245): Width: '480'  // After super03-26 11:26:16.536: DEBUG/ourtag(17245): Height: '778' // After super// Switching to portrait:03-26 11:26:28.724: DEBUG/ourtag(17245): Width: '854'  // Before super03-26 11:26:28.740: DEBUG/ourtag(17245): Height: '404' // Before super03-26 11:26:28.740: DEBUG/ourtag(17245): Width: '854'  // After super03-26 11:26:28.740: DEBUG/ourtag(17245): Height: '404' // After super</code></pre><p>Clearly, we're getting the portrait dimensions when we switch to landscape, and the landscape dimensions when we switch to portrait. Is there something we're doing wrong? We could get hacky and solve this, but I feel like there's a simple solution that we're missing.</p>","96514","","","","","2013-09-30 06:01:28","How to get NEW width/height of root layout in onConfigurationChanged?","<android><orientation><scrollview><onconfigurationchanged>","2","0","4","",""
"2524694","1","2562304","","2010-03-26 16:01:43","3","480","<p>I have an Android project and Eclipse is telling me my project has an error with its build path. Specifically, the problem view shows ""The project cannot be built until build path errors are resolved"". The entire project builds just fine, meaning there are no red X's on any of the files. I can build the project outside of Eclipse, deploy it to the device, and it runs just fine, so I know there isn't a problem with my source code or layouts. The strange thing is when I remove the 'src' folder from the build path in Eclipse, clean and build the project, then re-add the 'src' folder to the build path and build the project it works again. However, within a few changes it gives me the same problem.</p><p>Has anyone else encountered this before? Does anyone know of a solution? It's driving me mad!</p><p>Thanks,</p><p>-Dan</p>","212389","","","","","2010-04-01 17:28:43","Eclipse thinks there are problems with my Android project","<android><eclipse><build><path>","5","0","1","",""
"2524900","1","2525302","","2010-03-26 16:28:32","7","8462","<p>Has anyone tried to develop an android app on windows 7?  It says that it isn't a supported OS, but sometimes that doesn't stop people from trying to develop on it anyways.</p>","299592","","","","","2012-10-22 17:53:39","Android development on windows 7","<android><windows-7>","8","2","3","2013-08-14 20:09:56",""
"2524923","1","","","2010-03-26 16:31:35","1","4708","<p>I've tried these phones: Motorolla Backflip 1.5, Nexus One 2.1</p><p>Basically I register BroadcastReceiver to get ACTION_HEADSET_PLUG broadcast and look on 3 extras that come in intent:</p><ul><li>state</li><li>name</li><li>microphone</li></ul><p>Here is the description from API:</p><pre><code>* state - 0 for unplugged, 1 for plugged.* name - Headset type, human readable string* microphone - 1 if headset has a microphone, 0 otherwise</code></pre><p>Issue #1: Broadcast comes when activity is started (not expected), when screen rotation happens (not expected) and when headset/headphones plugged/unplugged (expected).</p><p>Issue #2: Backflip phone (1.5) sends null for state + microphone, 'No Device' as name when headset/headphones unplugged, and sends null for state + microphone, 'Stereo HeadSet'/'Stereo HeadPhones' as name when headset/headphones plugged.</p><p>UPDATE: T-Mobile G1 with 1.6 behaves the same as Backflip phone.</p><p>Nexus even worse, it always sends null for state + microphone, 'Headset' as name when headset/headphones plugged or unplugged.</p><p>Question: How it can be explained that API is broken so much on both 1.5 and 2.1 versions and different devices, manufactures?</p><p>UPDATE:</p><p>Code in onCreate of main Activity:</p><pre><code>// Register receiver    this.registerReceiver(new BroadcastsHandler(), new IntentFilter(Intent.ACTION_HEADSET_PLUG));</code></pre><p>Now the code of BroadcastReceiver:</p><pre><code>public class BroadcastsHandler extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent intent) {    if (intent.getAction().equalsIgnoreCase(Intent.ACTION_HEADSET_PLUG)) {        String data = intent.getDataString();        Bundle extraData = intent.getExtras();        String st = intent.getStringExtra(""state"");        String nm = intent.getStringExtra(""name"");        String mic = intent.getStringExtra(""microphone"");        String all = String.format(""st=%s, nm=%s, mic=%s"", st, nm, mic);        AlertDialog.Builder builder = new AlertDialog.Builder(context);        builder.setTitle(""Headset broadcast"");        builder.setMessage(all);        builder.setPositiveButton(""Okey-dokey"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int which) {                dialog.dismiss();            }        });        builder.create().show();    }}</code></pre><p>}</p>","2029411","","2029411","","2010-03-29 15:41:39","2013-09-25 07:03:22","Issues with ACTION_HEADSET_PLUG broadcast in Android","<android><broadcast>","3","2","2","",""
"2525053","1","2526284","","2010-03-26 16:47:49","0","3177","<p>I want to show a messageBox or notification when connection lost in Static Database class.But I can't use getApplicationContext() as the class is static and I tried to call other class called notification but I have an error. So How could I pass activity object to my new class ?</p>","302707","","766108","","2012-08-23 11:50:00","2012-08-23 11:50:00","How to get reference of activity object?","<android>","3","2","","",""
"2525074","1","2525098","","2010-03-26 16:49:29","13","13883","<p>A buddy sent me a later version of an .apk file. I already had the earlier version on my device.</p><p>When I tried to adb install the file, I got this:</p><pre><code>$ adb install ../FlashLite.apk 320 KB/s (18311 bytes in 0.055s)    pkg: /data/local/tmp/FlashLite.apkFailure [INSTALL_FAILED_ALREADY_EXISTS]$ adb uninstall FlashLite.apkFailure$ adb uninstall /data/local/tmp/FlashLite.apkFailure</code></pre><p>How do you install/replace from the cmd line? I don't have the source, so I cannot do it from Eclipse.</p>","253661","","56285","","2013-10-16 09:28:38","2013-10-16 09:28:38","How to install/replace on Android without using Eclipse","<android><command-line><install><apk>","5","1","2","",""
"2525244","1","2526462","","2010-03-26 17:17:31","0","3493","<p>I'm having some difficulties getting the TabActivity to work. Here's the implementation of the class:</p><pre><code>public class Profile extends TabActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    final TabHost tabHost = getTabHost();    if (tabHost.isEnabled()) {     Log.e(""profile"", ""enabled"");    }    tabHost.addTab(tabHost.newTabSpec(getString(R.string.friendReqs))            .setIndicator(""requests"")            .setContent(new Intent(this, FriendRequests.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));    tabHost.addTab(tabHost.newTabSpec(getString(R.string.friends))            .setIndicator(""photo list"")            .setContent(new Intent(this, Settings.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));    Log.e(""profile"", ""add tabs"");    tabHost.invalidate();}}</code></pre><p>The problem is that I call this class from my main activity (which is a MapActivity if it matters) and when I do the TabActivity doesn't show. It registers the click on the option menu and it even starts the intent but the screen doesn't change..it just stays on the main activity and i see in the logs that the main activity gets resumed. I call it like this:</p><pre><code>Intent p = new Intent(this,Profile.class);   p.putExtra(DBAdapter.KEY_USERID,userid);   startActivity(p);</code></pre><p>Like I said...there are no errors (the classes called from the tabs exist of course), just no actions. I put some log commands into the onCreate function in the tabactivity (as you see) and they all get written into the log...I have no idea what I'm doing wrong here. Any help?</p>","297616","","297616","","2010-03-26 17:24:30","2010-03-26 20:18:26","Android tabactivity problem","<android><activity><tabs>","3","0","","",""
"2525404","1","3578963","","2010-03-26 17:37:00","8","1179","<p>I've noticed a couple of Android applications that seem to be using a 3rd party crash reporting tool. Has anyone seen this screen and do you know where I can find it? I started using <a href=""http://code.google.com/p/android-remote-stacktrace/"" rel=""nofollow"">http://code.google.com/p/android-remote-stacktrace/</a> but i rather not require internet permissions if I can use an intent to send emails.</p><p><img src=""http://img532.yfrog.com/img532/808/devicefeedback.png"" alt=""alt text""></p>","67605","","","","","2011-05-09 08:43:10","Reporting Android Application Crashes","<android>","3","2","8","",""
"2525683","1","2525716","","2010-03-26 18:14:57","26","24488","<p>Those dark spinning progress dialogs in the Amazon and Engadget apps - are those standard in Android?</p>","246793","","","","","2010-03-26 18:30:27","How to do loading dialogs in Android?","<android><dialog><progress-bar>","1","0","11","",""
"2525823","1","","","2010-03-26 18:40:11","0","158","<p>I have an app on the market that requires sdk 2.0I want to rewrite and publish it using 1.6 to find a wider audience.</p><p>The question is: if I update my already published app with an sdk downgrade to 1.6 will it then show up to users with phones at 1.6?  I know currently the market search shows my app only to those that have 2.0 phones.</p>","300081","","","","","2010-03-26 20:42:36","Update an Android market app to lower sdk?","<android><publish>","2","0","","",""
"2525969","1","2526046","","2010-03-26 19:04:45","13","5587","<p>Does anybody know of a way to use Guice to inject dependencies into the constructor of an Activity in Android?  It looks like activities normally have only the default constructor so that the platform can easily create a new instance.  While it is easy enough to have a singleton to reference the injector and get dependencies that way it is less clean and introduces a bit of static state.</p><p>Any suggestions?</p>","97901","","136445","","2011-02-03 18:08:10","2013-03-18 14:10:40","Using Guice to inject dependencies into an Android activity's constructor","<android><guice><roboguice>","1","0","4","",""
"2526036","1","2526223","","2010-03-26 19:17:20","1","2972","<p>I have created a list view that displays the names and dates of items stored in a SQLite database, now I want to use a Context Menu to modify these items stored in the database such as edit the name, delete, and view.</p><p>This is the code for the list view:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.listview);    SQLiteDatabase myDB = null;     myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);    Cursor cur = myDB.rawQuery(""SELECT _id, trackname, tracktime"" + "" FROM "" + MY_DB_TABLE, null);    ListAdapter adapter = new SimpleCursorAdapter(this, R.layout.listview, cur,    new String[] { Constants.TRACK_NAME, Constants.TRACK_TIME}, new int[] { R.id.text1, R.id.text2});    ListView list = (ListView)findViewById(R.id.list);    list.setAdapter(adapter);    registerForContextMenu(list);}</code></pre><p>and the Context Menu...</p><pre><code>public void onCreateContextMenu(ContextMenu menu, View v,        ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, v, menuInfo);    menu.setHeaderTitle(""Track Options"");    menu.add(0, CHANGE_NAME, 0, ""Change name"");    menu.add(0, VIEW_TRACK, 0, ""View track"");    menu.add(0, SEND_TRACK, 0, ""Send track"");    menu.add(0, DELETE_TRACK, 0, ""Delete track"");}</code></pre><p>I have used a Switch statement to control the menu items..</p><pre><code>public boolean onContextItemSelected(MenuItem item) {   switch (item.getItemId()){   case CHANGE_NAME:       changename();       return true;   case DELETE_TRACK:       deletetrack();       return true;   default:   return super.onContextItemSelected(item);}</code></pre><p>So how would I go ahead and map the deletetrack(); method to find the ID of the track stored in the database to the item that has been selected in the list view?</p>","296810","","176075","","2012-11-07 03:12:37","2012-11-07 03:12:37","Using a Context Menu to delete from a SQLite database in Android","<java><android><sqlite><contextmenu>","2","0","1","",""
"2526080","1","","","2010-03-26 19:22:02","9","8871","<p>I am using datePicker in android to display images based on user selected dates. I need to limit said dates to certain days for instance Jan 1st 2010 to Dec 31st 2010. Simple as that i thought but no where can i find the answer on how to limit these dates.</p><p>Does anyone know how to limit the dates for Android DatePicker</p>","301760","","","","","2014-04-04 09:11:02","Set android datepicker date limits","<android><datepicker><android-datepicker>","2","1","3","",""
"2526536","1","2526757","","2010-03-26 20:31:41","2","293","<p>More specifically, does NDK have a complete STL implementation. We're looking at this for devices running 1.6 and upwards.</p>","246793","","102703","","2010-03-26 21:10:43","2011-05-24 14:07:59","Can anyone explain what features of the C runtime in Android (via NDK) are not supported?","<c++><android><stl><jni><android-ndk>","2","0","","",""
"2526962","1","","","2010-03-26 21:46:22","2","5552","<p>When i running Android App i got following error..</p><pre><code>[2010-03-27 02:47:28 - HelloAndroid] Connection with adb was interrupted.[2010-03-27 02:47:28 - HelloAndroid] 0 attempts have been made to reconnect.[2010-03-27 02:47:28 - HelloAndroid] You may want to manually restart adb from the Devices view.</code></pre><p>How can i fix this ?Thanks Atul Yadav</p>","255560","","492561","","2011-11-29 14:30:26","2012-06-24 03:48:35","When Running android app I get ADB error","<android>","3","2","","",""
"2527311","1","2528759","","2010-03-26 22:58:08","5","307","<p>I have a listview with 200 items. I use a custom view for each row. There is a code that takes some time to calculate, and because of this the list hangs out on scrolling and loads in slow (2-3sec).  </p><p>I have subclassed SimpleCursorAdapter, and using Filterable and SectionIndexer.</p><p>I have in mind to show initially the name of the record, and put in a thread the calculation, and will show up later when it's done. </p><p>How do I push back some work, and later update the listview to include the calculated data? This should show up on fly without user interaction.</p>","243782","","","","","2010-04-04 10:39:52","How to schedule heavy work for later display for Listviews?","<android><listview><multithreading><cursor>","2","0","1","",""
"2527450","1","2527687","","2010-03-26 23:30:39","0","14109","<p>I've just created a prototype of interface for my android app and tried to run it. Unfortunately I get an error that my app has stopped unexpectedly:</p><p><img src=""http://mobileka.freehostia.com/3.png"" alt=""screenshot""></p><p>This is layout mode of editing. Everything looks as I want so there shouldn't be errors:</p><p><img src=""http://mobileka.freehostia.com/1.png"" alt=""screenshot""></p><p>This is my main.xml code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:gravity=""top""    android:background=""@drawable/back"" &gt;    &lt;TextView        android:id=""@+id/score""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text = ""@string/scoreT""        android:textColor=""@string/scoreColor""        android:gravity = ""left""        android:typeface=""serif""        android:textStyle=""bold|italic""        android:textSize=""16sp""        android:paddingLeft = ""10px""        android:paddingTop=""4px""/&gt;    &lt;TextView        android:id = ""@+id/scoreTxt""        android:layout_toRightOf=""@+id/score""        android:textSize=""16sp""        android:paddingTop = ""5px""        android:paddingLeft=""4px""        android:typeface=""serif""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""    0""        android:textColor=""@string/scoreTextColor""        android:gravity = ""left""/&gt;    &lt;TextView        android:id = ""@+id/scoreSeparator""        android:layout_toRightOf=""@+id/scoreTxt""        android:textSize=""16sp""        android:paddingTop = ""3px""        android:paddingLeft=""4px""        android:typeface=""serif""        android:textStyle=""bold""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""|""        android:textColor=""@string/scoreColor""        android:gravity = ""left""/&gt;     &lt;TextView        android:id = ""@+id/timerTxt""        android:layout_alignParentRight=""true""        android:textSize=""16sp""        android:paddingRight=""10px""        android:paddingTop=""4px""        android:typeface=""serif""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textColor=""@string/scoreTextColor""        android:gravity = ""right""        android:text=""00:00"" /&gt;         &lt;TextView        android:id = ""@+id/timer""        android:layout_toLeftOf=""@+id/timerTxt""        android:textColor=""@string/scoreColor""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textSize=""16sp""        android:padding = ""3px""        android:typeface=""serif""        android:textStyle=""bold|italic""        android:text=""@string/timerT""        android:gravity = ""left""/&gt;    &lt;TextView        android:id = ""@+id/timerSeparator""        android:layout_toLeftOf=""@+id/timer""        android:textSize=""16sp""        android:paddingTop = ""3px""        android:paddingLeft=""4px""        android:typeface=""serif""        android:textStyle=""bold""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""|""        android:textColor=""@string/scoreColor""        android:gravity = ""left""/&gt;     &lt;ImageButton         android:id=""@+id/buttonOne""        android:layout_below=""@+id/score""         android:layout_marginTop=""40px""        android:layout_marginLeft=""14px""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:clickable=""true""         android:src=""@drawable/inactive""/&gt;    &lt;ImageButton         android:id=""@+id/buttonTwo""        android:layout_toRightOf=""@+id/buttonOne""         android:layout_marginTop=""63px""        android:layout_marginLeft=""10px""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/inactive"" /&gt;    &lt;ImageButton         android:id=""@+id/buttonThree""        android:layout_toRightOf=""@+id/buttonTwo""         android:layout_marginTop=""63px""        android:layout_marginLeft=""10px""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/inactive"" /&gt;    &lt;ImageButton         android:id=""@+id/buttonFour""        android:layout_toRightOf=""@+id/buttonThree""         android:layout_marginTop=""63px""        android:layout_marginLeft=""10px""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/inactive"" /&gt;    &lt;ImageButton         android:id=""@+id/buttonFive""        android:layout_below=""@+id/buttonOne""         android:layout_marginTop=""40px""        android:layout_marginLeft=""14px""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/inactive"" /&gt;     &lt;ImageButton         android:id=""@+id/buttonSix""        android:layout_toRightOf=""@+id/buttonFive""         android:layout_marginTop=""164px""        android:layout_marginLeft=""10px""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/inactive"" /&gt;    &lt;ImageButton         android:id=""@+id/buttonSeven""        android:layout_toRightOf=""@+id/buttonSix""         android:layout_marginTop=""164px""        android:layout_marginLeft=""10px""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/inactive"" /&gt;    &lt;ImageButton         android:id=""@+id/buttonEight""        android:layout_toRightOf=""@+id/buttonSeven""         android:layout_marginTop=""164px""        android:layout_marginLeft=""10px""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/inactive"" /&gt;    &lt;ImageButton         android:id=""@+id/buttonNine""        android:layout_below=""@+id/buttonEight""         android:layout_marginTop=""40px""        android:layout_marginLeft=""14px""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/inactive"" /&gt;    &lt;ImageButton         android:id=""@+id/buttonTen""        android:layout_toRightOf=""@+id/buttonNine""         android:layout_marginTop=""264px""        android:layout_marginLeft=""10px""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/inactive"" /&gt;    &lt;ImageButton         android:id=""@+id/buttonEleven""        android:layout_toRightOf=""@+id/buttonTen""         android:layout_marginTop=""264px""        android:layout_marginLeft=""10px""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/inactive"" /&gt;    &lt;ImageButton         android:id=""@+id/buttonTwelve""        android:layout_toRightOf=""@+id/buttonEleven""         android:layout_marginTop=""264px""        android:layout_marginLeft=""10px""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/inactive"" /&gt;     &lt;/RelativeLayout&gt;</code></pre><p><strong>And this is my logcat errors (p.s. line #12 is the first TextView in main.xml):</strong></p><hr><pre><code>03-26 22:59:31.670: WARN/dalvikvm(185): threadid=3: thread exiting with uncaught exception (group=0x4001b188)03-26 22:59:31.727: ERROR/AndroidRuntime(185): Uncaught handler: thread main exiting due to uncaught exception03-26 22:59:31.784: ERROR/AndroidRuntime(185): java.lang.RuntimeException: Unable to start activity ComponentInfo{kz.androidmarket.www.randomtest1/kz.androidmarket.www.randomtest1.randomTest1}: android.view.InflateException: Binary XML file line #12: Error inflating class &lt;unknown&gt;03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.os.Handler.dispatchMessage(Handler.java:99)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.os.Looper.loop(Looper.java:123)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.app.ActivityThread.main(ActivityThread.java:4363)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at java.lang.reflect.Method.invokeNative(Native Method)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at java.lang.reflect.Method.invoke(Method.java:521)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at dalvik.system.NativeStart.main(Native Method)03-26 22:59:31.784: ERROR/AndroidRuntime(185): Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class &lt;unknown&gt;03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.app.Activity.setContentView(Activity.java:1622)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at kz.androidmarket.www.randomtest1.randomTest1.onCreate(randomTest1.java:11)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     ... 11 more03-26 22:59:31.784: ERROR/AndroidRuntime(185): Caused by: java.lang.reflect.InvocationTargetException03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.widget.TextView.&lt;init&gt;(TextView.java:320)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at java.lang.reflect.Constructor.constructNative(Native Method)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     ... 22 more03-26 22:59:31.784: ERROR/AndroidRuntime(185): Caused by: android.content.res.Resources$NotFoundException: File #ffff9900 from drawable resource ID #0x7f040002: .xml extension required03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.content.res.Resources.loadColorStateList(Resources.java:1820)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.content.res.TypedArray.getColorStateList(TypedArray.java:289)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     at android.widget.TextView.&lt;init&gt;(TextView.java:627)03-26 22:59:31.784: ERROR/AndroidRuntime(185):     ... 26 more</code></pre><hr><p><strong>Could anybody help me?</strong></p>","277704","","76835","","2010-03-27 01:10:00","2011-05-09 10:55:03","Android programming. Application stopped unexpectedly","<android><debugging>","1","1","","2011-09-15 14:47:57",""
"2527516","1","","","2010-03-26 23:46:36","3","7299","<p>I am trying to extend the BaseExpandableListAdapter, however when once I view the list and I select one of the elements to expand, the order of the list gets reversed.  For example, if I have a list with 4 elements and select the 1st element, the order (from top to bottom) is now 4, 3, 2, 1 with the 4th element (now at the top) expanded.  If I unexpand the 4th element the order reverts to 1, 2, 3, 4 with no expanded elements.</p><p>Here is my implementation:</p><p><code>public class SensorExpandableAdapter extends BaseExpandableListAdapter {</code></p><pre><code>    private static final int FILTER_POSITION = 0;    private static final int FUNCTION_POSITION = 1;    private static final int NUMBER_OF_CHILDREN = 2;    ArrayList&lt;SensorType&gt; mParentGroups;    private Context mContext;    private LayoutInflater mInflater;    public SensorExpandableAdapter(ArrayList&lt;SensorType&gt; parentGroup, Context context) {        mParentGroups = parentGroup;        mContext = context;        mInflater = LayoutInflater.from(mContext);    }    @Override    public Object getChild(int groupPosition, int childPosition) {        // TODO Auto-generated method stub        if(childPosition == FILTER_POSITION) return ""filter"";        else return ""function"";    }    @Override    public long getChildId(int groupPosition, int childPosition) {        return childPosition;    }    @Override    public View getChildView(int groupPosition, int childPosition,            boolean isLastChild, View convertView, ViewGroup parent) {        if(convertView == null)        {            convertView = (RelativeLayout)mInflater.inflate(R.layout.sensor_row_list_item, parent, false);            if(childPosition == FILTER_POSITION) {                ((CheckBox)convertView.findViewById(R.id.chkTextAddFilter)).setText(""Add Filter"");            } else {                ((CheckBox)convertView.findViewById(R.id.chkTextAddFilter)).setText(""Add Function"");                 ((CheckBox)convertView.findViewById(R.id.chkTextAddFilter)).setEnabled(false);            }        }        return convertView;    }    @Override    public int getChildrenCount(int groupPosition) {        // TODO Auto-generated method stub        return NUMBER_OF_CHILDREN;    }    @Override    public Object getGroup(int groupPosition) {        return mParentGroups.get(groupPosition);    }    @Override    public int getGroupCount() {        // TODO Auto-generated method stub        return mParentGroups.size();    }    @Override    public long getGroupId(int groupPosition) {        // TODO Auto-generated method stub        return groupPosition;    }    @Override    public View getGroupView(int groupPosition, boolean isExpanded,            View convertView, ViewGroup parent) {        if(convertView == null)        {            convertView = mInflater.inflate(android.R.layout.simple_expandable_list_item_1, parent, false);            TextView tv = ((TextView)convertView.findViewById(android.R.id.text1));            tv.setText(mParentGroups.get(groupPosition).toString());        }        return convertView;    }    @Override    public boolean hasStableIds() {        // TODO Auto-generated method stub        return true;    }    @Override    public boolean isChildSelectable(int groupPosition, int childPosition) {        // TODO Auto-generated method stub        return true;    }}</code></pre><p>`</p><p>I just need to take a simple ArrayList of my own SensorType class.  The children are the same for all classes, just two.</p><p>Also, how do I go about making the parent in each group LongClickable?  I have tried in my ExpandableListActivity with this <code>getExpandableListView().setOnLongClickableListener() ...</code> and on the parent TextView set its OnLongClickableListener but neither works.</p><p>Any help on either of these is greatly appreciated!</p>","302949","","302949","","2010-03-26 23:53:24","2011-07-13 11:37:11","Android Extend BaseExpandableListAdapter","<android>","4","0","1","",""
"2527748","1","2527914","","2010-03-27 01:08:26","0","75","<p>How would I model a system that needs to be able to provide content in a format that would be consumable by iphone, Android or web browser (or whatever). All a new consumer would have to do is build a UI with rules on how to handle the data. I'm thinking something RESTful returning JSON or something. </p><p>I'm really looking for suggestions on the kinds of things I'd need to learn in order to be able to implement a system on this scale. </p><p>As an ASP.NET MVC developer, would that be the best framework/archetectrue to go with?</p><p>Thanks</p>","181771","","","","","2010-03-27 02:34:31","Looking for Suggestion on Multi-Consumer Service Development","<iphone><asp.net-mvc><android><oop><rest>","3","0","","",""
"2527756","1","","","2010-03-27 01:12:30","-1","1177","<p>I've been successfully testing my app which sends a text message to another phone number.  The problem came when I sent this to a buddy that has the Nexus One.  I added a pending intent to sendTextMessage() and saw I'm hitting: <code>RESULT_ERROR_GENERIC_FAILURE</code>.</p>","302978","","1101070","","2012-03-06 01:15:17","2014-01-09 04:44:45","On Nexus ONE, getting RESULT_ERROR_GENERIC_FAILURE when trying to use SmsManager.sendTextMessage()","<android>","2","1","","",""
"2527870","1","","","2010-03-27 02:11:46","0","168","<p>Hey guys, im pretty new to android platform and have a really simple question. Im putting buttons as layouts with text boxes, but im running out of room. How would i make it possible for the user to scroll down to view more buttons and stuff. For example, if i have 6 buttons, and 3 are in the field of view, i wanna be able to scroll with my finger and be able to see those buttons as I scroll.</p><p>Thanks for the help guys</p><p>-Localgamer</p>","302991","","","","","2010-03-27 11:47:18","Basic Scolling Question","<android>","1","0","","",""
"2527875","1","2527967","","2010-03-27 02:15:37","1","869","<p>I am trying to make a button programmable way (no attributes on LinearLayout).In other words, button count on the View is dynamically. </p><p>How to make it ?</p><p>Thanks</p>","164589","","","","","2010-03-27 02:57:29","How to make button on LinearLayout dynamically?","<android>","1","0","","",""
"2527899","1","5274400","","2010-03-27 02:27:21","28","52810","<p>Until now I have been an iPhone developer only and now I have decided to give Android a whirl. Something I haven't been able to figure out on Android is how to programmatically prevent scrolling in a <code>WebView</code>?</p><p>Something similar to iPhones prevention of the <code>onTouchMove</code> event would be great!</p>","283412","","119895","","2011-07-28 15:48:25","2014-03-18 14:08:31","Disable scrolling in webview?","<android><scrolling><webview>","10","0","25","",""
"2528010","1","2528423","","2010-03-27 03:18:07","4","439","<p>I understand most Android devices have a 16mb limit (24mb on Nexus One) on the Java heap size.  Is there any way a single app can use more memory than that?  I know the native SDK doesn't have this limitation but I'd like to stick with Java.</p>","289204","","991737","","2012-01-10 19:14:25","2012-01-10 19:14:25","Is there anyway an app can use more than 16mb in memory?","<android><memory><memory-management>","1","1","","",""
"2528067","1","2528350","","2010-03-27 03:42:32","0","377","<p>I have a dialog popup to indicate how long I want an activity to run.Seems simple enough, but its difficult to determine when the activity is really starting.If the user opens the keyboard on a G1 and thereby goes into landscape, that reruns the activities onCreate method.</p><p>I can't have a static for the class or even create an application class, because I can't determine when the 'application' goes away. Even after destroying the only activity, the application is apparently still alive.</p><p>Is there a way to determine that onCreate has been called because of the keyboard being extended or landscape mode invoked?</p><p>Thanks</p>","295392","","","","","2010-03-27 06:12:13","Application lifecycle. How to run something only when application starts","<android>","3","0","1","",""
"2528160","1","","","2010-03-27 04:37:44","2","8254","<p>I am relatively new to this still, and I have been developing a small app that would benefit greatly from a user being able to press 2 buttons at one time. What is the best method for achieving this? I dont think that an OnClickListener works like that, and I have seen examples for doing this with an OnTouch event. However, I do not know how to set up button presses with an OnTouch event.</p>","303032","","303032","","2010-03-27 04:46:50","2012-08-24 13:12:30","Multiple button presses for Android 2.x","<android><multi-touch>","3","0","","",""
"2528359","1","","","2010-03-27 06:16:17","0","664","<p>I'm trying to modify the Android device driver for calibre (an e-book management program) so that it identifies devices by only vendor id and product id, and excludes BCD.  </p><p>The driver is a fairly simply python plugin, and is currently set up to use all three numbers, but apparently, when Android devices use custom Android builds (ie CyanogenMod for the Nexus One), it changes the BCD so calibre stops recognizing it.  </p><p>The current code looks like this, with a simple list of vendor id's, that then have allowed product id's and BCD's with them:</p><pre><code>VENDOR_ID   = {        0x0bb4 : { 0x0c02 : [0x100], 0x0c01 : [0x100]},        0x22b8 : { 0x41d9 : [0x216]},        0x18d1 : { 0x4e11 : [0x0100], 0x4e12: [0x0100]},        0x04e8 : { 0x681d : [0x0222]},        }</code></pre><p>The line I'm specifically trying to change is:</p><pre><code>0x18d1 : { 0x4e11 : [0x0100], 0x4e12: [0x0100]},</code></pre><p>Which is, the line for identifying a Nexus One.  My N1, running CyanogenMod 5.0.5, has the BCD 0x226, and rather than just adding it to the list, I'd prefer to eliminate the BCD from the recognition process, so that any device with vendor id 0x18d1 and product id 0x4e11 or 0x4e12 would be recognized.  The custom Android rom doesn't change enough for the specifics to matter.</p><p>The syntax seems to require the BCD in brackets.</p><p>How can I edit this so that it matches anything in that field?</p>","","user303053","1228","user303053","2013-08-05 12:55:12","2013-08-05 12:55:12","Modify python USB device driver to only use vendor_id and product_id, excluding BCD","<android><python><usb><calibre>","1","1","","",""
"2528437","1","2528487","","2010-03-27 06:57:09","2","1011","<p>I am trying to maintain my session variables that I get back in a cookie from my website in my DefaultHttpClient by passing the client between activities.  Simply put how can I pass this object between activities to maintain my session variables?  Bundle.put... doesn't seem to support this object.  If it does how does it work with DefaultHttpClient?</p><p>Thanks in advance to anyone who can help.</p>","303061","","","","","2011-07-09 05:18:13","Passing a DefaultHttpClient between activites","<android><object>","3","2","2","",""
"2528489","1","","","2010-03-27 07:14:03","37","21844","<p>I am copying a pre-existing database to <code>/data/data/packagename/databases</code> using code learned from <a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/"">using-your-own-sqlite-database-in-android-applications</a></p><p>After copying, I recieve the following log message on opening the database:</p><p>No such table android_metadata</p><p>Do I need to create a table named android_metadata? And what the values do i need insert into this database table</p><p>Thanks very much</p>","275788","","808940","","2011-09-11 22:32:01","2012-10-11 05:38:25","No such table android_metadata, what's the problem?","<android><sqlite>","7","1","16","",""
"2528684","1","2528902","","2010-03-27 08:55:15","3","2170","<p>I've done a little research, and am interested in developing for Android.  I've never programmed before, and have no idea how to go from zero experience to developing for a mobile device.  My interest is in eventually making some sort of 2d game.  </p><p>Is there a lesson plan for starting from the ground up?  I would think one would need to learn the Java language to start.  Looking at the Sun website, it's a bit daunting.  Is there a book, specifically, that would wrap up this knowledge in a bit of a directed lesson plan?</p><p>I'm not sure if opengl-es is what would be required for 2d games.  I've done a little research on this, and it's even far more daunting than Java itself.  I can't even begin to figure out where to start with even just opengl, sans -es.  My best guess would be that I need further knowledge in Java to continue with this, but even still, is it possible to learn concurrently with Java?</p>","303097","","","","","2010-03-27 20:50:23","Roadmap to Android development","<java><android><opengl-es><2d>","2","2","","",""
"2528834","1","","","2010-03-27 10:03:37","0","527","<p>the old query works, the new on doesnt. the android logcat gives me error as:Failure 1: no such column abcname. abcname is the value of a editview that im trying to get from a popup in android.</p><p>i know that the first query will insert those values in the fields, as they are given in single inverted commas. the same query, i typed in the adb shell, works. so i copied the query, and just removed the data corresponding to the field names, and inserted the variable names. on trying to run, i get the above said error.</p><p><strong>OLD QUERY:</strong></p><pre><code>MapsActivity.myDB.execSQL(""INSERT INTO ""    +MapsActivity.TableName    + "" (name, user_comment, latitude, longitude) ""    + "" VALUES ('tagName','tagComment','tagLatitude','tagLongitude');"");</code></pre><p><strong>NEW QUERY:</strong></p><pre><code>MapsActivity.myDB.execSQL(""INSERT INTO ""    +MapsActivity.TableName    + "" (name, user_comment, latitude, longitude) ""    + "" VALUES (""+tagName +"",'tagComment','tagLatitude','tagLongitude');"");</code></pre><p>what is the problem?</p>","298685","","216074","","2010-03-27 18:56:35","2010-03-27 18:56:35","problem with sql query, variable value not inserting itself","<sql><android><sqlite>","3","0","","",""
"2529062","1","","","2010-03-27 11:20:29","14","2491","<p>I want to create a PRO version of my application for Android and was wondering how to structure my repository.</p><p>For know I have a trunk and feature branches. I'd like to put a pro version in another branch but maybe there is a better way? For example, maybe I should create two branches - one for free version, the other for pro?</p><p>Pro version will have additional features and will be ads-free, so eg. I don't want to include AdMob libraries in the pro version.</p><p>Do you have any experience or suggestions as to what would be the best way to structure the repository in this case?</p><p>EDIT:I think I've found the best solution (for my app) in this thread: <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/4ad3d67f735f16d7/948b4f9eee2490a3"">http://groups.google.com/group/android-developers/browse_thread/thread/4ad3d67f735f16d7/948b4f9eee2490a3</a></p><p>The trick discussed there is about having another application that only serves the purpose of unlocking PRO functionality in the actual application. The unlocking app is paid in the market and the actual app merely checks for the existence of it on the device.</p>","139298","","139298","","2010-03-27 18:56:53","2012-10-04 20:05:55","Maintaining both free and pro versions of an application","<android><versioning><maintainability>","4","1","13","",""
"2529145","1","2529335","","2010-03-27 11:49:01","5","8935","<p>Using the Android SDK, is it possible to play a video stream using the MMS protocol</p><p>I am streaming video from a PC using windows media.</p><p>I can use Windows Media Player to play the stream by just inputting the following URL in Windows Media Player</p><p>mms://192.168.223.194:8081</p><p>Is it possible to play the same stream using the Android SDK ?</p><p>Thanks</p>","130211","","","","","2010-03-27 12:59:44","Android SDK : Playing video using mms protocol","<android><video><streaming>","1","0","2","",""
"2529481","1","2530275","","2010-03-27 13:45:35","5","5044","<p>when i touch whereever in the screen that point will be glow(nothing but like a flash or glittering) for some time. how to do that? any example or idea?? i have to implement to put buttons on it. exactly when i touch the screen it will glow some time and then the button will appear on the point where i touched. </p>","267269","","267269","","2010-03-27 14:04:32","2010-03-27 18:51:04","glow when touch the screen in android?","<android><animation><touch><android-animation>","1","0","3","",""
"2529739","1","2529819","","2010-03-27 15:03:14","1","293","<p>I have a main application, and a bunch of sub-applications (they are separate apps, which do not appear on the android home dashboard).  I was planning on having a SQLite DB which the main app maintains, and get a list of available sub-apps from.  Is there a way to update this main database as the user installs the sub-apps?</p><p>Two alternative I was thinking of include:</p><ol><li><p>User installs the sub-apps via the main app, which would then update the DB.</p></li><li><p>Rather than use the DB to find all installed sub-apps, have each sub-app declare a category, and use intents to query for all applications which match that query (is this even possible? if so, advice is welcomed).</p></li></ol><p>Thanks!</p>","231768","","","","","2010-03-27 15:26:13","Is there a way to update a database when installing/upgrading an app?","<android><sqlite>","1","1","1","",""
"2530397","1","","","2010-03-27 18:20:38","0","1111","<p>I am Trying to use trace viewer by</p><pre><code>Debug.startMethodTracing(""sampletrace"");Debug.stopMethodTracing();</code></pre><p>And I pull the <code>sampletrace</code> to a folder from sdcard.</p><p>When I try to view the tracefile using the following command.</p><pre><code>D:\Android\android-sdk-windows\tools&gt;traceview D:\trace\sampletrace.trace</code></pre><p>it is showing the following line</p><pre><code>Key section does not have an *end marker</code></pre><p>Can anybody please explain what is this?</p>","321334","","243709","","2011-05-05 07:33:10","2011-05-05 07:33:10","android Traceviewer","<android><trace>","2","0","","",""
"2530486","1","2530689","","2010-03-27 18:45:20","2","760","<p>I have a <code>TabActivity</code> with three tabs defined. The first tab is light-weight and renders in acceptable time. But the 2nd and 3rd tab, does need a couple of seconds to get visually rendered, after I click them. I would like to launch them, after I've loaded my first tab, in background for pre-cache. Once they are loaded, I can switch quickly between them.  </p><p>So I am wondering how can I launch the 2nd and 3rd tab. They are new <strong>activities</strong> loaded in the view area. </p>","243782","","243782","","2010-03-28 20:46:42","2010-03-28 20:46:42","Start all tab's activities for pre-cache","<android><performance><multithreading><android-tabhost>","1","0","3","",""
"2530490","1","2530867","","2010-03-27 18:46:54","0","251","<p>I have an empty TextView set for my <code>ListView</code>. When there is no data, it shows the empty text, where I have description that they should go to Contacts application.</p><p>How can I linkify ""Contacts"" word so when tapped opens the Contacts application?</p>","243782","","","","","2010-03-27 20:45:24","How to linkify to in-built apps like Contacts?","<android><textview><linkify>","1","0","1","",""
"2530548","1","2530734","","2010-03-27 19:01:07","22","22830","<p>Is there a way for an Android user to browse the SQLite databases on his/her phone and view the data in the databases?</p><p>I use the SoftTrace beta program a lot. It's great but has no way that I can find to download the data it tracks to a PC.</p><p>Thanks</p>","220275","","","","","2014-02-18 20:56:29","browse data in Android SQLite Database","<database><android><sqlite><data-mining>","4","0","7","",""
"2530673","1","","","2010-03-27 19:41:19","15","7928","<p>I am starting out as an Android Developer, and I would like to know if there are any Computer vision libraries or Augmented Reality libraries for the Android SDK, as I am planning to use these libraries for a mobile app.</p><p>I have read that if I download the NDK, I might be able to ""import/use"" the C openCV, and ARtoolkit libraries, but I am wondering if this is possible, or if there is a better and easier way of using these tools.</p><p>Android apps are programmed in Java, yet OpenCV &amp; ARtoolkit use C/C++. Is there any way to use these libraries?</p>","303313","","398460","","2010-11-19 15:23:19","2013-04-25 18:19:06","Computer Vision and AR libraries availabe for Android?","<android><opencv><computer-vision><augmented-reality>","6","1","6","",""
"2530687","1","2532220","","2010-03-27 19:44:55","1","533","<p>I have read some question here but I didn't find a solution. I have read about <code>Parcelable</code>, <code>Intents</code>, and sharing specific data within <code>Activities</code> from the android dev docs (both dev guide and reference).</p><p>Here's the scenario:</p><p>I have one <code>ListActivity</code> that fills in an object parsing an xml file, it shows a list of values, and when clicked I want to return the object that represents the item clicked to the activity that has called it, for then, call another activity with this object.</p><p>I read on how to implement <code>Parcelable</code> but seems not being the way. Implementing <code>Parcelable</code> receives a <code>Parcel</code> for the constructor and then reads the values from it (or at least that was what I understood). This makes no sense for me and I can't see how to implement basing on that issue. I build the object parsing the xml file, not having a <code>Parcel</code>.</p><p>I appreciate some clarifications on this, regards.</p>","241750","","","","","2011-09-13 08:29:25","Android: Send arbitrary objects within Activities?","<android>","2","0","0","",""
"2530869","1","2532535","","2010-03-27 20:45:29","2","2646","<p>Whenever I use a RatingBar view in my layout, I suddenly get all kinds of compile errors. I'm using Android 2.0, but I've also tried 2.0.1, and 2.1, without joy. I also get a message: <code>Shader 'android.graphics.BitmapShader' is not supported in Layout Editor</code>,<br> and an odd warning which may or maynot be related:<br><code>warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute</code></p><p>I've tried using the RatingBar both within a tablelayout and outside it, but it behaves the same way. This is very puzzling and frustrating. Please help if you can.</p><p>Sincerely,  Ray</p><p>Here's the XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;  &lt;LinearLayout   xmlns:android=""http://schemas.android.com/apk/res/android""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   android:orientation=""vertical""   &gt;&lt;TextView  android:id=""@+id/gi_name""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:layout_gravity=""center_horizontal""  android:padding=""10px"" /&gt;&lt;TextView  android:id=""@+id/gi_description""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:padding=""4px"" /&gt;&lt;TableLayout  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:padding=""4px""&gt;  &lt;TableRow    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""&gt;    &lt;TextView      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:gravity=""right""      android:text=""@string/GameInfoVerificationLabelText"" /&gt;    &lt;TextView      android:id=""@+id/gi_verification""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content"" /&gt;  &lt;/TableRow&gt;  &lt;TableRow    android:layout_height=""wrap_content""    android:layout_width=""fill_parent"" &gt;    &lt;TextView      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:gravity=""right""      android:text=""@string/GameInfoPlayerRatingLabel"" /&gt;    &lt;TextView      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:text=""  "" /&gt;  &lt;/TableRow&gt;  &lt;TableRow    android:layout_height=""wrap_content""    android:layout_width=""fill_parent"" &gt;    &lt;RatingBar      android:id=""@+/gi_player_rating""      style=""?android:attr/ratingBarStyleSmall""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:layout_span=""2""      android:isIndicator=""true""      android:numStars=""5""      android:rating=""3""      android:stepSize=""1""      android:layout_gravity=""center_vertical""      /&gt;  &lt;/TableRow&gt;  &lt;TableRow    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""  &gt;    &lt;TextView      android:id=""@+id/gi_times_played_label""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:gravity=""right""      android:text=""@string/GameInfoTimesPlayedLabel"" /&gt;    &lt;TextView      android:id=""@+id/gi_times_played""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:text=""999"" /&gt;  &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;TextView  android:id=""@+id/gi_win_criteria_label""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:text=""@string/GameInfoWinCriteriaLabelText""  android:padding=""4px"" /&gt;&lt;TableLayout  android:id=""@+id/gi_win_criteria_table""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:padding=""1px""&gt;&lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre>","303340","","492624","","2012-01-02 09:33:08","2012-01-02 09:33:08","Android RatingBar weirdness: Whenever I add a RatingBar to my layout, a bunch of the generated tags, throw off errors as if they are undefined","<android><android-widget>","1","3","","",""
"2531187","1","2531308","","2010-03-27 22:33:25","48","23035","<p>Is there anyone here who have real-world experience on this topic and is willing to share his experiences on subject? Links to guides/code/step-by-step instructions are highly appreciated.</p><p>Thanks!</p>","237858","","","","","2013-12-27 10:21:06","Android and obfuscation","<android><obfuscation>","4","5","25","",""
"2531253","1","","","2010-03-27 23:00:51","4","1412","<p>Is there any way to add words to the suggestions in the soft keyboard?For a specific Edittext field i would like to add a list of names to the suggestions that pops up on top of the soft keyboard in android 2.0.</p><p>Does anyone know if this is possible?</p>","212651","","","","","2010-03-28 18:06:34","How do i add words to the suggestions on top of the soft keyboard","<android>","2","0","1","",""
"2531317","1","2559365","","2010-03-27 23:23:25","69","82088","<p>How can I mock my location on a physical device (Nexus One)? I know you can do this with the emulator in the Emulator Control panel, but this doesn't work for a physical device.</p>","764272","","","","","2013-11-26 20:38:41","Android mock location on device?","<android><gps><location><mocking>","14","2","47","",""
"2531336","1","2531485","","2010-03-27 23:33:13","21","15408","<p>I have an AsyncTask object which starts executing when the activity is created and does stuff in the background (downloads upto 100 images). Everything works fine but there is this peculiar behavior which i'm not able to understand. </p><p>For eg: when the android screen's orientation changes then the activity is destroyed and created again. So I override the onRetainNonConfigurationInstance() method and save all the downloaded data executed in the AsyncTask. My purpose of doing this is to not have AsyncTask run each time activity is destroyed-created during orientation changes, but as i can see in my logs the previous AsynTask is still executing. (The data is saved correctly though)</p><p>I even tried to cancel the AsynTask in the onDestroy() method of the activity but the logs still show AsynTask as running.</p><p>This is really strange behavior and would really be thankful if someone can tell me the correct procedure to stop/cancel the AsynTask.</p><p>Thanks</p>","240410","","","","","2013-10-15 12:36:59","AsyncTask won't stop even when the activity has destroyed","<android>","6","0","19","",""
"2531530","1","2531613","","2010-03-28 00:59:56","1","1618","<p>Looking in the android sdk folders, I've found a file called <code>values/config.xml</code>.  This seems to be somewhere that you can define values for later use in layouts and animations.</p><p>Given the config.xml:</p><pre><code>&lt;resources&gt;    &lt;string name=""config_somePadding""&gt;50dip&lt;/string&gt;&lt;/resources&gt;</code></pre><p>How would I reference this to use as the layout_height in a layout xml file?  </p><p><code>@string/config_somePadding</code> is actually the only one I've found that doesn't throw an error in Eclipse (even though there isn't a <code>config_somePadding</code> in <code>values/strings.xml</code>), but it appears to just put an empty string.</p><p>In the sdk, they use an integer for animation duration.  They reference it like this: <code>android:duration=""@android:integer/config_longAnimTime""</code>.  Is there a way to use values that aren't integers in the layout_height attribute?</p>","238849","","238849","","2010-03-28 01:17:05","2010-03-28 01:48:34","Using resource values as layout attributes (config.xml)","<android>","1","0","2","",""
"2531540","1","","","2010-03-28 01:03:16","2","2081","<p>Disk Utility in OSX easily mounts an SD Card image as a device, but not so the other img files.</p><p>I want to get the database I just created in the Android Emulator off the drive and into my osx file system.</p><p>I updated my system with qemu using macports but no combination I try succeeds. Anyone figured out how to do this?</p><p>Obviously one way I can do this is run the app on my phone than mount the phone as a USB drive. But I don't wanna. I wanna get it off the drive the emulator uses :-)</p><p>Thanks in advance, folks.</p><p>Michael</p>","215883","","","","","2013-01-15 11:46:51","how mount userdata.img or userdata-qemu.img in osx","<android><osx><mount><drive><qemu>","2","0","","",""
"2531898","1","","","2010-03-28 04:28:35","2","2016","<p>I see how to mount an SD card in the emulator, but I'm not sure how you move files back and forth between the userdata image and the SD card image. Can someone tell me how to do this?</p>","215883","","143804","","2010-03-28 04:58:26","2010-04-19 21:32:23","Copying files from emulator drive to sd card","<android><copy><userdata><android-sdcard>","1","0","2","",""
"2532058","1","2532906","","2010-03-28 06:01:24","7","1461","<p>How to rotate the screen to landscape (or portrait) by programmable way?I am trying to make it independent when user rotates the screen.</p><p>Is it possible thing ?</p><p>Thanks in advance.</p>","164589","","","","","2010-05-18 19:15:20","How to rotate the screen to landscape (or portrait) by programmable way?","<android>","2","0","3","",""
"2532185","1","2532195","","2010-03-28 07:24:15","1","4862","<p>I can read settings like this, for example:</p><p>final String mytest = System.getString(this.getContentResolver(), System.AIRPLANE_MODE_ON);</p><p>...but can't seem to write to settings using putString, no matter what I've tried. Maybe it is the scope of this.getContentResolver()??? I'm a newbie, so who knows, maybe it can't be done, or it's just syntax? Currently the code is in the onCreate of an Activity class.</p><p>Any insight is much appreciated.</p>","303478","","","","","2010-12-27 04:57:43","Can I update an Android provider.Settings.System value?","<android>","1","0","","",""
"2532366","1","","","2010-03-28 09:00:22","0","766","<p>I am trying to parse xml file using Sax parser. The file has variable number of same elements. I want to count the number of times the element is present.And i want this count before parsing, so that I can declare an array of appropriate size.</p><p>One way is to count them in a separately class with another parser (clumsy) and other way is dynamic array (List Array). Is there any other better way to do this?</p><p>Also, Is it possible to make an ArrayList of my class..? because I want an array of type myClass.</p>","296226","","","","","2010-03-28 12:42:00","Sax parsing from web service","<java><xml><android><arraylist><sax>","2","2","","",""
"2533128","1","2533910","","2010-03-28 13:56:14","3","328","<p>As far as I understand it is necessary for people using Scala for Android applications to bundle the Scala classes they used with their application.</p><p>Considering this adds hundreds of kilobytes to each Scala app redundantly, would it be possible to build a Scala library which can be delivered over the market, so app writers can just depend on that library instead of bundling it themselves?</p>","297776","","","","","2012-10-15 03:42:33","Would it make sense to have a separate Scala library in Android market?","<android><scala><bundle><google-play>","3","1","","",""
"2533149","1","2533230","","2010-03-28 14:02:43","4","10554","<p>In my Activity I use multiple AsyncTask classes.   </p><p>How to cancel AsyncTask when Activity finishes?</p>","243782","","","","","2014-04-04 09:40:10","How to cancel AsyncTask when Activity finishes?","<android><multithreading><activity><android-asynctask>","4","1","1","",""
"2533202","1","2544200","","2010-03-28 14:16:38","2","5584","<p>I want to place markers on the map.I want to use the standard Google Maps icons for markers.how do I use them? I don't want to create my own icons.I'm developing for Android.</p><p>in the documentation they tell me to create a class that overrides ItemizedOverlay but in the constructor I'm asked to provide a drawable object.</p><p>how do I point to the standard Google Maps ones?thanks. </p>","258429","","","","","2011-06-10 13:47:10","Android and Google Maps API - Icons","<android><google-maps>","3","1","1","",""
"2533236","1","2533245","","2010-03-28 14:29:42","9","13297","<p>I am trying to set my user agent string in the HttpClient apache object in Java but I cannot find out how to do it.</p><p>Please help!</p><p>Also I am trying to enable redirects to true but also cannot find this option within the HttpClient object.</p><p>Thanks</p><p>Andy</p>","265683","","398715","","2011-11-14 03:00:26","2013-03-09 01:21:29","Setting user agent in Java httpclient and allow redirects to true","<java><android><apache><httpclient><user-agent>","3","0","2","",""
"2533336","1","2533349","","2010-03-28 15:02:49","1","1367","<p>Using Mac OS X 10.6.2, Eclipse SDK 3.5.2.<br>I installed the Android plugin, following the instructions at:<br><a href=""http://developer.android.com/sdk/eclipse-adt.html"" rel=""nofollow"">http://developer.android.com/sdk/eclipse-adt.html</a></p><p>In the next section (step #3) it says:<br>For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory.</p><p>I cannot find such a directory. When I try some other directory, it says the directory has no 'tools' folder, so I've searched for a 'tools' folder, but none of those found (of 15 or 20) appear to be Android.</p><p>Where is this directory??? </p><p>--Dave<br>  matuszek@cis.upenn.edu</p>","303624","","","","","2010-03-28 16:36:14","Installed Android on Mac, cannot find SDK","<eclipse><android><osx><installation>","2","0","","",""
"2533410","1","2533444","","2010-03-28 15:28:58","32","44147","<p>What is the difference between the three drawable folders in the res folder in the project hierarchy? If I have an image to put into a folder, which folder do I put it in? </p>","200477","","","","","2014-01-19 11:25:18","Drawable folders in res folder?","<android><image><drawable>","2","0","8","",""
"2533517","1","2794546","","2010-03-28 16:01:22","7","1563","<p>How can I test all of the following methods code? I want to play scenarios when all of them are happening to see if my code works for save/restore process of an activity. So what should I do in the Emulator to get all methods tested?</p><pre><code>public class Activity extends ApplicationContext {     protected void onCreate(Bundle savedInstanceState);     protected void onStart();     protected void onRestoreInstanceState(Bundle savedInstanceState);     protected void onSaveInstanceState(Bundle savedInstanceState);     protected void onRestart();     protected void onResume();     protected void onPause();     protected void onStop();     protected void onDestroy(); }</code></pre>","243782","","243782","","2010-03-28 16:07:25","2013-10-27 19:48:17","How to test code built to save/restore Lifecycle of an Activity?","<android><activity><lifecycle>","3","0","3","",""
"2533541","1","","","2010-03-28 16:10:22","0","662","<p>When I start setup I get this message:XML verification failed for <a href=""http://dl-ssl.google.com/android/repository/repository.xml"" rel=""nofollow"">http://dl-ssl.google.com/android/repository/repository.xml</a>.Error: cvc-elt.1: Cannot find the declaration of element 'sdk:sdk-repository'.Failed to fetch URL  reason: Unknown</p><p>Even when I force the download to use http nothing happens.</p><p>I get no downloads etc for the SDK. Any help would be greatly appreciated.</p>","303652","","","","","2010-05-26 18:00:05","Trying to setup android sdk on PC with windows XP","<android><sdk>","1","0","","",""
"2533832","1","2533877","","2010-03-28 17:36:08","1","1358","<p>I want to build an notepad-style application on android that will have syntax highlighting. But when I search around the web, I find the syntax highlighting can be done only through use of an awt class. How could I syntax highlight in maybe a custom EditText or TextView view? I know that the release of a syntax highlighter is sort of anticipated, so I want to add my syntax highlighter on the market. </p>","200477","","","","","2013-12-12 20:03:05","Syntax highlight in java for android","<java><android><syntax-highlighting>","2","0","2","",""
"2533972","1","3203327","","2010-03-28 18:19:41","31","18263","<p>I'm having a problem including a different layout through the include tag in the android layout xml file. When specifing the layout reference ( @layout/... ), i'm getting a InflateException in the Eclipse ADT with the following error:<strong>InflateException: You must specifiy a valid layout reference. The layout ID @layout/func_edit_simple_calculator_toolbox is not valid.</strong></p><p>the reference should be valid, as I've selected it from the the list of my other layouts and didnt type it in. I'm using android sdk v2.1</p><p>these are the layout files</p><p>func_edit_simple_calculator_toolbox.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_height=""wrap_content"" android:layout_width=""wrap_content""&gt;&lt;TableRow android:id=""@+id/TableRow01"" android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;Button android:id=""@+id/Button01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""1""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/Button02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""2""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/Button03"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""3""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/Button04"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""+""&gt;&lt;/Button&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/TableRow02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;Button android:id=""@+id/Button05"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""4""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/Button06"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""5""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/Button07"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""6""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/Button08"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""-""&gt;&lt;/Button&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>function_editor_layout.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;com.calculoid.FunctionView android:id=""@+id/function_view"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""/&gt;&lt;include android:id=""@+id/include01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" layout=""@layout/func_edit_simple_calculator_toolbox""&gt;&lt;/include&gt;&lt;/LinearLayout&gt;</code></pre><p>Does any one know what could be the problem?</p><p>thanks in advance</p>","303704","","303704","","2012-02-29 14:24:35","2014-02-05 22:29:53","android include tag - invalid layout reference","<xml><android><layout>","7","1","8","",""
"2534216","1","2534320","","2010-03-28 19:34:29","1","869","<p>I have an activity with two buttons, start and stop. If the user press the start button a service is created using Context.startService. And the stop button calls Context.stopService. </p><p>I want the stop button to be the only way to destroy the service. Now, if i end the activity using a task manager, the service is killed as well. Is there any way to avoid this?</p><p>EDIT: Also, i would like to know how a task manager (such as Advanced Task Manager Free) kills activities and services? Since none of my onDestroy() and such methods is called.</p>","265990","","265990","","2010-03-28 19:49:02","2010-03-28 20:01:03","Make service indepented from activity (Android)","<android><service><activity>","2","0","1","",""
"2534912","1","","","2010-03-28 22:53:37","1","246","<p>I have a class Building. It contains a _bitmap object, referenced to a drawable.I can draw it on an external View, where its canvas calls myBuilding.getBitmap().</p><p>Now I want to draw some windows on the building, but I need them to be ""tied"" to the building, so that translating the x and y of myBuilding, the windows move together.</p><p>Is there a way to attach a bitmap (window) on the main bitmap (building) in order to get the resulting building with windows, when I call myBuilding.getBitmap() ?</p><p>Thank you.</p>","252711","","","","","2011-09-23 12:52:43","Attach a bitmap on another bitmap","<android><bitmap><draw><attach><tie>","1","0","","",""
"2534925","1","2555331","","2010-03-28 22:57:57","2","1428","<p>I'm trying to test an app out on the Motorola Backflip with AT&amp;T as the carrier.  I checked USB debugging on the phone's Development screen.  </p><p>Using Eclipse, how do I get the app to load on the Backflip so I can test it?  DDMS shows a device with a bunch of question marks and unkown.  Seems that it only gives me the option to load the app on the SD card which doesn't do me any good.</p><p>I searched and found a Motorola driver which I'm supposed to install to the adb folder.  Where is that folder?  I've checked the phone and on my development machine.  Maybe I need new glasses?</p><p>More info:</p><p>I have Run set to manual.  When I click on run I get:</p><p>Choose a running Android Device:</p><p>Serial number ????????</p><p>AVD Name N/A</p><p>Target Unk</p><p>State ??</p><p>and the OK button is greyed out so all I have left is to Cancel.</p><p>Still trying:</p><p>I don't know if this helps but in DDMS the following messages show up:</p><p>[2010-03-28 19:20:41 - ddms]execute: running ls -l /</p><p>[2010-03-28 19:20:41 - ddms]Got reply 'FAIL', diag='insufficient permissions for device'</p><p>[2010-03-28 19:20:41 - ddms]execute: returning</p><p>Did what Commonwares suggested:</p><pre><code>eric@i7Linux:~/Eclipse3.5/android-sdk-linux_86/tools&gt; ./adb kill-servereric@i7Linux:~/Eclipse3.5/android-sdk-linux_86/tools&gt; ./adb kill-servereric@i7Linux:~/Eclipse3.5/android-sdk-linux_86/tools&gt; ./adb start-server* daemon not running. starting it now ** daemon started successfully *eric@i7Linux:~/Eclipse3.5/android-sdk-linux_86/tools&gt; ./adb devicesList of devices attached????????????    no permissionseric@i7Linux:~/Eclipse3.5/android-sdk-linux_86/tools&gt;</code></pre>","278350","","278350","","2010-03-28 23:49:56","2010-03-31 18:10:09","Install app on Motorola Backflip from AT&T","<android><install><motorola>","3","0","","",""
"2535132","1","","","2010-03-29 00:09:03","11","6320","<p>Does anyone have sample code to validate user entered text in preferences? For example, I have a EditTextPreference for user to enter an email address. I'd like to validate the format of email address entered and pop up an alert dialog if the format isn't correct. Anyone have any sample code for this? Thanks </p>","157785","","","","","2013-03-06 12:21:21","How do you validate the format and values of EditTextPreference entered in Android 2.1?","<java><android><validation><preferences><alertdialog>","3","0","1","",""
"2535389","1","2535868","","2010-03-29 01:49:04","0","1210","<p>In the onCreate() of an activity, I've got a call to requestFocus() on an EditText.  Immediately after, I've got the following:</p><pre><code>    System.out.println(mEdit.isFocusableInTouchMode());    System.out.println(mEdit.isFocusable());    System.out.println(mEdit.isFocused());</code></pre><p>These were just put in while I was trying to figure out what is wrong with this activity... they all print ""true"".  However, as you may have guessed, the EditText does NOT have focus, and if I try to start typing, nothing happens.  I have to click on the EditText to being typing.</p><p>I can't see that anything else has focus, but obviously something has to have it..  how can I find out what it is?</p>","238849","","","","","2010-06-07 13:26:19","Problem with EditText.requestFocus()","<android>","1","0","","",""
"2535521","1","","","2010-03-29 02:40:17","0","251","<p>Normally, a Java p'rogram starts from an object, then that object will create some GUI objects (window) and call the ""Show"" method</p><p>So, is there any way to do the same thing in Android, since, by default in Android, a program runs from an object created by a class which extended from Activity class?</p>","122456","","","","","2010-03-29 12:05:21","Activity in Android","<android><activity>","1","1","","",""
"2535584","1","2536378","","2010-03-29 03:05:38","0","1435","<p>I'm looking for a way to update a layout's content with a new view. Is there any way to easily do this. It would be similar to how tabs work, but I don't want to have to get into extending the current tab structure if I don't have to. </p><p>The final result would be a few buttons that would switch the content in a specific linearlayout for each button.</p><p>Any help?</p>","118241","","","","","2010-03-29 07:34:11","Android Update Layout Content","<java><android><content><android-linearlayout>","1","0","","",""
"2535733","1","","","2010-03-29 04:03:28","13","18382","<p>I have to display some data after every 10 seconds. Can anyone tell me how to do that?</p>","285052","","114066","","2012-01-27 12:19:39","2014-03-07 06:14:35","display data after every 10 seconds in Android","<android><alert><delay>","5","1","6","",""
"2535775","1","2543740","","2010-03-29 04:23:32","1","1987","<p>I already have experience with setting up virtual machines, running them and other minor tasks. Im a gamer, so I wont get rid of windows (for now at least...) but I do want to be a great programmer and to be involved with the Open-Source community.</p><p>Id like to know if its a good idea to do my programming in linux through a virtual machine, vs giving it a partitioned section of the HDD. Id like to know about performance pros and cons and functionality.All responses are appreciated, thanks in advance.</p><p>The type of programming I intend to dive into :Android Dev, Web Dev, Desktop Dev...More Android and Web right now though.</p><p>So im looking at C#,C,C++,Java,PHP,HTML,MySQL...Off the top of the dome.</p><p>I do web designing as well, so dreamweaver is added as an ""essential"". But im sure I can do dreamweaver files and upload them to the server after programming in Linux...Right?</p><p>And any info on IDE's in Linux for the above mentioned are appreciated, but i would prefer going the coding route and understanding the essence of whats happening ""under the covers""</p><p>Thanks to all for reading, I appreciate it.Hope this isnt confusing :S</p>","302968","","","","","2010-03-30 08:26:49","Doing coding in Linux through a virtual machine on Windows VS partitioning","<windows><android><linux><virtual-machine>","7","5","","",""
"2535953","1","","","2010-03-29 05:36:24","13","23870","<p>I am new to android development. I got an error when I wrote the code </p><pre><code>import com.google.android.maps.MapView; </code></pre><p>in eclipse. The error is <code>The import com.google can not be resolved.</code> </p><p>Please anybody give suggestion to fix this problem.</p>","302314","","1845869","","2012-12-07 07:53:27","2012-12-07 07:53:27","Error - The import com.google can not be resolved","<android>","3","0","1","",""
"2535970","1","","","2010-03-29 05:41:56","0","2543","<p>Using Windows 7, 64 bit system. Prior to upgrade I was able to run ""Android SDK and AVD manager"" from Eclipse via a tool bar icon and menu option, both of which still exist. However now nothing happens when I try to run the manager. </p><p>As a result I can't start an emulator from within Eclipse. When I use Eclipse to run an Android app, the first emulator I installed is automatically started.</p><p>Using Windows Explorer, I can still run the manager from the SDK directory in which the update was applied (the update didn't change the location of the SDK).  If I run the manager and start multiple emulators and then Run an app from Eclipse, it sees the emulators and allows me to choose one as before. This is a satisfactory work-around, but it would be nice if the manager were fully integrated into Eclipse as it was before.</p>","","user303944","1101070","","2012-03-07 03:03:10","2013-09-22 08:17:11","Android SDK and AVD manager will not run from Eclipse after upgrade to SDK 5 and ADT 0.9.6","<android><eclipse><adt><avd>","1","3","0","",""
"2535998","1","2558351","","2010-03-29 05:51:19","1","655","<p>I am working on a light weight Java client library for Android mobile platform that can read and write to Excel files in .xls(BIFF) and Office 2003 XML format.</p><p>No sooner we decided to start than we got stuck with a basic question. How do we determine the format of the excel files in Java?</p><p>Please help.</p><p>Thanks.</p>","236128","","234405","","2010-03-29 06:51:42","2010-04-01 05:38:59","How to determine the format of Excel file in Java?","<android><excel><excel-2003><file-format><xls>","2","0","0","",""
"2536039","1","2543005","","2010-03-29 06:01:57","0","2354","<p>So, i have a application that displays tasks and i created an option in the Settings menu that lets you choose in how many days all (Never, 10 days, 20 days or 30 days) these tasks should be automatically deleted. So when i open up the app there will be a method that will be called and check if theres any tasks to be deleted. I did that to challenge myself, but i'm hitting the wall with my head and i cant come up with something. So here i am in need of help!</p><p>A little more information: i was trying to do something with java/android code, but from past searches i saw people dealing with it using SQL functions. Is it better?</p><p>Thanks in advance guys!</p>","2443607","","","","","2010-04-01 04:46:27","Deleting SQLite rows automatically/periodically","<android><sqlite><delete><settings><rows>","2","1","0","",""
"2536042","1","2536270","","2010-03-29 06:02:02","3","978","<p>Lets say I have an Android app that uses Google Maps and GPS.Uses custom views and timers. </p><p>How much time will it require to develop it for Blackberry?</p><p>What changes will be required? Can the UI be reused?</p><p>I am totally new to Blackberry, though I know Java.</p><p>Please help me estimate the time.</p>","284372","","67407","","2010-03-29 07:10:10","2010-03-29 10:58:06","Blackberry - Estimate port of Android app with GPS and Google Maps","<android><blackberry><porting><estimation>","4","0","1","",""
"2536080","1","2536326","","2010-03-29 06:13:53","-1","268","<p>Hi I want code for  refershing my page automatically when i click on any button.For Ex I have a people page In that page i delete people  from total peoples using one button but that selected people is not deleted immediately That means the People page is not refreshing.So,I want code for refreshing that page.Give me any suggestions.Thanks in advance</p>","454808","","","","","2010-03-29 07:19:31","Refreshing code","<android>","1","0","1","",""
"2536155","1","","","2010-03-29 06:37:27","0","165","<p>I am confused, and need to get my concepts straight.</p><p>After executing the last statement, which function is called, in MapsActivity? is it onResume? and under which function (onResume()?) should i put getExtra()?</p><pre><code>Log.i(""onMenuAnimate"", ""Attempting to animate to:"");Intent intent = new Intent(SearchDB.this, MapsActivity.class);intent.putExtra(""com.gpsdroid.SearchDB.Lat"", nameLatitude.getText());intent.putExtra(""com.gpsdroid.SearchDB.Long"", nameLatitude.getText());SearchDB.this.startActivity(intent);</code></pre>","298685","","","","","2013-03-25 14:07:09","Question about Intent, android","<android>","2","0","","",""
"2536194","1","2571105","","2010-03-29 06:46:48","4","6032","<p>Is there any 3rd part api for android to read exif tags from image which support api level starting from 1.5.</p>","216431","","","","","2011-05-02 20:55:05","android image exif reader 3rd party api","<android><libexif>","2","1","5","",""
"2536214","1","2536245","","2010-03-29 06:52:37","1","1481","<p>I had try to implement the send me log feature into my apps but I can't get it right. Can anyone please help me with it? In the logcat, it shows the errors:</p><pre>03-29 21:23:37.636: ERROR/AndroidRuntime(820): Uncaught handler: thread AsyncTask #1 exiting due to uncaught exception03-29 21:23:37.726: ERROR/AndroidRuntime(820): java.lang.RuntimeException: An error occured while executing doInBackground()03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at android.os.AsyncTask$3.done(AsyncTask.java:200)03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:234)03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258)03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.util.concurrent.FutureTask.run(FutureTask.java:122)03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.lang.Thread.run(Thread.java:1058)03-29 21:23:37.726: ERROR/AndroidRuntime(820): Caused by: java.lang.NullPointerException03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at resonet.android.androidgallery.helloAndroid$CheckForceCloseTask.doInBackground(helloAndroid.java:1565)03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at resonet.android.androidgallery.helloAndroid$CheckForceCloseTask.doInBackground(helloAndroid.java:1)03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at android.os.AsyncTask$2.call(AsyncTask.java:185)03-29 21:23:37.726: ERROR/AndroidRuntime(820):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)03-29 21:23:37.726: ERROR/AndroidRuntime(820):     ... 4 more</pre><p>Here is my code:</p><pre><code>public class helloAndroid extends Activity implements OnClickListener {public static final int DIALOG_SEND_LOG = 345350;protected static final int DIALOG_PROGRESS_COLLECTING_LOG = 3255;protected static final int DIALOG_FAILED_TO_COLLECT_LOGS = 3535122;private static final int DIALOG_REPORT_FORCE_CLOSE = 3535788; private LogCollector mLogCollector;public void onCreate(Bundle savedInstanceState) {requestWindowFeature(Window.FEATURE_NO_TITLE);  Bundle b = this.getIntent().getExtras();  s = b.getString(""specialValue"").trim();  String xmlURL = """";  CheckForceCloseTask task = new CheckForceCloseTask();     task.execute();    }    private void throwException() {  throw new NullPointerException(); } @Override protected Dialog onCreateDialog(int id) {  Dialog dialog = null;  switch (id) {  case DIALOG_SEND_LOG:  case DIALOG_REPORT_FORCE_CLOSE:   Builder builder = new AlertDialog.Builder(this);   String message;   if (id==DIALOG_SEND_LOG)    message = ""Do you want to send me your logs?"";   else     message = ""It appears this app has been force-closed, do you want to report it to me?"";   builder.setTitle(""Warning"")   .setIcon(android.R.drawable.ic_dialog_alert)   .setMessage(message)   .setPositiveButton(""Yes"", this)   .setNegativeButton(""No"", this);   dialog = builder.create();   break;  case DIALOG_PROGRESS_COLLECTING_LOG:   ProgressDialog pd = new ProgressDialog(this);   pd.setTitle(""Progress"");   pd.setMessage(""Collecting logs..."");   pd.setIndeterminate(true);   dialog = pd;      break;  case DIALOG_FAILED_TO_COLLECT_LOGS:   builder = new AlertDialog.Builder(this);   builder.setTitle(""Error"")   .setMessage(""Failed to collect logs."")   .setNegativeButton(""OK"", null);   dialog = builder.create();  }  return dialog; } class CheckForceCloseTask extends AsyncTask&lt;Void, Void, Boolean&gt; {  @Override  protected Boolean doInBackground(Void... params) {   return mLogCollector.hasForceCloseHappened();  }  @Override  protected void onPostExecute(Boolean result) {   if (result) {    showDialog(DIALOG_REPORT_FORCE_CLOSE);   } else    Toast.makeText(getApplicationContext(), ""No force close detected."", Toast.LENGTH_LONG).show();  } } public void onClick(DialogInterface dialog, int which) {  switch (which) {  case DialogInterface.BUTTON_POSITIVE:   new AsyncTask&lt;Void, Void, Boolean&gt;() {    @Override    protected Boolean doInBackground(Void... params) {     return mLogCollector.collect();    }    @Override    protected void onPreExecute() {     showDialog(DIALOG_PROGRESS_COLLECTING_LOG);    }    @Override    protected void onPostExecute(Boolean result) {     dismissDialog(DIALOG_PROGRESS_COLLECTING_LOG);     if (result)      mLogCollector.sendLog(""lintonye@gmail.com"", ""Error Log"", ""Preface\nPreface line 2"");     else      showDialog(DIALOG_FAILED_TO_COLLECT_LOGS);    }   }.execute();  }  dialog.dismiss(); }}</code></pre>","679696","","61974","","2010-05-30 11:54:40","2011-09-22 05:03:36","problem with send me log","<android>","2","0","1","",""
"2536267","1","","","2010-03-29 07:05:15","0","255","<p>mostly i am working on android 1.6 platform.I made an application on 1.5 platform but i could not access button through like R.id.button1 like platform 1.6.Is there any idea?Thank you</p>","263325","","","","","2011-03-19 18:15:21","How to access button's id in android 1.5 platform","<android>","2","3","","",""
"2536351","1","","","2010-03-29 07:25:39","0","1643","<p>I am planning to develop an accelerometer based mouse on the android platform. the mobile device which i plan to use is htc nexus one. the cursor should move as the mobile is moved is space. will that be difficult compard to movement wrt gravity?  </p>","304022","","","","","2011-09-28 17:37:50","Android acclerometer mouse","<android><accelerometer>","2","0","","",""
"2536455","1","","","2010-03-29 07:53:17","-1","947","<p>I want to get height of TextView and line number currently shown in that TextView.</p><p>How can I do that can any body help me about this matter ??</p>","286919","","1101070","","2012-03-06 01:40:43","2012-03-06 01:40:43","TextView height","<android>","1","0","","",""
"2536483","1","2537209","","2010-03-29 07:59:34","1","1688","<p>I am developing a walkie-talkie application for Android, and would like to know whether RTP and/or SCTP is natively supported in the latest version of android SDK. </p><p>From whatever I have dug-up so far, the answer is no. </p><p>It seems that support for SCTP is coming in <a href=""http://java.sun.com/developer/technicalArticles/javase/jdk7-sctp/index.html"" rel=""nofollow"">JDK 7</a>.But then, I am not sure how this will work with my android developemnt.</p><p>Could you please shed some light over this?</p><p>Thanks,</p>","299988","","","","","2010-03-29 10:31:14","does android natively support RTP and/or SCTP?","<android><sdk><rtp><sctp>","1","0","1","",""
"2536509","1","2536653","","2010-03-29 08:07:23","1","8460","<p>i want have an image and i want to set it as a background of android list view</p><p>i have used android:background=""drawable/image""  but nothing happened</p><p>can any one guide me how to achieve this?</p><p>any help would be appricated.</p>","249991","","","","","2011-07-14 17:42:31","how to set background image in android ListView?","<android><listview>","2","0","","",""
"2536643","1","","","2010-03-29 08:35:31","0","603","<p>HI</p><p>In Bluetooth application I am noticing it is displaying multiple icons not number. I updated number of notification object, then it was displaying number and but also multiple icons.. how to disable this multiple icons?</p>","304046","","","","","2010-03-29 08:40:35","Multiple Icons on status bar! How to disable this?","<android>","1","0","","",""
"2536761","1","2536783","","2010-03-29 09:04:00","2","1759","<p>In my application when a user clicks on a button I want to open the contacts application and display a particular contacts information.</p><p>At the minute I have this:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW, People.CONTENT_URI);startActivity(intent);</code></pre><p>This displays the contact application with all the contacts displayed.</p><p>But how do I get it to display just one contact according to the contacts name or number?</p><p>This Code works: (answer)</p><pre><code>Uri contactUri = ContentUris.withAppendedId(People.CONTENT_URI, 23);Intent intent = new Intent(Intent.ACTION_VIEW, contactUri);startActivity(intent);</code></pre>","243999","","1039608","","2013-03-19 17:06:03","2013-03-19 17:06:03","Android - display specific contacts information","<android><content><android-intent><contacts>","1","0","","",""
"2536817","1","","","2010-03-29 09:15:05","0","1212","<p>I've a webview which should distinguish between internal site links and external links. I achieve this behavior by adding a html anchor named ""#external"" to every link url which contains html-attribute target=""_blank"" with the help of javascript and checking the urls with WebViewClient's </p><blockquote>  <p>shouldOverrideUrlLoading</p></blockquote><p>This solution works great as long as the user selects a link on the touchscreen. If the user selects a link with a hardware input method (e.g. scroll-ball or enter-key) the html anchor is missing from the request url and as a result my external link detection won't work.</p><p>Any ideas of what's going wrong?</p><p>Thx in advance,alex</p>","272089","","","","","2010-08-27 20:13:33","Android Webview + WebViewClient + javascript + hardware input","<javascript><android><webview>","1","0","","",""
"2536882","1","2537264","","2010-03-29 09:28:52","6","12833","<p>I want to create an incrementing second timer like a stopwatch.</p><p>So I want to be able to display the seconds and minutes incrementing in the format 00:01...</p><p>Google only brings up 24 hour clock examples, I was wondering could anyone get me started with an example or tutorial of what I want to do?</p><p>Edit:</p><p>Here is what I have using the Chronometer in Android so far</p><p><strong>In onCreate()</strong></p><pre><code>    secondsT = 0;    elapsedTimeBeforePause = 0;    stopWatch.start();    startTime = SystemClock.elapsedRealtime();    stopWatch.setBase(elapsedTimeBeforePause);     stopWatch.setOnChronometerTickListener(new OnChronometerTickListener(){            @Override            public void onChronometerTick(Chronometer arg0) {                //countUp is a long declared earlier                secondsT = (SystemClock.elapsedRealtime() - arg0.getBase()) / 1000;                String asText = (secondsT / 60) + "":"" + (secondsT % 60);                 //textGoesHere is a TextView                ((TextView)findViewById(R.id.time)).setText(asText);            }     });</code></pre><hr><p><strong>In onDestroy()</strong></p><pre><code>@Overridepublic void onDestroy() {    inCall = false;    elapsedTimeBeforePause = SystemClock.elapsedRealtime() - stopWatch.getBase();    super.onDestroy();}</code></pre><p>The above compiles and runs but the TextView never increments, it always stays at 0, can anyone see why?</p>","243999","","243999","","2010-03-29 11:26:55","2013-11-12 08:33:46","Create an incrementing timer in seconds in 00:00 format?","<java><android><timer><clock><increment>","2","3","6","",""
"2537027","1","2537110","","2010-03-29 09:56:14","18","11177","<p>i after calling notifydatasetchanged(); </p><p>i want to move scroll of list to the bottom of list so that user could see last record in the listview.actually i am writing Chat module so for that purpose i need latest record at the bottom of list.</p><p>can any one guide me how to achieve this? </p><p>any help would be appriciated.</p>","249991","","","","","2013-03-11 15:53:39","how to move scroll at the bottom of list Programmatically?","<android><listview>","2","0","4","",""
"2537098","1","","","2010-03-29 10:07:20","0","289","<p>In my application I use an image . I made some portion of the image transparent. Now How can I find the co-ordinates of the transparent portion of the image so that I am able to find the actual area of the non-transparent area.</p>","304103","","1101070","","2012-03-06 01:27:49","2012-03-06 01:27:49","How to  find the co-ordinates of the transparent area of an .png image","<android>","1","0","","",""
"2537238","1","2538606","","2010-03-29 10:36:30","136","106966","<p>Is there a common way to show a big image and enable the user to zoom in and out and pan the image?</p><p>Until now I found two ways: </p><ol><li>overwriting ImageView, that seems a little bit too much for such a common problem. </li><li>using a webview but with less control over the overall layout etc.</li></ol>","114066","","","","","2014-02-21 11:06:18","How can I get zoom functionality for images?","<android><zoom><imageview>","11","2","114","",""
"2537261","1","2537688","","2010-03-29 10:42:32","1","889","<p>i want set my footer at the top layer of my app. it should not have any shakes and moves while the activity navigation or showing up the keyboard. it should always settled in the bottom of the screen. how to do that? any ideas plz.</p>","267269","","21234","","2010-12-08 11:01:26","2010-12-08 11:01:26","how to set a footer at top layer of the app in android?","<android><graphics><android-widget><android-layout><layer>","3","0","","",""
"2537302","1","3045934","","2010-03-29 10:51:16","0","1006","<p>I use configChanges=""locale"" on my activities.Without this options in <code>AndroidManifest.xml</code> in <code>2.x</code>, I am getting flickering screens.</p><p>It works in all my activities except in the preferences screen in which I have added programmatically.I have one Preference Activity --> It works after setting configChanges=""locale"" to the AndroidManifest.xml.</p><p>Inside of the Preference Activity, I add programatically a new preferencescreen.For this new PreferenceScreen, I don't have an activity in the AndroidManifest.xml!So I cannot add the configChanges=""locale"" and the screen flickers on 2.x !!</p><p>How can I add the attribute configChanges=""locale"" programatically?</p>","242070","","1904504","","2013-12-24 10:53:07","2013-12-24 11:07:47","Adding configChanges =""locale"" programatically","<android><locale><preference>","1","2","","",""
"2537396","1","2538230","","2010-03-29 11:12:11","3","15026","<p>I'm trying to draw an image in an ImageView, but i want it to be unscaled, with scrollbars as necessary. How can I accomplish this? Right now I just have a drawable set as the android:src of the ImageView in the XML. This autoscales the image to fit the screen width.</p><p>I read that this might be because of the compatibility mode (developing for 1.5, testing on 2.1), but then I added</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""4"" /&gt;</code></pre><p>to my manifest, and nothing changed.</p><p>Any clues?</p><p>--</p><p>Edit: I used <code>android:scaleType=""center""</code> on the ImageView, and this displays the full image (can't believe I didn't see this before), but I still only get a vertical scrollbar. Using <code>android:scrollbars=""horizontal""</code> on the ScrollView that's wrapped around the ImageView (obviously) hides the vertical scrollbar, but doesn't show a horizontal scrollbar...</p>","279363","","279363","","2010-03-29 11:42:11","2013-02-01 18:08:03","Full size image in ImageView","<android><scaling><imageview>","3","0","2","",""
"2537454","1","","","2010-03-29 11:23:44","20","42927","<p>I have looked at a question similar to this <a href=""http://stackoverflow.com/questions/2496119/in-an-android-app-i-would-like-to-show-a-progress-bar-on-a-child-tab-until-the-we/2496273#2496273"">here</a> but as I am a newbie could someone explain how to get this to work in a WebView or at least how to set a 10 second time delay so people know that it's loading?</p>","249098","","249098","","2010-03-29 11:38:21","2013-12-31 09:55:54","Android WebView progress bar","<android><progress-bar><webview>","5","2","15","",""
"2537527","1","","","2010-03-29 11:37:46","0","130","<p>I have seen the tutorial provided to display google maps here...<strong>http://developer.android.com/resources/tutorials/views/hello-mapview.html.</strong> </p><p>But sadly when i try to extend MapActivity instead of Activity the whole program is getting ruined and showing errors starting from onCreate... Whats the solution and how could i get google maps working in my application???</p>","303155","","235654","","2010-03-29 14:51:06","2012-06-14 16:34:05","Problem designing google maps app in the application","<android>","1","1","","",""
"2537742","1","","","2010-03-29 12:20:23","1","2095","<p>I have a tiny Lua script which is supposed to disable call forwarding:</p><pre><code>require 'android'android.dialNumber('*21#')</code></pre><p>The problem is that the script only dials '*21' and omits the '#' character. Playing around It looks to me like the # character is treated as comment character as everything after it is ignored. I've tried singel and double quotes, escaping, \023, but nothing works.</p><p>How can I dial '*21#' on android with Lua ?</p>","100243","","68204","","2010-03-30 01:38:34","2010-10-29 17:45:32","Lua on Android: Comment character","<android><scripting><lua>","0","5","1","",""
"2537747","1","2540666","","2010-03-29 12:21:06","-1","1351","<p>I am developing the chatting application but by using that application two persons are not received chatting messages properly.If one person send a chat message to other did not receive it immediately .For that i want the refresh that application For that what can i do?Give me some suggestion .Thanks in advance</p>","454808","","454808","","2010-03-30 11:07:25","2011-01-17 16:35:07","Refresh the pages","<android>","1","2","","",""
"2537759","1","2539055","","2010-03-29 12:22:46","1","2523","<p>My Android project references external classfiles that are not included in the in the Android SDK. I added those classes as an external library properly in eclipse. The code compiles with no problem. But as I try to run the application I get an ClassNotFoundException by the DalvikVM, although all the neccessary classes have been ported.</p><p>Am I missing something?</p><p>The steps I did.</p><ol><li>create new folder in eclipse android project.</li><li>copy neccessary classes in this folder.</li><li>add the folder to the classpath via eclipse.</li><li>programm</li><li>compile</li><li>run as android application</li><li>--> Exception</li></ol><p>EDIT:</p><p>I tried to add the external jar now. I get the following errors when eclipse is rebuilding the build path: </p><p>""warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)""</p><p>That comes for every class file in the jar apparently.</p><p>and: ""Dex Loader]Unable to execute dex: null""and: ""Conversion to Dalvik format failed: Unable to execute dex: null""</p>","283494","","283494","","2010-03-29 14:25:30","2010-03-29 15:18:37","Referencing external classes","<android>","2","4","1","",""
"2537848","1","2538305","","2010-03-29 12:35:11","0","1054","<p>I would like to know whether this is actually possible in Android? </p><p>When Android phone receives an incoming call from a specific number the phone's ringing should stop and also the screen should not blink. What I mean is the user should not be able to know that there was incoming call, but actually there was. </p><p>I do not want to delete any call logs, just to stop sound on incoming call from a specific number and that too at a specific time.</p><p>Can someone let me know if this is actually possible?</p>","261566","","881229","","2014-03-18 20:43:22","2014-03-18 20:43:22","Turn Off Sound and screen blink on incoming calls in Android?","<android><audio>","1","1","","",""
"2538380","1","2539031","","2010-03-29 13:56:52","12","5326","<p>I would like to display all resource drawables in a list so that the user can select one. Is there any way to loop through all R.drawable items so I don't have to hard code them into my program?</p>","292578","","","","","2013-10-02 07:18:17","How to display list of resource drawables","<android>","2","0","3","2013-10-02 08:11:03",""
"2538539","1","2542987","","2010-03-29 14:17:01","2","12483","<p>i have a question, been stuck for a while, i dont know how can i add a checkbox in the list, for example if I have a list of items i want to be able to check them. my xml code is the following:</p><p></p><pre><code>&lt;LinearLayout android:id=""@+id/topLayout""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_centerHorizontal=""true""  android:layout_height=""wrap_content""&gt;&lt;/LinearLayout&gt;&lt;LinearLayout    android:id=""@+id/middleLayout""    android:orientation=""horizontal""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""&gt;    &lt;LinearLayout android:id=""@+id/leftMiddleLayout""            android:orientation=""vertical"" android:layout_below=""@+id/topLayout""            android:layout_above=""@+id/bottomLayout""            android:layout_width=""60px"" android:layout_height=""wrap_content""            &gt;            &lt;ListView android:id=""@+id/checkboxList"" android:layout_width=""fill_parent""                    android:layout_height=""wrap_content"" &gt;&lt;/ListView&gt;            &lt;CheckBox android:id=""@+id/checkbox""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:checked=""false""            android:text=""test""&gt;            &lt;/CheckBox&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:id=""@+id/rightMiddleLayout""            android:orientation=""vertical"" android:layout_below=""@+id/topLayout""            android:layout_above=""@+id/bottomLayout""            android:layout_width=""280px"" android:layout_height=""wrap_content""            &gt;            &lt;ListView android:id=""@+id/list"" android:layout_width=""fill_parent""                    android:layout_height=""wrap_content"" &gt;&lt;/ListView&gt;            &lt;TextView android:id=""@+id/text"" android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""/&gt;                       &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;&lt;LinearLayout android:id=""@+id/bottomLayout""     android:layout_alignParentBottom=""true""     android:orientation=""horizontal""     android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:paddingBottom=""5pt""    &gt;    &lt;EditText android:id=""@+id/insertNewItem""        android:layout_width=""220px"" android:layout_height=""wrap_content"" /&gt;    &lt;TextView android:layout_width=""10px"" android:layout_height=""wrap_content"" /&gt;    &lt;Button android:id=""@+id/addItemButton"" android:layout_width=""wrap_content""        android:layout_height=""fill_parent"" android:text=""Add Item""/&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>if you have any ideas please let me know, its for my academic studies :((</p><p>Thank you!</p>","200123","","","","","2014-02-27 12:12:21","how to add a checkbox in a listview?","<android><listview><checkbox>","6","1","0","",""
"2538583","1","","","2010-03-29 14:21:16","4","7104","<p>I see on the Android SDK pages, it mentions some screen resolutions to expect on Android platforms:</p><p>Small screen<br>QVGA (240x320), 2.6""-3.0"" diagonal</p><p>Normal screen<br>WQVGA (240x400), 3.2""-3.5"" diagonalFWQVGA (240x432), 3.5""-3.8"" diagonalHVGA (320x480), 3.0""-3.5"" diagonalWVGA (480x800), 3.3""-4.0"" diagonalFWVGA (480x854), 3.5""-4.0"" diagonal</p><p>Large screen<br>WVGA (480x800), 4.8""-5.5"" diagonalFWVGA (480x854), 5.0""-5.8"" diagonal</p><p>Obviously, testing an app you want to sell on all these resolutions is going to be a pain. Is there any data on what percent of android phones being used use the above resolutions? My hope is that there's only really 3 or so popular resolutions...</p>","296109","","","","","2014-03-04 08:18:11","Which Android app resolutions to support?","<android><mobile-phones><resolution>","3","3","2","",""
"2538696","1","2538788","","2010-03-29 14:34:32","0","2439","<p>I am completely new to android, and pretty much a Java newb.</p><p>I have a simple app that I am building to get the hang of android's development environment - and things like click events, etc..</p><p>The app loads, and I am able to change the text in a textfield using a button handler. However, when I import the location class, and try to do a simple GPS call, the application crashes.</p><p>The problem is, everything looks good in Eclipse (error console) - and I'm not seeing any exceptions in the android emulator (DevTools). I have the logcat window open, but I haven't done anything in eclipse/code to send logcat anything (do I need to?)</p><p>Can anyone see something wrong with this? Is there a better way to troubleshoot?</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.*;import android.location.*;public class locationDisplay extends Activity {    private EditText text;    private Location GPSLocation;    double dblLat;    double dblong;    String strLat;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main); // bind the layout to the activity        text = (EditText) findViewById(R.id.EditText01);        text.setText(""No button pressed"");    }    // Handler for each button -- Button01 is when it crashes    public void myClickHandler(View view) {        switch (view.getId()) {        case R.id.Button01:             dblLat = GPSLocation.getLatitude();            strLat = Double.toString(dblLat);            text.setText(strLat);            break;        case R.id.Button02:            text.setText(""Button 2 was clicked"");            break;        case R.id.Button03:            text.setText(""Button 3 was clicked"");            break;        }    }</code></pre>","462307","","","","","2011-02-14 06:08:48","Android App crashes in emulator - logs blank","<android>","3","2","","",""
"2538812","1","4241794","","2010-03-29 14:47:57","2","3914","<p>i want to load my web view as a overview mode(completely zoomed out). that is the webpage zoomed out completely at the initial state.</p><p>i coded like this:</p><pre><code>webview_obj.getSettings().setLoadWithOverviewMode(true);</code></pre><p>its not working. what is the mistake and how to rectify it?</p>","267269","","267269","","2010-03-30 17:05:24","2010-11-22 02:36:41","how to show the web view as OverviewMode(completely zoomed out) in android? how?","<android><android-emulator><webview><android-webview>","1","0","1","",""
"2538984","1","2543357","","2010-03-29 15:09:52","2","6450","<p>I am experiencing an unusual error using ItemizedOverlay in Android.</p><p>I am creating a GPS tracking device that plots a route between waypoints stored in a database. </p><p>When I provide the first two sets of longitude and latitude points through the emulator in Eclipse, it draws a red line just how I want it, but if I send another GPS point, it animates to the point, but does not draw a line from the last point.</p><hr><pre><code>public class MyOverlay extends ItemizedOverlay&lt;OverlayItem&gt; {   // private Projection projection;private Paint linePaint;private Vector&lt;GeoPoint&gt; points;public MyOverlay(Drawable defaultMarker) {    super(defaultMarker);    points = new Vector&lt;GeoPoint&gt;();    //set colour, stroke width etc.    linePaint = new Paint();    linePaint.setARGB(255, 255, 0, 0);    linePaint.setStrokeWidth(3);    linePaint.setDither(true);    linePaint.setStyle(Style.FILL);    linePaint.setAntiAlias(true);    linePaint.setStrokeJoin(Paint.Join.ROUND);    linePaint.setStrokeCap(Paint.Cap.ROUND);}public void addPoint(GeoPoint point) {    points.addElement(point);}public void draw(Canvas canvas, MapView view, boolean shadow) {    int size = points.size();    Point lastPoint = new Point();    if(size == 0) return;    view.getProjection().toPixels(points.get(0), lastPoint);    Point point = new Point();    for(int i = 1; i&lt;size; i++){       view.getProjection().toPixels(points.get(i), point);        canvas.drawLine(lastPoint.x, lastPoint.y, point.x, point.y, linePaint);        lastPoint = point;    }}@Overrideprotected OverlayItem createItem(int arg0) {    // TODO Auto-generated method stub    return null;}@Overridepublic int size() {    // TODO Auto-generated method stub    return 0;}}</code></pre>","296810","","760489","","2011-12-27 10:33:58","2011-12-27 10:33:58","Overlay only draws line between first 2 GPS points in Android","<java><android><sqlite><overlay><itemizedoverlay>","2","3","","",""
"2539074","1","2539100","","2010-03-29 15:20:42","11","6766","<p>I'm planning to port a couple of games from iPhone/Windows Mobile to the Android platform. The games are written in C++ so I plan to use the NDK with a thin java wrapper.</p><p>I'm new to the Android platform and need some advice on which phone to buy for development. I suspect like Windows Mobile there is a level of fragmentation with different phones supporting different features (keyboard/ rotation/ screen size/ capacitive touch screen/ etc).</p><p>What are the best device(s) for development on the Android platform...?</p><p>They also have to be available in the UK/Europe.</p><p>Thank you in advance.Nikos.</p>","304345","","","","","2012-12-06 19:16:07","Which Android phone to use for development...?","<android><android-ndk>","9","0","4","2012-12-07 09:12:13",""
"2539264","1","2539402","","2010-03-29 15:44:36","19","27610","<p>I'd like to know how to control my application's volume from the volume keys (contrary to my belief , I've read they control only the ringer volume). Should I overwrite the onKey Down/Up?   </p><p>Or is there other way to accomplish this? I'm asking because if I overwrite the upper mentioned function for an activity, then the functions will receive the event only if a view associated with the this activity has the focus, and I'm looking for something ""Globaly"" ( to work no matter what activity is running now)</p>","284609","","114066","","2010-07-05 10:43:19","2012-06-06 17:46:28","Volume Control in android application","<android>","3","0","12","",""
"2539385","1","2540710","","2010-03-29 16:00:05","0","1052","<p>I would like an application which is not readily apparent to casual perusal of the Android.   </p><p>How best to activate it and bring its screen to the fore? Can I detect a special dialing sequence, like <code>*1234#</code>? Or a hotkey combination?  </p><p>When activated, I guess I can pop up an anonymous screen which does not mention the app, but only asks for a password.</p><p>If password is ok, then show the app.</p><p>Any suggestions?</p>","192910","","47550","","2010-03-29 16:05:38","2010-03-29 19:52:46","How to implement a ""hidden"" Android app?","<android>","2","5","","",""
"2539396","1","2539549","","2010-03-29 16:01:43","5","5875","<p>HI all,</p><p>I'm just getting started with developing for Android. I'm looking to port one of my iPhone applications, but I'm kind of at a loss for how to draw a view at runtime (a view not declared in the XML). Basically, I want to draw a simple rectangle, but then be able to manipulate its frame after being drawn. </p><p>Sorry if this is a really, really simple question, but I can't seem to find some equivalent to the iPhone SDK here. </p><p>Thanks in advance!</p>","253567","","","","","2010-03-29 16:24:29","New to Android - Drawing a view at runtime","<xml><android><view><runtime><draw>","1","0","2","",""
"2539519","1","2539648","","2010-03-29 16:20:55","5","2637","<p>In order for the user to control the volume , my android application has a menu consisting of a slider that provides int values from 0 to 10 , when dragged. After I obtain a value , I must set the volume to the corresponding value chosen by the user , and well , this is the part that I don't know to implement and I 'd like to find about it. </p>","284609","","114066","","2010-07-05 14:28:09","2010-07-05 14:28:09","Set the volume of an android application","<android>","1","0","1","",""
"2539524","1","2539739","","2010-03-29 16:21:19","7","9777","<p>My class extends View and I need to get continuous touch events on it.</p><p>If I use:</p><pre><code>public boolean onTouchEvent(MotionEvent me) {    if(me.getAction()==MotionEvent.ACTION_DOWN) {        myAction();    }    return true;}</code></pre><p>... the touch event is captured once.</p><p>What if I need to get continuous touches without moving the finger?Please, tell me I don't need to use threads or timers. My app is already too much heavy.</p><p>Thanks.</p>","252711","","","","","2013-08-06 15:06:41","How to get a continuous Touch Event?","<android><events><touch><continuous>","4","0","","",""
"2539527","1","2540649","","2010-03-29 16:21:31","0","2172","<p>I resolved this issue myself.  It turns out that the activation framework requires some libraries that aren't native to android, myjava.awt.datatransfer, org.apache.harmony.awt.*, and org.apache.harmony.misc.  Once i added those libraries everything worked fine.  </p><blockquote>  <p>I'm trying to use the gdata java  client library on android and have  managed a decent hack to get it  working.  However because the jar for  gdata had some package discrepancies  with android I had to import the  source into my project.  This source  is dependent on the JavaMail API and  the JavaBeans Activation Framework as  specified <a href=""http://code.google.com/apis/gdata/articles/java_client_lib.html#mac"" rel=""nofollow"">here</a>.  </p>    <p>My issue is that the JavaMail jar  throws a class definition not found  when seeking a class which is in the  Activation Framework jar.  A stack  trace is listed below.  I am working  in Eclipse and have both jars in a lib  folder and added to my build path.   I'm not very experienced dealing with  jars in a  situation like this so any  help or insight would be appreciated.</p></blockquote><pre><code>03-29 09:55:26.204: ERROR/AndroidRuntime(331): Uncaught handler: thread AsyncTask #3 exiting due to uncaught exception03-29 09:55:26.215: ERROR/AndroidRuntime(331): java.lang.RuntimeException: An error occured while executing doInBackground()03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at android.os.AsyncTask$3.done(AsyncTask.java:200)03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.FutureTask.setException(FutureTask.java:124)03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.lang.Thread.run(Thread.java:1096)03-29 09:55:26.215: ERROR/AndroidRuntime(331): Caused by: java.lang.NoClassDefFoundError: javax.activation.DataHandler03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at javax.mail.internet.MimeBodyPart.setContent(MimeBodyPart.java:684)03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at com.google.gdata.data.media.MediaBodyPart.&lt;init&gt;(MediaBodyPart.java:95)03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at com.google.gdata.data.media.MediaMultipart.&lt;init&gt;(MediaMultipart.java:126)03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at com.google.gdata.client.media.MediaService.insert(MediaService.java:382)03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at android.os.AsyncTask$2.call(AsyncTask.java:185)03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)</code></pre>","303256","","303256","","2010-03-29 19:21:58","2011-03-21 13:39:45","jar dependencies in android- no class definition found exception","<java><android><jar>","2","0","","",""
"2539669","1","2539688","","2010-03-29 16:43:18","1","3366","<p>The standard getUrlContent works welll when there is no firewall. But I got exceptions when I try to do it behind a firewall. </p><p>I've tried to set ""http proxy server"" in AVD manager, but it didn't work. Any idea how to correctly set it up?</p><p>and btw: from android documentation ""You can use the -verbose-proxy option to diagnose proxy connection problems."" -verbose-proxy is not a valid option at all.</p><pre><code>protected static synchronized String getUrlContent(String url) throws ApiException {    if(url.equals(""try"")){        return ""thanks"";    }    if (sUserAgent == null) {        throw new ApiException(""User-Agent string must be prepared"");    }    // Create client and set our specific user-agent string    HttpClient client = new DefaultHttpClient();    HttpGet request = new HttpGet(url);    request.setHeader(""User-Agent"", sUserAgent);    try {        HttpResponse response = client.execute(request);        // Check if server response is valid        StatusLine status = response.getStatusLine();        if (status.getStatusCode() != HTTP_STATUS_OK) {            throw new ApiException(""Invalid response from server: "" +                    status.toString());        }        // Pull content stream from response        HttpEntity entity = response.getEntity();        InputStream inputStream = entity.getContent();        ByteArrayOutputStream content = new ByteArrayOutputStream();        // Read response into a buffered stream        int readBytes = 0;        while ((readBytes = inputStream.read(sBuffer)) != -1) {            content.write(sBuffer, 0, readBytes);        }        // Return result from buffered stream        return new String(content.toByteArray());    } catch (IOException e) {        throw new ApiException(""Problem communicating with API"", e);    }}</code></pre>","253800","","253800","","2010-03-29 17:25:09","2011-08-05 16:43:13","Android: Unable to make httprequest behind firewall","<android><firewall><http-proxy>","2","0","1","",""
"2539870","1","2646226","","2010-03-29 17:16:35","2","187","<p>Does anybody knows when there will be more updated information than the following info provided by google a couple of month ago?</p><p><a href=""http://developer.android.com/intl/zh-CN/resources/dashboard/platform-versions.html"" rel=""nofollow"">http://developer.android.com/intl/zh-CN/resources/dashboard/platform-versions.html</a></p><p>maybe another source for more up to date information?</p><p>Thanks</p>","237115","","","","","2010-04-15 14:38:17","android Platform Versions","<android><version>","1","2","","",""
"2539932","1","2540779","","2010-03-29 17:29:30","2","4332","<p>I started my emulator with ./emulator -trace profile -avd emulator_15.  I then tracked down the trace files to ~/.android/avd/rodgers_emulator_15.avd/traces/profile, where there are six files:  qtrace.bb, qtrace.exc, qtrace.insn, qtrace.method, qtrace.pid, qtrace.static.  I can't figure out what to do with these files.  I've tried both dmtracedump and traceview on all of the files, but none seem to generate any output I can do anything with.</p><p>How can I view the proportion of time taken by native method calls on Android?</p>","281519","","3052751","","2014-01-08 14:05:40","2014-01-08 14:05:40","How to View Android Native Code Profiling?","<android><android-emulator><profiling><qemu>","2","0","1","",""
"2539990","1","2540093","","2010-03-29 17:38:57","0","523","<p>i still have a problem to develop a convenient app to the user. because i am struggling using the activities, intent and intent filters. www.developer.android.com/reference not fit for me to understand these things. can you suggest me a fine example code or tutorial to understand how these things are getting worked.</p>","267269","","","","","2012-04-18 05:57:00","Activity, subActivity, Intent and IntentFilters in android?","<android>","1","0","","",""
"2540053","1","2540067","","2010-03-29 17:47:59","3","1594","<p><code>Notification</code> and <code>NotificationManager</code> are used to create icons to be placed on the top-left position of the screen. A <code>Notification</code> also need to have an entry on the status bar pull-down.</p><p>However, icons on the right side such as the battery, signal strength, wireless indicators do not need any entry on the status bar. </p><p>How do I make such icons without any entry in the status bar pull-down?</p>","11238","","","","","2013-08-21 06:13:07","How to create a status bar icon on the right side? (Android)","<android><icons><notifications><notificationmanager>","2","0","1","",""
"2540786","1","2541720","","2010-03-29 19:48:01","21","53135","<p>I am currently trying to send some data from and Android application to a php server (both are controlled by me). </p><p>There is alot of data collected on a form in the app, this is written to the database. This all works.</p><p>In my main code, firstly I create a JSONObject (I have cut it down here for this example):</p><pre><code>JSONObject j = new JSONObject();j.put(""engineer"", ""me"");j.put(""date"", ""today"");j.put(""fuel"", ""full"");j.put(""car"", ""mine"");j.put(""distance"", ""miles"");</code></pre><p>Next I pass the object over for sending, and receive the response:</p><pre><code>String url = ""http://www.server.com/thisfile.php"";HttpResponse re = HTTPPoster.doPost(url, j);String temp = EntityUtils.toString(re.getEntity());if (temp.compareTo(""SUCCESS"")==0){    Toast.makeText(this, ""Sending complete!"", Toast.LENGTH_LONG).show();}</code></pre><p>The HTTPPoster class:</p><pre><code>public static HttpResponse doPost(String url, JSONObject c) throws ClientProtocolException, IOException {    HttpClient httpclient = new DefaultHttpClient();    HttpPost request = new HttpPost(url);    HttpEntity entity;    StringEntity s = new StringEntity(c.toString());    s.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, ""application/json""));    entity = s;    request.setEntity(entity);    HttpResponse response;    response = httpclient.execute(request);    return response;}</code></pre><p>This gets a response, but the server is returning a 403 - Forbidden response.</p><p>I have tried changing the doPost function a little (this is actually a little better, as I said I have alot to send, basically 3 of the same form with different data - so I create 3 JSONObjects, one for each form entry - the entries come from the DB instead of the static example I am using).</p><p>Firstly I changed the call over a bit:</p><pre><code>String url = ""http://www.myserver.com/ServiceMatalan.php"";Map&lt;String, String&gt; kvPairs = new HashMap&lt;String, String&gt;();kvPairs.put(""vehicle"", j.toString());// Normally I would pass two more JSONObjects.....HttpResponse re = HTTPPoster.doPost(url, kvPairs);String temp = EntityUtils.toString(re.getEntity());if (temp.compareTo(""SUCCESS"")==0){    Toast.makeText(this, ""Sending complete!"", Toast.LENGTH_LONG).show();}</code></pre><p>Ok so the changes to the doPost function:</p><pre><code>public static HttpResponse doPost(String url, Map&lt;String, String&gt; kvPairs) throws ClientProtocolException, IOException {    HttpClient httpclient = new DefaultHttpClient();    HttpPost httppost = new HttpPost(url);    if (kvPairs != null &amp;&amp; kvPairs.isEmpty() == false)     {        List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(kvPairs.size());        String k, v;        Iterator&lt;String&gt; itKeys = kvPairs.keySet().iterator();        while (itKeys.hasNext())         {            k = itKeys.next();            v = kvPairs.get(k);            nameValuePairs.add(new BasicNameValuePair(k, v));        }                     httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));    }    HttpResponse response;    response = httpclient.execute(httppost);    return response;}</code></pre><p>Ok So this returns a response 200</p><pre><code>int statusCode = re.getStatusLine().getStatusCode();</code></pre><p>However the data received on the server cannot be parsed to a JSON string. It is badly formatted I think (this is the first time I have used JSON):</p><p>If in the php file I do an echo on $_POST['vehicle'] I get the following:</p><pre><code>{\""date\"":\""today\"",\""engineer\"":\""me\""}</code></pre><p>Can anyone tell me where I am going wrong, or if there is a better way to achieve what I am trying to do? Hopefully the above makes sense!</p>","232565","","232565","","2012-03-06 14:21:27","2013-03-18 12:01:41","Android JSON HttpClient to send data to PHP server with HttpResponse","<php><android><json><httpclient><httpresponse>","4","3","18","",""
"2540903","1","2541051","","2010-03-29 20:07:33","0","1166","<p>I am trying to calculate the distance between the first GPS point stored in a SQLite database and the last GPs point stored. </p><p>My code so far is this:</p><pre><code>private double Distance() {SQLiteDatabase db1 = waypoints.getWritableDatabase();Cursor cursor = db1.query(TABLE_NAME, FROM, null, null, null, null,ORDER_BY);Cursor cursor1 = db1.query(TABLE_NAME, FROM, null, null, null, null,ORDER_BY);Double lat = cursor.getDouble(2);Double lon = cursor.getDouble(1);cursor.moveToFirst();cursor.moveToLast();cursor.close();distance = cursor.distanceTo(cursor1);}</code></pre><p>I realise I need to return a value but the error I am receiving is for the distanceTo method</p><p>""The method distanceTo(Cursor) is undefined for the type Cursor""</p><p>Thanks.</p>","296810","","","","","2010-03-29 20:30:23","Finding the distance between 2 points in Android using Cursor and the distanceTo() method","<java><android><sqlite><cursor>","1","0","1","",""
"2540967","1","5026375","","2010-03-29 20:18:22","2","742","<p>I'm writing unit tests for a ListActivity in Android that uses a handler to update a ListAdapter. While my activity works in the Android emulator, running the same code in a unit test doesn't update my adapter: calls to sendEmptyMessage do not call handleMessage in my activity's Handler.</p><p>How do I get my ActivityUnitTestCase to sync with the MessageQueue thread and call my Handler?</p><p>The code for the Activity is somewhat like this:</p><pre><code>public class SampleActivity extends ListActivity implements SampleListener {    List samples = new ArrayList();    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.sample_list);        listView.setEmptyView(findViewById(R.id.empty));    }    private final Handler handler = new Handler() {        @Override        public void handleMessage(Message msg) {            // unit test never reaches here            sharesAdapter = new SampleAdapter(SampleActivity.this, samples);            setListAdapter(sharesAdapter);        }    };    public void handleSampleUpdate(SampleEvent event) {        samples.add(event.getSample());        handler.sendEmptyMessage(0);    }}</code></pre><p>The code for my unit test is somewhat like this:</p><pre><code>public class SampleActivityTest extends ActivityUnitTestCase&lt;SampleActivity&gt; {    public SampleActivityTest() {        super(SampleActivity.class);    }    @MediumTest    public void test() throws Exception {        final SampleActivity activity = startActivity(new Intent(Intent.ACTION_MAIN), null, null);        final ListView listView = (ListView) activity.findViewById(android.R.id.list);        activity.handleSampleUpdate(new SampleEvent(this));        // unit test assert fails on this line:        assertTrue(listView.getCount() == 1);    }}</code></pre>","48611","","","","","2011-02-17 07:57:07","How do I get my ActivityUnitTestCases to sync with the MessageQueue thread and call my Handler?","<android><junit>","1","0","1","",""
"2541052","1","2542165","","2010-03-29 20:30:25","4","828","<p>I've been curious as to all the optimizations that go into the building of an .apk.  I'm curious because of two things I've tried in the past to bring down the size of my .apk:</p><ol><li><p>I have had a few large json assets in projects before, as well as a static sqlite database.  I tried bringing down the size of the apk by gzipping them before the build process, but the resulting size is exactly the same.</p></li><li><p>I just today tried pngcrush on my /drawable/ folders.  The resulting build was exactly the same size as before.</p></li></ol><p>I would think that perhaps #1 could be explained by the zip process, but simply zipping the /drawable/ folders in #2 result in different-sized files.  Perhaps the build process runs something akin to pngcrush?</p><p>Regardless, I was wondering if anyone knew where to find a detailed description of all the optimizations in the Android build process.  I don't want to waste my time trying to optimize what is already automated, and also I think it'd help my understanding of the resulting apk.  Does anyone know if this is documented anywhere?</p>","60261","","","","","2010-03-30 00:35:33","Is there a detailed description of optimizations in the Android build process?","<android><build-process>","2","0","","",""
"2541149","1","2541286","","2010-03-29 20:44:59","2","382","<p>I am brainstorming possible ways to implement something for an Android application. I am working on an application for a bus system in which I thought it would be neat to try and find a way to find the fastest bus to your destination. Any suggestions on how I could use a starting position and ending position to find the closest bus stops to both positions?</p><p>Any input is appreciated, thanks! </p><p>Rob</p>","289153","","19750","","2010-03-30 07:54:07","2010-03-30 07:54:07","Interesting use of Android Maps","<android><google-maps>","1","0","","",""
"2541293","1","","","2010-03-29 21:07:55","0","2348","<p>I just downloaded DroidEx but doesn't seem to allow me to run it (i.e <code>NoClassDefError</code>)</p><p>I'm on mac snow leopard and here is what I've done: 1. download droidex from <a href=""http://github.com/commonsguy/droidex"" rel=""nofollow"">http://github.com/commonsguy/droidex</a><br>2. download droidex.jar from <a href=""http://cloud.github.com/downloads/commonsguy/droidex/DroidEx.jar"" rel=""nofollow"">http://cloud.github.com/downloads/commonsguy/droidex/DroidEx.jar</a> and put it in my DroidEx_HOME/bin<br>3. create $ANDROID_HOME in .bash_profile and add the DroidEx folder to my $PATH<br>4. run droidex  </p><p>That failed.</p><p>This is what I get ""<strong>Exception</strong> in thread ""<strong>main</strong>"" <strong>java.lang.NoClassDefFoundError: com/android/ddmlib/AndroidDebugBridge</strong>""  </p><p>What am I missing?</p><p>Thanks,<br>Tee</p>","166940","","950427","","2014-02-17 03:23:26","2014-02-17 03:23:26","How to use DroidEx?","<android><droidex>","0","6","","",""
"2541802","1","3031178","","2010-03-29 22:52:30","36","39315","<p>Currently I have a TabHost implemented with 3 tabs each containing a separate activity.  My question is how do I switch between tabs from within one of the activities that is located inside the tab host.  I've looked everywhere and have been unsuccessful in finding a real answer to this problem.</p>","246639","","246639","","2010-04-12 04:52:18","2013-03-15 10:20:17","Android - Switch Tabs from within an Activity within a tab","<android><tabs><android-intent>","7","0","27","",""
"2541804","1","2543687","","2010-03-29 22:53:01","1","342","<p>Is there anywhere a summary of <strong>Build.MODEL</strong> strings for different Android handset models? Something like:</p><ul><li>""Hero"" - HTC Hero</li><li>""ERA G2 Touch"" - branded HTC Hero</li><li>""T-Mobile myTouch 3G"" - branded HTC Magic</li><li>""GT-I5700"" - Samsung Galaxy</li><li>... and so on</li></ul><p>I'm curious what is the percent of rooted devices among my app users, but sometimes is hard to tell which device is which (and yes, I know rooted firmware can mimic vanilla one, it just usually doesn't).</p>","7162","","","","","2010-03-30 08:14:39","Android: original firmware identification strings for different models","<android><model><firmware><handset>","1","0","","",""
"2541884","1","2542763","","2010-03-29 23:13:14","1","1448","<p>I'm creating a notification with something similar to the following:</p><pre><code>    Intent ni = new Intent(this, SomeActivity.class);    ni.putExtra(""somestring"", ""somedata"");    PendingIntent contentIntent =         PendingIntent.getActivity(this, 0, ni,                 PendingIntent.FLAG_UPDATE_CURRENT|PendingIntent.FLAG_ONE_SHOT);    Context context = getApplicationContext();    notification.setLatestEventInfo(context,             res.getString(R.string.app_name),             text, contentIntent);</code></pre><p>The key here is the extra data on the Intent for the notification.  Once I click on the notification and it brings up SomeActivity, it brings up the activity and the extra data is available.</p><p>However, if I exit the app, hold the home button until the recent activities list comes up, and choose to open the app again, the extra data is still passed.  Is there a way I can make this data get passed <em>only</em> if the app is opened via the Notification, and not from the recent activities list?</p>","238849","","","","","2012-08-03 06:32:24","PendingIntent from notification and application history conflicts","<android>","3","0","","",""
"2541979","1","","","2010-03-29 23:42:03","1","2257","<p>My android application has 1 main activity. And it launches some sub-activity (which I wrote) and that also launches some sub-activity (which I wrote).  I do this:</p><pre><code> Intent i = new Intent(""my intent1""); startActivity(i);</code></pre><p>My question is how can each of my sub-activity and sub-sub-activity get back to the Parent activity?</p><p>Thank you.</p>","286802","","","","","2010-03-29 23:54:18","What is the recommend way to get the main Activity from child Activity","<android>","2","0","","",""
"2542014","1","2542112","","2010-03-29 23:52:59","2","3245","<p>I have an application that calls a number stored by the user. Everything works okay unless the number contains commas or hash signs, in which case the Uri gets truncated after the digits. I have read that you need to encode the hash sign but even doing that, or without a hash sign, the commas never get passed through. However, they do get passed through if you just pick the number from your contacts. I must be doing something wrong. For example:</p><pre><code>String number = ""1234,,,,4#1"";Uri uri = Uri.parse(String.format(""tel:%s"", number));try {  startActivity(new Intent(callType, uri));} catch (ActivityNotFoundException e) { ...</code></pre><p>Only the number '1234' would end up in the dialer.</p>","81317","","","","","2013-03-12 09:51:41","How do I send DTMF tones and pauses using Android ACTION_CALL Intent with commas in the number?","<android>","2","1","","",""
"2542477","1","2543785","","2010-03-30 02:19:22","3","5366","<p>I am using a ListView. But the top-most and botom-most horizontal bar does not show up. Any idea why? I am using this: </p><pre><code>android:divider=""@android:drawable/divider_horizontal_bright""</code></pre>","302969","","","","","2013-04-18 08:26:41","Top-most and Bottom-most Horizonal Divider does not show up in ListView","<android><android-widget>","3","2","2","",""
"2542559","1","2543198","","2010-03-30 02:44:23","1","1032","<p>Ok I know everyone is going to tell me not to use RegEx for parsing HTML, but I'm programming on Android and don't have ready access to an HTML parser (that I'm aware of). Besides, this is server generated HTML which <em>should</em> be more consistent than user-generated HTML.</p><p>The regex looks like this:</p><pre><code>Pattern patternMP3 = Pattern.compile(        ""&lt;A HREF=\""[^\""]+.+\\.mp3&lt;/A&gt;"",        Pattern.CASE_INSENSITIVE |        Pattern.UNICODE_CASE);Matcher matcherMP3 = patternMP3.matcher(HTML);while (matcherMP3.find()) { ... }</code></pre><p>The input HTML is all on one line, which is causing the problem. When the HTML is on separate lines this pattern works. Any suggestions?</p>","298511","","","","","2010-03-30 11:55:48","Trying to parse links in an HTML directory listing using Java regex","<java><html><android><regex>","3","1","1","",""
"2542897","1","","","2010-03-30 04:40:52","7","4873","<p>Suppose I have a simple layout xml like the following:</p><p>button.xml:</p><pre><code>&lt;Button    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/button01""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" /&gt;</code></pre><p>Are there any differences in the following calls? and which one should i use?</p><pre><code>button = (Button) getLayoutInflater().inflate(R.layout.button, null);</code></pre><p>and</p><pre><code>View v = getLayoutInflater().inflate(R.layout.button, null);button = (Button) v.findViewById(R.id.button01);</code></pre>","","Cedric","243782","","2010-03-30 08:21:59","2011-08-25 10:01:32","inflate vs findViewById","<android>","2","1","1","",""
"2542938","1","3104265","","2010-03-30 04:55:36","107","30538","<p>I'm registering a preference change listener like this (in the onCreate() of my main activity):</p><pre><code>SharedPreferences prefs =     PreferenceManager.getDefaultSharedPreferences(this);prefs.registerOnSharedPreferenceChangeListener(    new SharedPreferences.OnSharedPreferenceChangeListener() {        public void onSharedPreferenceChanged(            SharedPreferences prefs, String key) {            System.out.println(key);        }    });</code></pre><p>The trouble is, the listener is not always called.  It works for the first few times a preference is changed, and then it is no longer called until I uninstall and reinstall the app.  No amount of restarting the application seems to fix it.</p><p>I found a mailing list <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg43834.html"">thread</a> reporting the same problem, but no one really answered him.  What am I doing wrong?</p>","238849","","96196","","2011-07-27 14:30:45","2013-09-03 08:03:15","SharedPreferences.onSharedPreferenceChangeListener not being called consistently","<android><android-preferences>","5","0","65","",""
"2543058","1","2543669","","2010-03-30 05:34:24","0","174","<p>When I try to shorten a link with ""#,&amp;"" character I get an exception. Is there a way to handle these character properly?</p><p>This is a sample code that works:</p><pre><code>String shortUrl = bitly.getShortUrl(""http://z""); //Works</code></pre><p>If I add for example '&amp;' or '%25' to the string it will throw an exception:</p><pre><code>String shortUrl = bitly.getShortUrl(""http://z%26""); // Exception String shortUrl = bitly.getShortUrl(""http://z&amp;""); // Exception</code></pre><p>The <code>getShortUrl</code> function from <a href=""http://github.com/finnjohnsen/BitlyAndroid/raw/master/src/com/finnjohnsen/bitlyandroid/test/BitlyAndroid.java"" rel=""nofollow"">this Java class</a>.</p><p>Thanks</p>","302707","","17028","","2010-03-30 06:20:12","2010-03-30 08:11:19","Characters problem in Bit.ly","<android><api><bit.ly>","1","0","","",""
"2543059","1","","","2010-03-30 05:34:26","19","26714","<p>I tried several things to try to get the camera preview to show up in portrait on a <code>SurfaceView</code>.  Nothing worked.  I am testing on a Droid that has 2.0.1.  I tried:</p><p>1) forcing the layout to be portrait by: <code>this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);</code></p><p>2) using</p><pre><code>Camera.Parameters parameters = camera.getParameters();parameters.set(""orientation"", ""portrait"");parameters.setRotation(90);camera.setParameters(parameters);</code></pre><p>Is there something else I can try?  If this a bug in Android or the phone how can I make sure that this is the case so that I have proof to inform the client?</p><p>Thanks,Prasanna</p>","304814","","840566","","2013-01-11 13:15:11","2013-01-11 13:15:11","Android Camera in Portrait on SurfaceView","<android>","6","1","3","",""
"2543079","1","2543738","","2010-03-30 05:42:16","0","515","<p>I am making an application which is currently working perfectly but with only 1 problem...As we all know that the activity is destroyed and recreated when user changes the orientation of the phone... my activity needs to save a vector full of objects wen the activity is recreated... i checked the OnSaveInstance() method and found that there is no way a vector can be stored... Does any1 have a suggestion for storing vector so that i can retrieve it on recreation of Activity???</p><p>Any help will be appreciated...</p><p>Thanx...</p>","238071","","","","","2010-03-30 08:26:19","android saveinstance saving vector datatypes","<android><vector><orientation><savestate>","1","0","","",""
"2543242","1","","","2010-03-30 06:32:33","3","5506","<p>Could someone help me in</p><p>1.Is this possible to play video from YouTube on emulator using YouTube video link (like:<a href=""http://www.youtube.com/watch?v=T1Wgp3mLa_E"" rel=""nofollow"">http://www.youtube.com/watch?v=T1Wgp3mLa_E</a>) ? If not, then why? 2.If yes then how ?</p><p>I tried to play YouTube video using VideoView but got</p><p><code>""Command PLAYER_INIT completed with an error or info PVMFErrCorrupt""</code> message through logcat command.</p>","301444","","603744","","2011-06-28 06:53:17","2013-08-18 11:47:32","android: How to play YouTube video on emulator","<android><android-video-player>","1","4","","",""
"2543334","1","","","2010-03-30 06:55:41","1","63","<p>I have a widget which mainly used to display date and month. However, after a few day the widget stop updating itself and must be replace in order for it to work again. Since I can't test its behavior in the emulator, I'd like to know if there's a best way to keep my application log separately and have it available to take a look later?</p><p>Also is it possible to updating the widget based on the system time. Right now I updated my widget every minute. But since its only displaying date and day, I just want to know if it's possible to trigger some event when the day changes?</p>","271736","","","","","2010-03-30 06:55:41","What's the best way to log an on going widget in handset?","<android><android-widget>","0","4","","",""
"2543336","1","3166634","","2010-03-30 06:56:03","6","10170","<p>I don't know what I did but for a period of time my TabWidget had white colored tabs which looked really nice. I never set a theme or background/foreground color in my project at all. The next time I compiled it it reverted back to the gray tabs. My application is using the default dark theme. Even if I set the application theme to light, the tabs are still gray. So obviously it was something else that changed the tabs' color. Anyone know how to do this?</p>","274972","","","","","2013-11-01 13:30:43","TabWidget white foreground color?","<android><colors><tabs><themes><tabwidget>","4","3","5","",""
"2543466","1","2545107","","2010-03-30 07:26:44","1","864","<p>i am having this problem with the android database. I adopted the DBAdapter file the NotepadAdv3 example from the google android page.</p><p>DBAdapter.java </p><pre><code>public class DBAdapter {private static final String TAG = ""DBAdapter"";private static final String DATABASE_NAME = ""PasswordDb"";private static final String DATABASE_TABLE = ""myuserdata"";private static final String DATABASE_USERKEY = ""myuserkey"";private static final int DATABASE_VERSION = 2;public static final String KEY_USERKEY = ""userkey"";public static final String KEY_TITLE = ""title"";public static final String KEY_DATA = ""data"";public static final String KEY_ROWID = ""_id"";private final Context mContext;private DatabaseHelper mDbHelper;private SQLiteDatabase mDb;private static final String DB_CREATE_KEY =    ""create table "" + DATABASE_USERKEY    + "" (""    + ""userkey text not null""    +"");"";private static final String DB_CREATE_DATA =    ""create table "" + DATABASE_TABLE    + "" (""    + ""_id integer primary key autoincrement, ""    + ""title text not null""    + ""data text""    +"");"";private static class DatabaseHelper extends SQLiteOpenHelper {    DatabaseHelper(Context context)     {        super(context, DATABASE_NAME, null, DATABASE_VERSION);    }    @Override        public void onCreate(SQLiteDatabase db)     {        db.execSQL(DB_CREATE_KEY);        db.execSQL(DB_CREATE_DATA);    }    @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion,         int newVersion)     {        Log.w(TAG, ""Upgrading database from version "" + oldVersion             + "" to ""            + newVersion + "", which will destroy all old data"");        db.execSQL(""DROP TABLE IF EXISTS myuserkey"");        db.execSQL(""DROP TABLE IF EXISTS myuserdata"");                    onCreate(db);    }}public DBAdapter(Context ctx){    this.mContext = ctx;}public DBAdapter Open() throws SQLException{        try {        mDbHelper = new DatabaseHelper(mContext);     }    catch(Exception e){        Log.e(TAG, e.toString());    }    mDb = mDbHelper.getWritableDatabase();    return this;}public void close(){    mDbHelper.close();}public Long storeKey(String userKey){    ContentValues initialValues = new ContentValues();    initialValues.put(KEY_USERKEY, userKey);    try {        mDb.delete(DATABASE_USERKEY, ""1=1"", null);    }    catch(Exception e)    {        Log.e(TAG, e.toString());    }    return mDb.insert(DATABASE_USERKEY, null, initialValues);}public String retrieveKey() {       final Cursor c;    try {        c = mDb.query(DATABASE_USERKEY, new String[] {            KEY_USERKEY},                 null,                 null,                 null,                 null,                 null);    }catch(Exception e){        Log.e(TAG, e.toString());        return """";    }    if(c.moveToFirst()){        return c.getString(0);    }    else{        Log.d(TAG, ""UserKey Empty"");    }    return """";}//not including any function related to ""myuserdata"" table</code></pre><p>}</p><p>Class1.java  </p><pre><code>{mUserKey = mDbHelper.retrieveKey();mDbHelper.storeKey(Key);</code></pre><p>}</p><p>the error that i am receiving is from Log.e(TAG, e.toString()) in the methods retrieveKey() and storeKey()</p><blockquote>  <p>""no such table: myuserkey: , while compiling: SELECT userkey FROM myuserkey""</p></blockquote>","177303","","177303","","2010-03-30 08:39:51","2010-03-30 12:30:36","Android: database reading problem throws exception","<database><android><sqlite>","2","2","","",""
"2543497","1","2543548","","2010-03-30 07:32:49","0","795","<p>I have some things in my app that I need to store, in order to have it available the next time I open the application. I wonder if I could save them using the sharedPreferences mechanism even if I don't have any ""view"" associated with them  ! .If this is possible please let me know, if not, what would you suggest instead ? </p>","304866","","","","","2013-07-10 13:03:16","Store in sharedPreferences","<android>","1","0","","",""
"2543633","1","2543906","","2010-03-30 08:03:12","2","568","<p>How can i have slide downeffect? The effect will be similar with search function on google map of android. When we click the search option from option menu, the softkeyboard will slide up and the search bar will slide down automatically. </p><p>Anyone provide any hint or any tutorial about this, or proper keyword i can search</p>","304881","","304881","","2010-03-30 09:59:48","2010-03-30 09:59:48","slide downeffect the View problem android","<android>","1","0","0","",""
"2543884","1","2543944","","2010-03-30 08:48:34","0","12355","<p>Actually my code is:</p><pre><code>   LinearLayout ll = new LinearLayout(this);    ll.setId(i);    ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));    ll.setPadding(0, 0, 0, 5);    //ll.setClickable(false);    TextView tv = new TextView(this);                       tv.setWidth(5);    tv.setId(++i);    tv.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));    final TextView name = new TextView(this);    name.setText(user_chat.get(j).toString());     name.setWidth(60);    name.setId(++i);    //name.setClickable(false);       name.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));    Log.v(""TextView name"",""""+name.getText());    TextView msg = new TextView(this);    msg.setText(user_chat.get(++j).toString());                     msg.setWidth(100);    msg.setId(++i);    //msg.setClickable(false);            msg.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));    TextView time= new TextView(this);    time.setText(user_chat.get(++j).toString());        time.setId(++i);    //time.setClickable(false);            time.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));    ll.addView(tv);    ll.addView(name);    ll.addView(msg);    ll.addView(time);                       lay.addView(ll);</code></pre><p>In this name,msg,time text fields I am displyed.I want name msg and time in proper order I mean same line. But the width is not adjusted to both android and droid. What can I do?Thanks in advance</p>","454808","","1945651","","2013-01-25 12:53:58","2013-01-25 12:53:58","setwidth of a dynamic textview","<android>","2","0","1","",""
"2544063","1","2545448","","2010-03-30 09:24:13","0","1465","<p>Sorry, this's my first time to ask a question here. So, I don't have the permission to upload the image to describe. Never Mind. What I would like to make is a row of ListView like this. The block on the left is an icon. </p><p>Much appreciated if you could feedback the correct XML tags. Thanks.</p><p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>-------<br>|  |          some text     some text<br>|  |          some text     some text<br>-------<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br></p>","298752","","","","","2010-03-30 13:18:36","How to make a row of ListView like this?","<android><listview><layout>","2","2","","",""
"2544097","1","2544491","","2010-03-30 09:30:24","2","3092","<p>I have a code that sets a new repeating alarm (on production I'll use a inexactRepeating), but the BroadCastReceiver I've registered for handling it is not being called.</p><p>Here is the code where I set the alarm:</p><pre><code>newAlarmPeriod = 5000; // For debuggingIntent alarmIntent = new Intent(this, GroupsCheckAlarmReceiver.class);PendingIntent sender = PendingIntent.getBroadcast(this, Constants.CHECK_ALARM_CODE,                                                  alarmIntent, 0);AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()                 + newAlarmPeriod, newAlarmPeriod, sender);</code></pre><p>It seems to work and it triggers and alarm every five seconds, as seen in the output of ""adb shell dumpsys alarm"":</p><pre><code>DUMP OF SERVICE alarm:Current Alarm Manager state:  Realtime wakeup (now=1269941046923):  RTC_WAKEUP #1: Alarm{43cbac58 type 0 android}    type=0 when=1269997200000 repeatInterval=0 count=0    operation=PendingIntent{43bb1738: PendingIntentRecord{43bb1248 android broadcastIntent}}  RTC_WAKEUP #0: Alarm{43ce30e0 type 0 com.almarsoft.GroundhogReader}    type=0 when=1269941049555 repeatInterval=5000 count=1    operation=PendingIntent{43d990c8: PendingIntentRecord{43d49108 com.almarsoft.GroundhogReader broadcastIntent}}  RTC #1: Alarm{43bfc250 type 1 android}    type=1 when=1269993600000 repeatInterval=0 count=0    operation=PendingIntent{43c5a618: PendingIntentRecord{43c4f048 android broadcastIntent}}  RTC #0: Alarm{43d67dd8 type 1 android}    type=1 when=1269941100000 repeatInterval=0 count=0    operation=PendingIntent{43c4e0f0: PendingIntentRecord{43c4f6c8 android broadcastIntent}}  Broadcast ref count: 0  Alarm Stats:  android    24390ms running, 0 wakeups    80 alarms: act=android.intent.action.TIME_TICK flg=0x40000004  com.almarsoft.GroundhogReader    26ms running, 2 wakeups    2 alarms: flg=0x4 cmp=com.almarsoft.GroundhogReader/.GroupsCheckAlarmReceiver</code></pre><p>But for some reason my BroadCastReceiver is not being called when the alarm is triggered. I've declared it on the Manifest:</p><pre><code>&lt;receiver android:name="".GroupsCheckAlarmReceiver"" /&gt;</code></pre><p>And this is the abbreviated code:</p><pre><code>public class GroupsCheckAlarmReceiver extends BroadcastReceiver{  @Override  public void onReceive(Context context, Intent intent) {     Toast.makeText(context, ""XXX Alarm worked."", Toast.LENGTH_LONG).show();     Log.d(""XXX"", ""GroupsCheckAlarmReceiver.onReceive"");  }</code></pre>","150404","","","","","2010-03-30 10:49:57","BroadcastReceiver not receiving an alarm's broadcast","<android>","2","0","1","",""
"2544141","1","","","2010-03-30 09:36:59","6","12590","<p>I have generated an HTML code(complete with <code>&lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;</code> tags) as a String. Now I want to send this HTML code as HTML to mail. My code is as below.</p><pre><code>Intent intent = new Intent(Intent.ACTION_SEND);intent.setType(""text/html"");intent.putExtra(Intent.EXTRA_EMAIL, new String[]{""me@mydomain.com""});intent.putExtra(Intent.EXTRA_SUBJECT, ""I would like to buy the following"");intent.putExtra(Intent.EXTRA_TEXT, purchaseOrder());startActivity(Intent.createChooser(intent, ""sending mail""));</code></pre><p>Where the <code>purchaseOrder()</code> is the method which passes me the string having full HTML code. But though the GMail client opens on my Nexus1 but it has the String with all HTML tags and not the actual HTML view. I tried the following but got error. The GMail crashed.</p><pre><code>intent.putExtra(Intent.EXTRA_STREAM, purchaseOrder());</code></pre>","238071","","1288","","2013-03-01 13:33:42","2013-03-01 13:33:42","Send HTML mail using Android intent","<html><android><email><android-intent>","4","2","4","",""
"2544214","1","2545829","","2010-03-30 09:49:45","3","5025","<p>I want to know if it is possible to call an activity through background service in android like :</p><pre><code>import android.app.Service;import android.content.Intent;import android.content.SharedPreferences;import android.media.MediaPlayer;import android.os.Handler;import android.os.IBinder;import android.os.Message;public class background extends Service{ private int timer1; @Override public void onCreate() {  // TODO Auto-generated method stub  super.onCreate();  SharedPreferences preferences = getSharedPreferences(""SaveTime"", MODE_PRIVATE);  timer1 = preferences.getInt(""time"", 0);  startservice(); } @Override public IBinder onBind(Intent arg0) {  // TODO Auto-generated method stub  return null; } private void startservice() {  Handler handler = new Handler();  handler.postDelayed(new Runnable(){   public void run() {    mediaPlayerPlay.sendEmptyMessage(0);   }  }, timer1*60*1000); } private Handler mediaPlayerPlay = new Handler(){  @Override  public void handleMessage(Message msg) {   try   {    getApplication();    MediaPlayer mp = new MediaPlayer();    mp = MediaPlayer.create(background.this, R.raw.alarm);    mp.start();   }   catch(Exception e)   {    e.printStackTrace();   }   super.handleMessage(msg);  } }; /*  * (non-Javadoc)  *   * @see android.app.Service#onDestroy()  */ @Override public void onDestroy() {  // TODO Auto-generated method stub  super.onDestroy(); }}</code></pre><p>i want to call my activity...... </p>","304961","","114066","","2010-03-30 10:13:10","2012-05-15 17:35:54","How can we call an activity through service in android?","<android>","2","1","3","",""
"2544291","1","2544593","","2010-03-30 10:03:43","2","5865","<p>I have an activity that launches another activity with <code>startActivityForResult</code> method. I would like to terminate the called one programmatically but I don't know how to do this since in <code>onActivityResult()</code> method I have no information about the called activity and I cannot call <code>finish()</code> on it. How can I achieve this?</p><p>Thanks</p>","269585","","","","","2010-04-15 14:03:07","Finish sub activities programmatically","<android><activity>","4","0","","",""
"2544295","1","","","2010-03-30 10:04:44","0","1077","<p>What's the procedure to run Facebook Connect application in android? Here is the link:<a href=""http://code.google.com/p/fbconnect-android/"" rel=""nofollow"">http://code.google.com/p/fbconnect-android/</a></p><p>Please explain step by step. I'm having errors in my manifest file:</p><pre><code>&lt;activity android:name=""com.codecarpet.fbconnect.FBLoginActivity""            android:theme=""@android:style/Theme.Translucent.NoTitleBar""/&gt;        &lt;activity android:name=""com.codecarpet.fbconnect.FBPermissionActivity""            android:theme=""@android:style/Theme.Translucent.NoTitleBar""/&gt;        &lt;activity android:name=""com.codecarpet.fbconnect.FBFeedActivity""            android:theme=""@android:style/Theme.Translucent.NoTitleBar""/&gt;</code></pre>","2355649","","234938","","2010-04-01 17:43:37","2010-04-01 18:35:11","How can i integrate Facebook api in any android application?","<android><facebook>","1","1","","",""
"2544365","1","2549365","","2010-03-30 10:15:44","5","47438","<p>I'm having great difficulty getting my Android application to play videos from the SD card. It doesn't matter what size, bitrate, video format, or any other setting I can think of, neither the emulator nor my G1 will play anything I try to encode. I've also tried a number of videos from the web (various video formats, bitrates, with and without audio tracks, etc.), and none of those work either.</p><p>All I keep getting is a dialog box that says: </p><p>""Cannot play video""</p><p>""Sorry, this video cannot be played.""</p><p>There are errors reported in LogCat, but I don't understand them and I've tried searching the Internet for further explanations without any luck. See below:</p><pre><code>03-30 05:34:26.807: ERROR/QCOmxcore(51): OMXCORE API :  Free Handle 390d403-30 05:34:26.817: ERROR/QCOmxcore(51):  Unloading the dynamic library for OMX.qcom.video.decoder.avc03-30 05:34:26.817: ERROR/PlayerDriver(51): Command PLAYER_PREPARE completed with an error or info PVMFErrNoResources03-30 05:34:26.857: ERROR/MediaPlayer(14744): error (1, -15)03-30 05:34:26.867: ERROR/MediaPlayer(14744): Error (1,-15)</code></pre><p>Sometimes I also get this:</p><pre><code>03-30 05:49:49.267: ERROR/PlayerDriver(51): Command PLAYER_INIT completed with an error or info PVMFErrResource03-30 05:49:49.267: ERROR/MediaPlayer(19049): error (1, -17)03-30 05:49:49.347: ERROR/MediaPlayer(19049): Error (1,-17)</code></pre><p>Here is the code I'm using (in my onCreate() method):</p><pre><code>this.setContentView(R.layout.main);//just a simple VideoView loading files from the SD cardVideoView myIntroView = (VideoView) this.findViewById(R.id.VideoView01);MediaController mc = new MediaController(this);myIntroView.setMediaController(mc);myIntroView.setVideoPath(""/sdcard/test.mp4"");myIntroView.requestFocus();myIntroView.start();</code></pre><p>Please help!</p>","272302","","","","","2010-03-30 23:17:22","Android -- Can't play any videos (mp4/mov/3gp/etc.)?","<android><video><videoview>","3","0","6","",""
"2544517","1","2563558","","2010-03-30 10:47:03","6","21794","<p>I need to upload an image to a remote PHP server which expects the following parameters in HTTPPOST: </p><pre><code>*$_POST['title']**$_POST['caption']**$_FILES['fileatt']*</code></pre><p>Most of the internet searches suggested either :  </p><p><strong>Download the following classes and trying MultiPartEntity to send the request:</strong></p><pre><code>apache-mime4j-0.5.jarhttpclient-4.0-beta2.jarhttpcore-4.0-beta3.jarhttpmime-4.0-beta2.jar</code></pre><p>OR  </p><p><strong>Use URLconnection and handle multipart data myself.</strong></p><p>Btw, I am keen on using HttpClient class rather than java.net(or is it android.net) classes. Eventually, I downloaded the Multipart classes from the Android source code and used them in my project instead.</p><p>Though this can be done by any of the above mentioned methods, I'd like to make sure if these are the only ways to achieve the said objective. I skimmed through the documentation and found a <code>FileEntity</code> class but I could not get it to work.</p><p>What is the correct way to get this done in an Android application?</p><p>Thanks.</p>","236128","","","","","2012-07-03 09:51:12","Uploading images to a PHP server from Android","<android><file-upload><httpclient>","3","1","6","",""
"2544988","1","2545146","","2010-03-30 12:16:57","0","654","<p>Seeking help to design a layout as shown here:</p><p><a href=""http://docs.google.com/Doc?docid=0AQhgDtGvE2HgZGZ6cmtua185MTd0eGdyZmc&amp;hl=en"" rel=""nofollow"">http://docs.google.com/Doc?docid=0AQhgDtGvE2HgZGZ6cmtua185MTd0eGdyZmc&amp;hl=en</a></p><p>The major challenge I face is aligning the components at desired positions. Please refer the three buttons(icons) and the way they are positioned.</p><p>Literally, going nuts, thinking how to position those exactly at the desired places. </p><p>Any help is much appreciated.</p><p>Regards,Rony</p>","305067","","","","","2010-04-12 12:50:27","Aligning components at desired positions","<android>","1","1","1","",""
"2545003","1","2545552","","2010-03-30 12:19:37","0","504","<p>I have displayed the map in my app by using the following code. I have retrieved info from the database and displayed the map. Now i want to add marker to the retrieved location...</p><p><strong>googleMao.java</strong></p><pre><code>public class googleMap extends MapActivity{    private MapView mapView;       private MapController mc;       GeoPoint p;       long s;       Cursor cur;       SQLiteDatabase db;        createSqliteHelper csh;        String qurry;     @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.map);            // String qurry=getIntent().getStringExtra(""value"");            //here is calling the map string qurry            s = getIntent().getLongExtra(""value"",2);            map();            mapView = (MapView) findViewById(R.id.mapview1);                   LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);              View zoomView = mapView.getZoomControls();             zoomLayout.addView(zoomView,                 new LinearLayout.LayoutParams(                    LayoutParams.WRAP_CONTENT,                     LayoutParams.WRAP_CONTENT));             //mapView.displayZoomControls(true);           mapView.setBuiltInZoomControls(true);            mc = mapView.getController();            String coordinates[] = {""1.352566007"", ""103.78921587""};            double lat = Double.parseDouble(coordinates[0]);            double lng = Double.parseDouble(coordinates[1]);            Geocoder geoCoder = new Geocoder(this, Locale.getDefault());                try {                List&lt;Address&gt; addresses = geoCoder.getFromLocationName(qurry,5);                String add = """";                if (addresses.size() &gt; 0) {                    p = new GeoPoint(                            (int) (addresses.get(0).getLatitude() * 1E6),                             (int) (addresses.get(0).getLongitude() * 1E6));                    mc.animateTo(p);                        mapView.invalidate();                    mc.setZoom(6);                }                } catch (IOException e) {                e.printStackTrace();            }        }       @Override       protected boolean isRouteDisplayed() {          // Required by MapActivity          return false;       }       public void map()       {           String[] str={""type""};           int[] i={R.id.type};           csh=new createSqliteHelper(this);           db=csh.getReadableDatabase();           cur=db.rawQuery(""select type from restaurants where _id=""+s,null);           if(cur.moveToFirst())           {              qurry=cur.getString(cur.getColumnIndex(""type""));           }       }}</code></pre>","303155","","243782","","2010-03-30 12:31:47","2010-03-30 13:31:54","Adding marker to the retrieved location","<android>","1","0","","",""
"2545148","1","2545568","","2010-03-30 12:34:49","21","4058","<p>I usually tend to define the model layer of my apps using POJO's, such as Article, Comment, etc.</p><p>I was about to implement an AlphabetIndexer in the adapter of one of my ListViews. Right now this adapter accepts a Collection of Articles, which I normally get from my wrapper around an SQLiteDatabase.</p><p>The signature of the AlphabetIndexer constructer is as follows:</p><pre><code>public AlphabetIndexer (Cursor cursor, int sortedColumnIndex, CharSequence alphabet)</code></pre><p>Since this doesn't accept a Collection or something similar, just a Cursor, it got me wondering: maybe I shouldn't be creating objects for my model, and just use the Cursors returned from the database?</p><p>So the <strong>question</strong> is, I guess: what should I do, represent data with Collections of POJO's, or just work with Cursors throughout my app?</p><p>Any input?</p>","279363","","","","","2014-04-02 22:50:09","POJO's versus Cursors in Android","<android><cursor><pojo>","4","2","10","",""
"2545187","1","2545599","","2010-03-30 12:41:07","7","1956","<p>I'm developing an app that checks several conditions during an incoming phone call. The main parts of the app are a BroadcastReceiver listening for Intents related to the phone's status and a local Service checking the conditions.</p><p>At the moment the service is started each time an incoming call is detected and is stopped when the phone status changed back to idle.</p><p>Now I'm wondering if this procedure is correct and whether it is reasonable to start and stop the service related to the phone's status. Or would it be better to let the service run regardless of the phone's status and bind/unbind to/from it when needed.</p><p>Are there any performance issues I would have to think about? Perhaps it is more expensive to start/stop a service than letting it run and communicate with it. Are there any best practices out there regarding the implementation of services?</p>","19601","","","","","2010-03-30 13:37:01","Android: Is it better to start and stop a service each time it is needed or to let a service run and bind to and unbind form it?","<android><service>","1","0","2","",""
"2545558","1","3266882","","2010-03-30 13:32:12","48","30840","<p>I have two tables: tracks and waypoints, a track can have many waypoints, but a waypoint is assigned to only 1 track. </p><p>In the way points table I have a column called ""trackidfk"" which inserts the track_ID once a track is made, however I have not setup Foreign Key constraints on this column.</p><p>When I delete a track I want to delete the assigned waypoints, is this possible?. I read about using Triggers but I don't think they are supported in Android.</p><p>To create the waypoints table:</p><pre><code>public void onCreate(SQLiteDatabase db) {    db.execSQL( ""CREATE TABLE "" + TABLE_NAME                 + "" (""                 + _ID         + "" INTEGER PRIMARY KEY AUTOINCREMENT, ""                 + LONGITUDE   + "" INTEGER,""                 + LATITUDE    + "" INTEGER,""                 + TIME        + "" INTEGER,""
                + TRACK_ID_FK + "" INTEGER""                + "" );""              );    ...}</code></pre>","296810","","641752","","2014-03-23 06:08:39","2014-03-23 06:08:39","Foreign key constraints in Android using SQLite? on Delete cascade","<java><android><sqlite><foreign-keys>","7","0","43","",""
"2545706","1","2546102","","2010-03-30 13:51:33","1","595","<p>I would like to know how to start and code a thread manager for my Android App.My app is going to fill a list with a network I/O and I have to manage threads for that.</p><p>I never done this before and I don't know where to start. I heard about Thread Pool and other stuff, but I'm quite confused. Could someone please help me make my way through ?</p><p>Thanks</p>","162178","","","","","2010-03-30 14:44:44","How do I create a Thread Manager for an Android App?","<java><android><multithreading>","2","0","","",""
"2545834","1","","","2010-03-30 14:08:47","0","569","<p>I'm new to Android and just starting the very basics. I implement my custom button skin using .9.png images for norma/focus/pressed states. It works fine, but I noticed that after a pressed the focussed button it visually ""lost"" focus and draws the normal state frame. I planned to use different state images to highloght what button is selected right now, but it seems that it would not work. I noticed also that the same happens with the default LAF button. Is it OK, or it's just emulator issue? What the good workaroud can be used?</p><p>Thanks</p>","305169","","","","","2010-11-08 13:45:12","Button draws normal state after pressing","<android>","2","0","","",""
"2546070","1","2546208","","2010-03-30 14:40:22","1","438","<p>I need to use a different datasource inside a map in Android than the google provided data. Is there a way to change the datasource to a tile based service (openstreetmap.org for example)?</p><p>Or are there other Android map APIs which are OpenSource and can be adapted (except Ericcson Mobile Maps - this doesn't work for me because of the licence)?It doesent have to have a server side part - a rich function library would be enough.</p>","288980","","","","","2010-07-07 21:47:30","Is there a way to change the map data for the Android Google Map API?","<java><android><api><google-maps><map>","3","0","1","",""
"2546175","1","3590161","","2010-03-30 14:53:45","4","6388","<p>I started developing with Titanium and now I really stuck on one part.I downloaded the Adroid SDK and added the path to Titanium:</p><p>/Users/michael/Downloads/android-sdk-mac_86/</p><p>I can open e.g. Kitchen Sink in the iPhone Simulator without problems, but when I want to open it in Android then my screen looks like this: <a href=""http://img526.imageshack.us/i/bildschirmfoto20100330u.png/"" rel=""nofollow"">Screenshot</a></p><p>Why is down there all the time, even after 2 hours of waiting, the label ""loading..."" ?</p>","269641","","269641","","2010-03-30 15:13:20","2011-08-17 11:33:28","Appcelerator Titanium: Android SDK doesn't load","<iphone><android><titanium><appcelerator>","6","0","1","",""
"2546193","1","","","2010-03-30 14:55:34","10","2973","<p>I would like to load a cropped version of a bitmap image into a Bitmap object, without loading the original bitmap as well.</p><p>Is this at all possible without writing custom loading routines to handle the raw data?</p><p>Thanks,Sandor</p>","305221","","","","","2014-01-05 08:57:47","Loading only part of a bitmap file in Android","<android><performance><graphics>","4","0","4","",""
"2546300","1","","","2010-03-30 15:09:37","0","3510","<p>I always get an ClassCastException error... i do not what else to do...- I'm using a data biding concept to populated the listview from a sqlite3 database.- I just want to get the selected item text after a long press click.</p><p>This is the code of the activity:</p><pre><code>public class ItemConsultaGastos extends ListActivity  { private DataHelper dh ; TextView seleccion; private static String[] FROM = {DataHelper.MES, DataHelper.ANO};   private static int[] TO =  {R.id.columnaMes, R.id.columnaAno };     public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.muestrafechas);        this.dh = new DataHelper(this);        Cursor cursor = dh.selectAllMeses();                    startManagingCursor(cursor);        this.mostrarFechas(cursor);        ListView lv = getListView();        lv.setOnItemLongClickListener(new OnItemLongClickListener(){         @Override         public boolean onItemLongClick(AdapterView&lt;?&gt; arg0, View arg1,int row, long arg3) {            //here is where i got the classCastException.            String[] tmp = (String[]) arg0.getItemAtPosition(row);            //tmp[0] ist the Text of the first TextView displayed by the  clicked ListItem             Log.w(""Gastos: "", ""El texto: "" + tmp[0].toString());            return true;         }     }); } private void mostrarFechas(Cursor cursor) {       SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,R.layout.muestrafechasitem,cursor, FROM, TO);       setListAdapter(adapter); }}</code></pre><p>This is the xml where a define the rows to show on the listview:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""horizontal""    android:padding=""10sp""&gt;       &lt;TextView     android:id=""@+id/espacio""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""    "" /&gt;       &lt;TextView       android:id=""@+id/columnaAno""       android:layout_width=""wrap_content""       android:layout_height=""wrap_content""       android:textSize=""20sp""        android:layout_toRightOf=""@+id/espacio""/&gt;       &lt;TextView     android:id=""@+id/separador1""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""            --             ""     android:layout_toRightOf=""@+id/columnaAno""     android:textSize=""20sp"" /&gt;       &lt;TextView       android:id=""@+id/columnaMes""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:layout_toRightOf=""@+id/separador1""        android:textSize=""20sp""/&gt; &lt;/RelativeLayout&gt;</code></pre>","305234","","13070","","2010-03-30 15:30:00","2010-03-30 15:38:17","I can not get the text from a selected item in a listview...pleeeeasss help","<android><listview>","1","0","","",""
"2546382","1","2546598","","2010-03-30 15:18:33","3","1230","<p>I 'd like to know how to obtain to heading , pitch , roll angles that determine the position of an android device, if that is possible . Don't consider the device dependent details . References to helpful documentation are also valuable .Thanks !</p>","284609","","","","","2010-03-30 16:33:16","heading , roll , pitch","<android>","1","0","1","",""
"2546510","1","2546539","","2010-03-30 15:34:47","0","574","<p>Let's say I have array of bytes:</p><pre>byte[] arr = new byte[] { 0, 1, 2, 3, 4 };</pre><p>Does platform has functions that I can use to play with this array - for example, how to invert it (get 4,3,2,1,0)? Or, how to invert part of it (2,1,0,3,4)? Get part of array (0,1,2,3)?</p><p>I know I can manually write functions but I am curious if I'm missing useful util functions in platform that I should know about (and couldn't find any useful guide using google).</p><p>Thanks!</p>","237858","","","","","2010-03-30 15:48:37","byte[] operations in Java","<java><android>","3","0","","",""
"2546947","1","2546971","","2010-03-30 16:41:42","0","284","<p>i want to display a msg to the user (msg box or Toast) when exception happend in a static SQLite Database class that i use.</p><p>the problem is that i cant call a non static method in a static class , how can i handle this. </p><p>this is the class </p><pre><code>private static SQLiteDatabase getDatabase(Context aContext) {</code></pre><p>and i want to add something like this in the class when exception happen but <code>context</code> generates the problem of reference to non static in static class. </p><pre><code>Context context = getApplicationContext();CharSequence text = ""Hello toast!"";int duration = Toast.LENGTH_SHORT;Toast toast = Toast.makeText(context, text, duration);toast.show();</code></pre>","302707","","18071","","2010-03-30 16:49:30","2010-03-30 16:49:30","Call a non static methode in a static SQLiteDatabase class","<java><android><exception-handling>","1","0","1","",""
"2546986","1","2548293","","2010-03-30 16:46:49","0","1062","<p>Im new to droid programming and i got a simple retrieve image from url working but confused on how to make it so i can load multiple images from my webpages url. Someone informed me change the drawable to string but not sure 100% how to do so here is most of my code so far:</p><pre><code>public class Gallery extends Activity {/** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);       setContentView(R.layout.main);        ImageView imgView =(ImageView)findViewById(R.id.ImageView01);        Drawable drawable = LoadImageFromWebOperations(""http://www.mandarichmodels.com/hot-pics/4.jpg"", ""http://www.mandarichmodels.com/hot-pics/5.jpg"");    imgView.setImageDrawable(drawable);}   private Drawable LoadImageFromWebOperations(String url, String string) {      try        {            InputStream is = (InputStream) new URL(url).getContent();            Drawable d = Drawable.createFromStream(is, ""src name"");            return d;        }catch (Exception e) {            System.out.println(""Exc=""+e);            return null;        }    }}</code></pre>","305307","","","","","2010-03-30 20:03:24","How do i make multiple url links show in array?","<android><arrays><drawable><url-link>","1","0","","",""
"2547100","1","","","2010-03-30 17:04:30","3","2707","<p>When I create a subfolder in the layout folder, and drag an xml file to it, the generated R file doesn't seem to show the subfolder. a) is there a way to change that b) is the file and file structure still picked up by SVN and c) so, if I do it that way, can I still just refer to the object using layout?</p>","215883","","","","","2010-03-30 17:13:53","Can you add subfolder to layout in Eclipse Android project?","<android><eclipse><layout><resources>","2","2","","",""
"2547282","1","2547440","","2010-03-30 17:37:24","1","4415","<p>From Android widget screen guidelines, <a href=""http://developer.android.com/guide/practices/ui_guidelines/widget_design.html"" rel=""nofollow"">http://developer.android.com/guide/practices/ui_guidelines/widget_design.html</a>, we know that, home screen has 4*4 cells, and in portrait orientation, each cell is 80 pixels wide by 100 pixels tall. </p><p>I think these are for baseline HVGA screen. How about for large screens and hdpi screens, do they still have 4*4 cells for widget and each cell in portrait orientation is still 80 pixels * 100 pixels?</p><p>Thanks.</p>","256239","","","","","2010-10-18 09:49:17","Home screen widget size for large screen or hdpi?","<android>","2","0","2","",""
"2547508","1","2547743","","2010-03-30 18:12:55","1","1532","<p>I'm trying to start unit testing on my application (should have done so from the beginning). I've got an Eclipse project structure set up and everything seems to work well, but...</p><p>I'm subclassing <code>SQLiteOpenHelper</code> to access the application database. This works well for the application, but when using the same class in the unit tests, it <em>writes to the same database as the actual application</em>. This is obviously rather irritating, since unit test data shows up when developing and testing the actual application.</p><p>What's the best way to make the <code>SQLiteOpenHelper</code> class write to a different database file when being called from the unit tests?</p>","235960","","","","","2012-08-20 14:22:36","Android unit testing & using a different database file","<android><unit-testing><tdd>","3","0","1","",""
"2547565","1","2549787","","2010-03-30 18:22:07","3","1324","<p>I have an application built for 1.5 and I am adding higher resolution drawables to support hdpi devices in 1.6 and above.</p><p>My original application icon is 48x48.  I created a second launcher icon that is 72x72 and placed it in a res/drawable-hdpi/ directory.  </p><p>When I install the application on my Nexus One the icon looks good when I view it in the application menu.  But when I place it on the desktop it appears small relative to other icons, my guess is I'm seeing the 48x48 version with no scaling.</p><p>These are my two resource directories:</p><p>res/drawable/appicon.pngres/drawable-hdpi/appicon.png</p><p>Do I need to do something differently either with my directory structure or my manifest file to get things to display correctly?</p><p>Thanks!</p>","233202","","","","","2010-03-31 01:09:31","Why is my launcher icon smaller when placed on the Android desktop?","<android>","2","0","1","",""
"2547802","1","","","2010-03-30 18:51:14","0","446","<p>Is it possible to hilight part of a text and copy in Android?<br>It's kinda like how in iPhone, when you hold a text for sometime, the box will show up and you can copy then paste that somewhere?</p>","166940","","1101070","","2012-03-06 01:46:26","2012-03-06 01:46:26","Android - highlight text and copy","<android>","1","0","","",""
"2547900","1","2547936","","2010-03-30 19:03:16","1","163","<p>I have a ListView composed of LinearLayouts. Inside each is an ImageView, TextView and another ImageView laid out horizontally:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    &gt;            &lt;ImageButton                android:id=""@+id/thumbnail""                android:background=""@color/white""                android:paddingTop=""10dip""                android:paddingLeft=""8dip""                android:paddingBottom=""10dip""                /&gt;            &lt;TextView                android:id=""@+id/title""                android:background=""@color/white""                android:textColor=""@color/bntext""                android:paddingTop=""10dip""                android:paddingLeft=""8dip""                /&gt;            &lt;ImageButton                android:src=""@drawable/green_arrow_small""                android:background=""@color/white""                /&gt;&lt;/LinearLayout&gt;</code></pre>","246793","","","","","2010-03-30 19:07:34","Do all widgets in an Android layout file require layout_width and layout_height?","<xml><android><layout>","1","0","","",""
"2548086","1","2548199","","2010-03-30 19:31:45","14","11136","<p>Ive specified white backgrounds for pretty much all widgets and it works, except when scrolling. The background container goes black during scrolling resulting in annoying flickering.</p>","246793","","","","","2013-06-27 17:51:05","My ListView backgrounds go black during scrolling - how to fix?","<android><listview><scrolling><colors>","5","1","5","",""
"2548259","1","2548270","","2010-03-30 19:58:52","5","1107","<p>For Android GUI: I would like to create a window that I can pull up from the bottom of another window, kind of like the Notification bar or the tab in the bottom on Spotify for Android.</p><p>I want to be able to grab a small piece of the window and pull it up. Or just click it and it will ""pop up"". And afterwards be able to pull or click it so it returs to its original space.</p><p>Does anyone know a good way to do this?</p>","270273","","","","","2010-03-30 20:00:08","How do I create a pull-down/up window in Android GUI?","<android><gui><popup><window><pull>","1","0","1","",""
"2548304","1","2548376","","2010-03-30 20:05:05","0","2452","<p>My app shows a list of items, where each line is an item title with its image asides, the line reserves 70% of space for text and 30% for image. Imagine what iphone app store looks like. Which view/layout combo is recommended for this purpose?</p><p>I googled and find this article:</p><p><a href=""http://www.curious-creature.org/2009/02/22/android-layout-tricks-1/"" rel=""nofollow"">http://www.curious-creature.org/2009/02/22/android-layout-tricks-1/</a></p><p>Does this view sound good?</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""?android:attr/listPreferredItemHeight""android:padding=""6dip""&gt;&lt;ImageView    android:id=""@+id/icon""    android:layout_width=""wrap_content""    android:layout_height=""fill_parent""    android:layout_alignParentTop=""true""    android:layout_alignParentBottom=""true""    android:layout_marginRight=""6dip""    android:src=""@drawable/icon"" /&gt;&lt;TextView    android:id=""@+id/secondLine""    android:layout_width=""fill_parent""    android:layout_height=""26dip""     android:layout_toRightOf=""@id/icon""    android:layout_alignParentBottom=""true""    android:layout_alignParentRight=""true""    android:singleLine=""true""    android:ellipsize=""marquee""    android:text=""Simple application that shows how to use RelativeLayout"" /&gt;&lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_toRightOf=""@id/icon""    android:layout_alignParentRight=""true""    android:layout_alignParentTop=""true""    android:layout_above=""@id/secondLine""    android:layout_alignWithParentIfMissing=""true""    android:gravity=""center_vertical""    android:text=""My Application"" /&gt;</code></pre><p></p>","253800","","253800","","2010-03-30 20:30:47","2010-03-31 18:08:55","android: which view should I use for showing text and image?","<android><layout>","2","1","1","",""
"2548466","1","2548570","","2010-03-30 20:29:42","6","4940","<p>I have a layout with an ImageView defined like:</p><pre><code>&lt;ImageView  android:layout_width=""45dip""  android:layout_height=""45dip""  android:scaleType=""fitXY"" /&gt;</code></pre><p>now I just want to set the imageview to be a static color, like red or green. I'm trying:</p><pre><code>ColorDrawable cd = new ColorDrawable(""FF0000"");cd.setAlpha(255);ImageView iv = ...;iv.setImageDrawable(cd);</code></pre><p>the imageview is just empty though, no color. The 45dip space is being used up though. What do I need to do to get the color to be rendered?</p><p>Thanks</p>","246114","","","","","2010-03-30 20:49:53","How to use ColorDrawable with ImageView?","<android>","1","0","1","",""
"2548504","1","2548737","","2010-03-30 20:34:43","3","794","<p>I need to generate a changelog of sorts between two Tags within a project controlled using git, rspecifically the android source code. This list should include any files/directories/etc which have been edited, moved, renamed, deleted, created.</p><p>Any help would be great. and if you have a way to do this over the entire android source at once... even better.</p>","294294","","11343","","2012-08-27 13:41:08","2012-08-27 13:41:08","Create a listing of changed files/directories/etc. using git between two tags","<android><git><diff><changelog>","2","5","2","",""
"2548532","1","","","2010-03-30 20:37:12","2","665","<p>I am looking to extend the Android Gallery view.  How is it possible to sense a change in the selected item?</p><p>I would have thought it could be done by extending one or both of the setSelection methods.  Yet when I do so, and change selection by a tap or swipe or D-pad press, I do not find either of the setSelection methods being called.</p><p>AdapterView has a nested OnItemSelectedListener class, but there seems to be no way to supply my own listener. getOnItemSelectedListener() is declared final, and there is no setOnItemSelectedListener().</p><p>My main reason for wanting to extend Gallery, actually, is to provide some animation as views move into or out of selection.  Any other suggestions on how to accomplish that...?</p>","301787","","199972","","2012-06-12 21:49:32","2012-06-12 21:49:32","How to sense (or animate view on) change of selection in Gallery","<android><android-widget><gallery>","0","0","1","",""
"2548770","1","6743102","","2010-03-30 21:10:10","6","1600","<p>I'm using 3 AutocompleteTextViews to suggest entries from a database.I subclassed AutocompleteTextView to handle setting the default text to null when clicked and setting back to the default instructions if moved away and nothing is entered.</p><p>I was using a SimpleCursorAdapter to bind to the view, but I discovered that there was no way I could get the id of the AutocompleteTextView from an OnItemClickListener, which I needed to put additional information from the selected row in a variable depending on which AutocompleteTextView it was from. All I could access was the AutoCompleteTextView$DropDownListView, which is an undocumented inner class that appears to offer no real functionality. Neither was there a way to go up the view hierarchy to get the original AutocompleteTextView.</p><p>So I subclassed SimpleCursorAdapter and added an int to the constructor to identify which AutocompleteTextView the adapter was from, and I was able to access this from the view passed into OnItemClick(). So, although my solution works fine, I wonder if it is possible to get the id of an AutocompleteTextView from its DropDownListView?</p><p>I am also using another database query which gets the id from the OnItemClick and then looks up the data for that item, because I couldn't find a way of converting more than one column to a string. Should I be using CursorAdapter for this, to save initiating another query? Oh, and another thing, do I need a database cursor initially (all_cursor) when all I'm doing is filtering on it to get a new cursor? Seems like overkill.</p><p>Activity....</p><pre><code>    dbse.openDataBase();    Cursor all_Cursor = dbse.autocomplete_query();    startManagingCursor(all_Cursor);    String[] from_all = new String[]{DbAdapter.KEY_NAME};    int[] to_all = new int[] {android.R.id.text1};    from_adapt = new AutocompleteAdapter(FROM_DBADAPTER, this,android.R.layout.simple_dropdown_item_1line, all_Cursor, from_all, to_all);    from_adapt.setStringConversionColumn(1);    from_adapt.setFilterQueryProvider(this);    to_adapt = new AutocompleteAdapter(TO_DBADAPTER, this,android.R.layout.simple_dropdown_item_1line, all_Cursor, from_all, to_all);    to_adapt.setStringConversionColumn(1);    to_adapt.setFilterQueryProvider(this);   from_auto_complete = (Autocomplete) findViewById(R.id.entry_from);from_auto_complete.setAdapter(from_adapt);from_auto_complete.setOnItemClickListener(this);to_auto_complete = (Autocomplete) findViewById(R.id.entry_to);to_auto_complete.setAdapter(to_adapt);to_auto_complete.setOnItemClickListener(this);public void onItemClick (AdapterView&lt;?&gt; parent, View view, int position, long id) {    Cursor selected_row_cursor = dbse.data_from_id(id);    selected_row_cursor.moveToFirst();    String lat = selected_row_cursor.getString(1);    String lon = selected_row_cursor.getString(2);    int source = ((AutocompleteAdapter) parent.getAdapter()).getSource();</code></pre><p>Autocomplete class:</p><pre><code>public class Autocomplete extends AutoCompleteTextView implements  OnTouchListener,OnFocusChangeListener{String textcontent;Context mycontext = null;int viewid = this.getId();public Autocomplete(Context context, AttributeSet attrs) {super(context, attrs);textcontent = this.getText().toString();mycontext = context;this.setOnFocusChangeListener(this);     this.setOnTouchListener(this);}public boolean onTouch(View v, MotionEvent event) {if (textcontent.equals(mycontext.getString(R.string.from_textbox)) |textcontent.equals(mycontext.getString(R.string.to_textbox)) |textcontent.equals(mycontext.getString(R.string.via_textbox))) {this.setText("""");}return false;}public void onFocusChange(View v, boolean hasFocus) {if (hasFocus == false) {int a = this.getText().length();if (a == 0){if (viewid == R.id.entry_from) {this.setText(R.string.from_textbox);}if (viewid == R.id.entry_to) {this.setText(R.string.to_textbox);}if (viewid == R.id.entry_via) {this.setText(R.string.via_textbox);}}}}}</code></pre><p>Adapter:</p><pre><code>public class AutocompleteAdapter extends SimpleCursorAdapter {int source;public AutocompleteAdapter(int query_source, Context context, int layout, Cursor c,        String[] from, int[] to) {    super(context, layout, c, from, to);    source = query_source;}public int getSource() {    return source;}    }</code></pre><p>sorry that's a lot of code! Thanks for your help.</p><p>Stephen</p>","278638","","","","","2011-07-19 06:29:36","Get information about AutocompleteTextView from resulting AutoCompleteTextView$DropDownListView","<android>","1","0","2","",""
"2548947","1","2548983","","2010-03-30 21:38:23","3","5232","<p>I want to be able to show the elapsed time in a textview or Chronometer held in a ""Statistics"" class since pressing a button located in another class. What would be the easiest way to implement this?.</p><p>Thanks</p>","296810","","","","","2010-06-07 23:28:44","Show elapsed time since pressing a button in Android","<java><android><datetime><button>","2","0","1","",""
"2549268","1","2705073","","2010-03-30 22:51:27","3","1638","<p>I'm wondering if anyone knows of a way to export geometry/textures for a rigged, animated character as Quake MD2? I’m developing an app for mobile devices, and I’ve found that MD2 works great for lightweight OpenGL rendering. I have several animated characters, and I’d like to export them as MD2 from Maya. Here are some of the things I have tried:</p><ol><li><p>Exporting FBX to 3D Studio Max and using the QTip plugin-- this works, but only if I convert my animation to point cache (pc2) and bring that into Max. When I do that, QTip plugin doesn’t honor the point cache node, and all I get is the model, no animation</p></li><li><p>Exporting OBJ Sequence to Blender, exporting MD2 from there-- I can’t seem to get blender to compile the imported obj sequence into a single animated object</p></li><li><p>Exporting FBX to Milkshape-- the maya rig gets corrupted in the process</p></li><li>Bake point cache for animation, export to FBX, import to Milkshape-- again, Milkshape doesn’t honor the geometry cache, so all that appears is a static character.</li></ol><p>I’m currently writing a plugin for Maya using the blender MD2 export script as reference (but re-writing using the C++ Maya API), but I’m just wondering if anyone has done this before or has any suggestions of how to do this.</p><p>Also, if anyone has other suggestions for the best format to render a single animated character on an OpenGL ES (Android or iPhone) device, I would be very grateful! I’m open to trying anything to get these animations rendering on device</p><p>Thanks!</p>","1028144","","","","","2011-08-16 07:56:29","File Translator to Export Animated 3D Character from Autodesk Maya as Quake MD2","<iphone><android><opengl-es><maya><quake>","1","0","2","",""
"2549344","1","2549418","","2010-03-30 23:12:33","0","330","<p>I just wonder whether there will be any conflict if two service intents are sent to the same service at the same time. My code is as below:</p><pre><code>public static class UpdateService extends Service {    @Override    public void onStart(Intent intent, int startId) {        int widgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,                AppWidgetManager.INVALID_APPWIDGET_ID);        UpdateThread updateThread = new UpdateThread();        updateThread.mWidgetId = widgetId;        updateThread.mContext = this;        updateThread.start();        stopSelf();    }}</code></pre><p>Suppose there are two intents, intent 1 and intent 2, for UpdateService at the same time. As I understand, there will be only one UpdateService instance. Then, will the two intents cause the service code to run sequentially like the workflow below?</p><ol><li>UpdateService starts, i.e. onStart() is called, for intent 1.</li><li>UpdateService stops because stopSelf() is called in onStart().</li><li>UpdateService starts, i.e. onStart() is called, for intent 2.</li><li>UpdateService stops because stopSelf() is called in onStart().</li></ol><p>Could the two intents cause the service code, i.e onStart(), to run simultaneously? Do I need to put synchronized in the onStart() method definition?</p><p>Thanks.</p>","256239","","","","","2010-03-30 23:32:41","Could be conflict due to two service intents to the same service?","<android>","1","0","","",""
"2549360","1","2549505","","2010-03-30 23:16:32","0","495","<p>I'm trying to make an <code>ActivityGroup</code> which has it's own interface, which should be persistent between Activities. </p><p>I have it working for my own Activities. But when I try to launch a 3rd party activity (from it's Intent{action=""ACTION_HOME"", category=""CATEGORY_LAUNCHER""}) I get a <code>java.lang.SecurityException</code> because the <code>Activity</code> I want to start does not have the same UID as the calling <code>Activity</code>. Does anyone knows how to cirumvent this?</p>","120309","","","","","2011-01-14 15:24:02","ActivityGroup start 3rd party Activity","<android>","2","0","","",""
"2549376","1","2550455","","2010-03-30 23:20:42","2","1457","<p>And its not '&amp;'</p><p>Im using the SAXParser object do parse the actual XML.</p><p>This is normally done by passing a URL to the XMLReader.Parse method.Because my XML is coming from a POST request to a webservice, I am saving that result as a String and then employing StringReader / InputSource to feed this string back to the XMLReader.Parse method.</p><p>However, something strange is happening at the 2001st character of the XMLstring.<br>The 'characters' method of the document handler is being called TWICE in between the startElement and endElement methods, effectively breaking my string (in this case a project title) into two pieces.  Because I am instantiating objects in my characters method, I am getting two objects instead of one.</p><p>This line, about 2000 chars into the string fires 'characters' two times, breaking between ""Lower"" and ""Level""</p><pre><code>&lt;title&gt;SUMC-BOOKSTORE, LOWER LEVEL RENOVATIONS&lt;/title&gt;</code></pre><p>When I bypass the StringReader / InputSource workaround and feed a flat XML file to XMLReader.Parse, it works absolutely fine.</p><p>Something about StringReader and or InputSource is somehow screwing this up.  </p><p>Here is my method that takes and XML string and parses is through the SAXParser.</p><pre><code>    public void parseXML(String XMLstring) {    try {        SAXParserFactory spf = SAXParserFactory.newInstance();        SAXParser sp = spf.newSAXParser();        XMLReader xr = sp.getXMLReader();        xr.setContentHandler(this);        // Something is happening in the StringReader or InputSource         // That cuts the XML element in half at the 2001 character mark.        StringReader sr = new StringReader(XMLstring);        InputSource is = new InputSource(sr);        xr.parse(is);    } catch (IOException e) {        Log.e(""CMS1"", e.toString());    } catch (SAXException e) {        Log.e(""CMS2"", e.toString());    } catch (ParserConfigurationException e) {        Log.e(""CMS3"", e.toString());    }}</code></pre><p>I would greatly appreciate any ideas on how to not have 'characters' firing off twice when I get to this point in the XML String.</p><p>Or, show me how to use a POST request and still pass off the URL to the Parse function.</p><p>THANK YOU.</p>","305564","","","","","2013-08-20 17:45:24","Using Android SAXParser, one my my XML Elements is mysteriously breaking in half","<java><xml><android><sax><stringreader>","4","0","1","",""
"2549488","1","","","2010-03-30 23:52:27","0","473","<p>I'm coding an app that uses configurable profiles for different user preferences: many different users will use the same app on the same device. </p><p>The problem is that I can't use Android's PreferenceActivity because it just support one user per application. </p><p>Is there an easy way to generate the user interface for configuration, or I have to code everything from 0, including the user interface?</p><p>Thank you!</p>","305582","","","","","2010-03-31 01:17:35","How to implement profiles in an Android application?","<java><android><activity><preferences><profiles>","1","0","","",""
"2549548","1","","","2010-03-31 00:09:07","1","1778","<p>I'm having trouble getting an asset image to scale up when I load it. The new call to BitmapDrawable(Resources, BitmapDrawable) is not available on 1.6 SDK. Is there a workaround to load the BitmapDrawable the old way and then somehow manipulate it? I have tried calling setTargetDensity() to no avail. My code (which doesn't scale properly) is:</p><blockquote><pre><code>    ImageView iv = (ImageView)view.findViewById(R.id.image); iv.setImageDrawable(new BitmapDrawable(view.getContext().getAssets().open(path)));</code></pre></blockquote>","274835","","1140748","","2012-05-06 16:52:56","2012-05-06 16:52:56","Load image in device independent and screen independent fashion into a layout view using 1.6 SDK","<android><image><scale>","1","1","","",""
"2549585","1","2552495","","2010-03-31 00:17:40","2","14538","<p>[update] I got the error, which says ""Your content must have a ListView whose id attribute is 'android.R.id.list'"". Appearently nothing in my xml is ListView. But is that required?</p><p>This is an follow-up issue on my previous question<a href=""http://stackoverflow.com/questions/2548304/android-which-view-should-i-use-for-showing-text-and-image"">http://stackoverflow.com/questions/2548304/android-which-view-should-i-use-for-showing-text-and-image</a></p><p>I read the article about creating ListView for LinearLayout. However, my following code failed at the setContentView() function when I changed ""extends Activity"" to ""extends ListActivity"", any idea why?</p><pre><code>private TextView mSelection;//private ImageView mImages;static final String[] keywords = new String[]{""China"", ""Japan"", ""USA"", ""Canada""};/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.contactLayout);    mSelection = (TextView)findViewById(R.id.ContactNames);    ArrayAdapter adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.contactlayout, R.id.ContactNames,keywords);    setListAdapter(adapter);    }</code></pre><p>My Layout is from this article: <a href=""http://www.curious-creature.org/2009/02/22/android-layout-tricks-1/"" rel=""nofollow"">http://www.curious-creature.org/2009/02/22/android-layout-tricks-1/</a></p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""?android:attr/listPreferredItemHeight""android:padding=""6dip""&gt;&lt;ImageView    android:id=""@+id/icon""    android:layout_width=""wrap_content""    android:layout_height=""fill_parent""    android:layout_marginRight=""6dip""    android:src=""@drawable/icon"" /&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""0dip""    android:layout_weight=""1""    android:layout_height=""fill_parent""&gt;    &lt;TextView        android:id=""@+id/ContactNames""        android:layout_width=""fill_parent""        android:layout_height=""0dip""        android:layout_weight=""1""        android:gravity=""center_vertical""        android:text=""My Application"" /&gt;    &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""0dip""        android:layout_weight=""1""         android:singleLine=""true""        android:ellipsize=""marquee""        android:text=""Simple application that shows how to use RelativeLayout"" /&gt;&lt;/LinearLayout&gt;</code></pre><p></p>","253800","","253800","","2010-03-31 00:34:45","2010-08-25 15:24:24","Android: failed to setContentView when switching to ListActivity","<android><layout><listactivity>","3","0","4","",""
"2549763","1","2606175","","2010-03-31 01:01:52","2","1992","<p>I just want to get numbers of times to be used for each Activity.So the very straightforward method I thought is increasing the count for an Activity when it was started. But how can I get the information?</p><p>Thanks for your great help!</p>","305605","","","","","2012-02-17 16:22:41","How to inform an Activity that another Activity was just started?","<android><activity>","3","0","6","",""
"2550037","1","","","2010-03-31 02:19:13","1","322","<p>How can I get the height of the device for portrait mode? I have to create a bitmap (which is zoomable) and I just want to get a rough idea what the tallest height should be.</p><pre><code>getResources().getDisplayMetrics().heightPixels;</code></pre><p>does the above return the height, in portrait mode only?</p><p>I'm not binding my UI to this absolute value, it's just a rough fit,</p><p>Thanks</p>","246114","","","","","2010-03-31 03:41:43","Height of screen in portrait mode only?","<android>","1","0","","",""
"2550066","1","","","2010-03-31 02:26:10","5","3914","<p>I have here a function that downloads data from a remote server to file. I am still not confident with my code. My question is, what if while reading the stream and saving the data to a file and suddenly I was disconnected in the internet, will these catch exceptions below can really catch that kind of incident? If not, can you suggest how to handle this kind of incident?</p><p>Note: I call this function in a thread so that the UI won't be blocked.</p><pre><code>public static boolean getFromRemote(String link, String fileName, Context context){         boolean dataReceived = false;        ConnectivityManager connec =  (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);            if (connec.getNetworkInfo(0).isConnected() || connec.getNetworkInfo(1).isConnected()){                try {                        HttpClient httpClient = new DefaultHttpClient();                        HttpGet httpGet = new HttpGet(link);                        HttpParams params = httpClient.getParams();                        HttpConnectionParams.setConnectionTimeout(params, 30000);                        HttpConnectionParams.setSoTimeout(params, 30000);                        HttpResponse response;                        response = httpClient.execute(httpGet);                        int statusCode = response.getStatusLine().getStatusCode();                        if (statusCode == 200){                            HttpEntity entity = response.getEntity();                            InputStream in = null;                            OutputStream output = null;                            try{                                in = entity.getContent();                                String secondLevelCacheDir = context.getCacheDir() + fileName;                                File imageFile = new File(secondLevelCacheDir);                                output= new FileOutputStream(imageFile);                                IOUtilities.copy(in, output);                                output.flush();                            } catch (IOException e) {                                Log.e(""SAVING"", ""Could not load xml"", e);                            } finally {                                IOUtilities.closeStream(in);                                IOUtilities.closeStream(output);                                dataReceived = true;                            }                        }                    }catch (SocketTimeoutException e){                          //Handle not connecting to client !!!!                        Log.d(""SocketTimeoutException Thrown"", e.toString());                        dataReceived = false;                    } catch (ClientProtocolException e) {                        //Handle not connecting to client !!!!                        Log.d(""ClientProtocolException Thrown"", e.toString());                        dataReceived = false;                    }catch (MalformedURLException e) {                        // TODO Auto-generated catch block                        e.printStackTrace();                        dataReceived = false;                        Log.d(""MalformedURLException Thrown"", e.toString());                    } catch (IOException e) {                        // TODO Auto-generated catch block                        e.printStackTrace();                        dataReceived = false;                        Log.d(""IOException Thrown"", e.toString());                    }                 }            return dataReceived;        }</code></pre>","235885","","236128","","2010-03-31 04:52:00","2010-04-09 12:54:34","Android: handle unexpected internet disconnect while downloading data","<java><android><exception-handling>","1","0","1","",""
"2550099","1","2550106","","2010-03-31 02:36:54","43","48479","<p>In an given Android activity, I would like to start a new activity for the user at some point. Once they leave the first activity and arrive at the second, the first activity is stale and I want to remove it completely so it can not be accessed again from the back button.</p><p>How is the best way to accomplish this? How do I kill or destroy this activity immediately after the user has launched the new activity?</p>","268648","","","","","2013-03-07 17:23:33","How to kill an Android activity when leaving it so that it cannot be accessed from the back button?","<android>","5","0","10","",""
"2550601","1","","","2010-03-31 05:05:05","-1","986","<p>i m uploading my apk for 1st time on market and getting Error:The server could not process your apk. Try .My manifest file is:-</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""packagename"" android:versionCode=""1"" android:versionName=""1.0""&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE""&gt;&lt;/uses-permission&gt;    &lt;application android:icon=""@drawable/iccicon""            android:label=""@string/app_name"" android:debuggable=""false""&gt;        &lt;activity android:name="".Activity1"" android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name="".Activity2"" android:label=""@string/app_name""            android:windowSoftInputMode=""adjustPan"" android:configChanges=""keyboardHidden|orientation""&gt;    &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""4"" android:targetSdkVersion=""4"" /&gt;    &lt;uses-configuration android:reqHardKeyboard=""true""        android:reqKeyboardType=""qwerty""&gt;    &lt;/uses-configuration&gt;&lt;/manifest&gt; </code></pre><p>Please help.Thanks.</p>","285052","","114066","","2010-03-31 08:00:16","2010-11-16 21:30:28","Urgent : Getting error on uploading apk to Android market","<android><manifest><google-play>","1","7","0","",""
"2550710","1","","","2010-03-31 05:32:55","0","711","<p>iPhone does not have Menus AFAIK; most of the stuff is driven by on screen controls and widgets. Android has menus, ofcourse. I am working on porting an iPhone application on Android platform.</p><p>What are the advantages and disadvantages of the Menu driven approach?</p>","305708","","320111","","2012-03-06 03:19:34","2012-03-06 03:19:34","Mobile Application design: Menu Driven vs Tab Control","<iphone><android>","1","0","","",""
"2550743","1","","","2010-03-31 05:41:37","17","22283","<p>Is there a stand-alone sample code for video capturing in Android ?</p>","255455","","","","","2013-02-04 08:24:44","Android Video Capture Sample App","<android><video-capture>","4","0","7","",""
"2550847","1","","","2010-03-31 06:10:25","134","77542","<p>I've seen plenty of info about how to stream video from the server to an android device, but not much about the other way, ala Qik.  Could someone point me in the right direction here, or give me some advice on how to approach this?</p>","305722","","213269","","2012-01-23 02:29:15","2014-04-14 09:41:36","Streaming video from Android camera to server","<android><video><streaming><video-streaming>","5","9","110","",""
"2551194","1","","","2010-03-31 07:39:56","1","2418","<p>I am developing android application on Linux platform because i have to make a system.img with a application.</p><p>When adding a drawable resource and building the project with mm command, i met a below error.</p><blockquote>  <p>""cannot find symbol   R.drawable.icon_send_type""</p></blockquote><p>At above error, the icon_send_type is the added resource.</p><p>This error occurred because the mm command did not generate R.java.</p><p>So, I want to know how to generate R.java by a manual on Linux platform.</p>","305787","","213269","","2011-09-23 15:01:46","2013-09-10 19:43:37","How to generate R.java manually on Linux platform","<android><linux><r.java-file>","4","0","","",""
"2551249","1","7365898","","2010-03-31 07:51:10","1","8370","<p>I have made a signed apk of an android project. Whenever my client try to run it on the emulator, he faces the following error message:</p><pre><code>D:\Android\android-sdk-windows\tools&gt;adb install -r abc.apk500 KB/s (6940708 bytes in 13.534s)        pkg: /data/local/tmp/abc.apkFailure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]</code></pre><p>What is the resolution?</p>","2355649","","21234","","2010-03-31 07:52:43","2013-04-30 14:13:42","Why signed android apk is not running on emulator","<android><apk>","6","2","4","",""
"2551389","1","2553066","","2010-03-31 08:18:23","0","231","<p>For invoke search android example, every time query search result is received by onCreate().How can i make it received by onNewIntent(). What kind of operation can cause onNewIntent() receive intent?</p>","304881","","","","","2010-03-31 13:01:58","APIdemo invoke search problem android","<android>","1","0","","",""
"2551591","1","","","2010-03-31 09:00:33","1","2683","<p>whenever I do a Clean on my project, I got 2 errors:-></p><pre><code>1.) the project is missing gen folder2.) there is a build path error.</code></pre><p>I go to ""Configure build path"" and uncheck ""Android 1.6"". It works. If I do this again , i go and this time check ""Android 1.6"". It again works.</p><p>Can anyone please tell me why this is happening.</p><p>Thanks</p>","285052","","683261","","2012-01-06 09:30:37","2013-04-20 05:04:56","Build path error in eclipse for android","<android><eclipse>","1","0","","",""
"2551612","1","","","2010-03-31 09:03:16","0","111","<p>I had built a application using the Android SDK. Now I would like to package this application as part of the Android build. So that when I port Android into my device, it will appear in the Application menu.</p><p>I tried, copying the apk file into the package folder, and include it in the make file. Doesn't work.</p><p>How should I do it?</p>","254504","","202431","","2010-03-31 09:06:54","2010-12-02 16:23:12","Application as part of Android Built","<android><android-build>","1","0","","",""
"2551767","1","2557414","","2010-03-31 09:31:09","0","1202","<p>Hi I'm inserting an image from the camera (Taking a picture) into the MediaStore.Images.Media datastore. </p><p>Does anyone know how I can go about displaying the last picture taken?</p><p>I used Uri image = ContentUris.withAppendedId(externalContentUri, 45); to display an image from the datastore but obviously 45 is not the correct image. </p><p>I try to pass the information from the previous activity (Camera) to the display activity but I'm assuming due to the photo call back being its own thread the value never gets set.  Photo code is as follows</p><p>Camera.PictureCallback photoCallback = new Camera.PictureCallback() {</p><pre><code>    public void onPictureTaken(byte[] data, Camera camera) {        // TODO Auto-generated method stub        FileOutputStream fos;        try        {            Bitmap bm = BitmapFactory.decodeByteArray(data, 0, data.length);            fileUrl = MediaStore.Images.Media.insertImage(getContentResolver(),  bm, ""LastTaken"", ""Picture"");            if(fileUrl == null)            {                Log.d(""Still"", ""Image Insert Failed"");                return;            } else            {                 picUri = Uri.parse(fileUrl);                sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, picUri));            }        }        catch(Exception e)        {            Log.d(""Picture"", ""Error Picture: "", e);        }        camera.startPreview();    }};</code></pre>","84278","","","","","2013-04-23 07:30:50","Display last picture","<android><camera>","1","2","1","",""
"2551864","1","2551895","","2010-03-31 09:47:54","2","1466","<p>I need to be able to schedule multiple Notifications at different times in the future.</p><p>I tried doing this with an AlarmManager, but that isn't suitable, for the following reason. From AlarmManager.set(): ""If there is already an alarm for this Intent scheduled (with the equality of two intents being defined by filterEquals(Intent)), then it will be removed and replaced by this one.""</p><p>Guess what, the sending intents <em>are</em> equal, apart from different Extra's (but those don't count for filterEquals).</p><p><strong>So how can I schedule multiple notifications</strong>, which will still be shown when my application is killed (the whole reason I tried AlarmManager)?</p><p>Thanks.</p>","279363","","","","","2012-02-17 09:13:26","Scheduling notifications in Android","<android><notifications><alarmmanager>","3","1","","",""
"2552181","1","2552826","","2010-03-31 10:47:07","2","18041","<p>i have a url for the video file.the format of that file is itunes M4V.</p><p>i want to play it in android mobile. is it possible? if not so let me know?</p><p>and also i cannot play the mp4 file in emulator why?</p>","267269","","267269","","2010-03-31 11:43:02","2013-09-05 13:59:58","does M4V format file play in android?","<android><android-emulator><android-video-player>","4","1","1","2013-09-05 15:40:44",""
"2552270","1","2769869","","2010-03-31 11:02:20","5","2595","<p>I'm just starting with Android development and I'm coming from JavaScript/HTML world so I'm currently investigating the possibilities of the Android SDK.</p><p>The HTML 5 canvas supports composite operations (See <a href=""https://developer.mozilla.org/en/Canvas_tutorial/Compositing"" rel=""nofollow"">here</a>).</p><p>Is this possible in an Android Canvas? I scanned the API of the Canvas class but couldn't find anything useful. I need at least the composite operation ""source-in"" or (if this isn't possible) ""source-atop"".</p>","274473","","881229","","2013-12-12 06:03:05","2013-12-12 06:03:05","Composite operations in Android Canvas","<java><android><html5-canvas><android-canvas>","3","0","3","",""
"2552318","1","2552834","","2010-03-31 11:08:52","0","6708","<p>I'm trying to save a file in a subdirectory in Android 1.5.I can successfully create a directory using</p><pre><code>_context.GetFileStreamPath(""foo"").mkdir();</code></pre><p>(_context is the Activity where I start the execution of saving the file) but then if I try to create a file in foo/ by</p><pre><code>_context.GetFileStreamPath(""foo/bar.txt"");</code></pre><p>I get a exception saying I can't have directory separator in a file name (""/"").</p><p>I'm missing something of working with files in Android... I thought I could use the standard Java classes but they don't seem to work...I searched the Android documentation but I couldn't fine example and google is not helping me too...</p><p>I'm asking the wrong question (to google)...</p><p>Can you help me out with this?</p><p>Thank you!</p>","1812","","","","","2012-05-11 14:44:14","Write file in sub-directory in Android","<java><android><file-io><filesystems>","3","0","","",""
"2552327","1","2552406","","2010-03-31 11:11:31","0","79","<p>I have the following problem: </p><p>I have an Activity where a user can start a web search showing a new activity to show a progress bar until the results are shown. Now the user can either wait for the results or maybe think about the search parameters, hit the back button and triggering a new search. The search is running in an Async Task and therefor still running if the user hits back. At the moment the thread finishes it calls some methods on the old activity causing the activity to show a dialog. </p><p>This causes the system to crash because the dialog tries to show itself with a reference to an activity that is not longer present on the screen. </p><p>How can I achieve a dialog that is only shown if the activity is still active? </p>","114066","","","","","2010-03-31 11:22:26","How to handle feedback from background threads if the user uses the back button?","<android><multithreading><back-button>","1","0","","",""
"2552368","1","2552677","","2010-03-31 11:16:48","7","12557","<p>what are file formats android video player can support in android?</p><p>and differentiate the video view and video player in android.. </p><p>i am looking on the tutorils, videos, forums answer, etc.</p><p>anything related to this...</p>","267269","","267269","","2010-03-31 11:27:53","2010-03-31 12:03:59","what are the file formats can android video player supports in android?","<android><android-video-player>","1","0","3","",""
"2552431","1","","","2010-03-31 11:26:24","5","957","<p>I m trying to convert the contacts on emulator to VCard format using the code  below</p><p>AssetFileDescriptor afd =openAssetFileDescriptor(Contacts.CONTENT_VCARD_URI ,""r"")</p><p>The stack Trace says java.io.FileNotFoundException No file at content://com.android.contacts/contacts/as_vcard</p><p>Do we need to attach a file to the URI ? Is there some other way to convert Contacts to Vcard in Android?</p>","305946","","","","","2011-05-20 00:59:54","FileNotFoundException while trying to convert contacts to Vcard","<android>","2","1","3","",""
"2552515","1","","","2010-03-31 11:39:40","2","544","<p>How can I check got a successful internet connect (Wifi/3G/whatever else) I already display an error to the user if they don't have Wifi connection but how can I make sure then that the user does got 3G connection if they wish to connect to use the application without the Wifi connection?</p>","91561","","","","","2010-03-31 12:52:04","Android Application: Got Internet Connection","<android>","1","0","","",""
"2552568","1","2552801","","2010-03-31 11:48:22","35","13359","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2280079/seemingly-useless-debugging-environment-for-android"">Seemingly useless debugging environment for Android</a>  </p></blockquote><p>I've obviously been spoiled by Visual Studio, because although I'm just learning Android and the Eclipse environment, debugging apps in Eclipse is becoming a serious detriment to further development.</p><p>For example, Eclipse will compile this divide by zero just fine:</p><pre><code>public class Lesson2Main extends Activity{    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate (savedInstanceState);        int i = 1 / 0;        TextView tv = new TextView (this);        tv.setText (""Hello, Android!"");        setContentView (tv);    }}</code></pre><p>And then, when it executes it under the debugger, I will get a full screen of useless debug info, non of which actually points me to the specific line containing the error.</p><p>The stackTrace is null within the exception ('e') info tree, and it simply states a message stating 'ArithmeticException'.  (that's nice, how about you point me in the direction of where you found it!?)</p><p>I've looked all over the screen and am baffled that this IDE can't get this right.  Does developing with Eclipse resort everyone back to 1991 with printf() like logging at every interval then to track down bugs?  Seriously.</p><p>Is there a configuration or plug-in that I'm missing to help with this?</p><p>I haven't tested this case with XCode, but if the iPhone dev. IDE handles this more like Visual Studio, then no wonder the Android marketplace has so few apps.</p><p>I'm excited about Android, but it seems that Eclipse is getting in the way.</p>","7599","","","","","2011-05-04 18:57:00","What's wrong with debugging in Eclipse on Android?","<android><eclipse><debugging>","5","3","19","2013-01-29 14:03:27",""
"2552610","1","","","2010-03-31 11:54:27","1","159","<p>I've got a camera application and when I take a picture the image is stored. However I cannot see it on the SD Card until I reboot the device.</p><p>Any ideas why? Also when I view the image as a bitmap in my activity (After restarting) the picture is flipped the wrong way around. Any ideas about that?</p><p><strong>My code is as follows:</strong></p><pre><code>Camera.PictureCallback photoCallback = new Camera.PictureCallback() {  public void onPictureTaken(byte[] data, Camera camera) {    // TODO Auto-generated method stub    FileOutputStream fos;    try    {      Bitmap bm = BitmapFactory.decodeByteArray(data, 0, data.length);      fileUrl = MediaStore.Images.Media.insertImage(getContentResolver(), bm, ""LastTaken"", ""Picture"");      if(fileUrl == null)      {        Log.d(""Still"", ""Image Insert Failed"");        return;      }      else      {        picUri = Uri.parse(fileUrl);        sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, picUri));      }    }    catch(Exception e)    {      Log.d(""Picture"", ""Error Picture: "", e);    }    camera.startPreview();  }};</code></pre>","84278","","352449","","2012-07-02 20:47:56","2012-07-02 20:47:56","Image not on SD Card","<android>","0","3","","",""
"2552729","1","","","2010-03-31 12:11:50","5","3670","<p>I've problem when I want to read <code>com.android.email.provider</code> toget email accounts. </p><p>Here is my code to retrieve the account : </p><pre><code>Cursor c = null;Uri CONTENT_URI = Uri.parse(""content://com.android.email.provider/account"");String RECORD_ID = ""_id"";String[] ID_PROJECTION = new String[] {RECORD_ID };        c = getContentResolver().query(CONTENT_URI,ID_PROJECTION,null, null, null);   </code></pre><p>I got a security exception:</p><pre><code>java.lang.SecurityException: Permission Denial: reading com.android.email.provider.EmailProvider uri content://com.android.email.provider/account from pid=278, uid=10003 requires com.android.email.permission.ACCESS_PROVIDER</code></pre><p>I want to know the account is created or not in some other app. Is there any other way to resolve this so that I can read from the provider.</p><p>I have also tried adding the permission in manifest:</p><pre><code>&lt;uses-permission android:name=""com.android.email.permission.ACCESS_PROVIDER""/&gt;</code></pre><p>That didn't help.</p><p>Any solution would be greatly appreciated.</p><p>Thanks in advance</p>","142521","","705773","","2011-11-20 09:28:33","2013-02-27 00:24:19","Permission denial to read from emailprovider in android","<android><permissions><android-manifest>","1","0","1","",""
"2553002","1","","","2010-03-31 12:54:36","1","1186","<p>I am trying to send a file from the phone running Android 1.5 to a server on a desktop. I wrote some code, which works on emulator, but on the phone it doesn't. I'm connecting to the network through WiFi. It works, I can access the internet through my phone and I've configured my router. The application stops when I'm trying to connect. I have the permissions. Someone have any ideas, below is my code. </p><p>Running on Android</p><pre><code>package br.ufs.reconhecimento;import java.io.DataInputStream;import java.io.DataOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.IOException;import java.net.Socket;import android.app.Activity;import android.app.AlertDialog;import android.content.DialogInterface;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.EditText;import android.widget.ImageButton;/** * Sample code that invokes the speech recognition intent API. */public class Reconhecimento extends Activity implements OnClickListener {    static final int VOICE_RECOGNITION_REQUEST_CODE = 1234;    static final String LOG_VOZ = ""UFS-Reconhecimento"";    final int INICIAR_GRAVACAO = 01;    int porta = 5158; // Porta definida no servidor    int tempoEspera = 1000;    String ipConexao = ""172.20.0.189"";    EditText ipEdit;    /**     * Called with the activity is first created.     */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // Inflate our UI from its XML layout description.        setContentView(R.layout.main);        // Get display items for later interaction        ImageButton speakButton = (ImageButton) findViewById(R.id.btn_speak);        speakButton.setPadding(10, 10, 10, 10);        speakButton.setOnClickListener(this);        //Alerta para o endereço IP        AlertDialog.Builder alerta = new AlertDialog.Builder(this);        alerta.setTitle(""IP"");//+mainWifi.getWifiState());        ipEdit =  new EditText(this);        ipEdit.setText(ipConexao);        alerta.setView(ipEdit);        alerta.setMessage(""Por favor, Confirme o endereço IP."");        alerta.setPositiveButton(""OK"", new DialogInterface.OnClickListener() {               public void onClick(DialogInterface dialog, int which) {                    ipConexao = ipEdit.getText().toString();                    Log.d(LOG_VOZ, ""Nova Atribuiçăo do Endreço IP: "" + ipConexao); } });        alerta.create();        alerta.show();    }    /**     * Handle the click on the start recognition button.     */    public void onClick(View v) {        if (v.getId() == R.id.btn_speak) {            //startVoiceRecognitionActivity();          Log.d(LOG_VOZ, ""Iniciando a próxima tela"");          Intent recordIntent = new Intent(this, GravacaoAtivity.class);          Log.d(LOG_VOZ, ""Iniciando a tela (instancia criada)"");          startActivityForResult(recordIntent, INICIAR_GRAVACAO);          Log.d(LOG_VOZ, ""Gravaçăo iniciada ..."");        }    }    /**     * Handle the results from the recognition activity.     */    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {     Log.d(LOG_VOZ, ""Iniciando onActivityResult()"");     if (requestCode == INICIAR_GRAVACAO &amp;&amp; resultCode == RESULT_OK) {          String path = data.getStringExtra(GravacaoAtivity.RETORNO);          conexaoSocket(path);     }     else          Log.e(LOG_VOZ, ""Resultado Inexperado ..."");    }    private void conexaoSocket(String path) {     Socket socket = SocketOpener.openSocket(ipConexao, porta, tempoEspera);     if(socket == null)          return;     try {               DataOutputStream conexao = new DataOutputStream(socket.getOutputStream());               Log.d(LOG_VOZ, ""Acessando arquivo ..."");               File file = new File(path);               DataInputStream arquivo = new DataInputStream(new FileInputStream(file));               Log.d(LOG_VOZ, ""Iniciando Transmissăo ..."");               conexao.writeLong(file.length());               for(int i = 0; i &lt; file.length(); i++)                    conexao.writeByte(arquivo.readByte());               Log.d(LOG_VOZ, ""Transmissăo realizada com sucesso..."");               Log.d(LOG_VOZ, ""Fechando a conexăo..."");               conexao.close();               socket.close();               Log.d(LOG_VOZ, ""============ Processo finalizado com Sucesso =============="");          } catch (IOException e) {               Log.e(LOG_VOZ, ""Erro ao fazer a conexăo via Socket. "" + e.getMessage());               // TODO Auto-generated catch block          }    }}    class SocketOpener implements Runnable {     private String host;     private int porta;     private Socket socket;     public SocketOpener(String host, int porta) {          this.host = host;          this.porta = porta;          socket = null;     }     public static Socket openSocket(String host, int porta, int timeOut) {          SocketOpener opener = new SocketOpener(host, porta);          Thread t = new Thread(opener);          t.start();          try {               t.join(timeOut);          } catch(InterruptedException e) {               Log.e(Reconhecimento.LOG_VOZ, ""Erro ao fazer o join da thread do socket. "" + e.getMessage());               //TODO: Mensagem informativa               return null;          }          return opener.getSocket();     }     public void run() {          try {               socket = new Socket(host, porta);          }catch(IOException e) {               Log.e(Reconhecimento.LOG_VOZ, ""Erro na criaçăo do socket. "" + e.getMessage());               //TODO: Mensagem informativa          }     }     public Socket getSocket() {          return socket;     }    }</code></pre><p>Running on the desktop</p><p>Java:</p><pre><code>import java.io.BufferedReader;import java.io.DataInputStream;import java.io.DataOutputStream;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStreamReader;import java.net.ServerSocket;import java.net.Socket;public class ServidorArquivo {     private static int porta = 5158;     static String ARQUIVO = ""voz.amr"";     /**      * Caminho que será gravado o arquivo de audio      */     static String PATH = ""/home/iade/Trabalho/lib/"";     public static void main(String[] args) {          int i = 1;          try {               System.out.println(""Iniciando o Servidor Socket - Android."");               ServerSocket s = new ServerSocket(porta);               System.out.println(""Servidor Iniciado com Sucesso..."");               System.out.println(""Aguardando conexőes na porta: "" + porta);               while(true) {                    Socket recebendo = s.accept();                    System.out.println(""Aceitando conexăo de nş "" + i);                    new ThreadedHandler(recebendo).start();                    i++;               }               } catch (Exception e) {                    System.out.println(""Erro: "" + e.getMessage());                    e.printStackTrace();               }     }}class ThreadedHandler extends Thread {     private Socket socket;     public ThreadedHandler(Socket so) {          socket = so;     }     public void run() {          DataInputStream entrada = null;          DataOutputStream arquivo = null;          try {               entrada = new DataInputStream(socket.getInputStream());               System.out.println(""========== Iniciando a leitura dos dados via Sockets =========="");               long tamanho = entrada.readLong();               System.out.println(""Tamanho do vetor "" + tamanho);               File file = new File(ServidorArquivo.PATH + ServidorArquivo.ARQUIVO);               if(!file.exists())                    file.createNewFile();               arquivo = new DataOutputStream(new FileOutputStream(file));               for(int j = 0; j &lt; tamanho; j++) {                    arquivo.write(entrada.readByte());               }               System.out.println(""========== Dados recebidos com sucesso =========="");          } catch (Exception e) {               System.out.println(""Erro ao tratar do socket: "" + e.getMessage());               e.printStackTrace();          } finally {               System.out.println(""**** Fechando as conexőes ****"");               try {                    entrada.close();                    socket.close();                    arquivo.close();               } catch (IOException e) {                    System.out.println(""Erro ao fechar conex&amp;#65533;es "" + e.getMessage());                    e.printStackTrace();               }          }          System.out.println(""============= Fim da Gravaçăo ==========="");          // tratar o arquivo          String cmd1 = ""ffmpeg -i voz.amr -ab 12288 -ar 16000 voz.wav"";          String cmd2 = ""soundstretch voz.wav voz2.wav -tempo=100"";          String dir = ""/home/iade/Trabalho/lib"";          File workDir = new File(dir);          File f1 = new File(dir+""/voz.wav"");          File f2 = new File(dir+""/voz2.wav"");          f1.delete();          f2.delete();          try {               executeCommand(cmd1, workDir);               System.out.println(""realizou cmd1"");               executeCommand(cmd2, workDir);               System.out.println(""realizou cmd2"");          } catch (IOException e) {               // TODO Auto-generated catch block               e.printStackTrace();          } catch (InterruptedException e) {               // TODO Auto-generated catch block               e.printStackTrace();          }     }     private void executeCommand(String cmd1, File workDir) throws IOException,               InterruptedException {          String s;          Process p = Runtime.getRuntime().exec(cmd1,null,workDir);          int i = p.waitFor();          if (i == 0) {               BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));               // read the output from the command               while ((s = stdInput.readLine()) != null) {                    System.out.println(s);               }          }          else {               BufferedReader stdErr = new BufferedReader(new InputStreamReader(p.getErrorStream()));               // read the output from the command               while ((s = stdErr.readLine()) != null) {                    System.out.println(s);               }          }     }}</code></pre><p>Thanks in advance.</p>","306012","","","","","2010-04-08 13:09:58","Problem when trying to connect to a desktop server from android on wifi","<android><sockets><wifi>","1","0","","",""
"2553251","1","","","2010-03-31 13:25:24","2","3394","<p>I'm trying to launch Google maps from my application. I'm using: </p><pre><code>GeoPoint center = _mapView.getMapCenter(); Uri uri = Uri.parse(""geo:""+center.getLatitudeE6()+"",""+center.getLongitudeE6()); Log.d(LOG_TAG, ""Launching Google Maps with Uri: (""+uri+"")""); Intent intent = new Intent(Intent.ACTION_VIEW, uri);startActivity(intent); </code></pre><p>I tested it with a map centered on somewhere in NYC, however Google maps opens not centered there. I followed Android Developer's site reference to use: ""geo:latitude,longitude"" pattern. </p><p>the log that you see prints:</p><pre><code>Launching Google Maps with Uri: (geo:40763500,-73979305) </code></pre><p>anyone knows what can be the problem?</p>","258429","","222908","","2010-03-31 13:49:39","2010-03-31 13:49:39","Launch Google Maps app","<android><google-maps><android-intent>","2","0","","",""
"2553410","1","2554656","","2010-03-31 13:45:41","14","4653","<p>I have a relatively simple MapActivity that I'm trying to make displaya list of ""camps"" within a given map region. I've created a customsubclass of OverlayItem called CampOverlayItem, a customItemizedOverlay called CampsOverlay that returns CampOverlayItems, andof course a MapActivity subclass that populates the map.</p><p>I'm pulling the overlay data from a database using an AsyncTask ascreated in my activity. The AsyncTask is triggered from aViewTreeObserver.OnGlobalLayoutListener attached to the MapView.</p><p>In the onPostExecute method of the AsyncTask, I create a new instanceof my CampsOverlay class and pass it a list of the camps returned fromthe database (which are fetched in doInBackground). I then call:</p><pre><code>mapView.getOverlays().add(newOverlay);</code></pre><p>where newOverlay is the CampsOverlay I just created. All of this coderuns without error, but when the Map tries to draw itself, I get aNullPointerException with the following stack trace:</p><pre><code>java.lang.NullPointerException   atcom.google.android.maps.ItemizedOverlay.getIndexToDraw(ItemizedOverlay.java:211)   atcom.google.android.maps.ItemizedOverlay.draw(ItemizedOverlay.java:240)   at com.google.android.maps.Overlay.draw(Overlay.java:179)   at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:42)   at com.google.android.maps.MapView.onDraw(MapView.java:476)   at android.view.View.draw(View.java:6274)   at android.view.ViewGroup.drawChild(ViewGroup.java:1526)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)   at android.view.ViewGroup.drawChild(ViewGroup.java:1524)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)   at android.view.View.draw(View.java:6277)   at android.widget.FrameLayout.draw(FrameLayout.java:352)   at android.view.ViewGroup.drawChild(ViewGroup.java:1526)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)   at android.view.ViewGroup.drawChild(ViewGroup.java:1524)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)   at android.view.ViewGroup.drawChild(ViewGroup.java:1524)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)   at android.view.ViewGroup.drawChild(ViewGroup.java:1524)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)   at android.view.ViewGroup.drawChild(ViewGroup.java:1524)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)   at android.view.View.draw(View.java:6277)   at android.widget.FrameLayout.draw(FrameLayout.java:352)   at android.view.ViewGroup.drawChild(ViewGroup.java:1526)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)   at android.view.View.draw(View.java:6277)   at android.widget.FrameLayout.draw(FrameLayout.java:352)   at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1883)   at android.view.ViewRoot.draw(ViewRoot.java:1332)   at android.view.ViewRoot.performTraversals(ViewRoot.java:1097)   at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)   at android.os.Handler.dispatchMessage(Handler.java:99)   at android.os.Looper.loop(Looper.java:123)   at android.app.ActivityThread.main(ActivityThread.java:4203)   at java.lang.reflect.Method.invokeNative(Native Method)   at java.lang.reflect.Method.invoke(Method.java:521)   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)   at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Because it seems particularly relevant, here is the code for myItemizedOverlay subclass:</p><pre><code>public class CampsOverlay extends ItemizedOverlay&lt;CampOverlayItem&gt; {    private ArrayList&lt;Camp&gt; camps = null;    public CampsOverlay(Drawable defaultMarker, ArrayList&lt;Camp&gt; theCamps){        super(defaultMarker);        this.camps = theCamps;    }    @Override    protected CampOverlayItem createItem(int i) {        Camp camp = camps.get(i);        CampOverlayItem item = new CampOverlayItem(camp);        return item;    }    @Override    protected boolean onTap(int index) {        // TODO Auto-generated method stub        return super.onTap(index);    }    @Override    public int size() {        return camps.size();    }}</code></pre><p>Does anyone have any idea what could be happening here? I've attemptedto verify that everything I have control over is non-null. I canprovide more code if necessary.</p>","209022","","","","","2010-08-23 10:21:35","NullPointerException in ItemizedOverlay.getIndexToDraw","<android><android-mapview>","3","0","2","",""
"2553444","1","2558926","","2010-03-31 13:49:32","3","12884","<p>I want to clear all map overlays or markers from google map and using following code</p><pre><code>if(!mapOverlays.isEmpty())     {     mapOverlays.clear(); }</code></pre><p>which is giving me exception can any one guide me?am i right or wrong if i am wrong then kindly provide me the solution to my problem.</p><p>i want map clean if there is any marker on it.</p><p>any help would be appriciated.      </p>","249991","","114066","","2010-03-31 14:54:53","2012-04-05 10:35:59","how to clear all map overlays or markers from google map in android?","<android><google-maps>","2","4","","",""
"2553535","1","2553584","","2010-03-31 14:00:41","2","9190","<p>I am writing an android app. I want to pass some data across the intents/activities and I feel that a conversion to and from JSON is probably a more optimal way at this point. I am able to convert a java hashmap to a json string successfully using JSONObject support.</p><p>However i need to convert back this JSON string to a java object or a hashmap. What is the best way to go about it. </p><p>Is parcelable really a change worth doing; if I have simple 5 field object? What are the other ways to transfer data between intents.</p><p>Cheers</p>","57847","","","","","2010-04-04 18:09:58","Convert JSON String to Java Object or HashMap","<java><android><json>","4","0","1","",""
"2553694","1","2562724","","2010-03-31 14:19:54","2","896","<p>I have a problem with the following code:</p><pre><code>protected void onDraw(Canvas canvas){    Paint paint = new Paint();    // Draw a blue circle    paint.setColor(Color.BLUE);    canvas.drawCircle(100, 100, 50, paint);    // Draw a red circle where it collides with the blue one    paint.setXfermode(new AvoidXfermode(Color.BLUE, 0, Mode.TARGET));    paint.setColor(Color.RED);    canvas.drawCircle(50, 50, 50, paint);}</code></pre><p>According to the API documentation of AvoidXfermode the tolerance value 0 means that it looks for an EXACT color match. This should work here because I specify the same color as I used for drawing the first circle. But the result is that the red circle is not drawn at all. When I use a tolerance value of 255 instead then it works (red circle is drawn where it collides with the blue one) but that sounds wrong because with such a high tolerance I think it should draw the circle EVERYWHERE.</p><p>So what's wrong here? API Documentation? Android? Me?</p>","274473","","","","","2012-04-05 14:09:00","AvoidXferMode Tolerance","<android><android-sdk-2.1>","1","0","","",""
"2553759","1","","","2010-03-31 14:27:48","0","2090","<p>I was wondering if anyone understood how to make your application be displayed when you unlock the screen. I have an application where the user turns on a Bluetooth device, it connects to the phone, and the user should be presented with a UI. Having them hunt for the app or using the notification menu is not a workable option (too much work and not the obvious behavior). </p><p>The problem is that:When the screen is unlocked: - you can popup the activity from the background service when Bluetooth connects to a device - User is happy because the UI is right there</p><p>When the screen is locked: - The application gets started but is destroyed - User unlocks the phone and nothing is there but the homescreen</p><p>One work around would be to disable the keyguard when the application gets woken up but the nuclear option is a pretty bad option. </p><p>PS:I know the standard Android assumption is that you shouldn't do this. In the normal case this behavior is fine, but in this case I explicitly did something I want the phone to respond without adding more work for the user to do. As per Google's guidelines if you don't like this behavior there can be an option for you to turn this off or you can not use the application. </p><hr><p>A few more details, so after looking at this a bit more the problem isn't necessarily that you can't have an activity running when the screen is locked, unlock and expect it to be waiting. That does work if you do something like the following:</p><ul><li>lock your device</li><li>run an app through Eclipse while the phone is locked/off</li><li>unlock and it will be waiting for you</li></ul><p>But in the case the Activity is already running and I'm brining up a new window (which happens to be a transparent one, saying you're connected and asking what they want to do). The problem is that it gets killed </p><pre>E/BackgroundPOPUP( 2436): POPUP created via onCreate!I/UsageStats(   78): Unexpected resume of com.test.POPUP while already resumed in com.android.launcher2E/BackgroundPOPUP( 2436): POPUP onPauseE/MyBacgrkoundService( 2436): POPUP active!I/ActivityManager(   78): Displayed activity com.test.POPUP/.PopupTest: 175 ms (total 175 ms)I/UsageStats(   78): Something wrong here, didn't expect com.android.launcher2 to be pausedE/BackgroundPOPUP( 2436): POPUP has ended through a call to onStopE/BackgroundPOPUP( 2436): POPUP has ended through a call to onDestroy</pre><p>The setup here is as follows:</p><ul><li><code>MyBackgroundService</code> is a serivce that handles Bluetooth state (waits for connections, turns on Bluetooth if the user starts the app, etc.). It triggers a popup <code>BackgroundPOPUP</code> activity that runs a ViewFlipper. <code>MyBackgroundService</code> starts <code>BackgroundPOPUP</code> through an intent.</li><li><code>BackgroundPOPUP</code> is an activity with a Translucent theme (Theme.Translucent to be precise), it shows a ViewFlipper with some instructions and presents some options</li></ul>","306093","","306093","","2010-03-31 16:34:11","2011-01-29 10:02:07","Android Activity is displayed after user unlocks the screen","<android><user-interface><background><activity><lockscreen>","1","0","","",""
"2554386","1","2554699","","2010-03-31 15:48:46","3","1413","<p>Using AdMob by itself works perfectly. Using AdMob through AdWhirl causes the following problem:</p><pre><code> 23114               dalvikvm  I  Failed resolving Lcom/adwhirl/adapters/AdMobAdapter; interface 144 'Lcom/admob/android/ads/AdListener;'                                                      23114               dalvikvm  W  Link of class 'Lcom/adwhirl/adapters/AdMobAdapter;' failed                                                                                                   23114               dalvikvm  E  Could not find class 'com.adwhirl.adapters.AdMobAdapter', referenced from method com.adwhirl.adapters.AdWhirlAdapter.getAdapter                              23114               dalvikvm  W  VFY: unable to resolve new-instance 172 (Lcom/adwhirl/adapters/AdMobAdapter;) in Lcom/adwhirl/adapters/AdWhirlAdapter;                                       23114               dalvikvm  D  VFY: replacing opcode 0x22 at 0x0012                                                                                                                         23114               dalvikvm  D  Making a copy of Lcom/adwhirl/adapters/AdWhirlAdapter;.getAdapter code (229 bytes)                                                                           23114               dalvikvm  I  Failed resolving Lcom/adwhirl/adapters/QuattroAdapter; interface 524 'Lcom/qwapi/adclient/android/view/AdEventsListener;'                                    23114               dalvikvm  W  Link of class 'Lcom/adwhirl/adapters/QuattroAdapter;' failed                                                                                                 23114               dalvikvm  E  Could not find class 'com.adwhirl.adapters.QuattroAdapter', referenced from method com.adwhirl.adapters.AdWhirlAdapter.getAdapter                            23114               dalvikvm  W  VFY: unable to resolve new-instance 177 (Lcom/adwhirl/adapters/QuattroAdapter;) in Lcom/adwhirl/adapters/AdWhirlAdapter;                                     23114               dalvikvm  D  VFY: replacing opcode 0x22 at 0x002c                                                                                                                         23114         AndroidRuntime  D  Shutting down VM                                                                                                                                             23114               dalvikvm  W  threadid=3: thread exiting with uncaught exception (group=0x4001b180)                                                                                        23114            FlurryAgent  D  Ending session                                                                                                                                               23114        LocationManager  D  removeUpdates: listener = com.flurry.android.FlurryAgent@4496be70                                                                                            23114         AndroidRuntime  E  Uncaught handler: thread main exiting due to uncaught exception                                                                                              23114         AndroidRuntime  E  java.lang.NoClassDefFoundError: com.adwhirl.adapters.AdMobAdapter                                                                                            23114         AndroidRuntime  E        at com.adwhirl.adapters.AdWhirlAdapter.getAdapter(AdWhirlAdapter.java:39)                                                                              23114         AndroidRuntime  E        at com.adwhirl.AdWhirlLayout.handleAd(AdWhirlLayout.java:154)                                                                                          23114         AndroidRuntime  E        at com.adwhirl.AdWhirlLayout.access$0(AdWhirlLayout.java:143)                                                                                          23114         AndroidRuntime  E        at com.adwhirl.AdWhirlLayout$1.run(AdWhirlLayout.java:87)                                                                                              23114         AndroidRuntime  E        at android.os.Handler.handleCallback(Handler.java:587)                                                                                                 23114         AndroidRuntime  E        at android.os.Handler.dispatchMessage(Handler.java:92)                                                                                                 23114         AndroidRuntime  E        at android.os.Looper.loop(Looper.java:123)                                                                                                             23114         AndroidRuntime  E        at android.app.ActivityThread.main(ActivityThread.java:4363)                                                                                           23114         AndroidRuntime  E        at java.lang.reflect.Method.invokeNative(Native Method)                                                                                                23114         AndroidRuntime  E        at java.lang.reflect.Method.invoke(Method.java:521)                                                                                                    23114         AndroidRuntime  E        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)                                                                     23114         AndroidRuntime  E        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)                                                                                        23114         AndroidRuntime  E        at dalvik.system.NativeStart.main(Native Method)                                    </code></pre><p>Any ideas?</p>","184367","","165260","","2010-04-02 07:36:52","2010-04-02 07:36:52","Android: AdWhirl cannot find AdMobAdapter","<android><admob><ads-api><adwhirl>","1","0","","",""
"2554389","1","","","2010-03-31 15:51:02","1","2076","<p>I want to know how to change dynamically a ListView's item layout.</p><p>To be exact, i want to know the method that the ListView's bindView method is called at runtime.</p><p>if the bindView method is artificially called by a other method. then i will change a ListView's item layout.</p><p>Please let me know.</p>","305787","","596219","","2012-01-04 02:27:12","2012-01-04 02:27:12","How to change dynamically a ListView's item  layout","<android>","1","0","","",""
"2554871","1","2564751","","2010-03-31 16:54:26","26","26793","<p>I'm trying to animate a simple ImageView in my application and I want it to slide in from the bottom of the screen and come to a resting position where the top 50px of the view is off the top of the screen (e.g. the final position of the ImageView should be -50px in X). I've tried to use the AbsoluteLayout to do this, but this actually cuts off the top 50px of the ImageView such that the top 50px is never rendered. I need to have the top 50px of the ImageView visible/rendered while it's animating and then simply have it come to a rest slightly off-screen. I hope I've explained that well enough. </p><p>Here is what I'm currently using as a layout and the slide-in animation (this currently doesn't render the top 50px of the ImageView):</p><p>Layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;   &lt;AbsoluteLayout xmlns:android=""http://schemas.android.com/apk/res/android""      android:layout_height=""fill_parent""       android:layout_width=""fill_parent""       android:id=""@+id/QuickPlayClipLayout""&gt;      &lt;ImageView android:id=""@+id/Clip""         android:background=""@drawable/clip""          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:layout_y=""-50dp""&gt;      &lt;/ImageView&gt;   &lt;/AbsoluteLayout&gt;</code></pre><p>Animation:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android""&gt;   &lt;translate android:fromYDelta=""100%p""        android:toYDelta=""0""       android:duration=""1000""/&gt;   &lt;alpha android:fromAlpha=""0.0""        android:toAlpha=""1.0""       android:duration=""1000"" /&gt;&lt;/set&gt;</code></pre><p>Thanks in advance.</p>","272302","","","","","2014-01-23 20:07:55","Android -- How to position View off-screen?","<android><layout><animation><imageview>","4","1","21","",""
"2555122","1","2555474","","2010-03-31 17:33:56","0","2614","<p>I am building an application which stores GPS locations in a SQLite database and then outputs the data onto a MapView using an Overlay by drawing a red line between the points. </p><p>I want to be able to show graphical markers (images) for each of these points as well as the red line. My code is as follows:</p><pre><code>public class MyOverlay extends ItemizedOverlay&lt;OverlayItem&gt; {// private Projection projection;private Paint linePaint;private Vector&lt;GeoPoint&gt; points;public MyOverlay(Drawable defaultMarker) {    super(defaultMarker);    points = new Vector&lt;GeoPoint&gt;();    //set colour, stroke width etc.    linePaint = new Paint();    linePaint.setARGB(255, 255, 0, 0);    linePaint.setStrokeWidth(3);    linePaint.setDither(true);    linePaint.setStyle(Style.FILL);    linePaint.setAntiAlias(true);    linePaint.setStrokeJoin(Paint.Join.ROUND);    linePaint.setStrokeCap(Paint.Cap.ROUND);}public void addPoint(GeoPoint point) {    populate();    points.addElement(point);}//public void setProjection(Projection projection) {//   this.projection = projection;// }public void draw(Canvas canvas, MapView view, boolean shadow) {    populate();    int size = points.size();    Point lastPoint = new Point();    if(size == 0) return;    view.getProjection().toPixels(points.get(0), lastPoint);    Point point = new Point();    for(int i = 1; i&lt;size; i++){       view.getProjection().toPixels(points.get(i), point);        canvas.drawLine(lastPoint.x, lastPoint.y, point.x, point.y, linePaint);        lastPoint = point;    }}@Overrideprotected OverlayItem createItem(int arg0) {    // TODO Auto-generated method stub    return null;}@Overridepublic int size() {    // TODO Auto-generated method stub    return 0;}}</code></pre><p>What would be the easiest way to implement adding markers for each GeoPoint?</p>","296810","","496830","","2011-08-24 00:44:19","2012-06-14 16:33:49","Adding visible ""Markers"" to represent Geopoints to a MapView using ItemizedOverlay in Android","<java><android><sqlite><overlay><android-mapview>","1","0","","",""
"2555738","1","","","2010-03-31 19:05:11","1","1591","<p>I'm looking for a way to programmatically save an array of shorts as PCM data.  I know that this should be possible, but I haven't found a very easy way to do this on Android.</p><p>Essentially, I'm taking voltage data, and I want to save it in PCM format.  My function looks something like this:</p><pre><code>  public void audifySignal(short[] signal) {    // Create a WAV file from the incoming signal  }</code></pre><p>Any suggestions would be awesome, or even references.  Seems like the audio APIs built in to android are more geared for directly recording from the mic, and not so much for lower level signal processing type work (at least for saving raw data to a file).  I'd also like to avoid having to manually write the PCM file headers and what not...</p><p>Thanks!</p>","93938","","","","","2011-11-21 16:15:25","Programmatically Writing PCM WAV Data in Android","<android>","2","0","","",""
"2555827","1","","","2010-03-31 19:21:01","2","1003","<p>I know this has to be trivial but I just don't find the right resource, I guess.<br>So all I want to do is retrieving a thumbnail for a video. All I have is the absolute path to the file on the sdcard as a String. So please point me into the right direction.</p><p>And believe me, this is embarrassing enough to ask...</p><p>Regards,<br>Steff</p>","289849","","","","","2010-11-24 11:15:33","How to retrieve video thumbnail from an absolute path?","<android><file><video><path><thumbnails>","1","0","1","",""
"2556065","1","2556094","","2010-03-31 19:59:49","0","597","<p>Is there a way to notify MediaScanner service on Android platform not to scan certain directories? I have application that encrypts images on SD card and after I do that MediaScanner goes wild in LogCat (writing out ""not JPEG"" exception... and there are time I have over 1000 pics in directory).</p><p>Thanks</p>","237858","","","","","2010-03-31 20:05:27","Stop MediaScanner scanning of certain directory","<java><android>","1","0","1","",""
"2556389","1","","","2010-03-31 20:55:49","1","1101","<p>I'm using the example from the SDK (CameraPreview) and also the example from this site <a href=""http://marakana.com/forums/android/android_examples/39.html"" rel=""nofollow"">http://marakana.com/forums/android/android_examples/39.html</a></p><p>When I run it, both gives this error ""The application AppName(appname) has stopped unexpectedly. Please try again"".<br>I can't run the debugger either because it's always ""Waiting for debugger. Force close"". (I have debuggable=true in the manifest file)  </p><p>The phone I have is a Nexus One.<br>Running on the emulator gives me the black and white squares with a moving square. (So I assume it works on the emulator?). Even on the emulator it gives me the ""stopped unexpectedly"" error 50% of the time.  </p><p>Does anyone know what caused it?</p><p>Thanks,<br>Tee</p>","166940","","","","","2010-04-01 18:41:02","Android - Camera functionality howto","<android>","2","1","","",""
"2556495","1","2556540","","2010-03-31 21:11:29","22","16005","<p>I have android.permission.READ_OWNER_DATA but I can't find any reliable code that would explain how can I read email address of device's owner. And please don't turn this into 'why you wanna do that' thread.</p><p>Thanks for help!</p>","237858","","237858","","2012-10-17 14:17:56","2012-10-17 14:17:56","Get owner's email address","<android>","1","3","8","2012-10-17 15:59:01",""
"2556723","1","2556879","","2010-03-31 21:51:12","0","1982","<p>For example, I want to write an activity that launches when you return from sleep (black screen). How can I set this activity to run instead of the default one? In other words, I want to make a custom lock screen. </p><p>Thanks</p>","306410","","306410","","2010-03-31 22:03:13","2010-05-18 20:00:06","How do I set a custom Android standby screen?","<android><screen><activity><standby>","1","0","","",""
"2556829","1","2557737","","2010-03-31 22:09:31","1","1176","<p>I know that the recently released android ndk r3 supports opengl es 2.0 on supported phones (nexus one for example), however it doesn't say whether there are java bindings for opengl es 2.0 included in the SDK yet. Are said bindings on the way, and if not, does JOGL2 support the opengl es 2.0 profile on the android?</p>","278966","","","","","2011-05-13 16:05:39","Are there java bindings for OpenGL ES 2.0 on the Android platform?","<android><jogl><android-ndk><android-sdk-2.1>","2","0","1","",""
"2556927","1","","","2010-03-31 22:29:06","0","1143","<p>I am designing a home screen widget. The widget layout file is like below.</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/widget""android:layout_width=""240dip"" android:layout_height=""200dip""    android:background=""@drawable/base_all""/&gt;</code></pre><p>I ran this widget on a HTC Hero device, which has a screen of 320 pixels * 480 pixels with mdpi. It ran perfect on HTC Hero. The widget takes 3 cells * 2 cells space, i.e. 240 pixels * 200 pixels.</p><p>Then I ran this widget on a Nexus One device, which has a screen of 480 pixels * 800 pixels, mdpi. Since Nexus One also is mdpi, so I though 240dip is equivalent to 240 pixels on Nexus One and 200dip is equivalent to 200 pixels on Nexus One, so the widget will not take 3 cells * 2 cells space on Nexus One device. To my surprise, when running on Nexus One device, the widget take exact 3 cells * 2 cells, about 360 pixels * 300 pixels, on Nexus One device.</p><p>I am confused. The layout xml above specifies 240dip in width and 200dip in height for the widget, but why did it take 360 pixels * 300 pixels on Nexus One Device? What am I missing?</p><p>Thanks.</p><hr><p>In reply to mbaird's comment:</p><p>I am still confused. Suppose I specify a ImageView, picture1, with 90dip * 100dip as below in the widget. What dimension in device pixels will the ImageView on the Nexus One device? </p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/widget""android:layout_width=""240dip"" android:layout_height=""200dip""    android:background=""@drawable/base_all""&gt;&lt;ImageView android:id=""@+id/picture1""    android:layout_width=""90dip""    android:layout_height=""110dip""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>I have to know this, because in my program I have to draw on the ImageView:</p><pre><code>public void draw(Canvas canvas) {    ShapeDrawable drawable = new ShapeDrawable(new RectShape());    drawable.getPaint().setColor(Color.WHITE);    drawable.setBounds(m_leftTopX, m_leftTopY, m_leftTopX + m_width,            m_leftTopY + m_height);    drawable.draw(canvas);}</code></pre><p>As I understant, drawable.setBounds() is using physical pixels in its parameters. I need to know the size of the ImageView in dimension of physical pixels.</p><p>Thanks.</p>","256239","","19679","","2014-02-13 16:29:32","2014-02-13 16:29:32","Confused about home screen widget size in normal screen and larget screen","<android>","1","0","","",""
"2557058","1","","","2010-03-31 22:53:39","0","696","<p>I am trying to display the image on the screen using <code>ImageView. setImageResource</code> fails. Here is my XML :</p><p></p><pre><code>&lt;FrameLayout android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:layout_weight=""1""&gt; &lt;ImageView      id=""@+id/batteryLevelview""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:layout_gravity=""center""/&gt;&lt;/FrameLayout&gt;</code></pre><p></p><pre><code>  @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);      ImageView batteryLevelImage = (ImageView) findViewById(R.id.batteryLevelview);     batteryLevelImage.setImageResource(R.drawable.notconnected);   }    </code></pre><p>What's wrong in my code? Can you please help me to find what's wrong. I would like to update image on the <code>ImageView</code> object based on criteria. I tried using <code>LinearLayout</code> and that did not help.</p><p>thanks.</p>","224488","","1232277","","2013-01-04 06:08:19","2013-01-04 06:24:54","setImageResource throws an exception to load image on the ImageView","<android>","1","3","","",""
"2557561","1","2557928","","2010-04-01 01:08:55","1","893","<p>I'm installing the Android SDK on Mac OS X.  Following the instructions on the Android Development site, I've downloaded the SDK and modified my .bash_profile to include the path. The next step is to use the Android SDK and AVD Manager to actually download the platforms.</p><p>However, when I use the Manager to install the platforms, I get the following error in the Terminal. I've looked around for similar problems in the Eclipse and Android forums and haven't found anything yet. Is something else damaged in the environment and needs to be repaired? Any recommendations on where I should look?</p><p>EDIT: I'm on Java version 1.6-u17. Just updated OS X to 10.6.3.</p><pre><code>java.lang.NullPointerExceptionat org.eclipse.swt.graphics.Device.getFontList(Unknown Source)at org.eclipse.jface.resource.FontRegistry.filterData(FontRegistry.java:456)at org.eclipse.jface.resource.FontRegistry.createFont(FontRegistry.java:490)at org.eclipse.jface.resource.FontRegistry.defaultFontRecord(FontRegistry.java:551)at org.eclipse.jface.resource.FontRegistry.defaultFontData(FontRegistry.java:563)at org.eclipse.jface.resource.FontRegistry.getFontData(FontRegistry.java:579)at org.eclipse.jface.dialogs.Dialog.dialogFontIsDefault(Dialog.java:1077)at org.eclipse.jface.dialogs.Dialog.applyDialogFont(Dialog.java:998)at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:756)at org.eclipse.jface.window.Window.create(Window.java:431)at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)at com.android.sdkuilib.internal.repository.UpdateChooserDialog.create(UpdateChooserDialog.java:280)at org.eclipse.jface.window.Window.open(Window.java:790)at com.android.sdkuilib.internal.repository.UpdaterData.updateOrInstallAll(UpdaterData.java:502)at com.android.sdkuilib.internal.repository.RemotePackagesPage.onInstallSelectedArchives(RemotePackagesPage.java:323)at com.android.sdkuilib.internal.repository.RemotePackagesPage.access$600(RemotePackagesPage.java:54)at com.android.sdkuilib.internal.repository.RemotePackagesPage$7.widgetSelected(RemotePackagesPage.java:168)at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source)at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source)at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)at com.android.sdkuilib.internal.repository.UpdaterWindowImpl.open(UpdaterWindowImpl.java:104)at com.android.sdkuilib.repository.UpdaterWindow.open(UpdaterWindow.java:110)at com.android.sdkmanager.Main.showMainWindow(Main.java:281)at com.android.sdkmanager.Main.doAction(Main.java:247)at com.android.sdkmanager.Main.run(Main.java:92)at com.android.sdkmanager.Main.main(Main.java:81)logout</code></pre>","75215","","75215","","2010-04-01 02:51:00","2014-01-25 05:16:08","NullPointerException when installing the Android SDK on Mac OS X","<android><installation>","2","0","","",""
"2557570","1","2557742","","2010-04-01 01:12:14","2","1463","<p>I've got an app that is heavily based on remote images.  They are usually displayed alongside some data in a ListView.  A lot of these images are new, and a lot of the old ones will never be seen again.  </p><p>I'm currently storing all of these images on the SD card in a custom cache directory (ala evancharlton's magnatune app).</p><p>I noticed that after about 10 days, the directory totals ~30MB.  This is quite a bit more than I expected, and it leads me to believe that I need to come up with a good solution for cleaning out old files... and I just can't think of a great one.  Maybe you can help.  These are the ideas that I've had:</p><ol><li><p>Delete old files.  When the app starts, start a background thread, and delete all files older than X days.  This seems to pose a problem, though, in that, if the user actively uses the app, this could make the device sluggish if there are hundreds of files to delete.</p></li><li><p>After creating the files on the SD card, call <code>new File(""/path/to/file"").deleteOnExit();</code> This will cause all files to be deleted when the VM exits (I don't even know if this method works on Android).  This is acceptable, because, even though the files need to be cached for the session, they don't need to be cached for the next session.  It seems like this will also slow the device down if there are a lot of files to be deleted when the VM exits.</p></li><li><p>Delete old files, up to a max number of files.  Same as #1, but only delete N number of files at a time.  I don't really like this idea, and if the user was very active, it may never be able to catch up and keep the cache directory clean.</p></li></ol><p>That's about all I've got.  Any suggestions would be appreciated.</p>","238849","","","","","2010-04-01 02:11:23","Solution for cleaning an image cache directory on the SD card","<android>","1","0","","",""
"2557716","1","2557727","","2010-04-01 02:01:44","1","743","<p>Is it possible to have an AndroidManifest.xml and or resource files in a Jar file and import that into a executable Android project?</p><p>My goal is to provide styles, resources, and services from a jar library that can be accessed from a main android project for my common tools.</p>","42005","","","","","2010-04-01 07:31:15","AndroidManifest from Jars","<android><jar><shared-libraries>","2","0","","",""
"2557761","1","","","2009-10-06 12:06:09","0","536","<p>I want to use default user login/pwd in my app. </p><p>Do you know how can I have access to this data?</p><p>best,Patrick</p>","","Patrick","","","","2010-04-01 02:20:37","How to use default account parameters (login/pwd) in Android phone?","<android>","1","2","","",""
"2558049","1","","","2010-04-01 04:00:04","1","9220","<p>The problem I hope to resolve here is that when I click on one item in the <code>ListView</code> that item's background changes to light gray, but when I continue to scroll through the list every 4th item has the background changed to light gray even though those other items have not been clicked.  How do I make only the item I clicked be effected by the click?</p><pre><code>    ListView lv = (ListView) findViewById(R.id.resultsList);    lv.setAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.resultitem, (String[])labelList.toArray(new String[labelList.size()])));    lv.setOnItemClickListener(new OnItemClickListener() {            @Override        public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {                  TextView tv = (TextView)view.findViewById(R.id.result);            tv.setBackgroundColor(Color.LTGRAY);            tv.setTextColor(Color.BLACK);        }     }</code></pre>","303061","","427763","","2012-07-16 23:33:51","2013-06-23 08:27:07","ListView selection issue...Using onItemClick(AdapterView<?> parent, View view, ...)","<android><listview><background><textview><android-arrayadapter>","3","0","1","",""
"2558079","1","2558673","","2010-04-01 04:14:13","3","857","<p>There are several different ways of definition the ID:</p><pre><code>android:id=""@id/android:list""android:id=""@+id/android:list""android:id=""@+id/confirm"" </code></pre><p>What is the difference?</p>","306558","","898400","","2014-02-25 11:16:07","2014-02-25 11:16:07","There are several different ways of definition the ID. What is the difference?","<android><android-resources>","3","0","1","",""
"2558257","1","17765543","","2010-04-01 05:14:03","14","8947","<p>How can you display upside down text with a textview in Android?</p><p>In my case I have a 2 player game, where they play across from each other. I want to display test to the second player oriented to them.</p><hr><p>This was the solution I implemented after AaronMs advice</p><p>The class that does the overriding, bab.foo.UpsideDownText </p><pre><code>package bab.foo;import android.content.Context;import android.graphics.Canvas;import android.util.AttributeSet;import android.widget.TextView;public class UpsideDownText extends TextView {    //The below two constructors appear to be required    public UpsideDownText(Context context) {        super(context);    }    public UpsideDownText(Context context, AttributeSet attrs)    {        super(context, attrs);    }    @Override    public void onDraw(Canvas canvas) {        //This saves off the matrix that the canvas applies to draws, so it can be restored later.         canvas.save();         //now we change the matrix        //We need to rotate around the center of our text        //Otherwise it rotates around the origin, and that's bad.         float py = this.getHeight()/2.0f;        float px = this.getWidth()/2.0f;        canvas.rotate(180, px, py);         //draw the text with the matrix applied.         super.onDraw(canvas);         //restore the old matrix.         canvas.restore();     }}</code></pre><p>And this is my XML layout:</p><pre><code>&lt;bab.foo.UpsideDownText     android:text=""Score: 0""     android:id=""@+id/tvScore""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:textColor=""#FFFFFF""     &gt;&lt;/bab.foo.UpsideDownText&gt;</code></pre>","92212","","92212","","2010-04-02 04:37:59","2013-07-20 19:06:24","How can you display upside down text with a textview in Android?","<android><textview>","3","0","6","",""
"2558560","1","2559397","","2010-04-01 06:35:58","0","787","<p>friends,</p><p>i have a EditText on simple activity with a button.when  every i move from one activity to this acivity focus is automatically set to EditText and keyboard appears in phone.</p><p>i dont want to open keyboard untill i click on editText.</p><p>can any one guide me what should i do?</p><p>any help would be appriciated.</p>","249991","","","","","2014-04-11 05:38:42","how to disappear keyboard onCreate Method?","<android><activity>","3","0","","",""
"2558591","1","","","2010-04-01 06:44:08","24","74919","<p>Can somebody please give me an example code of removing all ListView items and replacing with new items?</p><p>I tried replacing the adapter items without success. My code is</p><pre><code>populateList(){ results //populated arraylist with strings ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,                android.R.layout.simple_list_item_1, results); listview.setAdapter(adapter); adapter.notifyDataSetChanged(); listview.setOnItemClickListener(this);}// now populating list againrepopulateList(){ results1 //populated arraylist with strings ArrayAdapter&lt;String&gt; adapter1 = new ArrayAdapter&lt;String&gt;(this,                android.R.layout.simple_list_item_1, results1); listview.setAdapter(adapter1); adapter1.notifyDataSetChanged(); listview.setOnItemClickListener(this);}</code></pre><p>Here <code>repopulateList()</code> method will add to ListView items, but it doesn't remove/replace all ListView items.</p>","306627","","114066","","2012-01-27 08:41:09","2014-03-24 21:07:57","Remove ListView items in Android","<android><android-listview>","7","0","6","",""
"2558849","1","2559011","","2010-04-01 07:36:25","0","498","<p>I added google-collect-1.0.jar to my Android project and it made a 50K .apk into a 250k .apk (both Release).</p><p>This was all through using a single method Lists.newArrayList()</p><p>Is there any way to reduce the overhead?</p>","82515","","","","","2011-04-08 14:38:15","How to reduce apk bloat through library usage?","<android><jar>","2","1","","",""
"2559273","1","2562066","","2010-04-01 09:10:20","3","5950","<p>I want to be able to adjust my UI screen on Android when the soft keyboard pops up.</p><p>So at the minute I have something similiar to the first picture below where I have and EditText at the bottom of the screen and when a user taps the EditText I want the same as what happens in the second picture.</p><p>That is that the EditText gets moved up and appears to ""sit"" on top of the soft keyboard, when the soft keyboard dissapears it should then return to its prior state.</p><p>Can anyone let me know the best way to approach and implement this?</p><p><img src=""http://img40.imageshack.us/img40/2300/keyboarddown.png"" alt=""alt text""></p><hr><p><img src=""http://img46.imageshack.us/img46/9339/keyboardup.png"" alt=""alt text""></p>","243999","","164901","","2010-05-09 22:06:44","2013-09-24 03:35:46","Android - Adjust screen when keyboard pops up?","<android><user-interface><keyboard><screen><edittext>","2","0","1","",""
"2559531","1","2564113","","2010-04-01 09:57:34","2","7450","<p>i want to just find a shortest path between the location on map. we have to pass the location's geopoint then click the button to get direction. it will show the shortest path like a blue line. how to do this? i search about this. many of them import a package com.google.googlenav.*;. where i have to get this? Any Idea????</p><p><strong>Edit:got downloaded the Cloudemade API. how to draw the lines between the points.</strong></p>","267269","","267269","","2010-04-01 11:54:56","2010-04-02 08:12:13","route finding between two designation on maps in android?","<android><android-mapview><android-maps><android-location>","3","0","","",""
"2559611","1","","","2010-04-01 10:13:16","11","5823","<p>I have a Spinner View that's populated through a SimpleCursorAdapter. </p><p>Based on the selection I need to save the <strong>rowid</strong> in the entry database (position won't work because things can be added and deleted from the Spinner Database). </p><p>This I can do by using <strong><code>spinner.getAdapter().getItemId(pos);</code></strong>. But When I edit an entry I need to make the Spinner position selected that is associated with this rowid (currently).</p><p><strong><code>spinner.setSelection(position);</code></strong> won't work because I have the rowid, I need a way to find the current position of the item in the current spinner based on the rowid in the database.</p>","306765","","1318946","","2014-01-27 07:30:32","2014-01-27 08:14:52","setSelection on Spinner based on rowId","<database><android><spinner>","6","1","5","",""
"2559768","1","2560487","","2010-04-01 10:45:06","0","241","<p>Good Morning,</p><p>I got my app to install on the Backflip and started testing it.  On the emulator everything appeared ok but on the Backflip there are a few notable differences.</p><p>I have edittext boxes which on the emulator automatically vary in size to accommodate the text.  The text is a number, the max being two digits, i.e., 1-99.  On the Backflip the edit boxes seem to be a fixed width and that width is larger than needed.  Consequently some of the edittext boxes go past the end of the screen and can't be used or seen.  This doesn't happen on the emulator.</p><p>I also have spinners.  One set of spinners is created using android.R.layout.simple_spinner_dropdown_item populated by an array from array.xml.  These spinners have the radio button showing and they work on both the emulator and the Backflip displaying a white background with black text.</p><p>The other spinner is created using int layoutID = android.R.layout.simple_spinner_item and is populated with strings from the database using an ArrayAdapter.  This spinner displays ok on the emulator with a white background with black text.  On the Backflip however, it displays the white background but with white text making the list essentially impossible to see.  The list is populated because when I press on an item the background color changes to red, the text is white, and the program works ok.</p><p>My question is:  Are these discrepancies peculiar to the Backflip or am I doing something wrong in the code?  I'd hate to think all devices come with peculiarities that require workarounds.  Hopefully I'm doing something wrong and hope someone can point out what it is.  I'll post any code someone wants to see but right now I don't know what to post.  Thanks.</p><p>[Edit]  I should add that when I use android.R.layout.simple_spinner_dropdown_item for the other spinner the text shows up ok but I now have the radio buttons which I don't want.</p>","278350","","278350","","2010-04-01 11:05:52","2010-04-01 13:03:20","Backflip Testing Results","<android><testing><device><spinner>","1","0","","",""
"2559948","1","2560129","","2010-04-01 11:18:25","34","65703","<p>I would like to invoke a webservice via Android. I need to POST some XML to a URL via HTTP.I found this snipped for sending a POST, but i dont know how to include/add the XML data itself.</p><pre><code>public void postData() {         // Create a new HttpClient and Post Header           HttpClient httpclient = new DefaultHttpClient();           HttpPost httppost = new HttpPost(""http://10.10.4.35:53011/"");         try {               // Add your data               List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);               nameValuePairs.add(new BasicNameValuePair(""Content-Type"", ""application/soap+xml""));                            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));                  // Where/how to add the XML data?             // Execute HTTP Post Request               HttpResponse response = httpclient.execute(httppost);           } catch (ClientProtocolException e) {               // TODO Auto-generated catch block           } catch (IOException e) {               // TODO Auto-generated catch block           }       }</code></pre><p>This is the complete POST message that i need to imitate:</p><pre><code>POST /a8103e90-f1e3-11dd-bfdb-8b1fcff1a110 HTTP/1.1Host: 10.10.4.35:53011Content-Type: application/soap+xmlContent-Length: 602&lt;?xml version='1.0' encoding='UTF-8' ?&gt;&lt;s12:Envelope xmlns:s12=""http://www.w3.org/2003/05/soap-envelope"" xmlns:wsa=""http://schemas.xmlsoap.org/ws/2004/08/addressing""&gt;  &lt;s12:Header&gt;    &lt;wsa:MessageID&gt;urn:uuid:fc061d40-3d63-11df-bfba-62764ccc0e48&lt;/wsa:MessageID&gt;    &lt;wsa:Action&gt;http://schemas.xmlsoap.org/ws/2004/09/transfer/Get&lt;/wsa:Action&gt;    &lt;wsa:To&gt;urn:uuid:a8103e90-f1e3-11dd-bfdb-8b1fcff1a110&lt;/wsa:To&gt;    &lt;wsa:ReplyTo&gt;      &lt;wsa:Address&gt;http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous&lt;/wsa:Address&gt;    &lt;/wsa:ReplyTo&gt;  &lt;/s12:Header&gt;  &lt;s12:Body /&gt;&lt;/s12:Envelope&gt;</code></pre>","111093","","","","","2013-02-19 11:41:36","Android, sending XML via HTTP POST (SOAP)","<xml><android><http><soap><post>","7","2","28","",""
"2560083","1","2563714","","2010-04-01 11:50:30","0","3557","<p>I'm using this kind of code for my TCP/IP connection:</p><pre><code>sock = new Socket(host, port);sock.setKeepAlive(true);din = new DataInputStream(sock.getInputStream());dout = new DataOutputStream(sock.getOutputStream());</code></pre><p>Then, in separate thread I'm checking <code>din.available()</code> bytes to see if there are some incoming packets to read. </p><p>The problem is, that if a packet bigger than 2048 bytes arrives, the <code>din.available()</code> returns 2048 anyway. Just like there was a 2048 internal buffer. I can't read those 2048 bytes when I know it's not the full packet my application is waiting for. If I don't read it however - it'll all stuck at 2048 bytes and never receive more.</p><p>Can I enlarge the buffer size of <code>DataInputStream</code> somehow? Socket receive buffer is 16384 as returned by <code>sock.getReceiveBufferSize()</code> so it's not the socket limiting me to 2048 bytes.</p><p>If there is no way to increase the <code>DataInputStream</code> buffer size - I guess the only way is to declare my own buffer and read everything from DataInputStream to that buffer? </p><p>Regards</p>","306831","","","","","2010-04-01 21:08:28","How to change internal buffer size of DataInputStream","<java><android><sockets><network-programming>","4","2","","",""
"2560151","1","2915388","","2010-04-01 12:07:06","0","784","<p>Hi I want a list view and below of that list view i want one image.when i use the below code the list view and image view are appeared only in Portrait mode but not landscape mode,Can any one gie me the suggestions for displaying that list view and image view in Landscape also.My xml code is </p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;FrameLayout     android:id=""@+id/FrameLayout01""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;com.google.android.maps.MapView             android:id=""@+id/mapView""             android:layout_width=""fill_parent""             android:enabled=""true""             android:clickable=""true""             android:apiKey=""@string/apikey""             android:layout_height=""wrap_content""             /&gt;            &lt;RelativeLayout     android:orientation=""vertical""                        android:layout_width=""fill_parent""                        android:id=""@+id/linerlayouttransparent""                        android:layout_height=""fill_parent""&gt;&lt;LinearLayout   xmlns:android=""http://schemas.android.com/apk/res/android""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                android:orientation=""vertical""                android:gravity=""top""                android:paddingBottom=""100sp""                &gt;     &lt;com.fitzengineering.teslaworldnet.presentationlayer.TransparentPanel            android:id=""@+id/transparent_panel""             android:layout_width=""fill_parent""            android:paddingTop=""5sp""            android:paddingLeft=""5sp""            android:paddingRight=""5sp"" android:layout_height=""wrap_content"" android:paddingBottom=""5sp""&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ListView android:id=""@+id/ListView01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;/ListView&gt;&lt;TextView android:id=""@+id/TextView01"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""  android:height=""5sp""&gt;  &lt;/TextView&gt;  &lt;ImageView   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:clickable=""true"" android:focusable=""true"" android:src=""@drawable/back_normal_icon""android:layout_gravity=""center_horizontal"" android:id=""@+id/backImageView""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;&lt;/com.fitzengineering.teslaworldnet.presentationlayer.TransparentPanel&gt; &lt;/LinearLayout&gt;  &lt;/RelativeLayout&gt; &lt;/FrameLayout&gt;</code></pre><p>Thanks in adnance</p>","454808","","454808","","2010-04-01 12:26:43","2010-06-26 20:00:05","List View Below Image","<android>","2","0","","",""
"2560570","1","","","2010-04-01 13:15:08","0","911","<p>i got an error when converted jar file into eclipse.</p><p>The error is ""Error generating final archive: duplicate entry: classes.dex""</p><p>Anyone please help me?</p>","302314","","","","","2010-04-01 13:17:47","Android converted jar file into eclipse error","<android>","1","0","","",""
"2560748","1","2583320","","2010-04-01 13:42:43","4","4245","<p>I was trying to write to an AudioTrack from a jni callback, and I get a signal 7 (SIGBUS), fault addr 00000000.</p><p>I have looked at the Wolf3D example for <a href=""http://dev.odroid.com/wiki/odroid/pds/FrontPage/Wolf3D.zip"" rel=""nofollow"">odroid</a> and they seem to use a android.os.Handler to post a Runnable that will do an update in the correct thread context. I have also tried AttachCurrentThread, but I fail in this case also.</p><p>It works to play the sound when running from the constructor even if I wrap it in a thread and then post it to the handler. When I do the ""same"" via a callback from jni it fails. I assume I am braeaking some rules, but I haven't been able to figure out what they are. So far, I haven't found the answer here on SO.</p><p>So I wonder if anyone knows how this should be done.</p><p>EDIT: Answered below.</p><p>The following code is to illustrate the problem.</p><p>Java:</p><pre><code>package com.example.jniaudiotrack;import android.app.Activity;import android.media.AudioFormat;import android.media.AudioManager;import android.media.AudioTrack;import android.os.Bundle;import android.os.Handler;import android.util.Log;public class JniAudioTrackActivity extends Activity {    AudioTrack mAudioTrack;    byte[] mArr;    public static final Handler mHandler = new Handler();    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mArr = new byte[2048];        for (int i = 0; i &lt; 2048; i++) {            mArr[i] = (byte) (Math.sin(i) * 128);        }        mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC,                11025,                AudioFormat.CHANNEL_CONFIGURATION_MONO,                AudioFormat.ENCODING_PCM_8BIT,                2048,                AudioTrack.MODE_STREAM);        mAudioTrack.play();        new Thread(new Runnable() {            public void run() {                mHandler.post(new Runnable() {                    public void run() {                        mAudioTrack.write(mArr, 0, 2048);                        Log.i(TAG, ""*** Handler from constructor ***"");                    }                });            }        }).start();        new Thread(new Runnable() {            public void run() {                audioFunc();            }        }).start();    }    public native void audioFunc();    @SuppressWarnings(""unused"")    private void audioCB() {        mHandler.post(new Runnable() {            public void run() {                mAudioTrack.write(mArr, 0, 2048);                Log.i(TAG, ""*** audioCB called ***"");            }        });    }    private static final String TAG = ""JniAudioTrackActivity"";    static {        System.loadLibrary(""jni_audiotrack"");    }}</code></pre><p>cpp:</p><pre><code>#include &lt;jni.h&gt;extern ""C"" {    JNIEXPORT void Java_com_example_jniaudiotrack_JniAudioTrackActivity_audioFunc(JNIEnv* env, jobject obj);}JNIEXPORT void Java_com_example_jniaudiotrack_JniAudioTrackActivity_audioFunc(JNIEnv* env, jobject obj){    JNIEnv* jniEnv;    JavaVM* vm;    env-&gt;GetJavaVM(&amp;vm);    vm-&gt;AttachCurrentThread(&amp;jniEnv, 0);    jclass cls = env-&gt;GetObjectClass(obj);    jmethodID audioCBID = env-&gt;GetMethodID(cls, ""audioCB"", ""()V"");    if (!audioCBID) {        return;    }    env-&gt;CallVoidMethod(cls, audioCBID);}</code></pre><p>Trace snippet:</p><pre><code>I/DEBUG   ( 1653): pid: 9811, tid: 9811  &gt;&gt;&gt; com.example.jniaudiotrack &lt;&lt;&lt;I/DEBUG   ( 1653): signal 7 (SIGBUS), fault addr 00000000I/DEBUG   ( 1653):  r0 00000800  r1 00000026  r2 00000001  r3 00000000I/DEBUG   ( 1653):  r4 42385726  r5 41049e54  r6 bee25570  r7 ad00e540I/DEBUG   ( 1653):  r8 000040f8  r9 41048200  10 41049e44  fp 00000000I/DEBUG   ( 1653):  ip 000000f8  sp bee25530  lr ad02dbb5  pc ad012358  cpsr 20000010I/DEBUG   ( 1653):          #00  pc 00012358  /system/lib/libdvm.so</code></pre>","128800","","128800","","2010-04-06 07:37:57","2012-05-09 17:59:21","How do I handle calls to AudioTrack from jni without crashing?","<java><android><jni><android-ndk>","1","2","1","",""
"2560941","1","2561229","","2010-04-01 14:09:05","0","67","<p>I have a UI that has 6 EditText boxes.  3 of those EditText boxes don't show up when in vertical orientation.  I was hoping that wrap_content would wrap the non-showing 3 to the next line but found out that LinearLayout only allows for one row.</p><p>When in horizontal orientation I get all 6 of them showing.</p><p>I tried a TableView with two rows of 3 each.  That looks dorky when in horizontal orientation.</p><p>Do I need code to determine when the orientation changes to redraw those EditText boxes so it looks better or is there some layout that will automatically wrap when in vertical orientation?</p>","278350","","","","","2010-04-02 12:14:19","Wraping EditText Boxes in Layout","<android><layout>","2","0","","",""
"2560950","1","2561149","","2010-04-01 14:10:47","16","3648","<p>Has anyone seen or compiled benchmarks comparing declarative (XML) versus programmatically created UI's in Android?</p><p>There are things that Google has done to speed up the declarative approach, but you still do have the layout inflation step done at runtime.</p><p>Have you ever switched (or considered) changing your UI from declarative to programmatic for any reason?</p>","131640","","19750","","2010-04-01 14:16:40","2012-09-05 12:03:57","Android - Declarative vs Programmatic UI","<android><performance>","3","4","8","",""
"2561161","1","11240076","","2010-04-01 14:39:26","8","365","<p>When I'm editing XML files in Eclipse (mainly, Android layouts and so), it causes leaks on XServer and it ends eating all my RAM (4GB), so I have to Ctrl+Alt+Backspace to continue.</p><p>Do you know any remedy for that?</p>","305582","","1101070","","2012-03-06 01:42:30","2012-06-28 07:37:12","How to avoid Eclipse leaks on XServer when editing Android XML files?","<xml><android><linux><eclipse><xserver>","3","10","1","",""
"2561573","1","4651938","","2010-04-01 15:33:01","7","2770","<p>I just accidentally discovered the ant task for test coverage reports with emma.I'm now looking for a target that only invokes the unit test and generates unit testing output. Is there a list with the available ant targets somewhere, or is it possible to look them up somewhere inside the code of the SDK?</p>","114066","","","","","2013-01-07 14:00:29","Documentation of available Ant tasks for Android?","<android><documentation><ant>","3","0","3","",""
"2561598","1","2562307","","2010-04-01 15:36:18","28","29641","<p>I'm creating a splash screen that will display while my Android application loads.  I'd like to create it at the correct size so Android won't auto-scale it up or down to fit the screen.  (It's a bitmap image, a photograph of an oil painting, so I can't just turn it into a nine-patch.)</p><p>But there are at least three important screen sizes I care about: 320x480, 480x854 (Droid), and 480x800 (Nexus One).</p><p>I've read the documentation on <a href=""http://developer.android.com/guide/practices/screens_support.html"">supporting multiple screen sizes</a>, but I still don't see how I'm supposed to configure different splash screens for Droid/Nexus one (they're both ""hdpi"" resources as far as Android is concerned), and I don't know exactly how large my splash screen should be in any case. (How tall is the OS title bar/menu in Droid?  N1?)</p><p>What size should I make these images, and how do I tell Android to use the correct size on a given screen?</p>","54829","","54829","","2010-08-26 19:42:02","2013-01-21 14:49:59","What resolution should my Android splash screens be?","<android><resolution><splash-screen>","3","3","15","",""
"2561711","1","2799224","","2010-04-01 15:51:44","2","985","<p>Hello there i'm trying to write a layout similar to the timepicker widget layout.</p><p>So i decided to use the android framework layouts but i can't use them It seems that if i write android.R.drawable.timepicker_input or other timepicker related drawables i get them this Eclipse error:</p><blockquote>  <p>android.R.drawable.timepicker_up_btn cannot be resolved</p></blockquote><p>So i tried to import all the pngs and xml  from the android source but eclipse says there is an error in the manifest regarding the icon.</p><p>Ideas? </p>","314407","","","","","2010-05-09 21:23:07","Cannot access android.R.drawable.timepicker_input","<android>","2","0","","",""
"2562051","1","2830994","","2010-04-01 16:44:42","55","74705","<p>Is it possible to apply a custom background to each Listview item via the list selector?</p><p>The default selector specifies <code>@android:color/transparent</code> for the <code>state_focused=""false""</code> case, but changing this to some custom drawable doesn't affect items that aren't selected. Romain Guy seems to suggest <a href=""http://stackoverflow.com/questions/2217753/changing-background-color-of-listview-items-on-android/2218270#2218270"">in this answer</a> that this is possible.</p><p>I'm currently achieving the same affect by using a custom background on each view and hiding it when the item is selected/focused/whatever so the selector is shown, but it'd be more elegant to have this all defined in one place.</p><p>For reference, this is the selector I'm using to try and get this working:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_focused=""false""        android:drawable=""@drawable/list_item_gradient"" /&gt;    &lt;!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. --&gt;    &lt;item android:state_focused=""true"" android:state_enabled=""false""        android:state_pressed=""true""        android:drawable=""@drawable/list_selector_background_disabled"" /&gt;    &lt;item android:state_focused=""true"" android:state_enabled=""false""        android:drawable=""@drawable/list_selector_background_disabled"" /&gt;    &lt;item android:state_focused=""true"" android:state_pressed=""true""        android:drawable=""@drawable/list_selector_background_transition"" /&gt;    &lt;item android:state_focused=""false"" android:state_pressed=""true""        android:drawable=""@drawable/list_selector_background_transition"" /&gt;    &lt;item android:state_focused=""true""        android:drawable=""@drawable/list_selector_background_focus"" /&gt;&lt;/selector&gt;</code></pre><p>And this is how I'm setting the selector:</p><pre><code>&lt;ListView    android:id=""@android:id/list""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:listSelector=""@drawable/list_selector_background"" /&gt;    </code></pre><p>Thanks in advance for any help!</p>","307071","","","","","2014-04-15 10:13:21","ListView item background via custom selector","<android><listview><selector>","8","1","63","",""
"2562103","1","2565631","","2010-04-01 16:52:10","3","7202","<p>I am testing out an Android application I wrote with google maps. The DDMS is not loading the KML/GPX files I found on the internet. </p><p>What I assume is that the files are relatively old in format (Maximum 2007) and the DDMS cannot read them. I was wondering if there is somewhere I can download a sample KML or GPX file that I can use to test out my application.</p>","45471","","582594","","2012-09-06 04:53:23","2013-09-13 07:21:14","Android : Sample KML/GPX compatible with DDMS","<android><android-emulator>","3","0","1","",""
"2562206","1","2598857","","2010-04-01 17:10:24","22","12434","<p>Nasty little bug, this one.</p><p>As illustrated in <a href=""http://code.google.com/p/android/issues/detail?id=6721"">Android ticket 6721</a>, the Android browser seems to not respect z-index when absolutely positioned elements are laid over the top of <code>&lt;a&gt;</code> or <code>&lt;input&gt;</code> tags.I am desperate for any sort of workaround. Has anybody conquered this one before?</p><p>Thanks in advance!</p>","","c_harm","","","","2012-01-08 22:38:01","Android Webkit: Absolutely positioned elements don't respect z-index","<javascript><html><css><android><mobile-webkit>","6","4","11","",""
"2562248","1","2562449","","2010-04-01 17:18:06","87","29254","<p>I've thought of some less than elegant ways to solve this, but I know I must be missing something.</p><p>My onItemSelected fires off immediately without any interaction with the user, and this is undesired behavior.  I wish for the UI to wait until the user selects something before it does anything.</p><p>I even tried setting up the listener in the onResume, hoping that would help, but it doesn't.</p><p>How can I stop this from firing off before the user can touch the control?THANKS</p><pre><code>public class CMSHome extends Activity { private Spinner spinner;@Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // Heres my spinner ///////////////////////////////////////////    spinner = (Spinner) findViewById(R.id.spinner);    ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(            this, R.array.pm_list, android.R.layout.simple_spinner_item);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spinner.setAdapter(adapter);    };public void onResume() {    super.onResume();    spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());}    public class MyOnItemSelectedListener implements OnItemSelectedListener {    public void onItemSelected(AdapterView&lt;?&gt; parent,        View view, int pos, long id) {     Intent i = new Intent(CMSHome.this, ListProjects.class);     i.putExtra(""bEmpID"", parent.getItemAtPosition(pos).toString());        startActivity(i);        Toast.makeText(parent.getContext(), ""The pm is "" +          parent.getItemAtPosition(pos).toString(), Toast.LENGTH_LONG).show();    }    public void onNothingSelected(AdapterView parent) {      // Do nothing.    }}</code></pre><p>}</p>","305564","","","","","2014-03-27 15:44:04","Android: How to keep onItemSelected from firing off on a newly instantiated Spinner","<android><spinner>","13","1","34","",""
"2562329","1","6830202","","2010-04-01 17:33:47","4","1952","<p>I have an Android test project that I'd like to link into Hudson, but I haven't found a way to output the test results as XML instead of text. Does anyone know if there's an easy way to do this already?</p><p>-Dan</p>","212389","","","","","2011-07-26 12:44:19","Android InstrumentationTestRunner XML output for Hudson ingestion","<xml><android><instrumentation>","5","0","4","",""
"2562408","1","2562454","","2010-04-01 17:46:36","10","12124","<p>I'm defining a style XML for my android app.  I have some TTF files I want to use, how can I set the typeface to use those files as the font as opposed to the generic ""sans"", ""serif"" &amp; ""monospace"".  Thanks</p>","180825","","","","","2013-12-16 12:40:01","Set specific font in a styles.xml","<xml><android><fonts>","5","0","3","",""
"2562435","1","","","2010-04-01 17:51:17","5","3605","<p>In some books and online I see these method calls being made after adatabase is created:</p><pre><code>db.setLocale(Locale.getDefault());db.setLockingEnabled(true);db.setVersion(DB_VERSION);</code></pre><p>Why is this done? As far as I can tell, after creating a new database,the system adds a table named android_metadata with one field namedlocale and that table has one row with the locale field set to""en_US"". Now I assume the column has that value because I am using aU.S. phone, and if I were using a phone from a different region thenthe locale field would be set appropriately. Can anyone confirm this?I'm guessing that the setLocale method would only be useful in thecase that you install a pre-built database onto a phone and then wantto change the locale to match the phone's locale. Sound right?</p><p>The documentation for setLockingEnabled says it defaults to true sothere's no need to make that call, right?</p><p>Lastly, what's with the call to setVersion? I can't find a table thatcontains this information so I've been assuming that the database fileitself stores the version number somewhere. So when I create adatabase, which requires you to have already specified the versionnumber in the call to the SQLiteOpenHelper constructor, there's nopoint in calling setVersion. Again, perhaps this method exists for thecase of installing a pre-built database to a device and you then wishto change the database's version (though I can't think of when doingthis would make sense).</p><p>Thanks for any insight! </p>","277774","","277774","","2010-04-01 18:11:01","2010-04-01 18:30:51","Android SQLite database locale, locking, and version","<database><android><sqlite>","1","0","2","",""
"2562478","1","2562525","","2010-04-01 17:56:11","0","604","<p>i am developing an android todo list app to learn. right now in my main layout xml file, i list all to-do list items. i created a menu button called add to add a new to-do. the problem is that i want to show a different view when add button is pressed. in that view i will have an editbox and 2 buttons. anyone have any suggestion on how that can be accomplished?</p>","157332","","","","","2010-08-25 12:00:09","android separate view on button press","<android>","4","0","","",""
"2562629","1","","","2010-04-01 18:21:03","2","1311","<p>I love the BarCode Scanner application for the Android phone; We're using Motorola's Droid. </p><p>Is it possible to access the BarCode Scanner from a web application running on the phone? I was thinking of using a WebView, but I'm not sure how I'd access the Scanner API.</p>","307149","","128421","","2011-06-17 01:53:49","2011-06-17 01:53:49","How can I access Android's Barcode Scanner from WebView?","<android><barcode>","2","0","1","",""
"2562645","1","","","2010-04-01 18:23:12","1","993","<p>I'd like to know how to generate a fake press button event . The button in cause is a options menu button. Please tell me if this is possible, or sugest other references !</p><p>Thanks !</p>","284609","","","","","2011-12-20 01:32:04","generate a fake KeyEvent","<android>","2","0","","",""
"2562706","1","","","2010-04-01 18:32:16","2","779","<p>I would like to be able to switch between various android releases (1.0, 1.5, 2.0, etc.) and then access them via the file system to copy all files for that version into a tarball. Currently I am just running <code>repo init -u &lt;source URL&gt; -b release-1.</code> to get each version (changing the tag for each version I need). If this was a single git, I could check out the branch/tag I needed and the prject directory would ""morph"" to reflect then and I could just tar that folder. since the android source is split into multiple git repositories controlled by repo I have not yet found a way to change this other then the method mentioned above. </p><p>any suggestions are appreciated.</p>","294294","","280526","","2010-04-01 18:36:43","2011-03-20 12:57:17","A better way of switching between Android source versions","<android><git><android-manifest><repository>","2","0","","",""
"2563325","1","2563482","","2010-04-01 20:08:32","18","28625","<p>Ok.  I have looked EVERYWHERE and my little brain just can't understand a better way to refresh an activity.  Any suggestions that I can understand would be great.  :)</p><p>Here is the java code:</p><pre><code>package com.dge.dges;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.webkit.WebView;import android.widget.Button;public class dgeActivity extends Activity { WebView mWebView;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mWebView = (WebView) findViewById(R.id.webview);        mWebView.getSettings();        mWebView.loadUrl(""http://www.websitehere.php"");        Button newButton = (Button)findViewById(R.id.new_button);        newButton.setOnClickListener(new View.OnClickListener() {   public void onClick(View v) {    Intent intent = new Intent(dgeActivity.this, dgeActivity.class);    startActivity(intent);   }        });    }}</code></pre><p>And here is the main.xml</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/RelativeLayout"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:background=""#000000""&gt; &lt;WebView        android:id=""@+id/webview""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:scrollbars=""none"" /&gt; &lt;Button  android:id=""@+id/new_button""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:layout_alignParentBottom=""true""  android:layout_centerHorizontal=""true""  android:text=""Refresh"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>I don't like the idea of just re-stacking activity after activity.  There has to be an easier way to refresh the webview.  Please help.  :)</p>","307235","","16623","","2010-04-01 20:11:05","2013-11-08 18:50:27","Is there a better way to refresh WebView?","<android><refresh><webview><reload>","6","0","3","",""
"2563447","1","2578451","","2010-04-01 20:28:05","2","187","<p>I need to use google analytics tracking for my app and it says that it is supported with versions 1.6 and higher.</p><p>But my app runs on versions 1.5 and higher and right now it does not have an issue when I add the tracking code to my manifest.</p><pre><code>  &lt;receiver android:name=""com.google.android.apps.analytics.AnalyticsReceiver"" android:exported=""true""&gt;    &lt;intent-filter&gt;      &lt;action android:name=""com.android.vending.INSTALL_REFERRER"" /&gt;    &lt;/intent-filter&gt;  &lt;/receive&gt;</code></pre><p>I was wondering if this will be a problem after I release it into the android market.</p>","229266","","","","","2010-04-07 15:47:23","android analytics tracking issue with sdk1.5?","<android>","2","0","1","",""
"2563480","1","2563518","","2010-04-01 20:32:48","0","978","<p>Good advice from CommonWare and Steve H but it's not as easy to me as I first thought.</p><p>Based on their advice I'm trying to copy android.R.layout to my project to ensure consistency.  How do you do this?</p><p>I looked in Eclipse's Package Explorer and underAndroid 1.5>android.jar>android>R.class>R>layout and find R$layout.class.</p><p>Do I copy the code out of there into my own class?  From my very limited knowledge of Java, the following code doesn't make much sense:</p><pre><code>public static final class android.R$layout {  // Field descriptor #8 Ipublic static final int activity_list_item = 17367040;// Field descriptor #8 Ipublic static final int browser_link_context_header = 17367054;// Field descriptor #8 Ipublic static final int expandable_list_content = 17367041;// Field descriptor #8 Ipublic static final int preference_category = 17367042;// Field descriptor #8 Ipublic static final int select_dialog_item = 17367057;// Field descriptor #8 Ipublic static final int select_dialog_multichoice = 17367059;// Field descriptor #8 Ipublic static final int select_dialog_singlechoice = 17367058;// Field descriptor #8 Ipublic static final int simple_dropdown_item_1line = 17367050;// Field descriptor #8 Ipublic static final int simple_expandable_list_item_1 = 17367046;// Field descriptor #8 Ipublic static final int simple_expandable_list_item_2 = 17367047;// Field descriptor #8 Ipublic static final int simple_gallery_item = 17367051;// Field descriptor #8 Ipublic static final int simple_list_item_1 = 17367043;// Field descriptor #8 Ipublic static final int simple_list_item_2 = 17367044;// Field descriptor #8 Ipublic static final int simple_list_item_checked = 17367045;// Field descriptor #8 Ipublic static final int simple_list_item_multiple_choice = 17367056;// Field descriptor #8 Ipublic static final int simple_list_item_single_choice = 17367055;// Field descriptor #8 Ipublic static final int simple_spinner_dropdown_item = 17367049;// Field descriptor #8 Ipublic static final int simple_spinner_item = 17367048;// Field descriptor #8 Ipublic static final int test_list_item = 17367052;// Field descriptor #8 Ipublic static final int two_line_list_item = 17367053;// Method descriptor #50 ()V// Stack: 3, Locals: 1public R$layout(); 0  aload_0 [this] 1  invokespecial java.lang.Object() [1] 4  new java.lang.RuntimeException [2] 7  dup 8  ldc &lt;String ""Stub!""&gt; [3]10  invokespecial java.lang.RuntimeException(java.lang.String) [4]13  athrow  Line numbers:    [pc: 0, line: 899]  Local variable table:    [pc: 0, pc: 14] local: this index: 0 type: android.R.layoutInner classes: [inner class info: #5 android/R$layout, outer class info: #64 android/R  inner name: #55 layout, accessflags: 25 public static final] }</code></pre>","278350","","","","","2010-04-01 21:06:54","Copy android.R.layout to my project","<android><layout><copy><project>","2","2","","",""
"2563897","1","","","2010-04-01 21:47:34","12","11003","<p>i'm trying to make (for learning purposes) my own implementation of a simple AdapterView where items comes from an basic Adapter (ImageAdapter from sdk samples).</p><p>Actual code is like this:</p><pre><code>    public class MyAdapterView extends AdapterView&lt;ImageAdapter&gt; implements AdapterView.OnItemClickListener{    private ImageAdapter mAdapter;    public MyAdapterView(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        initThings();    }    private void initThings(){        setOnItemClickListener(this);    }    @Override    public ImageAdapter getAdapter() {        // TODO Auto-generated method stub        return mAdapter;    }    @Override    public void setAdapter(ImageAdapter adapter) {        // TODO Auto-generated method stub        mAdapter=adapter;        requestLayout();    }    View obtainView(int position) {        View child = mAdapter.getView(position, null, this);        return child;    }    @Override    protected void onLayout(boolean changed, int l, int t, int r, int b) {     super.onLayout(changed, l, t, r, b);        for(int i=0;i&lt;mAdapter.getCount();i++){            View child = obtainView(i);            child.layout(10, 70*i, 70, 70);            addViewInLayout(child, i, null, true);        }        this.invalidate();    }    @Override    public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {        Log.d(""MYEXAMPLES"",""Clicked an item!"");    }}</code></pre><p>This isn't a coding masterpiece, it just displays a pseudo-listview with pictures. I know i could've used ListView, GridView, Spinner, etc. but i'm relative new to android and i'm trying to figure out some things on it.</p><p>Well, the question here is:Why is my <B>onItemClick</B> not firing?</p><p>Using the same ImageAdapter with a GridView, everything works ok, but when i use with above class, i get nothing.Inside <B>AdapterView.java</B> there is code for those click, longclick, etc events... so why can't i just fire them?Maybe i'm misunderstanding basic things on how AdapterView works? Should I extend other base classes instead? And why?</p><p>Hoping to find more experienced guidance on here, thanks in advance.</p>","307298","","1043882","","2013-02-04 03:17:15","2013-05-10 23:57:32","Extending AdapterView","<android><android-adapterview>","3","1","3","",""
"2563941","1","2564100","","2010-04-01 21:54:40","3","13478","<p>I would like to apply successive animations (say ScaleAnimation) to an ImageView showing a resource image. The animation is triggered by a button. For example, I would like to incrementally enlarge an image upon each button click.</p><p>I've set fillAfter=""true"" on the animation. However, all the animations start from the original state of the ImageView. It seems as if the ImageView resets its state and the animation is always the same, instead of starting from the final state of the previous animation.</p><p>What am I doing wrong?</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button button = (Button)findViewById(R.id.Button01);    button.setOnClickListener(new OnClickListener() {        public void onClick(View arg0) {            animate();        }});}private void animate() {    ImageView imageView = (ImageView) findViewById(R.id.ImageView01);    ScaleAnimation scale = new ScaleAnimation((float)1.0, (float)1.5, (float)1.0, (float)1.5);    scale.setFillAfter(true);    scale.setDuration(500);    imageView.startAnimation(scale); }</code></pre>","143378","","","","","2010-09-10 13:54:57","Applying successive animations to ImageView in Android","<android><animation><imageview><drawable>","2","0","1","",""
"2563973","1","","","2010-04-01 22:00:13","25","25838","<p>I'm using the Android APIDemo sample code.</p><p>When I run the CameraPreview example, at first it was <a href=""http://stackoverflow.com/questions/2556389/android-camera-functionality-howto"">giving me an error</a>.  </p><p>I traced that one down and the sample was working for a while.<br>Now, it no longer works. It says </p><pre><code>ERROR/AndroidRuntime(2949): java.lang.RuntimeException: Fail to connect to camera service  </code></pre><p>What can be causing that? It happens when <code>camera.open()</code> is called.</p><p>Thanks,<br>Tee</p>","166940","","68805","","2011-09-07 07:17:47","2014-01-08 01:30:09","Android - Fail to connect to camera","<android>","8","0","3","",""
"2564027","1","2564121","","2010-04-01 22:14:12","1","1418","<p>R class on android has it's limitations. You can't use the resources dynamically for loading audio, pictures or whatever. If you wan't for example, load a set of audio files for a choosen object you can't do something like:</p><pre><code>R.raw.""string-upon-choosen-object""</code></pre><p>I'm new to android and at least I didn't find how you could do that, depending on what objects are choosen or something more dynamic than that. So, I thought about making it dynamic with a little of memory overhead. But, I'm in doubt if it's worth it or just working different with external resources.</p><h2>The idea is this:</h2><p>Modify the ant build xml to execute my own task. This task, is a java program that parses the R.java file building a set of HashMaps with it's  pair (key, value). I have done this manually and It's working good. So I need some experts voice about it. </p><p>This is how I will manage the whole thing:</p><p>Generate a base <code>Application</code> class, e.g. <code>MainApplicationResources</code> that builds up all the require methods and attributes. Then, you can access those methods invoking <code>getApplication()</code> and then the desired method. </p><p>Something like this:</p><pre><code>  package [packageName]  import android.app.Application;  import java.util.HashMap;  public class MainActivityResources extends Application {      private HashMap&lt;String,Integer&gt; [resNameObj1];      private HashMap&lt;String,Integer&gt; [resNameObj2];      ...      private HashMap&lt;String,Integer&gt; [resNameObjN];      public MainActivityResources() {          super();      [resNameObj1] = new HashMap&lt;String,Integer&gt;();      [resNameObj1].put(""[resNameObj1_Key1]"", new Integer([resNameObj1_Value1]));      [resNameObj1].put(""[resNameObj1_Key2]"", new Integer([resNameObj1_Value2]));      [resNameObj2] = new HashMap&lt;String,Integer&gt;();      [resNameObj2].put(""[resNameObj2_Key1]"", new Integer([resNameObj2_Value1]));      [resNameObj2].put(""[resNameObj2_Key2]"", new Integer([resNameObj2_Value2]));      ...      [resNameObjN] = new HashMap&lt;String,Integer&gt;();      [resNameObjN].put(""[resNameObjN_Key1]"", new Integer([resNameObjN_Value1]));      [resNameObjN].put(""[resNameObjN_Key2]"", new Integer([resNameObjN_Value2]));      }      public int get[ResNameObj1](String resourceName) {          return [resNameObj1].get(resourceName).intValue();      }      public int get[ResNameObj2](String resourceName) {          return [resNameObj2].get(resourceName).intValue();      }      ...      public int get[ResNameObjN](String resourceName) {          return [resNameObjN].get(resourceName).intValue();      }}</code></pre><h2>The question is:</h2><p>Will I add too much memory use of the device? Is it worth it?</p><p>Regards,</p>","241750","","","","","2010-04-01 22:40:06","Android: Creating custom class of resources","<android>","1","0","","",""
"2564171","1","2564483","","2010-04-01 22:56:21","0","1714","<p>i am trying to do this:</p><p>1) user long touches the screen,2) a circle/ball pops up (centered around the user's finger) and grows in size as long as the user is touching the screen3) once the user lets go of the finger, the ball (now in its final size) will bounce around.</p><p>i think i have the bouncing around figure out from the DivideAndConquer example, but i am not sure how to animate the ball's growth.  i looked at various view flipper examples such as this:</p><p><a href=""http://www.inter-fuser.com/2009/08/android-animations-3d-flip.html"" rel=""nofollow"">http://www.inter-fuser.com/2009/08/android-animations-3d-flip.html</a></p><p>but it seems like view flipper is best for swapping two static pictures.  i wasn't able to find a good view animator example other than the flippers.  also, i would prefer to use images as opposed to just a circle.  can someone point me in the right direction?</p><p>thanks.</p>","270811","","76310","","2010-04-01 22:59:57","2010-04-02 00:39:08","View Animation (Resizing a Ball)","<android><animation><view>","2","0","","",""
"2564266","1","2564632","","2010-04-01 23:29:42","6","6717","<p>I have a list of items that are displayed using a ListView from a SQLCursor.  The SQL table includes(as well as other things) a _id field and an order field.  I use the order field to sort the list before it gets to the ListView.</p><p>What I need is a widget like the MediaPlayer has in its playlist view.  It allows you to click the icon and drag the item in the playlist around and put it into a new order.  With that ability I can then retrieve the new order and update the SQL table with the new order.  However, I am not having any luck finding any clues to help me add that functionality into my program. </p><p>The question is whether I can use existing functions to help me, or do I need to manually program motion events and such until I get nearly the same functionality.  </p>","307347","","","","","2012-10-25 20:57:06","Reordering Lists like playlists in the media player","<android><list><ordering><playlist>","1","0","2","",""
"2564357","1","","","2010-04-01 23:54:01","2","3041","<p>I would like to obtain the transformation matrix of an animation to calculate the position of the view that was animated.</p><p>It seems the Animation class has a method called getTransformation that can be used to obtain the transformation applied to the view.</p><p>However, if I use getTransformation before starting the animation I obtain the identity matrix. And if I use it like this:</p><pre><code>public void onAnimationEnd(Animation animation) {    Transformation t = new Transformation();    animation.getTransformation(animation.getDuration(), t);}</code></pre><p>The program enters an infite loop because getTransformation seems to trigger onAnimationEnd (why?).</p><p>How should I use getTransformation to obtain the transformation matrix of an animation? Is there another way to do this?</p>","143378","","","","","2013-03-06 19:49:40","Getting the transformation matrix of an animation in Android","<android><animation><matrix><transformation>","2","0","0","",""
"2564358","1","","","2010-04-01 23:54:33","2","557","<p>Having a problem in Eclipse with regards to an XML file. Eclipse complains that android:scrollbars and android:fadingEdge do not allow Strings.  I checked the Android developer site and they do in fact accept strings in the xml file. A related question posed had the problem where there was a missing :android after xmlns. As you can see from the code the line beginning with xmlns is correct I believe. Here is the complete file contents:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;  &lt;com.example.todolist.TodoListItemView   xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:padding=""10dp""  android:scrollbars=""verticle""  android:textColor=""@color/notepad_text""  android:fadingEdge=""verticle""/&gt;</code></pre>","307351","","","","","2010-04-02 00:21:24","Eclipse complains android:scrollbars and android:fadingEdge do not allow Strings - includes code","<xml><android><eclipse>","1","0","","",""
"2564487","1","","","2010-04-02 00:40:50","4","9332","<p>I created a Hello World application, and the system generated most of the Android language below.  When running the app without the <code>System.out</code> statement, there is no ""Hello"" displayed in the emulator.  Then, using the Eclipse tutorial, I read that I can add the <code>System.out.println</code> statement to main.  Again the app runs, but there is no output.  </p><p>What am I not understanding here? </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    System.out.println ="" Hello world!""     /&gt;&lt;/LinearLayout&gt;</code></pre>","307379","","122607","","2012-04-02 20:04:11","2012-04-02 20:04:11","My Android ""Hello World"" app doesn't say ""Hello"" ","<android><hello-world>","4","1","","",""
"2564550","1","","","2010-04-02 01:04:57","14","1488","<p>How is an app's position in the Android Market search results determined? Is it as mysterious and complex as Google Web search results?</p><p>We obviously don't want to change any words in our app's title or description that would hurt our position. </p><p>Same question applies for not only search results, but when clicking on a Category in the Android Market. How is the order of the list determined?</p><p>Hopefully someone here can help. I would think that Google would have published some guidelines at least that could help, but I haven't found anything yet.</p>","483163","","","","","2010-11-16 21:57:21","Android Market, Search results position Mystery","<android><search><position><google-play>","2","3","1","",""
"2564871","1","2568749","","2010-04-02 03:37:45","3","5857","<p>i notice in the Android Default Voice Recorder that can sense how loud is your voice and <a href=""http://www.androidtapp.com/wp-content/uploads/2009/08/OI-Shopping-Voice-Recording.jpg"" rel=""nofollow"">show it to you in UI parameter</a> .</p><p>Can i use this from the intent or how can i program a code that sense the loudness of the voice in Android.</p>","302707","","","","","2012-09-23 13:25:28","Default Record Voice in Android","<java><android>","2","0","5","",""
"2565009","1","","","2010-04-02 04:30:43","1","959","<p>In an Android app I have a utility class that I use to parse strings for 2 regEx's. I compile the 2 patterns in a static initializer so they only get compiled once, then activities can use the parsing methods statically.</p><p>This works fine except that the first time the class is accessed and loaded, and the static initializer compiles the pattern, the UI hangs for close to a MINUTE while it compiles the pattern! After the first time, it flies on all subsequent calls to parseString().</p><p>My regEx that I am using is rather large - 847 characters, but in a normal java webapp this is lightning fast. I am testing this so far only in the emulator with a 1.5 AVD.</p><p>Could this just be an emulator issue or is there some other reason that this pattern is taking so long to compile?</p><pre><code>private static final String exp1 = ""(insertratherlong---847character--regexhere)"";private static Pattern regex1 = null;private static final String newLineAndTagsExp = ""[&lt;&gt;\\s]"";private static Pattern regexNewLineAndTags = null;static {    regex1 = Pattern.compile(exp1, Pattern.CASE_INSENSITIVE);    regexNewLineAndTags = Pattern.compile(newLineAndTagsExp);}public static String parseString(CharSequence inputStr) {    String replacementStr = ""replaceMentText"";    String resultString = ""none"";    try {        Matcher regexMatcher = regex1.matcher(inputStr);        try {            resultString = regexMatcher.replaceAll(replacementStr);        } catch (IllegalArgumentException ex) {        } catch (IndexOutOfBoundsException ex) {        }    } catch (PatternSyntaxException ex) {    }    return resultString;}</code></pre>","268648","","","","","2010-04-04 17:43:14","Using java.util.regex in Android apps - are there issues with this?","<android>","2","0","1","",""
"2565023","1","","","2010-04-02 04:37:49","8","7726","<p>I want to use an animation on a Home page Widget, i.e. an AppWidgetProvider.  I was hoping to use the ""Frame Animation"" technique:</p><p><a href=""http://developer.android.com/guide/topics/graphics/2d-graphics.html#frame-animation"">http://developer.android.com/guide/topics/graphics/2d-graphics.html#frame-animation</a></p><p>which I've used successfully in an activity.  But I can't translate that code to an AppWidgetProvider.</p><p>Basically, in an AppWidgetProvider, I create and work with a RemoteViews object, which AFAIK doesn't provide me with a method to get a reference to an ImageView in the layout for me to call start() on the animation.  There is also not a handler or a callback for when the widget displays so I can make the start() call.</p><p>Is there another way this can be done?  I suppose that I can probably do the animation on my own with very fast onUpdate() calls on the widget, but that seems awfully expensive.</p>","274106","","","","","2012-11-29 21:59:44","Is there a way to animate on a Home Widget?","<android>","5","0","6","",""
"2565083","1","","","2010-04-02 05:07:00","0","3085","<p>Hi in my application scroll bar is just too skinny to use. Does anyone know how to change the width of this? Thanks in advance</p>","454808","","","","","2010-04-02 06:03:41","Width of a scroll bar in android","<android>","1","0","1","",""
"2565253","1","","","2010-04-02 06:10:22","0","912","<p>I've been developing a live wallpaper using GLWallpaperService, and have gotten good results overall.  It runs rock-solid in the emulator and looks good.  I've dealt with OpenGL many times before so have a solid command of how to do things... unfortunately I'm having a hell of a time getting this to actually be stable on the actual hardware.</p><p>The basic symption occurs when you slide the physical keyboard on a Motorola Droid in and out a few times.  This causes the wallpaper to get destroyed/recreated several times in quick succession -- which would be fine, as I have my assets clearing in onDestroy and reloading in onSurfaceChanged.  The problem is after a few iterations of this, (four or five, maybe) the calls to onSurfaceChanged completely stop, and i get an endless string of this printed to the log:</p><p>04-02 00:53:18.088: WARN/SharedBufferStack(1032): waitForCondition(ReallocateCondition) timed out (identity=337, status=0). CPU may be pegged. trying again.</p><p>Is there something I should be implementing here aside from the Android-typical onSurfaceCreated/onSurfaceChanged/onSurfaceDestroyed triumvirate?  Browsing through the WallpaperService and WallpaperRenderer classes doesn't pop up anything obvious to me.</p>","307476","","44729","","2010-07-04 20:50:48","2010-08-16 09:56:14","Android Live Wallpaper: waitForCondition(ReallocateCondition)","<android><opengl-es>","1","0","1","",""
"2565272","1","","","2010-04-02 06:14:31","-1","223","<p>I am having problems getting transparency to work well on an ImageView. The images at (http://img265.imageshack.us/img265/6233/whatn.png) were screen captured from a Droid (hdpi). The top image I made in Photoshop and left the background white. The bottom image is the same image with the background transparent and the layout's color (white) shows through.</p><p>Whenever I have transparent backgrounds in images it dithers shadows like this. Also, it only happens on hdpi devices, on my G1 (mdpi) it looks just fine. What is going on? How can I make the bottom image look as good as the top one?</p>","246589","","1101070","","2012-03-07 02:59:29","2012-03-07 03:32:11","Poor Transparency on Images","<android>","2","2","","",""
"2565279","1","2565921","","2010-04-02 06:15:52","2","7014","<p>I am developing on a Mac with Eclipse and have the skeleton for an appthat implements the standard framework callbacks (onCreate, onDestroy,onPause, etc..). When I set breakpoints in the callbacks the debuggerstops and displays a tab that says""ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,Intent)line:2477"" and in the tab page body there issome red text that says ""Source not found"" and a button that says""Edit Source Lookup Path..."".</p><p>I have tried adding several paths via ""Edit Source Lookup Path..."" butcan't see to find the one Eclipse is looking for.</p><h2>Can anyone point me in the right direction?</h2>","307480","","","","","2014-04-14 17:42:10","Android: ""Edit Source Lookup Path...""","<android><eclipse><source-code><android-source>","2","0","1","",""
"2565608","1","","","2010-04-02 07:50:28","1","985","<p>i am developing an application which has a general text entry form. Sowhile testing on my moto droid, i am facing a strange issue-- when itouch an input field ( which is at lower end of the screen) -- the onscreen keyboard pops up and hides the input field. So user have toenter blindly. So is this a sdk issue OR it is particular for droidsOR am i doing something wrong???</p><p>I have tested this same form on G1, Hero..i see no issues at all.Please help... </p><p>Layout xml file -- `    </p><pre><code>    &lt;TextView android:id=""@+id/textmsg"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:text=""Some text""        android:layout_marginTop=""10px"" android:textColor=""#ffffff""        android:textSize=""15px"" android:layout_marginLeft=""10px""        android:layout_marginRight=""10px"" /&gt;    &lt;EditText android:id=""@+id/textstreet1"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_marginTop=""15px""        android:layout_below=""@+id/textmsg"" android:textColor=""#000000""        android:textSize=""20px"" android:gravity=""center_vertical""        android:layout_marginLeft=""10px"" android:paddingLeft=""5px""        android:layout_marginRight=""10px"" /&gt;    &lt;EditText android:id=""@+id/textstreet2"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_marginTop=""2px""        android:layout_below=""@+id/textstreet1"" android:textColor=""#000000""        android:textSize=""20px"" android:gravity=""center_vertical""        android:layout_marginLeft=""10px"" android:paddingLeft=""5px""        android:layout_marginRight=""10px"" /&gt;    &lt;EditText android:id=""@+id/textcity"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_marginTop=""2px""        android:layout_below=""@+id/textstreet2"" android:textColor=""#000000""        android:textSize=""20px"" android:gravity=""center_vertical""        android:layout_marginLeft=""10px"" android:paddingLeft=""5px""        android:layout_marginRight=""10px"" /&gt;    &lt;EditText android:id=""@+id/textstate"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_marginTop=""2px""        android:layout_below=""@+id/textcity"" android:textColor=""#000000""        android:textSize=""20px"" android:gravity=""center_vertical""        android:layout_marginLeft=""10px"" android:paddingLeft=""5px""        android:layout_marginRight=""10px"" /&gt;    &lt;EditText android:id=""@+id/textzip"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_marginTop=""2px""        android:layout_below=""@+id/textstate"" android:textColor=""#000000""        android:textSize=""20px"" android:gravity=""center_vertical""        android:layout_marginLeft=""10px"" android:paddingLeft=""5px""        android:layout_marginRight=""10px"" /&gt;    &lt;EditText android:id=""@+id/textcrossstreet""        android:layout_width=""fill_parent"" android:layout_height=""wrap_content""        android:layout_marginTop=""2px"" android:layout_below=""@+id/textzip""        android:textColor=""#000000"" android:textSize=""20px"" android:gravity=""center_vertical""        android:layout_marginLeft=""10px"" android:paddingLeft=""5px""        android:layout_marginRight=""10px"" /&gt;    &lt;EditText android:id=""@+id/textdi"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_marginTop=""2px""        android:layout_below=""@+id/textcrossstreet"" android:textColor=""#000000""        android:textSize=""20px"" android:gravity=""center_vertical""        android:layout_marginLeft=""10px"" android:paddingLeft=""5px""        android:layout_marginRight=""10px"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>`</p>","152867","","152867","","2010-04-14 05:06:56","2012-08-06 13:08:41","Problem with onscreen keyboard on Droid","<android>","4","2","1","",""
"2566004","1","","","2010-04-02 09:52:13","1","1775","<p>I am new to android development.</p><p>I am creating an application in  which when app launches the edittextfield getfocus automatically and the keyboard pop-up.I want to hide the keyboard by default and show when edittextField get focus. I have tried this method but it's not working.</p><pre><code>InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);</code></pre>","307583","","1101070","","2012-03-07 02:58:14","2012-03-07 03:02:43","hide keyboard in android?","<java><android><keyboard>","2","0","","",""
"2566026","1","2642615","","2010-04-02 09:59:25","3","7163","<p>I am trying to post to my own test soap server (C#) with Android in combination with KSOAP2.</p><p>Now I have the specifications from the SOAP server, it expects:</p><pre><code>POST /SharingpointCheckBarcode.asmx HTTP/1.1Host: awc.test.trin-it.nlContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: ""http://tempuri.org/checkBarcode""&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""     xmlns:xsd=""http://www.w3.org/2001/XMLSchema""     xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""&gt;  &lt;soap:Header&gt;    &lt;AuthHeader xmlns=""http://tempuri.org/""&gt;      &lt;username&gt;string&lt;/username&gt;      &lt;password&gt;string&lt;/password&gt;    &lt;/AuthHeader&gt;  &lt;/soap:Header&gt;  &lt;soap:Body&gt;    &lt;checkBarcode xmlns=""http://tempuri.org/""&gt;      &lt;barcode&gt;string&lt;/barcode&gt;    &lt;/checkBarcode&gt;  &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;  </code></pre><p>But what Android KSOAP2 sends out:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;v:Envelope xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:d=""http://www.w3.org/2001/XMLSchema"" xmlns:c=""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:v=""http://schemas.xmlsoap.org/soap/envelope/""&gt;        &lt;v:Header /&gt;        &lt;v:Body&gt;            &lt;checkBarcode xmlns=""http://tempuri.org"" id=""o0"" c:root=""1""&gt;                &lt;username i:type=""d:string""&gt;test&lt;/username&gt;                &lt;password i:type=""d:string""&gt;test&lt;/password&gt;                &lt;barcode i:type=""d:string""&gt;2620813000301&lt;/barcode&gt;            &lt;/checkBarcode&gt;        &lt;/v:Body&gt;    &lt;/v:Envelope&gt;</code></pre><p>With this code:</p><pre><code>    try {    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);        request.addProperty(""username"", ""test"");        request.addProperty(""password"", ""test"");        request.addProperty(""barcode"", ""2620813000301"");        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);        envelope.dotNet = true;        envelope.encodingStyle = ""test"";        envelope.setOutputSoapObject(request);        AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport (URL);         androidHttpTransport.debug = true;        androidHttpTransport.setXmlVersionTag(""&lt;?xml version=\""1.0\"" encoding=\""utf-8\""?&gt;"");        androidHttpTransport.call(SOAP_ACTION, envelope);        Log.d(""MyAPP"", ""----------------- "" + androidHttpTransport.requestDump +""\r\n\r\n"" + androidHttpTransport.responseDump);        ((TextView)findViewById(R.id.lblStatus)).setText(androidHttpTransport.requestDump +""\r\n\r\n"" + androidHttpTransport.responseDump);    } catch(Exception E) {        ((TextView)findViewById(R.id.lblStatus)).setText(""ERROR:"" + E.getClass().getName() + "": "" + E.getMessage());    }</code></pre><p>The response I get back from the server is that there are no results found, so not an error, but when I test it with another App or PHP, it with the same data, it says it's OK.</p><p>I think it's because of the ","247007","","","","","2012-08-02 10:57:09","KSoap2 Android not valid SOAP","<android><soap>","1","0","1","",""
"2566079","1","2566138","","2010-04-02 10:11:04","3","2545","<p>Is there any way to specify the time intervals that the Location Manager broadcasts the current location?</p><p>I am using a method called startListening:</p><pre><code>public void startListening() {        locationManager.requestLocationUpdates(                LocationManager.GPS_PROVIDER,                 0,                 0,                 this        );}</code></pre><p>Thanks</p>","296810","","12388","","2010-04-02 10:17:43","2010-10-22 03:07:31","Specify intervals for Location Manager to broadcast current location in Android","<java><android><locationmanager>","3","0","","",""
"2566113","1","2567875","","2010-04-02 10:18:45","2","3125","<p>I have a GridView in which each row has a custom view. The grid view adapter has an array that keeps the custom view.</p><p>At click of a button, I want to remove a specific row from the Grid and while doing so I want animation on it. I have an AnimationListener.</p><p>When I remove the upper most row from the array and setAdapter in onAnimationEnd(). It works perfectly fine. But, when I remove any other row, it gives a NullPointerException in the main thread.</p><p>Here is the code snippet:</p><pre><code>Animation anim = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.pushout);anim.setAnimationListener(animListener);public void removeRow() {final CustomRowView customRowView = rowArray.get(clickedId);customRowView.startAnimation(anim);//Remove the row clickedrowArray.remove(clickedId);}private AnimationListener animListener = new AnimationListener() {        @Override        public void onAnimationStart(Animation animation) {}        @Override        public void onAnimationRepeat(Animation animation) {}        @Override        public void onAnimationEnd(Animation animation) {            gameGrid.setAdapter(adapter);    }}</code></pre><p>The exception thread is as follows:</p><pre><code>ERROR/AndroidRuntime(11503): java.lang.NullPointerExceptionat android.view.ViewGroup.dispatchDraw(ViewGroup.java:1227)at android.widget.AbsListView.dispatchDraw(AbsListView.java:1319)at android.view.View.draw(View.java:5944)at android.widget.AbsListView.draw(AbsListView.java:2121)at android.view.ViewGroup.drawChild(ViewGroup.java:1486)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)at android.view.View.draw(View.java:5841)at android.widget.FrameLayout.draw(FrameLayout.java:352)at android.view.ViewGroup.drawChild(ViewGroup.java:1486)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)at android.view.View.draw(View.java:5841)at android.widget.FrameLayout.draw(FrameLayout.java:352)at android.view.ViewGroup.drawChild(ViewGroup.java:1486)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)at android.view.View.draw(View.java:5841)at android.widget.FrameLayout.draw(FrameLayout.java:352)at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1847)at android.view.ViewRoot.draw(ViewRoot.java:1217)at android.view.ViewRoot.performTraversals(ViewRoot.java:1030)at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:3948)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Please help!!!</p>","284372","","284372","","2010-04-05 08:42:50","2010-04-05 08:42:50","GridView row remove and animation - Android","<android><gridview><animation><adapter>","1","2","","",""
"2566283","1","2566528","","2010-04-02 11:03:22","0","3582","<p>How do I add a View dynamically in an android widget?</p><p>I realize that the RemoteViews works as a container of updates, but the RemoteViews.addView is only available on API level 7 (and I want my widget to work on HTC Hero phones, which has API level 3).</p>","276052","","","","","2010-04-02 12:05:23","How do I add a View (dynamically) in an android widget? (API-level 3)","<android><gui><widget>","1","0","2","",""
"2566323","1","2566518","","2010-04-02 11:15:42","0","1112","<p>I am currently in the process of creating an application that records current location of a mobile device in intervals, displaying the route as a coloured line on the device in real-time. At the same time the application is storing the longitude and latitude in a SQLite database as I want the user to be able to bring up that specific route again.</p><p>The route has a primary key and each waypoint is linked to that route by a foreign key. </p><p>What would be the easiest way to display the saved route on the map?.</p>","296810","","73488","","2010-04-02 11:32:16","2010-04-02 12:56:06","Displaying Longitude and Latitude values stored in a SQLite db as a Route on a MapView in Android (Not Real Time)","<android><sqlite><google-maps>","2","0","","",""
"2566350","1","","","2010-04-02 11:23:38","36","22100","<p>I am in the process of creating an app that is similar to the build-in SMS app.</p><p>What I need:<br>- a service that is always running in the background<br>- every 5 min. the service checks the current location of the device and calls a web service<br>- if certain criteria are meet, the service should generate a notification (just like the SMS app)<br>- when the notification is clicked, the user is taken to the app (just like the SMS app)<br>- when the app is installed the service should be started<br>- when the device is rebooted, the service should be started  </p><p>What I have tried:<br>- running a regular service which worked just fine until android kills the service<br>- using the AlarmManager the make the 5 min. interval call to a service. But I was not able to make this work.</p><p>Any help would be greatly appreciated...</p><p>-Thomas</p>","307624","","","","","2011-07-19 22:08:24","How to always run a service in the background","<android>","2","0","26","",""
"2566371","1","2566758","","2010-04-02 11:29:03","3","2686","<p>How can we integrate Facebook in android?</p>","304961","","19750","","2010-04-02 11:38:17","2012-02-20 19:40:16","steps of integrating Facebook in android","<android><facebook>","6","1","2","",""
"2566408","1","","","2010-04-02 11:37:17","1","5503","<p>I'm using the Android APIDemo sample code. but my phone is G2  Android OS 2.1</p>","307623","","2727310","","2014-03-01 09:28:14","2014-03-01 09:28:14","Java.lang.RuntimeException:setParameters failed at android.hardware.camera.native_setParameter(Native Method)","<java><android><camera>","4","0","","",""
"2566430","1","2566613","","2010-04-02 11:42:51","15","9501","<p>Does somebody knows where the file with the actual stored SharedPreferences is located?</p>","304866","","","","","2010-04-02 12:32:08","SharedPreferences file","<android>","1","0","9","",""
"2566485","1","2567346","","2010-04-02 11:55:07","15","37121","<p>I have an application on appspot that works fine through regular browser, however when used through Android WebView, it cannot set and read cookies. I am not trying to get cookies ""outside"" this web application BTW, once the URL is visited by WebView, all processing, ids, etc. can stay there, all I need is session management inside that application. First screen also loads fine, so I know WebView + server interactivity is not broken. </p><p>I looked at WebSettings class, there was no call like setEnableCookies. </p><p>I load url like this:</p><pre><code>public class MyActivity extends Activity {  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);           WebView webview = new WebView(this);    setContentView(webview);          webview.loadUrl([MY URL]);  }  .. }</code></pre><p>Any ideas? </p>","278711","","278711","","2010-04-02 12:00:54","2013-04-23 15:10:45","WebView and Cookies on Android","<java><android>","3","2","17","",""
